|
@@ -208,7 +208,7 @@ export default {
|
|
|
var replaceData=uni.getStorageSync("replaceData");
|
|
|
|
|
|
if(replaceData){
|
|
|
- replaceData.qty=1;
|
|
|
+ //replaceData.qty=1;
|
|
|
console.log(replaceData)
|
|
|
//console.log(this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll.goodsList[this.replaceIndex2])
|
|
|
this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsList.unshift(replaceData)
|
|
@@ -505,12 +505,48 @@ export default {
|
|
|
goods.goodsGroupDetail.forEach((tgoods,tindex)=>{
|
|
|
var addArr=JSON.parse(JSON.stringify(goods.goodsList))
|
|
|
if(tindex==0){
|
|
|
- if(referenceDosageQty>tgoods.capacity){
|
|
|
- var parseIntNum=parseInt(referenceDosageQty/tgoods.capacity)
|
|
|
- tgoods.qty=parseIntNum
|
|
|
+ if(tgoods.capacity){
|
|
|
+ if(referenceDosageQty>tgoods.capacity){
|
|
|
+ //console.log("referenceDosageQty>tgoods.capacity")
|
|
|
+ var parseIntNum=parseInt(referenceDosageQty/tgoods.capacity)
|
|
|
+ //console.log("parseIntNum--"+parseIntNum)
|
|
|
+ tgoods.qty=parseIntNum
|
|
|
+ addArr.unshift(tgoods)
|
|
|
+ var reduce= tgoods.capacity*parseIntNum
|
|
|
+ referenceDosageQty=referenceDosageQty - reduce
|
|
|
+ var addDta={
|
|
|
+ goodsGroupDetail:[],
|
|
|
+ goodsList:addArr,
|
|
|
+ del:true,
|
|
|
+ }
|
|
|
+ addDta.goodsList.forEach(add=>{
|
|
|
+ add.del=true;
|
|
|
+ })
|
|
|
+
|
|
|
+ list.listGoodsAll.splice(index, 1,addDta)
|
|
|
+ }else{
|
|
|
+ console.log("推荐大于容量")
|
|
|
+ if(goods.goodsGroupDetail.length==1){
|
|
|
+ console.log("同组品 一个")
|
|
|
+ addArr.unshift(tgoods)
|
|
|
+ referenceDosageQty=referenceDosageQty-tgoods.capacity
|
|
|
+ var addDta={
|
|
|
+ goodsGroupDetail:[],
|
|
|
+ goodsList:addArr,
|
|
|
+ del:true,
|
|
|
+ }
|
|
|
+ addDta.goodsList.forEach(add=>{
|
|
|
+ add.del=true;
|
|
|
+ })
|
|
|
+
|
|
|
+ list.listGoodsAll.splice(index, 1,addDta)
|
|
|
+ }else{
|
|
|
+ list.listGoodsAll.splice(index, 1)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
addArr.unshift(tgoods)
|
|
|
- var reduce= tgoods.capacity*parseIntNum
|
|
|
- referenceDosageQty=referenceDosageQty - reduce
|
|
|
var addDta={
|
|
|
goodsGroupDetail:[],
|
|
|
goodsList:addArr,
|
|
@@ -521,17 +557,13 @@ export default {
|
|
|
})
|
|
|
|
|
|
list.listGoodsAll.splice(index, 1,addDta)
|
|
|
- }else{
|
|
|
- if(goods.goodsGroupDetail.length==1){
|
|
|
- addArr.unshift(tgoods)
|
|
|
- referenceDosageQty=referenceDosageQty-tgoods.capacity
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
}else{
|
|
|
+ if(goods.goodsGroupDetail[0].capacity){
|
|
|
|
|
|
if(referenceDosageQty>0){
|
|
|
console.log('referenceDosageQty'+referenceDosageQty)
|
|
@@ -605,6 +637,9 @@ export default {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|