菜品原料克数限制

This commit is contained in:
zzyuan 2025-05-14 18:20:43 +08:00
parent b18c592947
commit 96f40250f6
1 changed files with 26 additions and 16 deletions

View File

@ -1661,6 +1661,7 @@
} }
}) })
}else{ }else{
//littleWeight largeWeight baseForm.littleWeight baseForm.largeWeight
param.littlePrice = Number(param.littlePrice)*100; param.littlePrice = Number(param.littlePrice)*100;
param.largePrice = Number(param.largePrice)*100; param.largePrice = Number(param.largePrice)*100;
param.littleMaterialCost = Number(param.littleMaterialCost)*100; param.littleMaterialCost = Number(param.littleMaterialCost)*100;
@ -1682,22 +1683,31 @@
} }
}) })
} }
// console.log(param.materialList) let sumWeight = 0
if (this.title === "新增") { param.materialList.forEach(item=>{
addMenuDishesApi(param).then(response => { sumWeight = item.weight+sumWeight;
this.openDish = false; })
this.$modal.msgSuccess("新增成功"); if(sumWeight>param.weight){
this.getList(); this.btnLoading=false
}); sumWeight=0
this.btnLoading=false; this.$modal.msgError("组成成分总克数不可大于菜品份量");
} else { return false
editMenuDishesApi(param).then(response => { }
this.openDish = false; if (this.title === "新增") {
this.$modal.msgSuccess("修改成功"); addMenuDishesApi(param).then(response => {
this.getList(); this.openDish = false;
}); this.$modal.msgSuccess("新增成功");
this.btnLoading=false; this.getList();
} });
this.btnLoading=false;
} else {
editMenuDishesApi(param).then(response => {
this.openDish = false;
this.$modal.msgSuccess("修改成功");
this.getList();
});
this.btnLoading=false;
}
} }
} }
}) })