|
|
@@ -71,7 +71,16 @@
|
|
|
<el-input v-model="drawerForm.platformName" placeholder="请输入平台名称" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="16">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="产品支持" prop="productSupport" label-for="productSupportSelect">
|
|
|
+ <el-select id="productSupportSelect" v-model="drawerForm.productSupport" style="width:100%" placeholder="请选择" filterable clearable @change="handleProductSupportChange">
|
|
|
+ <el-option v-for="item in computedProductSupportOptions" :key="item.userId || item.staffId" :label="item.nickName || item.staffName" :value="String(item.userId || item.staffId)" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="平台链接" prop="platformLink">
|
|
|
<el-input v-model="drawerForm.platformLink" placeholder="请输入平台链接" />
|
|
|
</el-form-item>
|
|
|
@@ -300,6 +309,24 @@ const computedUserOptions = computed(() => {
|
|
|
return list;
|
|
|
});
|
|
|
|
|
|
+const computedProductSupportOptions = computed(() => {
|
|
|
+ const list = [...(props.options.user || [])];
|
|
|
+ const supportId = drawerForm.value.productSupport;
|
|
|
+ if (supportId) {
|
|
|
+ const exists = list.some(u => String(u.userId || u.staffId) === String(supportId));
|
|
|
+ if (!exists && (drawerForm.value.productSupportName || drawerForm.value.staffSupportName)) {
|
|
|
+ const name = drawerForm.value.productSupportName || drawerForm.value.staffSupportName;
|
|
|
+ list.unshift({
|
|
|
+ userId: supportId,
|
|
|
+ staffId: supportId,
|
|
|
+ nickName: name,
|
|
|
+ staffName: name
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+});
|
|
|
+
|
|
|
const remoteSearchCustomer = async (query) => {
|
|
|
customerLoading.value = true;
|
|
|
try {
|
|
|
@@ -368,9 +395,16 @@ const loadData = async () => {
|
|
|
customName: data.customName || data.customerName, // 字段映射增强
|
|
|
leader: data.leader ? String(data.leader) : (data.leaderId ? String(data.leaderId) : ''),
|
|
|
leaderName: data.leaderName || data.staffName,
|
|
|
+ productSupport: data.productSupport ? String(data.productSupport) : '',
|
|
|
shortlistedRequirement: data.shortlistedRequirement || data.condition || data.requirement,
|
|
|
finalizationType: data.finalizationType || data.shortlistedType
|
|
|
};
|
|
|
+
|
|
|
+ // 补全 productSupportName
|
|
|
+ if (data.productSupport) {
|
|
|
+ const user = props.options.user?.find(u => String(u.userId || u.staffId) === String(data.productSupport));
|
|
|
+ drawerForm.value.productSupportName = user ? (user.nickName || user.staffName) : '';
|
|
|
+ }
|
|
|
if (data.fileNo) {
|
|
|
const ossRes = await listByIds(data.fileNo);
|
|
|
drawerForm.value.fileList = (ossRes.data || []).map(i => ({
|
|
|
@@ -395,6 +429,15 @@ const loadData = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const handleProductSupportChange = (val) => {
|
|
|
+ const user = computedProductSupportOptions.value.find(u => String(u.userId || u.staffId) === String(val));
|
|
|
+ if (user) {
|
|
|
+ drawerForm.value.productSupportName = user.nickName || user.staffName;
|
|
|
+ } else {
|
|
|
+ drawerForm.value.productSupportName = undefined;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const handleSubmit = async () => {
|
|
|
if (!drawerFormRef.value) return;
|
|
|
await drawerFormRef.value.validate(async (valid) => {
|