zss
2025-02-18 4b1898aa7f82e400b5958293c6c0a5dce5da6d6c
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
<!-- 设备验收 -->
<template>
  <div>
    <div class="search">
      <div class="search_thing">
        <div class="search_label">流程编号:</div>
        <div class="search_input"><el-input v-model="search.processNumber" clearable placeholder="请输入" size="small"
            @keyup.enter.native="getDeviceAList(clickNodeVal.value)"></el-input></div>
        <el-button size="small" style="margin-left: 10px" @click="resetSearch">重 置</el-button>
        <el-button size="small" type="primary" @click="getDeviceAList(clickNodeVal.value)">查 询</el-button>
      </div>
      <div class="search_thing">
        <el-button size="small" type="primary" @click="dialogVisible = true">添加验收</el-button>
        <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导出</el-button>
      </div>
    </div>
    <div class="tables">
      <el-table ref="table" :data="tableDataAlist" height="100%">
        <el-table-column label="序号" type="index" width="60">
          <template v-slot="scope">
            <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column label="流程编号" min-width="150" prop="processNumber" show-overflow-tooltip/>
        <el-table-column label="设备名称" min-width="140" prop="deviceName" show-overflow-tooltip/>
        <el-table-column label="管理编号" min-width="140" prop="managementNumber" show-overflow-tooltip/>
        <el-table-column label="序列号" min-width="80" prop="serialNumber" />
        <el-table-column label="提交者" min-width="100" prop="submitUser" />
        <el-table-column label="提交日期" min-width="150" prop="createTime" />
        <el-table-column label="当前状态" min-width="140" prop="currentState" />
        <el-table-column label="当前负责人" min-width="120" prop="currentResponsible" />
        <el-table-column fixed="right" label="操作" min-width="180">
          <template #default="{ row }">
            <el-button size="small" type="text" @click="handleAttachmentClick(row)">附件</el-button>
            <el-button size="small" type="text" @click="handleViewClick(row)">查看</el-button>
            <el-button size="small" type="text" @click="handleDownOne(row)">导出</el-button>
            <el-button size="small" type="text" @click="handleDeleteClick(row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
        :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
        @current-change="handleCurrentChange">
      </el-pagination>
    </div>
    <!-- 添加设备故障记录 -->
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" title="仪器设备验收记录"
      width="60%" @open="openRecordAcceptance">
      <el-steps :active="currentStep" finish-status="success">
        <el-step v-for="(v, i) in steps" :key="i" :title="v" style="cursor:pointer"
          @click.native="choiceStep(i)"></el-step>
      </el-steps>
      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
        <div v-show="currentStepClick === 0">
          <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
            <!-- 新增设备事记录卡片 -->
            <el-row>
              <el-col :span="24">
                <el-form-item label="流程编号:" prop="processNumber">
                  <el-input v-model="form.processNumber" disabled size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="设备名称:">
                  <el-input v-model="form.deviceName" disabled size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="生产厂家:">
                  <el-input v-model="form.manufacturer" disabled size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="设备型号:">
                  <el-input v-model="form.specificationModel" disabled size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="管理编号:">
                  <el-input v-model="form.managementNumber" disabled size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item :rules="[{ required: currentStep === 0, message: '请输入序列号', trigger: 'blur' }]" label="序列号:"
                  prop="serialNumber">
                  <el-input v-model="form.serialNumber" :disabled="currentStep !== 0" size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item :rules="[{ required: currentStep === 0, message: '请输入设备类别', trigger: 'change' }]" label="设备类别:"
                  prop="deviceClass">
                  <el-radio-group v-model="form.deviceClass" :disabled="currentStep !== 0">
                    <el-radio label="0precision">精密型设备</el-radio>
                    <el-radio label="1conventional">常规设备</el-radio><br />
                    <el-radio label="2auxiliary_class">辅助类设备</el-radio>
                    <el-radio label="4environmental">环境类设备</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item :rules="[{ required: currentStep === 0, message: '请输入开箱前检查外包装有无破损', trigger: 'blur' }]" label="开箱前检查外包装有无破损:" label-width="220px"
                  prop="checkOuterPackaging">
                  <el-input v-model="form.checkOuterPackaging" :disabled="currentStep !== 0" size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="相关附件:" prop="fileName">
                  <el-input v-model="form.fileName" :style="`width: ${currentStep == 0 ? '88%' : '100%'};`" disabled
                    size="small">
                    <el-button v-if="currentStep === 0" slot="append" icon="el-icon-delete-solid"
                      @click="deleteFile"></el-button>
                  </el-input>
                  <el-upload ref="upload" :action="action" :on-success="onSuccess" :show-file-list="false"
                    style="float: right;">
                    <el-button v-if="currentStep === 0" slot="trigger" class="uploadFile" size="small"
                      style="position: relative;top: -4px" type="primary">附件上传</el-button>
                  </el-upload>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item :rules="[{ required: currentStep === 0, message: '请选择下环节责任人', trigger: 'change' }]" label="下环节责任人:"
                  prop="submitNextPesponsible">
                  <el-select v-model="form.submitNextPesponsible" :disabled="currentStep !== 0" clearable filterable
                    placeholder="请选择下环节负责人" size="small" style="width: 50%;">
                    <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item :rules="[{ required: currentStep === 0, message: '请输入设备开箱验收结论', trigger: 'change' }]" label="设备开箱验收结论:" label-width="150px"
                  prop="unpackingAcceptanceConclusion">
                  <el-radio-group v-model="form.unpackingAcceptanceConclusion" :disabled="currentStep !== 0">
                    <el-radio :label="'0qualified'">合格</el-radio>
                    <el-radio :label="'1unqualified'">不合格,缺少备件供应商补发</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <div style="margin-bottom: 20px; width: 100%;">
                  <label>备件确认:</label>
                  <el-button v-if="currentStep === 0" size="small" style="float: right;"
                    type="primary" @click="addTableRow('sparePartsConfirmationList')">增加行</el-button>
                </div>
                <el-table :data="form.sparePartsConfirmationList" border stripe style="width: 100%; min-height: 30vh">
                  <el-table-column label="序号" prop="序号" type="index" width="80" />
                  <el-table-column label="名称" min-width="120" prop="name">
                    <template v-slot="scope">
                      <el-input v-if="currentStep === 0" v-model="scope.row.name" size="small"></el-input>
                      <label v-else>{{ scope.row.name }}</label>
                    </template>
                  </el-table-column>
                  <el-table-column label="数量" min-width="120" prop="number">
                    <template v-slot="scope">
                      <el-input v-if="currentStep === 0" v-model="scope.row.number" size="small"></el-input>
                      <label v-else>{{ scope.row.number }}</label>
                    </template>
                  </el-table-column>
                  <el-table-column label="备注" min-width="120" prop="note">
                    <template v-slot="scope">
                      <el-input v-if="currentStep === 0" v-model="scope.row.note" size="small"></el-input>
                      <label v-else>{{ scope.row.note }}</label>
                    </template>
                  </el-table-column>
                  <el-table-column v-if="currentStep === 0" fixed="right" label="操作" width="90">
                    <template slot-scope="scope">
                      <el-button icon="el-icon-delete" type="text"
                        @click="deleteRow(scope.$index, scope.row, 'sparePartsConfirmationList')">删除</el-button>
                    </template>
                  </el-table-column>
                </el-table>
              </el-col>
              <el-col :span="24">
                <div style="margin: 20px 0; width: 100%;">
                  <label>文件类确认:</label>
                  <el-button v-if="currentStep === 0" size="small" style="float: right;"
                    type="primary" @click="addTableRow('fileClassConfirmationList')">增加行</el-button>
                </div>
                <el-table :data="form.fileClassConfirmationList" border stripe style="width: 100%; min-height: 30vh">
                  <el-table-column label="序号" prop="序号" type="index" width="80" />
                  <el-table-column label="应有册数" min-width="120" prop="expectedCopies">
                    <template v-slot="scope">
                      <el-input v-if="currentStep === 0" v-model="scope.row.expectedCopies" size="small"></el-input>
                      <label v-else>{{ scope.row.expectedCopies }}</label>
                    </template>
                  </el-table-column>
                  <el-table-column label="实际收到册数" min-width="120" prop="actualCopies">
                    <template v-slot="scope">
                      <el-input v-if="currentStep === 0" v-model="scope.row.actualCopies" size="small"></el-input>
                      <label v-else>{{ scope.row.actualCopies }}</label>
                    </template>
                  </el-table-column>
                  <el-table-column v-if="currentStep === 0" fixed="right" label="操作" width="90">
                    <template v-slot="scope">
                      <el-button icon="el-icon-delete" type="text"
                        @click="deleteRow(scope.$index, scope.row, 'fileClassConfirmationList')">删除</el-button>
                    </template>
                  </el-table-column>
                </el-table>
              </el-col>
              <el-col :span="24" style="margin-top: 10px;">
                <el-form-item label="备注:" label-width="90px">
                  <el-input v-model="form.submitRemarks" :disabled="currentStep !== 0" size="small"
                    type="textarea"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-card>
          <el-row style="margin-top: 1em;">
            <el-col :span="4">
              操作人:{{ form.submitOperatingPersonnel }}
            </el-col>
            <el-col :span="6">
              日期:{{ form.submitDate }}
            </el-col>
          </el-row>
        </div>
        <div v-show="currentStepClick === 1">
          <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
            <el-row>
              <el-col :span="24">
                <el-form-item label="复核意见:" prop="accidentDescription">
                  <el-input v-model="form.unpackingReviewOpinion" :disabled="currentStep !== 1" size="small"
                    type="textarea"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item :rules="[{ required: currentStep === 1, message: '请输入下环节责任人', trigger: 'change' }]" label="下环节责任人:"
                  prop="unpackingNextPesponsible">
                  <el-select v-model="form.unpackingNextPesponsible" :disabled="currentStep !== 1" clearable filterable
                    placeholder="请选择下环节负责人" size="small" style="width: 50%;">
                    <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </el-card>
          <el-row style="margin-top: 1em;">
            <el-col :span="4">
              操作人:{{ form.unpackingOperatingPersonnel }}
            </el-col>
            <el-col :span="6">
              日期:{{ form.unpackingDate }}
            </el-col>
          </el-row>
        </div>
        <div v-show="currentStepClick === 2">
          <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
            <el-row>
              <el-col :span="24">
                <el-form-item :rules="[{ required: currentStep === 2, message: '请输入安装位置', trigger: 'blur' }]" label="安装位置:"
                  prop="installLocation">
                  <el-input v-model="form.installLocation" :disabled="currentStep !== 2" clearable placeholder="请输入安装位置"
                    size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="备注:">
                  <el-input v-model="form.installRemarks" :disabled="currentStep !== 2" size="small"
                    type="textarea"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item :rules="[{ required: currentStep === 2, message: '请输入下环节责任人', trigger: 'blur' }]" label="下环节责任人:"
                  prop="installNextPesponsible">
                  <el-select v-model="form.installNextPesponsible" :disabled="currentStep !== 2" clearable filterable
                    placeholder="请选择下环节负责人" size="small" style="width: 50%;">
                    <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <div style="margin-bottom: 20px; width: 100%;">
                  <label>安装验收记录</label>
                  <el-button v-if="currentStep === 2" size="small" style="float: right;"
                    type="primary" @click="addTableRow('installationAcceptanceRecordList')">增加行</el-button>
                </div>
                <el-table :data="form.installationAcceptanceRecordList" border stripe
                  style="width: 100%; min-height: 30vh">
                  <el-table-column label="序号" prop="序号" type="index" width="80" />
                  <el-table-column label="项目" min-width="120" prop="installationProject">
                    <template v-slot="scope">
                      <el-input v-if="currentStep === 2" v-model="scope.row.installationProject"
                        size="small"></el-input>
                      <label v-else>{{ scope.row.installationProject }}</label>
                    </template>
                  </el-table-column>
                  <el-table-column label="安装情况" min-width="120" prop="installationSituation">
                    <template v-slot="scope">
                      <el-input v-if="currentStep === 2" v-model="scope.row.installationSituation"
                        size="small"></el-input>
                      <label v-else>{{ scope.row.installationSituation }}</label>
                    </template>
                  </el-table-column>
                  <el-table-column label="安装完成" min-width="120" prop="installationCompleted">
                    <template v-slot="scope">
                      <el-select v-if="currentStep === 2" v-model="scope.row.installationCompleted" placeholder="请选择">
                        <el-option label="是" value="0yes"></el-option>
                        <el-option label="否" value="1no"></el-option>
                      </el-select>
                      <label v-else>{{ scope.row.installationCompleted === '0yes' ? '是' :
                        scope.row.installationCompleted === '1no' ? '否' : '' }}</label>
                    </template>
                  </el-table-column>
                  <el-table-column v-if="currentStep === 2" fixed="right" label="操作" width="90">
                    <template slot-scope="scope">
                      <el-button icon="el-icon-delete" type="text"
                        @click="deleteRow(scope.$index, scope.row, 'installationAcceptanceRecordList')">删除</el-button>
                    </template>
                  </el-table-column>
                </el-table>
              </el-col>
            </el-row>
          </el-card>
          <el-row style="margin-top: 1em;">
            <el-col :span="4">
              操作人:{{ form.installOperatingPersonnel }}
            </el-col>
            <el-col :span="6">
              日期:{{ form.installDate }}
            </el-col>
          </el-row>
        </div>
        <div v-show="currentStepClick === 3">
          <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
            <el-row>
              <el-col :span="24">
                <el-form-item :rules="[{ required: currentStep === 3, message: '请输入复合意见', trigger: 'blur' }]" label="复合意见:"
                  prop="installationAcceptanceCompoundOpinion">
                  <el-input v-model="form.installationAcceptanceCompoundOpinion" :disabled="currentStep !== 3"
                    size="small" type="textarea"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item :rules="[{ required: currentStep === 3, message: '请输入下环节负责人', trigger: 'change' }]" label="下环节责任人:"
                  prop="installationAcceptanceNextPesponsible">
                  <el-select v-model="form.installationAcceptanceNextPesponsible" :disabled="currentStep !== 3" clearable
                    filterable placeholder="请选择下环节负责人" size="small" style="width: 50%;">
                    <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </el-card>
          <el-row style="margin-top: 1em;">
            <el-col :span="4">
              操作人:{{ form.installationAcceptanceOperatingPersonnel }}
            </el-col>
            <el-col :span="6">
              日期:{{ form.installationAcceptanceDate }}
            </el-col>
          </el-row>
        </div>
        <div v-show="currentStepClick === 4">
          <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
            <div style="margin-bottom: 20px; width: 100%;">
              <label>验收核查记录:</label>
              <el-button v-if="currentStep === 4" size="small" style="float: right;"
                type="primary" @click="addTableRow('acceptanceCheckRecordList')">增加行</el-button>
            </div>
            <el-table :data="form.acceptanceCheckRecordList" border style="width: 100%; min-height: 30vh">
              <el-table-column label="序号" prop="sequence" width="80">
              </el-table-column>
              <el-table-column label="仪器模块" min-width="120" prop="instrumentModule">
                <template v-slot="scope">
                  <el-input v-if="currentStep === 4" v-model="scope.row.instrumentModule" size="small"></el-input>
                  <label v-else>{{ scope.row.instrumentModule }}</label>
                </template>
              </el-table-column>
              <el-table-column label="核查参数" min-width="120" prop="verificationParameter">
                <template v-slot="scope">
                  <el-input v-if="currentStep === 4" v-model="scope.row.verificationParameter" size="small"></el-input>
                  <label v-else>{{ scope.row.verificationParameter }}</label>
                </template>
              </el-table-column>
              <el-table-column label="可接收限" min-width="120" prop="acceptableLimit">
                <template v-slot="scope">
                  <el-input v-if="currentStep === 4" v-model="scope.row.acceptableLimit" size="small"></el-input>
                  <label v-else>{{ scope.row.acceptableLimit }}</label>
                </template>
              </el-table-column>
              <el-table-column label="核查结果" min-width="120" prop="verificationResult">
                <template v-slot="scope">
                  <el-input v-if="currentStep === 4" v-model="scope.row.verificationResult" size="small"></el-input>
                  <label v-else>{{ scope.row.verificationResult }}</label>
                </template>
              </el-table-column>
              <el-table-column label="核查结论" min-width="120" prop="verificationConclusion">
                <template v-slot="scope">
                  <el-select v-if="currentStep === 4" v-model="scope.row.verificationConclusion" placeholder="请选择">
                    <el-option label="符合" value="0accordWith"></el-option>
                    <el-option label="不符合" value="1inconformity"></el-option>
                  </el-select>
                  <label v-else>{{ scope.row.verificationConclusion }}</label>
                </template>
              </el-table-column>
              <el-table-column v-if="currentStep === 4" fixed="right" label="操作" width="90">
                <template slot-scope="scope">
                  <el-button size="small" type="text"
                    @click="deleteRow(scope.$index, scope.row, 'acceptanceCheckRecordList')">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-form-item :rules="[{ required: currentStep === 4, message: '请输入设备开箱验收结论', trigger: 'change' }]" label="设备开箱验收结论:"
              label-width="150px" prop="acceptanceCheckUnpackingConclusion">
              <el-radio-group v-model="form.acceptanceCheckUnpackingConclusion" :disabled="currentStep !== 4">
                <el-radio :label="'0qualified'">合格</el-radio>
                <el-radio :label="'1unqualified'">不合格,缺少备件供应商补发</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item :rules="[{ required: currentStep === 4, message: '请输入下环节责任人', trigger: 'change' }]" label="下环节责任人:"
              prop="acceptanceCheckNextPesponsible">
              <el-select v-model="form.acceptanceCheckNextPesponsible" :disabled="currentStep !== 4" clearable
                filterable placeholder="请选择下环节负责人" size="small" style="width: 50%;">
                <el-option v-for="item in responsibleOptions" :key="item.value" :label="item.label" :value="item.name">
                </el-option>
              </el-select>
            </el-form-item>
          </el-card>
          <el-row style="margin-top: 1em;">
            <el-col :span="4">
              操作人:{{ form.acceptanceCheckOperatingPersonnel }}
            </el-col>
            <el-col :span="6">
              日期:{{ form.acceptanceCheckDate }}
            </el-col>
          </el-row>
        </div>
        <div v-show="currentStepClick === 5">
          <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
            <el-row>
              <el-col :span="24">
                <el-form-item :rules="[{ required: currentStep === 5, message: '请输入审核意见', trigger: 'blur' }]" label="审核意见:"
                  prop="acceptanceAuditAuditOpinion">
                  <el-input v-model="form.acceptanceAuditAuditOpinion" :disabled="currentStep !== 5" size="small"
                    type="textarea"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-card>
          <el-row style="margin-top: 1em;">
            <el-col :span="4">
              操作人:{{ form.acceptanceAuditOperatingPersonnel }}
            </el-col>
            <el-col :span="6">
              日期:{{ form.acceptanceAuditDate }}
            </el-col>
          </el-row>
        </div>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button v-if="currentStep !== 0 && currentStep !== 6" @click="submitForm('3reject')">驳回</el-button>
        <el-button v-if="currentStep === 0" @click="submitForm('2save')">保存</el-button>
        <el-button v-if="currentStep !== 6" type="primary" @click="submitForm('1submit')">{{ currentStep === 0 ? '提交' :
          '通过'
          }}</el-button>
      </span>
    </el-dialog>
  </div>
  <!-- 查单编辑框 -->
