Commit ddf4caef by Jaxon

Merge branch 'feature/strategy-center' into 'SAAS+V5.8.2'

Feature/strategy center

See merge request !669
2 parents c3c90d38 3b6ad690
Showing 50 changed files with 2335 additions and 1195 deletions
...@@ -2,14 +2,8 @@ ...@@ -2,14 +2,8 @@
"eslint.enable": true, "eslint.enable": true,
"eslint.format.enable": true, "eslint.format.enable": true,
"prettier.enable": false, "prettier.enable": false,
"i18n-ally.localesPaths": [ "i18n-ally.localesPaths": ["src/locales"],
"src/locales" "cSpell.words": ["vuex", "Cascader", "glsx"],
],
"cSpell.words": [
"vuex",
"Cascader",
"glsx"
],
"workbench.tree.indent": 24, "workbench.tree.indent": 24,
"explorer.compactFolders": false, "explorer.compactFolders": false,
"scm.compactFolders": false, "scm.compactFolders": false,
...@@ -71,10 +65,7 @@ ...@@ -71,10 +65,7 @@
// "source.organizeImports": "explicit", // "source.organizeImports": "explicit",
"source.fixAll.eslint": "explicit" "source.fixAll.eslint": "explicit"
}, },
"editor.pasteAs.preferences": [ "editor.pasteAs.preferences": ["text.updateImports.jsts", "text"],
"text.updateImports.jsts",
"text"
],
"eslint.validate": [ "eslint.validate": [
"javascript", "javascript",
"javascriptreact", "javascriptreact",
...@@ -100,5 +91,8 @@ ...@@ -100,5 +91,8 @@
"javascript.preferences.importModuleSpecifier": "non-relative", // 优先使用 @/ 别名路径 "javascript.preferences.importModuleSpecifier": "non-relative", // 优先使用 @/ 别名路径
"javascript.suggest.autoImports": true, // 确保这个是 true "javascript.suggest.autoImports": true, // 确保这个是 true
"vue.updateImportsOnFileMove.enabled": true, "vue.updateImportsOnFileMove.enabled": true,
"i18n-ally.sourceLanguage": "zh-chs" "i18n-ally.sourceLanguage": "zh-chs",
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
} }
...@@ -4,8 +4,7 @@ export function getCurrentSixMonth(n = 5) { ...@@ -4,8 +4,7 @@ export function getCurrentSixMonth(n = 5) {
} }
export function formatThousand(val) { export function formatThousand(val) {
if (val === null || val === undefined || val === "") if (val === null || val === undefined || val === "") return "-";
return "-";
const str = String(val); const str = String(val);
const parts = str.split("."); const parts = str.split(".");
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
...@@ -20,7 +19,7 @@ export function limitPrice( ...@@ -20,7 +19,7 @@ export function limitPrice(
pointDigit, pointDigit,
minValue, minValue,
maxValue, maxValue,
regRule, regRule
) { ) {
// console.log( // console.log(
// newValue, // newValue,
...@@ -38,8 +37,8 @@ export function limitPrice( ...@@ -38,8 +37,8 @@ export function limitPrice(
}; };
regRule = regRule || "priceReg"; regRule = regRule || "priceReg";
if ( if (
newValue newValue &&
&& ((minValue && newValue < minValue) || (maxValue && newValue > maxValue)) ((minValue && newValue < minValue) || (maxValue && newValue > maxValue))
) { ) {
return oldValue || ""; return oldValue || "";
} }
...@@ -48,16 +47,16 @@ export function limitPrice( ...@@ -48,16 +47,16 @@ export function limitPrice(
newValue = newValue + ""; newValue = newValue + "";
let interger = newValue.split(".")[0]; let interger = newValue.split(".")[0];
let point = newValue.split(".")[1]; let point = newValue.split(".")[1];
let intergerNum let intergerNum =
= interger.length > intergerDigit ? oldValue.split(".")[0] : interger; interger.length > intergerDigit ? oldValue.split(".")[0] : interger;
let pointNum let pointNum =
= point.length > pointDigit ? point.slice(0, pointDigit) : point; point.length > pointDigit ? point.slice(0, pointDigit) : point;
newValue = pointDigit newValue = pointDigit
? intergerNum + "." + pointNum ? intergerNum + "." + pointNum
: newValue.split(".")[0]; : newValue.split(".")[0];
} else { } else {
newValue newValue =
= newValue.length > intergerDigit newValue.length > intergerDigit
? oldValue.slice(0, intergerDigit) ? oldValue.slice(0, intergerDigit)
: newValue; : newValue;
} }
...@@ -149,9 +148,9 @@ export const appointDays = 35; ...@@ -149,9 +148,9 @@ export const appointDays = 35;
export const afterTodayOptions = { export const afterTodayOptions = {
disabledDate(date) { disabledDate(date) {
if ( if (
date < new Date(new Date().toLocaleDateString()) date < new Date(new Date().toLocaleDateString()) ||
|| date date >
> new Date(new Date().setDate(new Date().getDate() + (appointDays - 1))) new Date(new Date().setDate(new Date().getDate() + (appointDays - 1)))
) { ) {
return true; return true;
} }
...@@ -288,8 +287,8 @@ export const rangePickerOptions_year_2023 = { ...@@ -288,8 +287,8 @@ export const rangePickerOptions_year_2023 = {
// console.log(new Date()) // console.log(new Date())
if ( if (
date.getFullYear() > new Date().getFullYear() date.getFullYear() > new Date().getFullYear() ||
|| date.getFullYear() < 2023 date.getFullYear() < 2023
) { ) {
return true; return true;
} }
...@@ -322,7 +321,7 @@ export const todayEndPickerOptions = { ...@@ -322,7 +321,7 @@ export const todayEndPickerOptions = {
today.getDate(), today.getDate(),
23, 23,
59, 59,
59, 59
); );
return time.getTime() > todayEnd.getTime(); return time.getTime() > todayEnd.getTime();
...@@ -331,7 +330,7 @@ export const todayEndPickerOptions = { ...@@ -331,7 +330,7 @@ export const todayEndPickerOptions = {
export const stockQueryDatePickerOptions = { export const stockQueryDatePickerOptions = {
disabledDate(time) { disabledDate(time) {
const minDate = new Date(2026, 1, 1); const minDate = new Date(2026, 1, 1); // 2026年2月1日 (月份从0开始,1代表2月)
minDate.setHours(0, 0, 0, 0); minDate.setHours(0, 0, 0, 0);
const today = new Date(); const today = new Date();
...@@ -341,12 +340,11 @@ export const stockQueryDatePickerOptions = { ...@@ -341,12 +340,11 @@ export const stockQueryDatePickerOptions = {
today.getDate(), today.getDate(),
23, 23,
59, 59,
59, 59
); );
return ( return (
time.getTime() < minDate.getTime() time.getTime() < minDate.getTime() || time.getTime() > todayEnd.getTime()
|| time.getTime() > todayEnd.getTime()
); );
}, },
}; };
...@@ -383,7 +381,7 @@ export const rangePickerOptions_outputValue = { ...@@ -383,7 +381,7 @@ export const rangePickerOptions_outputValue = {
const year = time.getFullYear(); const year = time.getFullYear();
const month = time.getMonth(); const month = time.getMonth();
const isAllowed = allowedMonths.some( const isAllowed = allowedMonths.some(
m => m.year === year && m.month === month, (m) => m.year === year && m.month === month
); );
return !isAllowed; // 不在允许范围则禁用 return !isAllowed; // 不在允许范围则禁用
}, },
...@@ -418,7 +416,7 @@ export const rangePickerOptions_oneYearNoFuture = { ...@@ -418,7 +416,7 @@ export const rangePickerOptions_oneYearNoFuture = {
const todayStart = new Date( const todayStart = new Date(
today.getFullYear(), today.getFullYear(),
today.getMonth(), today.getMonth(),
today.getDate(), today.getDate()
).getTime(); ).getTime();
// 不可选未来时间 // 不可选未来时间
if (time.getTime() > todayStart) { if (time.getTime() > todayStart) {
...@@ -430,12 +428,9 @@ export const rangePickerOptions_oneYearNoFuture = { ...@@ -430,12 +428,9 @@ export const rangePickerOptions_oneYearNoFuture = {
const minTime = selectDate_oneYearNoFuture - oneYearMs; const minTime = selectDate_oneYearNoFuture - oneYearMs;
const maxTime = Math.min( const maxTime = Math.min(
selectDate_oneYearNoFuture + oneYearMs, selectDate_oneYearNoFuture + oneYearMs,
todayStart, todayStart
);
return (
time.getTime() < minTime
|| time.getTime() > maxTime
); );
return time.getTime() < minTime || time.getTime() > maxTime;
} }
return false; return false;
}, },
...@@ -464,7 +459,7 @@ export const rangePickerOptions_deliveryQuantity = { ...@@ -464,7 +459,7 @@ export const rangePickerOptions_deliveryQuantity = {
// 处理跨年情况(如当前为1月时,上个月是去年12月) // 处理跨年情况(如当前为1月时,上个月是去年12月)
currentMonth === 0 currentMonth === 0
? { year: currentYear - 1, month: 11 } ? { year: currentYear - 1, month: 11 }
: { year: currentYear, month: currentMonth - 1 }, : { year: currentYear, month: currentMonth - 1 }
); );
} }
...@@ -472,7 +467,7 @@ export const rangePickerOptions_deliveryQuantity = { ...@@ -472,7 +467,7 @@ export const rangePickerOptions_deliveryQuantity = {
const year = time.getFullYear(); const year = time.getFullYear();
const month = time.getMonth(); const month = time.getMonth();
const isAllowed = allowedMonths.some( const isAllowed = allowedMonths.some(
m => m.year === year && m.month === month, (m) => m.year === year && m.month === month
); );
return !isAllowed; // 不在允许范围则禁用 return !isAllowed; // 不在允许范围则禁用
}, },
......
<template>
<baseDialog class="effect-detail-dialog"
:config="config"
:dialog-config="dialogConfig.config"
:is-show.sync="dialogShow">
<div 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 row">
<div :key="index"
class="business-item">
<div class="label">
{{ item.categoryExtension }}
</div>
<div class="value flex">
<template v-if="item.currentValue >= 0">
{{ item.currentValue }}<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 row">
<div :key="index"
class="business-item">
<div class="label">
{{ item.categoryExtension }}
</div>
<div class="value flex">
<template v-if="item.nextValue >= 0">
{{ item.nextValue }}<template v-if="item.unit">
{{ item.unit }}
</template>
<img class="arrow"
:src="getIconSrc(formatIsRatio(item.nextValue - item.currentValue))" />
</template>
<template v-else>
-
</template>
</div>
</div>
</template>
</div>
</div>
</div>
</div>
</baseDialog>
</template>
<script>
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: Array,
default: () => [],
},
searchParams: {
type: Object,
default: () => ({}),
},
},
data() {
return {
config: {
isShowFooter: false,
cancel_name: "关闭",
hideConfirmBtn: true,
},
dialogConfig: {
config: {
title: "效果分析",
width: "720px",
},
},
};
},
computed: {
dialogShow: {
get() {
return this.visible;
},
set() {
this.close();
},
},
},
methods: {
close() {
this.$emit("update:visible", false);
},
getIconSrc(name) {
return {
rise,
decline,
just01,
}[name] ?? "";
},
formatIsRatio(delta) {
return delta < 0 ? "decline" : delta === 0 ? "just01" : "rise";
},
},
};
</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>
...@@ -3,55 +3,57 @@ ...@@ -3,55 +3,57 @@
<div class="card-header"> <div class="card-header">
<span class="card-title">策略类型分布</span> <span class="card-title">策略类型分布</span>
<div class="operator-filter"> <div class="operator-filter">
线上运营人员: 运营人员:
<el-select <el-select size="mini"
:value="operatorFilter"
size="mini"
style="width: 120px;" style="width: 120px;"
@change="handleOperatorChange" :value="operatorFilter"
> @change="handleOperatorChange">
<el-option <el-option v-for="operator in operatorList"
v-for="operator in operatorList"
:key="operator.value" :key="operator.value"
:label="operator.label" :label="operator.label"
:value="operator.value" :value="operator.value">
></el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="chart-container" v-show="hasChartData"> <div v-show="hasChartData" class="chart-container">
<!-- ECharts 容器 --> <!-- ECharts 容器 -->
<div ref="pieChart" class="echart-box"></div> <div ref="pieChart" class="echart-box"></div>
<!-- 自定义图例 --> <!-- 自定义图例 -->
<div class="custom-legend"> <div class="custom-legend">
<div <div v-for="(item, index) in processedPieData"
class="legend-item"
v-for="(item, index) in processedPieData"
:key="index" :key="index"
> class="legend-item">
<div <div class="legend-dot"
class="legend-dot" :style="{ background: item.color }">
:style="{ background: item.color }" </div>
></div> <div class="legend-name">
<div class="legend-name">{{ item.name }}</div> {{ item.name }}
</div>
<div class="legend-right"> <div class="legend-right">
<div class="legend-percent">{{ item.percent }}%</div> <div class="legend-percent">
{{ item.percent }}%
</div>
<span class="legend-sep">|</span> <span class="legend-sep">|</span>
<div class="legend-value">{{ item.value }}</div> <div class="legend-value">
{{ item.value }}
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-show="!hasChartData" class="empty-box"> <div v-show="!hasChartData" class="empty-box">
<img :src="noDataImg" alt="暂无数据"> <img alt="暂无数据" :src="noDataImg">
<div class="empty-text">暂无数据</div> <div class="empty-text">
暂无数据
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import * as echarts from 'echarts'; import { merchantStaffByRoleList } from "@api/index";
import { merchantStaffByRoleList } from '@api/index'; import * as echarts from "echarts";
import noDataImg from "@/assets/strategy/emepty-strategy.png"; import noDataImg from "@/assets/strategy/emepty-strategy.png";
/** /**
...@@ -59,13 +61,13 @@ import noDataImg from "@/assets/strategy/emepty-strategy.png"; ...@@ -59,13 +61,13 @@ import noDataImg from "@/assets/strategy/emepty-strategy.png";
* @type {Object<number, {name: string, color: string}>} * @type {Object<number, {name: string, color: string}>}
*/ */
const STRATEGY_TYPE_CONFIG = { const STRATEGY_TYPE_CONFIG = {
0: { name: '学习', color: '#409EFF' }, 0: { name: "学习", color: "#409EFF" },
1: { name: '优秀案例分享', color: '#36CBCB' }, 1: { name: "优秀案例分享", color: "#36CBCB" },
2: { name: '带教', color: '#67C23A' }, 2: { name: "带教", color: "#67C23A" },
3: { name: '任务下发', color: '#FFD666' }, 3: { name: "任务下发", color: "#FFD666" },
4: { name: '销售精英到店提拉', color: '#B3E19D' }, 4: { name: "销售精英到店提拉", color: "#B3E19D" },
5: { name: '强力促销', color: '#E6A23C' }, 5: { name: "强力促销", color: "#E6A23C" },
6: { name: '最终盘点与低客单产品购入', color: '#9254DE' } 6: { name: "最终盘点与低客单产品购入", color: "#9254DE" },
}; };
/** /**
...@@ -73,16 +75,16 @@ const STRATEGY_TYPE_CONFIG = { ...@@ -73,16 +75,16 @@ const STRATEGY_TYPE_CONFIG = {
* @param {number} strategyType - 策略类型编号 * @param {number} strategyType - 策略类型编号
* @returns {{name: string, color: string}} * @returns {{name: string, color: string}}
*/ */
const getStrategyTypeConfig = (strategyType) => { function getStrategyTypeConfig(strategyType) {
return STRATEGY_TYPE_CONFIG[strategyType]; return STRATEGY_TYPE_CONFIG[strategyType];
}; }
/** /**
* 转换策略类型分布数据为图表数据格式 * 转换策略类型分布数据为图表数据格式
* @param {Array} apiData - API 返回的原始数据 * @param {Array} apiData - API 返回的原始数据
* @returns {Array} 图表数据 * @returns {Array} 图表数据
*/ */
const transformStrategyData = (apiData) => { function transformStrategyData(apiData) {
if (!Array.isArray(apiData) || apiData.length === 0) { if (!Array.isArray(apiData) || apiData.length === 0) {
return []; return [];
} }
...@@ -93,7 +95,7 @@ const transformStrategyData = (apiData) => { ...@@ -93,7 +95,7 @@ const transformStrategyData = (apiData) => {
// 转换数据格式 // 转换数据格式
return validData return validData
.map(item => { .map((item) => {
const { strategyType, strategyCount = 0, percent } = item; const { strategyType, strategyCount = 0, percent } = item;
const config = getStrategyTypeConfig(strategyType); const config = getStrategyTypeConfig(strategyType);
const calculatedPercent = percent ?? (total > 0 ? Math.round((strategyCount / total) * 100) : 0); const calculatedPercent = percent ?? (total > 0 ? Math.round((strategyCount / total) * 100) : 0);
...@@ -103,25 +105,25 @@ const transformStrategyData = (apiData) => { ...@@ -103,25 +105,25 @@ const transformStrategyData = (apiData) => {
value: strategyCount, value: strategyCount,
percent: calculatedPercent, percent: calculatedPercent,
color: config.color, color: config.color,
strategyType // 保留原始类型用于调试 strategyType, // 保留原始类型用于调试
}; };
}) })
.sort((a, b) => b.value - a.value); // 按数量降序排序 .sort((a, b) => b.value - a.value); // 按数量降序排序
}; }
export default { export default {
name: 'StrategyTypeDistribution', name: "StrategyTypeDistribution",
props: { props: {
// 策略类型分布原始数据(由父组件传递) // 策略类型分布原始数据(由父组件传递)
pieData: { pieData: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
// 运营人员筛选值(双向绑定) // 运营人员筛选值(双向绑定)
operatorFilter: { operatorFilter: {
type: [String, Number], type: [String, Number],
default: null default: null,
} },
}, },
data() { data() {
return { return {
...@@ -129,10 +131,10 @@ export default { ...@@ -129,10 +131,10 @@ export default {
myChart: null, myChart: null,
// 运营人员列表 // 运营人员列表
operatorList: [ operatorList: [
{ label: '全部', value: null }, { label: "全部", value: null },
], ],
// 处理后的图表数据 // 处理后的图表数据
processedPieData: [] processedPieData: [],
}; };
}, },
computed: { computed: {
...@@ -155,7 +157,7 @@ export default { ...@@ -155,7 +157,7 @@ export default {
*/ */
chartOption() { chartOption() {
return this.getChartOption(); return this.getChartOption();
} },
}, },
watch: { watch: {
// 监听原始数据变化,处理数据并更新图表 // 监听原始数据变化,处理数据并更新图表
...@@ -167,12 +169,12 @@ export default { ...@@ -167,12 +169,12 @@ export default {
}); });
}, },
immediate: true, immediate: true,
deep: true deep: true,
} },
}, },
mounted() { mounted() {
this.initChart(); this.initChart();
window.addEventListener('resize', this.resizeChart); window.addEventListener("resize", this.resizeChart);
// 获取线上运营列表 // 获取线上运营列表
this.getOnlineOpsList(); this.getOnlineOpsList();
// 数据加载由 watch 统一管理,无需在此处调用 // 数据加载由 watch 统一管理,无需在此处调用
...@@ -185,25 +187,25 @@ export default { ...@@ -185,25 +187,25 @@ export default {
} }
// 清理事件监听器 // 清理事件监听器
window.removeEventListener('resize', this.resizeChart); window.removeEventListener("resize", this.resizeChart);
}, },
methods: { methods: {
/** /**
* 获取线上运营列表 * 获取线上运营列表
*/ */
getOnlineOpsList() { getOnlineOpsList() {
merchantStaffByRoleList({ roleName: '线上运营' }).then((res) => { merchantStaffByRoleList({ roleName: "线上运营" }).then((res) => {
if (res) { if (res) {
// 将返回的数据转换为选择器需要的格式 // 将返回的数据转换为选择器需要的格式
this.operatorList = res.map(item => ({ this.operatorList = res.map(item => ({
value: item.uuid, value: item.uuid,
label: item.staffName label: item.staffName,
})); }));
// 在列表前面添加"全部"选项 // 在列表前面添加"全部"选项
if (this.operatorList.length && this.operatorList[0].label !== '全部') { if (this.operatorList.length && this.operatorList[0].label !== "全部") {
this.operatorList.unshift({ this.operatorList.unshift({
value: null, value: null,
label: '全部' label: "全部",
}); });
} }
} }
...@@ -215,7 +217,7 @@ export default { ...@@ -215,7 +217,7 @@ export default {
*/ */
handleOperatorChange(value) { handleOperatorChange(value) {
// 通过 .sync 修饰符自动更新父组件的值 // 通过 .sync 修饰符自动更新父组件的值
this.$emit('update:operatorFilter', value); this.$emit("update:operatorFilter", value);
}, },
/** /**
...@@ -226,36 +228,36 @@ export default { ...@@ -226,36 +228,36 @@ export default {
return { return {
series: [ series: [
{ {
name: '策略总数', name: "策略总数",
type: 'pie', type: "pie",
radius: ['55%', '75%'], radius: ["55%", "75%"],
center: ['50%', '50%'], center: ["50%", "50%"],
avoidLabelOverlap: false, avoidLabelOverlap: false,
itemStyle: { itemStyle: {
borderRadius: 0, borderRadius: 0,
borderColor: '#fff', borderColor: "#fff",
borderWidth: 2, borderWidth: 2,
}, },
label: { label: {
show: true, show: true,
position: 'center', position: "center",
formatter: this.hasChartData ? `策略总数` : '暂无数据', formatter: this.hasChartData ? `策略总数` : "暂无数据",
fontSize: 18, fontSize: 18,
color: '#666666', color: "#666666",
lineHeight: 20 lineHeight: 20,
}, },
emphasis: { emphasis: {
}, },
labelLine: { labelLine: {
show: false show: false,
}, },
data: this.processedPieData.map(item => ({ data: this.processedPieData.map(item => ({
value: item.value, value: item.value,
name: item.name, name: item.name,
itemStyle: { color: item.color } itemStyle: { color: item.color },
})) })),
} },
] ],
}; };
}, },
...@@ -264,14 +266,14 @@ export default { ...@@ -264,14 +266,14 @@ export default {
*/ */
updateChart() { updateChart() {
if (!this.myChart) { if (!this.myChart) {
console.warn('图表实例未初始化'); console.warn("图表实例未初始化");
return; return;
} }
try { try {
this.myChart.setOption(this.chartOption, true); // true 表示不合并,使用新配置 this.myChart.setOption(this.chartOption, true); // true 表示不合并,使用新配置
} catch (error) { } catch (error) {
console.error('图表更新失败:', error); console.error("图表更新失败:", error);
} }
}, },
...@@ -280,7 +282,8 @@ export default { ...@@ -280,7 +282,8 @@ export default {
*/ */
initChart() { initChart() {
const chartDom = this.$refs.pieChart; const chartDom = this.$refs.pieChart;
if (!chartDom) return; if (!chartDom)
return;
this.myChart = echarts.init(chartDom); this.myChart = echarts.init(chartDom);
// 初始时使用空数据,等待API数据加载后再更新 // 初始时使用空数据,等待API数据加载后再更新
...@@ -296,7 +299,7 @@ export default { ...@@ -296,7 +299,7 @@ export default {
} }
}, },
} },
}; };
</script> </script>
...@@ -385,7 +388,7 @@ $bg-white: #fff; ...@@ -385,7 +388,7 @@ $bg-white: #fff;
} }
.legend-sep { .legend-sep {
color: #E4E7ED; color: #e4e7ed;
margin: 0 8px; margin: 0 8px;
} }
} }
...@@ -415,4 +418,3 @@ $bg-white: #fff; ...@@ -415,4 +418,3 @@ $bg-white: #fff;
} }
} }
</style> </style>
<template> <template>
<baseDialog :is-show.sync="dialogShow" <baseDialog class="filtrate-dialog"
:dialog-config="dialogConfig.config"
:config="config" :config="config"
class="filtrate-dialog" :dialog-config="dialogConfig.config"
:is-show.sync="dialogShow"
@handleClick="submit"> @handleClick="submit">
<div class="filtrate-body"> <div class="filtrate-body">
<div class="filtrate-form"> <div class="filtrate-form">
<div class="filter-group"> <div class="filter-group">
<span class="label">区域:</span> <span class="label">区域:</span>
<el-select v-model="formData.provinceId" <el-select v-model="formData.provinceId"
size="small"
placeholder="全部"
class="filter-select" class="filter-select"
clearable
filterable filterable
clearable> placeholder="全部"
size="small">
<el-option v-for="item in provinceOptions" <el-option v-for="item in provinceOptions"
:key="item.code" :key="item.code"
:label="item.name" :label="item.name"
...@@ -24,25 +24,25 @@ ...@@ -24,25 +24,25 @@
<div class="filter-group"> <div class="filter-group">
<span class="label">品牌:</span> <span class="label">品牌:</span>
<el-cascader v-model="formData.brand" <el-cascader v-model="formData.brand"
:options="brandOptions" class="filter-select filter-select-brand"
:props="cascaderProps" clearable
collapse-tags collapse-tags
size="small"
filterable filterable
class="filter-select filter-select-brand" :options="brandOptions"
placeholder="全部" placeholder="全部"
:props="cascaderProps"
:show-all-levels="false" :show-all-levels="false"
clearable> size="small">
</el-cascader> </el-cascader>
</div> </div>
<div class="filter-group"> <div class="filter-group">
<span class="label">区域运营:</span> <span class="label">区域运营:</span>
<el-select v-model="formData.regionOps" <el-select v-model="formData.regionOps"
size="small"
placeholder="全部"
class="filter-select" class="filter-select"
clearable
filterable filterable
clearable> placeholder="全部"
size="small">
<el-option v-for="item in regionOpsOptions" <el-option v-for="item in regionOpsOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
...@@ -53,11 +53,11 @@ ...@@ -53,11 +53,11 @@
<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.onlineOps"
size="small"
placeholder="全部"
class="filter-select" class="filter-select"
clearable
filterable filterable
clearable> placeholder="全部"
size="small">
<el-option v-for="item in onlineOpsOptions" <el-option v-for="item in onlineOpsOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
...@@ -65,6 +65,21 @@ ...@@ -65,6 +65,21 @@
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<div class="filter-group">
<span class="label">区域督导:</span>
<el-select v-model="formData.supervisorOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
<el-option v-for="item in supervisorOpsOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div> </div>
</div> </div>
</baseDialog> </baseDialog>
...@@ -82,10 +97,11 @@ export default { ...@@ -82,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: {
...@@ -104,6 +120,10 @@ export default { ...@@ -104,6 +120,10 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
supervisorOpsOptions: {
type: Array,
default: () => [],
},
cascaderProps: { cascaderProps: {
type: Object, type: Object,
default: () => ({}), default: () => ({}),
...@@ -144,13 +164,17 @@ export default { ...@@ -144,13 +164,17 @@ export default {
}, },
}, },
methods: { methods: {
getDefaultOnlineOps() {
const { roleName, uuid } = this.$store.state.d2admin.user.info?.detail || {};
return roleName === "线上运营" ? uuid : "";
},
getInitialFormData() { getInitialFormData() {
return { return {
region: "", region: "",
provinceId: "", provinceId: "",
brand: [], brand: [],
regionOps: "", regionOps: "",
onlineOps: "", onlineOps: this.getDefaultOnlineOps(),
}; };
}, },
syncFormFromFilters() { syncFormFromFilters() {
...@@ -160,7 +184,7 @@ export default { ...@@ -160,7 +184,7 @@ export default {
provinceId: provinceId || "", provinceId: provinceId || "",
brand: Array.isArray(brand) ? brand.map(item => (Array.isArray(item) ? [...item] : item)) : [], brand: Array.isArray(brand) ? brand.map(item => (Array.isArray(item) ? [...item] : item)) : [],
regionOps: regionOps || "", regionOps: regionOps || "",
onlineOps: onlineOps || "", onlineOps: onlineOps || this.getDefaultOnlineOps(),
}; };
}, },
submit() { submit() {
...@@ -201,11 +225,17 @@ $text-sub: #333333; ...@@ -201,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="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" <!-- {{ cardData }} -->
<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,71 +24,84 @@ ...@@ -23,71 +24,84 @@
<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.mainBrandsStr }}
</div> </div>
</template> </template>
<span class="val">{{ cardData.mainBrands || '-' }}</span> <span class="val">{{ cardData.mainBrandsStr || '-' }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="row-item"> <div class="row-item">
<span class="label">线上运营:</span> <span class="label">线上运营:</span>
<el-tooltip :disabled="!cardData.onlineOperators" <el-tooltip :disabled="!onlineOperatorText"
effect="dark" effect="dark"
placement="top" placement="top"
popper-class="dark-tooltip"> popper-class="dark-tooltip">
<template #content> <template #content>
<div style="max-width:236px;line-height:1.6;"> <div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ cardData.onlineOperators }} {{ onlineOperatorText }}
</div> </div>
</template> </template>
<span class="val">{{ cardData.onlineOperators || '-' }}</span> <span class="val">{{ onlineOperatorText || '-' }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="row-item"> <div class="row-item">
<span class="label">区域运营:</span> <span class="label">区域运营:</span>
<el-tooltip :disabled="!cardData.regionalOperators" <el-tooltip :disabled="!areaOperatorText"
effect="dark" effect="dark"
placement="top" placement="top"
popper-class="dark-tooltip"> popper-class="dark-tooltip">
<template #content> <template #content>
<div style="max-width:236px;line-height:1.6;"> <div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ cardData.regionalOperators }} {{ areaOperatorText }}
</div> </div>
</template> </template>
<span class="val">{{ cardData.regionalOperators || '-' }}</span> <span class="val">{{ areaOperatorText || '-' }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="row-item"> <div class="row-item">
<span class="label">区域督导:</span> <span class="label">区域督导:</span>
<el-tooltip :disabled="!cardData.regionalOperators" <el-tooltip :disabled="!flightSupervisionText"
effect="dark" effect="dark"
placement="top" placement="top"
popper-class="dark-tooltip"> popper-class="dark-tooltip">
<template #content> <template #content>
<div style="max-width:236px;line-height:1.6;"> <div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ cardData.regionalOperators }} {{ flightSupervisionText }}
</div> </div>
</template> </template>
<span class="val">{{ cardData.regionalOperators || '-' }}</span> <span class="val">{{ flightSupervisionText || '-' }}</span>
</el-tooltip> </el-tooltip>
</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 :src="getAlertIcon(item)" <img alt=""
alt="" class="icon-img"
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> </div>
</div> </div>
...@@ -95,10 +109,10 @@ ...@@ -95,10 +109,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>
...@@ -129,6 +143,36 @@ export default { ...@@ -129,6 +143,36 @@ 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: {},
};
},
computed: {
onlineOperatorText() {
const list = this.cardData.onlineOperator;
if (!Array.isArray(list) || !list.length)
return "";
return list.map(item => item.username).filter(Boolean).join("/");
},
areaOperatorText() {
const list = this.cardData.areaOperator;
if (!Array.isArray(list) || !list.length)
return "";
return list.map(item => item.username).filter(Boolean).join("/");
},
flightSupervisionText() {
const list = this.cardData.flightSupervision;
if (!Array.isArray(list) || !list.length)
return "";
return list.map(item => item.username).filter(Boolean).join("/");
},
}, },
methods: { methods: {
handleCheckboxChange() { handleCheckboxChange() {
...@@ -142,6 +186,8 @@ export default { ...@@ -142,6 +186,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 +213,31 @@ export default { ...@@ -167,15 +213,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>
...@@ -247,6 +309,8 @@ $text-orange: #ff7d00; ...@@ -247,6 +309,8 @@ $text-orange: #ff7d00;
white-space: nowrap; white-space: nowrap;
} }
.val { .val {
flex: 1;
min-width: 0;
color: $text-main; color: $text-main;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
...@@ -268,8 +332,18 @@ $text-orange: #ff7d00; ...@@ -268,8 +332,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;
......
<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: {
// 处理选择 // 根据选项 value(即 warningType)动态获取图标,逻辑与 monitorCard.getAlertIcon 一致
getOptionIcon(item) {
if (!item || item.value == null) {
return null;
}
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"),
};
const key = item.value ?? item.warningType;
return iconMap[key] || iconMap[2];
},
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 +130,7 @@ export default { ...@@ -143,7 +130,7 @@ export default {
color: #333333; color: #333333;
&:hover { &:hover {
color: #2A58AD; color: #2a58ad;
} }
i { i {
...@@ -160,51 +147,44 @@ export default { ...@@ -160,51 +147,44 @@ 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 {
margin-right: 8px;
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>
<template> <template>
<baseDialog <baseDialog class="detail-content"
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
@handleClick="submit"
:config="config" :config="config"
> :dialog-config="dialogConfig.config"
<div :is-show.sync="dialogShow"
class="content" @handleClick="submit">
:key="viewKey" <div :key="viewKey"
> class="content">
<div class="left"> <div class="left">
<div class="title flex">录音列表</div> <div class="title flex">
录音列表
</div>
<div class="left-content"> <div class="left-content">
<div class="search-box flex"> <div class="search-box flex">
<el-input <el-input v-model="searchForm.staffName"
placeholder="搜索员工名称"
size="small"
class="search-input" class="search-input"
clearable clearable
v-model="searchForm.staffName" placeholder="搜索员工名称"
></el-input> size="small">
<el-date-picker </el-input>
v-model="searchForm.receptionDate" <el-date-picker v-model="searchForm.receptionDate"
size="small"
type="date"
class="search-input" class="search-input"
placeholder="搜索接待日期" placeholder="搜索接待日期"
> size="small"
type="date">
</el-date-picker> </el-date-picker>
<el-button <el-button size="small"
type="primary" type="primary"
size="small" @click="handleSearch">
@click="handleSearch" 查询
>查询</el-button> </el-button>
<el-button <el-button size="small"
size="small" @click="handleReset">
@click="handleReset" 重置
>重置</el-button> </el-button>
</div> </div>
<div class="table"> <div class="table">
<d2-table <d2-table ref="multipleTable"
ref="multipleTable" :before-search-fn="beforeSearchFn"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:has-num="false" :has-num="false"
:layout="'total, prev, pager, next'" layout="total, prev, pager, next"
:pagerCount="5" :pager-count="5"
@setTableFinishFun="setTableFinishFun" :search-form="searchFormSearch"
@selectionTable="selectionTable" :table-params="tableParams"
@selectRow="selectRow"
@selectAll="selectAll" @selectAll="selectAll"
:before-search-fn="beforeSearchFn" @selectRow="selectRow"
> @selectionTable="selectionTable"
@setTableFinishFun="setTableFinishFun">
</d2-table> </d2-table>
</div> </div>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<div class="title flex"> <div class="title flex">
已选录音<div class="num">{{ count }}</div>条 已选录音<div class="num">
<el-button {{ count }}
class="clear" </div>条
<el-button class="clear"
type="text" type="text"
@click="clearChooseList" @click="clearChooseList">
>清空</el-button> 清空
</el-button>
</div> </div>
<div class="right-content"> <div class="right-content">
<el-scrollbar class="multiple-tag-box"> <el-scrollbar class="multiple-tag-box">
<div class="multiple-tags"> <div class="multiple-tags">
<template v-for="(i,ind) in chooseList"> <template v-for="(i, ind) in chooseList">
<el-tag <el-tag :key="ind"
closable closable
:key="ind"
@close="remove(i,ind)"
disable-transitions disable-transitions
>{{ i.chooseContent }}</el-tag> @close="remove(i, ind)">
{{ i.chooseContent }}
</el-tag>
</template> </template>
</div> </div>
</el-scrollbar> </el-scrollbar>
...@@ -87,36 +82,35 @@ ...@@ -87,36 +82,35 @@
</template> </template>
<script> <script>
import dayjs from "dayjs";
import { import {
getRecordAllPageListByCondition, getRecordAllPageListByCondition,
} from '@/api/earlyWarningManager' } from "@/api/earlyWarningManager";
import multipleMixin from "./multipleMixin"; import multipleMixin from "./multipleMixin";
import dayjs from 'dayjs';
export default { export default {
name: "MultipleRecording", name: "MultipleRecording",
mixins: [multipleMixin], mixins: [multipleMixin],
mounted () { data() {
},
data () {
return { return {
dialogConfig: { dialogConfig: {
config: { config: {
title: "选择录音", title: "选择录音",
width: "1092px" width: "1092px",
} },
}, },
targetId: 'id', targetId: "id",
formatTag: (e) => { formatTag: (e) => {
return { return {
...e, ...e,
chooseContent: `${e.employeeName} ${e.startTime}` chooseContent: `${e.employeeName} ${e.startTime}`,
} };
}, },
getListApi: getRecordAllPageListByCondition, getListApi: getRecordAllPageListByCondition,
searchForm: { searchForm: {
staffName: '', staffName: "",
receptionDate: '', receptionDate: "",
businessType: 1 businessType: 1,
}, },
searchFormSearch: {}, searchFormSearch: {},
tableParams: { tableParams: {
...@@ -127,52 +121,59 @@ export default { ...@@ -127,52 +121,59 @@ export default {
{ {
label: "员工姓名", label: "员工姓名",
prop: "employeeName", prop: "employeeName",
minWidth: 90 minWidth: 90,
}, },
{ {
label: "接待时间", label: "接待时间",
prop: "startTime", prop: "startTime",
minWidth: 90 minWidth: 90,
}, },
{ {
label: "客户姓名", label: "客户姓名",
prop: "customerName", prop: "customerName",
minWidth: 90 minWidth: 90,
}, },
{ {
label: "车型", label: "车型",
prop: "carModel", prop: "carModel",
minWidth: 90 minWidth: 90,
}, },
{ {
label: "接待时长", label: "接待时长",
prop: "duration", prop: "duration",
minWidth: 90 minWidth: 90,
}, },
{ {
label: "质检评分/分", label: "质检评分/分",
prop: "score", prop: "score",
minWidth: 90 minWidth: 90,
}, },
{ {
label: "攻防得分/分", label: "攻防得分/分",
prop: "defencePoint", prop: "defencePoint",
minWidth: 90 minWidth: 90,
}, },
] {
label: "成交状态",
prop: "defencePoint",
minWidth: 90,
}, },
} ],
},
};
},
mounted() {
}, },
methods: { methods: {
getParams () { getParams() {
let params = this.deepClone(this.searchForm) let params = this.deepClone(this.searchForm);
if (params.receptionDate) { if (params.receptionDate) {
params.receptionDate = dayjs(params.receptionDate).format("YYYY-MM-DD") params.receptionDate = dayjs(params.receptionDate).format("YYYY-MM-DD");
} }
return params return params;
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<template> <template>
<baseDialog <baseDialog class="detail-content"
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
@handleClick="submit"
:config="config" :config="config"
> :dialog-config="dialogConfig.config"
<div :is-show.sync="dialogShow"
class="content" @handleClick="submit">
:key="viewKey" <div :key="viewKey"
> class="content">
<div class="left"> <div class="left">
<div class="title flex">人员列表</div> <div class="title flex">
人员列表
</div>
<div class="left-content"> <div class="left-content">
<div class="search-box flex"> <div class="search-box flex">
<el-input <el-input v-model="searchForm.staffName"
placeholder="搜索员工名称"
size="small"
class="search-input" class="search-input"
clearable clearable
v-model="searchForm.staffName" placeholder="搜索员工名称"
></el-input> size="small">
<el-button </el-input>
<el-button size="small"
type="primary" type="primary"
size="small" @click="handleSearch">
@click="handleSearch" 查询
>查询</el-button> </el-button>
<el-button <el-button size="small"
size="small" @click="handleReset">
@click="handleReset" 重置
>重置</el-button> </el-button>
</div> </div>
<div class="table"> <div class="table">
<d2-table <d2-table ref="multipleTable"
ref="multipleTable" :before-search-fn="beforeSearchFn"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:has-num="false" :has-num="false"
:layout="'total, prev, pager, next'" layout="total, prev, pager, next"
:pagerCount="5" :pager-count="5"
@setTableFinishFun="setTableFinishFun" :search-form="searchFormSearch"
@selectionTable="selectionTable" :table-params="tableParams"
@selectRow="selectRow"
@selectAll="selectAll" @selectAll="selectAll"
:before-search-fn="beforeSearchFn" @selectRow="selectRow"
> @selectionTable="selectionTable"
@setTableFinishFun="setTableFinishFun">
</d2-table> </d2-table>
</div> </div>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<div class="title flex"> <div class="title flex">
已选人员<div class="num">{{ count }}</div>人 已选人员<div class="num">
<el-button {{ count }}
class="clear" </div>人
<el-button class="clear"
type="text" type="text"
@click="clearChooseList" @click="clearChooseList">
>清空</el-button> 清空
</el-button>
</div> </div>
<div class="right-content"> <div class="right-content">
<el-scrollbar class="multiple-tag-box"> <el-scrollbar class="multiple-tag-box">
<div class="multiple-tags"> <div class="multiple-tags">
<template v-for="(i,ind) in chooseList"> <template v-for="(i, ind) in chooseList">
<el-tag <el-tag :key="ind"
closable closable
:key="ind"
@close="remove(i,ind)"
disable-transitions disable-transitions
>{{ i.staffName }}</el-tag> @close="remove(i, ind)">
{{ i.staffName }}
</el-tag>
</template> </template>
</div> </div>
</el-scrollbar> </el-scrollbar>
...@@ -81,26 +78,24 @@ ...@@ -81,26 +78,24 @@
<script> <script>
import { import {
getStrategyStaffList, getStrategyStaffList,
} from "@api/earlyWarningManager" } from "@api/earlyWarningManager";
import multipleMixin from "./multipleMixin"; import multipleMixin from "./multipleMixin";
export default { export default {
name: "MultipleStaff", name: "MultipleStaff",
mixins: [multipleMixin], mixins: [multipleMixin],
mounted () { data() {
},
data () {
return { return {
dialogConfig: { dialogConfig: {
config: { config: {
title: "选择人员", title: "选择人员",
width: "1092px" width: "1092px",
}
}, },
targetId: 'staffUuid', },
targetId: "staffUuid",
getListApi: getStrategyStaffList, getListApi: getStrategyStaffList,
searchForm: { searchForm: {
staffName: '' staffName: "",
}, },
tableParams: { tableParams: {
listName: "list", listName: "list",
...@@ -110,51 +105,54 @@ export default { ...@@ -110,51 +105,54 @@ export default {
{ {
label: "员工姓名", label: "员工姓名",
prop: "staffName", prop: "staffName",
minWidth: 130 minWidth: 130,
}, },
{ {
label: "手机号", label: "手机号",
prop: "phoneNumber", prop: "phoneNumber",
minWidth: 160 minWidth: 160,
}, },
{ {
label: "岗位", label: "岗位",
minWidth: 130, minWidth: 130,
formatter (row) { formatter(row) {
return { return {
0: '驻店人员', 0: "驻店人员",
6: '飞行督导', 6: "飞行督导",
9: '区域运营' 9: "区域运营",
}[row.positionType] }[row.positionType];
}
}, },
]
}, },
} ],
},
};
},
mounted() {
}, },
methods: { methods: {
beforeSearchFn () { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
let { positionTypeList, merchantList, paramsInfo, delMerchantList } = this;
let { positionTypeList, merchantList, paramsInfo ,delMerchantList} = this, let { staffName } = this.searchForm;
{ staffName } = this.searchForm, let merchantIdList = [];
merchantIdList = [] if (merchantList.length)
if (merchantList.length) merchantIdList = merchantList.map(item => item.merchantId) merchantIdList = merchantList.map(item => item.merchantId);
else merchantIdList = paramsInfo.merchantIds else merchantIdList = paramsInfo.merchantIds;
let params = { let params = {
positionTypeList, positionTypeList,
sceneType: 0, sceneType: paramsInfo.bizs == 2 ? 1 : 0, // 业务场景(0.会员权益(延保权益),1.精品升级(轻改))
staffName, staffName,
merchantIdList merchantIdList,
} };
if(delMerchantList) params.merchantIdList = [] if (delMerchantList)
params.merchantIdList = [];
this.searchFormSearch = this.deepClone(params) this.searchFormSearch = this.deepClone(params);
resolve() resolve();
}) });
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
const STRATEGYTYPEOPTIONS = [ const STRATEGYTYPEOPTIONS = [
{ label: '学习', value: 0 }, { label: "学习", value: 0 },
{ label: '优秀案例分享', value: 1 }, { label: "优秀案例分享", value: 1 },
{ label: '带教', value: 2 }, { label: "带教", value: 2 },
{ label: '任务下发', value: 3 }, { label: "任务下发", value: 3 },
{ label: '销售精英到店提拉', value: 4 }, { label: "销售精英到店提拉", value: 4 },
{ label: '强力促销', value: 5 }, { label: "强力促销", value: 5 },
{ label: '最终盘点与低客单产品购入', value: 6 }, { label: "最终盘点与低客单产品购入", value: 6 },
] ];
/** /**
*positionTypeList: 0:驻店,6:飞行督导,9:2.1区域运营 *positionTypeList: 0:驻店,6:飞行督导,9:2.1区域运营
*/ */
const STRATEGY_FORM_0 = [ const STRATEGY_FORM_0 = [
{ {
label: '标题', label: "标题",
type: 'input', type: "input",
key: 'title', key: "title",
maxlength: 20, maxlength: 20,
}, },
{ {
label: '学习人员', label: "学习人员",
type: 'multipleTag', type: "multipleTag",
btnText: '选择人员', btnText: "选择人员",
componentName: 'staffTag', componentName: "staffTag",
key: 'staffList', key: "staffList",
positionTypeList: [0], positionTypeList: [0],
tagNameKey: 'staffName' tagNameKey: "staffName",
}, },
{ {
label: '学习内容', label: "学习内容",
type: 'multipleTag', type: "multipleTag",
btnText: '选择课程', btnText: "选择课程",
componentName: 'courseTag', componentName: "courseTag",
key: 'courseList', key: "courseList",
tagKey: 'courseId', tagKey: "courseId",
tagNameKey: 'title' tagNameKey: "title",
}, },
{ {
label: '执行周期', label: "执行周期",
type: 'daterange', type: "daterange",
key: 'dateRange', key: "dateRange",
pickerOptions: 'afterPickerOptions' pickerOptions: "afterPickerOptions",
}, },
] ];
const STRATEGY_FORM_1 = [ const STRATEGY_FORM_1 = [
{ {
label: '标题', label: "标题",
type: 'input', type: "input",
key: 'title', key: "title",
maxlength: 20, maxlength: 20,
}, },
{ {
label: '学习人员', label: "学习人员",
type: 'multipleTag', type: "multipleTag",
btnText: '选择人员', btnText: "选择人员",
componentName: 'staffTag', componentName: "staffTag",
key: 'staffList', key: "staffList",
positionTypeList: [0], positionTypeList: [0],
tagNameKey: 'staffName' tagNameKey: "staffName",
}, },
{ {
label: '学习内容', label: "学习内容",
type: 'multipleTag', type: "multipleTag",
btnText: '选择录音', btnText: "选择录音",
componentName: 'recordingTag', componentName: "recordingTag",
key: 'recordingList', key: "recordingList",
tagKey: 'id', tagKey: "id",
tagNameKey: 'chooseContent' tagNameKey: "chooseContent",
}, },
{ {
label: '执行周期', label: "执行周期",
type: 'daterange', type: "daterange",
key: 'dateRange', key: "dateRange",
pickerOptions: 'afterPickerOptions' pickerOptions: "afterPickerOptions",
}, },
] ];
const STRATEGY_FORM_2456 = [ const STRATEGY_FORM_2456 = [
{ {
label: '执行人员', label: "执行人员",
type: 'multipleTag', type: "multipleTag",
btnText: '选择人员', btnText: "选择人员",
componentName: 'staffTag', componentName: "staffTag",
key: 'staffList', key: "staffList",
hide: (val) => { hide: (val) => {
let { strategyType } = val let { strategyType } = val;
return [5, 6].includes(strategyType) return [5, 6].includes(strategyType);
}, },
positionTypeList: [0, 6, 9], positionTypeList: [0, 6, 9],
tagNameKey: 'staffName', tagNameKey: "staffName",
delMerchantList: true delMerchantList: true,
}, },
{ {
label: '执行周期', label: "执行周期",
type: 'daterange', type: "daterange",
key: 'dateRange', key: "dateRange",
pickerOptions: 'afterPickerOptions' pickerOptions: "afterPickerOptions",
}, },
] ];
const STRATEGY_FORM_3 = [ const STRATEGY_FORM_3 = [
{ {
label: '标题', label: "标题",
type: 'input', type: "input",
key: 'title', key: "title",
maxlength: 20, maxlength: 20,
}, },
{ {
label: '副标题', label: "副标题",
type: 'input', type: "input",
maxlength: 200, maxlength: 200,
key: 'subTitle' key: "subTitle",
}, },
{ {
label: '内容', label: "内容",
type: 'richText', type: "richText",
key: 'content', key: "content",
}, },
{ {
label: '处理人', label: "处理人",
type: 'checkbox', type: "checkbox",
key: 'handlerType', key: "handlerType",
options: [ options: [
{ label: '区域运营', value: 0 }, { label: "区域运营", value: 0 },
{ label: '驻店人员', value: 1 }, { label: "驻店人员", value: 1 },
] ],
}, },
{ {
label: '区域运营', label: "区域运营",
type: 'multipleTag', type: "multipleTag",
btnText: '选择人员', btnText: "选择人员",
componentName: 'staffTag', componentName: "staffTag",
key: 'staffList', key: "staffList",
hide: (val) => { hide: (val) => {
let { handlerType } = val let { handlerType } = val;
return !handlerType.includes(0) return !handlerType.includes(0);
}, },
positionTypeList: [9], positionTypeList: [9],
tagNameKey: 'staffName' tagNameKey: "staffName",
}, },
{ {
label: '驻店人员', label: "驻店人员",
type: 'multipleTag', type: "multipleTag",
btnText: '选择人员', btnText: "选择人员",
componentName: 'staffTag1', componentName: "staffTag1",
key: 'staffList_1', key: "staffList_1",
hide: (val) => { hide: (val) => {
let { handlerType } = val let { handlerType } = val;
return !handlerType.includes(1) return !handlerType.includes(1);
}, },
positionTypeList: [0], positionTypeList: [0],
tagNameKey: 'staffName' tagNameKey: "staffName",
}, },
{ {
label: '执行时间', label: "执行时间",
type: 'radioTime', type: "radioTime",
key: 'pushType', key: "pushType",
pickerOptions: 'afterPickerOptions', pickerOptions: "afterPickerOptions",
timeKey: 'pushTime', timeKey: "pushTime",
options: [ options: [
{ label: '立即推送', value: 1 }, { label: "立即推送", value: 1 },
{ label: '定时推送', value: 0 }, { label: "定时推送", value: 0 },
], ],
showDateTimePicker: (val) => { showDateTimePicker: (val) => {
let { pushType } = val let { pushType } = val;
return pushType == 0 return pushType == 0;
}, },
pickerOptions: 'afterTwoHourPickerOptions' pickerOptions: "afterTwoHourPickerOptions",
}, },
] ];
const TITLE_RULES = [{ required: true, message: '请输入标题', trigger: 'blur' }] const TITLE_RULES = [{ required: true, message: "请输入标题", trigger: "blur" }];
const STAFF_LIST_RULES = { required: true, message: '请选择学习人员' } const STAFF_LIST_RULES = { required: true, message: "请选择学习人员" };
const STUDY_LIST_RULES = { required: true, message: '请选择学习内容' } const STUDY_LIST_RULES = { required: true, message: "请选择学习内容" };
const RANGE_DATE = [{ required: true, message: '请选择执行周期', trigger: 'blur' }] const RANGE_DATE = [{ required: true, message: "请选择执行周期", trigger: "blur" }];
const DESCRIPTION_RULES = [{ required: true, message: '请输入策略说明', trigger: 'blur' }] const DESCRIPTION_RULES = [{ required: true, message: "请输入策略说明", trigger: "blur" }];
const STRATEGY_FORM_RULES_0 = { const STRATEGY_FORM_RULES_0 = {
title: TITLE_RULES, title: TITLE_RULES,
staffList: STAFF_LIST_RULES, staffList: STAFF_LIST_RULES,
courseList: STUDY_LIST_RULES, courseList: STUDY_LIST_RULES,
dateRange: RANGE_DATE, dateRange: RANGE_DATE,
description: DESCRIPTION_RULES description: DESCRIPTION_RULES,
} };
const STRATEGY_FORM_RULES_1 = { const STRATEGY_FORM_RULES_1 = {
title: TITLE_RULES, title: TITLE_RULES,
staffList: STAFF_LIST_RULES, staffList: STAFF_LIST_RULES,
recordingList: STUDY_LIST_RULES, recordingList: STUDY_LIST_RULES,
dateRange: RANGE_DATE, dateRange: RANGE_DATE,
description: DESCRIPTION_RULES description: DESCRIPTION_RULES,
} };
const STRATEGY_FORM_RULES_2456 = { const STRATEGY_FORM_RULES_2456 = {
dateRange: RANGE_DATE, dateRange: RANGE_DATE,
description: DESCRIPTION_RULES description: DESCRIPTION_RULES,
} };
const STRATEGY_FORM_RULES_3 = { const STRATEGY_FORM_RULES_3 = {
title: TITLE_RULES, title: TITLE_RULES,
// subTitle: [{ required: true, message: '请输入副标题', trigger: 'blur' }], // subTitle: [{ required: true, message: '请输入副标题', trigger: 'blur' }],
content: [ content: [
{ required: true, message: '请输入内容', trigger: 'blur' } { required: true, message: "请输入内容", trigger: "blur" },
], ],
handlerType: [ handlerType: [
{ required: true, message: '请选择处理人', trigger: 'change' } { required: true, message: "请选择处理人", trigger: "change" },
], ],
staffList: [{ required: true, message: '请选择区域运营' }], staffList: [{ required: true, message: "请选择区域运营" }],
staffList_1: [{ required: true, message: '请选择驻店人员' }], staffList_1: [{ required: true, message: "请选择驻店人员" }],
description: DESCRIPTION_RULES description: DESCRIPTION_RULES,
} };
export { export {
STRATEGYTYPEOPTIONS,
STRATEGY_FORM_0, STRATEGY_FORM_0,
STRATEGY_FORM_1, STRATEGY_FORM_1,
STRATEGY_FORM_2456,
STRATEGY_FORM_3, STRATEGY_FORM_3,
STRATEGY_FORM_2456,
STRATEGY_FORM_RULES_0, STRATEGY_FORM_RULES_0,
STRATEGY_FORM_RULES_1, STRATEGY_FORM_RULES_1,
STRATEGY_FORM_RULES_3,
STRATEGY_FORM_RULES_2456, STRATEGY_FORM_RULES_2456,
STRATEGY_FORM_RULES_3
}
\ No newline at end of file \ No newline at end of file
STRATEGYTYPEOPTIONS,
};
\ No newline at end of file \ No newline at end of file
...@@ -2,69 +2,70 @@ export default { ...@@ -2,69 +2,70 @@ export default {
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
chooseData: { chooseData: {
type: Array, type: Array,
default: () => [] default: () => [],
} },
}, },
inject: [ inject: [
'deepClone', "deepClone",
'GET_POSITION_TYPE_LIST', "GET_POSITION_TYPE_LIST",
'GET_PARAMS_INFO', "GET_PARAMS_INFO",
'GET_MERCHANT_LIST', "GET_MERCHANT_LIST",
'GET_BIZ', "GET_BIZ",
'DEL_PARAMS_MERCHANT_LIST' "DEL_PARAMS_MERCHANT_LIST",
], ],
computed: { computed: {
dialogShow: { dialogShow: {
get () { get() {
return this.visible return this.visible;
}, },
set (val) { set(val) {
this.chooseList = [] this.chooseList = [];
this.close() this.close();
}
}, },
count () {
return this.chooseList.length
}, },
positionTypeList () { count() {
return this.GET_POSITION_TYPE_LIST && this.GET_POSITION_TYPE_LIST() return this.chooseList.length;
}, },
paramsInfo () { positionTypeList() {
return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO() return this.GET_POSITION_TYPE_LIST && this.GET_POSITION_TYPE_LIST();
}, },
merchantList () { paramsInfo() {
return this.GET_MERCHANT_LIST && this.GET_MERCHANT_LIST() return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO();
}, },
biz () { merchantList() {
return this.GET_BIZ && this.GET_BIZ() return this.GET_MERCHANT_LIST && this.GET_MERCHANT_LIST();
},
biz() {
return this.GET_BIZ && this.GET_BIZ();
},
delMerchantList() {
return this.DEL_PARAMS_MERCHANT_LIST && this.DEL_PARAMS_MERCHANT_LIST();
}, },
delMerchantList(){
return this.DEL_PARAMS_MERCHANT_LIST && this.DEL_PARAMS_MERCHANT_LIST()
}
}, },
watch: { watch: {
visible: { visible: {
handler (val) { handler(val) {
if (val) { if (val) {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm;
let multipleTable = this.multipleTable() let multipleTable = this.multipleTable();
if (multipleTable) multipleTable.page.currentPage = 1 if (multipleTable)
this.chooseList = this.deepClone(this.chooseData) multipleTable.page.currentPage = 1;
this.viewKey = Date.now() this.chooseList = this.deepClone(this.chooseData);
this.viewKey = Date.now();
} }
}, },
immediate: true, immediate: true,
deep: true deep: true,
}, },
}, },
mounted () { mounted() {
}, },
data () { data() {
return { return {
viewKey: Date.now(), viewKey: Date.now(),
config: { config: {
...@@ -75,93 +76,97 @@ export default { ...@@ -75,93 +76,97 @@ export default {
}, },
searchFormSearch: {}, searchFormSearch: {},
chooseList: [], chooseList: [],
} };
}, },
methods: { methods: {
getParams () { getParams() {
const params = this.deepClone(this.searchForm) const params = this.deepClone(this.searchForm);
return params return params;
}, },
beforeSearchFn () { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
this.searchFormSearch = this.getParams() this.searchFormSearch = this.getParams();
resolve() resolve();
}) });
}, },
close () { close() {
this.$emit('dialogClose') this.$emit("dialogClose");
}, },
remove (i, index) { remove(i, index) {
this.chooseList.splice(index, 1) this.chooseList.splice(index, 1);
let tableData = this.multipleTable().data let tableData = this.multipleTable().data;
tableData.map(j => { tableData.map((j) => {
if (i[this.targetId] === j[this.targetId]) { if (i[this.targetId] === j[this.targetId]) {
this.multipleTable().tableRef.toggleRowSelection(j, false) this.multipleTable().tableRef.toggleRowSelection(j, false);
} }
}) });
}, },
async submit () { async submit() {
this.$emit('choose', this.chooseList) this.$emit("choose", this.chooseList);
this.close() this.close();
}, },
handleReset () { handleReset() {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm;
this.multipleTable().page.currentPage = 1 this.multipleTable().page.currentPage = 1;
this.handleSearch() this.handleSearch();
}, },
handleSearch () { handleSearch() {
this.multipleTable().page.currentPage = 1 this.multipleTable().page.currentPage = 1;
this.multipleTable().refreshTable() this.multipleTable().refreshTable();
}, },
setTableFinishFun (data) { setTableFinishFun(data) {
this.$nextTick(() => { this.$nextTick(() => {
let { chooseList, targetId } = this let { chooseList, targetId } = this;
chooseList.map(item => { chooseList.map((item) => {
let index = data.findIndex(i => i[targetId] === item[targetId]) let index = data.findIndex(i => i[targetId] === item[targetId]);
if (index > -1) this.multipleTable().tableRef.toggleRowSelection(data[index], true) if (index > -1)
}) this.multipleTable().tableRef.toggleRowSelection(data[index], true);
}) });
}, });
selectionTable (list) { },
selectionTable(list) {
this.$nextTick(() => { this.$nextTick(() => {
let { targetId, chooseList } = this let { targetId, chooseList } = this;
if (this.formatTag) list = list.map(e => { if (this.formatTag) {
return this.formatTag(e) list = list.map((e) => {
}) return this.formatTag(e);
});
}
// 合并列表后基于 targetId 去重 // 合并列表后基于 targetId 去重
const mergedList = [...chooseList, ...list] const mergedList = [...chooseList, ...list];
this.chooseList = [...new Map( this.chooseList = [...new Map(
mergedList.map(item => [item[targetId], item]) mergedList.map(item => [item[targetId], item]),
).values()] ).values()];
}) });
}, },
selectRow (list, row) { selectRow(list, row) {
let { targetId } = this, let { targetId } = this;
index = list.findIndex(i => i[targetId] === row[targetId]) let index = list.findIndex(i => i[targetId] === row[targetId]);
if (index == -1) { if (index == -1) {
let delIndex = this.chooseList.findIndex(i => i[targetId] === row[targetId]) let delIndex = this.chooseList.findIndex(i => i[targetId] === row[targetId]);
if (delIndex > -1) this.chooseList.splice(delIndex, 1) if (delIndex > -1)
this.chooseList.splice(delIndex, 1);
} }
}, },
selectAll (list) { selectAll(list) {
if (!list.length) { if (!list.length) {
let tableData = this.multipleTable().data, let tableData = this.multipleTable().data;
{ targetId } = this let { targetId } = this;
// 使用 Set 存储 tableData 中的所有 targetId // 使用 Set 存储 tableData 中的所有 targetId
const tableDataIds = new Set(tableData.map(item => item[targetId])); const tableDataIds = new Set(tableData.map(item => item[targetId]));
// 保留 chooseList 中不在 tableData 的项目 // 保留 chooseList 中不在 tableData 的项目
this.chooseList = this.chooseList.filter(item => this.chooseList = this.chooseList.filter(item =>
!tableDataIds.has(item[targetId]) !tableDataIds.has(item[targetId]),
); );
} }
}, },
multipleTable () { multipleTable() {
return this.$refs.multipleTable return this.$refs.multipleTable;
},
clearChooseList() {
this.chooseList = [];
this.multipleTable().clearMutiSelect();
},
}, },
clearChooseList () {
this.chooseList = []
this.multipleTable().clearMutiSelect()
}
}
}
\ No newline at end of file \ No newline at end of file
};
\ No newline at end of file \ No newline at end of file
<template>
<el-drawer ref="drawer"
class="strategy-drawer"
size="50vw"
:visible.sync="dialogShow"
:wrapper-closable="false"
@close="close">
<template #title>
<div class="strategy-drawer-title">
添加协同任务
</div>
</template>
<div class="strategy-drawer-content">
<el-scrollbar class="content">
<el-form ref="form"
class="form"
label-width="110px"
:model="formData"
:rules="rules"
size="small">
<el-form-item label="任务类型:" prop="taskType">
<el-select v-model="formData.taskType"
placeholder="请选择任务类型"
style="width: 100%;">
<el-option v-for="(label, value) in taskTypeOptions"
:key="value"
:label="label"
:value="Number(value)">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="任务标题:" prop="taskTitle">
<el-input v-model="formData.taskTitle"
maxlength="20"
placeholder="请输入标题">
</el-input>
</el-form-item>
<el-form-item v-if="formData.taskType === 9"
label="问题人员:"
prop="staffList">
<el-button size="small" @click="openStaffDialog">
选择人员
</el-button>
<div v-if="formData.staffList && formData.staffList.length > 0" class="tags-container">
<el-tag v-for="(item, index) in formData.staffList"
:key="item.staffUuid"
class="staff-tag"
closable
@close="removeStaff(index)">
{{ item.staffName }}
</el-tag>
</div>
</el-form-item>
<el-form-item label="执行人员:" prop="executorUuid">
<el-select v-model="formData.executorUuid"
placeholder="请选择执行人员"
style="width: 100%;">
<el-option v-for="item in executorList"
:key="item.directorUserId"
:label="item.directorName"
:value="item.directorUserId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="任务说明:" prop="description">
<el-input v-model="formData.description"
maxlength="200"
placeholder="请输入任务说明"
:rows="6"
type="textarea">
</el-input>
</el-form-item>
</el-form>
</el-scrollbar>
<div class="footer">
<el-button v-preventReClick
size="small"
@click="close">
取消
</el-button>
<el-button :loading="loading"
size="small"
type="primary"
@click="confirm">
确定
</el-button>
</div>
</div>
<MultipleStaff ref="staffTagRef"
:choose-data="formData.staffList"
:visible="staffTagVisible"
@choose="handleStaffChoose"
@dialogClose="staffTagVisible = false">
</MultipleStaff>
</el-drawer>
</template>
<script>
import { batchCreateStrategy, getStrategyShopMerchantOperators, getStrategyStaffList } from "@/api/earlyWarningManager";
import MultipleStaff from "../AddStrategy/MultipleStaff.vue";
export default {
name: "AddTask",
components: {
MultipleStaff,
},
inject: ["GET_PARAMS_INFO", "GET_MERCHANT_NAME"],
provide() {
return {
GET_POSITION_TYPE_LIST: () => this.positionTypeList,
GET_MERCHANT_LIST: () => [],
GET_BIZ: () => this.biz,
DEL_PARAMS_MERCHANT_LIST: () => false,
};
},
props: {
visibleSync: {
type: Boolean,
default: false,
},
biz: {
type: Number,
default: 1,
},
},
data() {
return {
loading: false,
taskTypeOptions: {
9: "人员更换评估",
10: "商务政策更新评估",
11: "多品类拓张",
12: "流量问题改善",
},
formData: {
taskType: "",
taskTitle: "",
staffList: [],
executorUuid: "",
description: "",
},
rules: {
taskType: [
{ required: true, message: "请选择任务类型", trigger: "change" },
],
staffList: [
{
validator: (rule, value, callback) => {
if (this.formData.taskType === 9 && (!value || value.length === 0)) {
callback(new Error("请选择问题人员"));
} else {
callback();
}
},
trigger: "change",
},
],
executorUuid: [
{ required: true, message: "请选择执行人员", trigger: "change" },
],
description: [
{ required: true, message: "请输入任务说明", trigger: "blur" },
],
},
staffTagVisible: false,
positionTypeList: [0], // 0:驻店人员
executorList: [], // 区域运营列表
};
},
computed: {
dialogShow: {
get() {
return this.visibleSync;
},
set(val) {
this.$emit("update:visibleSync", val);
},
},
paramsInfo() {
return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO();
},
merchantName() {
return this.GET_MERCHANT_NAME && this.GET_MERCHANT_NAME();
},
},
watch: {
visibleSync(val) {
if (val) {
this.init();
}
},
"formData.taskType": function (val) {
// 切换任务类型时,如果不是人员更换评估,清空问题人员
if (val !== 9) {
this.formData.staffList = [];
}
// 触发重新校验
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.validateField("staffList");
}
});
},
},
methods: {
init() {
this.formData = {
taskType: "",
taskTitle: "",
staffList: [],
executorUuid: "",
description: "",
};
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate();
}
});
this.loadExecutors();
},
close() {
this.dialogShow = false;
},
loadExecutors() {
const params = {
merchantId: this.paramsInfo ? this.paramsInfo.merchantIds[0] : "",
businessType: this.biz,
};
getStrategyShopMerchantOperators(params).then((res) => {
if (res && res.length) {
this.executorList = res;
} else {
this.executorList = [];
}
}).catch(() => {
this.executorList = [];
});
},
openStaffDialog() {
this.staffTagVisible = true;
},
removeStaff(index) {
this.formData.staffList.splice(index, 1);
},
handleStaffChoose(list) {
this.formData.staffList = list;
this.$refs.form.validateField("staffList");
},
confirm() {
try {
this.loading = true;
let { paramsInfo, merchantName, formData, biz } = this;
let { taskType, taskTitle, staffList, executorUuid, description } = formData;
this.$refs.form.validate(async (valid) => {
if (valid) {
const executor = this.executorList.find(item => item.directorUserId === executorUuid);
let params = {
strategyInfo: {
strategyType: taskType,
biz,
title: taskTitle,
description,
},
merchantList: [
{
merchantId: paramsInfo.merchantIds[0],
merchantName,
},
],
};
let allStaffs = [];
if (staffList && staffList.length) {
if (staffList.length > 100) {
this.loading = false;
this.$message.error("最多只能选择100个问题人员");
return;
}
allStaffs = staffList.map(e => ({
userUuid: e.staffUuid,
userName: e.staffName,
userPhone: e.phoneNumber,
userPosition: 0, // 问题人员
}));
}
if (executor) {
allStaffs.push({
userUuid: executor.directorUserId,
userName: executor.directorName,
userPhone: executor.directorPhone,
userPosition: biz === 2 ? 8 : 9, // 执行人员:轻改=8,权益、延保=9
});
}
if (allStaffs.length) {
params.staffList = allStaffs;
}
console.log(params);
const data = await batchCreateStrategy(params);
this.loading = false;
if (data) {
this.$emit("refresh");
this.$message.success("操作成功");
this.close();
} else {
this.$message.error("操作失败");
}
} else {
this.loading = false;
}
});
} catch (error) {
console.log(error, "===");
this.loading = false;
if (error)
this.$message.error(error);
console.log(error);
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep.strategy-drawer {
.el-drawer__header {
padding: 0;
margin: 0;
border-bottom: 1px solid #e5e5e5;
}
.el-drawer__close-btn {
padding: 0 20px;
.el-dialog__close {
font-weight: 700;
font-size: 24px;
}
}
&-title {
height: 26px;
line-height: 26px;
color: #333333;
font-size: 18px;
padding: 17px 20px;
font-weight: bold;
}
&-content {
height: calc(100vh - 61px);
.content {
height: calc(100% - 61px);
.form {
padding: 20px;
.tags-container {
margin-top: 10px;
padding: 10px;
border: 1px solid #e4e7ed;
border-radius: 4px;
min-height: 40px;
max-height: 120px;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.staff-tag {
margin-right: 0;
}
}
}
.footer {
padding: 14px 0;
border-top: 1px solid #e5e5e5;
display: flex;
justify-content: flex-end;
padding-right: 20px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<el-drawer ref="drawer"
class="strategy-drawer"
size="50vw"
:visible.sync="dialogShow"
:wrapper-closable="false"
@close="close">
<template #title>
<div class="strategy-drawer-title">
添加带教申请
</div>
</template>
<div class="strategy-drawer-content">
<el-scrollbar class="content">
<el-form ref="form"
class="form"
label-width="110px"
:model="formData"
:rules="rules"
size="small">
<el-form-item label="需带教人员:" prop="staffList">
<el-button size="small" @click="openStaffDialog">
选择人员
</el-button>
<div v-if="formData.staffList && formData.staffList.length > 0" class="tags-container">
<el-tag v-for="(item, index) in formData.staffList"
:key="item.staffUuid"
class="staff-tag"
closable
@close="removeStaff(index)">
{{ item.staffName }}
</el-tag>
</div>
</el-form-item>
<el-form-item label="申请说明:" prop="description">
<el-input v-model="formData.description"
maxlength="200"
placeholder="请输入申请说明"
:rows="6"
type="textarea">
</el-input>
</el-form-item>
</el-form>
</el-scrollbar>
<div class="footer">
<el-button v-preventReClick
size="small"
@click="close">
取消
</el-button>
<el-button :loading="loading"
size="small"
type="primary"
@click="confirm">
确定
</el-button>
</div>
</div>
<MultipleStaff ref="staffTagRef"
:choose-data="formData.staffList"
:visible="staffTagVisible"
@choose="handleStaffChoose"
@dialogClose="staffTagVisible = false">
</MultipleStaff>
</el-drawer>
</template>
<script>
import { batchCreateStrategy } from "@/api/earlyWarningManager";
import MultipleStaff from "../AddStrategy/MultipleStaff.vue";
export default {
name: "AddTeaching",
components: {
MultipleStaff,
},
inject: ["GET_PARAMS_INFO", "GET_MERCHANT_NAME"],
provide() {
return {
GET_POSITION_TYPE_LIST: () => this.positionTypeList,
GET_MERCHANT_LIST: () => [],
GET_BIZ: () => this.biz,
DEL_PARAMS_MERCHANT_LIST: () => false,
};
},
props: {
visibleSync: {
type: Boolean,
default: false,
},
biz: {
type: Number,
default: 1,
},
},
data() {
return {
loading: false,
formData: {
staffList: [],
description: "",
},
rules: {
staffList: [
{ type: "array", required: true, message: "请选择需带教人员", trigger: "change" },
],
description: [
{ required: true, message: "请输入申请说明", trigger: "blur" },
],
},
staffTagVisible: false,
positionTypeList: [0], // 0:驻店人员
};
},
computed: {
dialogShow: {
get() {
return this.visibleSync;
},
set(val) {
this.$emit("update:visibleSync", val);
},
},
paramsInfo() {
return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO();
},
merchantName() {
return this.GET_MERCHANT_NAME && this.GET_MERCHANT_NAME();
},
},
watch: {
visibleSync(val) {
if (val) {
this.init();
}
},
},
methods: {
init() {
this.formData = {
staffList: [],
description: "",
};
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate();
}
});
},
close() {
this.dialogShow = false;
},
openStaffDialog() {
this.staffTagVisible = true;
},
removeStaff(index) {
this.formData.staffList.splice(index, 1);
},
handleStaffChoose(list) {
this.formData.staffList = list;
this.$refs.form.validateField("staffList");
},
confirm() {
try {
this.loading = true;
const { paramsInfo, merchantName, formData, biz } = this;
const { staffList, description } = formData;
this.$refs.form.validate(async (valid) => {
if (valid) {
const params = {
strategyInfo: {
strategyType: 8,
biz,
description,
},
merchantList: [
{
merchantId: paramsInfo.merchantIds[0],
merchantName,
},
],
};
if (staffList && staffList.length) {
if (staffList.length > 100) {
this.loading = false;
this.$message.error("最多只能选择100个人员");
return;
}
params.staffList = staffList.map((e) => {
return {
userUuid: e.staffUuid,
userName: e.staffName,
userPhone: e.phoneNumber,
userPosition: e.positionType,
};
});
}
console.log(params);
const data = await batchCreateStrategy(params);
this.loading = false;
if (data) {
this.$emit("refresh");
this.$message.success("操作成功");
this.close();
} else {
this.$message.error("操作失败");
}
} else {
this.loading = false;
}
});
} catch (error) {
console.log(error, "===");
this.loading = false;
if (error)
this.$message.error(error);
console.log(error);
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep.strategy-drawer {
.el-drawer__header {
padding: 0;
margin: 0;
border-bottom: 1px solid #e5e5e5;
}
.el-drawer__close-btn {
padding: 0 20px;
.el-dialog__close {
font-weight: 700;
font-size: 24px;
}
}
&-title {
height: 26px;
line-height: 26px;
color: #333333;
font-size: 18px;
padding: 17px 20px;
font-weight: bold;
}
&-content {
height: calc(100vh - 61px);
.content {
height: calc(100% - 61px);
.form {
padding: 20px;
.tags-container {
margin-top: 10px;
padding: 10px;
border: 1px solid #e4e7ed;
border-radius: 4px;
min-height: 40px;
max-height: 120px;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.staff-tag {
margin-right: 0;
}
}
}
.footer {
padding: 14px 0;
border-top: 1px solid #e5e5e5;
display: flex;
justify-content: flex-end;
padding-right: 20px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<baseDialog <baseDialog class="detail-content"
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config" :dialog-config="dialogConfig.config"
class="detail-content" :is-show.sync="dialogShow"
@handleClick="submit" @handleClick="submit">
> <el-form ref="form"
<el-form
ref="form"
class="form" class="form"
label-width="120px" label-width="120px"
size="small"
:rules="formRules"
:model="formData" :model="formData"
@submit.native.prevent="submit" :rules="formRules"
> size="small"
<el-form-item @submit.native.prevent="submit">
label="停止展业日期:" <el-form-item label="停止展业日期:"
prop="nodeDate" prop="nodeDate">
> <el-date-picker v-model="formData.nodeDate"
<el-date-picker
v-model="formData.nodeDate"
type="date"
placeholder="请选择停止展业日期"
:picker-options="afterTodayOptions" :picker-options="afterTodayOptions"
> placeholder="请选择停止展业日期"
type="date">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -33,90 +25,93 @@ ...@@ -33,90 +25,93 @@
<script> <script>
import { import {
stopBusiness, stopBusiness,
} from "@api/earlyWarningManager" } from "@api/earlyWarningManager";
import dayjs from "dayjs"; import dayjs from "dayjs";
export default { export default {
name: "AddStaff", name: "AddStaff",
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
minDate: { minDate: {
type: String, type: String,
default: dayjs().format("YYYY-MM-DD") default: dayjs().format("YYYY-MM-DD"),
} },
},
inject: ["GET_PARAMS_INFO"],
data() {
return {
formData: {
nodeDate: "",
},
formRules: {
nodeDate: [{ required: true, message: "请选择停止展业日期", trigger: "blur" }],
},
dialogConfig: {
config: {
title: "停止展业",
width: "640px",
},
},
};
}, },
inject: ['GET_PARAMS_INFO'],
computed: { computed: {
dialogShow: { dialogShow: {
get () { get() {
return this.visible return this.visible;
},
set(val) {
this.close();
}, },
set (val) {
this.close()
}
}, },
afterTodayOptions () { afterTodayOptions() {
return { return {
disabledDate: (time) => { disabledDate: (time) => {
return ( return (
time.getTime() < dayjs(this.minDate).valueOf() // 小于最小日期 → 禁用 time.getTime() < dayjs(this.minDate).valueOf() // 小于最小日期 → 禁用
); );
}
}
}, },
paramsInfo () { };
return this.GET_PARAMS_INFO()
}, },
paramsInfo() {
return this.GET_PARAMS_INFO();
}, },
mounted () {
}, },
data () {
return { mounted() {
formData: {
nodeDate: '',
},
formRules: {
nodeDate: [{ required: true, message: '请选择停止展业日期', trigger: 'blur' }],
},
dialogConfig: {
config: {
title: "停止展业",
width: "640px"
}
},
}
}, },
methods: { methods: {
close () { close() {
this.formData = this.$options.data.call(this).formData this.formData = this.$options.data.call(this).formData;
this.$refs?.form?.resetFields() this.$refs?.form?.resetFields();
this.$emit('dialogClose') this.$emit("dialogClose");
}, },
submit () { submit() {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
if (valid) { if (valid) {
const { merchantIds } = this.paramsInfo, const { merchantIds, bizs } = this.paramsInfo;
{ nodeDate } = this.formData, const { nodeDate } = this.formData;
data = await stopBusiness({ const data = await stopBusiness({
merchantId: merchantIds[0], merchantId: merchantIds[0],
sceneType: 0, sceneType: bizs == 2 ? 1 : 0, // 业务场景(0.会员权益(延保权益),1.精品升级(轻改))
bizs: 1, bizs,
nodeDate: dayjs(nodeDate).format("YYYY-MM-DD HH:mm:ss") nodeDate: dayjs(nodeDate).format("YYYY-MM-DD HH:mm:ss"),
}) });
if(data) { if (data) {
this.$emit('refresh') this.$emit("refresh");
this.$message.success('操作成功') this.$message.success("操作成功");
this.close() this.close();
}else this.$message.error('操作失败') } else {
} this.$message.error("操作失败");
})
} }
} }
} });
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<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, bizs } = this.paramsInfo;
data = await getStrategyMerchantTimeline({ let data = await getStrategyMerchantTimeline({
merchantId: merchantIds[0], merchantId: merchantIds[0],
bizs: 1, //业务类型(1.延保 2.轻改 3.权益) bizs,
sceneType: 0 //业务场景(0.会员权益,1.精品升级) sceneType: bizs == 2 ? 1 : 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>
<baseDialog <baseDialog class="detail-content"
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
:config="config" :config="config"
> :dialog-config="dialogConfig.config"
:is-show.sync="dialogShow">
<div class="content"> <div class="content">
<d2-table <d2-table ref="table"
class="table" class="table"
ref="table" :has-num="false"
:has-page="false"
:search-form="formSearch" :search-form="formSearch"
:table-params="tableParams"
:table-data="list" :table-data="list"
:has-page="false" :table-params="tableParams">
:has-num="false"
>
</d2-table> </d2-table>
<div class="block"></div> <div class="block"></div>
</div> </div>
...@@ -24,67 +20,42 @@ ...@@ -24,67 +20,42 @@
<script> <script>
import { import {
getStrategyMerchantAnalysisIndexHistory, getStrategyMerchantAnalysisIndexHistory,
} from "@api/earlyWarningManager" } from "@api/earlyWarningManager";
export default { export default {
name: "HistoryTarget", name: "HistoryTarget",
inject: [ inject: [
'GET_PARAMS_INFO', "GET_PARAMS_INFO",
], ],
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
index: { index: {
type: Number, type: Number,
default: 0 default: 0,
}
},
computed: {
dialogShow: {
get () {
return this.visible
}, },
set (val) {
this.close()
}
}, },
merchantId () { data() {
let [merchantId] = this.GET_PARAMS_INFO().merchantIds
return merchantId
}
},
watch: {
visible: function (val) {
if (val) {
this.list = []
this.getList()
}
}
},
mounted () {
},
data () {
return { return {
config: { config: {
isShowFooter: true, isShowFooter: true,
cancel_name: "返回", cancel_name: "返回",
hideConfirmBtn: true hideConfirmBtn: true,
}, },
dialogConfig: { dialogConfig: {
config: { config: {
title: "历史兜底目标", title: "历史兜底目标",
width: "600px" width: "600px",
} },
}, },
formSearch: {}, formSearch: {},
tableParams: { tableParams: {
tableColumns: [ tableColumns: [
{ {
label: "月份", label: "月份",
prop: 'recordYearMonth', prop: "recordYearMonth",
minWidth: 64, minWidth: 64,
}, },
{ {
...@@ -93,14 +64,14 @@ export default { ...@@ -93,14 +64,14 @@ export default {
formatter: (row) => { formatter: (row) => {
let val = row[ let val = row[
{ {
0: 'ewPenetrationRate', 0: "ewPenetrationRate",
1: 'ewAxbPenetrationRate', 1: "ewAxbPenetrationRate",
2: 'batteryPenetrationRate', 2: "batteryPenetrationRate",
3: 'ewLtPenetrationRate' 3: "ewLtPenetrationRate",
}[this.index] }[this.index]
] || null ] || null;
return val != null ? val + '%' : '-' return val != null ? val + "%" : "-";
} },
}, },
{ {
label: "转化率兜底目标", label: "转化率兜底目标",
...@@ -108,34 +79,59 @@ export default { ...@@ -108,34 +79,59 @@ export default {
formatter: (row) => { formatter: (row) => {
let val = row[ let val = row[
{ {
0: 'ewConRate', 0: "ewConRate",
1: 'ewAxbConRate', 1: "ewAxbConRate",
2: 'batteryConversionRate', 2: "batteryConversionRate",
3: 'ewLtConRate' 3: "ewLtConRate",
}[this.index] }[this.index]
] || null ] || null;
return val != null ? val + '%' : '-' return val != null ? val + "%" : "-";
} },
},
],
},
list: [],
};
},
computed: {
dialogShow: {
get() {
return this.visible;
},
set(val) {
this.close();
},
}, },
] merchantId() {
let [merchantId] = this.GET_PARAMS_INFO().merchantIds;
return merchantId;
}, },
list: [] },
watch: {
visible(val) {
if (val) {
this.list = [];
this.getList();
} }
}, },
},
mounted() {
},
methods: { methods: {
close () { close() {
this.$emit('dialogClose') this.$emit("dialogClose");
}, },
async getList () { async getList() {
const { merchantId } = this, const { merchantId } = this;
data = await getStrategyMerchantAnalysisIndexHistory({ const data = await getStrategyMerchantAnalysisIndexHistory({
bizs: 1, bizs: 1,
merchantId merchantId,
}) });
this.list = data this.list = data;
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<template> <template>
<baseDialog <baseDialog class="detail-content"
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
:config="config" :config="config"
> :dialog-config="dialogConfig.config"
:is-show.sync="dialogShow">
<div class="content"> <div class="content">
<template v-for="(item,index) in list"> <template v-for="(item, index) in list">
<div <div :key="index"
class="list-box" class="list-box">
:key="index" <div class="line" :class="[{ 'first-line': index == 0 }, { 'last-line': index == list.length - 1 }]">
>
<div :class="['line',{'first-line':index == 0},{'last-line':index == list.length - 1}]">
<div class="icon"></div> <div class="icon"></div>
</div> </div>
<div class="title">{{ item.yearMonth }}</div> <div class="title">
{{ item.yearMonth }}
</div>
<div class="staff-list flex"> <div class="staff-list flex">
<template v-for="(i,ind) in item.staffList"> <template v-for="(i, ind) in item.staffList">
<div <div :key="ind"
class="staff-item flex" class="staff-item flex">
:key="ind"
>
<div class="staff-icon"> <div class="staff-icon">
<img src="@/assets/strategy/default-avatar.png"> <img src="@/assets/strategy/default-avatar.png">
<template v-if="i.temporarySupport"> <template v-if="i.stationType == 2">
<div class="temporary-support flex">临时支援</div> <div class="temporary-support flex">
临时支援
</div>
</template>
<template v-else-if="i.staffStatus == 1">
<div class="temporary-support flex">
临时支援
</div>
</template> </template>
</div> </div>
<div class="staff-info"> <div class="staff-info">
<div class="name text-hide">{{ i.staffName }}</div> <div class="name text-hide">
{{ i.staffName }}
</div>
<template v-if="i.deletedFlag == 'N'"> <template v-if="i.deletedFlag == 'N'">
<div <div class="deleted flex"
class="deleted flex" @click.stop="disabledStaff(i)">
@click.stop="disabledStaff(i)"
>
禁用 禁用
<div class="disabled-btn flex"> <div class="disabled-btn flex">
</div> </div>
...@@ -55,90 +58,92 @@ ...@@ -55,90 +58,92 @@
import { import {
disableStrategyStaff, disableStrategyStaff,
getStrategyMerchantAnalysisEmployeeHistory, getStrategyMerchantAnalysisEmployeeHistory,
} from "@api/earlyWarningManager" } from "@api/earlyWarningManager";
export default { export default {
name: "HistoryStaffList", name: "HistoryStaffList",
inject: ["GET_PARAMS_INFO"],
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false,
},
},
data() {
return {
config: {
isShowFooter: true,
cancel_name: "返回",
hideConfirmBtn: true,
},
dialogConfig: {
config: {
title: "历史人员记录",
width: "600px",
},
}, },
list: [],
};
}, },
computed: { computed: {
dialogShow: { dialogShow: {
get () { get() {
return this.visible return this.visible;
}, },
set (val) { set(val) {
this.close() this.close();
} },
},
paramsInfo() {
return this.GET_PARAMS_INFO();
}, },
paramsInfo () {
return this.GET_PARAMS_INFO()
}
}, },
inject: ['GET_PARAMS_INFO'],
watch: { watch: {
visible: { visible: {
handler (val) { handler(val) {
if (val) { if (val) {
this.getStrategyMerchantAnalysisEmployeeHistory() this.getStrategyMerchantAnalysisEmployeeHistory();
} }
}, },
immediate: true immediate: true,
}
},
mounted () {
},
data () {
return {
config: {
isShowFooter: true,
cancel_name: "返回",
hideConfirmBtn: true
}, },
dialogConfig: {
config: {
title: "历史人员记录",
width: "600px"
}
}, },
list: []
} mounted() {
}, },
methods: { methods: {
close () { close() {
this.$emit('dialogClose') this.$emit("dialogClose");
}, },
async getStrategyMerchantAnalysisEmployeeHistory () { async getStrategyMerchantAnalysisEmployeeHistory() {
let { merchantIds } = this.paramsInfo, let { merchantIds } = this.paramsInfo;
data = await getStrategyMerchantAnalysisEmployeeHistory({ let data = await getStrategyMerchantAnalysisEmployeeHistory({
bizs: 1, bizs: 1,
merchantId: merchantIds[0] merchantId: merchantIds[0],
}) });
this.list = data this.list = data;
}, },
disabledStaff (item) { disabledStaff(item) {
this.$confirm("对员工进行禁用操作后,对应的账户无法再使用;历史已产生的业务数据不受影响。", "提示", { this.$confirm("对员工进行禁用操作后,对应的账户无法再使用;历史已产生的业务数据不受影响。", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
closeOnClickModal: false closeOnClickModal: false,
}).then(async () => { }).then(async () => {
const data = await disableStrategyStaff({ const data = await disableStrategyStaff({
staffUuid: item.staffUUid staffUuid: item.staffUUid,
}) });
if (data) { if (data) {
this.getStrategyMerchantAnalysisEmployeeHistory() this.getStrategyMerchantAnalysisEmployeeHistory();
this.$message.success('操作成功') this.$message.success("操作成功");
} else this.$message.error('操作失败') } else {
this.$message.error("操作失败");
}
}).catch(() => { }).catch(() => {
}) });
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
<!-- 时间切换和日期选择器 --> <!-- 时间切换和日期选择器 -->
<CalendarCustom ref="calendarCustom" <CalendarCustom ref="calendarCustom"
v-model="timeRangeType" v-model="timeRangeType"
:time-range-options="timeRangeOptions"
:date-range.sync="dateRange"
:date-format="dateFormat" :date-format="dateFormat"
:date-range.sync="dateRange"
:time-range-options="timeRangeOptions"
@date-range-change="handleDateRangeChange" /> @date-range-change="handleDateRangeChange" />
</div> </div>
<div class="merchant-info flex"> <div class="merchant-info flex">
<div class="merchant-icon flex"> <div class="merchant-icon flex">
<img :src="`${IMG_URL}merchant-icon.webp`" <img class="icon"
class="icon"> :src="`${IMG_URL}merchant-icon.webp`">
</div> </div>
<div class="info "> <div class="info ">
<div class="name text-hide"> <div class="name text-hide">
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
</div> </div>
<div class="control flex"> <div class="control flex">
<div class="scene flex"> <div class="scene flex">
<img :src="`${IMG_URL}scene-icon.webp`" <img class="scene-icon"
class="scene-icon"> :src="`${IMG_URL}scene-icon.webp`">
业务:延保 业务:{{ businessLabel }}
</div> </div>
<el-button type="text" <el-button class="change-store"
class="change-store" type="text"
@click="merchantVisible = true"> @click="merchantVisible = true">
切换门店 切换门店
<i class="el-icon-sort"></i> <i class="el-icon-sort"></i>
...@@ -65,10 +65,10 @@ ...@@ -65,10 +65,10 @@
</div> </div>
</template> </template>
</div> </div>
<ChangeMerchantDialog :visible="merchantVisible" <ChangeMerchantDialog :merchant-id="merchantDetailInfo.merchantNo"
:merchant-id="merchantDetailInfo.merchantNo" :visible="merchantVisible"
@dialogClose="merchantVisible = false" @changeMerchant="changeMerchant"
@changeMerchant="changeMerchant"> @dialogClose="merchantVisible = false">
</ChangeMerchantDialog> </ChangeMerchantDialog>
</div> </div>
</template> </template>
...@@ -118,8 +118,8 @@ export default { ...@@ -118,8 +118,8 @@ export default {
tooltip: true, tooltip: true,
}, },
{ {
label: "区域运营", label: "区域督导",
key: "areaOperatorText", key: "flightSupervisionext",
tooltip: true, tooltip: true,
}, },
{ {
...@@ -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 = {
...@@ -186,6 +197,8 @@ export default { ...@@ -186,6 +197,8 @@ export default {
data.onlineOperatorText = data.onlineOperator.map(e => e.username).join("/"); data.onlineOperatorText = data.onlineOperator.map(e => e.username).join("/");
if (data.areaOperator && data.areaOperator.length) if (data.areaOperator && data.areaOperator.length)
data.areaOperatorText = data.areaOperator.map(e => e.username).join("/"); data.areaOperatorText = data.areaOperator.map(e => e.username).join("/");
if (data.flightSupervision && data.flightSupervision.length)
data.flightSupervisionText = data.flightSupervision.map(e => e.username).join("/");
this.merchantDetailInfo = data; this.merchantDetailInfo = data;
}, },
changeMerchant(e) { changeMerchant(e) {
......
<template> <template>
<el-tabs v-model="activeName" <el-tabs v-model="activeName"
type="card" class="tabs-content"
class="tabs-content"> type="card">
<el-tab-pane label="学习情况" <el-tab-pane label="学习情况"
name="first"> name="first">
<template v-if="activeName == 'first'"> <template v-if="activeName == 'first'">
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
</div> </div>
<d2-table ref="firstTable" <d2-table ref="firstTable"
class="firstTable" class="firstTable"
:table-params="tableParams" :has-page="false"
:table-data="tags[currentIndex].staffList" :table-data="tags[currentIndex].staffList"
:has-page="false"> :table-params="tableParams">
<template #statusHtml="scope"> <template #statusHtml="scope">
<div class="online-status"> <div class="online-status">
<span class="dot" <span class="dot"
...@@ -86,13 +86,13 @@ ...@@ -86,13 +86,13 @@
<div v-loading="loading"> <div v-loading="loading">
<div class="block"> <div class="block">
<div class="block-title flex"> <div class="block-title flex">
<img src="@/assets/strategy/performance.png" <img class="block-icon"
class="block-icon"> src="@/assets/strategy/performance.png">
业绩情况 业绩情况
</div> </div>
<div class="business-box"> <div class="business-box">
<img src="@/assets/strategy/detail-bg.webp" <img class="bg"
class="bg"> src="@/assets/strategy/detail-bg.webp">
<div class="left"> <div class="left">
<div class="business-title"> <div class="business-title">
学习前 学习前
...@@ -145,8 +145,8 @@ ...@@ -145,8 +145,8 @@
</div> </div>
<div class="block"> <div class="block">
<div class="block-title flex"> <div class="block-title flex">
<img src="@/assets/strategy/recording.png" <img class="block-icon"
class="block-icon"> src="@/assets/strategy/recording.png">
录音情况 录音情况
</div> </div>
<div class="recording-box"> <div class="recording-box">
...@@ -157,8 +157,8 @@ ...@@ -157,8 +157,8 @@
</div> </div>
</div> </div>
<div class="ai flex"> <div class="ai flex">
<img src="@/assets/strategy/ai.png" <img class="ai-icon"
class="ai-icon"> src="@/assets/strategy/ai.png">
AI导师建议 AI导师建议
</div> </div>
<template v-if="beforeStatic.aiTutorSuggest"> <template v-if="beforeStatic.aiTutorSuggest">
...@@ -185,12 +185,12 @@ ...@@ -185,12 +185,12 @@
</template> </template>
</div> </div>
<d2-table ref="leftTable" <d2-table ref="leftTable"
:search-form="leftFormSearch" :before-search-fn="leftBeforeSearchFn"
:table-params="secondTableParams"
:get-list-api="secondGetListApi" :get-list-api="secondGetListApi"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:pager-count="5" :pager-count="5"
:before-search-fn="leftBeforeSearchFn"> :search-form="leftFormSearch"
:table-params="secondTableParams">
<template #auth-button="scope"> <template #auth-button="scope">
<el-button type="text" <el-button type="text"
@click="qualitDetail(scope.scope, 'leftTable')"> @click="qualitDetail(scope.scope, 'leftTable')">
...@@ -206,8 +206,8 @@ ...@@ -206,8 +206,8 @@
</div> </div>
</div> </div>
<div class="ai flex"> <div class="ai flex">
<img src="@/assets/strategy/ai.png" <img class="ai-icon"
class="ai-icon"> src="@/assets/strategy/ai.png">
AI导师建议 AI导师建议
</div> </div>
<template v-if="afterStatic.aiTutorSuggest"> <template v-if="afterStatic.aiTutorSuggest">
...@@ -234,12 +234,12 @@ ...@@ -234,12 +234,12 @@
</template> </template>
</div> </div>
<d2-table ref="rightTable" <d2-table ref="rightTable"
:search-form="rightFormSearch" :before-search-fn="rightBeforeSearchFn"
:table-params="secondTableParams"
:get-list-api="secondGetListApi" :get-list-api="secondGetListApi"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:pager-count="5" :pager-count="5"
:before-search-fn="rightBeforeSearchFn"> :search-form="rightFormSearch"
:table-params="secondTableParams">
<template #auth-button="scope"> <template #auth-button="scope">
<el-button type="text" <el-button type="text"
@click="qualitDetail(scope.scope, 'rightTable')"> @click="qualitDetail(scope.scope, 'rightTable')">
......
<template> <template>
<div class="strategy-item"> <div class="strategy-item">
<div :class="['strategy-item-line',{'first-line':index == 0},{'last-line':isLast}]"> <div class="strategy-item-line" :class="[{ 'first-line': index == 0 }, { 'last-line': isLast }]">
<div class="icon"></div> <div class="icon"></div>
</div> </div>
<div class="strategy-item-title flex"> <div class="strategy-item-title flex">
<div class="text text-hide"> <div class="text text-hide">
{{ STRATEGYTYPEOPTIONS[item.strategyType]}} {{ STRATEGYTYPEOPTIONS[item.strategyType] }}
</div> </div>
<div class="strategy-item-date"> <div class="strategy-item-status" :style="{ color: formatStatusStyle(item.pushFlag).color, background: formatStatusStyle(item.pushFlag).bg }">
{{ item.createdDateText }} {{ formatPushFlag(item.pushFlag) }}
</div> </div>
</div> </div>
<div class="strategy-item-created">
{{ item.createdDateText }}<span>{{ item.createdBy }}</span>
</div>
<template v-for="(i, ind) in strategyTypeObject"> <template v-for="(i, ind) in strategyTypeObject">
<div <div v-if="!i.hide || !i.hide(item)"
class="content"
:key="ind" :key="ind"
v-if="!i.hide || !i.hide(item)" class="content">
> <div class="label">
<div class="label">{{ i.label }}:</div> {{ i.label }}:
</div>
<div class="value-box"> <div class="value-box">
<template v-if="i.tooltip"> <template v-if="i.tooltip">
<el-tooltip <el-tooltip effect="dark"
effect="dark" placement="top">
placement="top" <template #content>
> <div class="tooltip-content-max">
<div
slot="content"
class="tooltip-content-max"
>
<div v-html="item[i.key]"></div> <div v-html="item[i.key]"></div>
</div> </div>
<span </template>
class="two-line-ellipsis" <span class="two-line-ellipsis"
v-html="item[i.key]" v-html="item[i.key]">
></span> </span>
</el-tooltip> </el-tooltip>
</template> </template>
<template v-else> <template v-else>
<div :class="['value text-hide',i.className]"> <div class="value text-hide" :class="[i.className]">
<template v-if="i.format">{{ i.format(item) }}</template> <template v-if="i.format">
<template v-else>{{ item[i.key] }}</template> {{ i.format(item) }}
</template>
<template v-else>
{{ item[i.key] }}
</template>
</div> </div>
</template> </template>
</div> </div>
</div> </div>
</template> </template>
<div class="btn-list flex"> <div class="btn-list flex">
<template v-if="item.showDel"> <!-- 状态=未下发 -->
<el-button <template v-if="item.pushFlag == 0">
<el-button class="btn-default _btn"
:size="size" :size="size"
class="btn-default _btn" @click="deleteStrategy(item)">
@click="deleteStrategy(item)" 删除
>删除</el-button> </el-button>
</template> </template>
<el-button <el-button class="btn-primary _btn"
plain
:size="size" :size="size"
type="primary" type="primary"
plain @click="$emit('toDetail', item)">
class="btn-primary _btn" 查看详情
@click="$emit('toDetail',item)" </el-button>
>查看详情</el-button>
</div> </div>
</div> </div>
</div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { import {
STRATEGYTYPEOPTIONS, deleteStrategy,
} from "@/api/earlyWarningManager";
import {
STRATEGY_01, STRATEGY_01,
STRATEGY_2456,
STRATEGY_3, STRATEGY_3,
STRATEGY_7 STRATEGY_7,
} from './contant' STRATEGY_8,
import { STRATEGY_9,
deleteStrategy STRATEGY_10_11_12,
} from '@/api/earlyWarningManager' STRATEGY_2456,
STRATEGYTYPEOPTIONS,
} from "./contant";
export default { export default {
name: 'StrategyItem', name: "StrategyItem",
props: { props: {
item: { item: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
}, },
index: { index: {
type: Number, type: Number,
default: 0 default: 0,
}, },
isLast: { isLast: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
data() {
return {
size: "small",
STRATEGYTYPEOPTIONS,
};
},
computed: { computed: {
strategyTypeObject () { strategyTypeObject() {
let { strategyType } = this.item, let { strategyType } = this.item;
list = [0, 1].includes(strategyType) let list = [0, 1].includes(strategyType)
? STRATEGY_01 : [2, 4, 5, 6].includes(strategyType) ? ? STRATEGY_01
STRATEGY_2456 : { : [2, 4, 5, 6].includes(strategyType)
? STRATEGY_2456
: [10, 11, 12].includes(strategyType)
? STRATEGY_10_11_12
: {
3: STRATEGY_3, 3: STRATEGY_3,
7: STRATEGY_7 7: STRATEGY_7,
}[strategyType] || [] 8: STRATEGY_8,
9: STRATEGY_9,
}[strategyType] || [];
return [ return [
...list, ...list,
{ {
label: '策略说明', label: this.formatText(strategyType),
tooltip: true, tooltip: true,
key: 'descriptionText' key: "descriptionText",
}]
}
}, },
];
data () {
return {
size: 'small',
STRATEGYTYPEOPTIONS
}
}, },
mounted () { },
mounted() {
}, },
methods: { methods: {
deleteStrategy (item) { formatText(strategyType) {
let text = "策略说明";
text = [9, 10, 11, 12].includes(strategyType)
? "任务说明"
: [8].includes(strategyType) ? "申请说明" : text;
return text;
},
formatPushFlag(state) {
const numState = Number(state);
const obj = { 0: "待下发", 1: "已下发", 2: "未完成", 3: "审批中", 4: "执行中", 5: "已驳回", 6: "完成" };
return obj[numState] || "";
},
formatStatusStyle(state) {
const numState = Number(state);
const obj = { 0: {
color: "#8C8C8C",
bg: "rgba(140, 140, 140, 0.1)",
}, 1: {
color: "#43CF7C",
bg: "rgba(67, 207, 124, 0.1)",
}, 2: { color: "#2A82E4", bg: "rgba(42, 130, 228, 0.1)" }, 3: { color: "#FDB757", bg: "rgba(224, 183, 87, 0.1)" }, 4: {
color: "#2A82E4",
bg: "rgba(42, 130, 228, 0.1)",
}, 5: { color: "#EB4E4E", bg: "rgba(235, 78, 78, 0.1)" }, 6: { color: "#43CF7C", bg: "rgba(67, 207, 124, 0.1)" } };
console.log(obj[numState], "obj[numState]");
return obj[numState] || {};
},
deleteStrategy(item) {
this.$confirm("删除后不可恢复,是否确定删除?", "提示", { this.$confirm("删除后不可恢复,是否确定删除?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
closeOnClickModal: false closeOnClickModal: false,
}).then(async () => { }).then(async () => {
const data = await deleteStrategy({ const data = await deleteStrategy({
id: item.id id: item.id,
}) });
if (data) { if (data) {
this.$emit('refresh') this.$emit("refresh");
this.$message.success('操作成功') this.$message.success("操作成功");
this.close() this.close();
} else this.$message.error('操作失败') } else {
}).catch(() => { this.$message.error("操作失败");
})
} }
} }).catch(() => {
} });
},
},
};
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
...@@ -217,11 +263,19 @@ export default { ...@@ -217,11 +263,19 @@ export default {
max-width: calc(100% - 106px); max-width: calc(100% - 106px);
} }
} }
&-date { &-created {
color: #333333;
font-size: 14px;
span {
margin-left: 4px;
}
}
&-status {
margin-left: auto; margin-left: auto;
font-size: 14px; font-size: 14px;
line-height: 20px;
flex-shrink: 0; flex-shrink: 0;
padding: 2px 6px;
border-radius: 2px;
} }
.tooltip-content-max { .tooltip-content-max {
max-height: 320px; max-height: 320px;
......
import dayjs from "dayjs" /*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2026-04-01 09:57:49
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-06-02 17:54:09
* @FilePath: \dj-car-life-system\src\views\earlyWarningManager\strategyCentre\storeSignboard\components\StrategyList\contant.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import dayjs from "dayjs";
const STRATEGYTYPEOPTIONS = { const STRATEGYTYPEOPTIONS = {
0: '学习', 0: "学习",
1: '优秀案例分享', 1: "优秀案例分享",
2: '带教', 2: "带教",
3: '任务下发', 3: "任务下发",
4: '销售精英到店提拉', 4: "销售精英到店提拉",
5: '强力促销', 5: "强力促销",
6: '最终盘点与低客单产品购入', 6: "最终盘点与低客单产品购入",
7: '留言' 7: "留言",
} 8: "带教申请",
9: "人员更换评估",
10: "商务政策更新评估",
11: "多品类拓张",
12: "流量问题改善",
};
const DATE_RANGE = { const DATE_RANGE = {
label: '执行周期', label: "执行周期",
format: (val) => { format: (val) => {
let { startDate, endDate } = val let { startDate, endDate } = val;
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}` return `${dayjs(startDate).format("YYYY-MM-DD")}至 ${dayjs(endDate).format("YYYY-MM-DD")}`;
} },
} };
const STAFF_FORMAT = (label) => { function STAFF_FORMAT(label) {
return { return {
label, label,
format: (val) => { format: (val) => {
let { staffList } = val let { staffList } = val;
return staffList.map(item => item.userName).join('/') || '-' return staffList.filter(item => !item.userPosition).map(item => item.userName).join("/") || "-";
} },
} };
} }
const STRATEGY_01 = [ const STRATEGY_01 = [
STAFF_FORMAT('学习人员'), STAFF_FORMAT("学习人员"),
{ {
label: '学习内容', label: "学习内容",
className: 'two-line-ellipsis', className: "two-line-ellipsis",
format: (val) => { format: (val) => {
let { courseList, recordingList, strategyType } = val let { courseList, recordingList, strategyType } = val;
return strategyType == 1 ? return strategyType == 1
recordingList.map(item => `《${item.receptionStaffName}${item.receptionDate}》`).join('\t') : ? recordingList.map(item => `《${item.receptionStaffName}${item.receptionDate}》`).join("\t")
courseList.map(item => `《${item.courseName}》`).join('\t') : courseList.map(item => `《${item.courseName}》`).join("\t");
} },
}, },
DATE_RANGE DATE_RANGE,
] ];
const STRATEGY_2456 = [ const STRATEGY_2456 = [
{ {
...STAFF_FORMAT('执行人'), ...STAFF_FORMAT("执行人"),
hide: (val) => { hide: (val) => {
let { strategyType } = val let { strategyType } = val;
return [5, 6].includes(strategyType) return [5, 6].includes(strategyType);
}, },
}, },
DATE_RANGE DATE_RANGE,
] ];
const STRATEGY_3 = [ const STRATEGY_3 = [
{ {
label: '标题', label: "标题",
key: 'title', key: "title",
}, },
STAFF_FORMAT('处理人'), STAFF_FORMAT("处理人"),
{ {
label: '执行时间', label: "执行时间",
format: (val) => { format: (val) => {
let { startDate, createdDate } = val let { startDate, createdDate } = val;
return `${dayjs(startDate ? startDate : createdDate).format('YYYY-MM-DD HH:mm:ss')}` return `${dayjs(startDate || createdDate).format("YYYY-MM-DD HH:mm:ss")}`;
}
}, },
] },
];
const STRATEGY_7 = [ const STRATEGY_7 = [
{ {
label: '留言人', label: "留言人",
key: 'createdBy', key: "createdBy",
},
STAFF_FORMAT("处理人"),
];
const STRATEGY_8 = [
STAFF_FORMAT("需带教人员"),
];
const STRATEGY_9 = [
STAFF_FORMAT("问题人员"),
{
label: "执行人员",
format: (val) => {
let { staffList } = val;
return staffList.filter(item => item.userPosition != 0).map(item => item.userName).join("/") || "-";
},
},
];
const STRATEGY_10_11_12 = [
{
label: "执行人员",
format: (val) => {
let { staffList } = val;
return staffList.filter(item => item.userPosition != 0).map(item => item.userName).join("/") || "-";
},
}, },
STAFF_FORMAT('处理人') ];
]
export { export {
STRATEGYTYPEOPTIONS,
STRATEGY_01, STRATEGY_01,
STRATEGY_2456,
STRATEGY_3, STRATEGY_3,
STRATEGY_7, STRATEGY_7,
STRATEGY_8,
STRATEGY_9,
STRATEGY_10_11_12,
STRATEGY_2456,
STRATEGYTYPEOPTIONS,
}
\ No newline at end of file \ No newline at end of file
};
\ No newline at end of file \ No newline at end of file
...@@ -2,139 +2,195 @@ ...@@ -2,139 +2,195 @@
<div class="strategy"> <div class="strategy">
<div class="strategy-title flex"> <div class="strategy-title flex">
策略中心 策略中心
<div class="add-grounp flex">
<div class="add"> <div class="add">
<el-button type="text" @click="addStrategyVisible = true"> <i class="el-icon-plus"></i>添加策略</el-button> <el-button type="text" @click="addTeachingVisible = true">
<i class="el-icon-plus"></i>带教
</el-button>
</div> </div>
<span class="line">|</span>
<div class="add">
<el-button type="text" @click="addTaskVisible = true">
<i class="el-icon-plus"></i>任务
</el-button>
</div>
<span class="line">|</span>
<div class="add">
<el-button type="text" @click="addStrategyVisible = true">
<i class="el-icon-plus"></i>策略
</el-button>
</div>
</div>
</div> </div>
<el-scrollbar class="strategy-list" :key="viewKey" v-loading="loading" ref="scrollbar"> <el-scrollbar :key="viewKey"
ref="scrollbar"
v-loading="loading"
class="strategy-list">
<template v-for="(i, index) in list"> <template v-for="(i, index) in list">
<strategy-item :key="index" :index="index" :item="i" :isLast="index == list.length - 1" <StrategyItem :key="index"
:class="[{ first: index == 0 }, { last: index == list.length - 1 }]" @toDetail="toDetail" :class="[{ first: index == 0 }, { last: index == list.length - 1 }]"
@refresh="init"></strategy-item> :index="index"
:is-last="index == list.length - 1"
:item="i"
@refresh="init"
@toDetail="toDetail">
</StrategyItem>
</template> </template>
<div v-if="loading && list.length > 0" class="loading-more">加载中...</div> <div v-if="loading && list.length > 0" class="loading-more">
<div v-if="noMoreData && list.length > 0" class="no-more-data">没有更多了</div> 加载中...
</div>
<div v-if="noMoreData && list.length > 0" class="no-more-data">
没有更多了
</div>
</el-scrollbar> </el-scrollbar>
<add-strategy :dialogVisible.sync="addStrategyVisible" @refresh="init"></add-strategy> <AddTeaching :visibleSync.sync="addTeachingVisible" @refresh="init"></AddTeaching>
<strategy-detail :dialogVisible.sync="strategyDetailVisible" :item="currentItem" <AddTask :visibleSync.sync="addTaskVisible" @refresh="init"></AddTask>
@openReceptionDialog="$emit('openReceptionDialog', $event)"></strategy-detail> <StrategyDetail :dialogVisible.sync="strategyDetailVisible"
:item="currentItem"
@openReceptionDialog="$emit('openReceptionDialog', $event)">
</StrategyDetail>
<AddStrategy :dialogVisible.sync="addStrategyVisible" @refresh="init"></AddStrategy>
<TeachingDetail :item="currentItem"
:visibleSync.sync="teachingDetailVisible">
</TeachingDetail>
<TaskDetail :item="currentItem" :visibleSync.sync="taskDetailVisible"></TaskDetail>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import StrategyItem from './StrategyItem.vue'; import dayjs from "dayjs";
import AddStrategy from '../AddStrategy/index.vue';
import StrategyDetail from '../StrategyDetail/index.vue';
import dayjs from 'dayjs';
import { import {
getStrategyList getStrategyList,
} from '@/api/earlyWarningManager'; } from "@/api/earlyWarningManager";
import AddStrategy from "../AddStrategy/index.vue";
import AddTask from "../AddTask/index.vue";
import AddTeaching from "../AddTeaching/index.vue";
import StrategyDetail from "../StrategyDetail/index.vue";
import TaskDetail from "../taskDetail/index.vue";
import TeachingDetail from "../TeachingDetail/index.vue";
import StrategyItem from "./StrategyItem.vue";
export default { export default {
name: "StrategyList",
components: { components: {
StrategyItem, StrategyItem,
AddStrategy, AddStrategy,
StrategyDetail AddTeaching,
AddTask,
StrategyDetail,
TeachingDetail,
TaskDetail,
}, },
name: 'StrategyList', inject: ["GET_PARAMS_INFO"],
inject: ['GET_PARAMS_INFO'], data() {
data () {
return { return {
list: [], list: [],
addStrategyVisible: false, addStrategyVisible: false,
addTeachingVisible: false,
addTaskVisible: false,
strategyDetailVisible: false, strategyDetailVisible: false,
teachingDetailVisible: false,
taskDetailVisible: false,
currentItem: {}, currentItem: {},
viewKey: Date.now(), viewKey: Date.now(),
loading: false, loading: false,
noMoreData: false, noMoreData: false,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
} };
}, },
computed: { computed: {
paramsInfo () { paramsInfo() {
return this.GET_PARAMS_INFO() return this.GET_PARAMS_INFO();
}, },
}, },
mounted () { mounted() {
}, },
beforeDestroy () { beforeDestroy() {
const scrollbar = this.$refs.scrollbar; const scrollbar = this.$refs.scrollbar;
if (scrollbar && scrollbar.wrap) { if (scrollbar && scrollbar.wrap) {
scrollbar.wrap.removeEventListener('scroll', this.handleScroll); scrollbar.wrap.removeEventListener("scroll", this.handleScroll);
} }
}, },
methods: { methods: {
bindScrollEvent () { bindScrollEvent() {
this.$nextTick(() => { this.$nextTick(() => {
const scrollbar = this.$refs.scrollbar; const scrollbar = this.$refs.scrollbar;
if (scrollbar && scrollbar.wrap) { if (scrollbar && scrollbar.wrap) {
console.log('绑定滚动事件') console.log("绑定滚动事件");
scrollbar.wrap.addEventListener('scroll', this.handleScroll); scrollbar.wrap.addEventListener("scroll", this.handleScroll);
} else { } else {
console.log('scrollbar 或 wrap 不存在:', { scrollbar, wrap: scrollbar?.wrap }) console.log("scrollbar 或 wrap 不存在:", { scrollbar, wrap: scrollbar?.wrap });
} }
}) });
}, },
init () { init() {
this.pageNum = 1 this.pageNum = 1;
this.noMoreData = false this.noMoreData = false;
this.list = [] this.list = [];
this.getStrategyList() this.getStrategyList();
}, },
toDetail (item) { toDetail(item) {
this.currentItem = item this.currentItem = item;
this.strategyDetailVisible = true if (item.strategyType === 8) {
this.teachingDetailVisible = true;
} else if ([9, 10, 11, 12].includes(item.strategyType)) {
this.taskDetailVisible = true;
} else {
this.strategyDetailVisible = true;
}
}, },
async getStrategyList () { async getStrategyList() {
try { try {
this.loading = true this.loading = true;
let { merchantIds } = this.paramsInfo, let { merchantIds, bizs } = this.paramsInfo;
data = await getStrategyList({ let data = await getStrategyList({
merchantId: merchantIds[0], merchantId: merchantIds[0],
biz: 1, biz: bizs,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pageSize pageSize: this.pageSize,
}) });
if (data && data.list) { if (data && data.list) {
let { list } = data let { list } = data;
list.map(e => { list.map((e) => {
e.showDel = dayjs().diff(dayjs(e.startDate), 's') < 0 e.showDel = dayjs().diff(dayjs(e.startDate), "s") < 0;
e.createdDateText = dayjs(e.createdDate).format('YYYY-MM-DD') e.createdDateText = dayjs(e.createdDate).format("YYYY-MM-DD HH:mm:ss");
e.descriptionText = e.description ? e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') : '-' e.descriptionText = e.description ? e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, "<br>") : "-";
}) });
if (this.pageNum == 1) { if (this.pageNum == 1) {
this.list = list this.list = list;
} else { } else {
this.list = this.list.concat(list) this.list = this.list.concat(list);
} }
this.loading = false this.loading = false;
if (this.pageNum == 1) this.viewKey = Date.now() if (this.pageNum == 1)
this.viewKey = Date.now();
if (list.length < this.pageSize) { if (list.length < this.pageSize) {
this.noMoreData = true this.noMoreData = true;
} }
// 数据加载完成后重新绑定事件 // 数据加载完成后重新绑定事件
this.bindScrollEvent() this.bindScrollEvent();
} }
} catch (error) { } catch (error) {
this.loading = false this.loading = false;
} }
}, },
handleScroll (event) { handleScroll(event) {
const wrap = event.target const wrap = event.target;
const scrollTop = wrap.scrollTop const scrollTop = wrap.scrollTop;
const scrollHeight = wrap.scrollHeight const scrollHeight = wrap.scrollHeight;
const clientHeight = wrap.clientHeight const clientHeight = wrap.clientHeight;
if (scrollTop + clientHeight >= scrollHeight - 10 && !this.loading && !this.noMoreData) { if (scrollTop + clientHeight >= scrollHeight - 10 && !this.loading && !this.noMoreData) {
this.pageNum++ this.pageNum++;
this.getStrategyList() this.getStrategyList();
}
}
} }
} },
},
};
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
...@@ -171,6 +227,12 @@ export default { ...@@ -171,6 +227,12 @@ export default {
margin-right: 5px; margin-right: 5px;
} }
} }
.line {
width: 1px;
height: 16px;
color: #e5e5e5;
margin: 0 12px;
}
} }
&-list { &-list {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!