From 9ca1d8a5c10cf277d02445845bd62510bebf6989 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 20 二月 2025 18:00:09 +0800
Subject: [PATCH] 项目增加项目子类型字段回显bug
---
src/views/projectEngineering/projectLibrary/component/BasicInfo.vue | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
index f4b3578..488b476 100644
--- a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
+++ b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
@@ -430,7 +430,8 @@
import {addProject, getProject, updateProject, getProjectCode, editProject} from '@/api/projectEngineering/projectInfo';
import {approvalList} from "@/api/system/dept";
import {getByDept} from "@/api/system/user";
-import {getChildList} from "@/api/system/dict/data";
+import {getChildList, getDicts} from "@/api/system/dict/data";
+import log from "@/views/monitor/job/log";
export default {
name: 'BasicInfo',
@@ -555,8 +556,13 @@
}
if (this.projectForm.projectType) {
// 鏍规嵁椤圭洰绫诲瀷鏌ュ瓙绫诲瀷
- getChildList(this.dict.type.sys_project_type.filter(item => item.raw.dictValue === this.projectForm.projectType)[0].raw.dictCode).then(res => {
- this.projectSubTypeList = res.data
+ getDicts("sys_project_type").then(res => {
+ const projectType = res.data.find(item => item.dictValue === this.projectForm.projectType);
+ if (projectType) {
+ getChildList(projectType.dictCode).then(res => {
+ this.projectSubTypeList = res.data
+ })
+ }
})
}
this.$emit('updateIsShow', true);
@@ -657,8 +663,13 @@
}
if (this.projectForm.projectType) {
// 鏍规嵁椤圭洰绫诲瀷鏌ュ瓙绫诲瀷
- getChildList(this.dict.type.sys_project_type.filter(item => item.raw.dictValue === this.projectForm.projectType)[0].raw.dictCode).then(res => {
- this.projectSubTypeList = res.data
+ getDicts("sys_project_type").then(res => {
+ const projectType = res.data.find(item => item.dictValue === this.projectForm.projectType);
+ if (projectType) {
+ getChildList(projectType.dictCode).then(res => {
+ this.projectSubTypeList = res.data
+ })
+ }
})
}
this.$emit('updateIsShow', true);
--
Gitblit v1.8.0