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