提交 e6c511d8 编写于 作者: zhongyao.qiao's avatar zhongyao.qiao

feat 筛选增加全部保险项目

上级 6474cfc2
...@@ -449,7 +449,7 @@ ...@@ -449,7 +449,7 @@
class="t-b" class="t-b"
> >
<el-select <el-select
v-model="insuranceCodes" :value="insuranceCodes"
placeholder="请选择数据来源" placeholder="请选择数据来源"
clearable clearable
multiple multiple
...@@ -942,13 +942,46 @@ export default { ...@@ -942,13 +942,46 @@ export default {
clearInterval(this.timer); clearInterval(this.timer);
}, },
methods: { methods: {
handleProjectSelect() { handleProjectSelect(item) {
this.searchParam.dataSourceList = this.insuranceCodes?.flat() || []; const ids = this.insuranceCodes.join();
const selectIds = item.join();
const index = item.findIndex((i) => i === '0');
if (ids === '0' && selectIds === '0') return;
if (!selectIds) this.insuranceCodes = [];
else if (index > -1 && index === item.length - 1) {
this.insuranceCodes = ['0'];
} else if (index > -1) {
item.splice(index, 1);
this.insuranceCodes = item;
} else this.insuranceCodes = item;
let result = [];
if (this.insuranceCodes.join() === '0') {
result = this.dataFromList
.map((i) => i.projectEquityCodes)
.join()
.split(',');
} else {
result = this.insuranceCodes.length
? this.insuranceCodes.join().split(',')
: [];
}
this.searchParam.dataSourceList = [...new Set(result)];
}, },
getProjectList() { getProjectList() {
projectList().then((res) => { projectList().then((res) => {
if (res.code == '000000') { if (res.code == '000000') {
this.dataFromList = res.data || []; const item = {
insuranceProjectId: 0,
projectName: '全部保险项目',
projectEquityCodes: [0],
};
this.dataFromList = [item].concat(res.data).map((row) => {
return {
...row,
projectEquityCodes: row.projectEquityCodes.join(','),
};
});
} }
}); });
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册