This commit is contained in:
xiezhijun 2021-04-09 20:00:06 +08:00
commit fe7834e640
8 changed files with 25 additions and 9 deletions

View File

@ -29,8 +29,8 @@ public class SysRecipesTemplateController extends BaseController {
* 查询 * 查询
*/ */
@PreAuthorize("@ss.hasPermi('recipes:template:list')") @PreAuthorize("@ss.hasPermi('recipes:template:list')")
@GetMapping("/list") @PostMapping("/list")
public TableDataInfo list(SysRecipesTemplate sysRecipesTemplate) { public TableDataInfo list(@RequestBody SysRecipesTemplate sysRecipesTemplate) {
startPage(); startPage();
List<SysRecipesTemplate> list = iSysRecipesTemplateService.selectRecipesTemplateListByCondition(sysRecipesTemplate); List<SysRecipesTemplate> list = iSysRecipesTemplateService.selectRecipesTemplateListByCondition(sysRecipesTemplate);
return getDataTable(list); return getDataTable(list);

View File

@ -36,4 +36,6 @@ public class SysRecipesTemplate {
Long recipesId; Long recipesId;
Integer reviewStatus; Integer reviewStatus;
String[] keys;
} }

View File

@ -31,7 +31,11 @@
left join sys_user su_nutritionist on su_nutritionist.user_id = srt.nutritionist_id and su_nutritionist.del_flag = 0 left join sys_user su_nutritionist on su_nutritionist.user_id = srt.nutritionist_id and su_nutritionist.del_flag = 0
left join sys_user su_nutritionist_assis on su_nutritionist_assis.user_id = srt.nutri_assis_id and su_nutritionist_assis.del_flag = 0 left join sys_user su_nutritionist_assis on su_nutritionist_assis.user_id = srt.nutri_assis_id and su_nutritionist_assis.del_flag = 0
where srt.del_flag = 0 where srt.del_flag = 0
<if test="name != null and name != ''">and srt.name like concat('%', #{name}, '%') or srt.remark like concat('%', #{name}, '%')</if> <if test="keys != null">and
<foreach collection="keys" item="key" separator="and" open="(" close=")">
srt.name like concat('%', #{key}, '%') or srt.remark like concat('%', #{key}, '%')
</foreach>
</if>
<if test="nutriAssisId != null ">and srt.nutri_assis_id = #{nutriAssisId}</if> <if test="nutriAssisId != null ">and srt.nutri_assis_id = #{nutriAssisId}</if>
<if test="nutritionistId != null ">and srt.nutritionist_id = #{nutritionistId}</if> <if test="nutritionistId != null ">and srt.nutritionist_id = #{nutritionistId}</if>
<if test="reviewStatus != null ">and srp.review_status = #{reviewStatus}</if> <if test="reviewStatus != null ">and srp.review_status = #{reviewStatus}</if>

View File

@ -1,10 +1,14 @@
import request from "@/utils/request"; import request from "@/utils/request";
export function listRecipesTemplate(query) { export function listRecipesTemplate(data) {
return request({ return request({
url: "/recipes/template/list", url: "/recipes/template/list",
method: "get", method: "post",
params: query params: {
pageSize: data.pageSize,
pageNum: data.pageNum
},
data
}); });
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="template_view_wrapper"> <div class="template_view_wrapper">
<div class="header"> <div class="header">
<div style="fontWeight: bold">选择模板</div> <div style="fontweight: bold">选择模板</div>
<el-button size="mini" @click="handleOnBackClick">返回</el-button> <el-button size="mini" @click="handleOnBackClick">返回</el-button>
</div> </div>
<div class="content"> <div class="content">
@ -131,7 +131,9 @@ export default {
}, },
getList() { getList() {
this.loading = true; this.loading = true;
listRecipesTemplate(this.queryParams).then((res) => { const params = JSON.parse(JSON.stringify(this.queryParams));
params.keys = (params.name || "").split(" ");
listRecipesTemplate(params).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.dataList = res.rows; this.dataList = res.rows;
this.total = res.total; this.total = res.total;

View File

@ -12,6 +12,7 @@
placeholder="请输入客户姓名或手机号" placeholder="请输入客户姓名或手机号"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="日期" prop="planStartDateScope"> <el-form-item label="日期" prop="planStartDateScope">

View File

@ -269,7 +269,9 @@ export default {
/** 查询食谱计划列表 */ /** 查询食谱计划列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listRecipesTemplate(this.queryParams).then((response) => { const params = JSON.parse(JSON.stringify(this.queryParams));
params.keys = params.name ? params.name.split(" ") : null;
listRecipesTemplate(params).then((response) => {
this.recipesTemplateList = response.rows; this.recipesTemplateList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;

View File

@ -10,6 +10,7 @@
clearable clearable
size="small" size="small"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
@keyup.enter.native="handleQuery"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
</div> </div>