Ver Fonte

前端货源提交不了,货源小数位数问题

gjy há 2 anos atrás
pai
commit
afd801b8bf

+ 6 - 3
src/views/taskManagement/supplyofgoods.vue

@@ -94,6 +94,7 @@
     fmoney,
     EventBus
   } from 'base-core-lib'
+import { toFixed } from 'xe-utils/methods'
   export default {
     name: 'viewSpareMoney',
     components: {
@@ -280,9 +281,10 @@
           }
           
          }
+         this.num=this.num.toFixed(3)
          console.log(this.multipleSelection1)
           for (let q = 0; q < this.multipleSelection1.length; q++) {
-            this.content=this.content+this.multipleSelection1[q].goodsName+(this.multipleSelection1[q].estimateOutWarehouseWeight?this.multipleSelection1[q].estimateOutWarehouseWeight:0)+'吨'
+            this.content=this.content+this.multipleSelection1[q].goodsName+(this.multipleSelection1[q].estimateOutWarehouseWeight?this.multipleSelection1[q].estimateOutWarehouseWeight.toFixed(3):0)+'吨'
           }
         for (let i = 0; i < val.length; i++) {
           val[i].select=true
@@ -328,8 +330,9 @@
           }
           
          }
+         this.num=this.num.toFixed(3)
           for (let q = 0; q < this.multipleSelection1.length; q++) {
-            this.content=this.content+this.multipleSelection1[q].goodsName+(this.multipleSelection1[q].estimateOutWarehouseWeight?this.multipleSelection1[q].estimateOutWarehouseWeight:0)+'吨,'
+            this.content=this.content+this.multipleSelection1[q].goodsName+(this.multipleSelection1[q].estimateOutWarehouseWeight?this.multipleSelection1[q].estimateOutWarehouseWeight.toFixed(3):0)+'吨,'
           }
       },
       getList() {
@@ -403,7 +406,7 @@
                 });
                 return
             }
-            if(String(this.multipleSelection[i].estimateOutWarehouseWeight).indexOf('.')!=-1&&this.multipleSelection[i].estimateOutWarehouseWeight.substring(this.multipleSelection[i].estimateOutWarehouseWeight.indexOf('.')+1, this.multipleSelection[i].estimateOutWarehouseWeight.length).length>3){
+            if(String(this.multipleSelection[i].estimateOutWarehouseWeight).indexOf('.')!=-1&&String(this.multipleSelection[i].estimateOutWarehouseWeight).substring(String(this.multipleSelection[i].estimateOutWarehouseWeight).indexOf('.')+1, this.multipleSelection[i].estimateOutWarehouseWeight.length).length>3){
               this.$message({
                 message: '预计出库重量输入错误',
                 type: 'error'

+ 4 - 2
src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue

@@ -598,13 +598,15 @@
 						}
 						console.log(this.goods)
 					}
+					this.dataList1.weight=this.dataList1.weight.toFixed(3)
+					this.dataList.weight=this.dataList.weight.toFixed(3)
 				}else if(this.dataList.taskTypeKey==1||this.dataList.taskTypeKey==3){
 					var supplygoods=JSON.parse(localStorage.getItem('supplygoods1'))
 					if(localStorage.getItem('supplygoodsstatus')&&localStorage.getItem('supplygoodsstatus')==0){
 						for (let i = 0; i < supplygoods.length; i++) {
 							this.goods=this.goods!=''?this.goods+',':''+supplygoods[i].goodsName
-							this.dataList1.weight=Number(this.dataList1.weight)+Number(supplygoods[i].estimateOutWarehouseWeight)
-							this.dataList.weight=Number(this.dataList.weight)+Number(supplygoods[i].estimateOutWarehouseWeight)
+							this.dataList1.weight=Number(this.dataList1.weight)+Number(supplygoods[i].estimateOutWarehouseWeight.toFixed(3))
+							this.dataList.weight=Number(this.dataList.weight)+Number(supplygoods[i].estimateOutWarehouseWeight.toFixed(3))
 						}
 					}
 					

+ 2 - 2
src/views/taskManagement/tranManagementWarehouseInOutTaskAudit.vue

@@ -1082,8 +1082,8 @@
               for (let i = 0; i < supplygoods.length; i++) {
                 console.log(this.goods)
                 this.goods=this.goods!=''?this.goods+',':''+supplygoods[i].goodsName
-                this.dataList1.weight=Number(this.dataList1.weight)+Number(supplygoods[i].estimateOutWarehouseWeight)
-                this.dataList.weight=Number(this.dataList.weight)+Number(supplygoods[i].estimateOutWarehouseWeight)
+                this.dataList1.weight=Number(this.dataList1.weight)+Number(supplygoods[i].estimateOutWarehouseWeight.toFixed(3))
+                this.dataList.weight=Number(this.dataList.weight)+Number(supplygoods[i].estimateOutWarehouseWeight.toFixed(3))
               }
             }
           }

+ 4 - 4
src/views/taskManagement/tranManagementWarehouseInOutTaskEdit.vue

@@ -1832,12 +1832,12 @@ export default {
                       this.dataList1.weight =
                       Number(this.dataList1.weight) +
                       Number(
-                        supplygoods[i].estimateOutWarehouseWeight
+                        supplygoods[i].estimateOutWarehouseWeight.toFixed(3)
                       )
                     this.dataList.weight =
                       Number(this.dataList.weight) +
                       Number(
-                        supplygoods[i].estimateOutWarehouseWeight
+                        supplygoods[i].estimateOutWarehouseWeight.toFixed(3)
                       )
                     }
                     
@@ -1857,10 +1857,10 @@ export default {
                       : '' + supplygoods[i].goodsName
                   this.dataList1.weight =
                     Number(this.dataList1.weight) +
-                    Number(supplygoods[i].estimateOutWarehouseWeight)
+                    Number(supplygoods[i].estimateOutWarehouseWeight.toFixed(3))
                   this.dataList.weight =
                     Number(this.dataList.weight) +
-                    Number(supplygoods[i].estimateOutWarehouseWeight)
+                    Number(supplygoods[i].estimateOutWarehouseWeight.toFixed(3))
                 }
               }
             }