|
@@ -769,6 +769,7 @@ export default {
|
|
|
let amountSum = 0;
|
|
|
let purchaseAmountSum = 0;
|
|
|
let grossProfitRate = 0;
|
|
|
+ let grossProfit=0
|
|
|
this.data.forEach(e => {
|
|
|
amountSum = _.add(amountSum, Number(e.amount));
|
|
|
purchaseAmountSum = _.add(
|
|
@@ -780,11 +781,12 @@ export default {
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
- this.form.grossProfit = _.subtract(amountSum, purchaseAmountSum);
|
|
|
+ grossProfit = _.subtract(amountSum, purchaseAmountSum);
|
|
|
grossProfitRate = _.multiply(
|
|
|
_.divide(_.subtract(amountSum, purchaseAmountSum), amountSum),
|
|
|
100
|
|
|
);
|
|
|
+ this.form.grossProfit=Number(grossProfit?grossProfit:0).toFixed(2);
|
|
|
this.form.grossProfitRate = Number(
|
|
|
grossProfitRate ? grossProfitRate : 0
|
|
|
).toFixed(2);
|