Commit 91fc51a6 by 李伟康

feat(earlyWarningManager/strategyCentre): 完成门店看板策略任务相关功能迭代

1. 新增任务类型选项13、14并同步至多处常量文件
2. 重构督导详情页逻辑,合并至任务详情组件并移除冗余TeachingDetail组件
3. 修复表单字段绑定、样式适配问题
4. 新增门店筛选联动功能,完善看板跳转详情逻辑
5. 优化任务详情展示格式与字段映射关系
1 parent 86a0945c
Showing 16 changed files with 466 additions and 417 deletions
......@@ -157,20 +157,23 @@ export default {
computed: {
onlineOperatorText() {
const list = this.cardData.onlineOperator;
if (!Array.isArray(list) || !list.length)
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)
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)
if (!Array.isArray(list) || !list.length) {
return "";
}
return list.map(item => item.username).filter(Boolean).join("/");
},
},
......@@ -204,11 +207,7 @@ export default {
query.endDate = this.dateRange.endDate;
}
}
this.$router.push({
path: "/storeSignboard",
query,
});
this.$emit("jumpDetail", query);
}
},
// 获取预警图标
......@@ -230,8 +229,9 @@ export default {
},
checkWarningOverflow(event, index) {
const el = event.currentTarget;
if (!el)
if (!el) {
return;
}
this.$set(
this.warningOverflowMap,
index,
......
......@@ -77,7 +77,8 @@
:date-range="dateRange"
:index="index"
:time-range-type="timeRangeType"
@checkbox-change="handleCheckboxChange">
@checkbox-change="handleCheckboxChange"
@jumpDetail="handleJumpDetail">
</MonitorCard>
</el-col>
</el-row>
......@@ -751,6 +752,19 @@ export default {
const day = String(d.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
},
handleJumpDetail(query) {
const { filters } = this;
query.brand = filters.brand;
query.region = filters.provinceId;
query.regionalOperatorId = filters.regionOps;
query.onlineOperatorId = filters.onlineOps;
query.flightSupervisionId = filters.supervisorOps;
this.$router.push({
path: "/storeSignboard",
query,
});
},
},
};
</script>
......
......@@ -212,7 +212,6 @@ export default {
// 1.延保 2.轻改 3.权益 4.二手车 延保和权益都传1
return new Promise((resolve) => {
this.searchFormSearch = this.getParams();
this.searchFormSearch.businessType = this.biz == 3 ? 1 : this.biz;
resolve();
});
},
......@@ -221,6 +220,7 @@ export default {
if (params.receptionDate) {
params.receptionDate = dayjs(params.receptionDate).format("YYYY-MM-DD");
}
params.businessType = this.biz == 3 ? 1 : this.biz;
return params;
},
},
......
......@@ -151,20 +151,23 @@ export default {
methods: {
beforeSearchFn() {
return new Promise((resolve) => {
let { positionTypeListSale,positionTypeList, merchantList, paramsInfo, delMerchantList, biz } = this;
let { positionTypeListSale, positionTypeList, merchantList, paramsInfo, delMerchantList, biz } = this;
let { staffName } = this.searchForm;
let merchantIdList = [];
if (merchantList.length)
if (merchantList.length) {
merchantIdList = merchantList.map(item => item.merchantId);
else merchantIdList = paramsInfo?.merchantIds || [];
} else {
merchantIdList = paramsInfo?.merchantIds || [];
}
let params = {
positionTypeList: positionTypeListSale?positionTypeListSale(biz):positionTypeList,
positionTypeList: positionTypeListSale ? positionTypeListSale(biz) : positionTypeList,
sceneType: biz == 2 ? 1 : 0, // 业务场景(0.会员权益(延保权益),1.精品升级(轻改))
staffName,
merchantIdList,
};
if (delMerchantList)
if (delMerchantList) {
params.merchantIdList = [];
}
this.searchFormSearch = this.deepClone(params);
resolve();
......
......@@ -305,7 +305,7 @@ export default {
precision: 2,
prevText: currentBiz == 2 ? "平均客单价=" : "转化率=",
unit: currentBiz == 2 ? "" : "%",
class: "flex",
class: "flex date-range",
});
}
return [
......@@ -333,6 +333,7 @@ export default {
return {
strategyType: [{ required: true, message: "请选择执行策略", trigger: "blur" }],
// eslint-disable-next-line style/multiline-ternary
...([2, 4, 5, 6].includes(strategyType) ? {
...STRATEGY_FORM_RULES_2456,
staffList: [
......@@ -693,7 +694,7 @@ export default {
margin-left: 8px;
}
.number-input {
width: 259px;
// width: 259px;
}
}
padding: 20px 30px 20px 20px;
......
const TASKTYPEOPTION = [
{ label: "转化类-督导带教", value: 2 },
{ label: "转化类-督导带教", value: 8 },
{ label: "转化类-人员更换评估", value: 9 },
{ label: "流量类-提升触客率", value: 12 },
{ label: "流量类-多场景拓展", value: 13 },
{ label: "流量类-拓新店流量", value: 14 },
];
const TASK_FORM_2 = [
const TASK_FORM_8 = [
{
label: "需带教人员",
type: "multipleTag",
......@@ -36,7 +36,7 @@ const TASK_FORM_2 = [
precision: 2,
prevTextFun: val => val == 2 ? "平均客单价=" : "转化率=",
unitFun: val => val == 2 ? "" : "%",
class: "flex",
class: "flex date-range",
},
{
label: "带教场景",
......@@ -139,7 +139,7 @@ const TASK_FORM_DEFAULT = [
},
];
export {
TASK_FORM_2,
TASK_FORM_8,
TASK_FORM_DEFAULT,
TASKTYPEOPTION,
};
......@@ -53,7 +53,7 @@
<el-scrollbar class="multiple-tag-box">
<div class="multiple-tags">
<template v-for="(i, ind) in formData[item.key]">
<el-tag :key="ind"
<el-tag :key="`tag-${ind}`"
closable
@close="removeTag (ind, item)">
{{ i[item.tagNameKey] }}
......@@ -91,8 +91,8 @@
</template>
<template v-else-if="item.type == 'checkbox'">
<el-checkbox-group v-model="formData[item.key]">
<el-checkbox v-for="(i, index) in item.options"
:key="index"
<el-checkbox v-for="(i, optionIndex) in item.options"
:key="`checkbox-${optionIndex}`"
:label="i.value">
{{ i.label }}
</el-checkbox>
......@@ -100,8 +100,8 @@
</template>
<template v-else-if="item.type == 'radioTime'">
<el-radio-group v-model="formData[item.key]">
<el-radio v-for="(i, index) in item.options"
:key="index"
<el-radio v-for="(i, radioIndex) in item.options"
:key="`radio-${radioIndex}`"
:label="i.value">
{{ i.label }}
</el-radio>
......@@ -129,64 +129,20 @@
:disabled="item.disabledFun ? item.disabledFun(formData) : false"
:filterable="item.filterable"
:multiple="item.multiple">
<el-option v-for="(i, index) in (item.optionsFun ? item.optionsFun(formData) : item.options)"
:key="index"
<el-option v-for="(i, optionIndex) in (item.optionsFun ? item.optionsFun(formData) : item.options)"
:key="`select-${optionIndex}`"
:label="i[item.labelKey] || i.label"
:value="i[item.valueKey] || i.value">
</el-option>
</el-select>
</template>
<template v-if="item.unit || item.unitFun">
<template v-if="item.unit || (item.unitFun ? item.unitFun(biz) : false)">
<span class="form-text unit">{{ item.unitFun ? item.unitFun(biz) : item.unit }}</span>
</template>
</div>
</el-form-item>
</template>
</template>
<!-- <el-form-item label="任务标题:" prop="taskTitle">
<el-input v-model="formData.taskTitle"
maxlength="20"
placeholder="请输入标题">
</el-input>
</el-form-item>
<template v-if="formData.taskType === 9">
<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>
</template>
<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="请输入任务说明"
type="textarea"
:rows="6">
</el-input>
</el-form-item> -->
</el-form>
</el-scrollbar>
<div class="footer">
......@@ -203,13 +159,6 @@
</el-button>
</div>
</div>
<!-- <MultipleStaff ref="staffTagRef"
:choose-data="formData.staffList"
:visible="staffTagVisible"
@choose="handleStaffChoose"
@dialogClose="staffTagVisible = false">
</MultipleStaff> -->
<MultipleStaff ref="staffTagRef"
:choose-data="formData.staffList"
:visible="staffTagVisible"
......@@ -220,14 +169,14 @@
</template>
<script>
import { batchCreateStrategy, getStrategyShopMerchantOperators, getStrategyStaffList } from "@/api/earlyWarningManager";
import { batchCreateStrategy, getStrategyShopMerchantOperators } from "@/api/earlyWarningManager";
import {
afterPickerOptions,
} from "@/common/format";
import { deepClone } from "@/common/util.js";
import textBox from "@/components/glsx-combi-form/textBox";
import MultipleStaff from "../AddStrategy/MultipleStaff.vue";
import { TASK_FORM_2, TASK_FORM_DEFAULT, TASKTYPEOPTION } from "./contant.js";
import { TASK_FORM_8, TASK_FORM_DEFAULT, TASKTYPEOPTION } from "./contant.js";
export default {
name: "AddTask",
......@@ -269,7 +218,7 @@ export default {
executorUuid: "",
description: "",
scene: "",
type: [],
type: "",
},
rules: {
taskType: [
......@@ -320,8 +269,8 @@ export default {
taskTypeFormList() {
const { taskType } = this.formData;
const { executorList } = this;
const list = deepClone(taskType == 2 ? TASK_FORM_2 : TASK_FORM_DEFAULT);
if (taskType != 2) {
const list = deepClone(taskType == 8 ? TASK_FORM_8 : TASK_FORM_DEFAULT);
if (taskType != 8) {
list.forEach((item) => {
if (item.key == "executorUuid") {
item.options = executorList;
......@@ -355,7 +304,7 @@ export default {
"formData.scene": {
handler(val) {
if (this.formData.type) {
this.formData.type = [];
this.formData.type = "";
}
},
immediate: true,
......@@ -377,7 +326,9 @@ export default {
this.formRef.clearValidate();
}
});
this.loadExecutors();
if (!this.executorList.length) {
this.loadExecutors();
}
},
close() {
this.dialogShow = false;
......@@ -616,12 +567,15 @@ export default {
margin-left: 8px;
}
.number-input {
width: 259px;
// width: 259px;
}
.date-time {
width: 336px;
}
}
.date-range {
width: 336px;
}
padding: 20px 30px 20px 20px;
.tags-container {
margin-top: 10px;
......
......@@ -4,15 +4,91 @@
:dialog-config="dialogConfig.config"
:is-show.sync="dialogShow"
@handleClick="submit">
<el-form v-loading="loading"
class="form"
label-width="120px"
size="small">
<el-form class="form"
label-width="150px"
size="small"
:loading="loading">
<el-form-item label="区域:"
required>
<el-select v-model="formData.regionId"
class="filter-select"
placeholder="全部"
size="small"
clearable
filterable>
<el-option v-for="item in provinceOptions"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="品牌:"
required>
<el-cascader v-model="formData.brand"
class="filter-select filter-select-brand"
placeholder="全部"
size="small"
clearable
collapse-tags
filterable
:options="brandOptions"
:props="cascaderProps"
:show-all-levels="false">
</el-cascader>
</el-form-item>
<el-form-item label="区域运营:"
required>
<el-select v-model="formData.regionalOperatorId"
class="filter-select"
placeholder="全部"
size="small"
clearable
filterable>
<el-option v-for="item in regionOpsOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="线上运营:"
required>
<el-select v-model="formData.onlineOperatorId"
class="filter-select"
placeholder="全部"
size="small"
clearable
filterable>
<el-option v-for="item in onlineOpsOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="区域督导:"
required>
<el-select v-model="formData.flightSupervisionId"
class="filter-select"
placeholder="全部"
size="small"
clearable
filterable>
<el-option v-for="item in supervisorOpsOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="门店名称:"
required>
<el-select v-model="currentMerchantId"
class="select"
filterable>
class="filter-select"
filterable
:loading="merchantSelectLoading"
@visible-change="visibleChange">
<el-option v-for="item in merchantList"
:key="item.merchantNo"
:label="item.storeName"
......@@ -26,6 +102,7 @@
<script>
import { getWarningSummaryList } from "@/api/earlyWarningManager";
import { deepClone } from "@/common/util";
import {
cleanWarningSummaryParams,
getWarningSummaryParamsFromRoute,
......@@ -43,6 +120,30 @@ export default {
default: false,
},
merchantId: [String, Number],
provinceOptions: {
type: Array,
default: () => [],
},
brandOptions: {
type: Array,
default: () => [],
},
regionOpsOptions: {
type: Array,
default: () => [],
},
onlineOpsOptions: {
type: Array,
default: () => [],
},
supervisorOpsOptions: {
type: Array,
default: () => [],
},
defaultForm: {
type: Object,
default: () => ({}),
},
},
data() {
return {
......@@ -56,6 +157,24 @@ export default {
currentMerchantId: "",
loading: false,
btnLoding: false,
formData: {
regionId: "",
brand: [],
regionalOperatorId: "",
onlineOperatorId: "",
flightSupervisionId: "",
},
// 级联选择器配置
cascaderProps: {
value: "id",
label: "label",
children: "children",
expandTrigger: "hover",
emitPath: true,
checkStrictly: true, // 允许选择任意一级
multiple: true, // 启用多选功能(Element UI 2.x 需要在 props 中配置)
},
merchantSelectLoading: false,
};
},
computed: {
......@@ -67,14 +186,27 @@ export default {
this.close();
},
},
paramsInfo() {
return this.GET_PARAMS_INFO() || {};
},
},
watch: {
visible: {
handler(val) {
if (val) {
let defaultForm = deepClone(this.defaultForm);
let { formData } = this;
Object.keys(defaultForm).forEach((key) => {
if (formData[key] == "" || formData[key] == null || formData[key] == undefined) {
formData[key] = defaultForm[key];
}
if (key == "brand" && formData[key].length == 0) {
formData[key] = defaultForm[key];
}
});
this.formData = formData;
this.currentMerchantId = String(this.merchantId);
// console.log(typeof (this.currentMerchantId));
this.getMerchantList();
this.handleSearch(this.formData);
}
},
immediate: true,
......@@ -90,22 +222,26 @@ export default {
this.$emit("dialogClose");
},
getWarningSummaryRequestParams() {
const stored = loadWarningSummaryParams() || getWarningSummaryParamsFromRoute(this.$route.query);
const { bizs, cycleType, startTime, endTime } = this.GET_PARAMS_INFO() || {};
// const stored = loadWarningSummaryParams() || getWarningSummaryParamsFromRoute(this.$route.query);
const { bizs, cycleType, startTime, endTime } = deepClone(this.paramsInfo);
return cleanWarningSummaryParams({
...stored,
// ...stored,
...(bizs != null && { businessType: bizs }),
...(cycleType != null && { cycleType }),
...(startTime && { startDate: startTime }),
...(endTime && { endDate: endTime }),
});
},
async getMerchantList() {
async getMerchantList(filters = {}) {
this.loading = true;
try {
const data = await getWarningSummaryList(this.getWarningSummaryRequestParams());
const params = this.getWarningSummaryRequestParams();
console.log(JSON.parse(JSON.stringify({ ...params, ...filters })));
const data = await getWarningSummaryList({ ...params, ...filters });
this.merchantList = data;
this.merchantSelectLoading = false;
} finally {
this.merchantSelectLoading = false;
this.loading = false;
}
},
......@@ -119,6 +255,54 @@ export default {
}
this.close();
},
visibleChange(val) {
if (val) {
this.handleSearch(this.formData);
}
},
handleSearch(options) {
let filters = deepClone(options);
this.merchantSelectLoading = true;
let brandData = filters.brand;
let params = {};
// 过滤品牌数据:分离一级品牌id和二级品牌id
let firstbrandIds = []; // 一级品牌id数组
let twoBrandIds = []; // 二级品牌id数组
if (Array.isArray(brandData) && brandData.length > 0) {
brandData.forEach((brandItem) => {
if (Array.isArray(brandItem) && brandItem.length > 0) {
const firstLevelId = brandItem[0];
// 如果子数组长度为1,说明只选择了一级品牌,加入一级品牌数组
if (brandItem.length === 1) {
if (firstLevelId !== undefined && firstLevelId !== null) {
firstbrandIds.push(firstLevelId);
}
// eslint-disable-next-line style/brace-style
}
// 如果子数组长度大于1,说明选择了二级品牌,只加入二级品牌数组,不加入一级品牌数组
else if (brandItem.length > 1) {
const secondLevelId = brandItem[1];
if (secondLevelId !== undefined && secondLevelId !== null) {
twoBrandIds.push(secondLevelId);
}
}
}
});
// 去重
firstbrandIds = [...new Set(firstbrandIds)];
twoBrandIds = [...new Set(twoBrandIds)];
}
// 更新筛选条件(立即更新,保证UI响应)
delete filters.brand;
Object.keys(filters).forEach((key) => {
if (filters[key] != "") {
params[key] = filters[key];
}
});
this.getMerchantList({ ...params, firstbrandIds, twoBrandIds });
},
},
};
</script>
......@@ -130,11 +314,14 @@ export default {
}
.detail-content-warn {
::v-deep .el-dialog {
height: 256px;
height: 468px;
.el-dialog__body {
padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-form-item__label {
padding-right: 0;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
......@@ -144,13 +331,19 @@ export default {
border-top: none;
padding: 0;
}
.filter-select-brand {
.el-cascader__search-input {
&::placeholder {
color: #606266;
}
}
}
}
.form {
height: 89px;
padding: 37px 22px 0 0;
padding: 0 22px;
box-sizing: border-box;
.select {
width: 436px;
.filter-select {
width: 100%;
}
}
}
......
......@@ -71,7 +71,13 @@
</div>
</template>
</div>
<ChangeMerchantDialog :merchant-id="merchantDetailInfo.merchantNo"
<ChangeMerchantDialog :brand-options="baseData.brandOptions"
:default-form="formData"
:merchant-id="merchantDetailInfo.merchantNo"
:online-ops-options="baseData.onlineOpsList"
:province-options="baseData.provinceInfoList"
:region-ops-options="baseData.regionOpsList"
:supervisor-ops-options="baseData.supervisorOpsList"
:visible="merchantVisible"
@changeMerchant="changeMerchant"
@dialogClose="merchantVisible = false">
......@@ -80,9 +86,8 @@
</template>
<script type='text/ecmascript-6'>
import {
getStrategyMerchantDetail,
} from "@/api/earlyWarningManager";
import { merchantStaffByRoleList } from "@api/index";
import { getCarBrandList, getDistrictDetail, getStrategyMerchantDetail } from "@/api/earlyWarningManager";
import CalendarCustom from "../../../compoments/clendarCustom.vue";
import ChangeMerchantDialog from "./ChangeMerchantDialog.vue";
......@@ -138,6 +143,13 @@ export default {
},
],
merchantDetailInfo: {},
baseData: {
provinceInfoList: [],
regionOpsList: [], // 区域运营列表
onlineOpsList: [], // 线上运营列表
supervisorOpsList: [], // 督导列表
brandOptions: [], // 品牌级联选择器数据
},
};
},
computed: {
......@@ -151,17 +163,111 @@ export default {
3: "权益",
};
const routeLabel = this.$route.query.businessLabel;
if (routeLabel)
if (routeLabel) {
return routeLabel;
}
return BIZ_LABEL_MAP[this.paramsInfo.bizs] || "-";
},
formData() {
let { query } = this.$route;
return {
regionId: query.regionId || "",
brand: query.brand || [],
regionalOperatorId: query.regionalOperatorId || "",
onlineOperatorId: query.onlineOperatorId || "",
flightSupervisionId: query.flightSupervisionId || "",
};
},
},
mounted() {
},
methods: {
init() {
this.getStrategyMerchantDetail();
this.getCarBrandList();
this.getProvinceList();
this.getRegionOpsList();
this.getOnlineOpsList();
this.getSupervisorOpsList();
},
// 获取车品牌列表
async getCarBrandList() {
const res = await getCarBrandList({ containsChildren: true });
this.baseData.brandOptions = res;
},
// 获取省份列表
getProvinceList() {
const params = { districtName: "中国" };
getDistrictDetail(params).then((res) => {
if (res && res.length) {
this.baseData.provinceInfoList = res[0].districts;
// 在列表前面添加"全部"选项
if (this.baseData.provinceInfoList.length && this.baseData.provinceInfoList[0].name !== "全部") {
this.baseData.provinceInfoList.unshift({
code: "",
// code: null,
name: "全部",
});
}
}
});
},
// 获取区域运营列表
getRegionOpsList() {
merchantStaffByRoleList({ roleName: "区域运营" }).then((res) => {
if (res && res.length) {
// 将返回的数据转换为选择器需要的格式
this.baseData.regionOpsList = res.map(item => ({
value: item.uuid,
label: item.staffName,
}));
// 在列表前面添加"全部"选项
if (this.baseData.regionOpsList.length && this.baseData.regionOpsList[0].label !== "全部") {
this.baseData.regionOpsList.unshift({
value: "",
label: "全部",
});
}
}
});
},
// 获取线上运营列表
getOnlineOpsList() {
merchantStaffByRoleList({ roleName: "线上运营" }).then((res) => {
if (res && res.length) {
// 将返回的数据转换为选择器需要的格式
this.baseData.onlineOpsList = res.map(item => ({
value: item.uuid,
label: item.staffName,
}));
// 在列表前面添加"全部"选项
if (this.baseData.onlineOpsList.length && this.baseData.onlineOpsList[0].label !== "全部") {
this.baseData.onlineOpsList.unshift({
value: "",
label: "全部",
});
}
}
});
},
// 获取督导列表
getSupervisorOpsList() {
merchantStaffByRoleList({ roleName: "飞行督导" }).then((res) => {
if (res && res.length) {
// 将返回的数据转换为选择器需要的格式
this.baseData.supervisorOpsList = res.map(item => ({
value: item.uuid,
label: item.staffName,
}));
// 在列表前面添加"全部"选项
if (this.baseData.supervisorOpsList.length && this.baseData.supervisorOpsList[0].label !== "全部") {
this.baseData.supervisorOpsList.unshift({
value: "",
label: "全部",
});
}
}
});
},
// 处理日期范围变化
handleDateRangeChange(dateRange) {
......@@ -199,22 +305,27 @@ export default {
});
data.carBrandText = carBrandText.join("/");
}
if (data.onlineOperator && data.onlineOperator.length)
if (data.onlineOperator && data.onlineOperator.length) {
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("/");
if (data.flightSupervision && data.flightSupervision.length)
}
if (data.flightSupervision && data.flightSupervision.length) {
data.flightSupervisionText = data.flightSupervision.map(e => e.username).join("/");
}
this.merchantDetailInfo = data;
},
changeMerchant(e) {
this.$emit("changeMerchant", e);
},
formatDateValue(date) {
if (!date)
if (!date) {
return null;
if (typeof date === "string")
}
if (typeof date === "string") {
return date;
}
const d = new Date(date);
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, "0");
......@@ -222,10 +333,12 @@ export default {
return `${year}-${month}-${day}`;
},
setDate(rangeType, dateRange) {
if (rangeType)
if (rangeType) {
this.timeRangeType = this.timeRangeOptions.find(item => item.value == rangeType);
if (dateRange)
}
if (dateRange) {
this.dateRange = { ...dateRange };
}
// 等待 CalendarCustom 因切换周期类型触发的 watcher 执行完毕后再同步
this.$nextTick(() => {
const calendar = this.$refs.calendarCustom;
......@@ -241,8 +354,9 @@ export default {
const range = dateRange?.startDate && dateRange?.endDate
? this.dateRange
: calendar?.internalDateRange;
if (!range?.startDate || !range?.endDate)
if (!range?.startDate || !range?.endDate) {
return;
}
const { value } = this.timeRangeType;
this.$emit("dateChange", {
startTime: this.formatDateValue(range.startDate),
......@@ -340,6 +454,7 @@ export default {
}
.change-store {
padding: 0 !important;
font-size: 13px;
}
}
.el-icon-sort {
......
......@@ -34,11 +34,20 @@ const CREATED_DATE = {
return dayjs(val.createdDate).format("YYYY-MM-DD HH:mm:ss");
},
};
const LEARNING_TARGET = {
label: "学习目标",
format: (val, bizs) => {
let prevText = bizs == 2 ? "平均客单价" : "转化率";
let unit = bizs == 2 ? "" : "%";
return val.learningTarget ? `${prevText}= ${val.learningTarget}${unit}` : "-";
},
};
const STRATEGY_FORM_01 = [
TITLE,
DATE_RANGE,
CREATED,
CREATED_DATE,
LEARNING_TARGET,
];
const STRATEGY_FORM_2456 = [
CREATED,
......@@ -58,6 +67,16 @@ const STRATEGY_FORM_2456 = [
return [5, 6].includes(strategyType);
},
},
{
label: "最大订单数",
key: "maxOrderNum",
hide: (val) => {
let {
strategyType,
} = val;
return ![5, 6].includes(strategyType);
},
},
CREATED_DATE,
];
const STRATEGY_FORM_3 = [
......
......@@ -30,7 +30,7 @@
</template>
<template v-else>
<template v-if="item.format">
{{ item.format(detailInfo) }}
{{ item.format(detailInfo, currentBiz) }}
</template>
<template v-else>
{{ detailInfo[item.key] || '-' }}
......@@ -128,6 +128,7 @@ export default {
components: {
StudyView,
},
inject: ["GET_PARAMS_INFO"],
props: {
dialogVisible: {
type: Boolean,
......@@ -249,12 +250,19 @@ export default {
}
return list;
},
paramsInfo() {
return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO();
},
currentBiz() {
return this.paramsInfo?.bizs;
},
},
watch: {
dialogShow: {
handler(val) {
if (val)
if (val) {
this.init();
}
},
immediate: true,
deep: true,
......
......@@ -22,7 +22,8 @@ const STRATEGYTYPEOPTIONS = {
10: "商务政策更新评估",
11: "多品类扩张",
12: "流量类-提升触客率",
13: "流量类-多场景拓展",
14: "流量类-拓新店流量",
};
const DATE_RANGE = {
label: "执行周期",
......
......@@ -59,9 +59,7 @@
<AddStrategy :dialogVisible.sync="addStrategyVisible"
@refresh="init">
</AddStrategy>
<TeachingDetail :item="currentItem"
:visibleSync.sync="teachingDetailVisible">
</TeachingDetail>
<TaskDetail :item="currentItem" :visibleSync.sync="taskDetailVisible"></TaskDetail>
</div>
</template>
......@@ -76,7 +74,6 @@ 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 {
......@@ -87,7 +84,6 @@ export default {
// AddTeaching,
AddTask,
StrategyDetail,
TeachingDetail,
TaskDetail,
},
inject: ["GET_PARAMS_INFO"],
......@@ -98,7 +94,6 @@ export default {
addTeachingVisible: false,
addTaskVisible: false,
strategyDetailVisible: false,
teachingDetailVisible: false,
taskDetailVisible: false,
currentItem: {},
viewKey: Date.now(),
......@@ -142,9 +137,7 @@ export default {
},
toDetail(item) {
this.currentItem = item;
if (item.strategyType === 8) {
this.teachingDetailVisible = true;
} else if ([9, 10, 11, 12].includes(item.strategyType)) {
if ([8, 9, 10, 11, 12, 13, 14].includes(item.strategyType)) {
this.taskDetailVisible = true;
} else {
this.strategyDetailVisible = true;
......
<template>
<el-drawer class="strategy-drawer"
size="69.44vw"
:visible.sync="dialogShow"
:wrapper-closable="false"
@close="close">
<template #title>
<div class="strategy-drawer-title">
查看详情
</div>
</template>
<div class="drawer-content">
<el-scrollbar class="scrollbar-wrapper">
<div class="detail-container">
<div v-for="(section, index) in detailData"
:key="index"
class="detail-section">
<div class="section-title">
{{ section.title }}
</div>
<div class="section-content">
<el-row>
<el-col v-for="(item, idx) in section.config"
:key="idx"
class="info-item"
:span="item.fullRow ? 24 : 12">
<div class="info-label">
{{ item.subtitle }}
</div>
<div class="info-value">
<template v-if="!item.isImage">
{{ item.value || '-' }}
</template>
<template v-else>
<div v-if="item.value && item.value.length > 0" class="image-list">
<el-image v-for="(img, imgIdx) in item.value"
:key="imgIdx"
fit="cover"
style="width: 80px; height: 80px; margin-right: 10px; border-radius: 4px;"
:preview-src-list="item.value"
:src="img">
</el-image>
</div>
<div v-else>
-
</div>
</template>
</div>
</el-col>
</el-row>
</div>
</div>
</div>
</el-scrollbar>
<div class="footer">
<el-button v-preventReClick
:size="size"
@click="close">
返回
</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import { queryStrategyStudyDetailById } from "@/api/earlyWarningManager";
export default {
name: "TeachingDetail",
props: {
visibleSync: {
type: Boolean,
default: false,
},
item: {
type: Object,
default: () => ({}),
},
},
data() {
return {
size: "small",
detailData: [],
};
},
computed: {
dialogShow: {
get() {
return this.visibleSync;
},
set(val) {
this.$emit("update:visibleSync", val);
},
},
},
watch: {
visibleSync(val) {
if (val) {
this.initData();
}
},
},
methods: {
close() {
this.dialogShow = false;
},
async initData() {
if (!this.item.id)
return;
try {
const res = await queryStrategyStudyDetailById({ id: this.item.id });
if (res) {
this.formatDetailData(res);
}
} catch (error) {
console.error(error);
}
},
formatDetailData(data) {
const staffList = data.staffList || [];
const targetStaffs = staffList.filter(e => e.userPosition === 0).map(e => e.userName).join("/");
const detailData = [
{
title: "申请信息",
config: [
{ subtitle: "需带教人员:", value: targetStaffs || "-", fullRow: true },
{ subtitle: "申请说明:", value: data.description || "-", fullRow: true },
{ subtitle: "操作人:", value: data.createdBy || "-", fullRow: false },
{ subtitle: "操作时间:", value: data.createdDate || "-", fullRow: false },
],
},
];
const mentoringAppDetail = data.mentoringApplicationDetail || {};
const approvalInfo = mentoringAppDetail.approvalInfo || {};
detailData.push({
title: "审批信息",
config: [
{ subtitle: "状态:", value: approvalInfo.approvalStatus || "-", fullRow: true },
...(approvalInfo.approvalStatus === "驳回" && approvalInfo.rejectReason ? [{ subtitle: "驳回:", value: approvalInfo.rejectReason || "-", fullRow: true }] : []),
{ subtitle: "审批人:", value: approvalInfo.approverName || "-", fullRow: false },
{ subtitle: "审批时间:", value: approvalInfo.approvalTime || "-", fullRow: false },
],
});
const taskDetail = mentoringAppDetail.taskDetail;
if (taskDetail) {
detailData.push({
title: "带教信息",
config: [
{ subtitle: "状态:", value: taskDetail.taskStatus || "-", fullRow: false },
{ subtitle: "指定区域督导:", value: taskDetail.supervisorName || "-", fullRow: false },
{ subtitle: "带教场景:", value: taskDetail.mentoringScene || "-", fullRow: false },
{ subtitle: "带教时间:", value: taskDetail.mentoringTime || "-", fullRow: false },
{ subtitle: "带教方式:", value: taskDetail.mentoringMethod || "-", fullRow: false },
{ subtitle: "带教主题:", value: taskDetail.mentoringTopic || "-", fullRow: false },
{ subtitle: "推送课程:", value: taskDetail.pushCourses || "-", fullRow: true },
{ subtitle: "带教内容摘要:", value: taskDetail.contentSummary || "-", fullRow: true },
{ subtitle: "带教招聘佐证:", value: taskDetail.evidenceImages || [], isImage: true, fullRow: true },
],
});
}
this.detailData = detailData;
},
},
};
</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;
}
.el-drawer__body {
height: calc(100% - 55px);
overflow: hidden;
}
}
.drawer-content {
height: 100%;
display: flex;
flex-direction: column;
.scrollbar-wrapper {
flex: 1;
overflow: hidden;
::v-deep .el-scrollbar__wrap {
overflow-x: hidden;
}
}
.detail-container {
padding: 0 20px;
}
.detail-section {
.section-title {
color: #333333;
font-size: 16px;
padding: 16px 0;
border-bottom: 1px solid #e5e5e5;
margin-bottom: 16px;
display: flex;
justify-content: space-between;
align-items: center;
}
.section-content {
padding: 0 10px;
.info-item {
display: flex;
margin-bottom: 16px;
line-height: 20px;
font-size: 14px;
.info-label {
color: #666;
width: 110px;
flex-shrink: 0;
text-align: right;
}
.info-value {
color: #333;
flex: 1;
word-break: break-all;
.image-list {
display: flex;
flex-wrap: wrap;
}
}
}
}
}
.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
const TASK_OPTIONS = {
8: "转化类-督导带教",
9: "转化类-人员更换评估",
10: "商务政策更新评估",
11: "多品类扩张",
12: "流量类-提升触客率",
// 👇
13: "流量类-多场景拓展",
14: "流量类-拓新店流量",
};
export {
TASK_OPTIONS,
};
......@@ -18,7 +18,7 @@
class="info-item"
:span="item.fullRow ? 24 : 12">
<div class="info-label">
{{ item.subtitle }}
{{ item.subtitle }}:
</div>
<div class="info-value">
<template v-if="!item.isImage">
......@@ -111,6 +111,7 @@ export default {
},
formatDetailData(data) {
const staffList = data.staffList || [];
const { strategyType } = data;
// 问题人员:userPosition=0
const problemStaffs = staffList.filter(e => e.userPosition === 0).map(e => e.userName).join("、");
// 执行人员:userPosition=8 或 9
......@@ -118,7 +119,7 @@ export default {
// 任务类型映射
const taskTypeMap = {
2: "转化类-督导带教",
8: "转化类-督导带教",
9: "转化类-人员更换评估",
10: "商务政策更新评估",
11: "多品类扩张",
......@@ -128,27 +129,32 @@ export default {
14: "流量类-拓新店流量",
};
const taskTypeName = taskTypeMap[data.strategyType] || "-";
const taskTypeName = taskTypeMap[strategyType] || "-";
const taskStatusName = data.pushFlag === 6 ? "已完成" : "未完成";
const detailData = [
{ subtitle: "任务类型:", value: taskTypeName, fullRow: false },
{ subtitle: "操作人:", value: data.createdBy || "-", fullRow: false },
{ subtitle: "操作时间:", value: data.createdDate || "-", fullRow: false },
{ subtitle: "任务类型", value: taskTypeName, fullRow: false },
{ subtitle: "操作人", value: data.createdBy || "-", fullRow: false },
{ subtitle: "操作时间", value: data.createdDate || "-", fullRow: false },
];
// 仅 strategyType=9 时展示问题人员
if (data.strategyType === 9) {
detailData.push({ subtitle: "问题人员:", value: problemStaffs || "-", fullRow: true });
if (strategyType === 9) {
detailData.push({ subtitle: "问题人员", value: problemStaffs || "-", fullRow: true });
}
// 剩余基础字段
detailData.push(
{ subtitle: "执行人:", value: executorStaffs || "-", fullRow: true },
{ subtitle: "任务说明:", value: data.description || "-", fullRow: true },
{ subtitle: "任务状态:", value: taskStatusName, fullRow: true },
{ subtitle: "执行人", value: executorStaffs || "-", fullRow: true },
{ subtitle: "任务说明", value: data.description || "-", fullRow: true },
{ subtitle: "任务状态", value: taskStatusName, fullRow: true },
);
if ([9, 13, 14].includes(strategyType)) {
detailData.push({ subtitle: "任务执行结果", value: data.a || "-", fullRow: true });
}
if (strategyType === 9) {
detailData.push({ subtitle: "关联招聘或人员", value: data.b || "-", fullRow: true });
}
// 协同任务专有详情 (collaborativeTaskDetail)
const collabDetail = data.collaborativeTaskDetail || {};
detailData.push(
......@@ -219,7 +225,7 @@ export default {
.info-label {
color: #666;
width: 110px;
width: 120px;
flex-shrink: 0;
text-align: right;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!