Procházet zdrojové kódy

联络员 姓名 部门 联动

Luka před 1 měsícem
rodič
revize
a01bd03986

+ 14 - 24
src/views/notificationInfoManage/addressBook/components/detail.vue

@@ -97,15 +97,10 @@
 									<!-- 联络人姓名  -->
 									<template v-if="item.type === 'contactName'">
 										<el-select
-											:disabled="item.disabled"
+											:readonly="contactNameDisabled"
 											v-model="formData[item.prop]"
 											filterable
-											remote
-											reserve-keyword
 											:placeholder="item.placeholder"
-											:remote-method="remoteuserNameMethod"
-											:loading="userLoading"
-											remote-show-suffix
 											style="width: 100%"
 										>
 											<el-option
@@ -153,7 +148,7 @@ import { reactive, ref } from 'vue';
 import type { FormInstance } from 'element-plus';
 import useSystemStore from '@/store/main';
 import { outTypeList, outDeptTree } from '@/libs/commonMeth';
-import { TreeOptions } from '@/types/global';
+import { TreeOptions, IOptions } from '@/types/global';
 const bj_msg_recipient = outTypeList('bj_msg_recipient'); //短信接收人
 import dayjs from 'dayjs';
 // 定义props
@@ -183,24 +178,18 @@ const systemStore = useSystemStore();
 
 const { pageDetailInfo, pageOperateType } = storeToRefs(systemStore);
 
-interface userNameListItem {
-	value: string;
-	label: string;
-}
-const alluserNameOptions = ref<userNameListItem[]>([]);
-const userLoading = ref(false);
-const userNameOptions = ref<userNameListItem[]>([]);
-const remoteuserNameMethod = (query: string) => {
+const contactNameDisabled = ref(true);
+const userNameOptions = ref<IOptions[]>([]);
+const queryUserNameOptions = (query: string) => {
+	userNameOptions.value = [];
 	if (query) {
-		userLoading.value = true;
-		setTimeout(() => {
-			userLoading.value = false;
-			userNameOptions.value = alluserNameOptions.value.filter(item => {
-				return item.label.toLowerCase().includes(query.toLowerCase());
-			});
-		}, 200);
-	} else {
-		userNameOptions.value = alluserNameOptions.value;
+		// const postData: any = await changeInventoryStatus(row.liaisonId, status);
+		// if (postData.code === 200) {
+		// 	userNameOptions.value = postData.data;
+		// } else {
+		// 	userNameOptions.value = [];
+		// }
+		contactNameDisabled.value = false;
 	}
 };
 
@@ -305,6 +294,7 @@ watch(
 	() => formData.value,
 	(newVal, oldVal) => {
 		if (newVal?.unitName !== oldVal?.unitName) {
+			queryUserNameOptions(newVal.unitName);
 			console.log('unitName:', newVal.unitName, oldVal?.unitName);
 		}
 		if (newVal?.contactName !== oldVal?.contactName) {

+ 1 - 1
src/views/notificationInfoManage/addressBook/config/detail.config.ts

@@ -116,7 +116,7 @@ const modalConfig = {
 		{
 			label: '联络人姓名',
 			prop: 'contactName',
-			type: 'input',
+			type: 'contactName',
 			placeholder: '请输入联络人姓名',
 		},
 		{

+ 1 - 1
src/views/notificationInfoManage/addressBook/config/detail.nonIndustry.config.ts

@@ -115,7 +115,7 @@ const modalConfig = {
 		{
 			label: '联络人姓名',
 			prop: 'contactName',
-			type: 'input',
+			type: 'contactName',
 			placeholder: '请输入联络人姓名',
 		},
 		{