菜谱管理
This commit is contained in:
parent
b6ecd2233f
commit
7429558ca0
|
|
@ -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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,24 @@
|
||||||
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
|
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -126,6 +141,7 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { mealTimeListApi,menuTypeListApi,systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/dish/menu";
|
import { mealTimeListApi,menuTypeListApi,systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/dish/menu";
|
||||||
|
import { getCurrentRecipeListApi, getPageRecipeListApi } from "@/api/dish/menu";
|
||||||
export default {
|
export default {
|
||||||
name: "",
|
name: "",
|
||||||
dicts: [],
|
dicts: [],
|
||||||
|
|
@ -189,11 +205,19 @@
|
||||||
this.daysList = this.getRecentWeekDates();
|
this.daysList = this.getRecentWeekDates();
|
||||||
this.queryParams.applyDate = this.daysList[0].data;
|
this.queryParams.applyDate = this.daysList[0].data;
|
||||||
this.getAreaTreeData()
|
this.getAreaTreeData()
|
||||||
this.getCurrentList()//获取当前菜谱
|
this.getList()//获取当前菜谱
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleTabClick(tab, event) {
|
handleTabClick(tab, event) {
|
||||||
console.log(tab.name,tab.label)
|
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()
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
//餐次数据
|
//餐次数据
|
||||||
|
|
@ -270,35 +294,50 @@
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList()
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
|
this.queryParams = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
key:"2",
|
||||||
|
applyDate:"",
|
||||||
|
areaIds: [],
|
||||||
|
canteenIds: [],
|
||||||
|
stallIds: [],
|
||||||
|
recipeName:"",
|
||||||
|
}
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 查询当前菜谱列表 */
|
/** 查询当前菜谱列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
this.queryParams.current = this.queryParams.pageNum
|
||||||
|
this.queryParams.size = this.queryParams.pageSize
|
||||||
if(this.activeName=='currentRecipe'){
|
if(this.activeName=='currentRecipe'){
|
||||||
this.queryParams.key="2"
|
getCurrentRecipeListApi(this.queryParams).then(response => {
|
||||||
this.queryParams.applyDate = this.daysList[0].data;
|
this.tableListData = response.data.records;
|
||||||
|
this.total = Number(response.data.total);
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
}else if(this.activeName=='pageRecipe'){
|
}else if(this.activeName=='pageRecipe'){
|
||||||
this.queryParams.key=undefined
|
getPageRecipeListApi(this.queryParams).then(response => {
|
||||||
this.queryParams.applyDate=undefined
|
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() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue