commit
df485e55d0
@ -2,9 +2,9 @@ package com.stdiet.web.controller.custom;
|
|||||||
|
|
||||||
import com.stdiet.common.core.controller.BaseController;
|
import com.stdiet.common.core.controller.BaseController;
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
import com.stdiet.custom.service.ISysRecipesPlanService;
|
|
||||||
import com.stdiet.custom.service.ISysRecipesService;
|
import com.stdiet.custom.service.ISysRecipesService;
|
||||||
import com.stdiet.custom.service.ISysWapServices;
|
import com.stdiet.custom.service.ISysWapServices;
|
||||||
|
import com.stdiet.system.service.ISysDictTypeService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@ -20,8 +20,12 @@ public class SysWapController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ISysRecipesService iSysRecipesService;
|
ISysRecipesService iSysRecipesService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ISysDictTypeService iSysDictTypeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户食谱详情
|
* 客户食谱详情
|
||||||
|
*
|
||||||
* @param outId
|
* @param outId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -39,4 +43,9 @@ public class SysWapController extends BaseController {
|
|||||||
public AjaxResult dayilyMenu(@PathVariable Long id) {
|
public AjaxResult dayilyMenu(@PathVariable Long id) {
|
||||||
return AjaxResult.success(iSysRecipesService.selectDishesByMenuId(id));
|
return AjaxResult.success(iSysRecipesService.selectDishesByMenuId(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/dict/{dictType}")
|
||||||
|
public AjaxResult sysDict(@PathVariable String dictType) {
|
||||||
|
return AjaxResult.success(iSysDictTypeService.selectDictDataByType(dictType));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,3 +29,13 @@ export function getRecipesMenuInfoApi(id) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getDicts(id) {
|
||||||
|
return request({
|
||||||
|
url: "/wap/dict/" + id,
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
isToken: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -21,10 +21,7 @@ export function getData(dictCode) {
|
|||||||
export function getDicts(dictType) {
|
export function getDicts(dictType) {
|
||||||
return request({
|
return request({
|
||||||
url: "/system/dict/data/type/" + dictType,
|
url: "/system/dict/data/type/" + dictType,
|
||||||
method: "get",
|
method: "get"
|
||||||
headers: {
|
|
||||||
isToken: false
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,9 +29,11 @@ service.interceptors.request.use(config => {
|
|||||||
service.interceptors.response.use(res => {
|
service.interceptors.response.use(res => {
|
||||||
// 未设置状态码则默认成功状态
|
// 未设置状态码则默认成功状态
|
||||||
const code = res.data.code || 200;
|
const code = res.data.code || 200;
|
||||||
|
console.log(res)
|
||||||
// 获取错误信息
|
// 获取错误信息
|
||||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||||
if (code === 401) {
|
if (code === 401) {
|
||||||
|
console.log(code)
|
||||||
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
|
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
|
||||||
confirmButtonText: '重新登录',
|
confirmButtonText: '重新登录',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import NutriComputeCom from "./NutriComputeCom";
|
import NutriComputeCom from "./NutriComputeCom";
|
||||||
import DishesDetailDialog from "./DishesDetailDialog";
|
import DishesDetailDialog from "./DishesDetailDialog";
|
||||||
|
import { getDicts } from "@/api/custom/recipesShow";
|
||||||
export default {
|
export default {
|
||||||
name: "menuDetail",
|
name: "menuDetail",
|
||||||
props: ["value", "date"],
|
props: ["value", "date"],
|
||||||
@ -38,19 +39,19 @@ export default {
|
|||||||
DishesDetailDialog,
|
DishesDetailDialog,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getDicts("cus_cus_unit").then((response) => {
|
getDicts("cus_cus_unit").then((response) => {
|
||||||
this.curUnitDict = response.data.reduce((obj, cur) => {
|
this.curUnitDict = response.data.reduce((obj, cur) => {
|
||||||
obj[cur.dictValue] = cur.dictLabel;
|
obj[cur.dictValue] = cur.dictLabel;
|
||||||
return obj;
|
return obj;
|
||||||
}, {});
|
}, {});
|
||||||
});
|
});
|
||||||
this.getDicts("cus_cus_weight").then((response) => {
|
getDicts("cus_cus_weight").then((response) => {
|
||||||
this.cusWeightDict = response.data.reduce((obj, cur) => {
|
this.cusWeightDict = response.data.reduce((obj, cur) => {
|
||||||
obj[cur.dictValue] = cur.dictLabel;
|
obj[cur.dictValue] = cur.dictLabel;
|
||||||
return obj;
|
return obj;
|
||||||
}, {});
|
}, {});
|
||||||
});
|
});
|
||||||
this.getDicts("cus_dishes_type").then((response) => {
|
getDicts("cus_dishes_type").then((response) => {
|
||||||
this.menuTypeDict = response.data.reduce((obj, cur) => {
|
this.menuTypeDict = response.data.reduce((obj, cur) => {
|
||||||
obj[cur.dictValue] = cur.dictLabel;
|
obj[cur.dictValue] = cur.dictLabel;
|
||||||
return obj;
|
return obj;
|
||||||
@ -91,7 +92,7 @@ export default {
|
|||||||
typeName: this.menuTypeDict[type],
|
typeName: this.menuTypeDict[type],
|
||||||
values: mData[type],
|
values: mData[type],
|
||||||
}));
|
}));
|
||||||
console.log(mMenus);
|
// console.log(mMenus);
|
||||||
return mMenus;
|
return mMenus;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -123,7 +123,7 @@ export default {
|
|||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.menuData = getProcessMenuData(response.data);
|
this.menuData = getProcessMenuData(response.data);
|
||||||
console.log(this.menuData);
|
// console.log(this.menuData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user