完成忌口检查
This commit is contained in:
parent
5167828ff8
commit
f02235936c
@ -36,7 +36,10 @@ const oriState = {
|
|||||||
fontSize: parseInt(localStorage.getItem("fontSize")) || 12,
|
fontSize: parseInt(localStorage.getItem("fontSize")) || 12,
|
||||||
dishBigClassOptions: [],
|
dishBigClassOptions: [],
|
||||||
dishSmallClassOptions: [],
|
dishSmallClassOptions: [],
|
||||||
leftShow: false
|
//
|
||||||
|
leftShow: false,
|
||||||
|
notRecIgds: [],
|
||||||
|
igdTypeOptions: []
|
||||||
};
|
};
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@ -64,7 +67,7 @@ const mutations = {
|
|||||||
payload.cusWeight && (tarIgd.cusWeight = payload.cusWeight);
|
payload.cusWeight && (tarIgd.cusWeight = payload.cusWeight);
|
||||||
payload.cusUnit && (tarIgd.cusUnit = payload.cusUnit);
|
payload.cusUnit && (tarIgd.cusUnit = payload.cusUnit);
|
||||||
}
|
}
|
||||||
console.log(JSON.parse(JSON.stringify(state.recipesData)));
|
// console.log(JSON.parse(JSON.stringify(state.recipesData)));
|
||||||
} else if (actionType === "delIgd") {
|
} else if (actionType === "delIgd") {
|
||||||
tarDishes.igdList = tarDishes.igdList.filter(
|
tarDishes.igdList = tarDishes.igdList.filter(
|
||||||
igd => igd.id !== payload.igdId
|
igd => igd.id !== payload.igdId
|
||||||
@ -103,6 +106,9 @@ const mutations = {
|
|||||||
toggleLeftShow(state, payload) {
|
toggleLeftShow(state, payload) {
|
||||||
state.leftShow = !state.leftShow;
|
state.leftShow = !state.leftShow;
|
||||||
},
|
},
|
||||||
|
setNotRecIgds(state, payload) {
|
||||||
|
state.notRecIgds = payload.data;
|
||||||
|
},
|
||||||
setDate(state, payload) {
|
setDate(state, payload) {
|
||||||
state.startDate = payload.startDate;
|
state.startDate = payload.startDate;
|
||||||
state.endDate = payload.endDate;
|
state.endDate = payload.endDate;
|
||||||
@ -152,6 +158,9 @@ const actions = {
|
|||||||
getDicts("dish_class_small").then(response => {
|
getDicts("dish_class_small").then(response => {
|
||||||
commit("updateStateData", { dishSmallClassOptions: response.data });
|
commit("updateStateData", { dishSmallClassOptions: response.data });
|
||||||
});
|
});
|
||||||
|
getDicts("cus_ing_type").then(response => {
|
||||||
|
commit("updateStateData", { igdTypeOptions: response.data });
|
||||||
|
});
|
||||||
|
|
||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
// 健康数据
|
// 健康数据
|
||||||
@ -559,6 +568,19 @@ const getters = {
|
|||||||
});
|
});
|
||||||
return arr;
|
return arr;
|
||||||
}, []),
|
}, []),
|
||||||
|
igdTypeDetial: state =>
|
||||||
|
state.recipesData.reduce((obj, cur) => {
|
||||||
|
cur.dishes.forEach(dObj => {
|
||||||
|
dObj.igdList.forEach(iObj => {
|
||||||
|
if (!obj[iObj.type]) {
|
||||||
|
obj[iObj.type] = [{ name: iObj.name, id: iObj.id }];
|
||||||
|
} else if (!obj[iObj.type].some(tObj => tObj.id === iObj.id)) {
|
||||||
|
obj[iObj.type].push({ name: iObj.name, id: iObj.id });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return obj;
|
||||||
|
}, {}),
|
||||||
cusUnitDict: state =>
|
cusUnitDict: state =>
|
||||||
state.cusUnitOptions.reduce((obj, cur) => {
|
state.cusUnitOptions.reduce((obj, cur) => {
|
||||||
obj[cur.dictValue] = cur.dictLabel;
|
obj[cur.dictValue] = cur.dictLabel;
|
||||||
@ -583,6 +605,11 @@ const getters = {
|
|||||||
state.dishSmallClassOptions.reduce((obj, cur) => {
|
state.dishSmallClassOptions.reduce((obj, cur) => {
|
||||||
obj[cur.dictValue] = cur.dictLabel;
|
obj[cur.dictValue] = cur.dictLabel;
|
||||||
return obj;
|
return obj;
|
||||||
|
}, {}),
|
||||||
|
igdTypeDict: state =>
|
||||||
|
state.igdTypeOptions.reduce((obj, cur) => {
|
||||||
|
obj[cur.dictValue] = cur.dictLabel;
|
||||||
|
return obj;
|
||||||
}, {})
|
}, {})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -598,6 +598,11 @@ export function dealHealthy(customerHealthy) {
|
|||||||
? `,${customerHealthy.otherMotionField}`
|
? `,${customerHealthy.otherMotionField}`
|
||||||
: "";
|
: "";
|
||||||
}
|
}
|
||||||
|
if (customerHealthy.hasOwnProperty("otherOperationHistory")) {
|
||||||
|
customerHealthy.operationHistory += customerHealthy.otherOperationHistory
|
||||||
|
? `,${customerHealthy.otherOperationHistory}`
|
||||||
|
: "";
|
||||||
|
}
|
||||||
if (customerHealthy.hasOwnProperty("defecationNum")) {
|
if (customerHealthy.hasOwnProperty("defecationNum")) {
|
||||||
customerHealthy.defecationNum += "次/天";
|
customerHealthy.defecationNum += "次/天";
|
||||||
}
|
}
|
||||||
|
@ -12,12 +12,13 @@
|
|||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
placeholder="请输入菜品名称"
|
placeholder="请输入菜品名称"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="mini"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="菜品种类" prop="dishClass">
|
<el-form-item label="菜品种类" prop="dishClass">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
|
size="mini"
|
||||||
v-model="dishClassQueryParam"
|
v-model="dishClassQueryParam"
|
||||||
:options="dishClassOptions"
|
:options="dishClassOptions"
|
||||||
:props="{ expandTrigger: 'hover' }"
|
:props="{ expandTrigger: 'hover' }"
|
||||||
@ -32,7 +33,7 @@
|
|||||||
v-model="queryParams.type"
|
v-model="queryParams.type"
|
||||||
placeholder="请选择菜品类型"
|
placeholder="请选择菜品类型"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="mini"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in typeOptions"
|
v-for="dict in typeOptions"
|
||||||
@ -113,9 +114,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="菜品名称" align="center" prop="name" />
|
<el-table-column label="菜品名称" align="center" prop="name" />
|
||||||
<el-table-column label="菜品种类" align="center" prop="bigClass" >
|
<el-table-column label="菜品种类" align="center" prop="bigClass">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{dishClassFormat(scope.row)}}
|
{{ dishClassFormat(scope.row) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="菜品类型" align="center" prop="type">
|
<el-table-column label="菜品类型" align="center" prop="type">
|
||||||
@ -199,7 +200,7 @@
|
|||||||
:options="dishClassOptions"
|
:options="dishClassOptions"
|
||||||
:props="{ expandTrigger: 'hover' }"
|
:props="{ expandTrigger: 'hover' }"
|
||||||
placeholder="请选择菜品种类"
|
placeholder="请选择菜品种类"
|
||||||
></el-cascader>
|
></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
@ -464,8 +465,8 @@ export default {
|
|||||||
//
|
//
|
||||||
cusWeightOptions: [],
|
cusWeightOptions: [],
|
||||||
dishClassOptions: [],
|
dishClassOptions: [],
|
||||||
dishClassBigOptions:[],
|
dishClassBigOptions: [],
|
||||||
dishClassSmallOptions:[],
|
dishClassSmallOptions: [],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -473,14 +474,14 @@ export default {
|
|||||||
name: null,
|
name: null,
|
||||||
type: null,
|
type: null,
|
||||||
bigClass: null,
|
bigClass: null,
|
||||||
smallClass: null
|
smallClass: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {},
|
||||||
//菜品种类查询种类
|
//菜品种类查询种类
|
||||||
dishClassQueryParam:[]
|
dishClassQueryParam: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -512,9 +513,12 @@ export default {
|
|||||||
/** 查询菜品列表 */
|
/** 查询菜品列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
if(this.dishClassQueryParam != null && this.dishClassQueryParam.length > 0){
|
if (
|
||||||
|
this.dishClassQueryParam != null &&
|
||||||
|
this.dishClassQueryParam.length > 0
|
||||||
|
) {
|
||||||
this.queryParams.smallClass = this.dishClassQueryParam[1];
|
this.queryParams.smallClass = this.dishClassQueryParam[1];
|
||||||
}else{
|
} else {
|
||||||
this.queryParams.smallClass = null;
|
this.queryParams.smallClass = null;
|
||||||
}
|
}
|
||||||
listDishes(this.queryParams).then((response) => {
|
listDishes(this.queryParams).then((response) => {
|
||||||
@ -549,23 +553,25 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
//处理菜品大类小类的关系
|
//处理菜品大类小类的关系
|
||||||
dealDishClassBigAndSmall(){
|
dealDishClassBigAndSmall() {
|
||||||
this.dishClassBigOptions.forEach((item, index) => {
|
this.dishClassBigOptions.forEach((item, index) => {
|
||||||
this.dishClassOptions.push({
|
this.dishClassOptions.push({
|
||||||
'value': parseInt(item.dictValue),
|
value: parseInt(item.dictValue),
|
||||||
'label': item.dictLabel,
|
label: item.dictLabel,
|
||||||
'children': []
|
children: [],
|
||||||
|
});
|
||||||
|
if (index == this.dishClassBigOptions.length - 1) {
|
||||||
|
this.dishClassSmallOptions.forEach((smallClass, i) => {
|
||||||
|
if (smallClass.remark) {
|
||||||
|
this.dishClassOptions[
|
||||||
|
parseInt(smallClass.remark - 1)
|
||||||
|
].children.push({
|
||||||
|
value: parseInt(smallClass.dictValue),
|
||||||
|
label: smallClass.dictLabel,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if(index == this.dishClassBigOptions.length - 1){
|
}
|
||||||
this.dishClassSmallOptions.forEach((smallClass, i) => {
|
|
||||||
if(smallClass.remark){
|
|
||||||
this.dishClassOptions[parseInt(smallClass.remark-1)].children.push({
|
|
||||||
'value': parseInt(smallClass.dictValue),
|
|
||||||
'label': smallClass.dictLabel
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 菜品类型字典翻译
|
// 菜品类型字典翻译
|
||||||
@ -587,13 +593,19 @@ export default {
|
|||||||
return this.selectDictLabel(this.reviewStatusOptions, row.area);
|
return this.selectDictLabel(this.reviewStatusOptions, row.area);
|
||||||
},
|
},
|
||||||
//菜品种类翻译
|
//菜品种类翻译
|
||||||
dishClassFormat(row){
|
dishClassFormat(row) {
|
||||||
if(row.bigClass > 0 && row.smallClass > 0){
|
if (row.bigClass > 0 && row.smallClass > 0) {
|
||||||
let bigClassName = this.selectDictLabel(this.dishClassBigOptions, row.bigClass);
|
let bigClassName = this.selectDictLabel(
|
||||||
let smallClassName = this.selectDictLabel(this.dishClassSmallOptions, row.smallClass);
|
this.dishClassBigOptions,
|
||||||
return bigClassName+"/"+smallClassName;
|
row.bigClass
|
||||||
}
|
);
|
||||||
return "";
|
let smallClassName = this.selectDictLabel(
|
||||||
|
this.dishClassSmallOptions,
|
||||||
|
row.smallClass
|
||||||
|
);
|
||||||
|
return bigClassName + "/" + smallClassName;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
@ -606,7 +618,7 @@ export default {
|
|||||||
id: null,
|
id: null,
|
||||||
name: null,
|
name: null,
|
||||||
type: [],
|
type: [],
|
||||||
dishClass:[],
|
dishClass: [],
|
||||||
methods: null,
|
methods: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
@ -834,7 +846,7 @@ export default {
|
|||||||
(arr, cur, idx) => {
|
(arr, cur, idx) => {
|
||||||
if (idx > 1) {
|
if (idx > 1) {
|
||||||
if (idx === 6) {
|
if (idx === 6) {
|
||||||
arr[6] = arr[3] * 4 + arr[4] * 9 + arr[5] * 4 + ' kcal';
|
arr[6] = arr[3] * 4 + arr[4] * 9 + arr[5] * 4 + " kcal";
|
||||||
} else {
|
} else {
|
||||||
arr[idx] = data.reduce((acc, dAcc) => {
|
arr[idx] = data.reduce((acc, dAcc) => {
|
||||||
if (idx === 2) {
|
if (idx === 2) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form>
|
<el-form @submit.native.prevent>
|
||||||
<el-form-item label="菜品名">
|
<el-form-item label="菜品名">
|
||||||
<span style="color: #262626; font-size: 16px; font-weight: bold">{{
|
<span style="color: #262626; font-size: 16px; font-weight: bold">{{
|
||||||
name
|
name
|
||||||
|
@ -1,60 +1,71 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form
|
<el-row :gutter="15">
|
||||||
:model="queryParams"
|
<el-form
|
||||||
ref="queryForm"
|
:model="queryParams"
|
||||||
:inline="true"
|
ref="queryForm"
|
||||||
label-width="68px"
|
:inline="true"
|
||||||
>
|
label-width="68px"
|
||||||
<el-form-item label="菜品名称" prop="name">
|
@submit.native.prevent
|
||||||
<el-input
|
>
|
||||||
v-model="queryParams.name"
|
<el-col :span="6">
|
||||||
placeholder="请输入菜品名称"
|
<el-form-item label="菜品名称" prop="name">
|
||||||
clearable
|
<el-input
|
||||||
size="mini"
|
v-model="queryParams.name"
|
||||||
@keyup.enter.native="handleQuery"
|
placeholder="请输入菜品名称"
|
||||||
/>
|
clearable
|
||||||
</el-form-item>
|
size="mini"
|
||||||
<el-form-item label="菜品种类" prop="dishClass">
|
@keyup.enter.native="handleQuery"
|
||||||
<el-cascader
|
/>
|
||||||
filterable
|
</el-form-item>
|
||||||
clearable
|
</el-col>
|
||||||
v-model="dishClassQueryParam"
|
<el-col :span="6">
|
||||||
:options="dishClassOptions"
|
<el-form-item label="菜品种类" prop="dishClass">
|
||||||
:props="{ expandTrigger: 'hover' }"
|
<el-cascader
|
||||||
:show-all-levels="true"
|
filterable
|
||||||
placeholder="请选择菜品种类"
|
clearable
|
||||||
></el-cascader>
|
size="mini"
|
||||||
</el-form-item>
|
v-model="dishClassQueryParam"
|
||||||
<el-form-item label="菜品类型" prop="type">
|
:options="dishClassOptions"
|
||||||
<el-select
|
:props="{ expandTrigger: 'hover' }"
|
||||||
:disabled="lockType"
|
:show-all-levels="true"
|
||||||
v-model="queryParams.type"
|
placeholder="请选择菜品种类"
|
||||||
placeholder="请选择菜品类型"
|
></el-cascader>
|
||||||
clearable
|
</el-form-item>
|
||||||
size="mini"
|
</el-col>
|
||||||
>
|
<el-col :span="6">
|
||||||
<el-option
|
<el-form-item label="菜品类型" prop="type">
|
||||||
v-for="dict in typeOptions"
|
<el-select
|
||||||
:key="dict.dictValue"
|
:disabled="lockType"
|
||||||
:label="dict.dictLabel"
|
v-model="queryParams.type"
|
||||||
:value="dict.dictValue"
|
placeholder="请选择菜品类型"
|
||||||
/>
|
clearable
|
||||||
</el-select>
|
size="mini"
|
||||||
</el-form-item>
|
width="120px"
|
||||||
<el-form-item>
|
>
|
||||||
<el-button
|
<el-option
|
||||||
type="cyan"
|
v-for="dict in typeOptions"
|
||||||
icon="el-icon-search"
|
:key="dict.dictValue"
|
||||||
size="mini"
|
:label="dict.dictLabel"
|
||||||
@click="handleQuery"
|
:value="dict.dictValue"
|
||||||
>搜索
|
/>
|
||||||
</el-button>
|
</el-select>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
</el-form-item>
|
||||||
>重置
|
</el-col>
|
||||||
</el-button>
|
<el-form-item>
|
||||||
</el-form-item>
|
<el-button
|
||||||
</el-form>
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
@ -67,7 +78,10 @@
|
|||||||
<el-table-column label="菜品名称" align="center" prop="name" />
|
<el-table-column label="菜品名称" align="center" prop="name" />
|
||||||
<el-table-column label="菜品种类" align="center" prop="bigClass">
|
<el-table-column label="菜品种类" align="center" prop="bigClass">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<AutoHideMessage :data="dishClassFormat(scope.row)" :maxLength="10"></AutoHideMessage>
|
<AutoHideMessage
|
||||||
|
:data="dishClassFormat(scope.row)"
|
||||||
|
:maxLength="10"
|
||||||
|
></AutoHideMessage>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="菜品类型" align="center" prop="type">
|
<el-table-column label="菜品类型" align="center" prop="type">
|
||||||
@ -109,7 +123,7 @@ import AutoHideInfo from "@/components/AutoHideInfo";
|
|||||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||||
import { listDishes } from "@/api/custom/dishes";
|
import { listDishes } from "@/api/custom/dishes";
|
||||||
import { createNamespacedHelpers } from "vuex";
|
import { createNamespacedHelpers } from "vuex";
|
||||||
const { mapState,mapGetters } = createNamespacedHelpers("recipes");
|
const { mapState, mapGetters } = createNamespacedHelpers("recipes");
|
||||||
export default {
|
export default {
|
||||||
name: "SelectDishes",
|
name: "SelectDishes",
|
||||||
props: [],
|
props: [],
|
||||||
@ -129,14 +143,19 @@ export default {
|
|||||||
reviewStatus: "yes",
|
reviewStatus: "yes",
|
||||||
},
|
},
|
||||||
//菜品种类查询参数
|
//菜品种类查询参数
|
||||||
dishClassQueryParam:[]
|
dishClassQueryParam: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AutoHideInfo,AutoHideMessage
|
AutoHideInfo,
|
||||||
|
AutoHideMessage,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["typeOptions","dishBigClassOptions","dishSmallClassOptions"]),
|
...mapState([
|
||||||
|
"typeOptions",
|
||||||
|
"dishBigClassOptions",
|
||||||
|
"dishSmallClassOptions",
|
||||||
|
]),
|
||||||
...mapGetters(["dishClassOptions"]),
|
...mapGetters(["dishClassOptions"]),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -146,9 +165,12 @@ export default {
|
|||||||
this.lockType = true;
|
this.lockType = true;
|
||||||
this.queryParams.type = type;
|
this.queryParams.type = type;
|
||||||
}
|
}
|
||||||
if(this.dishClassQueryParam != null && this.dishClassQueryParam.length > 0){
|
if (
|
||||||
|
this.dishClassQueryParam != null &&
|
||||||
|
this.dishClassQueryParam.length > 0
|
||||||
|
) {
|
||||||
this.queryParams.smallClass = this.dishClassQueryParam[1];
|
this.queryParams.smallClass = this.dishClassQueryParam[1];
|
||||||
}else{
|
} else {
|
||||||
this.queryParams.smallClass = null;
|
this.queryParams.smallClass = null;
|
||||||
}
|
}
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@ -213,13 +235,19 @@ export default {
|
|||||||
.map((type) => this.selectDictLabel(this.typeOptions, type));
|
.map((type) => this.selectDictLabel(this.typeOptions, type));
|
||||||
},
|
},
|
||||||
//菜品种类翻译
|
//菜品种类翻译
|
||||||
dishClassFormat(row){
|
dishClassFormat(row) {
|
||||||
if(row.bigClass > 0 && row.smallClass > 0){
|
if (row.bigClass > 0 && row.smallClass > 0) {
|
||||||
let bigClassName = this.selectDictLabel(this.dishBigClassOptions, row.bigClass);
|
let bigClassName = this.selectDictLabel(
|
||||||
let smallClassName = this.selectDictLabel(this.dishSmallClassOptions, row.smallClass);
|
this.dishBigClassOptions,
|
||||||
return bigClassName+"/"+smallClassName;
|
row.bigClass
|
||||||
}
|
);
|
||||||
return "";
|
let smallClassName = this.selectDictLabel(
|
||||||
|
this.dishSmallClassOptions,
|
||||||
|
row.smallClass
|
||||||
|
);
|
||||||
|
return bigClassName + "/" + smallClassName;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
:step="5"
|
:step="5"
|
||||||
:value="value"
|
:value="value"
|
||||||
@blur="handleOnBlur"
|
@blur="handleOnBlur"
|
||||||
@keydown.enter.native="handleEnterClick"
|
@keydown="handleOnKeydown"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -43,8 +43,11 @@ export default {
|
|||||||
this.$message.error("数字必须大于0");
|
this.$message.error("数字必须大于0");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleEnterClick(e) {
|
handleOnKeydown(e) {
|
||||||
e.target.blur();
|
// console.log(e);
|
||||||
|
if (e.keyCode === 13) {
|
||||||
|
e.target.blur();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="菜品" prop="name" align="center" :width="180">
|
<el-table-column label="菜品" prop="name" align="center">
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
class="item"
|
class="item"
|
||||||
@ -108,7 +108,7 @@
|
|||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="食材" prop="igdName" align="center" :width="180">
|
<el-table-column label="食材" prop="igdName" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span
|
<span
|
||||||
v-if="
|
v-if="
|
||||||
@ -412,6 +412,7 @@ export default {
|
|||||||
"fontSize",
|
"fontSize",
|
||||||
"canCopyMenuTypes",
|
"canCopyMenuTypes",
|
||||||
"recipesId",
|
"recipesId",
|
||||||
|
"notRecIgds",
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -420,7 +421,11 @@ export default {
|
|||||||
if (!columnIndex) {
|
if (!columnIndex) {
|
||||||
return "recipes_first_col";
|
return "recipes_first_col";
|
||||||
} else {
|
} else {
|
||||||
return `recipes_cell recipes_cell_${this.fontSize}`;
|
return `recipes_cell recipes_cell_${this.fontSize} ${
|
||||||
|
columnIndex === 2 && this.notRecIgds.includes(row.igdId)
|
||||||
|
? "warning_heightlight"
|
||||||
|
: ""
|
||||||
|
}`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleParentClick(e) {
|
handleParentClick(e) {
|
||||||
@ -660,4 +665,9 @@ export default {
|
|||||||
.recipes_cell_18 {
|
.recipes_cell_18 {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.warning_heightlight {
|
||||||
|
background: #d66969;
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="verify_view_wrapper">
|
<div class="verify_view_wrapper">
|
||||||
<div>忌口</div>
|
<div>病理忌口</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<span
|
<span
|
||||||
:class="`item ${
|
:class="`item ${
|
||||||
@ -12,23 +12,46 @@
|
|||||||
>{{ item.name }}</span
|
>{{ item.name }}</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="margin: 24px 0 8px 0">涉及食材</div>
|
||||||
|
<div v-for="key in Object.keys(igdTypeDetial).reverse()" :key="key">
|
||||||
|
<div style="font-size: 14px; color: #8c8c8c">{{ igdTypeDict[key] }}</div>
|
||||||
|
<div class="content">
|
||||||
|
<span
|
||||||
|
:class="`item ${selectedIgd === item.id ? 'selected_item' : ''} `"
|
||||||
|
v-for="item in igdTypeDetial[key]"
|
||||||
|
:key="item.id"
|
||||||
|
@click="handleOnIgdClick(item)"
|
||||||
|
>{{ item.name }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { createNamespacedHelpers } from "vuex";
|
import { createNamespacedHelpers } from "vuex";
|
||||||
const { mapActions, mapState, mapGetters } = createNamespacedHelpers("recipes");
|
const {
|
||||||
|
mapActions,
|
||||||
|
mapState,
|
||||||
|
mapGetters,
|
||||||
|
mapMutations,
|
||||||
|
} = createNamespacedHelpers("recipes");
|
||||||
export default {
|
export default {
|
||||||
name: "VerifyView",
|
name: "VerifyView",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedNotRec: [],
|
selectedNotRec: [],
|
||||||
|
selectedIgd: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(["verifyNotRecData"]),
|
...mapGetters(["verifyNotRecData", "igdTypeDict", "igdTypeDetial"]),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleOnClick(data) {
|
handleOnClick(data) {
|
||||||
|
if (this.selectedIgd !== 0) {
|
||||||
|
this.selectedIgd = 0;
|
||||||
|
this.setNotRecIgds({ data: [] });
|
||||||
|
}
|
||||||
if (this.selectedNotRec.some((str) => data.name === str)) {
|
if (this.selectedNotRec.some((str) => data.name === str)) {
|
||||||
this.selectedNotRec = this.selectedNotRec.filter(
|
this.selectedNotRec = this.selectedNotRec.filter(
|
||||||
(str) => str !== data.name
|
(str) => str !== data.name
|
||||||
@ -39,27 +62,45 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const notRecIgds = this.selectedNotRec.reduce((arr, cur) => {
|
const notRecIgds = this.selectedNotRec.reduce((arr, cur) => {
|
||||||
this.verifyNotRecData[cur].data.forEach((obj) => {
|
const tarData = this.verifyNotRecData.find((obj) => obj.name === cur);
|
||||||
if (!arr.includes(obj.igdId)) {
|
if (tarData) {
|
||||||
arr.push(obj.igdId);
|
tarData.data.forEach((obj) => {
|
||||||
}
|
if (!arr.includes(obj.igdId)) {
|
||||||
});
|
arr.push(obj.igdId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
return arr;
|
return arr;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
console.log({
|
// console.log({
|
||||||
data,
|
// data,
|
||||||
notRecIgds,
|
// notRecIgds,
|
||||||
verifyNotRecData: this.verifyNotRecData,
|
// verifyNotRecData: this.verifyNotRecData,
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
this.setNotRecIgds({ data: notRecIgds });
|
||||||
},
|
},
|
||||||
|
handleOnIgdClick(data) {
|
||||||
|
if (this.selectedNotRec.length > 0) {
|
||||||
|
this.selectedNotRec = [];
|
||||||
|
this.setNotRecIgds({ data: [] });
|
||||||
|
}
|
||||||
|
|
||||||
|
this.selectedIgd = data.id;
|
||||||
|
|
||||||
|
this.setNotRecIgds({ data: [this.selectedIgd] });
|
||||||
|
},
|
||||||
|
...mapMutations(["setNotRecIgds"]),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.verify_view_wrapper {
|
.verify_view_wrapper {
|
||||||
|
height: calc(100vh - 32px);
|
||||||
|
overflow: auto;
|
||||||
.content {
|
.content {
|
||||||
margin-top: 8px;
|
margin: 8px 0;
|
||||||
.item {
|
.item {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user