twt преди 3 години
родител
ревизия
ecf0c6a5a2
променени са 1 файла, в които са добавени 18 реда и са изтрити 6 реда
  1. 18 6
      pages/module/maintain.vue

+ 18 - 6
pages/module/maintain.vue

@@ -177,6 +177,7 @@ export default {
 			replaceIndex1:'',
 			replaceIndex2:'',
 			brand:'',
+			isNull:true,
 		}
 	},
 	onLoad(opt) {
@@ -319,6 +320,7 @@ export default {
 			
 		},
 		calculation(txt){
+			this.isNull=true
 			this.total=0;
 			this.totalhj=0;
 			this.goodsTotal=0;
@@ -352,9 +354,14 @@ export default {
 									}) */
 									//goods[0].salePrice=1;
 									this.goodsTotal=Number(this.goodsTotal)
-									this.goodsTotal+=goods[0].salePrice*goods[0].qty
-									this.goodsTotal=this.goodsTotal.toFixed(2)
-										obj.listGoodsAll.push(goods[0])
+									if(!isNaN(goods[0].salePrice)){
+										this.goodsTotal+=goods[0].salePrice*goods[0].qty
+										this.goodsTotal=this.goodsTotal.toFixed(2)
+										
+									}else{
+									   this.isNull=false
+							     	}
+									obj.listGoodsAll.push(goods[0])
 									
 								
 								})
@@ -369,10 +376,15 @@ export default {
 							
 							i.listItem.forEach(xm=>{
 								xm.qty=1;
+								if(!isNaN(xm.salePrice)){
+									this.salePriceTotal=Number(this.salePriceTotal)
+									this.salePriceTotal+=xm.salePrice
+									this.salePriceTotal=this.salePriceTotal.toFixed(2)
+								}else{
+									this.isNull=false
+								}
 								//xm.salePrice=1;
-								this.salePriceTotal=Number(this.salePriceTotal)
-								this.salePriceTotal+=xm.salePrice
-								this.salePriceTotal=this.salePriceTotal.toFixed(2)
+								
 							})
 							//this.totalhj
 						}