diff --git a/src/api/dish/menu.js b/src/api/dish/menu.js
index b8e7e75e..925b9a3d 100644
--- a/src/api/dish/menu.js
+++ b/src/api/dish/menu.js
@@ -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
+ })
+ }
diff --git a/src/views/dish/menu/index.vue b/src/views/dish/menu/index.vue
index 0efb032e..3bc5e88d 100644
--- a/src/views/dish/menu/index.vue
+++ b/src/views/dish/menu/index.vue
@@ -79,9 +79,24 @@
{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
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();