|
@@ -53,6 +53,14 @@
|
|
|
:data="tableData"
|
|
|
bordered
|
|
|
>
|
|
|
+ <template #roleName="{ row }">
|
|
|
+ <span v-if="row.roleName === '区域协调人'">{{
|
|
|
+ row.roleName
|
|
|
+ }}</span>
|
|
|
+ <span v-else
|
|
|
+ ><span style="color: red">* </span>{{ row.roleName }}</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
<template #key="{ row }">
|
|
|
<t-select
|
|
|
v-if="row.key === 'REGION_COORDINATOR'"
|
|
@@ -60,6 +68,7 @@
|
|
|
:options="options1"
|
|
|
placeholder="请选择"
|
|
|
multiple
|
|
|
+ :max="1"
|
|
|
:keys="{ label: 'name', value: 'userId' }"
|
|
|
/>
|
|
|
<t-select
|
|
@@ -68,6 +77,7 @@
|
|
|
:options="options2"
|
|
|
placeholder="请选择"
|
|
|
multiple
|
|
|
+ :max="1"
|
|
|
:keys="{ label: 'name', value: 'userId' }"
|
|
|
/>
|
|
|
<t-select
|
|
@@ -112,7 +122,6 @@ const emit = defineEmits(['update:visible', 'success']);
|
|
|
const props = defineProps({
|
|
|
visible: Boolean,
|
|
|
curRow: Object,
|
|
|
- dispatchInfo: { type: Object, default: () => {} },
|
|
|
});
|
|
|
const requestInfo = ref({});
|
|
|
const formRef = ref(null);
|
|
@@ -140,7 +149,7 @@ const { formData, isEdit } = useClearDialog(
|
|
|
props,
|
|
|
formRef,
|
|
|
() => {
|
|
|
- formData.crmDetailId = props.curRow?.id;
|
|
|
+ formData.crmDetailId = props.curRow?.crmDetailId || props.curRow?.id; //两种场景使用了人员调配,一个是菜单页面的SOP列表,一个是创建sop里的sop列表
|
|
|
formData.allocationParams = init();
|
|
|
getOptions();
|
|
|
}
|
|
@@ -151,7 +160,7 @@ const options2 = ref([]);
|
|
|
const options3 = ref([]);
|
|
|
const getOptions = () => {
|
|
|
getAllocationInfoApi({
|
|
|
- crmDetailId: props.curRow?.id,
|
|
|
+ crmDetailId: props.curRow?.crmDetailId || props.curRow?.id,
|
|
|
}).then((res) => {
|
|
|
requestInfo.value = res;
|
|
|
tableData.value[0].history = res.regionCoordinatorInfo.historicalList;
|
|
@@ -199,12 +208,17 @@ const tableData = ref([
|
|
|
},
|
|
|
]);
|
|
|
const roleColumns = [
|
|
|
- { colKey: 'roleName', title: '角色', width: 120 },
|
|
|
+ { colKey: 'roleName', title: '角色', width: 120, cel: 'roleName' },
|
|
|
{ colKey: 'key', title: '人员', cell: 'key' },
|
|
|
{ colKey: 'history', title: '历史人员记录', cell: 'history', width: 200 },
|
|
|
];
|
|
|
|
|
|
const save = async () => {
|
|
|
+ if (!formData.allocationParams[1].userIdList?.length) {
|
|
|
+ return MessagePlugin.error('大区经理必选,且只能选择一个');
|
|
|
+ } else if (!formData.allocationParams[2].userIdList?.length) {
|
|
|
+ return MessagePlugin.error('工程师必选');
|
|
|
+ }
|
|
|
saveAllocationInfoApi(formData).then(() => {
|
|
|
MessagePlugin.success('保存成功');
|
|
|
emit('update:visible', false);
|