Commit 71f77149 by wangzhihui

```

refactor(api): 调整预警管理API文件格式化

调整了src/api/earlyWarningManager.js文件中的代码格式,
包括修正分号使用、函数参数格式、字符串引号统一等,
同时新增了一个获取区域运营执行人员列表的API函数。
```
1 parent e7b7faba
export default { 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 () { count() {
return this.chooseList.length return this.chooseList.length;
}, },
positionTypeList () { positionTypeList() {
return this.GET_POSITION_TYPE_LIST && this.GET_POSITION_TYPE_LIST() return this.GET_POSITION_TYPE_LIST && this.GET_POSITION_TYPE_LIST();
}, },
paramsInfo () { paramsInfo() {
return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO() return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO();
}, },
merchantList () { merchantList() {
return this.GET_MERCHANT_LIST && this.GET_MERCHANT_LIST() return this.GET_MERCHANT_LIST && this.GET_MERCHANT_LIST();
}, },
biz () { biz() {
return this.GET_BIZ && this.GET_BIZ() return this.GET_BIZ && this.GET_BIZ();
}, },
delMerchantList(){ delMerchantList() {
return this.DEL_PARAMS_MERCHANT_LIST && this.DEL_PARAMS_MERCHANT_LIST() 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, },
deep: true immediate: true,
}, deep: true,
}, },
},
mounted () { mounted() {
}, },
data () { data() {
return { return {
viewKey: Date.now(), viewKey: Date.now(),
config: { config: {
appendToBody: true, appendToBody: true,
isShowFooter: true, isShowFooter: true,
cancel_name: "取消", cancel_name: "取消",
confirm_name: "确定", confirm_name: "确定",
}, },
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) { },
this.$nextTick(() => { selectionTable(list) {
let { targetId, chooseList } = this this.$nextTick(() => {
if (this.formatTag) list = list.map(e => { let { targetId, chooseList } = this;
return this.formatTag(e) if (this.formatTag) {
}) list = list.map((e) => {
// 合并列表后基于 targetId 去重 return this.formatTag(e);
const mergedList = [...chooseList, ...list] });
this.chooseList = [...new Map( }
mergedList.map(item => [item[targetId], item]) // 合并列表后基于 targetId 去重
).values()] const mergedList = [...chooseList, ...list];
}) this.chooseList = [...new Map(
}, mergedList.map(item => [item[targetId], item]),
selectRow (list, row) { ).values()];
let { targetId } = this, });
index = list.findIndex(i => i[targetId] === row[targetId]) },
if (index == -1) { selectRow(list, row) {
let delIndex = this.chooseList.findIndex(i => i[targetId] === row[targetId]) let { targetId } = this;
if (delIndex > -1) this.chooseList.splice(delIndex, 1) let index = list.findIndex(i => i[targetId] === row[targetId]);
} if (index == -1) {
}, let delIndex = this.chooseList.findIndex(i => i[targetId] === row[targetId]);
selectAll (list) { if (delIndex > -1)
if (!list.length) { this.chooseList.splice(delIndex, 1);
let tableData = this.multipleTable().data, }
{ targetId } = this },
// 使用 Set 存储 tableData 中的所有 targetId selectAll(list) {
const tableDataIds = new Set(tableData.map(item => item[targetId])); if (!list.length) {
// 保留 chooseList 中不在 tableData 的项目 let tableData = this.multipleTable().data;
this.chooseList = this.chooseList.filter(item => let { targetId } = this;
!tableDataIds.has(item[targetId]) // 使用 Set 存储 tableData 中的所有 targetId
); const tableDataIds = new Set(tableData.map(item => item[targetId]));
} // 保留 chooseList 中不在 tableData 的项目
}, this.chooseList = this.chooseList.filter(item =>
multipleTable () { !tableDataIds.has(item[targetId]),
return this.$refs.multipleTable );
}, }
clearChooseList () { },
this.chooseList = [] multipleTable() {
this.multipleTable().clearMutiSelect() return this.$refs.multipleTable;
} },
} 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
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
<el-select v-model="formData.taskType" <el-select v-model="formData.taskType"
placeholder="请选择任务类型" placeholder="请选择任务类型"
style="width: 100%;"> style="width: 100%;">
<el-option label="人员更换评估" value="人员更换评估"></el-option> <el-option v-for="(label, value) in taskTypeOptions"
<el-option label="商务政策更新评估" value="商务政策更新评估"></el-option> :key="value"
<el-option label="多品类拓张" value="多品类拓张"></el-option> :label="label"
<el-option label="流量问题改善" value="流量问题改善"></el-option> :value="Number(value)">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -52,13 +53,15 @@ ...@@ -52,13 +53,15 @@
</el-form-item> </el-form-item>
<el-form-item label="执行人员:" prop="executorUuid"> <el-form-item label="执行人员:" prop="executorUuid">
<el-radio-group v-model="formData.executorUuid"> <el-select v-model="formData.executorUuid"
<el-radio v-for="item in executorList" placeholder="请选择执行人员"
:key="item.staffUuid" style="width: 100%;">
:label="item.staffUuid"> <el-option v-for="item in executorList"
{{ item.staffName }} :key="item.directorUserId"
</el-radio> :label="item.directorName"
</el-radio-group> :value="item.directorUserId">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="任务说明:" prop="description"> <el-form-item label="任务说明:" prop="description">
...@@ -77,7 +80,8 @@ ...@@ -77,7 +80,8 @@
@click="close"> @click="close">
取消 取消
</el-button> </el-button>
<el-button size="small" <el-button :loading="loading"
size="small"
type="primary" type="primary"
@click="confirm"> @click="confirm">
确定 确定
...@@ -95,7 +99,7 @@ ...@@ -95,7 +99,7 @@
</template> </template>
<script> <script>
import { getStrategyStaffList } from "@/api/earlyWarningManager"; import { batchCreateStrategy, getStrategyShopMerchantOperators, getStrategyStaffList } from "@/api/earlyWarningManager";
import MultipleStaff from "../AddStrategy/MultipleStaff.vue"; import MultipleStaff from "../AddStrategy/MultipleStaff.vue";
export default { export default {
...@@ -124,6 +128,13 @@ export default { ...@@ -124,6 +128,13 @@ export default {
}, },
data() { data() {
return { return {
loading: false,
taskTypeOptions: {
9: "人员更换评估",
10: "商务政策更新评估",
11: "多品类拓张",
12: "流量问题改善",
},
formData: { formData: {
taskType: "", taskType: "",
taskTitle: "", taskTitle: "",
...@@ -187,37 +198,24 @@ export default { ...@@ -187,37 +198,24 @@ export default {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
} }
}); });
this.loadAllStaffs();
this.loadExecutors(); this.loadExecutors();
}, },
close() { close() {
this.dialogShow = false; this.dialogShow = false;
}, },
loadAllStaffs() {
const params = {
positionTypeList: this.positionTypeList,
sceneType: 0,
staffName: "",
merchantIdList: this.paramsInfo ? this.paramsInfo.merchantIds : [],
};
getStrategyStaffList({ ...params, pageSize: 9999, pageNum: 1 }).then((res) => {
if (res && res.list) {
this.formData.staffList = res.list;
}
});
},
loadExecutors() { loadExecutors() {
// 9: 区域运营
const params = { const params = {
positionTypeList: [9], merchantId: this.paramsInfo ? this.paramsInfo.merchantIds[0] : "",
sceneType: 0, businessType: this.biz,
staffName: "",
merchantIdList: this.paramsInfo ? this.paramsInfo.merchantIds : [],
}; };
getStrategyStaffList({ ...params, pageSize: 9999, pageNum: 1 }).then((res) => { getStrategyShopMerchantOperators(params).then((res) => {
if (res && res.list) { if (res && res.length) {
this.executorList = res.list; this.executorList = res;
} else {
this.executorList = [];
} }
}).catch(() => {
this.executorList = [];
}); });
}, },
openStaffDialog() { openStaffDialog() {
...@@ -231,27 +229,74 @@ export default { ...@@ -231,27 +229,74 @@ export default {
this.$refs.form.validateField("staffList"); this.$refs.form.validateField("staffList");
}, },
confirm() { confirm() {
this.$refs.form.validate((valid) => { try {
if (valid) { this.loading = true;
const executor = this.executorList.find(item => item.staffUuid === this.formData.executorUuid); let { paramsInfo, merchantName, formData, biz } = this;
// TODO: 调用后端接口提交 let { taskType, taskTitle, staffList, executorUuid, description } = formData;
const submitData = { this.$refs.form.validate(async (valid) => {
merchantId: this.paramsInfo.merchantIds[0], if (valid) {
merchantName: this.merchantName, const executor = this.executorList.find(item => item.directorUserId === executorUuid);
biz: this.biz, let params = {
taskType: this.formData.taskType, strategyInfo: {
taskTitle: this.formData.taskTitle, strategyType: taskType,
staffList: this.formData.staffList, biz,
executor, title: taskTitle,
description: this.formData.description, description,
}; },
console.log("提交协同任务:", submitData); 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
});
}
this.$message.success("操作成功"); if (allStaffs.length) {
this.$emit("refresh"); params.staffList = allStaffs;
this.dialogShow = false; }
} 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);
}
}, },
}, },
}; };
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
@click="close"> @click="close">
取消 取消
</el-button> </el-button>
<el-button size="small" <el-button :loading="loading"
size="small"
type="primary" type="primary"
@click="confirm"> @click="confirm">
确定 确定
...@@ -67,7 +68,7 @@ ...@@ -67,7 +68,7 @@
</template> </template>
<script> <script>
import { getStrategyStaffList } from "@/api/earlyWarningManager"; import { batchCreateStrategy } from "@/api/earlyWarningManager";
import MultipleStaff from "../AddStrategy/MultipleStaff.vue"; import MultipleStaff from "../AddStrategy/MultipleStaff.vue";
export default { export default {
...@@ -96,6 +97,7 @@ export default { ...@@ -96,6 +97,7 @@ export default {
}, },
data() { data() {
return { return {
loading: false,
formData: { formData: {
staffList: [], staffList: [],
description: "", description: "",
...@@ -146,24 +148,10 @@ export default { ...@@ -146,24 +148,10 @@ export default {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
} }
}); });
this.loadAllStaffs();
}, },
close() { close() {
this.dialogShow = false; this.dialogShow = false;
}, },
loadAllStaffs() {
const params = {
positionTypeList: this.positionTypeList,
sceneType: 0,
staffName: "",
merchantIdList: this.paramsInfo ? this.paramsInfo.merchantIds : [],
};
getStrategyStaffList({ ...params, pageSize: 9999, pageNum: 1 }).then((res) => {
if (res && res.list) {
this.formData.staffList = res.list;
}
});
},
openStaffDialog() { openStaffDialog() {
this.staffTagVisible = true; this.staffTagVisible = true;
}, },
...@@ -175,23 +163,61 @@ export default { ...@@ -175,23 +163,61 @@ export default {
this.$refs.form.validateField("staffList"); this.$refs.form.validateField("staffList");
}, },
confirm() { confirm() {
this.$refs.form.validate((valid) => { try {
if (valid) { this.loading = true;
// TODO: 调用后端接口提交 const { paramsInfo, merchantName, formData, biz } = this;
const submitData = { const { staffList, description } = formData;
merchantId: this.paramsInfo.merchantIds[0], this.$refs.form.validate(async (valid) => {
merchantName: this.merchantName, if (valid) {
biz: this.biz, const params = {
staffList: this.formData.staffList, strategyInfo: {
description: this.formData.description, strategyType: 8,
}; biz,
console.log("提交带教申请:", submitData); description,
},
this.$message.success("操作成功"); merchantList: [
this.$emit("refresh"); {
this.dialogShow = false; 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);
}
}, },
}, },
}; };
......
import dayjs from "dayjs" /*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2026-04-01 09:57:49
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-06-01 15:21:51
* @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.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('处理人') STAFF_FORMAT("处理人"),
] ];
const STRATEGY_8 = [
STAFF_FORMAT("需带教人员"),
];
const STRATEGY_9_10_11_12 = [
STAFF_FORMAT("问题人员"),
STAFF_FORMAT("执行人员"),
];
export { export {
STRATEGYTYPEOPTIONS, STRATEGY_01,
STRATEGY_01, STRATEGY_3,
STRATEGY_2456, STRATEGY_7,
STRATEGY_3, STRATEGY_8,
STRATEGY_7, STRATEGY_9_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
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
:item="currentItem" :item="currentItem"
@openReceptionDialog="$emit('openReceptionDialog', $event)"> @openReceptionDialog="$emit('openReceptionDialog', $event)">
</StrategyDetail> </StrategyDetail>
<AddStrategy :dialogVisible.sync="addStrategyVisible" @refresh="init"></AddStrategy>
</AddStrategy>
<TeachingDetail :item="currentItem" <TeachingDetail :item="currentItem"
:visibleSync.sync="teachingDetailVisible"> :visibleSync.sync="teachingDetailVisible">
</TeachingDetail> </TeachingDetail>
...@@ -150,7 +152,7 @@ export default { ...@@ -150,7 +152,7 @@ export default {
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) {
......
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
</template> </template>
<script> <script>
import { queryStrategyTaskDetailById } from "@/api/earlyWarningManager";
export default { export default {
name: "TeachingDetail", name: "TeachingDetail",
props: { props: {
...@@ -103,42 +105,66 @@ export default { ...@@ -103,42 +105,66 @@ export default {
close() { close() {
this.dialogShow = false; this.dialogShow = false;
}, },
initData() { async initData() {
// 模拟数据,等后端接口提供后替换为实际数据 if (!this.item.id)
this.detailData = [ return;
try {
const res = await queryStrategyTaskDetailById({ 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: "申请信息", title: "申请信息",
config: [ config: [
{ subtitle: "需带教人员:", value: "张三/李四", fullRow: true }, { subtitle: "需带教人员:", value: targetStaffs || "-", fullRow: true },
{ subtitle: "申请说明:", value: "安排课程学习,进一步跟进驻店人员学习情况及业务情况。安排课程学习,进一步跟进驻店人员学习情况及业务情况。安排课程学习,进一步跟进驻店人员学习情况及业务情况。", fullRow: true }, { subtitle: "申请说明:", value: data.description || "-", fullRow: true },
{ subtitle: "操作人:", value: "杨佳", fullRow: false }, { subtitle: "操作人:", value: data.createdBy || "-", fullRow: false },
{ subtitle: "操作时间:", value: "2025-10-01 12:34:23", fullRow: false }, { subtitle: "操作时间:", value: data.createdDate || "-", fullRow: false },
],
},
{
title: "审批信息",
config: [
{ subtitle: "状态:", value: "张三/李四", fullRow: true },
{ subtitle: "驳回:", value: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", fullRow: true },
{ subtitle: "审批人:", value: "通过", fullRow: false },
{ subtitle: "审批时间:", value: "2025-10-01 12:34:23", 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: "带教信息", title: "带教信息",
config: [ config: [
{ subtitle: "状态:", value: "执行中", fullRow: false }, { subtitle: "状态:", value: taskDetail.taskStatus || "-", fullRow: false },
{ subtitle: "指定区域督导:", value: "杨佳", fullRow: false }, { subtitle: "指定区域督导:", value: taskDetail.supervisorName || "-", fullRow: false },
{ subtitle: "带教场景:", value: "XXXXXXXXXXXXXXXXXX", fullRow: false }, { subtitle: "带教场景:", value: taskDetail.mentoringScene || "-", fullRow: false },
{ subtitle: "带教时间:", value: "2025-10-01 12:34:23", fullRow: false }, { subtitle: "带教时间:", value: taskDetail.mentoringTime || "-", fullRow: false },
{ subtitle: "带教方式:", value: "XXXXXXXXXXXXXXXXXX", fullRow: false }, { subtitle: "带教方式:", value: taskDetail.mentoringMethod || "-", fullRow: false },
{ subtitle: "带教主题:", value: "XXXXXXXXXXXXXXXXXX", fullRow: false }, { subtitle: "带教主题:", value: taskDetail.mentoringTopic || "-", fullRow: false },
{ subtitle: "推送课程:", value: "XXXXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXX", fullRow: true }, { subtitle: "推送课程:", value: taskDetail.pushCourses || "-", fullRow: true },
{ subtitle: "带教内容摘要:", value: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", fullRow: true }, { subtitle: "带教内容摘要:", value: taskDetail.contentSummary || "-", fullRow: true },
{ subtitle: "带教招聘佐证:", value: ["https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", "https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg"], isImage: true, fullRow: true }, { subtitle: "带教招聘佐证:", value: taskDetail.evidenceImages || [], isImage: true, fullRow: true },
], ],
}, });
]; }
this.detailData = detailData;
}, },
}, },
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!