浏览代码

fix:验收单、结算单位数修改

jiand 5 月之前
父节点
当前提交
b97632976f

+ 2 - 2
src/views/acceptanceManagement/components/historyViewContent/add.vue

@@ -261,8 +261,8 @@ export default {
           item.acceptanceDate = item.acceptanceDate.split(' ')[0]
         })
 
-        this.countTotal = num ? Math.round(num * 100) / 100 : 0
-        this.priceTotal = price ? Math.round(price * 100) / 100 : 0
+        this.countTotal = num ? num.toFixed(4) : 0
+        this.priceTotal = price ? price.toFixed(2) : 0
       },
       immediate: true,
       deep: true

+ 2 - 2
src/views/acceptanceManagement/components/historyViewContent/priceAdjust.vue

@@ -172,8 +172,8 @@ export default {
           item.acceptanceDate = item.acceptanceDate.split(' ')[0]
         })
 
-        this.countTotal = num ? Math.round(num * 100) / 100 : 0
-        this.priceTotal = price ? Math.round(price * 100) / 100 : 0
+        this.countTotal = num ? num.toFixed(4) : 0
+        this.priceTotal = price ? price.toFixed(2) : 0
       },
       immediate: true,
       deep: true

+ 14 - 4
src/views/settlementManagement/components/add.vue

@@ -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)

+ 5 - 4
src/views/settlementManagement/components/edit.vue

@@ -74,7 +74,7 @@
 
 <script>
 import request from '@/utils/request'
-import { handleMoney } from '@/utils'
+import { handleMoney, fourMoney } from '@/utils'
 
 export default {
   name: 'AddSettlement',
@@ -128,11 +128,12 @@ 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
     },
     getBusinessDetail() {
@@ -155,7 +156,7 @@ export default {
   },
   computed: {
     changeNum1() {
-      return handleMoney(this.ruleForm.countTheGoods)
+      return fourMoney(this.ruleForm.countTheGoods)
     },
     changeNum2() {
       return handleMoney(this.ruleForm.settleTotalSalesPrice)