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 @@
</div>
<!-- 预警标签组 -->
<div v-if="cardData.warningSummary && cardData.warningSummary.length > 0" class="alert-group">
<div v-for="(item, index) in cardData.warningSummary"
<div v-if="cardData.warningRecords && cardData.warningRecords.length > 0" class="alert-group">
<div v-for="(item, index) in cardData.warningRecords"
:key="index"
class="alert-tag"
:class="[item.includes('兜底预警') ? 'red' : 'orange']">
:class="[item.warningType == 4 || item.warningType == 2 ? 'red' : 'orange']">
<img alt=""
class="icon-img"
: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>
......@@ -129,6 +142,16 @@ export default {
type: Object,
default: () => ({ startDate: null, endDate: null }),
},
// 当前业务 Tab
currentTab: {
type: Object,
default: () => ({ label: "延保", value: 1 }),
},
},
data() {
return {
warningOverflowMap: {},
};
},
methods: {
handleCheckboxChange() {
......@@ -142,6 +165,8 @@ export default {
const query = {
merchantNo: this.cardData.merchantNo,
storeName: this.cardData.storeName,
businessType: this.currentTab.value,
businessLabel: this.currentTab.label,
};
// 添加时间范围类型
......@@ -167,15 +192,31 @@ export default {
},
// 获取预警图标
getAlertIcon(item) {
// Tode: 数据未返回具体字段类型,因此经沟通智能暂时先通过字符串截取判断
return item.includes("兜底预警")
? require("@/assets/strategy/icon-strategy-type01.png")
: require("@/assets/strategy/icon-strategy-type02.png");
const iconMap = {
2: require("@/assets/strategy/icon-strategy-type01.png"),
3: 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) {
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>
......@@ -268,8 +309,18 @@ $text-orange: #ff7d00;
font-size: 12px;
display: flex;
align-items: center;
min-width: 0;
color: #606266;
.alert-text {
flex: 1;
min-width: 0;
font-size: 13px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
i {
margin-right: 6px;
font-size: 14px;
......
......@@ -73,6 +73,7 @@
class="col-item"
:span="8">
<MonitorCard :card-data="item"
:current-tab="currentTab"
:date-range="dateRange"
:index="index"
:time-range-type="timeRangeType"
......@@ -348,7 +349,7 @@ export default {
twoBrandIds: twoBrandIds || [],
regionalOperatorId: regionOps,
onlineOperatorId: onlineOps,
periodType: this.timeRangeType.value,
timeDimension: { 1: "W", 2: "M" }[this.timeRangeType.value],
businessType: this.currentTab.value,
startDate: this.dateRange.startDate,
monitorType: this.currentWatchType.value,
......@@ -378,8 +379,22 @@ export default {
handleCheckboxChange(item, index) {
this.cardList[index].checked = item.checked;
},
handleTabChange(tab) {
async handleTabChange(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) {
let brandData = filters.brand;
......
......@@ -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 {
name: "OverViewList",
components: { HistoryTarget },
......@@ -153,6 +254,11 @@ export default {
type: Boolean,
default: false,
},
// 业务类型,对应策略中心 currentTab.value(1-延保 2-轻改 3-权益)
businessType: {
type: [Number, String],
default: 1,
},
},
data() {
return {
......@@ -162,10 +268,12 @@ export default {
},
computed: {
overviewList() {
let { hasEHi, isHarmony } = this;
let list = this.deepClone(overviewList);
if (hasEHi) {
list.map((e, index) => {
const { isHarmony, businessType } = this;
const biz = Number(businessType);
if (isHarmony && biz === 1) {
const list = this.deepClone(overviewList);
list.forEach((e, index) => {
e.list.push({
label: "生态系数",
key: {
......@@ -174,11 +282,17 @@ export default {
2: "batteryWarrantyEcoCoefficient",
3: "tireWarrantyEcoCoefficient",
}[index],
hide: !isHarmony,
hide: true,
});
});
return list;
}
return list;
if (biz === 2) {
return this.deepClone(overviewList02);
}
return [];
},
},
mounted() {
......
......@@ -190,7 +190,9 @@
<div v-loading="staffRightLoading"
class="staff-overview-item right">
<div class="content">
<OverViewList :view-data="viewData"></OverViewList>
<OverViewList :business-type="paramsInfo.bizs"
:view-data="viewData">
</OverViewList>
</div>
<template v-for="(item, index) in rightWarningInfoList">
<EarlyWarningTips :key="index"
......
......@@ -22,7 +22,7 @@
<div class="scene flex">
<img class="scene-icon"
:src="`${IMG_URL}scene-icon.webp`">
业务:延保
业务:{{ businessLabel }}
</div>
<el-button class="change-store"
type="text"
......@@ -138,6 +138,17 @@ export default {
paramsInfo() {
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() {
......@@ -158,9 +169,9 @@ export default {
});
},
async getStrategyMerchantDetail(merchantNo = "") {
let { merchantIds } = this.paramsInfo;
let { merchantIds, bizs } = this.paramsInfo;
let data = await getStrategyMerchantDetail({
businessType: 1,
businessType: bizs || 1,
merchantNo: merchantNo || merchantIds[0],
});
data.directSalesFlagText = {
......
......@@ -148,7 +148,8 @@
<div class="summary-overview-item right">
<div v-loading="summaryRightLoading"
class="content">
<OverViewList has-e-hi
<OverViewList :business-type="paramsInfo.bizs"
has-e-hi
:is-harmony="isHarmony"
:view-data="viewData">
</OverViewList>
......
......@@ -118,12 +118,14 @@ export default {
// 在你的Vue组件的mounted钩子中添加事件监听
mounted() {
// 获取路由参数 merchantNo
const { merchantNo, storeName } = this.$route.query;
const { merchantNo, storeName, businessType } = this.$route.query;
if (merchantNo || storeName) {
console.log("接收到的 merchantNo:", merchantNo);
// 可以根据 merchantNo 更新 merchantInfo 或进行其他操作
this.paramsInfo.merchantIds = [merchantNo || ""];
this.merchantName = storeName || "";
if (businessType)
this.paramsInfo.bizs = Number(businessType);
let { timeRangeType, startDate, endDate } = this.$route.query;
if (timeRangeType || startDate || endDate) {
if (timeRangeType) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!