菜谱管理

This commit is contained in:
zzyuan 2025-03-12 16:29:16 +08:00
parent b6ecd2233f
commit 7429558ca0
2 changed files with 82 additions and 23 deletions

View File

@ -56,8 +56,28 @@ export function getStallByCanteenApi(data) {
})
}
// 获取当前菜谱
export function getCurrentRecipeListApi(data) {
return request({
url: '/smart-canteen/api/v2/menurecipe/query/current/recipe',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 获取所有菜谱-分页
export function getPageRecipeListApi(data) {
return request({
url: '/smart-canteen/api/v2/menurecipe/page',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}

View File

@ -79,9 +79,24 @@
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="区域名称" align="center" prop="areaName" />
<el-table-column label="食堂名称" align="center" prop="canteenName" />
<el-table-column label="档口名称" align="center" prop="stallName" />
<el-table-column label="菜谱名称" align="center" prop="recipeName" />
<el-table-column v-for="item in mealTimeList" :key="item.mealtimeType" :label="item.mealtimeName" align="center">
<template slot-scope="scope">
<!-- <div v-for="subItem in scope.row.detail.details" :key="subItem.detailId">
<div v-if="subItem.mealtimeType==item.mealtimeType">
<span v-for="lastItem in subItem.dishesList" :key="lastItem.dishesId">{{ lastItem.typeName }}</span>
</div>
</div> -->
</template>
</el-table-column>
<el-table-column label="菜谱更新时间" align="center" prop="uptime" />
<el-table-column label="创建时间" align="center" prop="crtime" />
<el-table-column label="更新时间" align="center" prop="uptime"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -126,6 +141,7 @@
<script>
import { mealTimeListApi,menuTypeListApi,systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/dish/menu";
import { getCurrentRecipeListApi, getPageRecipeListApi } from "@/api/dish/menu";
export default {
name: "",
dicts: [],
@ -189,11 +205,19 @@
this.daysList = this.getRecentWeekDates();
this.queryParams.applyDate = this.daysList[0].data;
this.getAreaTreeData()
this.getCurrentList()//
this.getList()//
},
methods: {
handleTabClick(tab, event) {
console.log(tab.name,tab.label)
if(this.activeName=='currentRecipe'){
this.queryParams.key="2"
this.queryParams.applyDate = this.daysList[0].data;
}else if(this.activeName=='pageRecipe'){
this.queryParams.key=undefined
this.queryParams.applyDate=undefined
}
this.handleQuery()
},
//
@ -270,35 +294,50 @@
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
key:"2",
applyDate:"",
areaIds: [],
canteenIds: [],
stallIds: [],
recipeName:"",
}
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询当前菜谱列表 */
getList() {
this.loading = true;
this.loading = true;
this.queryParams.current = this.queryParams.pageNum
this.queryParams.size = this.queryParams.pageSize
if(this.activeName=='currentRecipe'){
this.queryParams.key="2"
this.queryParams.applyDate = this.daysList[0].data;
getCurrentRecipeListApi(this.queryParams).then(response => {
this.tableListData = response.data.records;
this.total = Number(response.data.total);
this.loading = false;
});
}else if(this.activeName=='pageRecipe'){
this.queryParams.key=undefined
this.queryParams.applyDate=undefined
getPageRecipeListApi(this.queryParams).then(response => {
this.tableListData = response.records;
this.total = Number(response.total);
this.loading = false;
});
}
// let param = {
// "page":{"current":this.queryParams.pageNum,"size":this.queryParams.pageSize},
// "object":{
// }
// }
// getMenuDishesSuitListApi({"content":JSON.stringify(param)}).then(response => {
// this.tableListData = response.data.records;
// this.total = Number(response.data.total);
// this.loading = false;
// });
},
},
/** 新增按钮操作 */
handleAdd() {
this.reset();