!284 菜品拷贝功能、食谱计划列表优化,移除订单联查,改为客户档案联查

Merge pull request !284 from 德仔/xzj
This commit is contained in:
德仔 2021-06-09 19:11:50 +08:00 committed by Gitee
commit ebbf04ddb1
6 changed files with 45 additions and 18 deletions

View File

@ -184,13 +184,11 @@
srp.start_date,srp.end_date,srp.send_flag,srp.send_time, sc.name as customer, srp.review_status,
srp.subscribed
FROM sys_recipes_plan srp
LEFT JOIN sys_order sr ON sr.order_id = srp.order_id
LEFT JOIN sys_customer sc ON sc.id = srp.cus_id
LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sr.nutritionist_id AND su_nutritionist.del_flag
= 0
LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sr.nutri_assis_id AND
LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sc.main_dietitian AND su_nutritionist.del_flag = 0
LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sc.assistant_dietitian AND
su_nutritionist_assis.del_flag = 0
WHERE srp.del_flag = 0 AND sr.del_flag = 0 AND srp.type = 0
WHERE srp.del_flag = 0 AND sc.del_flag = 0 AND srp.type = 0
<if test="orderId != null">AND srp.order_id = #{orderId}</if>
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if>
<if test="customer != null and customer != ''">AND (sc.name like concat('%',#{customer},'%') OR sc.phone like

View File

@ -362,7 +362,8 @@ export default {
return (value == undefined || value == null || value == "") ? "" : value;
},
autoSelectLive(row){
if(row.importFanChannel == undefined || row.importFanChannel == null || row.importFanChannel == ""){
if(row.importFanChannel == undefined || row.importFanChannel == null || row.importFanChannel == ""
|| row.fanTime == undefined || row.fanTime == null || row.fanTime == ""){
row.importFanLive = null;
return;
}

View File

@ -261,6 +261,7 @@ export default {
selNotRec: [],
selRecIds: [],
selNotRecIds: [],
copyFlag: false //
};
},
props: [
@ -316,9 +317,10 @@ export default {
},
},
methods: {
showDrawer(id) {
showDrawer(id, copyFlag) {
this.open = true;
this.title = id ? "修改菜品" : "新建菜品";
this.copyFlag = (copyFlag != undefined && copyFlag) ? true : false;
this.title = id ? (this.copyFlag ? "拷贝菜品" : "修改菜品") : "新建菜品";
this.reset();
if (id) {
this.fetchDishesDetail(id);
@ -390,7 +392,7 @@ export default {
data.type = data.type.join(",");
data.recIds = this.selRecIds;
data.notRecIds = this.selNotRecIds;
if (data.id != null) {
if (data.id != null && !this.copyFlag) {
updateDishes(data).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
@ -399,9 +401,13 @@ export default {
}
});
} else {
if(this.copyFlag){
//id
data.id = null;
}
addDishes(data).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.msgSuccess(this.copyFlag ? "拷贝成功" : "新增成功");
this.open = false;
this.$emit("onSuccess");
}

View File

@ -149,7 +149,7 @@
>
<template slot-scope="scope">
<el-button
size="mini"
size="normal"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@ -157,7 +157,15 @@
>修改
</el-button>
<el-button
size="mini"
size="normal"
type="text"
icon="el-icon-document-copy"
@click="handleCopy(scope.row)"
v-hasPermi="['custom:dishes:add']"
>拷贝
</el-button>
<el-button
size="normal"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
@ -378,6 +386,10 @@ export default {
handleUpdate(row) {
this.$refs.dishesDrawerRef.showDrawer(row.id);
},
/** 拷贝按钮操作 */
handleCopy(row) {
this.$refs.dishesDrawerRef.showDrawer(row.id, true);
},
/** 删除按钮操作 */
handleDelete(row) {
this.$confirm("是否确认删除菜品「" + row.name + "」的数据项?", "警告", {

View File

@ -395,7 +395,17 @@
<el-table-column label="服务时长" align="center" prop="serveTime" />
<el-table-column label="销售/售中" align="center" prop="preSale" >
<template slot-scope="scope">
<div v-if="scope.row.orderType == 2">
<div>
{{ scope.row.preSaleId ? scope.row.preSale : "无" }}
</div>
<div>
{{scope.row.onSaleId ? scope.row.onSale : "无" }}
</div>
</div>
<div v-else>
{{scope.row.preSaleId ? scope.row.preSale : scope.row.onSale}}
</div>
</template>
</el-table-column>
<el-table-column
@ -416,7 +426,7 @@
align="center"
prop="nutriAssis"
/>
<el-table-column
<!--<el-table-column
v-if="!isMobile"
label="策划"
align="center"
@ -427,7 +437,7 @@
label="策划助理"
align="center"
prop="plannerAssis"
/>
/>-->
<el-table-column
v-if="!isMobile"
label="运营"
@ -444,7 +454,7 @@
<template slot-scope="scope">
<auto-hide-message
:data="scope.row.remark == null ? '' : scope.row.remark + ''"
:maxLength="20"
:maxLength="10"
/>
</template>
</el-table-column>

View File

@ -83,12 +83,12 @@
>
</el-form-item>
</el-form>
<div>
<!--<div>
<span style="color: #e6a23c; font-family: PingFang SC">
注意事项
<br />12021年1月开始的订单才会自动生成食谱计划</span
>
</div>
</div>-->
<el-row :gutter="10" class="mb8" style="margin-top: 10px">
<el-col :span="1.5">
<el-button