From 0d541fcd7dc65b10dc475792bb7646976259c2aa Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期三, 23 四月 2025 11:09:48 +0800 Subject: [PATCH] qx --- src/views/hosp/project/index.vue | 95 ++++++++++++++++++++++++++++++++--------------- 1 files changed, 65 insertions(+), 30 deletions(-) diff --git a/src/views/hosp/project/index.vue b/src/views/hosp/project/index.vue index 219515f..775a846 100644 --- a/src/views/hosp/project/index.vue +++ b/src/views/hosp/project/index.vue @@ -14,9 +14,19 @@ </div> <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" - highlight-current @node-click="handleNodeClick" :render-content="renderContent" v-loading="loadings" /> + <el-tree + :data="deptOptions" + :props="defaultProps" + :expand-on-click-node="false" + :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> </el-col> @@ -120,6 +130,7 @@ v-loading="loading" :data="projectList" ref="tableRef" + height="580" border > <el-table-column @@ -206,7 +217,13 @@ width="90px" > </el-table-column> - <el-table-column label="Lis椤圭洰鍚嶇О" align="center" prop="lisXmmc" :show-overflow-tooltip="true" width="200px"> + <el-table-column + label="Lis椤圭洰鍚嶇О" + align="center" + prop="lisXmmc" + :show-overflow-tooltip="true" + width="200px" + > </el-table-column> <el-table-column label="Lis缂栫爜" @@ -589,6 +606,12 @@ 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" @@ -964,6 +987,16 @@ children: "dictSfxms", label: "xmmc", }, + dictTypesy: [ + { + value:"0", + label:"鏄�" + }, + { + value:"1", + label:"鍚�" + } + ], xmmc: "", chargeId: [], List: false, @@ -1040,6 +1073,7 @@ proScope: "", proSex: "2", resultType: "", + sfcyyc: "0", }, rules: { createTime: [ @@ -1104,9 +1138,9 @@ created() { this.getConsumables(); this.getDeptList(); - this.getDeptTree().then(() => { - this.precomputePinyin(); - }); + // this.getDeptTree().then(() => { + // this.precomputePinyin(); + // }); }, mounted() { this.getDeptTree().then(() => { @@ -1115,23 +1149,18 @@ }, methods: { debounceFilter: debounce(function (val) { - this.$refs.tree.filter(val); - }, 800), + this.$refs.tree1.filter(val); + }, 300), precomputePinyin() { const traverse = (nodes) => { nodes.forEach((node) => { if (node.label) { - const lowerSpell = cnchar.spell(node.label, 'low', 'array').join(''); // 瀹屾暣灏忓啓鎷奸煶 - const upperSpell = cnchar.spell(node.label, 'up', 'array').join(''); // 瀹屾暣澶у啓鎷奸煶 - const shortPinyin = node.label - .split('') - .map(char => cnchar.spell(char, 'array')[0]?.[0]?.toLowerCase() || char) // 鎷奸煶棣栧瓧姣� - .join(''); + const lowerSpell = node.label.spell("low", "array").join(""); + const upperSpell = node.label.spell("up", "array").join(""); this.pinyinCache.set(node.id, { lowerSpell, upperSpell, - shortPinyin, // 缂撳瓨鎷奸煶绠�鍐� - label: node.label + label: node.label, }); } if (node.children) traverse(node.children); @@ -1142,12 +1171,11 @@ filterNode(value, data) { if (!value) return true; const cached = this.pinyinCache.get(data.id); - if (!cached) return false; // 濡傛灉娌℃湁缂撳瓨鏁版嵁锛屼笉鏄剧ず璇ヨ妭鐐� - const searchLower = value.toLowerCase(); // 灏嗘悳绱㈣瘝杞负灏忓啓 + if (!cached) return false; return ( - cached.label.includes(value) || // 鐩存帴鍖归厤姹夊瓧 - cached.shortPinyin.includes(searchLower) || // 鍖归厤鎷奸煶绠�鍐� - cached.lowerSpell.includes(searchLower) // 鍖归厤瀹屾暣鎷奸煶 + cached.label.includes(value) || + cached.lowerSpell.includes(value) || + cached.upperSpell.includes(value) ); }, filterNode2(value, data) { @@ -1265,8 +1293,8 @@ this.open = true; } else if (this.treeDate.id) { if (this.treeDate.qf == "0") { - this.form.proParentId = "0" - this.form.deptId = this.treeDate.id + this.form.proParentId = "0"; + this.form.deptId = this.treeDate.id; } else { this.form.proParentId = this.treeDate.id; this.projectOptions.forEach((item) => { @@ -1278,10 +1306,9 @@ }); } - this.open = true; } else { - this.form.proParentId = "0" + this.form.proParentId = "0"; this.open = true; } } @@ -1401,13 +1428,18 @@ getDeptTree() { return deptTree111().then((response) => { this.deptOptions = response.data; - this.treeId.push(this.treeDate.id); + this.treeId = [] + if(this.treeDate.id){ + this.treeId.push( this.treeDate.id) + }else{ + this.treeId.push("532") + } + }); }, handleNodeClick(date) { this.treeDate = date; - this.treeId = [] - console.log(this.treeId,2222); + this.xiugaiList ={} this.xiugais = date.qf === "0"; let proId = date.id; getInfoByProId(proId).then((response) => { @@ -1562,8 +1594,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) => { @@ -1589,6 +1623,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) { @@ -1741,7 +1776,7 @@ this.getList(); this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }) - .catch(() => { }); + .catch(() => {}); }, handleExport() { this.download( -- Gitblit v1.8.0