| | |
| | | </el-table-column> |
| | | <el-table-column prop="proPrice" label="原价" width="56px"> |
| | | </el-table-column> |
| | | <el-table-column label="折扣"> |
| | | <el-table-column label="折扣" width="150px"> |
| | | <template slot-scope="scope"> |
| | | <!-- @input="validateDiscount(scope.row)" --> |
| | | <el-input-number v-model.number="scope.row.discount" @change="handleManualChange(scope.row)" |
| | |
| | | }, |
| | | |
| | | |
| | | updateProPrice(row) { |
| | | console.log(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(); |
| | | 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; |
| | | }, |
| | | |
| | | |
| | | debounceNumberChange(currentValue, oldValue) { |
| | | clearTimeout(this.debounceTimer); |
| | | this.debounceTimer = setTimeout(() => { |
| | |
| | | // this.TotalPrice = this.DataList3.reduce((sum, item) => { |
| | | // return sum.plus(new Big(item.nowPrice || "0")); |
| | | // }, new Big(0)); |
| | | this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)) |
| | | this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)).toFixed(2) |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | |
| | | numberChangeXianPrice(currentValue, oldValue) { |
| | | // 如果现价没有变化,直接返回 |
| | | if (this.TotalPrice === this.lastXianPrice || !this.TotalPrice) { |
| | | console.log(2222333) |
| | | return; |
| | | } |
| | | this.$confirm("确定修改所有子项的折扣吗?", "提示", { |
| | |
| | | // this.discount = this.getInfodis; |
| | | // } |
| | | let totalYsprice = new Big(0); |
| | | console.log(this.tableData3, 11111) |
| | | this.tableData3.forEach((item) => { |
| | | console.log(this.DataList3, 11111) |
| | | this.DataList3.forEach((item) => { |
| | | item.discount = this.discount; |
| | | const ordPrice = new Big(item.proPrice); |
| | | const discount = new Big(item.discount); |
| | |
| | | // }, |
| | | |
| | | updateProPrice(row) { |
| | | console.log(row, 55555) |
| | | if (row.proPrice == 0) { |
| | | row.discount = 10 |
| | | return |
| | | } else { |
| | | const ordPrice = new Big(row.proPrice); |
| | | const discount = new Big(row.discount); |
| | | const result = ordPrice.times(discount.div(10)); // ordPrice * (discount / 10) |
| | |
| | | }, new Big(0)); |
| | | this.discount = |
| | | (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10; |
| | | } |
| | | }, |
| | | |
| | | handleRevoke() { |
| | |
| | | this.DataList = []; |
| | | this.DataList3 = []; |
| | | this.Datalists = []; |
| | | this.filterText = "", |
| | | this.filterage = "", |
| | | this.TotalPrice = 0; |
| | | this.discount = 10; |
| | | this.filterText = ""; |
| | | this.filterage = ""; |
| | | this.TotalPrice1 = 0; |
| | | this.orderId = this.ids; |
| | | this.cusId = this.cusIds; |
| | |
| | | this.TotalPrice1 = 0; |
| | | this.DataList3.forEach((item) => { |
| | | this.TotalPrice1 += item.proPrice * item.sl; |
| | | this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)) |
| | | this.TotalPrice = this.TotalPrice1 * (this.discount / 10) |
| | | this.lastXianPrice = this.TotalPrice; |
| | | }); |
| | | }); |
| | |
| | | this.spliceData(); |
| | | this.TotalPrice1 = 0; |
| | | this.DataList.forEach((item1) => { |
| | | console.log(item1.proPrice, 3322); |
| | | console.log(this.TotalPrice1, 1122); |
| | | |
| | | this.TotalPrice1 = item1.proPrice + this.TotalPrice1; |
| | | }); |
| | | if (this.marryalls != 0) { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | this.DataList3.forEach((item, index) => { |
| | | if (item.proId == row.proId) { |
| | | let proParentId = item.proParentId |
| | | // 获取当前选中的节点key |
| | | const currentCheckedKeys = this.$refs.tree.getCheckedKeys(); |
| | | |
| | | // 创建一个新数组,移除想要取消选中的节点key(这里假设是1) |
| | | const newCheckedKeys = currentCheckedKeys.filter(key => key !== proParentId); |
| | | |
| | | // 使用setCheckedKeys方法更新选中状态 |
| | | this.$refs.tree.setCheckedKeys(newCheckedKeys); |
| | | this.DataList3.splice(index, 1); |
| | | this.marryalls = 0; |
| | | this.DataList3.forEach((item1) => { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | if (this.DataList3.length == 0) { |
| | | this.discount = 10 |
| | | this.checkedkey = [] |
| | | this.$refs.tree.setCheckedKeys([]) |
| | | this.TotalPrice1 = this.marryalls; |
| | | this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)) |
| | | } else if (this.DataList3.length == 1) { |
| | | this.discount = this.DataList3[0].discount |
| | | this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)).toFixed(2) |
| | | } |
| | | this.DataList.forEach((item, index) => { |
| | | if (item.proId == row.proId) { |
| | | this.DataList.splice(index, 1); |
| | | this.TotalPrice1 = 0; |
| | | this.TotalPrice = 0; |
| | | this.DataList.forEach((item1) => { |
| | | this.TotalPrice1 = item1.proPrice + this.TotalPrice1; |
| | | this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)) |
| | | }); |
| | | if (this.marryalls != 0) { |
| | | this.TotalPrice1 += this.marryalls; |
| | | this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)) |
| | | } |
| | | } |
| | | }); |
| | | this.TotalPrice1 = 0; |
| | | this.TotalPrice = 0; |
| | | this.DataList3.forEach((item) => { |
| | | this.TotalPrice1 += item.proPrice; |
| | | this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)) |
| | | }); |
| | | }, |
| | | /** 删除按钮操作 */ |
| | |
| | | } |
| | | |
| | | .box1 { |
| | | width: 50%; |
| | | width: 35%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |