twt vor 3 Jahren
Ursprung
Commit
76429d6621
1 geänderte Dateien mit 28 neuen und 9 gelöschten Zeilen
  1. 28 9
      pages/module/maintain.vue

+ 28 - 9
pages/module/maintain.vue

@@ -520,8 +520,15 @@ export default {
 													}) 
 													//addDta.splice(1,0)
 													console.log(addDta)
-													var add=JSON.parse(JSON.stringify(addDta))
-													list.listGoodsAll.splice(index+1, 0,add)
+													if(addDta.goodsList[0].capacity==goods.goodsList[0].capacity){
+																											  
+														 goods.goodsList[0].qty++
+													}else{
+														var add=JSON.parse(JSON.stringify(addDta))
+														 list.listGoodsAll.splice(index+1, 0,add)
+													}
+													//var add=JSON.parse(JSON.stringify(addDta))
+													//list.listGoodsAll.splice(index+1, 0,add)
 													
 												}
 											} 
@@ -818,6 +825,10 @@ export default {
 						goods.goodsGroupDetail.forEach(tgoods=>{
 							tgoods.del=false;
 							
+						})
+						goods.goodsList.forEach(tgoods=>{
+							tgoods.del=false;
+							
 						})
 						goods.goodsList[0].del=false;
 						if(goods.tpn){
@@ -856,15 +867,16 @@ export default {
 										}else
 										if(goods.goodsList[0].capacity>0&&!goods.goodsList[0].del){
 											goods.goodsList.forEach((newGoods,newindex)=>{
-												var qtynum1=referenceDosageQty-newGoods.capacity
-												var qtynum2=Math.ceil(qtynum1/newGoods.capacity)
-												 console.log("qtynum2=="+qtynum2)
+												
 												if(newindex==0&&!goods.goodsList[0].del){
-													console.log("??sdsaf")
+													var qtynum1=referenceDosageQty-newGoods.capacity
+													var qtynum2=Math.ceil(qtynum1/newGoods.capacity)
+													 console.log("qtynum2=="+qtynum2)
 													 goods.goodsList[0].qty=qtynum2;
 													 goods.goodsList[0].del=true;
 													 referenceDosageQty=referenceDosageQty-(qtynum2*newGoods.capacity)
 												}else if(newindex!=0&&!newGoods.del){
+													console.log("referenceDosageQty---"+referenceDosageQty)
 													if(referenceDosageQty>0){
 														//var qtynum4=referenceDosageQty-newGoods.capacity
 													  var qtynum3=Math.ceil(referenceDosageQty/newGoods.capacity)
@@ -882,9 +894,16 @@ export default {
 													  	add.del=true;
 													  }) 
 													  
-													  console.log(addDta)
-													  var add=JSON.parse(JSON.stringify(addDta))
-													  list.listGoodsAll.splice(index+1, 0,add)
+													  //console.log(addDta)
+													  //console.log("第一个容量"+goods.goodsList[0].capacity)
+													  if(addDta.goodsList[0].capacity==goods.goodsList[0].capacity){
+														  
+														  goods.goodsList[0].qty++
+													  }else{
+														  var add=JSON.parse(JSON.stringify(addDta))
+														  list.listGoodsAll.splice(index+1, 0,add)
+													  }
+													 
 													  //if(addArrnt[0].)
 													}