|
@@ -135,7 +135,7 @@
|
|
|
|
|
|
<script>
|
|
|
import request from '@/utils/request'
|
|
|
-import { handleMoney } from '@/utils'
|
|
|
+import { handleMoney, fourMoney } from '@/utils'
|
|
|
|
|
|
export default {
|
|
|
name: 'AddSettlement',
|
|
@@ -296,12 +296,22 @@ export default {
|
|
|
let num = 0, price = 0, buyPrice = 0;
|
|
|
this.goodsList.forEach(item => {
|
|
|
num = parseFloat(Number(num) + Number(item.goodsQuantity || 0)).toFixed(4)
|
|
|
- price = parseFloat(Number(price) + Number(item.salesTotalPrice || 0)).toFixed(2)
|
|
|
+ price = parseFloat(Number(price) + (Number(item.goodsQuantity || 0) * Number(item.salesPrice || 0))).toFixed(4)
|
|
|
buyPrice = parseFloat(Number(buyPrice) + Number(item.purchaseTotalPrice || 0)).toFixed(2)
|
|
|
})
|
|
|
this.ruleForm.countTheGoods = num
|
|
|
- this.ruleForm.settleTotalSalesPrice = price
|
|
|
+ this.ruleForm.settleTotalSalesPrice = parseFloat(price).toFixed(2)
|
|
|
+ // this.ruleForm.settlementAmount = parseFloat(price).toFixed(2)
|
|
|
this.buyTotalPrice = buyPrice
|
|
|
+
|
|
|
+ // this.goodsList.forEach(item => {
|
|
|
+ // num = parseFloat(Number(num) + Number(item.goodsQuantity || 0)).toFixed(4)
|
|
|
+ // price = parseFloat(Number(price) + Number(item.salesTotalPrice || 0)).toFixed(2)
|
|
|
+ // buyPrice = parseFloat(Number(buyPrice) + Number(item.purchaseTotalPrice || 0)).toFixed(2)
|
|
|
+ // })
|
|
|
+ // this.ruleForm.countTheGoods = num
|
|
|
+ // this.ruleForm.settleTotalSalesPrice = price
|
|
|
+ // this.buyTotalPrice = buyPrice
|
|
|
},
|
|
|
confirmRepay() {
|
|
|
let arr = []
|
|
@@ -332,7 +342,7 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
changeNum1() {
|
|
|
- return handleMoney(this.ruleForm.countTheGoods)
|
|
|
+ return fourMoney(this.ruleForm.countTheGoods)
|
|
|
},
|
|
|
changeNum2() {
|
|
|
return handleMoney(this.ruleForm.settleTotalSalesPrice)
|