菜谱管理

This commit is contained in:
zzyuan 2025-05-29 17:41:42 +08:00
parent cb27e520a2
commit 5fd26b998b
6 changed files with 67 additions and 67 deletions

View File

@ -85,7 +85,7 @@ export function addMenuRecipeApi(data) {
//菜谱-编辑 //菜谱-编辑
export function editMenuRecipeApi(data) { export function editMenuRecipeApi(data) {
return request({ return request({
url: '/smart-canteen/cook_recipe', url: '/smart-canteen/cook_recipe/edit',
method: 'post', method: 'post',
headers: { headers: {
"merchant-id":"378915229716713472", "merchant-id":"378915229716713472",

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 仓库 // 仓库
export function drpWareHousePageApi(data) { export function drpWareHousePageApi(data) {
return request({ return request({
url: '/smart-canteen/warehouse_info/list', url: '/smart-canteen/supply_warehouse_info/list',
method: 'get', method: 'get',
headers: { headers: {
"merchant-id":"378915229716713472", "merchant-id":"378915229716713472",

View File

@ -126,19 +126,19 @@
</div> </div>
<div> <div>
<div style="font-weight: bold;margin: 10px 0;">菜品分类</div> <div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
<el-cascader v-model="queryDish.dishesTypeId" <el-cascader v-model="queryDish.typeId"
:options="typeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false" :options="typeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{ :props="{
emitPath: false,// falseid emitPath: false,// falseid
checkStrictly: false,// checkStrictly: false,//
value:'dishesTypeId',label:'dishesTypeName' value:'typeId',label:'dishesTypeName'
}" clearable @change="getDishesPage"> }" clearable @change="getDishesPage">
</el-cascader> </el-cascader>
<!-- <el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage"> <!-- <el-select v-model="queryDish.typeId" style="width: 100%;" clearable @change="getDishesPage">
<el-option v-for="item in typeOptions" <el-option v-for="item in typeOptions"
:key="item.dishesTypeId" :key="item.typeId"
:label="item.dishesTypeName" :label="item.dishesTypeName"
:value="item.dishesTypeId" :value="item.typeId"
></el-option> ></el-option>
</el-select> --> </el-select> -->
</div> </div>
@ -166,7 +166,7 @@
<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;">
<el-button plain :class="dishesType==item.dishesTypeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button> <el-button plain :class="dishesType==item.typeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button>
</div> </div>
</div> </div>
<div class="dialog-right"> <div class="dialog-right">
@ -542,7 +542,7 @@ export default {
// //
queryDish:{ queryDish:{
salesMode:null, salesMode:null,
dishesTypeId:null, typeId:null,
dishesName:'' dishesName:''
}, },
typeOptions:[], typeOptions:[],
@ -843,9 +843,9 @@ export default {
this.dishesList=item.dishesList; this.dishesList=item.dishesList;
this.dishesTypeList=[] this.dishesTypeList=[]
this.dishesList.forEach(dish=>{ this.dishesList.forEach(dish=>{
let index = this.dishesTypeList.findIndex(v=>v.dishesTypeId==dish.dishesTypeId) let index = this.dishesTypeList.findIndex(v=>v.typeId==dish.typeId)
if(index==-1){ if(index==-1){
this.dishesTypeList.push({dishesTypeId:dish.dishesTypeId,dishesTypeName:dish.dishesTypeName}) this.dishesTypeList.push({typeId:dish.typeId,dishesTypeName:dish.dishesTypeName})
} }
}) })
this.choseDishesType(this.dishesTypeList[0]) this.choseDishesType(this.dishesTypeList[0])
@ -859,7 +859,7 @@ export default {
"canteenId":this.baseInfo.canteenId, "canteenId":this.baseInfo.canteenId,
"stallId":this.baseInfo.stallId, "stallId":this.baseInfo.stallId,
"salesMode":this.queryDish.salesMode, "salesMode":this.queryDish.salesMode,
"typeIds":[this.queryDish.dishesTypeId], "typeIds":[this.queryDish.typeId],
"dishesName":this.queryDish.dishesName, "dishesName":this.queryDish.dishesName,
"pageNum":1, "pageNum":1,
"pageSize":100 "pageSize":100
@ -894,9 +894,9 @@ export default {
} }
}) })
// //
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==obj.dishesTypeId) let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==obj.typeId)
if(typeIndex==-1){ if(typeIndex==-1){
this.dishesTypeList.push({dishesTypeId:obj.dishesTypeId,dishesTypeName:obj.dishesTypeName}) this.dishesTypeList.push({typeId:obj.typeId,dishesTypeName:obj.dishesTypeName})
} }
}else{ }else{
this.dishesList.splice(index,1) this.dishesList.splice(index,1)
@ -912,15 +912,15 @@ export default {
}, },
//- //-
choseDishesType(item){ choseDishesType(item){
this.dishesType = item.dishesTypeId; this.dishesType = item.typeId;
this.dishesTableList = [] this.dishesTableList = []
this.dishesList.forEach(dish=>{ this.dishesList.forEach(dish=>{
if(dish.dishesTypeId==item.dishesTypeId){ if(dish.typeId==item.typeId){
this.dishesTableList.push(dish) this.dishesTableList.push(dish)
} }
}) })
if(this.dishesTableList.length==0){// if(this.dishesTableList.length==0){//
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==item.dishesTypeId) let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
if(typeIndex>-1){ if(typeIndex>-1){
this.dishesTypeList.splice(typeIndex,1) this.dishesTypeList.splice(typeIndex,1)
} }
@ -940,7 +940,7 @@ export default {
} }
}) })
if(this.dishesTableList.length==0){// if(this.dishesTableList.length==0){//
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==item.dishesTypeId) let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
if(typeIndex>-1){ if(typeIndex>-1){
this.dishesTypeList.splice(typeIndex,1) this.dishesTypeList.splice(typeIndex,1)
} }

View File

@ -126,19 +126,19 @@
</div> </div>
<div> <div>
<div style="font-weight: bold;margin: 10px 0;">菜品分类</div> <div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
<el-cascader v-model="queryDish.dishesTypeId" <el-cascader v-model="queryDish.typeId"
:options="typeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false" :options="typeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{ :props="{
emitPath: false,// falseid emitPath: false,// falseid
checkStrictly: false,// checkStrictly: false,//
value:'dishesTypeId',label:'dishesTypeName' value:'typeId',label:'dishesTypeName'
}" clearable @change="getDishesPage"> }" clearable @change="getDishesPage">
</el-cascader> </el-cascader>
<!-- <el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage"> <!-- <el-select v-model="queryDish.typeId" style="width: 100%;" clearable @change="getDishesPage">
<el-option v-for="item in typeOptions" <el-option v-for="item in typeOptions"
:key="item.dishesTypeId" :key="item.typeId"
:label="item.dishesTypeName" :label="item.dishesTypeName"
:value="item.dishesTypeId" :value="item.typeId"
></el-option> ></el-option>
</el-select> --> </el-select> -->
</div> </div>
@ -166,7 +166,7 @@
<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;">
<el-button plain :class="dishesType==item.dishesTypeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button> <el-button plain :class="dishesType==item.typeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button>
</div> </div>
</div> </div>
<div class="dialog-right"> <div class="dialog-right">
@ -543,7 +543,7 @@ export default {
// //
queryDish:{ queryDish:{
salesMode:null, salesMode:null,
dishesTypeId:null, typeId:null,
dishesName:'' dishesName:''
}, },
typeOptions:[], typeOptions:[],
@ -707,11 +707,11 @@ export default {
} }
getMenuRecipeDetailApi(param).then((response) => { getMenuRecipeDetailApi(param).then((response) => {
// console.log(response) // console.log(response)
if(response.length>0){ if(response.data.length>0){
for (let i = 0; i < response.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.detailList.forEach(item=>{ this.detailList.forEach(item=>{
if(item.mealtimeType==response[i].mealtimeType){ if(item.mealtimeType==response.data[i].mealtimeType){
item.dishesList = response[i].dishesList; item.dishesList = response.data[i].dishesList;
item.dishesList.forEach(dish=>{ item.dishesList.forEach(dish=>{
this.$set(dish,'price',Number(dish.price/100)) this.$set(dish,'price',Number(dish.price/100))
this.$set(dish,'salePrice',Number(dish.salePrice/100)||0) this.$set(dish,'salePrice',Number(dish.salePrice/100)||0)
@ -730,11 +730,11 @@ export default {
} }
getMenuRecipeTemplateDetailApi(param).then((response) => { getMenuRecipeTemplateDetailApi(param).then((response) => {
// console.log(response) // console.log(response)
if(response.length>0){ if(response.data.length>0){
for (let i = 0; i < response.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.detailList.forEach(item=>{ this.detailList.forEach(item=>{
if(item.mealtimeType==response[i].mealtimeType){ if(item.mealtimeType==response.data[i].mealtimeType){
item.dishesList = response[i].dishesList item.dishesList = response.data[i].dishesList
item.dishesList.forEach(dish=>{ item.dishesList.forEach(dish=>{
this.$set(dish,'price',Number(dish.price/100)) this.$set(dish,'price',Number(dish.price/100))
this.$set(dish,'salePrice',Number(dish.salePrice/100)||0) this.$set(dish,'salePrice',Number(dish.salePrice/100)||0)
@ -753,11 +753,11 @@ export default {
} }
getMenuRecipeTemplateDetailApi(param).then((response) => { getMenuRecipeTemplateDetailApi(param).then((response) => {
// console.log(response) // console.log(response)
if(response.length>0){ if(response.data.length>0){
for (let i = 0; i < response.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.detailList.forEach(item=>{ this.detailList.forEach(item=>{
if(item.mealtimeType==response[i].mealtimeType){ if(item.mealtimeType==response.data[i].mealtimeType){
item.dishesList = response[i].dishesList item.dishesList = response.data[i].dishesList
item.dishesList.forEach(dish=>{ item.dishesList.forEach(dish=>{
this.$set(dish,'price',Number(dish.price/100)) this.$set(dish,'price',Number(dish.price/100))
this.$set(dish,'salePrice',Number(dish.salePrice/100)||0) this.$set(dish,'salePrice',Number(dish.salePrice/100)||0)
@ -1045,9 +1045,9 @@ export default {
this.dishesList=item.dishesList; this.dishesList=item.dishesList;
this.dishesTypeList=[] this.dishesTypeList=[]
this.dishesList.forEach(dish=>{ this.dishesList.forEach(dish=>{
let index = this.dishesTypeList.findIndex(v=>v.dishesTypeId==dish.dishesTypeId) let index = this.dishesTypeList.findIndex(v=>v.typeId==dish.typeId)
if(index==-1){ if(index==-1){
this.dishesTypeList.push({dishesTypeId:dish.dishesTypeId,dishesTypeName:dish.dishesTypeName}) this.dishesTypeList.push({typeId:dish.typeId,dishesTypeName:dish.dishesTypeName})
} }
}) })
this.choseDishesType(this.dishesTypeList[0]) this.choseDishesType(this.dishesTypeList[0])
@ -1061,7 +1061,7 @@ export default {
"canteenId":this.baseInfo.canteenId, "canteenId":this.baseInfo.canteenId,
"stallId":this.baseInfo.stallId, "stallId":this.baseInfo.stallId,
"salesMode":this.queryDish.salesMode, "salesMode":this.queryDish.salesMode,
"typeIds":[this.queryDish.dishesTypeId], "typeIds":[this.queryDish.typeId],
"dishesName":this.queryDish.dishesName, "dishesName":this.queryDish.dishesName,
"pageNum":1, "pageNum":1,
"pageSize":100 "pageSize":100
@ -1096,9 +1096,9 @@ export default {
} }
}) })
// //
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==obj.dishesTypeId) let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==obj.typeId)
if(typeIndex==-1){ if(typeIndex==-1){
this.dishesTypeList.push({dishesTypeId:obj.dishesTypeId,dishesTypeName:obj.dishesTypeName}) this.dishesTypeList.push({typeId:obj.typeId,dishesTypeName:obj.dishesTypeName})
} }
}else{ }else{
this.dishesList.splice(index,1) this.dishesList.splice(index,1)
@ -1114,15 +1114,15 @@ export default {
}, },
//- //-
choseDishesType(item){ choseDishesType(item){
this.dishesType = item.dishesTypeId; this.dishesType = item.typeId;
this.dishesTableList = [] this.dishesTableList = []
this.dishesList.forEach(dish=>{ this.dishesList.forEach(dish=>{
if(dish.dishesTypeId==item.dishesTypeId){ if(dish.typeId==item.typeId){
this.dishesTableList.push(dish) this.dishesTableList.push(dish)
} }
}) })
if(this.dishesTableList.length==0){// if(this.dishesTableList.length==0){//
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==item.dishesTypeId) let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
if(typeIndex>-1){ if(typeIndex>-1){
this.dishesTypeList.splice(typeIndex,1) this.dishesTypeList.splice(typeIndex,1)
} }
@ -1142,7 +1142,7 @@ export default {
} }
}) })
if(this.dishesTableList.length==0){// if(this.dishesTableList.length==0){//
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==item.dishesTypeId) let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
if(typeIndex>-1){ if(typeIndex>-1){
this.dishesTypeList.splice(typeIndex,1) this.dishesTypeList.splice(typeIndex,1)
} }
@ -1412,11 +1412,11 @@ export default {
"recipeId": this.dialogQueryParams.recipeId "recipeId": this.dialogQueryParams.recipeId
} }
getMenuRecipeTemplateDetailApi(param).then((response) => { getMenuRecipeTemplateDetailApi(param).then((response) => {
if(response.length>0){ if(response.data.length>0){
for (let i = 0; i < response.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.dialogDetailList.forEach(item=>{ this.dialogDetailList.forEach(item=>{
if(item.mealtimeType==response[i].mealtimeType){ if(item.mealtimeType==response.data[i].mealtimeType){
item.dishesList = response[i].dishesList; item.dishesList = response.data[i].dishesList;
} }
}) })
} }
@ -1458,11 +1458,11 @@ export default {
"recipeId": this.dialogQueryParams.recipeId "recipeId": this.dialogQueryParams.recipeId
} }
getMenuRecipeTemplateDetailApi(param).then((response) => { getMenuRecipeTemplateDetailApi(param).then((response) => {
if(response.length>0){ if(response.data.length>0){
for (let i = 0; i < response.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.dialogDetailList.forEach(item=>{ this.dialogDetailList.forEach(item=>{
if(item.mealtimeType==response[i].mealtimeType){ if(item.mealtimeType==response.data[i].mealtimeType){
item.dishesList = response[i].dishesList; item.dishesList = response.data[i].dishesList;
} }
}) })
} }
@ -1608,11 +1608,11 @@ export default {
"recipeId": this.dialogQueryParams.recipeId "recipeId": this.dialogQueryParams.recipeId
} }
getMenuRecipeTemplateDetailApi(param).then((response) => { getMenuRecipeTemplateDetailApi(param).then((response) => {
if(response.length>0){ if(response.data.length>0){
for (let i = 0; i < response.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.dialogDetailList.forEach(item=>{ this.dialogDetailList.forEach(item=>{
if(item.mealtimeType==response[i].mealtimeType){ if(item.mealtimeType==response.data[i].mealtimeType){
item.dishesList = response[i].dishesList; item.dishesList = response.data[i].dishesList;
} }
}) })
} }

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="dishesCount" v-if="activeName=='pageRecipe'"/>
<el-table-column label="菜谱生效日期" align="center" prop="applyDateStringList" v-if="activeName=='pageRecipe'"> <el-table-column label="菜谱生效日期" align="center" prop="applyDateStringList" v-if="activeName=='pageRecipe'">
<template slot-scope="scope"> <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;"> <div style="width: 100%;padding: 10px;border-bottom: 1px solid #ccc;margin-bottom: 10px;">
{{currentMonth}} {{currentMonth}}
</div> </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 v-for="(item,index) in monthDaysList" :key="index" :class="scope.row.applyDateStringList.findIndex(v=>v==item)>-1 ? 'dateTable2' : 'dateTable'" class="" >{{item}}</div>
</div> </div>
<div style="color: #1890ff;cursor: pointer;" slot="reference">查看详情</div> <div style="color: #1890ff;cursor: pointer;" slot="reference">查看详情</div>
</el-popover> --> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用户范围" align="center" prop="effName" v-if="activeName=='pageRecipe'"/> <el-table-column label="用户范围" align="center" prop="effName" v-if="activeName=='pageRecipe'"/>

View File

@ -443,13 +443,13 @@
}, },
handleTreeChange(e){ handleTreeChange(e){
console.log(e) console.log(e)
// let param = { let param = {
// areaId:e areaId:e
// } }
// drpWareHousePageApi(param).then(response => { drpWareHousePageApi(param).then(response => {
// this.wareHouseOptions = response.rows this.wareHouseOptions = response.rows
// this.queryParams.warehouseId = null this.queryParams.warehouseId = null
// }); });
}, },
getWareHouse() { getWareHouse() {
drpWareHousePageApi({}).then(response => { drpWareHousePageApi({}).then(response => {