Commit ed858a92 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 71f77149 d6748ebe
...@@ -415,7 +415,6 @@ export function getMonitorTypeDictList(data = {}) { ...@@ -415,7 +415,6 @@ export function getMonitorTypeDictList(data = {}) {
return request(data, RequestMethods.POST); return request(data, RequestMethods.POST);
} }
// 策略分析模块
/** /**
* 策略分析-总数统计 * 策略分析-总数统计
*/ */
...@@ -648,6 +647,15 @@ export function getStrategyRecordStaticByCondition(data = {}) { ...@@ -648,6 +647,15 @@ export function getStrategyRecordStaticByCondition(data = {}) {
export function getStrategyMerchantAnalysisIndexHistory(data = {}) { export function getStrategyMerchantAnalysisIndexHistory(data = {}) {
data.method = "dj.api.strategy.merchant.analysis.index.history"; data.method = "dj.api.strategy.merchant.analysis.index.history";
return request(data, RequestMethods.POST); return request(data, RequestMethods.POST);
}
/**
* 招聘概况
*/
export function getRecruitmentDemandOverview(data = {}) {
data.method = "dj.staff.api.recruitment.demand.merchant.overview";
return request(data, RequestMethods.POST);
} }
/** /**
...@@ -659,9 +667,56 @@ export function getRecruitmentDemandOverview(data = {}) { ...@@ -659,9 +667,56 @@ export function getRecruitmentDemandOverview(data = {}) {
} }
/** /**
* 项目组选择列表
*/
export function getGroupListAPI(data = {}) {
data.method = "dj.api.strategy.warning.group.list";
return request(data, RequestMethods.POST);
}
/**
* 预警类型下拉列表
*/
export function getWarningTypeList(data = {}) {
data.method = "dj.api.strategy.warning.type.list";
return request(data, RequestMethods.POST);
}
/**
* 预警指标下拉列表
*/
export function getWarningMetricList(data = {}) {
data.method = "dj.api.strategy.warning.metric.list";
return request(data, RequestMethods.POST);
}
/**
* 门店预警汇总列表
*/
export function getWarningSummaryList(data = {}) {
data.method = "dj.api.strategy.warning.summary";
return request(data, RequestMethods.POST);
}
/**
* 区域运营执行人员列表 * 区域运营执行人员列表
*/ */
export function getStrategyShopMerchantOperators(data = {}) { export function getStrategyShopMerchantOperators(data = {}) {
data.method = "dj.api.strategy.shop.merchant.operators"; data.method = "dj.api.strategy.shop.merchant.operators";
return request(data, RequestMethods.POST); return request(data, RequestMethods.POST);
} }
/*
* 门店预警员工详情
*/
export function getWarningStoreStaffDetail(data = {}) {
data.method = "dj.api.strategy.warning.store.staff.detail";
return request(data, RequestMethods.POST);
}
/**
* 策略分析-效果分析
*/
export function getStrategyAnalysisEffect(data = {}) {
data.method = "dj.api.strategy.analysis.effect";
return request(data, RequestMethods.POST);
}
<template>
<baseDialog class="effect-detail-dialog"
:config="config"
:dialog-config="dialogConfig.config"
:is-show.sync="dialogShow">
<div v-loading="loading"
class="content">
<div class="block">
<div class="business-box">
<img class="bg"
src="@/assets/strategy/strategy-analyse-bg.png">
<div class="left">
<div class="business-title">
当前周期
</div>
<template v-for="(item, index) in businessForm">
<div :key="index"
class="business-item">
<div class="label">
{{ item.label }}
</div>
<div class="value flex">
<template v-if="businessDetail.beforeLearning[item.key] != null">
{{ businessDetail.beforeLearning[item.key] }}<template v-if="item.unit">
{{ item.unit }}
</template>
</template>
<template v-else>
-
</template>
</div>
</div>
</template>
</div>
<div class="right">
<div class="business-title">
下一周期
</div>
<template v-for="(item, index) in businessForm">
<div :key="index"
class="business-item">
<div class="label">
{{ item.label }}
</div>
<div class="value flex">
<template v-if="businessDetail.afterLearning[item.key] != null">
{{ businessDetail.afterLearning[item.key] }}<template v-if="item.unit">
{{ item.unit }}
</template>
<img class="arrow"
:src="getIconSrc(formatIsRatio(item.key))" />
</template>
<template v-else>
-
</template>
</div>
</div>
</template>
</div>
</div>
</div>
</div>
</baseDialog>
</template>
<script>
import { getStrategyAnalysisEffect } from "@/api/earlyWarningManager";
const decline = require("@/assets/strategy/decline.png");
const just01 = require("@/assets/strategy/just01.png");
const rise = require("@/assets/strategy/rise.png");
export default {
name: "EffectDetailDialog",
props: {
visible: {
type: Boolean,
default: false,
},
row: {
type: Object,
default: () => ({}),
},
searchParams: {
type: Object,
default: () => ({}),
},
},
data() {
return {
loading: false,
config: {
isShowFooter: false,
cancel_name: "关闭",
hideConfirmBtn: true,
},
dialogConfig: {
config: {
title: "效果分析",
width: "720px",
},
},
businessDetail: {
beforeLearning: {},
afterLearning: {},
},
businessForm: [
{
label: "转化率",
key: "conversionRate",
unit: "%",
},
{
label: "客单价",
key: "avgOrderAmount",
},
{
label: "套餐销售率",
key: "packageSalesRate",
unit: "%",
},
{
label: "整车延保渗透率",
key: "wholeVehicleWarrantyPenetration",
unit: "%",
},
{
label: "安心包渗透率",
key: "anxinPackagePenetration",
unit: "%",
},
{
label: "电池渗透率",
key: "batteryPenetration",
unit: "%",
},
],
};
},
computed: {
dialogShow: {
get() {
return this.visible;
},
set() {
this.close();
},
},
},
watch: {
visible(val) {
if (val) {
this.fetchDetail();
}
},
},
methods: {
close() {
this.$emit("update:visible", false);
},
getIconSrc(name) {
return {
rise,
decline,
just01,
}[name] ?? "";
},
formatIsRatio(key) {
const { beforeLearning, afterLearning } = this.businessDetail;
const b = beforeLearning[key];
const a = afterLearning[key];
return a < b ? "decline" : b === a ? "just01" : "rise";
},
async fetchDetail() {
if (!this.row?.merchantId4s) {
return;
}
this.loading = true;
try {
const data = await getStrategyAnalysisEffect({
merchantId: this.row.merchantId4s,
...this.searchParams,
});
this.businessDetail = {
beforeLearning: data?.beforeLearning || data?.beforePeriod || {},
afterLearning: data?.afterLearning || data?.afterPeriod || {},
};
} catch (error) {
console.error("获取效果分析详情失败:", error);
this.businessDetail = {
beforeLearning: {},
afterLearning: {},
};
this.$message.error("获取效果分析详情失败,请稍后重试");
} finally {
this.loading = false;
}
},
},
};
</script>
<style scoped lang="scss">
.flex {
display: flex;
align-items: center;
}
.arrow {
width: 16px;
height: 16px;
transform: translateY(1px);
}
.content {
min-height: 289px;
}
.block {
&-title {
padding: 0 0 8px;
}
&-icon {
width: 16px;
height: 16px;
margin-right: 4px;
}
.business-box {
height: 289px;
border-radius: 4px;
position: relative;
display: flex;
box-sizing: border-box;
padding: 10px;
.bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.left,
.right {
width: 59%;
display: flex;
flex-direction: column;
gap: 14px;
position: relative;
z-index: 2;
.business-title {
padding-top: 16px;
color: #1d1d1d;
font-size: 14px;
font-weight: 500;
}
.business-item {
display: flex;
align-items: center;
font-size: 13px;
.label {
width: 104px;
color: #888888;
}
.value {
color: #1d1d1d;
}
}
}
.left {
box-sizing: border-box;
padding-left: 15%;
}
.right {
border-radius: 4px;
background: #ffffffcc;
padding-left: 24px;
.business-item {
.value {
color: #2a58ad;
font-size: 16px;
font-weight: 500;
}
}
}
}
}
</style>
...@@ -168,10 +168,21 @@ ...@@ -168,10 +168,21 @@
<span v-else>{{ scope.columnsObj.formatter(scope.scope) }}</span> <span v-else>{{ scope.columnsObj.formatter(scope.scope) }}</span>
</div> </div>
</template> </template>
<!-- 效果分析 -->
<template #nextCycleIndicator="scope">
<span class="effect-cell"
@click="handleEffectDetail(scope.scope)">
{{ scope.columnsObj.formatter(scope.scope) }}
</span>
</template>
</d2-table> </d2-table>
</div> </div>
</div> </div>
</div> </div>
<EffectDetailDialog :row="effectDetailRow"
:search-params="effectSearchParams"
:visible.sync="effectDetailVisible" />
</div> </div>
</template> </template>
...@@ -183,6 +194,7 @@ import { deepClone } from "@/common/util"; ...@@ -183,6 +194,7 @@ import { deepClone } from "@/common/util";
import calendarCustom from "../strategyCentre/compoments/clendarCustom.vue"; import calendarCustom from "../strategyCentre/compoments/clendarCustom.vue";
import HeaderCustom from "../strategyCentre/compoments/headerCustom.vue"; import HeaderCustom from "../strategyCentre/compoments/headerCustom.vue";
import SelectCustom from "../strategyCentre/compoments/selectCustom.vue"; import SelectCustom from "../strategyCentre/compoments/selectCustom.vue";
import EffectDetailDialog from "./components/EffectDetailDialog.vue";
import OnlineOperList from "./components/OnlineOperList"; import OnlineOperList from "./components/OnlineOperList";
import StrategyTypeChart from "./components/StrategyTypeChart/index.vue"; import StrategyTypeChart from "./components/StrategyTypeChart/index.vue";
// 盯防类型图标配置(配置化管理,易于扩展) // 盯防类型图标配置(配置化管理,易于扩展)
...@@ -210,6 +222,7 @@ export default { ...@@ -210,6 +222,7 @@ export default {
CalendarCustom: calendarCustom, CalendarCustom: calendarCustom,
StrategyTypeChart, StrategyTypeChart,
OnlineOperList, OnlineOperList,
EffectDetailDialog,
}, },
data() { data() {
return { return {
...@@ -217,8 +230,8 @@ export default { ...@@ -217,8 +230,8 @@ export default {
currentTab: { label: "延保", value: 1 }, currentTab: { label: "延保", value: 1 },
tabs: [ tabs: [
{ label: "延保", value: 1 }, { label: "延保", value: 1 },
{ label: "权益", value: 2 }, { label: "权益", value: 3 },
{ label: "轻改", value: 3 }, { label: "轻改", value: 2 },
], ],
// 时间范围类型 // 时间范围类型
timeRangeType: { label: "月", value: 2 }, timeRangeType: { label: "月", value: 2 },
...@@ -261,6 +274,8 @@ export default { ...@@ -261,6 +274,8 @@ export default {
getListApi: null, // 在 mounted 中初始化 getListApi: null, // 在 mounted 中初始化
// 初始化标志,用于避免初始化阶段 watch 触发重复刷新 // 初始化标志,用于避免初始化阶段 watch 触发重复刷新
isInitializing: false, isInitializing: false,
effectDetailVisible: false,
effectDetailRow: {},
// 策略类型分布运营人员筛选防抖定时器 // 策略类型分布运营人员筛选防抖定时器
_strategyTypeOperatorTimer: null, _strategyTypeOperatorTimer: null,
tableParams: { tableParams: {
...@@ -361,8 +376,10 @@ export default { ...@@ -361,8 +376,10 @@ export default {
label: "效果分析", label: "效果分析",
prop: "nextCycleIndicator", prop: "nextCycleIndicator",
minWidth: 120, minWidth: 120,
type: "slot",
addHtml: "nextCycleIndicator",
formatter: (cellValue) => { formatter: (cellValue) => {
if (cellValue.nextCycleIndicator == null && cellValue.nextCycleIndicator == undefined) { if (cellValue.nextCycleIndicator == null || cellValue.nextCycleIndicator === undefined) {
return "-"; return "-";
} }
return `${cellValue.nextCycleIndicator}${this.currentWatchType.value == 1 ? "%" : ""}`; return `${cellValue.nextCycleIndicator}${this.currentWatchType.value == 1 ? "%" : ""}`;
...@@ -389,6 +406,16 @@ export default { ...@@ -389,6 +406,16 @@ export default {
}; };
}); });
}, },
effectSearchParams() {
return {
startDate: this.startDate,
endDate: this.endDate,
businessType: this.currentTab.value,
monitorType: this.currentWatchType.value || null,
metricTypeId: this.currentIndicatorType.value || null,
periodType: this.timeRangeType.value,
};
},
// 指标类型选项(自动根据当前盯防类型生成) // 指标类型选项(自动根据当前盯防类型生成)
indicatorTypeOptions() { indicatorTypeOptions() {
// 查找当前选中的盯防类型对应的数据 // 查找当前选中的盯防类型对应的数据
...@@ -800,6 +827,10 @@ export default { ...@@ -800,6 +827,10 @@ export default {
this.loading.onlineOperData = false; this.loading.onlineOperData = false;
} }
}, },
handleEffectDetail(row) {
this.effectDetailRow = row;
this.effectDetailVisible = true;
},
handleViewDetail(e) { handleViewDetail(e) {
// 构建查询参数 // 构建查询参数
const query = { const query = {
...@@ -962,6 +993,11 @@ $bg-white: #fff; ...@@ -962,6 +993,11 @@ $bg-white: #fff;
} }
} }
.effect-cell {
color: #2a58ad;
cursor: pointer;
}
::v-deep .emptyBg { ::v-deep .emptyBg {
margin-top: 20px; margin-top: 20px;
color: #999ea8; color: #999ea8;
......
...@@ -67,13 +67,13 @@ ...@@ -67,13 +67,13 @@
</div> </div>
<div class="filter-group"> <div class="filter-group">
<span class="label">区域督导:</span> <span class="label">区域督导:</span>
<el-select v-model="formData.onlineOps" <el-select v-model="formData.supervisorOps"
class="filter-select" class="filter-select"
clearable clearable
filterable filterable
placeholder="全部" placeholder="全部"
size="small"> size="small">
<el-option v-for="item in onlineOpsOptions" <el-option v-for="item in supervisorOpsOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
...@@ -97,10 +97,11 @@ export default { ...@@ -97,10 +97,11 @@ export default {
type: Object, type: Object,
default: () => ({ default: () => ({
region: "", region: "",
provinceId: "", provinceId: null,
brand: [], brand: [],
regionOps: "", regionOps: "all",
onlineOps: "", onlineOps: null,
supervisorOps: null,
}), }),
}, },
brandOptions: { brandOptions: {
...@@ -119,6 +120,10 @@ export default { ...@@ -119,6 +120,10 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
supervisorOpsOptions: {
type: Array,
default: () => [],
},
cascaderProps: { cascaderProps: {
type: Object, type: Object,
default: () => ({}), default: () => ({}),
...@@ -220,11 +225,17 @@ $text-sub: #333333; ...@@ -220,11 +225,17 @@ $text-sub: #333333;
.label { .label {
flex-shrink: 0; flex-shrink: 0;
width: 72px; width: 92px;
font-size: 14px; font-size: 14px;
color: $text-sub; color: $text-sub;
text-align: right; text-align: right;
margin-right: 12px; margin-right: 12px;
&::before {
content: "*";
color: #f56c6c;
margin-right: 4px;
}
} }
.filter-select { .filter-select {
......
<template> <template>
<div class="top-header"> <div class="top-header">
<!-- 左侧 Tabs --> <!-- Tabs -->
<div ref="tabsNav" class="tabs-nav"> <div ref="tabsNav" class="tabs-nav">
<div v-for="(tab, index) in tabs" <div v-for="(tab, index) in tabs"
:key="getTabKey(tab, index)" :key="getTabKey(tab, index)"
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</div> </div>
</div> </div>
<!-- 右侧 筛选区 + 按钮 --> <!-- 筛选区 + 按钮 -->
<div v-if="showRightArea" class="filter-area"> <div v-if="showRightArea" class="filter-area">
<div class="filter-group"> <div class="filter-group">
<span class="label">门店名称:</span> <span class="label">门店名称:</span>
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
filterable filterable
placeholder="全部" placeholder="全部"
size="small"> size="small">
<el-option v-for="item in provinceOptions" <el-option v-for="item in groupOptions"
:key="item.code" :key="item.value"
:label="item.name" :label="item.label"
:value="item.code"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
...@@ -114,21 +114,11 @@ ...@@ -114,21 +114,11 @@
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<div class="filter-actions-right">
<div class="filter-group filter-more" @click="openFiltrateDialog"> <div class="filter-group filter-more" @click="openFiltrateDialog">
<span class="filter-more-text">更多筛选</span> <span class="filter-more-text">更多筛选</span>
<i class="el-icon-arrow-right filter-more-icon"></i> <i class="el-icon-arrow-right filter-more-icon"></i>
</div> </div>
<FiltrateDialog :brand-options="brandOptions"
:cascader-props="cascaderProps"
:filters="localFilters"
:online-ops-options="onlineOpsOptions"
:province-options="provinceOptions"
:region-ops-options="regionOpsOptions"
:visible.sync="filtrateDialogVisible"
@confirm="handleFiltrateConfirm" />
<!-- 按钮组 -->
<div class="btn-group"> <div class="btn-group">
<el-button class="btn-search" <el-button class="btn-search"
size="small" size="small"
...@@ -143,6 +133,17 @@ ...@@ -143,6 +133,17 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<FiltrateDialog :brand-options="brandOptions"
:cascader-props="cascaderProps"
:filters="localFilters"
:online-ops-options="onlineOpsOptions"
:province-options="provinceOptions"
:region-ops-options="regionOpsOptions"
:supervisor-ops-options="supervisorOpsOptions"
:visible.sync="filtrateDialogVisible"
@confirm="handleFiltrateConfirm" />
</div>
</div> </div>
</template> </template>
...@@ -188,6 +189,10 @@ export default { ...@@ -188,6 +189,10 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
groupOptions: {
type: Array,
default: () => [],
},
// 城市选项数据 // 城市选项数据
cityOptions: { cityOptions: {
type: Array, type: Array,
...@@ -203,6 +208,11 @@ export default { ...@@ -203,6 +208,11 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
// 区域督导选项数据
supervisorOpsOptions: {
type: Array,
default: () => [],
},
// 控制筛选区域是否展示 // 控制筛选区域是否展示
showRightArea: { showRightArea: {
type: Boolean, type: Boolean,
...@@ -329,12 +339,13 @@ export default { ...@@ -329,12 +339,13 @@ export default {
this.localFilters = { this.localFilters = {
...this.localFilters, ...this.localFilters,
region: dialogFilters.region ?? this.localFilters.region, region: dialogFilters.region ?? this.localFilters.region,
provinceId: dialogFilters.provinceId || "", provinceId: dialogFilters.provinceId ?? null,
brand: Array.isArray(dialogFilters.brand) brand: Array.isArray(dialogFilters.brand)
? dialogFilters.brand.map(item => (Array.isArray(item) ? [...item] : item)) ? dialogFilters.brand.map(item => (Array.isArray(item) ? [...item] : item))
: [], : [],
regionOps: dialogFilters.regionOps || "", regionOps: dialogFilters.regionOps ?? "all",
onlineOps: dialogFilters.onlineOps || "", onlineOps: dialogFilters.onlineOps ?? null,
supervisorOps: dialogFilters.supervisorOps ?? null,
}; };
}, },
handleSearch() { handleSearch() {
...@@ -373,10 +384,9 @@ $text-orange: #ff7d00; ...@@ -373,10 +384,9 @@ $text-orange: #ff7d00;
// ================= Top Header ================= // ================= Top Header =================
.top-header { .top-header {
background: #fff; background: #fff;
height: 54px;
display: flex; display: flex;
align-items: center; flex-direction: column;
padding: 0 24px; align-items: stretch;
border-radius: 4px; border-radius: 4px;
margin-bottom: 1px; margin-bottom: 1px;
position: sticky; position: sticky;
...@@ -389,10 +399,11 @@ $text-orange: #ff7d00; ...@@ -389,10 +399,11 @@ $text-orange: #ff7d00;
.tabs-nav { .tabs-nav {
position: relative; position: relative;
display: flex; display: flex;
height: 100%; flex-shrink: 0;
border-bottom: 1px solid #e5e5e5;
padding: 17px 24px;
.tab-item { .tab-item {
height: 100%; height: 34px;
width: 54px; width: 54px;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -427,32 +438,52 @@ $text-orange: #ff7d00; ...@@ -427,32 +438,52 @@ $text-orange: #ff7d00;
.filter-area { .filter-area {
display: flex; display: flex;
flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-start;
margin-left: auto; width: 100%;
min-width: 0;
box-sizing: border-box;
padding: 16px 24px;
gap: 8px 0;
.filter-group { .filter-group {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 24px; margin-right: 24px;
max-width: 100%;
flex-shrink: 1;
min-width: 0;
.label { .label {
font-size: 14px; font-size: 14px;
color: $text-sub; color: $text-sub;
margin-right: 8px; margin-right: 8px;
white-space: nowrap; white-space: nowrap;
flex-shrink: 0;
} }
.filter-select { .filter-select {
width: 123px; width: 300px;
max-width: 100%;
flex-shrink: 1;
min-width: 0;
} }
.filter-select-brand { .filter-select-brand {
min-width: 120px; min-width: 120px;
width: auto; width: auto;
} }
}
.filter-actions-right {
display: flex;
align-items: center;
gap: 12px;
margin-left: auto;
flex-shrink: 0;
&.filter-more { .filter-more {
width: 88px; width: 88px;
height: 32px; height: 34px;
margin-right: 24px; margin-right: 0;
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
color: $text-sub-2; color: $text-sub-2;
font-size: 14px; font-size: 14px;
...@@ -461,6 +492,7 @@ $text-orange: #ff7d00; ...@@ -461,6 +492,7 @@ $text-orange: #ff7d00;
flex-shrink: 0; flex-shrink: 0;
box-sizing: border-box; box-sizing: border-box;
border-radius: 4px; border-radius: 4px;
.filter-more-text { .filter-more-text {
line-height: 1; line-height: 1;
} }
......
<template> <template>
<div class="monitor-card" :class="{ 'is-checked': cardData.checked }"> <div class="monitor-card" :class="{ 'is-checked': cardData.checked }">
<div class="card-head"> <div class="card-head">
<el-tooltip effect="dark" <el-tooltip :disabled="!cardData.storeName"
effect="dark"
placement="bottom" placement="bottom"
popper-class="dark-tooltip" popper-class="dark-tooltip">
:disabled="!cardData.storeName">
<template #content> <template #content>
<div style="width:236px;line-height:1.6;word-break:break-all;"> <div style="width:236px;line-height:1.6;word-break:break-all;">
{{ cardData.storeName }} {{ cardData.storeName }}
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
<div class="card-body" @click="handleViewDetail"> <div class="card-body" @click="handleViewDetail">
<div class="row-item"> <div class="row-item">
<span class="label">主营品牌:</span> <span class="label">主营品牌:</span>
<el-tooltip effect="dark" <el-tooltip :disabled="!cardData.mainBrands"
effect="dark"
placement="top" placement="top"
popper-class="dark-tooltip" popper-class="dark-tooltip">
:disabled="!cardData.mainBrands">
<template #content> <template #content>
<div style="max-width:236px;line-height:1.6;word-break:break-all;"> <div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ cardData.mainBrands }} {{ cardData.mainBrands }}
...@@ -84,9 +84,9 @@ ...@@ -84,9 +84,9 @@
:key="index" :key="index"
class="alert-tag" class="alert-tag"
:class="[item.includes('兜底预警') ? 'red' : 'orange']"> :class="[item.includes('兜底预警') ? 'red' : 'orange']">
<img :src="getAlertIcon(item)" <img alt=""
alt="" class="icon-img"
class="icon-img"> :src="getAlertIcon(item)">
<span style=" font-size: 13px;">{{ item }}</span> <span style=" font-size: 13px;">{{ item }}</span>
</div> </div>
</div> </div>
...@@ -95,10 +95,10 @@ ...@@ -95,10 +95,10 @@
<div class="card-foot" @click="handleViewDetail"> <div class="card-foot" @click="handleViewDetail">
<span class="info">共{{ cardData.warningTotalCount }}项预警</span> <span class="info">共{{ cardData.warningTotalCount }}项预警</span>
<span class="link"> <span class="link">
查看详情 <img src="@/assets/strategy/icon-strategy-arrow-r.png" 查看详情 <img alt=""
alt="" class="icon-arrow"
srcset="" src="@/assets/strategy/icon-strategy-arrow-r.png"
class="icon-arrow"> srcset="">
</span> </span>
</div> </div>
</div> </div>
......
<template> <template>
<el-popover <el-dropdown :disabled="disabled"
placement="bottom-start" placement="bottom-start"
:width="popoverWidth"
trigger="click" trigger="click"
popper-class="pure-popover" @command="handleSelect">
v-model="popoverVisible" <div class="icon-text-btn"
> :class="{ 'has-selected': value && value.label && value.label !== defaultText, 'is-disabled': disabled }">
<ul class="popover-list"> <img v-if="triggerIconType === 'image'"
<li
v-for="(item, index) in options"
:key="index"
:class="{ 'is-selected': isSelected(item) }"
@click="handleSelect(item)"
style="font-size: 14px;"
>
<!-- 支持图片图标 -->
<img
v-if="item.iconUrl"
:src="item.iconUrl"
alt="" alt=""
class="icon-img" class="icon-img"
> :src="triggerIcon">
<!-- 支持字体图标 --> <i v-else-if="triggerIconType === 'icon'"
<i :class="triggerIcon">
v-else-if="item.icon" </i>
:class="item.icon" <span>{{ label }}:{{ currentValue }}</span>
></i> </div>
{{ item.label }} <template #dropdown>
</li> <el-dropdown-menu class="select-custom-dropdown"
</ul> :style="{ minWidth: `${popoverWidth}px` }">
<div <el-dropdown-item v-for="(item, index) in options"
slot="reference" :key="index"
class="icon-text-btn" :class="{ 'is-selected': isSelected(item) }"
:class="{ 'has-selected': value && value.label && value.label !== defaultText }" :command="item">
> <div class="icon-img">
<!-- 触发按钮图标:支持图片和字体图标 --> <img v-if="item.iconUrl"
<img
v-if="triggerIconType === 'image'"
:src="triggerIcon"
alt="" alt=""
class="icon-img" class="icon-img"
> :src="item.iconUrl">
<i <i v-else-if="item.icon"
v-else-if="triggerIconType === 'icon'" :class="item.icon">
:class="triggerIcon" </i>
></i>
<span>{{ label }}:{{ currentValue }}</span>
</div> </div>
</el-popover> {{ item.label }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template> </template>
<script> <script>
export default { export default {
name: 'SelectCustom', name: "SelectCustom",
props: { props: {
// 选项列表
options: { options: {
type: Array, type: Array,
required: true, required: true,
default: () => [] default: () => [],
}, },
// 当前选中的值
value: { value: {
type: Object, type: Object,
default: () => ({ label: '盯防类型', value: '' }) default: () => ({ label: "盯防类型", value: "" }),
}, },
// 标签文本(如"盯防类型"、"指标类型")
label: { label: {
type: String, type: String,
required: true required: true,
}, },
// 触发按钮的图标(可以是图片路径或图标类名)
triggerIcon: { triggerIcon: {
type: String, type: String,
required: true required: true,
}, },
// 触发按钮图标类型:'image' | 'icon'
triggerIconType: { triggerIconType: {
type: String, type: String,
default: 'icon', default: "icon",
validator: (value) => ['image', 'icon'].includes(value) validator: value => ["image", "icon"].includes(value),
}, },
// 默认文本(用于判断是否选中状态)
defaultText: { defaultText: {
type: String, type: String,
default: '全部' default: "全部",
}, },
// popover宽度
popoverWidth: { popoverWidth: {
type: Number, type: Number,
default: 120 default: 120,
} },
disabled: {
type: Boolean,
default: false,
}, },
data() {
return {
popoverVisible: false
};
}, },
computed: { computed: {
// 当前显示的值
currentValue() { currentValue() {
if (this.value && typeof this.value === 'object' && this.value.label) { if (this.value && typeof this.value === "object" && this.value.label) {
return this.value.label; return this.value.label;
} }
return this.defaultText; return this.defaultText;
} },
}, },
methods: { methods: {
// 处理选择
handleSelect(item) { handleSelect(item) {
this.popoverVisible = false; this.$emit("change", item);
// 触发change事件,传递选中的项
this.$emit('change', item);
// 同时触发input事件,支持v-model,传递包含label和value的对象
const selectedValue = { const selectedValue = {
label: item.label, label: item.label,
value: item.value !== undefined ? item.value : item.label value: item.value !== undefined ? item.value : item.label,
}; };
this.$emit('input', selectedValue); this.$emit("input", selectedValue);
}, },
// 判断选项是否被选中
isSelected(item) { isSelected(item) {
if (!this.value) return false; if (!this.value)
// 优先比较value属性,如果没有value则比较label return false;
const itemValue = item.value !== undefined ? item.value : item.label; const itemValue = item.value !== undefined ? item.value : item.label;
const currentValue = this.value.value !== undefined ? this.value.value : this.value.label; const currentValue = this.value.value !== undefined ? this.value.value : this.value.label;
return itemValue === currentValue; return itemValue === currentValue;
} },
} },
}; };
</script> </script>
...@@ -143,7 +116,7 @@ export default { ...@@ -143,7 +116,7 @@ export default {
color: #333333; color: #333333;
&:hover { &:hover {
color: #2A58AD; color: #2a58ad;
} }
i { i {
...@@ -160,51 +133,49 @@ export default { ...@@ -160,51 +133,49 @@ export default {
} }
&.has-selected { &.has-selected {
background-color: #EFF3F6; background-color: #eff3f6;
}
&.is-disabled {
cursor: not-allowed;
color: #c0c4cc;
&:hover {
color: #c0c4cc;
}
} }
} }
</style> </style>
<style> <style>
/* 全局样式,与父组件保持一致 */ .select-custom-dropdown {
.pure-popover {
padding: 4px 0 !important; padding: 4px 0 !important;
border-color: #E5E6EB !important; border-color: #e5e6eb !important;
box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
} }
.popover-list { .select-custom-dropdown .el-dropdown-menu__item {
list-style: none;
margin: 0;
padding: 0;
li {
padding: 9px 16px;
cursor: pointer;
color: #333333;
font-size: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 9px 16px;
font-size: 14px;
color: #333333;
line-height: 1.5;
}
&.is-selected { .select-custom-dropdown .el-dropdown-menu__item.is-selected {
background-color: #f7f7f7; background-color: #f7f7f7;
} }
&:hover {
background-color: #F2F3F5;
}
i { .select-custom-dropdown .el-dropdown-menu__item i {
margin-right: 8px; margin-right: 8px;
font-size: 14px; font-size: 14px;
} }
.icon-img { .select-custom-dropdown .el-dropdown-menu__item .icon-img {
width: 18px; width: 18px;
height: 18px; height: 18px;
border-radius: 3px; border-radius: 3px;
margin-right: 8px; margin-right: 8px;
}
}
} }
</style> </style>
...@@ -4,16 +4,17 @@ ...@@ -4,16 +4,17 @@
<HeaderCustom v-model="currentTab" <HeaderCustom v-model="currentTab"
:brand-options="baseData.brandOptions" :brand-options="baseData.brandOptions"
:filters="filters" :filters="filters"
:group-options="baseData.groupOptions"
:online-ops-options="baseData.onlineOpsList" :online-ops-options="baseData.onlineOpsList"
:province-options="baseData.provinceInfoList" :province-options="baseData.provinceInfoList"
:region-ops-options="baseData.regionOpsList" :region-ops-options="baseData.regionOpsList"
:show-right-area="true" :show-right-area="true"
:supervisor-ops-options="baseData.supervisorOpsList"
:tabs="tabs" :tabs="tabs"
@reset="handleReset" @reset="handleReset"
@search="handleSearch" @search="handleSearch"
@tab-change="handleTabChange"> @tab-change="handleTabChange">
</HeaderCustom> </HeaderCustom>
<!-- 2. 中间工具栏 --> <!-- 2. 中间工具栏 -->
<div class="toolbar-container"> <div class="toolbar-container">
<div class="tool-left"> <div class="tool-left">
...@@ -28,7 +29,8 @@ ...@@ -28,7 +29,8 @@
<span class="v-divider">|</span> <span class="v-divider">|</span>
<!-- 指标类型 --> <!-- 指标类型 -->
<SelectCustom label="指标类型" <SelectCustom :disabled="isIndicatorTypeDisabled"
label="指标类型"
:options="indicatorTypeOptions" :options="indicatorTypeOptions"
:trigger-icon="require('@/assets/strategy/icon-strategy-type06.png')" :trigger-icon="require('@/assets/strategy/icon-strategy-type06.png')"
trigger-icon-type="image" trigger-icon-type="image"
...@@ -96,7 +98,7 @@ ...@@ -96,7 +98,7 @@
<script> <script>
import { findMerchantStaffList, merchantStaffByRoleList } from "@api/index"; import { findMerchantStaffList, merchantStaffByRoleList } from "@api/index";
import { getCarBrandList, getDistrictDetail, getMonitorList, getMonitorTypeDictList } from "@/api/earlyWarningManager"; import { getCarBrandList, getDistrictDetail, getGroupListAPI, getMonitorList, getMonitorTypeDictList } from "@/api/earlyWarningManager";
import noDataImg from "@/assets/strategy/emepty-strategy.png"; import noDataImg from "@/assets/strategy/emepty-strategy.png";
import { deepClone } from "@/common/util"; import { deepClone } from "@/common/util";
import util from "@/libs/util"; import util from "@/libs/util";
...@@ -144,8 +146,8 @@ export default { ...@@ -144,8 +146,8 @@ export default {
currentTab: { label: "延保", value: 1 }, currentTab: { label: "延保", value: 1 },
tabs: [ tabs: [
{ label: "延保", value: 1 }, { label: "延保", value: 1 },
{ label: "权益", value: 2 }, { label: "权益", value: 3 },
{ label: "轻改", value: 3 }, { label: "轻改", value: 2 },
], ],
filters: { filters: {
storeName: "", storeName: "",
...@@ -155,13 +157,16 @@ export default { ...@@ -155,13 +157,16 @@ export default {
brand: [], brand: [],
regionOps: "", regionOps: "",
onlineOps: "", onlineOps: "",
flightSupervisionId: "",
}, // 顶部筛选项表单 }, // 顶部筛选项表单
// 选择器数据 // 选择器数据
baseData: { baseData: {
provinceInfoList: [], provinceInfoList: [],
regionOpsList: [], // 区域运营列表 regionOpsList: [], // 区域运营列表
onlineOpsList: [], // 线上运营列表 onlineOpsList: [], // 线上运营列表
supervisorOpsList: [], // 督导列表
brandOptions: [], // 品牌级联选择器数据 brandOptions: [], // 品牌级联选择器数据
groupOptions: [], // 项目组列表
}, },
timeRangeType: { label: "月", value: 2 }, // 当前选中的时间范围类型 timeRangeType: { label: "月", value: 2 }, // 当前选中的时间范围类型
timeRangeOptions: [ timeRangeOptions: [
...@@ -178,7 +183,7 @@ export default { ...@@ -178,7 +183,7 @@ export default {
// 存储原始监控类型数据(接口返回的完整数据) // 存储原始监控类型数据(接口返回的完整数据)
monitorTypeData: [], monitorTypeData: [],
// 当前选中的盯防类型 // 当前选中的盯防类型
currentWatchType: { label: "", value: null }, currentWatchType: { label: "全部", value: null },
// 当前选中的指标类型 // 当前选中的指标类型
currentIndicatorType: { label: "全部", value: null }, currentIndicatorType: { label: "全部", value: null },
// 门店列表数据 // 门店列表数据
...@@ -190,10 +195,13 @@ export default { ...@@ -190,10 +195,13 @@ export default {
computed: { computed: {
// 盯防类型选项数据格式化:label: 盯防类型, value: 盯防类型编码, icon: 图标, iconUrl: 图标路径(自动根据原始数据生成) // 盯防类型选项数据格式化:label: 盯防类型, value: 盯防类型编码, icon: 图标, iconUrl: 图标路径(自动根据原始数据生成)
watchTypeOptions() { watchTypeOptions() {
const allOption = { label: "全部", value: null };
if (!this.monitorTypeData || this.monitorTypeData.length === 0) { if (!this.monitorTypeData || this.monitorTypeData.length === 0) {
return []; return [allOption];
} }
return this.monitorTypeData.map((item) => { return [
allOption,
...this.monitorTypeData.map((item) => {
const iconConfig = WATCH_TYPE_ICON_CONFIG[item.typeCode] || WATCH_TYPE_ICON_CONFIG.default; const iconConfig = WATCH_TYPE_ICON_CONFIG[item.typeCode] || WATCH_TYPE_ICON_CONFIG.default;
return { return {
label: item.typeName, label: item.typeName,
...@@ -201,11 +209,21 @@ export default { ...@@ -201,11 +209,21 @@ export default {
icon: iconConfig.icon, icon: iconConfig.icon,
iconUrl: iconConfig.iconUrl, iconUrl: iconConfig.iconUrl,
}; };
}); }),
];
},
// 盯防类型为「全部」时,指标类型不可选
isIndicatorTypeDisabled() {
return this.currentWatchType.value == null;
}, },
// 指标类型选项(自动根据当前盯防类型生成) // 指标类型选项(自动根据当前盯防类型生成)
indicatorTypeOptions() { indicatorTypeOptions() {
if (this.currentWatchType.value == null) {
return [{ label: "全部", value: null }];
}
// 查找当前选中的盯防类型对应的数据 // 查找当前选中的盯防类型对应的数据
const currentTypeData = this.monitorTypeData.find( const currentTypeData = this.monitorTypeData.find(
item => item.typeCode === this.currentWatchType.value, item => item.typeCode === this.currentWatchType.value,
...@@ -286,6 +304,10 @@ export default { ...@@ -286,6 +304,10 @@ export default {
this.getRegionOpsList(); this.getRegionOpsList();
// 获取线上运营列表 // 获取线上运营列表
this.getOnlineOpsList(); this.getOnlineOpsList();
// 获取督导列表
this.getSupervisorOpsList();
// 获取项目组列表
this.getGroupList();
// 获取车品牌列表 // 获取车品牌列表
this.getCarBrandList(); this.getCarBrandList();
// 获取指标类型列表 // 获取指标类型列表
...@@ -533,6 +555,36 @@ export default { ...@@ -533,6 +555,36 @@ export default {
} }
}); });
}, },
// 获取督导列表
getSupervisorOpsList() {
merchantStaffByRoleList({ roleName: "线上运营" }).then((res) => {
console.log("督导列表:", res);
if (res && res.length) {
// 将返回的数据转换为选择器需要的格式
this.baseData.supervisorOpsList = res.map(item => ({
value: item.uuid,
label: item.staffName,
}));
// 在列表前面添加"全部"选项
if (this.baseData.supervisorOpsList.length && this.baseData.supervisorOpsList[0].label !== "全部") {
this.baseData.supervisorOpsList.unshift({
value: null,
label: "全部",
});
}
}
});
},
getGroupList() {
getGroupListAPI().then((res) => {
if (res && res.length) {
this.baseData.groupOptions = res.map(item => ({
value: item.groupId,
label: item.groupName,
}));
}
});
},
// 获取监控类型字典列表(更简洁的实现) // 获取监控类型字典列表(更简洁的实现)
async getIndicatorTypeList() { async getIndicatorTypeList() {
try { try {
...@@ -541,15 +593,8 @@ export default { ...@@ -541,15 +593,8 @@ export default {
if (res && res.length) { if (res && res.length) {
// 保存原始数据(计算属性会自动基于此生成选项) // 保存原始数据(计算属性会自动基于此生成选项)
this.monitorTypeData = res; this.monitorTypeData = res;
// 初始化当前选中的盯防类型为第一个 // 默认盯防类型、指标类型均为「全部」
if (res[0]) { this.currentWatchType = { label: "全部", value: null };
this.currentWatchType = {
label: res[0].typeName,
value: res[0].typeCode,
};
}
// 初始化当前选中的指标类型为"全部"
this.currentIndicatorType = { label: "全部", value: null }; this.currentIndicatorType = { label: "全部", value: null };
} else { } else {
console.warn("指标类型列表接口返回为空"); console.warn("指标类型列表接口返回为空");
...@@ -610,7 +655,7 @@ export default { ...@@ -610,7 +655,7 @@ export default {
$primary: #2a58ad; $primary: #2a58ad;
$text-main: #1d2129; $text-main: #1d2129;
$text-sub: #333333; $text-sub: #333333;
$border: #e5e6eb; $border: #e5e5e5;
$bg-gray: #eff3f6; $bg-gray: #eff3f6;
$bg-white: #fff; $bg-white: #fff;
...@@ -635,7 +680,7 @@ $bg-white: #fff; ...@@ -635,7 +680,7 @@ $bg-white: #fff;
gap: 12px; gap: 12px;
border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
border-top: 1px solid $border; border-top: 1px solid #eeeeee6b;
border-bottom: 1px solid $border; border-bottom: 1px solid $border;
} }
......
<template> <template>
<div <div v-loading="loading"
class="business-overview" class="business-overview">
v-loading="loading"
>
<div class="business-overview-title"> <div class="business-overview-title">
展业概况 展业概况
<div :class="['business-overview-status',{'normal':businessOverviewDetail.status == 0}]">{{ businessOverviewText }}</div> <div class="business-overview-status" :class="[{ normal: businessOverviewDetail.status == 0 }]">
{{ businessOverviewText }}
</div>
<div class="business-overview-total flex"> <div class="business-overview-total flex">
累计展业 累计展业
<div class="num">{{ businessOverviewDetail.developmentDay || '-'}}</div> <div class="num">
{{ businessOverviewDetail.developmentDay || '-' }}
</div>
天 天
<el-button <el-button class="stop"
plain plain
type="primary"
class="stop"
size="small" size="small"
@click="openStopBusinessDialog" type="primary"
>停止展业</el-button> @click="openStopBusinessDialog">
停止展业
</el-button>
</div> </div>
</div> </div>
<template v-if="businessOverviewDetail.timelineList && businessOverviewDetail.timelineList.length"> <template v-if="businessOverviewDetail.timelineList && businessOverviewDetail.timelineList.length">
<scroll-x-view> <ScrollXView>
<div class="timeline"> <div class="timeline">
<div <div v-for="(item, index) in businessOverviewDetail.timelineList"
:class="['timeline-item',{last: index == businessOverviewDetail.timelineList.length - 1}]"
v-for="(item, index) in businessOverviewDetail.timelineList"
:key="index" :key="index"
> class="timeline-item"
:class="[{ last: index == businessOverviewDetail.timelineList.length - 1 }]">
<div class="timeline-item-arc"></div> <div class="timeline-item-arc"></div>
<div class="timeline-item-line"></div> <div class="timeline-item-line"></div>
<div class="timeline-item-date">{{ item.nodeDate }}</div> <div class="timeline-item-date">
<div class="timeline-item-content">{{ item.content }}</div> {{ item.nodeDate }}
</div> </div>
<div class="timeline-item-content">
{{ item.content }}
</div> </div>
</scroll-x-view> </div>
</div>
</ScrollXView>
</template> </template>
<stop-business <StopBusiness :min-date="minDate"
:visible.sync="stopBusinessVisible" :visible.sync="stopBusinessVisible"
@dialogClose="stopBusinessVisible = false" @dialogClose="stopBusinessVisible = false"
:minDate="minDate" @refresh="getStrategyMerchantTimeline">
@refresh="getStrategyMerchantTimeline" </StopBusiness>
></stop-business>
</div> </div>
</template> </template>
<script> <script>
import ScrollXView from '../ScrollXView.vue'; import dayjs from "dayjs";
import StopBusiness from './StopBusiness.vue';
import { import {
getStrategyMerchantTimeline getStrategyMerchantTimeline,
} from '@/api/earlyWarningManager'; } from "@/api/earlyWarningManager";
import dayjs from 'dayjs'; import ScrollXView from "../ScrollXView.vue";
import StopBusiness from "./StopBusiness.vue";
export default { export default {
name: "BusinessOverview",
components: { components: {
ScrollXView, ScrollXView,
StopBusiness StopBusiness,
}, },
name: 'BusinessOverview', inject: ["GET_PARAMS_INFO"],
inject: ['GET_PARAMS_INFO'], data() {
data () {
return { return {
stopBusinessVisible: false, stopBusinessVisible: false,
businessOverviewDetail: {}, businessOverviewDetail: {},
loading: false, loading: false,
minDate: dayjs().format('YYYY-MM-DD') minDate: dayjs().format("YYYY-MM-DD"),
}; };
}, },
computed: { computed: {
businessOverviewText () { businessOverviewText() {
let { status } = this.businessOverviewDetail let { status } = this.businessOverviewDetail;
return status == 0 ? '展业中' : '停止展业' return status == 0 ? "展业中" : "停止展业";
},
paramsInfo() {
return this.GET_PARAMS_INFO();
}, },
paramsInfo () {
return this.GET_PARAMS_INFO()
}
}, },
mounted () { mounted() {
}, },
methods: { methods: {
init () { init() {
this.getStrategyMerchantTimeline() this.getStrategyMerchantTimeline();
}, },
openStopBusinessDialog () { openStopBusinessDialog() {
this.stopBusinessVisible = true this.stopBusinessVisible = true;
}, },
async getStrategyMerchantTimeline () { async getStrategyMerchantTimeline() {
try { try {
this.businessOverviewDetail = {} this.businessOverviewDetail = {};
this.loading = true this.loading = true;
let { merchantIds } = this.paramsInfo, let { merchantIds } = this.paramsInfo;
data = await getStrategyMerchantTimeline({ let data = await getStrategyMerchantTimeline({
merchantId: merchantIds[0], merchantId: merchantIds[0],
bizs: 1, //业务类型(1.延保 2.轻改 3.权益) bizs: 1, // 业务类型(1.延保 2.轻改 3.权益)
sceneType: 0 //业务场景(0.会员权益,1.精品升级) sceneType: 0, // 业务场景(0.会员权益,1.精品升级)
}) });
data.timelineList && data.timelineList.forEach(item => { data.timelineList && data.timelineList.forEach((item) => {
item.nodeDate = dayjs(item.nodeDate).format('YYYY-MM-DD') item.nodeDate = dayjs(item.nodeDate).format("YYYY-MM-DD");
/** /**
* 节点类型,0-产品首次上架,1- 正式开单,2-安心包产品上架,3-延保-轮胎上架,4-延保-电池上架,5-展业风险,6-停止展业,7-恢复展业 * 节点类型,0-产品首次上架,1- 正式开单,2-安心包产品上架,3-延保-轮胎上架,4-延保-电池上架,5-展业风险,6-停止展业,7-恢复展业
*/ */
item.content = { item.content = {
0: '产品首次上架', 0: "产品首次上架",
1: '正式开单', 1: "正式开单",
2: '安心包产品上架', 2: "安心包产品上架",
3: '轮胎产品上架', 3: "轮胎产品上架",
4: '电池产品上架', 4: "电池产品上架",
5: '展业风险', 5: "展业风险",
6: '停止展业', 6: "停止展业",
7: '恢复展业' 7: "恢复展业",
}[item.nodeType] }[item.nodeType];
}) });
this.businessOverviewDetail = data this.businessOverviewDetail = data;
let nodeDate = '' let nodeDate = "";
if (data && data.timelineList) { if (data && data.timelineList) {
let { timelineList } = data let { timelineList } = data;
if (timelineList.length) { if (timelineList.length) {
let lastNode = timelineList.at(-1) let lastNode = timelineList.at(-1);
if (lastNode) { if (lastNode) {
if (lastNode.nodeType != 6) nodeDate = lastNode.nodeDate if (lastNode.nodeType != 6)
else nodeDate = timelineList.at(-2).nodeDate nodeDate = lastNode.nodeDate;
else nodeDate = timelineList.at(-2).nodeDate;
} }
} }
if (nodeDate) this.minDate = dayjs(nodeDate).format('YYYY-MM-DD') if (nodeDate)
} else this.minDate = dayjs().format('YYYY-MM-DD') this.minDate = dayjs(nodeDate).format("YYYY-MM-DD");
this.loading = false } else {
} catch (error) { this.minDate = dayjs().format("YYYY-MM-DD");
console.log(error)
}
} }
this.loading = false;
} catch (error) {
console.log(error);
} }
},
},
}; };
</script> </script>
...@@ -142,7 +151,7 @@ export default { ...@@ -142,7 +151,7 @@ export default {
.business-overview { .business-overview {
padding: 0 20px; padding: 0 20px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
.timeline-content{ .timeline-content {
min-height: 89px; min-height: 89px;
} }
&-title { &-title {
......
<template> <template>
<div class="overview-box"> <div class="overview-box">
<template v-for="(item, index) in overviewList2"> <template v-for="(item, index) in overviewList">
<div :key="index" <div :key="index"
class="overview-item" class="overview-item"
:class="[{ 'clear-border': index == overviewList2.length - 1 }]"> :class="[{ 'clear-border': index == overviewList.length - 1 }]">
<div class="title flex"> <div class="title flex">
{{ item.title }} {{ item.title }}
<el-button v-if="hasEHi" <el-button v-if="hasEHi"
...@@ -134,89 +134,6 @@ const overviewList = [ ...@@ -134,89 +134,6 @@ const overviewList = [
], ],
}, },
]; ];
const overviewList2 = [
{
title: "车窗膜",
list: [
{
label: "成交数",
key: "vehicleWarrantyDealCount",
},
{
label: "单车采购产值",
key: "vehicleWarrantyPenetrationRate",
subKey: "vehicleWarrantyPenetrationBottomTarget",
unit: "%",
},
{
label: "渗透率",
key: "vehicleWarrantyConversionRate",
subKey: "vehicleWarrantyConversionBottomTarget",
unit: "%",
},
{
label: "触客转化率",
key: "vehicleWarrantyConversionRate",
subKey: "vehicleWarrantyConversionBottomTarget",
unit: "%",
},
],
},
{
title: "车身膜",
list: [
{
label: "成交数",
key: "safetyPackageDealCount",
},
{
label: "单车采购产值",
key: "safetyPackagePenetrationRate",
subKey: "safetyPackagePenetrationBottomTarget",
unit: "%",
},
{
label: "渗透率",
key: "safetyPackageConversionRate",
subKey: "safetyPackageConversionBottomTarget",
unit: "%",
},
{
label: "触客转化率",
key: "safetyPackageConversionRate",
subKey: "safetyPackageConversionBottomTarget",
unit: "%",
},
],
},
{
title: "精品附件",
list: [
{
label: "成交数",
key: "batteryWarrantyDealCount",
},
{
label: "单车采购产值",
key: "batteryWarrantyPenetrationRate",
subKey: "batteryWarrantyPenetrationBottomTarget",
unit: "%",
},
{
label: "渗透率",
key: "batteryWarrantyConversionRate",
subKey: "batteryWarrantyConversionBottomTarget",
unit: "%",
},
{
label: "触客转化率",
key: "batteryWarrantyConversionRate",
subKey: "batteryWarrantyConversionBottomTarget",
unit: "%",
},
],
},
];
export default { export default {
name: "OverViewList", name: "OverViewList",
components: { HistoryTarget }, components: { HistoryTarget },
...@@ -263,25 +180,6 @@ export default { ...@@ -263,25 +180,6 @@ export default {
} }
return list; return list;
}, },
overviewList2() {
let { hasEHi, isHarmony } = this;
let list = this.deepClone(overviewList2);
if (hasEHi) {
list.map((e, index) => {
e.list.push({
label: "生态系数",
key: {
0: "vehicleWarrantyEcoCoefficient",
1: "safetyPackageEcoCoefficient",
2: "batteryWarrantyEcoCoefficient",
3: "tireWarrantyEcoCoefficient",
}[index],
hide: !isHarmony,
});
});
}
return list;
},
}, },
mounted() { mounted() {
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!