src/views/hosp/project/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/system/package/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
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.proParent = true; this.isPriceDisabled = true; // 先加载科室列表数据,再设置表单数据 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(); this.form.proDelivery = this.form.proDelivery.toString(); this.proParent = true; this.isPriceDisabled = true; getlist().then((response) => { if (response.code == 200) { // 处理项目选项 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; }).catch((error) => { console.error("加载数据失败:", error); this.$message.error("加载数据失败"); }) }, handleUpdate(row) { this.reset(); @@ -1691,6 +1707,8 @@ const proId = row.proId || this.ids; this.proParent = false; this.isPriceDisabled = false; listDept(this.queryParams).then((response) => { this.parentNameList = response.data; getProject(proId).then((response) => { this.form = response.data; this.showPrise = this.form.proParentId === "0"; @@ -1733,6 +1751,8 @@ this.open = true; this.title = "体检项目信息维护"; }); }) }, getSelectValue(val) { this.form.consumablesList.forEach((formitem) => { 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; });