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