From a84a399991afc41e97fecdabf35deffa75668761 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期三, 22 一月 2025 16:14:10 +0800 Subject: [PATCH] 111 --- src/views/system/tijian/index.vue | 63 ++++++++++++++++++------------- 1 files changed, 37 insertions(+), 26 deletions(-) diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index bbea675..54d29ea 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -351,6 +351,8 @@ </el-table-column> <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px"> </el-table-column> + <el-table-column prop="sl" label="鏁伴噺" width="56px"> + </el-table-column> <el-table-column prop="proPrice" label="鍘熶环" width="56px"> </el-table-column> @@ -477,7 +479,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 +507,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 +1076,7 @@ }; }, watch: { + filterText(val) { this.$refs.tree.filter(val); }, @@ -1647,6 +1650,10 @@ }); }, numberChangeXianPrice(currentValue, oldValue) { + // 濡傛灉鐜颁环娌℃湁鍙樺寲锛岀洿鎺ヨ繑鍥� + if (this.TotalPrice === this.lastXianPrice || !this.TotalPrice) { + return; + } this.$confirm("纭畾淇敼鎵�鏈夊瓙椤圭殑鎶樻墸鍚楋紵", "鎻愮ず", { confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", @@ -1685,6 +1692,7 @@ ); } } + this.lastXianPrice = this.TotalPrice; }) .catch(() => { this.discount = oldValue; @@ -1831,7 +1839,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 +1890,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 +2290,7 @@ this.DataList = []; // 娓呯┖宸查�夐」鐩垪琛� this.checkedkey = []; // 娓呯┖鏍戠殑閫変腑鐘舵�� this.checkedListkey = []; - this.TreedataList = []; - this.$refs.tree.setCheckedKeys([]); // 閲嶇疆鏍戦�変腑鐘舵�� + this.TreedataList = [] let data = { cusId, @@ -2509,7 +2516,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) => { @@ -2550,7 +2556,7 @@ if (this.DataLists.length >= 1) { this.marryalls = 0; this.DataLists.forEach((item1) => { - this.marryalls += item1.proPrice; + this.marryalls += item1.proPrice * item1.sl; this.packagedataList.forEach((item3) => { if (item1.proParentId == item3.proId) { @@ -2624,32 +2630,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 +2814,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 +3177,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 +3211,7 @@ }; this.listgetOrder(data); } else { + this.loadingSubmit = false; this.$message({ type: "warning ", message: "璇烽�夋嫨濂楅!", -- Gitblit v1.8.0