From 13a9015a85303de6e6dd4379f31621b0877672a3 Mon Sep 17 00:00:00 2001 From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com> Date: 星期二, 27 二月 2024 09:08:55 +0800 Subject: [PATCH] qxtj --- src/views/hosp/project/index.vue | 56 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/views/hosp/project/index.vue b/src/views/hosp/project/index.vue index 25fa209..7eed577 100644 --- a/src/views/hosp/project/index.vue +++ b/src/views/hosp/project/index.vue @@ -291,8 +291,9 @@ label-width="100px" :inline="true" > - <el-form-item label="涓婚」鍚嶇О" prop="proParentId"> + <el-form-item label="涓婚」鍚嶇О" prop="proParentId" > <treeselect + :disabled="proParent" v-model="form.proParentId" :options="projectOptions" :normalizer="normalizer" @@ -300,6 +301,7 @@ placeholder="閫夋嫨涓婚」鍚嶇О" style="width: 260px" @select="obtain" + /> </el-form-item> <el-form-item label="鏄庣粏椤圭洰" prop="proName" v-if="key == 'Y'"> @@ -921,6 +923,7 @@ children: "children", label: "label", }, + proParent:false, id: "", // 閲嶆柊娓叉煋琛ㄦ牸鐘舵�� refreshTable: true, @@ -1096,8 +1099,6 @@ }else{ this.form.deptId = null } - - console.log(this.form.deptId) // this.form.proId = this.queryParams.proId; this.form.proCheckMethod = "N"; @@ -1219,7 +1220,6 @@ getDeptList() { listDept(this.queryParams).then((response) => { this.parentNameList = response.data; - console.log(this.parentNameList) this.deptList = this.handleTree(response.data, "proId"); }); }, @@ -1243,7 +1243,7 @@ }, // 鑺傜偣鍗曞嚮浜嬩欢 handleNodeClick(date) { - if (date.children) { + if (date.qf == "0") { this.xiugais = true; } else { this.xiugais = false; @@ -1469,6 +1469,21 @@ handleUpdate1() { this.open = true; this.form = this.xiugaiList; + // console.log( this.form ) + this.proParent = true + // if(){ + // this.proParent = true + // } + getlist().then((response) => { + if (response.code == 200) { + this.loading = false; + this.projectOptions = []; + const project = { proId: 0, proName: "涓荤被鐩�", children: [] }; + project.children = this.handleTree(response.data.list, "proId"); + this.key = response.data.key; + this.projectOptions.push(project); + } + }) }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { @@ -1476,6 +1491,7 @@ this.getData(); // this.form = row; const proId = row.proId || this.ids; + this.proParent =false getProject(proId).then((response) => { this.form = response.data; if (this.form.proParentId === "0") { @@ -1485,7 +1501,7 @@ this.showPrise = false; this.showRentPrise = true; } - this.form.deptId = Number(this.form.deptId); + // this.form.deptId = Number(this.form.deptId); if (this.form.proStandard === 0) { this.showPrise = true; this.showRentPrise = false; @@ -1528,13 +1544,21 @@ } }); } - + getlist().then((response) => { + if (response.code == 200) { + this.loading = false; + this.projectOptions = []; + const project = { proId: 0, proName: "涓荤被鐩�", children: [] }; + project.children = this.handleTree(response.data.list, "proId"); + this.key = response.data.key; + this.projectOptions.push(project); + } + }) this.open = true; this.title = "浣撴椤圭洰淇℃伅缁存姢"; }); }, changeValue(value) { - console.log(value) // this.form.deptName = value; this.form.deptId = value; }, @@ -1605,8 +1629,14 @@ this.form.lisXmbm = this.form.lisXmbm; updateProject(this.form).then((response) => { this.$modal.msgSuccess("淇敼鎴愬姛"); - this.cancel(); + if(this.proParent == true){ + this.getDeptTree(); + this.cancel(); + }else{ + this.cancel(); this.getList(); + } + }); } else { if (this.form.proParentId === 0) { @@ -1669,8 +1699,14 @@ this.form.lisXmbm = this.form.lisXmbm; updateProject(this.form).then((response) => { this.$modal.msgSuccess("淇敼鎴愬姛"); - this.cancel(); + if(this.proParent == true){ + this.getDeptTree(); + this.cancel(); + }else{ + this.cancel(); this.getList(); + } + }); } else { if (this.form.proParentId === 0) { -- Gitblit v1.8.0