</template>
 
<script>
import { dateFormat } from '../../../util/date'
import file from '../../../util/file';
 
export default {
  props: {
    clickNodeVal: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {
      //事故设备信息
      tableDataAlist: [], // 更改变量名称
      dialogVisible: false,
      rules: {
        quantity: [{ required: true, message: '请输入数量', trigger: 'blur' }],
      },
      currentStep: 0, // 步骤条显示第几步
      currentStepClick: 0, // 点击步骤条变化
      steps: ['提交', '开箱验收复核', '安装验收检查', '安装验收复核', '验收核查', '验收核查审核'],
      form: {
        sparePartsConfirmationList: [], // 备件确认List
        fileClassConfirmationList: [], // 文件确认List
        installationAcceptanceRecordList: [], // 安装验收记录
        acceptanceCheckRecordList: [], // 验收核查记录
        fileName: '', // 文件名称
        systemFileName: '', // 系统文件名称
      },
      outLoading: false,
      responsibleOptions: [], // 下环节负责人list
      isUpdate: false,
      search: {
        size: 20,
        current: 1,
        total: 0,
        processNumber: '',
      },
    }
  },
  computed: {
    action() {
      return this.javaApi + this.$api.personnel.saveCNASFile
    }
  },
  mounted() {
    // 获取设备事故信息
    this.getDeviceAList(this.clickNodeVal.value);
    window.excelClosed = this.closed
  },
  methods: {
    handleSizeChange(val) {
      this.search.size = val
      this.getPersonnelTraining(this.clickNodeVal.value);
    },
    handleCurrentChange(val) {
      this.search.current = val
      this.getPersonnelTraining(this.clickNodeVal.value);
    },
    deleteFile() {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.personnel.deleteCNASFile + "?fileName=" + this.form.systemFileName).then(res => {
          if (res.code == 200) {
            this.$message.success('删除成功!')
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    onSuccess(response, file, fileList) {
      if (response.code == 200) {
        // 在保存赋值新文件
        this.form.fileName = file.name
        this.form.systemFileName = response.data
      } else {
        this.$message.error(response.message)
      }
    },
    addTableRow(value) {
      switch (value) {
        // 备件确认
        case 'sparePartsConfirmationList':
          const obj = Object.assign({
            name: '',
            number: null,
            note: ''
          })
          this.form.sparePartsConfirmationList.push(obj)
          break
        // 文件确认List
        case 'fileClassConfirmationList':
          const obj1 = Object.assign({
            expectedCopies: '',
            actualCopies: '',
          })
          this.form.fileClassConfirmationList.push(obj1)
          break
        // 安装验收记录
        case 'installationAcceptanceRecordList':
          const obj2 = Object.assign({
            installationProject: '',
            installationSituation: '',
            installationCompleted: ''
          })
          this.form.installationAcceptanceRecordList.push(obj2)
          break
        // 验收核查记录
        case 'acceptanceCheckRecordList':
          const obj3 = Object.assign({
            instrumentModule: '',
            verificationParameter: '',
            acceptableLimit: '',
            verificationResult: '',
            verificationConclusion: ''
          })
          this.form.acceptanceCheckRecordList.push(obj3)
        default:
          break
      }
    },
    deleteRow(index, row, type) {
      switch (type) {
        // 备件确认
        case 'sparePartsConfirmationList':
          if (row.sparePartsId) {
            this.$axios.delete(this.$api.deviceCheck.deleteIncidentReportAll + '?sparePartsId=' + row.sparePartsId).then(res => { });
          }
          this.form.sparePartsConfirmationList.splice(index, 1)
          this.$message.success('删除成功!')
          break
        // 文件确认List
        case 'fileClassConfirmationList':
          if (row.fileId) {
            this.$axios.delete(this.$api.deviceCheck.deleteIncidentReportAll + '?fileId=' + row.fileId).then(res => { });
          }
          this.form.fileClassConfirmationList.splice(index, 1)
          this.$message.success('删除成功!')
          break
        // 安装验收记录
        case 'installationAcceptanceRecordList':
          if (row.installId) {
            this.$axios.delete(this.$api.deviceCheck.deleteIncidentReportAll + '?installId=' + row.installId).then(res => { });
          }
          this.form.installationAcceptanceRecordList.splice(index, 1)
          this.$message.success('删除成功!')
          break
        // 验收核查记录
        case 'acceptanceCheckRecordList':
          if (row.acceptanceCheckId) {
            this.$axios.delete(this.$api.deviceCheck.deleteIncidentReportAll + '?acceptanceCheckId=' + row.acceptanceCheckId).then(res => { });
          }
          this.form.acceptanceCheckRecordList.splice(index, 1)
          this.$message.success('删除成功!')
        default:
          break
      }
    },
    choiceStep(index) {
      this.currentStepClick = index
    },
    openRecordAcceptance() {
      // 获取设备基础信息
      this.$axios.get(this.$api.deviceScope.selectDeviceByCode + '?id=' + this.clickNodeVal.value).then(res => {
        this.form.deviceName = res.data.deviceName
        this.form.manufacturer = res.data.manufacturer
        this.form.specificationModel = res.data.specificationModel
        this.form.managementNumber = res.data.managementNumber
        this.$nextTick(() => {
          this.$refs['form'].clearValidate()
        })
      });
      // 获取负责人信息
      this.getUserList()
    },
    //提交表单
    async submitForm(saveState) {
      this.$refs.form.validate((valid) => {
        if (valid === true || saveState !== '1submit') {
          // 给当前环节设置创建人与时间
          let user = JSON.parse(localStorage.getItem('user'))
          const dateTime = dateFormat(new Date())
          // 获取当前环节操作人与日期
          switch (this.currentStep) {
            case 0:
              this.form.submitOperatingPersonnel = user.name
              this.form.submitDate = dateTime
              break
            case 1:
              this.form.unpackingOperatingPersonnel = user.name
              this.form.unpackingDate = dateTime
              break
            case 2:
              this.form.installOperatingPersonnel = user.name
              this.form.installDate = dateTime
              break
            case 3:
              this.form.installationAcceptanceOperatingPersonnel = user.name
              this.form.installationAcceptanceDate = dateTime
              break
            case 4:
              this.form.acceptanceCheckOperatingPersonnel = user.name
              this.form.acceptanceCheckDate = dateTime
              break
            case 5:
              this.form.acceptanceAuditOperatingPersonnel = user.name
              this.form.acceptanceAuditDate = dateTime
              break
            default:
              break
          }
          // 获取当前环节负责人
          switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) {
            case 0:
              this.form.currentResponsible = this.form.submitNextPesponsible
              break
            case 1:
              this.form.currentResponsible = this.form.unpackingNextPesponsible
              break
            case 2:
              this.form.currentResponsible = this.form.installNextPesponsible
              break
            case 3:
              this.form.currentResponsible = this.form.installationAcceptanceNextPesponsible
              break
            case 4:
              this.form.currentResponsible = this.form.acceptanceCheckNextPesponsible
              break
            default:
              break
          }
          let currentStepAction;
          // 设置该操作判断是否为提交,保存,驳回,通过
          switch (saveState) {
            // 提交,通过
            case '1submit':
              currentStepAction = this.currentStep + 1
              break
            // 保存
            case '2save':
              currentStepAction = this.currentStep
              break
            // 驳回
            case '3reject':
              currentStepAction = this.currentStep - 1
              break
            default:
              break
          }
          // 获取当前状态
          this.form.currentState = currentStepAction === 6 ? '关闭' : this.steps[currentStepAction]
          this.form.deviceId = this.clickNodeVal.value
          this.$axios.post(this.$api.deviceCheck.saveIncidentReportData, this.form, {
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            if (res.code == 200) {
              this.$message.success('提交成功')
              this.getDeviceAList(this.clickNodeVal.value);
              this.dialogVisible = false
            }
          })
        } else {
          let step = this.steps[this.currentStep]
          this.$message.warning(step + '  流程中有必填项未填!');
        }
      });
    },
    // 获取负责人信息接口
    getUserList() {
      this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
        if (res.code == 200) {
          this.responsibleOptions = res.data
        }
      })
    },
    resetSearch() {
      this.search = {
        size: 20,
          current: 1,
          total: 0,
          processNumber: '',
      }
      this.getDeviceAList(this.clickNodeVal.value);
    },
    // 获取设备事故信息(根据从vuex中获取到的设备名称id进行数据查询)
    getDeviceAList(deviceId) {
      this.$axios.get(this.$api.deviceCheck.incidentReportPage + "?deviceId=" + deviceId + "&size=" + this.search.size + "&current=" + this.search.current + "&processNumber=" + this.search.processNumber).then(res => {
        if (res.code == 200) {
          this.tableDataAlist = res.data.records
          this.search.total = res.data.total
        }
      })
    },
    //table 事件处理开始处
    handleAttachmentClick(row) {
      // 模拟下载附件
      const imageUrl = this.javaApi+'/img/'+row.systemFileName; // 图片 URL
      // downloadImage(imageUrl);
      file.downloadIamge(imageUrl,row.fileName)
    },
    handleViewClick(row) {
      this.$axios.get(this.$api.deviceCheck.getShowIncidentReport + "?id=" + row.id).then(res => {
        this.form = { ...res.data }
        // 如果索引为6表示全部通过
        this.currentStep = this.steps.indexOf(this.form.currentState) === -1 ? 6 : this.steps.indexOf(this.form.currentState)
        this.currentStepClick = this.currentStep === 6 ? 0 : this.currentStep
        this.$nextTick(() => {
          this.$refs['form'].clearValidate()
        })
      })
      this.dialogVisible = true
    },
    // 导出
    handleDownOne(row) {
      this.outLoading = true
      this.$axios.get(this.$api.deviceCheck.acceptanceCertificateExport + '?deviceId=' + row.deviceId + '&processNumber=' + row.processNumber, {
        responseType: "blob"
      }).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res], { type: 'application/octet-stream' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '设备验收.doc';
        link.click();
      })
    },
    // 删除
    handleDeleteClick(row) {
      this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.deviceCheck.deleteIncidentReport + '?id=' + row.id).then(res => {
          if (res.code == 200) {
            this.$message.success('删除成功')
            this.getDeviceAList(this.clickNodeVal.value);
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
 
    },
    //导出
    handleDown() {
      this.outLoading = true
      this.$axios.get(this.$api.deviceCheck.incidentReportExport + '?deviceId=' + this.clickNodeVal.value, {
        responseType: "blob"
      }).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res], { type: 'application/octet-stream' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '设备验收.xlsx';
        link.click();
      })
    },
  },
  watch: {
    // 监听点击el-tree的数据,进行数据刷新
    clickNodeVal(newVal) {
      if (newVal.value) {
        this.getDeviceAList(newVal.value);
      }
    },
    dialogVisible(newVal) {
      if (!newVal) {
        this.form = {
          sparePartsConfirmationList: [], // 备件确认List
          fileClassConfirmationList: [], // 文件确认List
          installationAcceptanceRecordList: [], // 安装验收记录
          acceptanceCheckRecordList: [], // 验收核查记录
          fileName: '', // 文件名称
          systemFileName: '', // 系统文件名称
        }
        this.currentStep = 0 // 步骤条显示第几步
        this.currentStepClick = 0 // 点击步骤条变化
        this.$refs['form'].clearValidate()
      }
    }
  }
}
function downloadImage(url) {
  const link = document.createElement('a');
  link.href = url;
  link.download = 'attachment.jpg'; // 文件名
  document.body.appendChild(link);
  link.click();
  document.body.removeChild(link);
}
</script>
 
<style scoped>
>>>.el-radio {
  color: #606266;
  font-weight: 500;
  cursor: pointer;
  margin-right: 0px;
  width: 10em;
}
 
.tables {
  width: 100%;
  height: calc(100vh - 17em);
}
 
.search {
  background-color: #fff;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
 
.search_thing {
  display: flex;
  align-items: center;
  height: 40px;
}
 
.search_label {
  font-size: 14px;
  width: 110px;
}
 
.search_input {
  width: calc(100% - 120px);
}
 
.search_thing {
  display: flex;
  margin: 10px 0;
}
 
.line {
  width: 20px;
  height: 1px;
  background-color: #ccc;
  display: inline-block;
  margin-right: 10px;
}
 
.form .search_label {
  width: 120px;
}
</style>