|
@@ -258,7 +258,7 @@
|
|
|
<script>
|
|
|
import request from '@/utils/request'
|
|
|
import chooseGoodsVue from './components/chooseGoods.vue'
|
|
|
-import { handleMoney } from '@/utils'
|
|
|
+import { handleMoney, fourMoney } from '@/utils'
|
|
|
|
|
|
export default {
|
|
|
name: 'AddSettlement',
|
|
@@ -524,13 +524,13 @@ export default {
|
|
|
calculateTotal() {
|
|
|
let num = 0, price = 0, buyPrice = 0;
|
|
|
this.ruleForm.goodsList.forEach(item => {
|
|
|
- num = parseFloat(Number(num) + Number(item.goodsQuantity || 0)).toFixed(2)
|
|
|
- price = parseFloat(Number(price) + Number(item.salesTotalPrice || 0)).toFixed(2)
|
|
|
+ num = parseFloat(Number(num) + Number(item.goodsQuantity || 0)).toFixed(4)
|
|
|
+ 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.settlementAmount = price
|
|
|
+ this.ruleForm.settleTotalSalesPrice = parseFloat(price).toFixed(2)
|
|
|
+ this.ruleForm.settlementAmount = parseFloat(price).toFixed(2)
|
|
|
this.buyTotalPrice = buyPrice
|
|
|
},
|
|
|
confirmRepay() {
|
|
@@ -757,7 +757,7 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
changeNum1() {
|
|
|
- return handleMoney(this.ruleForm.countTheGoods)
|
|
|
+ return fourMoney(this.ruleForm.countTheGoods)
|
|
|
},
|
|
|
changeNum2() {
|
|
|
return handleMoney(this.ruleForm.settleTotalSalesPrice)
|