From 37e09a8edf9afb70342b68352329ce959f8ebda6 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期三, 23 四月 2025 11:11:10 +0800 Subject: [PATCH] qx --- src/views/hosp/project/index.vue | 41 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/views/hosp/project/index.vue b/src/views/hosp/project/index.vue index 0ee06f4..0ae2020 100644 --- a/src/views/hosp/project/index.vue +++ b/src/views/hosp/project/index.vue @@ -9,7 +9,7 @@ <div class="scrollable-container"> <div class="content"> <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" - :filter-node-method="filterNode" ref="tree" node-key="id" :default-expanded-keys="treeId" + :filter-node-method="filterNode" ref="tree1" node-key="id" :default-expanded-keys="treeId" highlight-current @node-click="handleNodeClick" :render-content="renderContent" v-loading="loadings" /> </div> </div> @@ -229,6 +229,12 @@ <el-form-item label="鎺掑簭" prop="xh"> <el-input v-model="form.xh" placeholder="璇疯緭鍏ユ帓搴�" style="width: 200px" /> </el-form-item> + <el-form-item label="鏄惁鍙備笌寮傚父" prop="sfcyyc"> + <el-select v-model="form.sfcyyc" placeholder="璇烽�夋嫨鏄惁鍙備笌寮傚父" style="width: 260px"> + <el-option v-for="dict in dictTypesy" :key="dict.value" :label="dict.label" + :value="dict.value"></el-option> + </el-select> + </el-form-item> </el-form> <el-button style="margin-left: 40px" type="primary" plain size="mini" icon="el-icon-plus" @click="addmembers">鏂板琛�</el-button> @@ -441,6 +447,16 @@ }, xmmc: "", chargeId: [], + dictTypesy: [ + { + value:"0", + label:"鏄�" + }, + { + value:"1", + label:"鍚�" + } + ], List: false, deptName: "", deptOption: [], @@ -515,6 +531,7 @@ proScope: "", proSex: "2", resultType: "", + sfcyyc: "0", }, rules: { createTime: [ @@ -549,7 +566,7 @@ const lastId = newVal[newVal.length - 1] || "532"; const node = this.findNodeById(this.deptOptions, lastId); if (node) { - this.$refs.tree.setCurrentKey(lastId); + this.$refs.tree1.setCurrentKey(lastId); const nodeElement = document.querySelector(`.el-tree-node[data-key="${lastId}"] .el-tree-node__content`); if (nodeElement) { nodeElement.click(); @@ -587,7 +604,7 @@ }, methods: { debounceFilter: debounce(function (val) { - this.$refs.tree.filter(val); + this.$refs.tree1.filter(val); }, 300), precomputePinyin() { const traverse = (nodes) => { @@ -836,7 +853,7 @@ handleNodeClick(date) { this.treeDate = date; - console.log(this.treeDate) + this.xiugaiList ={} this.xiugais = date.qf === "0"; let proId = date.id; getInfoByProId(proId).then((response) => { @@ -871,6 +888,11 @@ let data = { proId: this.queryParams.proId }; getAllChildListById(data).then(() => { this.loading = false; + }); + this.deptName = ""; + // 鎵嬪姩璋冪敤杩囨护鏂规硶锛堥渶绛夊緟 DOM 鏇存柊锛� + this.$nextTick(() => { + this.$refs.tree1.filter(this.deptName); }); }, handleClose() { @@ -910,7 +932,7 @@ resetQuery() { this.resetForm("queryForm"); this.queryParams.proId = undefined; - this.$refs.tree.setCurrentKey(null); + this.$refs.tree1.setCurrentKey(null); this.handleQuery(); }, flexColumnWidth(column) { @@ -981,8 +1003,10 @@ } }, handleUpdate1() { + this.form ={} this.form = this.xiugaiList; this.form.proStatus = this.form.proStatus.toString(); + this.form.sfcyyc = this.form.sfcyyc.toString(); this.proParent = true; this.isPriceDisabled = true; getlist().then((response) => { @@ -993,6 +1017,7 @@ project.children = this.handleTree(response.data.list, "proId"); this.key = response.data.key; this.projectOptions.push(project); + console.log( this.projectOptions,11111) } }); this.open = true; @@ -1008,6 +1033,7 @@ this.showPrise = this.form.proParentId === "0"; this.showRentPrise = !this.showPrise; this.form.proStatus = this.form.proStatus.toString(); + this.form.sfcyyc = this.form.sfcyyc.toString(); this.form.consumablesList = response.data.consumablesList; this.form.tjStandardList = response.data.tjStandardList; if (this.form.tjStandardList) { @@ -1067,6 +1093,11 @@ } } }); + this.deptName = ""; + // 鎵嬪姩璋冪敤杩囨护鏂规硶锛堥渶绛夊緟 DOM 鏇存柊锛� + this.$nextTick(() => { + this.$refs.tree1.filter(this.deptName); + }); }, processSubmission(isUpdate, isY) { if (isUpdate) { -- Gitblit v1.8.0