菜谱管理

This commit is contained in:
zzyuan 2025-05-29 14:17:16 +08:00
parent ef744252b9
commit c4c987a8b9
3 changed files with 54 additions and 38 deletions

View File

@ -126,13 +126,21 @@
</div>
<div>
<div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
<el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
<el-cascader v-model="queryDish.dishesTypeId"
:options="typeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'dishesTypeId',label:'dishesTypeName'
}" clearable @change="getDishesPage">
</el-cascader>
<!-- <el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
<el-option v-for="item in typeOptions"
:key="item.dishesTypeId"
:label="item.dishesTypeName"
:value="item.dishesTypeId"
></el-option>
</el-select>
</el-select> -->
</div>
<div>
<div style="font-weight: bold;margin: 10px 0;">菜品名称</div>
@ -182,9 +190,9 @@
<el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/>
</template>
</el-table-column>
<el-table-column label="最大供应量" align="center" prop="remanentNum">
<el-table-column label="最大供应量" align="center" prop="supplyNum">
<template slot-scope="scope">
<el-input v-model="scope.row.remanentNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.remanentNum=v.replace(/[^\d]/g,''))"/>
<el-input v-model="scope.row.supplyNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.supplyNum=v.replace(/[^\d]/g,''))"/>
</template>
</el-table-column>
<el-table-column label="每人限购数" align="center" prop="limitNum">
@ -851,7 +859,7 @@ export default {
"canteenId":this.baseInfo.canteenId,
"stallId":this.baseInfo.stallId,
"salesMode":this.queryDish.salesMode,
"dishesTypeId":this.queryDish.dishesTypeId,
"typeIds":[this.queryDish.dishesTypeId],
"dishesName":this.queryDish.dishesName,
"pageNum":1,
"pageSize":100
@ -876,7 +884,7 @@ export default {
let dish = Object.assign({}, obj)
this.$set(dish,'salePrice',Number(dish.price/100)||Number(dish.price/100))
this.$set(dish,'price',Number(dish.price/100))
this.$set(dish,'remanentNum',dish.remanentNum||99999)
this.$set(dish,'supplyNum',dish.supplyNum||99999)
this.$set(dish,'limitNum',dish.limitNum||99999)
this.dishesList.push(dish)
//
@ -1095,7 +1103,7 @@ export default {
stallId:this.dialogQueryParams.stallId,
}
getPageRecipeListApi(param).then((response) => {
this.recipeOptions = response.data||[]
this.recipeOptions = response.rows||[]
this.dialogQueryParams.recipeId = null
this.dialogQueryParams.recipeType = null;
this.dialogQueryParams.applyDate = null;
@ -1200,11 +1208,11 @@ export default {
"recipeId": this.dialogQueryParams.recipeId
}
getMenuRecipeTemplateDetailApi(param).then((response) => {
if(response.length>0){
for (let i = 0; i < response.length; i++) {
if(response.data.length>0){
for (let i = 0; i < response.data.length; i++) {
this.dialogDetailList.forEach(item=>{
if(item.mealtimeType==response[i].mealtimeType){
item.dishesList = response[i].dishesList;
if(item.mealtimeType==response.data[i].mealtimeType){
item.dishesList = response.data[i].dishesList;
}
})
}
@ -1246,11 +1254,11 @@ export default {
"recipeId": this.dialogQueryParams.recipeId
}
getMenuRecipeTemplateDetailApi(param).then((response) => {
if(response.length>0){
for (let i = 0; i < response.length; i++) {
if(response.data.length>0){
for (let i = 0; i < response.data.length; i++) {
this.dialogDetailList.forEach(item=>{
if(item.mealtimeType==response[i].mealtimeType){
item.dishesList = response[i].dishesList;
if(item.mealtimeType==response.data[i].mealtimeType){
item.dishesList = response.data[i].dishesList;
}
})
}

View File

@ -126,13 +126,21 @@
</div>
<div>
<div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
<el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
<el-cascader v-model="queryDish.dishesTypeId"
:options="typeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'dishesTypeId',label:'dishesTypeName'
}" clearable @change="getDishesPage">
</el-cascader>
<!-- <el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
<el-option v-for="item in typeOptions"
:key="item.dishesTypeId"
:label="item.dishesTypeName"
:value="item.dishesTypeId"
></el-option>
</el-select>
</el-select> -->
</div>
<div>
<div style="font-weight: bold;margin: 10px 0;">菜品名称</div>
@ -183,9 +191,9 @@
<el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/>
</template>
</el-table-column>
<el-table-column label="最大供应量" align="center" prop="remanentNum">
<el-table-column label="最大供应量" align="center" prop="supplyNum">
<template slot-scope="scope">
<el-input v-model="scope.row.remanentNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.remanentNum=v.replace(/[^\d]/g,''))"/>
<el-input v-model="scope.row.supplyNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.supplyNum=v.replace(/[^\d]/g,''))"/>
</template>
</el-table-column>
<el-table-column label="每人限购数" align="center" prop="limitNum">
@ -1054,7 +1062,7 @@ export default {
"canteenId":this.baseInfo.canteenId,
"stallId":this.baseInfo.stallId,
"salesMode":this.queryDish.salesMode,
"dishesTypeId":this.queryDish.dishesTypeId,
"typeIds":[this.queryDish.dishesTypeId],
"dishesName":this.queryDish.dishesName,
"pageNum":1,
"pageSize":100
@ -1079,7 +1087,7 @@ export default {
let dish = Object.assign({}, obj)
this.$set(dish,'salePrice',Number(dish.price/100)||Number(dish.price/100))
this.$set(dish,'price',Number(dish.price/100))
this.$set(dish,'remanentNum',dish.remanentNum||99999)
this.$set(dish,'supplyNum',dish.supplyNum||99999)
this.$set(dish,'limitNum',dish.limitNum||99999)
this.dishesList.push(dish)
//
@ -1300,7 +1308,7 @@ export default {
stallId:this.dialogQueryParams.stallId,
}
getPageRecipeListApi(param).then((response) => {
this.recipeOptions = response.data||[]
this.recipeOptions = response.rows||[]
this.dialogQueryParams.recipeId = null
this.dialogQueryParams.recipeType = null;
this.dialogQueryParams.applyDate = null;

View File

@ -146,7 +146,7 @@
<el-table-column label="菜品数量" align="center" prop="dishesCount" v-if="activeName=='pageRecipe'"/>
<el-table-column label="菜谱生效日期" align="center" prop="applyDateStringList" v-if="activeName=='pageRecipe'">
<template slot-scope="scope">
<el-popover placement="top" width="400">
<!-- <el-popover placement="top" width="400">
<div style="width: 100%;padding: 10px;border-bottom: 1px solid #ccc;margin-bottom: 10px;">
{{currentMonth}}
</div>
@ -157,7 +157,7 @@
<div v-for="(item,index) in monthDaysList" :key="index" :class="scope.row.applyDateStringList.findIndex(v=>v==item)>-1 ? 'dateTable2' : 'dateTable'" class="" >{{item}}</div>
</div>
<div style="color: #1890ff;cursor: pointer;" slot="reference">查看详情</div>
</el-popover>
</el-popover> -->
</template>
</el-table-column>
<el-table-column label="用户范围" align="center" prop="effName" v-if="activeName=='pageRecipe'"/>
@ -516,14 +516,14 @@
this.queryParams.pageNum = this.queryParams.pageNum
this.queryParams.pageSize = this.queryParams.pageSize
if(this.activeName=='currentRecipe'){
getCurrentRecipeListApi(this.queryParams).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
// getCurrentRecipeListApi(this.queryParams).then(response => {
// this.tableListData = response.rows;
// this.total = Number(response.total);
// this.loading = false;
// });
}else if(this.activeName=='pageRecipe'){
getPageRecipeListApi(this.queryParams).then(response => {
this.tableListData = response.data;
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
@ -537,14 +537,14 @@
},
/** 修改按钮操作 */
handleUpdate(row) {
let param = {
recipeId:row.recipeId
}
getPageRecipeListApi(param).then(response => {
let obj = response.data[0]
// let param = {
// recipeId:row.recipeId
// }
// getPageRecipeListApi(param).then(response => {
// let obj = response.rows[0]
this.$router.push({ path: "/dish/menuEdit",query: {pageJson:JSON.stringify(obj)} });
});
this.$router.push({ path: "/dish/menuEdit",query: {pageJson:JSON.stringify(row)} });
// });
},
/** 查看设备 */
handleDevice(row) {
@ -592,7 +592,7 @@
}
getPageRecipeListApi(param).then(response => {
// console.log(response.records)
this.recipeOptionsData = response.data
this.recipeOptionsData = response.rows
this.resetForm("menuForm");
this.openMenu=true
});