|
@@ -719,12 +719,12 @@ export default {
|
|
|
|
|
|
// 设置合同金额合计和标准售价合计,以及计算折扣率总和。
|
|
|
setTotalAmounts(productData) {
|
|
|
- const totalFinalPrice = productData.reduce((acc, cur) => acc + Number(cur.final_price), 0).toFixed(2);
|
|
|
- const totalOriginalPrice = productData.reduce((acc, cur) => acc + Number(cur.original_price), 0).toFixed(2);
|
|
|
- const rateTotal = div(totalFinalPrice, totalOriginalPrice) ? (div(totalFinalPrice, totalOriginalPrice) * 100).toFixed(2) + '%' : '无法计算';
|
|
|
-
|
|
|
+ this.orderData = this.orderDetail.orderData || {};
|
|
|
+ const totalFinalPrice = this.isBackstageOrder ? (this.formatNumber(this.orderData.pay_money) || '0.00') : (this.formatNumber(this.orderData.order_money) || '0.00')
|
|
|
+ let totalOriginalPrice = productData.reduce((acc, cur) => acc + Number(cur.original_price), 0).toFixed(2);
|
|
|
+ const totalDiscountRate = div(totalFinalPrice, totalOriginalPrice) * 100
|
|
|
+ const rateTotal = totalDiscountRate ? (div(totalFinalPrice, totalOriginalPrice) * 100).toFixed(2) + '%' : '0%'
|
|
|
// 无标准售价产品,标准售价合计展示为无法计算
|
|
|
- // const noOriginalPriceProduct = ['企业商机管理', '医械通', '物业数字化营销', '运营商专版']
|
|
|
let noOriginalPriceProductBool = false
|
|
|
productData.forEach(product => {
|
|
|
if(!product.original_price) {
|
|
@@ -732,11 +732,16 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
const originalPriceTotal = !noOriginalPriceProductBool
|
|
|
- this.orderData.final_price_total = totalFinalPrice;
|
|
|
- this.orderData.original_price_total = originalPriceTotal ? '¥' + totalOriginalPrice : '无法计算';
|
|
|
- this.orderData.rate_total = originalPriceTotal && Number(totalOriginalPrice) ? rateTotal : '无法计算';
|
|
|
+ if(originalPriceTotal) {
|
|
|
+ totalOriginalPrice = this.isBackstageOrder ? this.formatNumber(this.orderData.order_money || '0.00') : this.formatNumber(this.orderData.original_price || '0.00')
|
|
|
+ }
|
|
|
+ this.orderData = {
|
|
|
+ ...this.orderData,
|
|
|
+ final_price_total: totalFinalPrice,
|
|
|
+ original_price_total: originalPriceTotal ? '¥' + totalOriginalPrice : '无法计算',
|
|
|
+ rate_total: originalPriceTotal && Number(totalOriginalPrice) ? rateTotal : '无法计算'
|
|
|
+ }
|
|
|
},
|
|
|
-
|
|
|
// flattenLinkOrderList(linkOrderList) {
|
|
|
// const result = [];
|
|
|
// if (!linkOrderList || linkOrderList.length === 0) return result;
|