菜谱问题修改
This commit is contained in:
parent
b7dd2a72f8
commit
e8b20092a7
|
|
@ -103,7 +103,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-card">
|
<div class="bottom-card">
|
||||||
<el-button type="primary" @click="addDishes(item)" v-if="item.dishesList.length==0">新增</el-button>
|
<el-button type="primary" @click="addDishes(item)" v-if="item.dishesList.length==0">新增</el-button>
|
||||||
<el-button plain type="primary" v-else @click="editDishes(item)" >修改</el-button>
|
<el-button plain type="primary" v-if="item.dishesList.length>0" @click="editDishes(item)">修改</el-button>
|
||||||
|
<el-button plain type="danger" v-if="item.dishesList.length>0" @click="clearDishes(item)">清空</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -166,8 +167,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="dialog-center">
|
<div class="dialog-center">
|
||||||
<div class="dialog-center-header">菜品分类</div>
|
<div class="dialog-center-header">菜品分类</div>
|
||||||
<div v-for="(item,index) in dishesTypeList" :key="index" style="width: 100%;text-align: center;margin: 10px 0;">
|
<div v-for="(item,index) in dishesTypeList" :key="index" style="width: 100%;text-align: center;margin: 10px 0;display: flex;align-items: center;justify-content: center;">
|
||||||
<el-button plain :class="dishesType==item.typeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button>
|
<el-button plain :class="dishesType==item.typeId?'primary':''" style="width: 70%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button>
|
||||||
|
<!-- <el-button size="mini" type="text" style="color: red;" @click="clearDishTab(item)">清空</el-button> -->
|
||||||
|
<i class="el-icon-delete" style="color: red;cursor: pointer;margin-left: 10px;font-size: 18px;" @click="clearDishTab(item)"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dialog-right">
|
<div class="dialog-right">
|
||||||
|
|
@ -281,17 +284,22 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;display: flex;">
|
<div style="width: 100%;height: 500px;padding: 10px;border-radius: 10px;margin-bottom: 10px;display: flex;">
|
||||||
<el-card class="dishes-card" v-for="item in dialogDetailList" :key="item.mealtimeType">
|
<div style="width: 20%;height: 100%;margin-right: 10px;" v-for="item in dialogDetailList" :key="item.mealtimeType">
|
||||||
<div slot="header">
|
<el-card style="width: 100%;height: 88%;position: relative;">
|
||||||
<span style="font-weight: 600;">{{item.mealtimeName}}</span>
|
<div slot="header">
|
||||||
</div>
|
<span style="font-weight: 600;">{{item.mealtimeName}}</span>
|
||||||
<div class="body-card">
|
|
||||||
<div v-for="dish in item.dishesList" :key="dish.dishesId" style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
|
|
||||||
<span>{{dish.dishesName}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="body-card">
|
||||||
|
<div v-for="dish in item.dishesList" :key="dish.dishesId" style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
|
||||||
|
<span>{{dish.dishesName}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<div style="width: 100%;height: 12%;display: flex;align-items: center;justify-content: center;">
|
||||||
|
<el-button type="primary" @click="confirmCopyMealTypeMenu(item)">复制餐次</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="confirmCopyMenu">确 定</el-button>
|
<el-button type="primary" @click="confirmCopyMenu">确 定</el-button>
|
||||||
|
|
@ -546,7 +554,7 @@ export default {
|
||||||
//弹窗左侧待选菜品
|
//弹窗左侧待选菜品
|
||||||
dishesPageList:[],
|
dishesPageList:[],
|
||||||
//弹窗中间待选菜品
|
//弹窗中间待选菜品
|
||||||
dishesTypeList:[],
|
dishesTypeList:[{dishesTypeName:"全部",typeId:"-1"}],
|
||||||
dishesType:"",
|
dishesType:"",
|
||||||
//弹窗右侧已选菜品
|
//弹窗右侧已选菜品
|
||||||
dishesTableList:[],
|
dishesTableList:[],
|
||||||
|
|
@ -829,7 +837,7 @@ export default {
|
||||||
//新增
|
//新增
|
||||||
addDishes(item){
|
addDishes(item){
|
||||||
this.dishesList=item.dishesList;
|
this.dishesList=item.dishesList;
|
||||||
this.dishesTypeList=[]
|
this.dishesTypeList=[{dishesTypeName:"全部",typeId:"-1"}]
|
||||||
this.dishesTableList=[]
|
this.dishesTableList=[]
|
||||||
this.getDishesPage()
|
this.getDishesPage()
|
||||||
this.openDishes=true
|
this.openDishes=true
|
||||||
|
|
@ -838,7 +846,7 @@ export default {
|
||||||
editDishes(item){
|
editDishes(item){
|
||||||
// console.log(item)
|
// console.log(item)
|
||||||
this.dishesList=item.dishesList;
|
this.dishesList=item.dishesList;
|
||||||
this.dishesTypeList=[]
|
this.dishesTypeList=[{dishesTypeName:"全部",typeId:"-1"}]
|
||||||
this.dishesList.forEach(dish=>{
|
this.dishesList.forEach(dish=>{
|
||||||
let index = this.dishesTypeList.findIndex(v=>v.typeId==dish.typeId)
|
let index = this.dishesTypeList.findIndex(v=>v.typeId==dish.typeId)
|
||||||
if(index==-1){
|
if(index==-1){
|
||||||
|
|
@ -849,6 +857,16 @@ export default {
|
||||||
this.getDishesPage()
|
this.getDishesPage()
|
||||||
this.openDishes=true
|
this.openDishes=true
|
||||||
},
|
},
|
||||||
|
//清空
|
||||||
|
clearDishes(item){
|
||||||
|
console.log(item)
|
||||||
|
console.log(this.detailList)
|
||||||
|
this.detailList.forEach(mealType=>{
|
||||||
|
if(mealType.mealtimeType==item.mealtimeType){
|
||||||
|
mealType.dishesList=[]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
//获取左侧待选菜品
|
//获取左侧待选菜品
|
||||||
getDishesPage(){
|
getDishesPage(){
|
||||||
let param = {
|
let param = {
|
||||||
|
|
@ -911,18 +929,57 @@ export default {
|
||||||
choseDishesType(item){
|
choseDishesType(item){
|
||||||
this.dishesType = item.typeId;
|
this.dishesType = item.typeId;
|
||||||
this.dishesTableList = []
|
this.dishesTableList = []
|
||||||
this.dishesList.forEach(dish=>{
|
if(this.dishesType==-1){
|
||||||
if(dish.typeId==item.typeId){
|
this.dishesList.forEach(dish=>{
|
||||||
this.dishesTableList.push(dish)
|
this.dishesTableList.push(dish)
|
||||||
}
|
})
|
||||||
})
|
}else{
|
||||||
if(this.dishesTableList.length==0){//单个菜品分类中无菜品时,删除该分类
|
this.dishesList.forEach(dish=>{
|
||||||
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
|
if(dish.typeId==item.typeId){
|
||||||
if(typeIndex>-1){
|
this.dishesTableList.push(dish)
|
||||||
this.dishesTypeList.splice(typeIndex,1)
|
}
|
||||||
|
})
|
||||||
|
if(this.dishesTableList.length==0){//单个菜品分类中无菜品时,删除该分类
|
||||||
|
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
|
||||||
|
if(typeIndex>-1){
|
||||||
|
this.dishesTypeList.splice(typeIndex,1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//弹窗中间-清空菜品类别
|
||||||
|
clearDishTab(item){
|
||||||
|
this.$modal.confirm('是否确认清空该类别?').then(()=>{
|
||||||
|
if(item.typeId==-1){
|
||||||
|
for (let i = this.dishesList.length - 1; i >= 0; i--) {
|
||||||
|
this.dishesList.splice(i, 1);
|
||||||
|
}
|
||||||
|
this.dishesType = -1
|
||||||
|
this.dishesTypeList=[{dishesTypeName:"全部",typeId:"-1"}]
|
||||||
|
this.dishesTableList = []
|
||||||
|
this.dishesPageList.forEach(dish=>{
|
||||||
|
dish.isChecked = null;
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
for (let i = this.dishesList.length - 1; i >= 0; i--) {
|
||||||
|
if (this.dishesList[i].typeId == item.typeId) {
|
||||||
|
this.dishesList.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.dishesPageList.forEach(dish=>{
|
||||||
|
if(dish.typeId==item.typeId){
|
||||||
|
dish.isChecked = null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
|
||||||
|
if(typeIndex>-1){
|
||||||
|
this.dishesTypeList.splice(typeIndex,1)
|
||||||
|
}
|
||||||
|
this.dishesTableList = []
|
||||||
|
this.choseDishesType(this.dishesTypeList[0])
|
||||||
|
}
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
//弹窗右侧表格删除菜谱
|
//弹窗右侧表格删除菜谱
|
||||||
handleDelDishes(item){
|
handleDelDishes(item){
|
||||||
this.$modal.confirm('是否确认删除?').then(()=>{
|
this.$modal.confirm('是否确认删除?').then(()=>{
|
||||||
|
|
@ -945,9 +1002,9 @@ export default {
|
||||||
}
|
}
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
//外部餐次列表删除菜谱
|
//外部餐次列表删除菜品
|
||||||
deleteDishes(type,dish){
|
deleteDishes(type,dish){
|
||||||
this.$modal.confirm('是否确认删除?').then(()=>{
|
this.$modal.confirm('是否确认删除菜品?').then(()=>{
|
||||||
let index = type.dishesList.findIndex(v=>v.dishesId==dish.dishesId)
|
let index = type.dishesList.findIndex(v=>v.dishesId==dish.dishesId)
|
||||||
this.detailList.forEach(item=>{
|
this.detailList.forEach(item=>{
|
||||||
if(item.mealtimeType==type.mealtimeType){
|
if(item.mealtimeType==type.mealtimeType){
|
||||||
|
|
@ -1525,7 +1582,7 @@ export default {
|
||||||
]
|
]
|
||||||
this.openCopyMenu = true
|
this.openCopyMenu = true
|
||||||
},
|
},
|
||||||
//确认复制
|
//确认复制其他日期菜谱
|
||||||
confirmCopyMenu(){
|
confirmCopyMenu(){
|
||||||
this.$modal.confirm('当前日期会被覆盖!确定复制?').then(() => {
|
this.$modal.confirm('当前日期会被覆盖!确定复制?').then(() => {
|
||||||
console.log(this.dialogDetailList)
|
console.log(this.dialogDetailList)
|
||||||
|
|
@ -1574,7 +1631,29 @@ export default {
|
||||||
this.openCopyMenu = false
|
this.openCopyMenu = false
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
|
//确认复制其他日期菜谱-单个餐次
|
||||||
|
confirmCopyMealTypeMenu(item){
|
||||||
|
console.log(item)
|
||||||
|
console.log(this.dialogDetailList)
|
||||||
|
console.log(this.detailList)
|
||||||
|
this.$modal.confirm('当前日期会被覆盖!确定复制?').then(() => {
|
||||||
|
item.dishesList.forEach(sub=>{
|
||||||
|
sub.price = (Number(sub.price)/100).toFixed(2)
|
||||||
|
sub.salePrice = (Number(sub.salePrice)/100).toFixed(2)
|
||||||
|
})
|
||||||
|
let index = this.detailList.findIndex(v=>v.mealtimeType==item.mealtimeType)
|
||||||
|
this.detailList[index].dishesList = item.dishesList;
|
||||||
|
if(this.copyType=='date'){
|
||||||
|
this.dateRangeList[this.dateRangeIndex].detailList = this.detailList;
|
||||||
|
}
|
||||||
|
if(this.copyType=='week'){
|
||||||
|
let index = this.weekDateList.findIndex(v=>v.applyWeek==this.weekId)
|
||||||
|
this.weekDateList[index].detailList = this.detailList;
|
||||||
|
}
|
||||||
|
this.$modal.msgSuccess("复制成功");
|
||||||
|
this.openCopyMenu = false
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
//清空当天菜谱-日期
|
//清空当天菜谱-日期
|
||||||
clearDateMenu(){
|
clearDateMenu(){
|
||||||
this.$modal.confirm('是否确认清空当天菜谱?').then(() => {
|
this.$modal.confirm('是否确认清空当天菜谱?').then(() => {
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-card">
|
<div class="bottom-card">
|
||||||
<el-button type="primary" @click="addDishes(item)" v-if="item.dishesList.length==0">新增</el-button>
|
<el-button type="primary" @click="addDishes(item)" v-if="item.dishesList.length==0">新增</el-button>
|
||||||
<el-button plain type="primary" v-else @click="editDishes(item)" >修改</el-button>
|
<el-button plain type="primary" v-if="item.dishesList.length>0" @click="editDishes(item)">修改</el-button>
|
||||||
|
<el-button plain type="danger" v-if="item.dishesList.length>0" @click="clearDishes(item)">清空</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -166,8 +167,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="dialog-center">
|
<div class="dialog-center">
|
||||||
<div class="dialog-center-header">菜品分类</div>
|
<div class="dialog-center-header">菜品分类</div>
|
||||||
<div v-for="(item,index) in dishesTypeList" :key="index" style="width: 100%;text-align: center;margin: 10px 0;">
|
<div v-for="(item,index) in dishesTypeList" :key="index" style="width: 100%;text-align: center;margin: 10px 0;display: flex;align-items: center;justify-content: center;">
|
||||||
<el-button plain :class="dishesType==item.typeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button>
|
<el-button plain :class="dishesType==item.typeId?'primary':''" style="width: 70%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button>
|
||||||
|
<i class="el-icon-delete" style="color: red;cursor: pointer;margin-left: 10px;font-size: 18px;" @click="clearDishTab(item)"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dialog-right">
|
<div class="dialog-right">
|
||||||
|
|
@ -280,17 +282,22 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;display: flex;">
|
<div style="width: 100%;height: 500px;padding: 10px;border-radius: 10px;margin-bottom: 10px;display: flex;">
|
||||||
<el-card class="dishes-card" v-for="item in dialogDetailList" :key="item.mealtimeType">
|
<div style="width: 20%;height: 100%;margin-right: 10px;" v-for="item in dialogDetailList" :key="item.mealtimeType">
|
||||||
<div slot="header">
|
<el-card style="width: 100%;height: 88%;position: relative;">
|
||||||
<span style="font-weight: 600;">{{item.mealtimeName}}</span>
|
<div slot="header">
|
||||||
</div>
|
<span style="font-weight: 600;">{{item.mealtimeName}}</span>
|
||||||
<div class="body-card">
|
|
||||||
<div v-for="dish in item.dishesList" :key="dish.dishesId" style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
|
|
||||||
<span>{{dish.dishesName}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="body-card">
|
||||||
|
<div v-for="dish in item.dishesList" :key="dish.dishesId" style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
|
||||||
|
<span>{{dish.dishesName}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<div style="width: 100%;height: 12%;display: flex;align-items: center;justify-content: center;">
|
||||||
|
<el-button type="primary" @click="confirmCopyMealTypeMenu(item)">复制餐次</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="confirmCopyMenu">确 定</el-button>
|
<el-button type="primary" @click="confirmCopyMenu">确 定</el-button>
|
||||||
|
|
@ -547,7 +554,7 @@ export default {
|
||||||
//弹窗左侧待选菜品
|
//弹窗左侧待选菜品
|
||||||
dishesPageList:[],
|
dishesPageList:[],
|
||||||
//弹窗中间待选菜品
|
//弹窗中间待选菜品
|
||||||
dishesTypeList:[],
|
dishesTypeList:[{dishesTypeName:"全部",typeId:"-1"}],
|
||||||
dishesType:"",
|
dishesType:"",
|
||||||
//弹窗右侧已选菜品
|
//弹窗右侧已选菜品
|
||||||
dishesTableList:[],
|
dishesTableList:[],
|
||||||
|
|
@ -1034,7 +1041,7 @@ export default {
|
||||||
//新增菜品
|
//新增菜品
|
||||||
addDishes(item){
|
addDishes(item){
|
||||||
this.dishesList=item.dishesList;
|
this.dishesList=item.dishesList;
|
||||||
this.dishesTypeList=[]
|
this.dishesTypeList=[{dishesTypeName:"全部",typeId:"-1"}]
|
||||||
this.dishesTableList=[]
|
this.dishesTableList=[]
|
||||||
this.getDishesPage()
|
this.getDishesPage()
|
||||||
this.openDishes=true
|
this.openDishes=true
|
||||||
|
|
@ -1042,7 +1049,7 @@ export default {
|
||||||
//修改菜品
|
//修改菜品
|
||||||
editDishes(item){
|
editDishes(item){
|
||||||
this.dishesList=item.dishesList;
|
this.dishesList=item.dishesList;
|
||||||
this.dishesTypeList=[]
|
this.dishesTypeList=[{dishesTypeName:"全部",typeId:"-1"}]
|
||||||
this.dishesList.forEach(dish=>{
|
this.dishesList.forEach(dish=>{
|
||||||
let index = this.dishesTypeList.findIndex(v=>v.typeId==dish.typeId)
|
let index = this.dishesTypeList.findIndex(v=>v.typeId==dish.typeId)
|
||||||
if(index==-1){
|
if(index==-1){
|
||||||
|
|
@ -1053,6 +1060,16 @@ export default {
|
||||||
this.getDishesPage()
|
this.getDishesPage()
|
||||||
this.openDishes=true
|
this.openDishes=true
|
||||||
},
|
},
|
||||||
|
//清空
|
||||||
|
clearDishes(item){
|
||||||
|
console.log(item)
|
||||||
|
console.log(this.detailList)
|
||||||
|
this.detailList.forEach(mealType=>{
|
||||||
|
if(mealType.mealtimeType==item.mealtimeType){
|
||||||
|
mealType.dishesList=[]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
//获取左侧待选菜品
|
//获取左侧待选菜品
|
||||||
getDishesPage(){
|
getDishesPage(){
|
||||||
let param = {
|
let param = {
|
||||||
|
|
@ -1112,21 +1129,59 @@ export default {
|
||||||
this.choseDishesType(obj)
|
this.choseDishesType(obj)
|
||||||
},
|
},
|
||||||
//选中菜品类型-更新右侧表格数据
|
//选中菜品类型-更新右侧表格数据
|
||||||
choseDishesType(item){
|
choseDishesType(item){
|
||||||
this.dishesType = item.typeId;
|
this.dishesType = item.typeId;
|
||||||
this.dishesTableList = []
|
this.dishesTableList = []
|
||||||
this.dishesList.forEach(dish=>{
|
if(this.dishesType==-1){
|
||||||
if(dish.typeId==item.typeId){
|
this.dishesList.forEach(dish=>{
|
||||||
this.dishesTableList.push(dish)
|
this.dishesTableList.push(dish)
|
||||||
}
|
})
|
||||||
})
|
}else{
|
||||||
if(this.dishesTableList.length==0){//单个菜品分类中无菜品时,删除该分类
|
this.dishesList.forEach(dish=>{
|
||||||
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
|
if(dish.typeId==item.typeId){
|
||||||
if(typeIndex>-1){
|
this.dishesTableList.push(dish)
|
||||||
this.dishesTypeList.splice(typeIndex,1)
|
}
|
||||||
|
})
|
||||||
|
if(this.dishesTableList.length==0){//单个菜品分类中无菜品时,删除该分类
|
||||||
|
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
|
||||||
|
if(typeIndex>-1){
|
||||||
|
this.dishesTypeList.splice(typeIndex,1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//弹窗中间-清空菜品类别
|
||||||
|
clearDishTab(item){
|
||||||
|
this.$modal.confirm('是否确认清空该类别?').then(()=>{
|
||||||
|
if(item.typeId==-1){
|
||||||
|
for (let i = this.dishesList.length - 1; i >= 0; i--) {
|
||||||
|
this.dishesList.splice(i, 1);
|
||||||
|
}
|
||||||
|
this.dishesType = -1
|
||||||
|
this.dishesTypeList=[{dishesTypeName:"全部",typeId:"-1"}]
|
||||||
|
this.dishesTableList = []
|
||||||
|
this.dishesPageList.forEach(dish=>{
|
||||||
|
dish.isChecked = null;
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
for (let i = this.dishesList.length - 1; i >= 0; i--) {
|
||||||
|
if (this.dishesList[i].typeId == item.typeId) {
|
||||||
|
this.dishesList.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.dishesPageList.forEach(dish=>{
|
||||||
|
if(dish.typeId==item.typeId){
|
||||||
|
dish.isChecked = null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
|
||||||
|
if(typeIndex>-1){
|
||||||
|
this.dishesTypeList.splice(typeIndex,1)
|
||||||
|
}
|
||||||
|
this.choseDishesType(this.dishesTypeList[0])
|
||||||
|
}
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
//弹窗右侧表格删除菜谱
|
//弹窗右侧表格删除菜谱
|
||||||
handleDelDishes(item){
|
handleDelDishes(item){
|
||||||
this.$modal.confirm('是否确认删除?').then(()=>{
|
this.$modal.confirm('是否确认删除?').then(()=>{
|
||||||
|
|
@ -1755,7 +1810,7 @@ export default {
|
||||||
|
|
||||||
this.openCopyMenu = true
|
this.openCopyMenu = true
|
||||||
},
|
},
|
||||||
//确认复制
|
//确认复制其他日期菜谱
|
||||||
confirmCopyMenu(){
|
confirmCopyMenu(){
|
||||||
this.$modal.confirm('当前日期会被覆盖!确定复制?').then(() => {
|
this.$modal.confirm('当前日期会被覆盖!确定复制?').then(() => {
|
||||||
this.detailList=[]
|
this.detailList=[]
|
||||||
|
|
@ -1786,6 +1841,35 @@ export default {
|
||||||
dishesList:[...this.dialogDetailList[4].dishesList]
|
dishesList:[...this.dialogDetailList[4].dishesList]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
this.detailList.forEach(item=>{
|
||||||
|
item.dishesList.forEach(sub=>{
|
||||||
|
sub.price = (Number(sub.price)/100).toFixed(2)
|
||||||
|
sub.salePrice = (Number(sub.salePrice)/100).toFixed(2)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
if(this.copyType=='date'){
|
||||||
|
this.dateRangeList[this.dateRangeIndex].detailList = this.detailList;
|
||||||
|
}
|
||||||
|
if(this.copyType=='week'){
|
||||||
|
let index = this.weekDateList.findIndex(v=>v.applyWeek==this.weekId)
|
||||||
|
this.weekDateList[index].detailList = this.detailList;
|
||||||
|
}
|
||||||
|
this.$modal.msgSuccess("复制成功");
|
||||||
|
this.openCopyMenu = false
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
//确认复制其他日期菜谱-单个餐次
|
||||||
|
confirmCopyMealTypeMenu(item){
|
||||||
|
console.log(item)
|
||||||
|
console.log(this.dialogDetailList)
|
||||||
|
console.log(this.detailList)
|
||||||
|
this.$modal.confirm('当前日期会被覆盖!确定复制?').then(() => {
|
||||||
|
item.dishesList.forEach(sub=>{
|
||||||
|
sub.price = (Number(sub.price)/100).toFixed(2)
|
||||||
|
sub.salePrice = (Number(sub.salePrice)/100).toFixed(2)
|
||||||
|
})
|
||||||
|
let index = this.detailList.findIndex(v=>v.mealtimeType==item.mealtimeType)
|
||||||
|
this.detailList[index].dishesList = item.dishesList;
|
||||||
if(this.copyType=='date'){
|
if(this.copyType=='date'){
|
||||||
this.dateRangeList[this.dateRangeIndex].detailList = this.detailList;
|
this.dateRangeList[this.dateRangeIndex].detailList = this.detailList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue