@liuqiongqiong/vue-pages 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,777 @@
1
+ <template>
2
+ <div class="app-container">
3
+ <div class="filter-container">
4
+ <el-form ref="listQuery" :inline="true" :model="listQuery" class="demo-form-inline">
5
+ <el-form-item label="姓名" prop="name">
6
+ <el-select v-model="listQuery.name" style="width: 100%" clearable filterable size="small" class="filter-item"
7
+ placeholder="请选择姓名">
8
+ <el-option v-for="(item, index) in renyuanxinxi" :key="index" :label="item.name" :value="item.name" />
9
+ </el-select>
10
+ </el-form-item>
11
+ <el-form-item>
12
+ <el-button size="small" type="primary" @click="onSubmit">查询</el-button>
13
+ </el-form-item>
14
+ <el-form-item>
15
+ <el-button size="small" type="warning" @click="resetting('listQuery')">重置</el-button>
16
+ </el-form-item>
17
+ <el-form-item>
18
+ <el-button size="small" type="success" @click="add">新增</el-button>
19
+ </el-form-item>
20
+ </el-form>
21
+ </div>
22
+ <el-table border height="65vh" :data="list" style="width: 100%">
23
+ <!-- @sort-change="sortChange" -->
24
+ <el-table-column :label="'姓名'" prop="id" align="center">
25
+ <template slot-scope="{ row }">
26
+ <span>{{ row.name }}</span>
27
+ </template>
28
+ </el-table-column>
29
+ <el-table-column :label="'性别'" align="center">
30
+ <template slot-scope="{ row }">
31
+ <span>{{ row.sex }}</span>
32
+ </template>
33
+ </el-table-column>
34
+ <el-table-column :label="'手机号码'" align="center">
35
+ <template slot-scope="{ row }">
36
+ <span>{{ row.phoneNumber }}</span>
37
+ <!-- <el-tag>{{ row.type | typeFilter }}</el-tag> -->
38
+ </template>
39
+ </el-table-column>
40
+ <el-table-column :label="'身份证号'" align="center">
41
+ <template slot-scope="{ row }">
42
+ <span>{{ row.idCard }}</span>
43
+ <!-- <span style="color:red;">{{ row.reviewer }}</span> -->
44
+ </template>
45
+ </el-table-column>
46
+ <el-table-column :label="'状态'" align="center">
47
+ <template slot-scope="{ row }">
48
+ <el-tag size="medium" :type="row.approveStatus == 0 ? 'danger' : row.approveStatus == 1 ? 'success' : ''
49
+ ">
50
+ <span v-if="row.approveStatus == 0">不通过</span>
51
+ <span v-if="row.approveStatus == 1">通过</span>
52
+ </el-tag>
53
+ </template>
54
+ </el-table-column>
55
+ <el-table-column :label="'资质证书'" align="center">
56
+ <template slot-scope="{ row }">
57
+ <el-image v-for="(item, index) in row.certPicUrlList" :key="index" style="width: 50px; height: 50px"
58
+ :src="`${constant}${img(item)}`" :preview-src-list="[`${constant}${img(item)}`]" />
59
+ </template>
60
+ </el-table-column>
61
+ <el-table-column :label="'身份证'" align="center">
62
+ <template slot-scope="{ row }">
63
+ <el-image v-for="(item, index) in row.sfzUrlList" :key="index" style="width: 50px; height: 50px"
64
+ :src="`${constant}${img(item)}`" :preview-src-list="[`${constant}${img(item)}`]" />
65
+ </template>
66
+ </el-table-column>
67
+ <el-table-column :label="'学历证书'" align="center">
68
+ <template slot-scope="{ row }">
69
+ <el-image v-for="(item, index) in row.xlUrlList" :key="index" style="width: 50px; height: 50px"
70
+ :src="`${constant}${img(item)}`" :preview-src-list="[`${constant}${img(item)}`]" />
71
+ </template>
72
+ </el-table-column>
73
+ <!-- <el-table-column :label="'状态'" align="center">
74
+ <template slot-scope="{row}">
75
+ <el-tag size="medium" :type="row.status == '1' ? 'success' : row.status == '2' ? 'warning' : '' " >{{ row.status == '1' ? '有效' : row.status == '2' ? '无效' : row.status == '0' ? '待审核' : '-'}}</el-tag>
76
+ </template>
77
+ </el-table-column> -->
78
+ <el-table-column :label="'操作'" align="center" width="280" class-name="small-padding fixed-width">
79
+ <template slot-scope="{ row, $index }">
80
+
81
+ <el-button size="mini" type="primary" @click="edit(row, 'draft')">
82
+ 修改
83
+ </el-button>
84
+
85
+ </template>
86
+ </el-table-column>
87
+ </el-table>
88
+
89
+ <pagination v-show="total > 0" :total="total" :page.sync="listQuery.pageNo" :limit.sync="listQuery.size"
90
+ @pagination="getList" />
91
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="textMap[dialogStatus]"
92
+ :visible.sync="dialogFormVisible" width="40%">
93
+ <el-form ref="dataForm" :rules="rules" :model="temp" label-position="right" label-width="150px">
94
+ <el-row :gutter="20">
95
+ <el-col :span="12">
96
+ <el-form-item label="姓名" prop="name">
97
+ <el-input v-model="temp.name" size="small" clearable placeholder="请输入姓名" />
98
+ </el-form-item>
99
+ </el-col>
100
+ <el-col :span="12">
101
+ <el-form-item label="性别" prop="sex">
102
+ <el-select v-model="temp.sex" style="width: 100%" clearable filterable size="small" placeholder="请选择性别"
103
+ class="filter-item">
104
+ <el-option v-for="(item, index) in [
105
+ { label: '男', value: 1 },
106
+ { label: '女', value: 2 },
107
+ ]" :key="index" :label="item.label" :value="item.value" />
108
+ </el-select>
109
+ </el-form-item>
110
+ </el-col>
111
+ <el-col :span="12">
112
+ <el-form-item label="手机号码" prop="phoneNumber">
113
+ <el-input v-model="temp.phoneNumber" size="small" clearable placeholder="请输入手机号码" />
114
+ </el-form-item>
115
+ </el-col>
116
+ <el-col :span="12">
117
+ <el-form-item label="身份证号" prop="idCard">
118
+ <el-input v-model="temp.idCard" size="small" clearable placeholder="请输入身份证号" />
119
+ </el-form-item>
120
+ </el-col>
121
+ <el-col :span="12">
122
+ <el-form-item label="所属机构" prop="unitId">
123
+ <el-select v-model="temp.unitId" style="width: 100%" clearable filterable size="small" class="filter-item"
124
+ placeholder="请选择所属机构">
125
+ <el-option v-for="(item, index) in institutionArrData" :key="index" :label="item.label"
126
+ :value="item.value" />
127
+ </el-select>
128
+ </el-form-item>
129
+ </el-col>
130
+ <el-col :span="12">
131
+ <el-form-item label="归属医保区划" prop="addrAdmdvs">
132
+ <el-select v-model="temp.addrAdmdvs" style="width: 100%" clearable filterable size="small"
133
+ class="filter-item" placeholder="请选择归属医保区划">
134
+ <el-option v-for="(item, index) in admdvsOptions" :key="index" :label="item.label"
135
+ :value="item.value" />
136
+ </el-select>
137
+ </el-form-item>
138
+ </el-col>
139
+ <el-col :span="12">
140
+ <el-form-item label="数据权限医保区划" prop="admdvs">
141
+ <el-select v-model="temp.admdvs" style="width: 100%" clearable filterable size="small" class="filter-item"
142
+ placeholder="请选择数据权限医保区划">
143
+ <el-option v-for="(item, index) in admdvsOptions" :key="index" :label="item.label"
144
+ :value="item.value" />
145
+ </el-select>
146
+ </el-form-item>
147
+ </el-col>
148
+ <el-col :span="12">
149
+ <el-form-item label="审核状态" prop="approveStatus">
150
+ <el-select v-model="temp.approveStatus" style="width: 100%" clearable filterable size="small"
151
+ class="filter-item" placeholder="请选择审核状态">
152
+ <el-option label="通过" :value="1" />
153
+ <el-option label="不通过" :value="0" />
154
+ </el-select>
155
+ </el-form-item>
156
+ </el-col>
157
+ <el-col :span="24">
158
+ <el-form-item label="资质证书" prop="certPicUrlList">
159
+ <el-upload action="#" :limit="1" :before-upload="beforeAvatarUploada" :http-request="certhandleFileUpload"
160
+ :data="{ att_type: '22' }" :on-remove="handleCertPicUrlRemove" :before-remove="beforeRemove"
161
+ :on-error="handleError" :file-list="temp.certPicUrlList" :on-preview="onPreview">
162
+ <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
163
+ </el-upload>
164
+ </el-form-item>
165
+ </el-col>
166
+ <el-col :span="24">
167
+ <el-form-item label="身份证" prop="sfzUrlList">
168
+ <el-upload action="#" :limit="1" :data="{ att_type: '01' }" :before-upload="beforeAvatarUploada"
169
+ :http-request="sfzhandleFileUpload" :on-remove="handleSfzUrllRemove" :before-remove="beforeRemove"
170
+ :file-list="temp.sfzUrlList" :on-preview="onPreview">
171
+ <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
172
+ </el-upload>
173
+ </el-form-item>
174
+ </el-col>
175
+ <el-col :span="24">
176
+ <el-form-item label="健康证" prop="xlUrlList">
177
+ <el-upload action="#" :limit="1" :data="{ att_type: '99' }" :before-upload="beforeAvatarUploada"
178
+ :http-request="xlhandleFileUpload" :on-remove="handleXlUrlRemove" :before-remove="beforeRemove"
179
+ :file-list="temp.xlUrlList" :on-preview="onPreview">
180
+ <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
181
+ </el-upload>
182
+ </el-form-item>
183
+ </el-col>
184
+ </el-row>
185
+ </el-form>
186
+ <div slot="footer" class="dialog-footer">
187
+ <el-button size="small" @click="dialogFormVisible = false">
188
+ 取 消
189
+ </el-button>
190
+ <el-button type="primary" size="small" @click="dialogStatus === 'create' ? createData() : updateData()">
191
+ 确 认
192
+ </el-button>
193
+ </div>
194
+ </el-dialog>
195
+ <preview-file :file="file" />
196
+ </div>
197
+ </template>
198
+
199
+ <script>
200
+ import {
201
+ SPersonSave,
202
+ SPersonPage,
203
+ SPersonDel,
204
+ updateStatus,
205
+ } from "@/api/article";
206
+ import { SysUnitPage } from "@/api/institution";
207
+ import { uploadTP, uploadPDF, uploadThird } from "@/api/upload";
208
+ import { fileUrl } from "@/utils/fileUrl.js";
209
+ import Pagination from "@/components/Pagination";
210
+ import PreviewFile from "@/components/previewFile";
211
+ import { getUserInfoRole } from "@/utils/auth";
212
+ export default {
213
+ name: "Personnel",
214
+ components: { Pagination, PreviewFile },
215
+ filters: {},
216
+ data() {
217
+ return {
218
+ userInfo: {},
219
+ renyuanxinxi: [],
220
+ file: {
221
+ fileurl: "",
222
+ dialogVisible: false,
223
+ title: "",
224
+ type: "",
225
+ },
226
+ FormData: {},
227
+ institutionArrData: [],
228
+ admdvsOptions: [
229
+ { value: "330302", label: "鹿城区" },
230
+ { value: "330303", label: "龙湾区" },
231
+ { value: "330304", label: "瓯海区" },
232
+ { value: "330305", label: "洞头区" },
233
+ { value: "330381", label: "瑞安市" },
234
+ { value: "330382", label: "乐清市" },
235
+ { value: "330383", label: "龙港市" },
236
+ { value: "330324", label: "永嘉县" },
237
+ { value: "330326", label: "平阳县" },
238
+ { value: "330327", label: "苍南县" },
239
+ { value: "330328", label: "文成县" },
240
+ { value: "330329", label: "泰顺县" },
241
+ { value: "330399", label: "市本级" }
242
+ ],
243
+ dialogStatus: "",
244
+ textMap: { update: "编辑", create: "创建" },
245
+ tableKey: 0,
246
+ list: null,
247
+ total: 0,
248
+ listLoading: true,
249
+ listQuery: {
250
+ pageNo: 1,
251
+ size: 20,
252
+ },
253
+ dialogFormVisible: false,
254
+ dialogPvVisible: false,
255
+ rules: {
256
+ name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
257
+ idCard: [
258
+ { required: true, message: "请输入身份证号", trigger: "blur" },
259
+ ],
260
+ phoneNumber: [
261
+ { required: true, message: "请输入手机号码", trigger: "blur" },
262
+ ],
263
+ sex: [{ required: true, message: "请选择性别", trigger: "change" }],
264
+ unitId: [
265
+ { required: true, message: "请选择所属机构", trigger: "change" },
266
+ ],
267
+ addrAdmdvs: [{ required: true, message: "请选择归属医保区划", trigger: "change" }],
268
+ admdvs: [{ required: true, message: "请选择数据权限医保区划", trigger: "change" }],
269
+ approveStatus: [{ required: true, message: "请选择审核状态", trigger: "change" }],
270
+ },
271
+ temp: {
272
+ longtermPsnAttDtoList: [],
273
+ },
274
+ downloadLoading: false,
275
+ };
276
+ },
277
+ computed: {
278
+ constant() {
279
+ return this.$constant.imgAddr;
280
+ },
281
+ img() {
282
+ return function (value) {
283
+ if (value.match(/^chx\/tp\//)) {
284
+ return value;
285
+ } else {
286
+ return "chx/tp/" + value;
287
+ }
288
+ };
289
+ },
290
+ },
291
+ created() {
292
+ console.log("VUE_APP_BASE_API:", process.env);
293
+ this.getList();
294
+ this.getinstitution();
295
+ this.userInfo = JSON.parse(getUserInfoRole());
296
+ },
297
+ methods: {
298
+ handleError(err, file, fileList) {
299
+ console.log("上传失败", err, file, fileList);
300
+ // 这里可以添加你的错误处理逻辑,比如提示用户或者重试上传
301
+ this.$message.error("图片上传失败,请重试");
302
+ },
303
+ // 获取机构
304
+ getinstitution() {
305
+ SysUnitPage({ pageNo: 1, size: 9999 }).then((response) => {
306
+ this.institutionArrData = response.result.data.map((item) => {
307
+ return { label: item.name, value: item.id };
308
+ });
309
+ });
310
+ },
311
+ // 文件格式验证
312
+ beforeAvatarUploada(file) {
313
+ this.loadingstate = true;
314
+ const index = file.name.lastIndexOf(".");
315
+ const extension = file.name.substr(index + 1);
316
+ const extensionList = ["png", "PNG", "jpg", "JPG", "jpeg", "JPEG"];
317
+ const isLt2M = file.size / 1024 / 1024 < 10;
318
+ if (!isLt2M) {
319
+ this.$message({
320
+ message: "封面不可超出10M",
321
+ type: "warning",
322
+ center: true,
323
+ });
324
+ return false;
325
+ } else if (extensionList.indexOf(extension) < 0) {
326
+ this.$message({
327
+ message: "只能图片文件",
328
+ type: "error",
329
+ center: true,
330
+ });
331
+ return false;
332
+ }
333
+ },
334
+ onPreview(file) {
335
+ const type = fileUrl(file.url);
336
+ let url = `${this.$constant.imgAddr}${file.url}`;
337
+ console.log(url);
338
+ if (
339
+ type == "word" ||
340
+ type == "wps" ||
341
+ type == "pdf" ||
342
+ type == "pptx" ||
343
+ type == "txt"
344
+ ) {
345
+ this.file.type = type;
346
+ url = `https://wps-view.zhihuipk.com/?src=` + url;
347
+ } else if (type == "image") {
348
+ this.file.type = type;
349
+ } else if (type == "video") {
350
+ this.file.type = type;
351
+ } else if (type == "radio") {
352
+ this.file.type = type;
353
+ } else {
354
+ this.$message.error("该格式不可在线预览,请下载后查看");
355
+ return;
356
+ }
357
+ this.file.fileurl = url; // 后端请求回来的文件地址url
358
+ this.file.dialogVisible = true; // 弹窗
359
+ this.file.title = file.name; // 文件名称
360
+ },
361
+ beforeRemove(file, fileList) {
362
+ return this.$confirm(`确定移除 ${file.name}?`);
363
+ },
364
+ handleCertPicUrlRemove(file, fileList) {
365
+ this.temp.certPicUrlList = this.temp.certPicUrlList.filter((item) => {
366
+ // const regex = /(.*\/)([^\/]+)\.(jpg|png)$/;
367
+ // const match1 = item.name.match(regex);
368
+ // if (match1) {
369
+ // return match1[2] + '.' + match1[3] != file.name
370
+ // }
371
+ return item.name != file.name;
372
+ });
373
+ this.temp.longtermPsnAttDtoList = this.temp.longtermPsnAttDtoList.filter(
374
+ (item) => {
375
+ return item.att_name != file.name;
376
+ }
377
+ );
378
+ },
379
+ handleSfzUrllRemove(file, fileList) {
380
+ this.temp.sfzUrlList = this.temp.sfzUrlList.filter((item) => {
381
+ // const regex = /(.*\/)([^\/]+)\.(jpg|png)$/;
382
+ // const match1 = item.name.match(regex);
383
+ // if (match1) {
384
+ // return match1[2] + '.' + match1[3] != file.name
385
+ // }
386
+ return item.name != file.name;
387
+ });
388
+ this.temp.longtermPsnAttDtoList = this.temp.longtermPsnAttDtoList.filter(
389
+ (item) => {
390
+ return item.att_name != file.name;
391
+ }
392
+ );
393
+ },
394
+ handleXlUrlRemove(file, fileList) {
395
+ this.temp.xlUrlList = this.temp.xlUrlList.filter((item) => {
396
+ // const regex = /(.*\/)([^\/]+)\.(jpg|png)$/;
397
+ // const match1 = item.name.match(regex);
398
+ // if (match1) {
399
+ // return match1[2] + '.' + match1[3] != file.name
400
+ // }
401
+ return item.name != file.name;
402
+ });
403
+ this.temp.longtermPsnAttDtoList = this.temp.longtermPsnAttDtoList.filter(
404
+ (item) => {
405
+ return item.att_name != file.name;
406
+ }
407
+ );
408
+ // this.temp.xlUrlList = this.xlUrlList
409
+ },
410
+
411
+ // 处理文件上传操作
412
+ certhandleFileUpload(file) {
413
+ const obj = new FormData();
414
+ // 上传文件
415
+ obj.append("file", file.file);
416
+ obj.append("realPath", file.file.name);
417
+ obj.append("fileName", file.file.name);
418
+ obj.append("att_type", file.data.att_type);
419
+ this.temp.certPicUrlList = [];
420
+ // 上传文件接口
421
+ uploadTP(obj).then((data) => {
422
+ console.log(data);
423
+ if (data.status == 1) {
424
+ this.$message({
425
+ message: "上传成功",
426
+ type: "success",
427
+ });
428
+ }
429
+ this.temp.certPicUrlList.push({
430
+ url: data.result.url,
431
+ name: data.result.name,
432
+ });
433
+ uploadThird(obj).then((res) => {
434
+ if (res.status == 1) {
435
+ const obj = {
436
+ att_type: file.data.att_type,
437
+ att_name: res.result.output.att_name,
438
+ file_id: res.result.output.file_id,
439
+ file_type: res.result.output.file_type,
440
+ };
441
+ this.temp.longtermPsnAttDtoList.push(obj);
442
+ }
443
+ });
444
+ });
445
+ },
446
+ sfzhandleFileUpload(file) {
447
+ const obj = new FormData();
448
+ // 上传文件
449
+ obj.append("file", file.file);
450
+ obj.append("realPath", file.file.name);
451
+ obj.append("fileName", file.file.name);
452
+ obj.append("att_type", file.data.att_type);
453
+ this.temp.sfzUrlList = [];
454
+ // 上传文件接口
455
+ uploadTP(obj).then((data) => {
456
+ console.log(data);
457
+ if (data.status == 1) {
458
+ this.$message({
459
+ message: "上传成功",
460
+ type: "success",
461
+ });
462
+ }
463
+ this.temp.sfzUrlList.push({
464
+ url: data.result.url,
465
+ name: data.result.name,
466
+ });
467
+ uploadThird(obj).then((res) => {
468
+ if (res.status == 1) {
469
+ const obj = {
470
+ att_type: file.data.att_type,
471
+ att_name: res.result.output.att_name,
472
+ file_id: res.result.output.file_id,
473
+ file_type: res.result.output.file_type,
474
+ };
475
+ this.temp.longtermPsnAttDtoList.push(obj);
476
+ }
477
+ });
478
+ });
479
+ },
480
+ xlhandleFileUpload(file) {
481
+ const obj = new FormData();
482
+ // 上传文件
483
+ obj.append("file", file.file);
484
+ obj.append("realPath", file.file.name);
485
+ obj.append("fileName", file.file.name);
486
+ obj.append("att_type", file.data.att_type);
487
+ this.temp.xlUrlList = [];
488
+ // 上传文件接口
489
+ uploadTP(obj).then((data) => {
490
+ console.log(data);
491
+ if (data.status == 1) {
492
+ this.$message({
493
+ message: "上传成功",
494
+ type: "success",
495
+ });
496
+ }
497
+ this.temp.xlUrlList.push({
498
+ url: data.result.url,
499
+ name: data.result.name,
500
+ });
501
+ uploadThird(obj).then((res) => {
502
+ if (res.status == 1) {
503
+ const obj = {
504
+ att_type: file.data.att_type,
505
+ att_name: res.result.output.att_name,
506
+ file_id: res.result.output.file_id,
507
+ file_type: res.result.output.file_type,
508
+ };
509
+ this.temp.longtermPsnAttDtoList.push(obj);
510
+ }
511
+ });
512
+ });
513
+ },
514
+ add() {
515
+ this.dialogStatus = "create";
516
+ this.dialogFormVisible = true;
517
+ this.temp = {};
518
+ this.temp.longtermPsnAttDtoList = [];
519
+ this.temp.xlUrlList = [];
520
+ this.temp.certPicUrlList = [];
521
+ this.temp.sfzUrlList = [];
522
+ },
523
+ update(row) {
524
+ updateStatus({ id: row.id }).then((res) => {
525
+ if (res.status == 1) {
526
+ this.getList();
527
+ this.$notify({
528
+ title: res.info,
529
+ message: "更新成功",
530
+ type: "success",
531
+ duration: 2000,
532
+ });
533
+ this.dialogFormVisible = false;
534
+ return;
535
+ }
536
+ this.$notify({
537
+ title: res.info,
538
+ message: "更新失败",
539
+ type: "error",
540
+ duration: 2000,
541
+ });
542
+ });
543
+ },
544
+ edit(row) {
545
+ // if(!contains22Or01) {
546
+ // this.$message({
547
+ // message: "请传资质证书或身份证",
548
+ // type: "warning",
549
+ // center: true,
550
+ // });
551
+ // }
552
+ this.temp = JSON.parse(JSON.stringify(row));
553
+ this.dialogStatus = "update";
554
+ this.dialogFormVisible = true;
555
+ this.temp.longtermPsnAttDtoList = [];
556
+ this.temp.certPicUrlList = [];
557
+ this.temp.sfzUrlList = [];
558
+ this.temp.xlUrlList = [];
559
+ if (row.certPicUrlList) {
560
+ this.temp.certPicUrlList = row.certPicUrlList.map((res) => {
561
+ return {
562
+ name: res,
563
+ url: res,
564
+ };
565
+ });
566
+ }
567
+ if (row.sfzUrlList) {
568
+ this.temp.sfzUrlList = row.sfzUrlList.map((res) => {
569
+ return {
570
+ name: res,
571
+ url: res,
572
+ };
573
+ });
574
+ }
575
+ if (row.xlUrlList) {
576
+ this.temp.xlUrlList = row.xlUrlList.map((res) => {
577
+ return {
578
+ name: res,
579
+ url: res,
580
+ };
581
+ });
582
+ }
583
+ if (this.temp.thirdFileList && this.temp.thirdFileList.length > 0) {
584
+ for (var i = 0; i < this.temp.thirdFileList.length; i++) {
585
+ if (
586
+ this.temp.thirdFileList[i].att_type == "01" ||
587
+ this.temp.thirdFileList[i].att_type == "21" ||
588
+ this.temp.thirdFileList[i].att_type == "22"
589
+ ) {
590
+ this.temp.longtermPsnAttDtoList.push(this.temp.thirdFileList[i]);
591
+ }
592
+ }
593
+ }
594
+ },
595
+ getList() {
596
+ this.listLoading = true;
597
+ SPersonPage(this.listQuery).then((response) => {
598
+ this.list = response.result.data;
599
+ this.total = response.result.count;
600
+ setTimeout(() => {
601
+ this.listLoading = false;
602
+ }, 1.5 * 1000);
603
+ });
604
+ SPersonPage({ size: 9999, pageNo: 1 }).then((response) => {
605
+ this.renyuanxinxi = response.result.data;
606
+ });
607
+ },
608
+ handleModifyStatus(row, status) {
609
+ this.$message({
610
+ message: "操作成功",
611
+ type: "success",
612
+ });
613
+ row.status = status;
614
+ },
615
+ resetting(formName) {
616
+ this.$nextTick(() => {
617
+ this.$refs[formName].resetFields();
618
+ });
619
+ },
620
+ onSubmit() {
621
+ this.getList();
622
+ },
623
+ createData() {
624
+ this.$refs["dataForm"].validate((valid) => {
625
+ if (valid) {
626
+ this.temp.rolel = "2";
627
+ const obj = {
628
+ certPicUrlList: [],
629
+ xlUrlList: [],
630
+ sfzUrlList: [],
631
+ };
632
+ if (this.temp.certPicUrlList.length > 0) {
633
+ obj.certPicUrlList = this.temp.certPicUrlList.map((item) => {
634
+ return item.name;
635
+ });
636
+ }
637
+ if (this.temp.xlUrlList.length > 0) {
638
+ obj.xlUrlList = this.temp.xlUrlList.map((item) => {
639
+ return item.name;
640
+ });
641
+ }
642
+ if (this.temp.sfzUrlList.length > 0) {
643
+ obj.sfzUrlList = this.temp.sfzUrlList.map((item) => {
644
+ return item.name;
645
+ });
646
+ }
647
+ SPersonSave({ ...this.temp, ...obj }).then((res) => {
648
+ if (res.status == 1) {
649
+ this.getList();
650
+ this.$notify({
651
+ title: res.info,
652
+ message: "创建成功,请通知医保审核",
653
+ type: "success",
654
+ duration: 2000,
655
+ });
656
+ this.dialogFormVisible = false;
657
+ return;
658
+ }
659
+ this.$notify({
660
+ title: res.info,
661
+ message: "创建失败",
662
+ type: "error",
663
+ duration: 2000,
664
+ });
665
+ });
666
+ }
667
+ });
668
+ },
669
+ hasBothValues(arr, value1, value2) {
670
+ const has22 = arr.some((item) => item.att_type === value1);
671
+ const has01 = arr.some((item) => item.att_type === value2);
672
+ return has22 && has01;
673
+ },
674
+ updateData() {
675
+ this.$refs["dataForm"].validate((valid) => {
676
+ if (valid) {
677
+ this.temp.rolel = "2";
678
+ const obj = {
679
+ certPicUrlList: [],
680
+ xlUrlList: [],
681
+ sfzUrlList: [],
682
+ };
683
+ if (
684
+ this.temp.certPicUrlList.length > 0 &&
685
+ this.temp.certPicUrlList[0]
686
+ ) {
687
+ obj.certPicUrlList = this.temp.certPicUrlList.map((item) => {
688
+ return item.name;
689
+ });
690
+ }
691
+ if (this.temp.xlUrlList.length > 0 && this.temp.xlUrlList[0]) {
692
+ obj.xlUrlList = this.temp.xlUrlList.map((item) => {
693
+ return item.name;
694
+ });
695
+ }
696
+ if (this.temp.sfzUrlList.length > 0 && this.temp.sfzUrlList[0]) {
697
+ obj.sfzUrlList = this.temp.sfzUrlList.map((item) => {
698
+ return item.name;
699
+ });
700
+ }
701
+ if (this.temp.longtermPsnAttDtoList.length == 0) {
702
+ this.$message({
703
+ message: "请上传材料",
704
+ type: "warning",
705
+ center: true,
706
+ });
707
+ return;
708
+ }
709
+ const result = this.hasBothValues(
710
+ this.temp.longtermPsnAttDtoList,
711
+ "22",
712
+ "01"
713
+ );
714
+ console.log(result);
715
+ if (!result) {
716
+ this.$message({
717
+ message: "请传资质证书或身份证",
718
+ type: "warning",
719
+ center: true,
720
+ });
721
+ }
722
+ SPersonSave({ ...this.temp, ...obj }).then((res) => {
723
+ if (res.status == 1) {
724
+ this.getList();
725
+ this.$notify({
726
+ title: res.info,
727
+ message: "更新成功,请通知医保审核",
728
+ type: "success",
729
+ duration: 2000,
730
+ });
731
+ this.dialogFormVisible = false;
732
+ return;
733
+ }
734
+ this.$notify({
735
+ title: res.info,
736
+ message: "更新失败",
737
+ type: "error",
738
+ duration: 2000,
739
+ });
740
+ });
741
+ }
742
+ });
743
+ },
744
+ handleDelete(row, index) {
745
+ this.$confirm('护工注销需要确认上传明细,以免冲正重新上传变成自费,是否继续?', '提示', {
746
+ confirmButtonText: '确定',
747
+ cancelButtonText: '取消',
748
+ type: 'warning'
749
+ }).then(() => {
750
+ SPersonDel({ id: row.id, isDelete: "1" }).then((res) => {
751
+ if (res.status == 1) {
752
+ this.getList();
753
+ this.$notify({
754
+ title: res.info,
755
+ message: "删除成功",
756
+ type: "success",
757
+ duration: 2000,
758
+ });
759
+ return;
760
+ }
761
+ this.$notify({
762
+ title: res.info,
763
+ message: "删除失败",
764
+ type: "error",
765
+ duration: 2000,
766
+ });
767
+ });
768
+ }).catch(() => {
769
+ this.$message({
770
+ type: 'info',
771
+ message: '已取消删除'
772
+ });
773
+ });
774
+ },
775
+ },
776
+ };
777
+ </script>