Kaynağa Gözat

联络人 关键信息联动

Luka 1 ay önce
ebeveyn
işleme
89914569b2

+ 37 - 5
src/views/notificationInfoManage/contactsmanage/components/detail.vue

@@ -84,7 +84,7 @@
 									<!-- 单位名称 -->
 									<template v-if="item.type === 'unitName'">
 										<el-tree-select
-											v-model="formData[item.prop]"
+											v-model="formData.unitName"
 											:data="unitOptions"
 											:disabled="dialogLook || item.disabled"
 											node-key="id"
@@ -98,11 +98,12 @@
 									<!-- 联络人姓名  -->
 									<template v-if="item.type === 'contactName'">
 										<el-select
-											:readonly="contactNameDisabled"
 											v-model="formData[item.prop]"
 											filterable
+											ref="userSelectRef"
 											:disabled="dialogLook || item.disabled"
 											:placeholder="item.placeholder"
+											@focus="checkUnitSelected"
 											style="width: 100%"
 										>
 											<el-option
@@ -117,8 +118,29 @@
 									<!-- 所属部门 -->
 									<template v-if="item.type === 'belongsDept'">
 										<el-input
-											:disabled="dialogLook || item.disabled"
+											:disabled="item.disabled"
+											v-model="formData[item.prop]"
+											@focus="checkContactNameSelected"
+											:placeholder="item.placeholder"
+										/>
+									</template>
+
+									<!-- 所属职位 -->
+									<template v-if="item.type === 'position'">
+										<el-input
+											:disabled="item.disabled"
+											v-model="formData[item.prop]"
+											@focus="checkContactNameSelected"
+											:placeholder="item.placeholder"
+										/>
+									</template>
+
+									<!-- 联系电话 -->
+									<template v-if="item.type === 'contactNumber'">
+										<el-input
+											:disabled="item.disabled"
 											v-model="formData[item.prop]"
+											@focus="checkContactNameSelected"
 											:placeholder="item.placeholder"
 										/>
 									</template>
@@ -180,7 +202,6 @@ const systemStore = useSystemStore();
 
 const { pageDetailInfo, pageOperateType } = storeToRefs(systemStore);
 
-const contactNameDisabled = ref(true);
 const userNameOptions = ref<IOptions[]>([]);
 const queryUserNameOptions = (query: string) => {
 	userNameOptions.value = [];
@@ -191,7 +212,6 @@ const queryUserNameOptions = (query: string) => {
 		// } else {
 		// 	userNameOptions.value = [];
 		// }
-		contactNameDisabled.value = false;
 	}
 };
 
@@ -292,6 +312,18 @@ function onPageDetail(urlId: number | [] | string) {
 	systemStore.detailPageDataAction(props.modalConfig.pageName, urlId);
 }
 
+function checkUnitSelected() {
+	if (!formData.value.unitName) {
+		ElMessage.warning('请先选择单位名称!');
+	}
+}
+
+function checkContactNameSelected() {
+	if (!formData.value.contactName) {
+		ElMessage.warning('请先选择联络人员!');
+	}
+}
+
 watch(
 	() => formData.value,
 	(newVal, oldVal) => {

+ 2 - 5
src/views/notificationInfoManage/contactsmanage/config/detail.config.ts

@@ -123,14 +123,12 @@ const modalConfig = {
 			label: '所属部门',
 			prop: 'belongsDept',
 			type: 'belongsDept',
-			disabled: true,
 			placeholder: '请输入所属部门',
 		},
 		{
 			label: '所属职务',
 			prop: 'position',
-			type: 'input',
-			disabled: true,
+			type: 'position',
 			placeholder: '请输入所属职务',
 		},
 		{
@@ -142,8 +140,7 @@ const modalConfig = {
 		{
 			label: '联系电话',
 			prop: 'contactNumber',
-			disabled: true,
-			type: 'input',
+			type: 'contactNumber',
 			placeholder: '请输入联系电话',
 		},
 		{

+ 2 - 5
src/views/notificationInfoManage/contactsmanage/config/detail.nonIndustry.config.ts

@@ -122,14 +122,12 @@ const modalConfig = {
 			label: '所属部门',
 			prop: 'belongsDept',
 			type: 'belongsDept',
-			disabled: true,
 			placeholder: '请输入所属部门',
 		},
 		{
 			label: '所属职务',
 			prop: 'position',
-			type: 'input',
-			disabled: true,
+			type: 'position',
 			placeholder: '请输入所属职务',
 		},
 		{
@@ -141,8 +139,7 @@ const modalConfig = {
 		{
 			label: '联系电话',
 			prop: 'contactNumber',
-			disabled: true,
-			type: 'input',
+			type: 'contactNumber',
 			placeholder: '请输入联系电话',
 		},
 		{