|
|
@@ -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) => {
|