From 067c77dee145023f983eea591dfaf3be8ffc1ab9 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期三, 22 一月 2025 15:15:31 +0800 Subject: [PATCH] 1 --- src/views/system/tijian/index.vue | 59 ++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index bbea675..7e99913 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -477,7 +477,7 @@ <el-form-item label="浣撴绫诲瀷"> <el-select v-model="form.tjType" placeholder="璇烽�夋嫨浣撴绫诲瀷"> <el-option v-for="dict in dict.type.dict_team" :key="dict.value" :label="dict.label" - :value="dict.value" :disabled="!form.firmId && dict.value === '1'"></el-option> + :value="dict.value"></el-option> </el-select> </el-form-item> <el-form-item label="浣撴绫诲埆"> @@ -505,8 +505,8 @@ <el-form-item style="margin-left: 149px"> <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">閫夋嫨濂楅</el-button> <el-button type="primary" @click="resetpackage" size="mini" style="margin-right: 20px">閲嶇疆濂楅</el-button> - <el-button type="primary" @click="submitPrice" :loading="loadingSubmit" - :disabled="confirm || loadingSubmit" v-if="showHidden.has_charge == 'N'" size="mini">绛惧埌鐧昏</el-button> + <el-button type="primary" @click="submitPrice" :loading="loadingSubmit" :disabled="loadingSubmit" + v-if="showHidden.has_charge == 'N'" size="mini">绛惧埌鐧昏</el-button> <el-button type="primary" @click="submitCheckinfee" :disabled="confirm" v-if="showHidden.has_charge == 'Y'" size="mini">鐧昏鏀惰垂</el-button> </el-form-item> @@ -1074,6 +1074,7 @@ }; }, watch: { + filterText(val) { this.$refs.tree.filter(val); }, @@ -1647,6 +1648,10 @@ }); }, numberChangeXianPrice(currentValue, oldValue) { + // 濡傛灉鐜颁环娌℃湁鍙樺寲锛岀洿鎺ヨ繑鍥� + if (this.TotalPrice === this.lastXianPrice || !this.TotalPrice) { + return; + } this.$confirm("纭畾淇敼鎵�鏈夊瓙椤圭殑鎶樻墸鍚楋紵", "鎻愮ず", { confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", @@ -1685,6 +1690,7 @@ ); } } + this.lastXianPrice = this.TotalPrice; }) .catch(() => { this.discount = oldValue; @@ -1831,7 +1837,7 @@ }); } else { let configKey = "getInfoFromSqlData"; - getconfigKey(configKey).then((res) => { + getconfigKey(configKey).then((res) => { if (res.code == 200) { if (res.msg == "N") { var websocket = null; @@ -1882,7 +1888,7 @@ /* this.$refs.aaa.open = true; this.$refs.aaa.getAllList(); this.$refs.aaa.title = "璇佷欢瀛楀吀"; */ - + } else if (res.msg == "S") { this.cardreader = true; _this.cardreaderradio = 3; @@ -2282,8 +2288,7 @@ this.DataList = []; // 娓呯┖宸查�夐」鐩垪琛� this.checkedkey = []; // 娓呯┖鏍戠殑閫変腑鐘舵�� this.checkedListkey = []; - this.TreedataList = []; - this.$refs.tree.setCheckedKeys([]); // 閲嶇疆鏍戦�変腑鐘舵�� + this.TreedataList = [] let data = { cusId, @@ -2509,7 +2514,6 @@ this.loading = true; getProParentIdDxList().then((response) => { this.Treedata = response.data.list; - if (this.tableData[0]) { this.tableData[0].tjProjectList.forEach((selectionitem) => { this.Treedata.forEach((item) => { @@ -2624,32 +2628,36 @@ }); } }, - // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐� handleCurrentChecked(data, checked, checkedNodes) { this.dataObj = data; - if (checked.checkedNodes.length != 0) { - this.$refs.tree.setCheckedKeys([data.proId]); + if (checked.checkedNodes.length > 0) { + const promises = checked.checkedNodes.map(node => getProSonDxList(node.proId)); + Promise.all(promises).then(results => { + this.TreedataList = results.flatMap(res => res.data.list); + this.checkedListkey = []; + this.DataList = []; - let proId = data.proId; - getProSonDxList(proId).then((res) => { - this.TreedataList = res.data.list; this.TreedataList.forEach((item) => { this.checkedListkey.push(item.proId); - this.DataList.push(item); - this.spliceData(); - this.DataList.forEach((item1) => { - if (item1.proParentId == data.proId) { - item1.propinName = data.proName; - } - }); }); + + this.spliceData(); // 鍋囪杩欎釜鏂规硶鏄綘瀹氫箟鐨勫叾浠栧湴鏂瑰鐞嗘暟鎹殑 + + // 鏇存柊鍚嶇О鍜岃绠楁�讳环 + this.DataList.forEach((item1) => { + const parent = checked.checkedNodes.find(node => node.proId === item1.proParentId); + if (parent) { + item1.propinName = parent.proName; + } + }); + this.TotalPrice1 = 0; this.marryall = 0; if (this.DataList.length != 0) { this.list1 = false; this.DataList.forEach((item) => { - this.marryall = item.proPrice * item.sl; + this.marryall += Number(item.proPrice) * Number(item.sl); }); } }); @@ -2804,9 +2812,8 @@ pacId: _this.pacId, proIds: this.proIds, }; - // 鏍规嵁浣撴绫诲瀷閫夋嫨涓嶅悓鐨勫鐞嗘柟娉� - if (this.form.tjType == 1) { + if (this.form.firmId) { tuantiqueren(data).then((response) => { if (response.code == 200) { this.processOrderItems(cusId); @@ -3168,8 +3175,9 @@ cusIdCard: item.cusId, })); // 鍒涘缓鏂扮殑瀵硅薄锛屽寘鍚� discount 鍜� id gaibianzhekou(newArray).then((res) => { + this.loadingSubmit = false; if (res.code === 200) { - this.loadingSubmit = false; + let data; if (pacId || this.tjOrderList.length > 0) { @@ -3201,6 +3209,7 @@ }; this.listgetOrder(data); } else { + this.loadingSubmit = false; this.$message({ type: "warning ", message: "璇烽�夋嫨濂楅!", -- Gitblit v1.8.0