修复菜谱截取功能

This commit is contained in:
huangdeliang 2021-04-06 19:13:54 +08:00
parent 13f25e4f02
commit f2946fea59
4 changed files with 45 additions and 12 deletions

View File

@ -480,7 +480,7 @@
<!-- 根据客户ID查询该客户下所有订单 -->
<select id="getAllOrderByCusId" parameterType="Long" resultMap="SysOrderResult">
select * from sys_order where del_flag = 0 and cus_id = #{cusId} order by order_id asc
select * from sys_order where del_flag = 0 and cus_id = #{cusId} order by order_time asc
</select>
</mapper>

View File

@ -242,9 +242,9 @@ const actions = {
if (recipesDataResult.code === 200) {
const { endNum, startNum, recipesId } = state;
// 计算
let length = endNum - startNum;
const length = endNum - startNum;
recipesData = recipesDataResult.data.reduce((outArr, dayData, idx) => {
if (!recipesId || length >= idx) {
if (length >= idx) {
outArr.push({
id: dayData.id,
numDay: !recipesId ? startNum + idx : dayData.numDay,
@ -531,7 +531,8 @@ const actions = {
}).then(() => {
window.postMessage(
{
type: messageTypes.UPDATE_SHORTCUT
type: messageTypes.UPDATE_SHORTCUT,
setCurrent: true
},
"*"
);

View File

@ -50,8 +50,13 @@
/>
<!-- 菜品预览 -->
<el-table border :data="scope.row.data.igdList" v-else size="mini">
<el-table-column align="center" label="食材" prop="name" />
<el-table-column align="center" label="分量估算">
<el-table-column
align="center"
label="食材"
prop="name"
width="100"
/>
<el-table-column align="center" label="分量估算" width="100">
<template slot-scope="scope">
<span>{{
`${cusWeightDict[scope.row.cusWeight]}${
@ -60,7 +65,12 @@
}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="重量(g)" prop="weight" />
<el-table-column
align="center"
label="重量(g)"
prop="weight"
width="100"
/>
</el-table>
<el-button type="text" size="mini" slot="reference">预览</el-button>
</el-popover>
@ -68,7 +78,11 @@
</el-table-column>
<el-table-column label="操作" :width="60" align="center">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="handleOnDelete(scope.row)">
<el-button
type="text"
size="mini"
@click="handleOnDelete(scope.row)"
>
删除
</el-button>
</template>
@ -129,18 +143,24 @@ export default {
messageListener(e) {
const { data } = e;
if (data.type === messageTypes.UPDATE_SHORTCUT) {
this.getList();
this.getList(data.setCurrent);
}
},
getList() {
getList(setCurrent) {
getShortCut().then((data) => {
this.dataList = data;
// console.log(this.dataList);
if (setCurrent) {
this.$refs.shortCutTable.setCurrentRow(data[0]);
}
});
},
handleOnDelete(data) {
removeShortCut(data.id).then((res) => {
this.getList();
if (this.curShortCutObj.id === data.id) {
this.setCurShortCutObj({});
}
});
},
handleOnCurrentChange(data) {

View File

@ -39,7 +39,10 @@
@click="handleOnMenuPasteClick"
>快捷替换</el-button
>
<div v-else-if="curShortCutObj.type" style="margin-top: 8px">
<div
v-else-if="curShortCutObj && curShortCutObj.type"
style="margin-top: 8px"
>
<el-button
icon="el-icon-right"
size="mini"
@ -411,6 +414,13 @@ export default {
}
const mData = processMenuData(this.data.dishes);
// console.log(mData);
// mData.forEach((obj, idx) =>
// console.log({
// num: this.num,
// type: obj.type,
// idx: idx + 1,
// })
// );
return mData;
},
@ -478,7 +488,9 @@ export default {
},
shouldPasteShow(type) {
return (
this.curShortCutObj.type && this.curShortCutObj.type.includes(type)
this.curShortCutObj &&
this.curShortCutObj.type &&
this.curShortCutObj.type.includes(type)
);
},
cellClassName({ row, column, rowIndex, columnIndex }) {