This commit is contained in:
huangdeliang 2021-04-10 09:05:05 +08:00
parent 39ad0f1b86
commit f28f009086
3 changed files with 37 additions and 24 deletions

View File

@ -74,7 +74,9 @@ export default {
}, },
methods: { methods: {
handleOnHide() { handleOnHide() {
this.$emit("onConfirm", { remark: this.nData }); if (this.nData !== null && this.nData !== undefined) {
this.$emit("onConfirm", { remark: this.nData });
}
}, },
}, },
}; };

View File

@ -25,13 +25,25 @@
<div v-for="mObj in obj.values" :key="mObj.id"> <div v-for="mObj in obj.values" :key="mObj.id">
<div class="dishes_item"> <div class="dishes_item">
<div <div
v-if="!mObj.methods && !mObj.remark && !mObj.igdList" v-if="mObj.igdList.length === 1"
class="simple_dishes" class="simple_dishes"
@click="
mObj.remark || mObj.methods ? handleOnDetailClick(mObj) : null
"
> >
<span>{{ mObj.name }}</span> <span
>{{ mObj.igdList[0].name }}
<em
v-if="mObj.remark || mObj.methods"
class="el-icon-collection-tag"
style="color: #ababab; margin-left: 8px"
/>
</span>
<span class="weight_style"> <span class="weight_style">
<span style="margin-right: 20px">{{ mObj.cusStr }}</span> <span style="margin-right: 20px">{{
<span>{{ mObj.weight }}</span> mObj.igdList[0].cusStr
}}</span>
<span>{{ mObj.igdList[0].weight }}</span>
</span> </span>
</div> </div>
<div v-else class="complex_dishes" @click="handleOnDetailClick(mObj)"> <div v-else class="complex_dishes" @click="handleOnDetailClick(mObj)">
@ -82,24 +94,24 @@ export default {
if (!obj[cur.type]) { if (!obj[cur.type]) {
obj[cur.type] = []; obj[cur.type] = [];
} }
let tarMenu = cur; // let tarMenu = cur;
if ( // if (
!tarMenu.methods && // !tarMenu.methods &&
!tarMenu.remark && // !tarMenu.remark &&
tarMenu.igdList.length === 1 // tarMenu.igdList.length === 1
) { // ) {
tarMenu = tarMenu.igdList[0]; // tarMenu = tarMenu.igdList[0];
tarMenu.cusStr = `${this.cusWeightDict[tarMenu.cusWeight] || ""}${ // tarMenu.cusStr = `${this.cusWeightDict[tarMenu.cusWeight] || ""}${
this.cusUnitDict[tarMenu.cusUnit] || "" // this.cusUnitDict[tarMenu.cusUnit] || ""
// }`;
// } else {
cur.igdList.forEach((igd) => {
igd.cusStr = `${this.cusWeightDict[igd.cusWeight] || ""}${
this.cusUnitDict[igd.cusUnit] || ""
}`; }`;
} else { });
tarMenu.igdList.forEach((igd) => { // }
igd.cusStr = `${this.cusWeightDict[igd.cusWeight] || ""}${ obj[cur.type].push(cur);
this.cusUnitDict[igd.cusUnit] || ""
}`;
});
}
obj[cur.type].push(tarMenu);
return obj; return obj;
}, {}); }, {});
const mMenus = Object.keys(mData).map((type) => ({ const mMenus = Object.keys(mData).map((type) => ({
@ -107,7 +119,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;
}, },
...mapState(["cusUnitDict", "cusWeightDict", "menuTypeDict"]), ...mapState(["cusUnitDict", "cusWeightDict", "menuTypeDict"]),

View File

@ -7,7 +7,6 @@
class="icon_btn" class="icon_btn"
@click="handleOnPlanClick" @click="handleOnPlanClick"
/> />
<!-- <img :src="logo" style="width: auto; height: 32px" alt="logo" /> -->
<span>{{ curDate }}</span> <span>{{ curDate }}</span>
<el-button <el-button
icon="el-icon-user" icon="el-icon-user"