From 33de1cf5576373b99dc2a6ed4be097f4d6ad0892 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期三, 30 七月 2025 10:58:03 +0800 Subject: [PATCH] 1111 --- src/views/system/package/index.vue | 41 ++++++++++++++++++-- src/views/hosp/project/index.vue | 44 ++++++++++++++++------ 2 files changed, 69 insertions(+), 16 deletions(-) diff --git a/src/views/hosp/project/index.vue b/src/views/hosp/project/index.vue index cb569f3..3cc1e32 100644 --- a/src/views/hosp/project/index.vue +++ b/src/views/hosp/project/index.vue @@ -1666,24 +1666,40 @@ }, handleUpdate1() { this.form = {}; - this.form = this.xiugaiList; - this.form.proStatus = this.form.proStatus.toString(); - this.form.sfcyyc = this.form.sfcyyc.toString(); - this.form.proDelivery = this.form.proDelivery.toString(); + // this.form = this.xiugaiList; + // this.form.proStatus = this.form.proStatus.toString(); + // this.form.sfcyyc = this.form.sfcyyc.toString(); + // this.form.proDelivery = this.form.proDelivery.toString(); this.proParent = true; this.isPriceDisabled = true; - getlist().then((response) => { - if (response.code == 200) { + // 鍏堝姞杞界瀹ゅ垪琛ㄦ暟鎹紝鍐嶈缃〃鍗曟暟鎹� + Promise.all([ + listDept(this.queryParams), + getlist() + ]).then(([deptResponse, listResponse]) => { + // 鍏堣缃瀹ゅ垪琛� + this.parentNameList = deptResponse.data; + + // 鍐嶈缃〃鍗曟暟鎹� + this.form = this.xiugaiList; + this.form.proStatus = this.form.proStatus.toString(); + this.form.sfcyyc = this.form.sfcyyc.toString(); + + // 澶勭悊椤圭洰閫夐」 + if (listResponse.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; + project.children = this.handleTree(listResponse.data.list, "proId"); + this.key = listResponse.data.key; this.projectOptions.push(project); - console.log(this.projectOptions, 11111); } - }); - this.open = true; + + this.open = true; + }).catch((error) => { + console.error("鍔犺浇鏁版嵁澶辫触:", error); + this.$message.error("鍔犺浇鏁版嵁澶辫触"); + }) }, handleUpdate(row) { this.reset(); @@ -1691,7 +1707,9 @@ const proId = row.proId || this.ids; this.proParent = false; this.isPriceDisabled = false; - getProject(proId).then((response) => { + listDept(this.queryParams).then((response) => { + this.parentNameList = response.data; + getProject(proId).then((response) => { this.form = response.data; this.showPrise = this.form.proParentId === "0"; this.showRentPrise = !this.showPrise; @@ -1733,6 +1751,8 @@ this.open = true; this.title = "浣撴椤圭洰淇℃伅缁存姢"; }); + }) + }, getSelectValue(val) { this.form.consumablesList.forEach((formitem) => { diff --git a/src/views/system/package/index.vue b/src/views/system/package/index.vue index 197f8ae..6bad63d 100644 --- a/src/views/system/package/index.vue +++ b/src/views/system/package/index.vue @@ -162,6 +162,7 @@ node-key="proId" @check-change="handleCurrentChecked" :default-checked-keys="checkedkey" + :filter-node-method="filterNode" ref="tree" :render-content="renderContent" > @@ -295,6 +296,7 @@ page: 1, pageSize: 30, nr: "", + xb: "", }, form: { xianprice: null, @@ -333,6 +335,15 @@ } const filterTextLower = this.filterText.toLowerCase(); this.filteredTreeData = this.filterNodes(this.originalTreeData, filterTextLower); + }, + filterNode(value, data) { + if (!value) return true; + console.log(value, 6666); + + return ( + data.proName.indexOf(value) !== -1 || + (data.proEngName && data.proEngName.indexOf(value) !== -1) + ); }, filterNodes(nodes, filterText) { return nodes.filter(node => { @@ -418,9 +429,30 @@ this.keywordList = response.rows; }); }, - sel(val) { + /* sel(val) { let id = val; this.keys = id.join(","); + }, */ + sel(val) { + const maleId = "4"; // 鈥滅敺鈥濈殑 ID + const femaleId = "5"; // 鈥滃コ鈥濈殑 ID + let selectedIds = [...val]; // 澶嶅埗褰撳墠閫変腑鐨� ID 鏁扮粍 + + // 瀹炵幇鈥滅敺鈥濆拰鈥滃コ鈥濅簰鏂ラ�昏緫 + if (selectedIds.includes(maleId) && selectedIds.includes(femaleId)) { + selectedIds = selectedIds.slice(-1); // 淇濈暀鏈�鍚庨�変腑鐨勪竴涓� + this.$message.warning("鈥滅敺鈥濆拰鈥滃コ鈥濆叧閿瓧浜掓枼锛屽彧鑳介�夋嫨涓�涓紒"); + } + + // 鏇存柊 form.keywords 鍜� keys + this.form.keywords = selectedIds; + this.keys = selectedIds.join(","); + + // 璋冪敤 getDataList锛屼紶閫掓墍鏈夐�変腑鐨勫叧閿瓧 ID锛堥�楀彿鍒嗛殧锛� + // this.getDataList({ xb: this.keys }); + this.queryParams1.xb = this.keys; // 馃憟 鏇存柊鏌ヨ鍙傛暟 + this.queryParams1.page = 1; // 馃憟 鍒囨崲鏉′欢鏃堕噸缃〉鐮� + this.getDataList(); // 涓嶉渶瑕佸啀浼犲弬浜� }, getCategory() { this.loading = true; @@ -666,9 +698,10 @@ </span> ); }, - getDataList() { + getDataList(params = {}) { this.loading = true; - search(this.queryParams1).then((response) => { + const query = { ...this.queryParams1, ...params }; + search(query).then((response) => { this.Treedata = response.data.list; this.total1 = response.data.total; this.pics = this.DataList.reduce((total, item) => total + item.priceOrd, 0); @@ -677,8 +710,8 @@ this.$nextTick(() => { this.$refs.tree.setCheckedKeys(this.checkedNodes); this.initializing = false; - this.loading = false; }); + this.loading = false; }).catch(() => { this.loading = false; }); -- Gitblit v1.8.0