diff --git a/src/views/sales/salesOrder/salesOrderAdd.vue b/src/views/sales/salesOrder/salesOrderAdd.vue index 0e987db..d8e4eec 100644 --- a/src/views/sales/salesOrder/salesOrderAdd.vue +++ b/src/views/sales/salesOrder/salesOrderAdd.vue @@ -156,7 +156,7 @@ @@ -170,7 +170,7 @@ @@ -186,10 +186,14 @@ + + + - @@ -203,7 +207,7 @@
优惠金额:
- +
优惠后金额:
@@ -215,13 +219,13 @@
运费:
- +
本次收款
- +
本次欠款
@@ -229,11 +233,11 @@
总欠款
- +
预收款余额
- +
结算账户
@@ -489,17 +493,17 @@ export default { if (this.formobj.goodsList.length > 0) { this.formobj.goodsList.forEach((e) => { if (e.goodsSpuName !== '') { - yhh = parseFloat(yhh) + parseFloat(e.dueAmount !== '' ? e.dueAmount : '0') + yhh = Math.round((parseFloat(yhh) + parseFloat(e.dueAmount !== '' ? e.dueAmount : '0')) * 10000) / 10000 } }) } - yhh = Math.round((parseFloat(yhh) - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0')) * 100) / 100 + yhh = Math.round((parseFloat(yhh) - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0')) * 10000) / 10000 return yhh }, // 计算本次欠款 = 应收合计(优惠后金额) + 运费 - 本次收款 bcqkCompute() { let bcqk = '0' - bcqk = Math.round((parseFloat(this.yhhCompute) + parseFloat(this.formobj.freight !== '' ? this.formobj.freight : '0') - parseFloat(this.formobj.thisPay !== '' ? this.formobj.thisPay : '0')) * 100) / 100 + bcqk = Math.round((parseFloat(this.yhhCompute) + parseFloat(this.formobj.freight !== '' ? this.formobj.freight : '0') - parseFloat(this.formobj.thisPay !== '' ? this.formobj.thisPay : '0')) * 10000) / 10000 return bcqk } }, @@ -858,13 +862,13 @@ export default { discountRateInput() { if (this.formobj.goodsList.length > 0) { // 重新计算底部的优惠金额 = 总应收合计 * (1 - 折扣率) - this.formobj.discountAmount = Math.round((parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0') * (parseFloat(1) - parseFloat(this.formobj.discountRate !== '' ? this.formobj.discountRate : '0') / 100)) * 100) / 100 + this.formobj.discountAmount = Math.round((parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0') * (parseFloat(1) - parseFloat(this.formobj.discountRate !== '' ? this.formobj.discountRate : '0') / 100)) * 10000) / 10000 // 需计算商品列表中各商品的分摊优惠、惠后金额 this.formobj.goodsList.forEach((e) => { // 分摊优惠 = 底部优惠金额 * 对应的应收 / 总应收合计 - e.discountAmount = Math.round((parseFloat(this.formobj.discountAmount) * parseFloat(e.dueAmount !== '' ? e.dueAmount : '0') / parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0')) * 100) / 100 + e.discountAmount = Math.round((parseFloat(this.formobj.discountAmount) * parseFloat(e.dueAmount !== '' ? e.dueAmount : '0') / parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0')) * 10000) / 10000 // 惠后金额 = 对应的应收 - 对应的分摊优惠 - e.amount = Math.round((parseFloat(e.dueAmount !== '' ? e.dueAmount : '0') - parseFloat(e.discountAmount !== '' ? e.discountAmount : '0')) * 100) / 100 + e.amount = Math.round((parseFloat(e.dueAmount !== '' ? e.dueAmount : '0') - parseFloat(e.discountAmount !== '' ? e.discountAmount : '0')) * 10000) / 10000 }) } }, @@ -872,39 +876,39 @@ export default { discountAmountInput() { if (this.formobj.goodsList.length > 0) { // 重新计算折扣率 = (总应收合计 - 优惠金额) / 总应收合计 - this.formobj.discountRate = Math.round((((parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0') - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0')) / parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0')) * 100).toFixed(2) * 100) / 100 + this.formobj.discountRate = Math.round((((parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0') - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0')) / parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0')) * 100).toFixed(2) * 10000) / 10000 // 需计算商品列表中各商品的分摊优惠、惠后金额 this.formobj.goodsList.forEach((e) => { // 分摊优惠 = 底部优惠金额 * 对应的应收 / 总应收合计 - e.discountAmount = Math.round((parseFloat(this.formobj.discountAmount) * parseFloat(e.dueAmount !== '' ? e.dueAmount : '0') / parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0')) * 100) / 100 + e.discountAmount = Math.round((parseFloat(this.formobj.discountAmount) * parseFloat(e.dueAmount !== '' ? e.dueAmount : '0') / parseFloat(this.totalReceivables !== '' ? this.totalReceivables : '0')) * 10000) / 10000 // 惠后金额 = 对应的应收 - 对应的分摊优惠 - e.amount = Math.round((parseFloat(e.dueAmount !== '' ? e.dueAmount : '0') - parseFloat(e.discountAmount !== '' ? e.discountAmount : '0')) * 100) / 100 + e.amount = Math.round((parseFloat(e.dueAmount !== '' ? e.dueAmount : '0') - parseFloat(e.discountAmount !== '' ? e.discountAmount : '0')) * 10000) / 10000 }) } }, // 计算折后单价 = 单价 * 折扣率 discountPriceInput(row) { - row.discountPrice = Math.round((parseFloat(row.price !== '' ? row.price : '0') * parseFloat(row.discountRtate !== '' ? row.discountRtate : '0') / 100) * 100) / 100 + row.discountPrice = Math.round((parseFloat(row.price !== '' ? row.price : '0') * parseFloat(row.discountRtate !== '' ? row.discountRtate : '0') / 100) * 10000) / 10000 // 折扣单价改变,重新计算应收款、惠后金额等 this.dueAmountInput(row) }, // 计算应收款, 同时计算惠后金额 dueAmountInput(row) { // 应收款 = 折后单价 * 数量 - row.dueAmount = Math.round((parseFloat(row.discountPrice !== '' ? row.discountPrice : '0') * parseFloat(row.count !== '' ? row.count : '0')) * 100) / 100 + row.dueAmount = Math.round((parseFloat(row.discountPrice !== '' ? row.discountPrice : '0') * parseFloat(row.count !== '' ? row.count : '0')) * 10000) / 10000 // 惠后金额 = 应收款 - 分摊金额 - row.amount = Math.round((parseFloat(row.dueAmount) - parseFloat(row.discountAmount)) * 100) / 100 + row.amount = Math.round((parseFloat(row.dueAmount) - parseFloat(row.discountAmount)) * 10000) / 10000 // 重新计算税额等 this.taxAmountInput(row) }, // 计算税额。同时计算未含税价及未含税总额 taxAmountInput(row) { // 计算单个商品税额 = 单价 - (单价 / (1 + 税率)) - row.taxAmount = Math.round((parseFloat(row.price) - (parseFloat(row.price) / (parseFloat(1) + parseFloat(row.taxRate !== '' ? row.taxRate : '0') / 100))) * 100) / 100 + row.taxAmount = Math.round((parseFloat(row.price) - (parseFloat(row.price) / (parseFloat(1) + parseFloat(row.taxRate !== '' ? row.taxRate : '0') / 100))) * 10000) / 10000 // 计算未含税价 = 单价 - 税额 - row.unTaxPrice = Math.round((parseFloat(row.price) - parseFloat(row.taxAmount)) * 100) / 100 + row.unTaxPrice = Math.round((parseFloat(row.price) - parseFloat(row.taxAmount)) * 10000) / 10000 // 计算未含税总额 = 未含税价 * 数量 - row.taxTotalAmount = Math.round((parseFloat(row.unTaxPrice) * parseFloat(row.count !== '' ? row.count : '0')) * 100) / 100 + row.taxTotalAmount = Math.round((parseFloat(row.unTaxPrice) * parseFloat(row.count !== '' ? row.count : '0')) * 10000) / 10000 }, handleAccount() { this.formobj.bankAccount = ''