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