Commit cad43dc8 by wangzhihui

Merge branch 'feature/strategy-center' of http://192.168.3.233:8090/saas_plus/dj…

…-car-life-system into feature/strategy-center
2 parents 4cd3dc78 9e51b826
...@@ -79,15 +79,28 @@ ...@@ -79,15 +79,28 @@
</div> </div>
<!-- 预警标签组 --> <!-- 预警标签组 -->
<div v-if="cardData.warningSummary && cardData.warningSummary.length > 0" class="alert-group"> <div v-if="cardData.warningRecords && cardData.warningRecords.length > 0" class="alert-group">
<div v-for="(item, index) in cardData.warningSummary" <div v-for="(item, index) in cardData.warningRecords"
:key="index" :key="index"
class="alert-tag" class="alert-tag"
:class="[item.includes('兜底预警') ? 'red' : 'orange']"> :class="[item.warningType == 4 || item.warningType == 2 ? 'red' : 'orange']">
<img alt="" <img alt=""
class="icon-img" class="icon-img"
:src="getAlertIcon(item)"> :src="getAlertIcon(item)">
<span style=" font-size: 13px;">{{ item }}</span> <el-tooltip :disabled="!warningOverflowMap[index]"
effect="dark"
placement="top"
popper-class="dark-tooltip">
<template #content>
<div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ getWarningDisplayText(item) }}
</div>
</template>
<span class="alert-text"
@mouseenter="checkWarningOverflow($event, index)">
{{ getWarningDisplayText(item) }}
</span>
</el-tooltip>
</div> </div>
</div> </div>
</div> </div>
...@@ -129,6 +142,16 @@ export default { ...@@ -129,6 +142,16 @@ export default {
type: Object, type: Object,
default: () => ({ startDate: null, endDate: null }), default: () => ({ startDate: null, endDate: null }),
}, },
// 当前业务 Tab
currentTab: {
type: Object,
default: () => ({ label: "延保", value: 1 }),
},
},
data() {
return {
warningOverflowMap: {},
};
}, },
methods: { methods: {
handleCheckboxChange() { handleCheckboxChange() {
...@@ -142,6 +165,8 @@ export default { ...@@ -142,6 +165,8 @@ export default {
const query = { const query = {
merchantNo: this.cardData.merchantNo, merchantNo: this.cardData.merchantNo,
storeName: this.cardData.storeName, storeName: this.cardData.storeName,
businessType: this.currentTab.value,
businessLabel: this.currentTab.label,
}; };
// 添加时间范围类型 // 添加时间范围类型
...@@ -167,15 +192,31 @@ export default { ...@@ -167,15 +192,31 @@ export default {
}, },
// 获取预警图标 // 获取预警图标
getAlertIcon(item) { getAlertIcon(item) {
// Tode: 数据未返回具体字段类型,因此经沟通智能暂时先通过字符串截取判断 const iconMap = {
return item.includes("兜底预警") 2: require("@/assets/strategy/icon-strategy-type01.png"),
? require("@/assets/strategy/icon-strategy-type01.png") 3: require("@/assets/strategy/icon-strategy-type02.png"),
: require("@/assets/strategy/icon-strategy-type02.png"); 4: require("@/assets/strategy/icon-strategy-type07.png"),
5: require("@/assets/strategy/icon-strategy-type08.png"),
};
return iconMap[item.warningType] || iconMap[2];
}, },
// 获取预警标签文本 // 获取预警标签文本
getAlertLabel(index) { getAlertLabel(index) {
return index === 0 ? "兜底指标:" : "生态预警:"; return index === 0 ? "兜底指标:" : "生态预警:";
}, },
getWarningDisplayText(item) {
return `${item.warningTypeName || ""}: ${item.warningText || ""}`;
},
checkWarningOverflow(event, index) {
const el = event.currentTarget;
if (!el)
return;
this.$set(
this.warningOverflowMap,
index,
el.scrollWidth > el.clientWidth,
);
},
}, },
}; };
</script> </script>
...@@ -268,8 +309,18 @@ $text-orange: #ff7d00; ...@@ -268,8 +309,18 @@ $text-orange: #ff7d00;
font-size: 12px; font-size: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
min-width: 0;
color: #606266; color: #606266;
.alert-text {
flex: 1;
min-width: 0;
font-size: 13px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
i { i {
margin-right: 6px; margin-right: 6px;
font-size: 14px; font-size: 14px;
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
class="col-item" class="col-item"
:span="8"> :span="8">
<MonitorCard :card-data="item" <MonitorCard :card-data="item"
:current-tab="currentTab"
:date-range="dateRange" :date-range="dateRange"
:index="index" :index="index"
:time-range-type="timeRangeType" :time-range-type="timeRangeType"
...@@ -348,7 +349,7 @@ export default { ...@@ -348,7 +349,7 @@ export default {
twoBrandIds: twoBrandIds || [], twoBrandIds: twoBrandIds || [],
regionalOperatorId: regionOps, regionalOperatorId: regionOps,
onlineOperatorId: onlineOps, onlineOperatorId: onlineOps,
periodType: this.timeRangeType.value, timeDimension: { 1: "W", 2: "M" }[this.timeRangeType.value],
businessType: this.currentTab.value, businessType: this.currentTab.value,
startDate: this.dateRange.startDate, startDate: this.dateRange.startDate,
monitorType: this.currentWatchType.value, monitorType: this.currentWatchType.value,
...@@ -378,8 +379,22 @@ export default { ...@@ -378,8 +379,22 @@ export default {
handleCheckboxChange(item, index) { handleCheckboxChange(item, index) {
this.cardList[index].checked = item.checked; this.cardList[index].checked = item.checked;
}, },
handleTabChange(tab) { async handleTabChange(tab) {
this.currentTab = tab; this.currentTab = tab;
const { roleName, uuid } = this.$store.state.d2admin.user.info?.detail || {};
this.filters = {
storeName: "",
isStrategySent: "",
groupId: "",
region: "",
provinceId: "",
brand: [],
regionOps: "",
onlineOps: roleName === "线上运营" && uuid ? uuid : "",
flightSupervisionId: "",
};
await this.getIndicatorTypeList();
this.getMonitorListData();
}, },
handleSearch(filters) { handleSearch(filters) {
let brandData = filters.brand; let brandData = filters.brand;
......
...@@ -134,6 +134,107 @@ const overviewList = [ ...@@ -134,6 +134,107 @@ const overviewList = [
], ],
}, },
]; ];
const overviewList02 = [
{
title: "车窗膜",
list: [
{
label: "成交数",
key: "windowFilmDealCount",
},
{
label: "单车采购产值",
key: "windowFilmPerCarOutput",
// subKey: "windowFilmConversionRate",
// unit: "%",
},
{
label: "渗透率",
key: "windowFilmPenetrationRate",
subKey: "windowFilmPenetrationBottomTarget",
unit: "%",
},
{
label: "触客转化率",
key: "windowFilmConversionRate",
subKey: "windowFilmConversionBottomTarget",
unit: "%",
},
{
label: "生态系数",
key: "windowFilmEcoCoefficient",
// subKey: "vehicleWarrantyConversionBottomTarget",
// unit: "%",
},
],
},
{
title: "车身膜",
list: [
{
label: "成交数",
key: "carBodyFilmDealCount",
},
{
label: "单车采购产值",
key: "carBodyFilmPerCarOutput",
// subKey: "safetyPackagePenetrationBottomTarget",
// unit: "%",
},
{
label: "渗透率",
key: "carBodyFilmPenetrationRate",
subKey: "carBodyFilmPenetrationBottomTarget",
unit: "%",
},
{
label: "触客转化率",
key: "carBodyFilmConversionRate",
subKey: "carBodyFilmConversionBottomTarget",
unit: "%",
},
{
label: "生态系数",
key: "carBodyFilmEcoCoefficient",
// subKey: "safetyPackageConversionBottomTarget",
// unit: "%",
},
],
},
{
title: "精品附件",
list: [
{
label: "成交数",
key: "accessoriesDealCount",
},
{
label: "单车采购产值",
key: "accessoriesPerCarOutput",
// subKey: "batteryWarrantyPenetrationBottomTarget",
// unit: "%",
},
{
label: "渗透率",
key: "accessoriesPenetrationRate",
subKey: "accessoriesPenetrationBottomTarget",
unit: "%",
},
{
label: "触客转化率",
key: "accessoriesConversionRate",
subKey: "accessoriesConversionBottomTarget",
unit: "%",
},
{
label: "生态系数",
key: "accessoriesEcoCoefficient",
// subKey: "batteryWarrantyConversionBottomTarget",
// unit: "%",
},
],
},
];
export default { export default {
name: "OverViewList", name: "OverViewList",
components: { HistoryTarget }, components: { HistoryTarget },
...@@ -153,6 +254,11 @@ export default { ...@@ -153,6 +254,11 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
// 业务类型,对应策略中心 currentTab.value(1-延保 2-轻改 3-权益)
businessType: {
type: [Number, String],
default: 1,
},
}, },
data() { data() {
return { return {
...@@ -162,10 +268,12 @@ export default { ...@@ -162,10 +268,12 @@ export default {
}, },
computed: { computed: {
overviewList() { overviewList() {
let { hasEHi, isHarmony } = this; const { isHarmony, businessType } = this;
let list = this.deepClone(overviewList); const biz = Number(businessType);
if (hasEHi) {
list.map((e, index) => { if (isHarmony && biz === 1) {
const list = this.deepClone(overviewList);
list.forEach((e, index) => {
e.list.push({ e.list.push({
label: "生态系数", label: "生态系数",
key: { key: {
...@@ -174,11 +282,17 @@ export default { ...@@ -174,11 +282,17 @@ export default {
2: "batteryWarrantyEcoCoefficient", 2: "batteryWarrantyEcoCoefficient",
3: "tireWarrantyEcoCoefficient", 3: "tireWarrantyEcoCoefficient",
}[index], }[index],
hide: !isHarmony, hide: true,
}); });
}); });
return list;
} }
return list;
if (biz === 2) {
return this.deepClone(overviewList02);
}
return [];
}, },
}, },
mounted() { mounted() {
......
...@@ -190,7 +190,9 @@ ...@@ -190,7 +190,9 @@
<div v-loading="staffRightLoading" <div v-loading="staffRightLoading"
class="staff-overview-item right"> class="staff-overview-item right">
<div class="content"> <div class="content">
<OverViewList :view-data="viewData"></OverViewList> <OverViewList :business-type="paramsInfo.bizs"
:view-data="viewData">
</OverViewList>
</div> </div>
<template v-for="(item, index) in rightWarningInfoList"> <template v-for="(item, index) in rightWarningInfoList">
<EarlyWarningTips :key="index" <EarlyWarningTips :key="index"
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="scene flex"> <div class="scene flex">
<img class="scene-icon" <img class="scene-icon"
:src="`${IMG_URL}scene-icon.webp`"> :src="`${IMG_URL}scene-icon.webp`">
业务:延保 业务:{{ businessLabel }}
</div> </div>
<el-button class="change-store" <el-button class="change-store"
type="text" type="text"
...@@ -138,6 +138,17 @@ export default { ...@@ -138,6 +138,17 @@ export default {
paramsInfo() { paramsInfo() {
return this.GET_PARAMS_INFO(); return this.GET_PARAMS_INFO();
}, },
businessLabel() {
const BIZ_LABEL_MAP = {
1: "延保",
2: "轻改",
3: "权益",
};
const routeLabel = this.$route.query.businessLabel;
if (routeLabel)
return routeLabel;
return BIZ_LABEL_MAP[this.paramsInfo.bizs] || "-";
},
}, },
mounted() { mounted() {
...@@ -158,9 +169,9 @@ export default { ...@@ -158,9 +169,9 @@ export default {
}); });
}, },
async getStrategyMerchantDetail(merchantNo = "") { async getStrategyMerchantDetail(merchantNo = "") {
let { merchantIds } = this.paramsInfo; let { merchantIds, bizs } = this.paramsInfo;
let data = await getStrategyMerchantDetail({ let data = await getStrategyMerchantDetail({
businessType: 1, businessType: bizs || 1,
merchantNo: merchantNo || merchantIds[0], merchantNo: merchantNo || merchantIds[0],
}); });
data.directSalesFlagText = { data.directSalesFlagText = {
......
...@@ -148,7 +148,8 @@ ...@@ -148,7 +148,8 @@
<div class="summary-overview-item right"> <div class="summary-overview-item right">
<div v-loading="summaryRightLoading" <div v-loading="summaryRightLoading"
class="content"> class="content">
<OverViewList has-e-hi <OverViewList :business-type="paramsInfo.bizs"
has-e-hi
:is-harmony="isHarmony" :is-harmony="isHarmony"
:view-data="viewData"> :view-data="viewData">
</OverViewList> </OverViewList>
......
...@@ -118,12 +118,14 @@ export default { ...@@ -118,12 +118,14 @@ export default {
// 在你的Vue组件的mounted钩子中添加事件监听 // 在你的Vue组件的mounted钩子中添加事件监听
mounted() { mounted() {
// 获取路由参数 merchantNo // 获取路由参数 merchantNo
const { merchantNo, storeName } = this.$route.query; const { merchantNo, storeName, businessType } = this.$route.query;
if (merchantNo || storeName) { if (merchantNo || storeName) {
console.log("接收到的 merchantNo:", merchantNo); console.log("接收到的 merchantNo:", merchantNo);
// 可以根据 merchantNo 更新 merchantInfo 或进行其他操作 // 可以根据 merchantNo 更新 merchantInfo 或进行其他操作
this.paramsInfo.merchantIds = [merchantNo || ""]; this.paramsInfo.merchantIds = [merchantNo || ""];
this.merchantName = storeName || ""; this.merchantName = storeName || "";
if (businessType)
this.paramsInfo.bizs = Number(businessType);
let { timeRangeType, startDate, endDate } = this.$route.query; let { timeRangeType, startDate, endDate } = this.$route.query;
if (timeRangeType || startDate || endDate) { if (timeRangeType || startDate || endDate) {
if (timeRangeType) { if (timeRangeType) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!