@liuqiongqiong/vue-pages 1.0.4 → 1.0.6

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