菜谱操作问题提交
This commit is contained in:
parent
6ff0718f63
commit
7babf5804a
|
|
@ -416,6 +416,7 @@ export default {
|
|||
//弹窗右侧已选菜品
|
||||
dishesTableList:[],
|
||||
dishesList:[],
|
||||
noDishes:true
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -783,17 +784,26 @@ export default {
|
|||
if(this.baseInfo.recipeType==3){
|
||||
param.recipeDateList = this.weekDateList
|
||||
}
|
||||
this.noDishes = true;
|
||||
param.recipeDateList.forEach(item=>{
|
||||
item.detailList.forEach(subItem=>{
|
||||
subItem.dishesList.forEach(dishItem=>{
|
||||
dishItem.price = Number(dishItem.price*100)
|
||||
dishItem.salePrice = Number(dishItem.salePrice*100)
|
||||
})
|
||||
if(subItem.dishesList.length>0){
|
||||
console.log(noDishes)
|
||||
noDishes=false
|
||||
subItem.dishesList.forEach(dishItem=>{
|
||||
dishItem.price = Number(dishItem.price*100)
|
||||
dishItem.salePrice = Number(dishItem.salePrice*100)
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
addMenuRecipeApi(param).then((response) => {
|
||||
this.jumpList()
|
||||
});
|
||||
if(!this.noDishes){
|
||||
this.$modal.msgError("请选中菜品!");
|
||||
}else{
|
||||
addMenuRecipeApi(param).then((response) => {
|
||||
this.jumpList()
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -417,6 +417,7 @@ export default {
|
|||
//弹窗右侧已选菜品
|
||||
dishesTableList:[],
|
||||
dishesList:[],
|
||||
noDishes:true
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -438,12 +439,20 @@ export default {
|
|||
console.log(this.baseInfo)
|
||||
if(this.baseInfo.recipeType==1){//指定日期
|
||||
let length = this.baseInfo.applyDateList.length
|
||||
this.dateRange[0] = this.baseInfo.applyDateList[0]
|
||||
this.dateRange[1] = this.baseInfo.applyDateList[length-1]
|
||||
this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1])
|
||||
this.dateRangeRadio = this.dateRange[0];
|
||||
this.detailList = this.dateRangeList[0].detailList;
|
||||
this.getRecipeDetailByDate()
|
||||
if(length>0){
|
||||
this.dateRange[0] = this.baseInfo.applyDateList[0]
|
||||
this.dateRange[1] = this.baseInfo.applyDateList[length-1]
|
||||
this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1])
|
||||
this.dateRangeRadio = this.dateRange[0];
|
||||
this.detailList = this.dateRangeList[0].detailList;
|
||||
this.getRecipeDetailByDate()
|
||||
}else{
|
||||
this.dateRange=[new Date(),new Date().setDate(new Date().getDate() + 6)]
|
||||
this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1])
|
||||
this.dateRangeRadio = this.formatDate(this.dateRange[0]);
|
||||
this.detailList = this.dateRangeList[0].detailList;
|
||||
this.getRecipeDetailByDate()
|
||||
}
|
||||
}
|
||||
if(this.baseInfo.recipeType==2){//每日循环
|
||||
this.detailList = [
|
||||
|
|
@ -680,6 +689,7 @@ export default {
|
|||
//周几
|
||||
var days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
|
||||
var dayOfWeek = start.getDay();
|
||||
console.log(this.formatDate(start))
|
||||
let obj = {
|
||||
applyDate:this.formatDate(start),
|
||||
applyDateStr:this.formatDate(start)+" "+days[dayOfWeek],
|
||||
|
|
@ -910,8 +920,7 @@ export default {
|
|||
// 提交按钮
|
||||
confirmSubmit(){
|
||||
this.$refs["baseInfo"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
if (valid) {
|
||||
let param = this.baseInfo
|
||||
if(this.baseInfo.recipeType==1){
|
||||
param.recipeDateList = this.dateRangeList
|
||||
|
|
@ -926,17 +935,26 @@ export default {
|
|||
console.log(this.weekDateList)
|
||||
param.recipeDateList = this.weekDateList
|
||||
}
|
||||
this.noDishes = true;
|
||||
param.recipeDateList.forEach(item=>{
|
||||
item.detailList.forEach(subItem=>{
|
||||
subItem.dishesList.forEach(dishItem=>{
|
||||
dishItem.price = Number(dishItem.price*100)
|
||||
dishItem.salePrice = Number(dishItem.salePrice*100)
|
||||
})
|
||||
if(subItem.dishesList.length>0){
|
||||
this.noDishes=false
|
||||
subItem.dishesList.forEach(dishItem=>{
|
||||
dishItem.price = Number(dishItem.price*100)
|
||||
dishItem.salePrice = Number(dishItem.salePrice*100)
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
addMenuRecipeApi(param).then((response) => {
|
||||
this.jumpList()
|
||||
});
|
||||
if(this.noDishes){
|
||||
this.$modal.msgError("请选中菜品!");
|
||||
}else{
|
||||
addMenuRecipeApi(param).then((response) => {
|
||||
this.jumpList()
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue