案例管理优化

This commit is contained in:
xiezhijun 2021-03-09 18:25:13 +08:00
parent 4b58e1b6bc
commit addf0fc000
6 changed files with 58 additions and 9 deletions

View File

@ -57,6 +57,7 @@ public class SysCustomerCaseController extends BaseController
public TableDataInfo list(SysCustomerCase sysCustomerCase)
{
startPage();
sysCustomerCase.setKeywordArray(StringUtils.isNotEmpty(sysCustomerCase.getKeyword()) ? sysCustomerCase.getKeyword().split(",") : null);
List<SysCustomerCase> list = sysCustomerCaseService.selectSysCustomerCaseList(sysCustomerCase);
return getDataTable(list);
}

View File

@ -28,6 +28,8 @@ public class SysCustomerCase extends BaseEntity
@Excel(name = "关键词")
private String keyword;
private String[] keywordArray;
/** 案例所属客户ID */
private Long customerId;

View File

@ -23,16 +23,30 @@
select id, name, keyword, remark, customer_id, create_time from sys_customer_case
</sql>
<sql id="searchKey">
<if test="keywordArray != null">
<trim prefix="AND (" suffix=")" suffixOverrides="or">
<foreach collection="keywordArray" separator="or" item="typeArray" index="i">
( scc.keyword like concat('%', #{typeArray}, '%') or scc.name like concat('%', #{typeArray}, '%') or scc.remark like concat('%', #{typeArray}, '%') )
</foreach>
</trim>
</if>
</sql>
<select id="selectSysCustomerCaseList" parameterType="SysCustomerCase" resultMap="SysCustomerCaseResult">
select scc.id, scc.name, scc.keyword, scc.remark, scc.customer_id, scc.create_time,sc.name as customer_name from sys_customer_case scc
left join sys_customer sc on sc.id = scc.customer_id and sc.del_flag = 0
where scc.del_flag = 0
<if test="name != null and name != ''">
and (scc.name like concat('%', #{name}, '%') OR scc.keyword like concat('%', #{name}, '%') OR scc.remark like concat('%', #{name}, '%'))
</if>
<!--<if test="name != null and name != ''">
and (scc.name like concat('%', #{name}, '%') OR scc.remark like concat('%', #{name}, '%'))
</if>-->
<include refid="searchKey">
<property name="keywordArray" value="#{keywordArray}"/>
</include>
<if test="customerName != null and customerName != ''">
and sc.name like concat('%', #{customerName}, '%')
</if>
OR scc.keyword like concat('%', #{name}, '%')
order by id desc
</select>

View File

@ -132,7 +132,7 @@ export default {
downSigleFile(file.downUrl, file.fileName);
},
isImage(name){
var idx = name.indexOf('.');
var idx = name.lastIndexOf(".");
if (idx === -1) {
return false;
}

View File

@ -2,7 +2,7 @@
<div>
<div v-for="(item, index) in oldCaseFileList">
<span style="margin-right: 10px;">
{{item.fileName ? (item.fileName.substring(0,15)+"..."): ""}}
{{item.fileName.length > 15 ? (item.fileName.substring(0,15)+"...") : item.fileName}}
</span>
<el-button style="margin-left: 10px;" type="danger" size="small" @click="removeOldFile(index)">移除该文件</el-button>
</div>

View File

@ -1,14 +1,32 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="案例信息" prop="name">
<!--<el-form-item label="案例信息" prop="name">
<el-input
v-model.trim="queryParams.name"
placeholder="请输入案例名称或关键字"
placeholder="请输入案例名称或备注"
clearable
size="small"
/>
</el-form-item>-->
<el-form-item label="案例信息" prop="name">
<el-select
v-model="keywordArray"
multiple
filterable
allow-create
clearable
default-first-option
placeholder="关键词搜索" style="width: 100%;">
<el-option
v-for="dict in caseKeyOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="客户姓名" prop="customerName">
<el-input
v-model.trim="queryParams.customerName"
@ -149,9 +167,16 @@
v-model="form.keywordArray"
multiple
filterable
clearable
allow-create
default-first-option
placeholder="请创建案例关键词按回车创建最多20个" style="width: 100%;">
<el-option
v-for="dict in caseKeyOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="案例备注" prop="remark">
@ -222,6 +247,7 @@
pageNum: 1,
pageSize: 10,
name: null,
keyword: null,
customerName: null
},
//
@ -237,7 +263,9 @@
{ required: true, message: "案例关键词不能为空", trigger: "blur" },
],
},
submitFlag: false
keywordArray:[],
submitFlag: false,
caseKeyOptions: [],
};
},
components: {
@ -250,11 +278,15 @@
},
created() {
this.getList();
this.getDicts("case_key").then((response) => {
this.caseKeyOptions = response.data;
});
},
methods: {
/** 查询客户案例管理列表 */
getList() {
this.loading = true;
this.queryParams.keyword = this.keywordArray.join(",");
listCustomerCase(this.queryParams).then(response => {
this.customerCaseList = response.rows;
this.total = response.total;