1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<template>
<div class="custom-info">
<!-- form -->
<a-form-model ref="form" layout="vertical" :model="form">
<a-row :gutter="30">
<a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="病历号码">
<a-input v-model="form.mrnNo" placeholder="请输入病历号" allow-clear></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="客户姓名">
<a-input v-model="form.patientName" placeholder="请输入客户姓名" allow-clear></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="5" :lg="6" :sm="12">
<a-form-model-item label="出生日期">
<a-date-picker v-model="form.birthday" placeholder="请选择出生日期" value-format="YYYY-MM-DD 00:00:00" allow-clear></a-date-picker>
</a-form-model-item>
</a-col>
<a-col :xl="5" :lg="6" :sm="12">
<a-form-model-item label="保险公司">
<a-select v-model="form.payorId" placeholder="请选择保险公司" show-search allow-clear :filterOption="filterCode">
<a-select-option v-for="item in companyCode" :key="item.corpCode" :value="item.id">{{ item.longName }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="保单号码">
<a-input v-model="form.policyNo" placeholder="请输入保单号码" allow-clear></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="18" :lg="18" :sm="12" class="none-label">
<a-form-model-item label="button">
<!-- <a-button type="primary" @click="addNewCustom"><Icon name="ssiadd" :size="14" />新建客户</a-button> -->
<a-button class="mar-left10" type="primary" @click="handlerSearch">
<Icon name="ssisearch_active" :size="14" />查询
</a-button>
<a-button class="mar-left10" type="primary" @click="resetEvt">
<Icon name="ssireset" :size="14" />重置
</a-button>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
<!-- table -->
<a-table
:columns="columns"
:data-source="dataList"
:scroll="{ x: true }"
:pagination="false"
:customRow="handlerRowClick"
>
<template slot="sex" slot-scope="text">
<span>{{text | formatSex}}</span>
</template>
<template slot="operation" slot-scope="record">
<a-button type="link" v-if="!record.isExpired" @click.stop="changeDataStatus(record)">修改</a-button>
<a-button type="link" @click.stop="printClaimPdf(record)">打印理赔申请书</a-button>
<a-button type="link" @click.stop="changeDataStatus(record, '2')">新增保单</a-button>
<!-- <a-button type="link" class="success">新增</a-button> -->
<!-- <a-popconfirm title="你确定要删除吗?" ok-text="确定" cancel-text="取消" @confirm="deleteData(record)">
<a-button type="link" class="danger" @click.stop>删除</a-button>
</a-popconfirm> -->
</template>
</a-table>
<!--分页-->
<BurtPagination :pagination="pager" @pageChange="_getCustomerList" />
</div>
</template>
<script>
import BurtPagination from "@/components/CUSTOMER/pagation";
import {downloadFile} from '@/utils/index'
import moment from 'moment'
import mixins from "@/mixins";
export default {
data() {
const dateFormat = (val) => {
return val && moment(val).format('YYYY-MM-DD')
}
const columns = [
{ title: "病历号", dataIndex: "mrnNo", width: 180, },
{ title: "客户姓名", dataIndex: "patientName", width: 120,},
{ title: "出生日期", dataIndex: "birthday", width: 170, customRender: dateFormat},
{ title: "性别", dataIndex: "sex", width: 80, scopedSlots: { customRender: "sex" } },
{ title: "保险公司", dataIndex: "payorName", width: 180 },
{ title: "保险卡号", dataIndex: "cardNo", width: 190 },
{ title: "保单生效日期", dataIndex: "startDate", width: 170, customRender: (val, row) => {
const formatDate = dateFormat(val)
if (row.isExpired) {
return <span class="red-text">{formatDate}</span>
}
return formatDate;
}},
{ title: "保单终止日期", dataIndex: "endDate", width: 170, customRender: (val, row) => {
const formatDate = dateFormat(val)
if (row.isExpired) {
return <span class="red-text">{formatDate}</span>
}
return formatDate;
}},
{ title: "操作", key: "operation", width: "270px", fixed: "right", scopedSlots: { customRender: "operation" }, align: 'center'},
];
return {
columns,
form: {},
pageForm: {},
companyCode: [],
dataList: [],
pager: {
pageNum: 1,
pageSize: 10,
total: 0,
},
};
},
mixins: [mixins],
components: {
BurtPagination,
},
created() {
this._getPayorCode();
},
methods: {
// 选择框筛选
filterCode(input, option) {
return (
option.componentOptions.children[0].text
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
);
},
//重置
resetEvt(){
this.form = {};
this.pageForm = {};
},
handlerRowClick(record) {
const { id, patientPolicyId } = record;
return {
style: {
color: record.isEdit ? "#2B63FF" : "#252631",
},
on: {
click: () => {
if (record.isEdit) {
return true;
}
if((record.cardNo || '').startsWith('80001428')){
this.$apis.GETJUMPECCSURL({
cardNo: record.cardNo
})
.then(res => {
if (res.returnCode === "0000") {
window.open(res.content, '_blank');
}else{
this.$message.error(res.returnMsg || "操作失败");
}
})
}else{
this.$router.push({
name: "welfareInfo",
query: { id, patientPolicyId },
});
}
},
},
};
},
// 修改按钮
changeDataStatus(record, type) {
const { id, patientPolicyId } = record;
this.$router.push({
name: "customerEdit",
query: { id, patientPolicyId, type },
});
},
saveChange(record) {
record.isEdit = undefined;
record.isNew = undefined;
},
handlerSearch() {
this.$refs.form.validate((valid) => {
if (!valid) {
return false;
}
this.pager.pageNum = 1;
this.pageForm = this.$lodash.cloneDeep(this.form);
this._getCustomerList();
});
},
printClaimPdf(data) {
this.$apis.CREATECUSTOMERCLAIMPGF(data).then(res => {
const {url, file_name} = downloadFile(res);
console.log(url, file_name)
let link = document.createElement('a');
link.setAttribute('href', url);
// link.setAttribute('download', file_name);
link.setAttribute('target', "_blank");
link.setAttribute('alt', file_name);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
})
},
deleteData(data) {
this.$apis.DELETECUSTOM({id: data.id}).then(res => {
if (res.returnCode === "0000") {
this.$message.success(res.returnMsg || "操作成功");
this._getCustomerList();
} else {
this.$message.error(res.returnMsg || "操作失败");
}
})
},
// 新建客户信息
addNewCustom() {
this.$router.push("/customer/edit");
},
_getPayorCode() {
this.$apis.GETPAYORCODE({}).then((res) => {
this.companyCode = res.content || [];
});
},
_getCustomerList() {
const data = {
...this.pageForm,
...this.pager,
};
this.$apis.GETCUSTOMERLIST(data).then((res) => {
this.pager.total = (res.content && res.content.total) || 0;
const data = (res.content && res.content.list) || [];
data.forEach(item => {
item.isExpired = moment(item.endDate).valueOf() < moment(new Date()).valueOf()
});
console.log(data)
this.dataList = data;
});
},
},
};
</script>
<style lang="less" scoped>
.none-label {
text-align: right;
.ant-form-item-label {
opacity: 0;
}
}
.ant-btn .icon-class {
.mg-r(10);
}
.red-text{
color: red;
}
</style>