From 416b4ef820586a62b136d77fa0ccc185f173b5b9 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期五, 03 一月 2025 21:33:20 +0800 Subject: [PATCH] 1 --- src/views/system/tijian/index.vue | 90 ++++++++++++++++++--------------------------- 1 files changed, 36 insertions(+), 54 deletions(-) diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index da7eba1..7c1f5d9 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -301,7 +301,7 @@ </el-form-item> <el-form-item> <el-button type="primary" icon="el-icon-search" size="mini" @click="handle">鏌ヨ</el-button> - <!-- <el-button type="primary" size="mini" @click="submit">纭</el-button> --> + </el-form-item> </el-form> <div class="tab4"> @@ -322,19 +322,7 @@ </el-table-column> --> </el-table> </div> - <!-- <el-button - style=" - width: 20px; - height: 100px; - margin-top: 20%; - font-size: 10px; - padding-right: 20px; - " - type="primary" - size="mini" - @click="submit" - ><i style="font-size: 18px" class="el-icon-d-arrow-right"></i - ></el-button> --> + </div> </el-tab-pane> <el-tab-pane label="缁勫悎" name="third"> @@ -617,6 +605,12 @@ <el-table-column prop="proCheckMethod" label="鏄惁绌鸿吂"> <template slot-scope="scope"> <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.proCheckMethod" /> + </template> + </el-table-column> + <el-table-column label="鎿嶄綔" align="center" width="80px"> + <template slot-scope="scope"> + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete1(scope.row)" title="鍒犻櫎"> + </el-button> </template> </el-table-column> </el-table> @@ -1084,6 +1078,31 @@ mounted() { }, methods: { + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete1(row) { + console.log(row); + let data = { + cusCardId: row.cusId, + proId: row.parentProId, + }; + this.$modal.confirm('鏄惁纭鍒犻櫎锛�').then(() => { + return delTbBycusCardIdAndProId(data); + }).then(() => { + this.TotalPrice1 = 0 + getTransitionList1(row.cusId).then((response) => { + this.tableData1 = response.data; + this.tableData1.forEach((item) => { + this.TotalPrice1 += item.ordPrice; + this.TotalPrice += item.nowPrice; + }); + this.TotalPrice = this.tableData1.reduce((sum, item) => { + return sum.plus(new Big(item.nowPrice || '0')); + }, new Big(0)); + this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10 + }); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => { }); + }, validateDiscount(row) { if (row.discount > 10) { row.discount = 10; // 寮哄埗灏嗗�艰缃负鏈�澶у�� @@ -1097,7 +1116,7 @@ }, updateProPrice(row) { const ordPrice = new Big(row.ordPrice); - + const discount = new Big(row.discount); const result = ordPrice.times(discount.div(10)); // ordPrice * (discount / 10) row.nowPrice = result.toNumber(); @@ -1105,7 +1124,7 @@ return sum.plus(new Big(item.nowPrice || '0')); }, new Big(0)); - this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1)*100)/100)*10 + this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10 }, @@ -1283,42 +1302,6 @@ this.$refs.historyTj.getlist(); }, - candelete(item) { - let data = { - cusCardId: this.form.cusIdcard, - proId: item.proPrantId, - }; - delTbBycusCardIdAndProId(data).then((res) => { - getTransitionList1(this.form.cusIdcard).then((response) => { - this.tableData1 = response.data; - this.TotalPrice1 = 0; - if (this.tableData1) { - this.tableData1.forEach((item) => { - this.TotalPrice1 += item.ordPrice; - this.TotalPrice += item.nowPrice; - if (item.pacName === null) { - item.pacName = "鍗曢」"; - } - if (item.pacName == "鍗曢」") { - item.list.forEach((item9) => { - this.treeList.push(item9.proId); - }); - } - this.pacName = item.pacName; - }); - - - - this.list1 = false; - this.list3 = true; - } else { - this.list1 = true; - - this.TotalPrice = 0; - } - }); - }); - }, cope() { this.tcShow = true; let cusIdCard = this.form.cusIdcard; @@ -2695,7 +2678,6 @@ } else { this.$message.warning("璇峰厛濉啓淇℃伅锛屽啀閫変綋妫�鍐呭"); } - let _this = this; if (this.tableData.length != 0) { this.tableData.forEach((item) => { @@ -3139,7 +3121,7 @@ message: "璇烽�夋嫨濂楅!", }); } - } else{ + } else { this.$modal.msgError("鏀瑰彉鎶樻墸閿欒"); } }) -- Gitblit v1.8.0