楚江漓i
2021-03-02 6dcaba66e84e79db877fde6f764a82cb9dea38f0
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
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
<template>
  <div style="height: 100%;background: #fff;">
    <el-container style="background: #fff;">
      <el-header :height="headerHeight">
        <el-row style="margin-bottom: 10px;">
          <el-col :span="16">
            <h3 class="bu-tian-jia-title">在职员工</h3>
          </el-col>
          <el-col :span="8" style="margin-top: 15px;">
            <el-input v-model="queryParams.vague" placeholder="请输入内容" style="width:200px" />
            <span class="search-btn" @click="vagueSearch">查询</span>
            <span class="sup-search-btn" @click="advancedQueryShowMethods">高级查询</span>
          </el-col>
        </el-row>
        <div v-show="advancedQueryShow">
          <el-row>
            <el-col :span="3">员工编号:
              <el-input v-model="queryParams.empNumb" size="small" maxlength="20" style="width:85px" />
            </el-col>
            <el-col :span="3">姓名:
              <el-input v-model="queryParams.empName" size="small" maxlength="10" style="width:110px" />
            </el-col>
            <el-col :span="4">身份证号:
              <el-input v-model="queryParams.certificateNumb" size="small" maxlength="18" style="width:140px" />
            </el-col>
            <el-col :span="3">护卫点:
              <el-input v-model="queryParams.deptName" size="small" maxlength="20" style="width:100px" />
            </el-col>
            <el-col :span="8">入职日期:
              <el-date-picker
                v-model="queryParams.entryDateStr"
                size="small"
                type="daterange"
                align="right"
                unlink-panels
                range-separator="~"
                value-format="yyyy-MM-dd"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                style="width: 300px;"
              />
            </el-col>
            <el-col :span="3">
              <el-button size="mini" class="hr-but-all" type="primary" @click="search">查询</el-button>
              <el-button size="mini" class="hr-but" type="danger" @click="resetSearch">重置</el-button>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <table class="searchTable">
                <tr>
                  <td class="td">性别:</td>
                  <td class="td-group">
                    <el-checkbox-group v-model="queryParams.sex" class="fj-checkbox">
                      <el-checkbox label="" @change="selectAllSex">全部</el-checkbox>
                      <el-checkbox label="1">男性</el-checkbox>
                      <el-checkbox label="2">女性</el-checkbox>
                    </el-checkbox-group>
                  </td>
                </tr>
                <tr>
                  <td class="td">最高学历:</td>
                  <td class="td-group">
                    <el-checkbox-group v-model="queryParams.education" class="fj-checkbox">
                      <el-checkbox label="" @change="selectAllEducation">全部</el-checkbox>
                      <el-checkbox label="91">无学历</el-checkbox>
                      <el-checkbox label="81">小学</el-checkbox>
                      <el-checkbox label="71">初中</el-checkbox>
                      <el-checkbox label="61">高中</el-checkbox>
                      <el-checkbox label="42">中技</el-checkbox>
                      <el-checkbox label="41">中专</el-checkbox>
                      <el-checkbox label="31">大学专科</el-checkbox>
                      <el-checkbox label="21">大学本科</el-checkbox>
                      <el-checkbox label="11">硕士</el-checkbox>
                      <el-checkbox label="10">博士</el-checkbox>
                    </el-checkbox-group>
                  </td>
                </tr>
                <tr>
                  <td class="td">政治面貌:</td>
                  <td class="td-group">
                    <el-checkbox-group v-model="queryParams.politics" class="fj-checkbox">
                      <el-checkbox label="" @change="selectAllPolitics">全部</el-checkbox>
                      <el-checkbox label="01">党员</el-checkbox>
                      <el-checkbox label="02">预备</el-checkbox>
                      <el-checkbox label="03">共青</el-checkbox>
                      <el-checkbox label="04">民革</el-checkbox>
                      <el-checkbox label="05">民盟</el-checkbox>
                      <el-checkbox label="06">民建</el-checkbox>
                      <el-checkbox label="07">民进</el-checkbox>
                      <el-checkbox label="08">农工</el-checkbox>
                      <el-checkbox label="09">致公</el-checkbox>
                      <el-checkbox label="10">九三</el-checkbox>
                      <el-checkbox label="11">台盟</el-checkbox>
                      <el-checkbox label="12">民主</el-checkbox>
                      <el-checkbox label="13">群众</el-checkbox>
                    </el-checkbox-group>
                  </td>
                </tr>
                <tr>
                  <td class="td">年龄:</td>
                  <td class="td-group">
                    <el-checkbox-group v-model="queryParams.ageStr" class="fj-checkbox">
                      <el-checkbox label="" @change="selectAllAgeStr">全部</el-checkbox>
                      <el-checkbox label="18-29">18-29</el-checkbox>
                      <el-checkbox label="30-39">30-39</el-checkbox>
                      <el-checkbox label="40-49">40-49</el-checkbox>
                      <el-checkbox label="50-59">50-59</el-checkbox>
                      <el-checkbox label="60-69">60-69</el-checkbox>
                      <el-checkbox label="69-999">69及以上</el-checkbox>
                    </el-checkbox-group>
                  </td>
                </tr>
                <tr>
                  <td class="td">档案情况:</td>
                  <td class="td-group">
                    <el-checkbox-group v-model="queryParams.archivesStatus" class="fj-checkbox">
                      <el-checkbox label="" @change="selectAllArchivesStatus">全部</el-checkbox>
                      <el-checkbox label="0">已移交</el-checkbox>
                      <el-checkbox label="1">未移交</el-checkbox>
                    </el-checkbox-group>
                  </td>
                </tr>
                <tr>
                  <td class="td">保险类型:</td>
                  <td class="td-group">
                    <el-checkbox-group v-model="queryParams.insuranceType" class="fj-checkbox">
                      <el-checkbox label="" @change="selectAllInsuranceType">全部</el-checkbox>
                      <el-checkbox label="1">深户(五险一档)</el-checkbox>
                      <el-checkbox label="2">非深户(五险一档)</el-checkbox>
                      <el-checkbox label="3">非深户(五险二档)</el-checkbox>
                      <el-checkbox label="4">非深户(五险三档)</el-checkbox>
                      <el-checkbox label="5">非深户(四险三档)</el-checkbox>
                    </el-checkbox-group>
                  </td>
                </tr>
                <!-- <tr>
                  <td class="td">员工状态:</td>
                  <td class="td-group">
                    <el-checkbox-group v-model="queryParams.empStatus" class="fj-checkbox">
                      <el-checkbox label="" @change="selectAllEmpStatus">全部</el-checkbox>
                      <el-checkbox label="0">在职</el-checkbox>
                      <el-checkbox label="1">离职</el-checkbox>
                      <el-checkbox label="2">退休</el-checkbox>
                    </el-checkbox-group>
                  </td>
                </tr> -->
              </table>
            </el-col>
          </el-row>
        </div>
      </el-header>
      <el-main style="height: 85%;">
        <el-row style="margin: 10px 0 10px 0;">
          <el-col :span="24">
            <el-button type="danger" class="hr-but-all" @click="showXzyg(0)">新增员工</el-button>
            <el-button type="primary" class="hr-but-all" @click="delEmp">删除员工</el-button>
            <el-button type="danger" class="hr-but-all" @click="showYgdg(0)">员工调岗</el-button>
            <el-button type="danger" class="hr-but-all" @click="showDryg(0)">导入员工</el-button>
            <el-button type="danger" class="hr-but-all" @click="showDcyg(0)">导出员工</el-button>
            <el-button type="danger" class="hr-but-all" @click="doDcda">导出档案</el-button>
            <el-button type="danger" class="hr-but-all" @click="showGbda(0)">关闭档案</el-button>
          </el-col>
        </el-row>
        <el-table ref="multipleTable" :data="tableData" :header-cell-style="{'height':'5.3vh','background-color':'#e6e6e6'}" stripe style="width: 100%;color: #000;">
          <el-table-column type="selection" width="55" />
          <el-table-column label="操作" width="110">
            <template slot-scope="scope">
              <!--              <el-button-->
              <!--                type="text"-->
              <!--                size="small"-->
              <!--                @click="editArchives(scope.row)"-->
              <!--              >-->
              <!--                档案</el-button>-->
              <!--              <el-button type="text" size="small" @click="editEmpBase(scope.row)">编辑</el-button>-->
 
              <span style="color: #a00515;display: inline-block;width: 50%;cursor: pointer" @click="editArchives(scope.row)">档案</span>
              <span style="color: #a00515;display: inline-block;width: 50%;cursor: pointer" @click="editEmpBase(scope.row)">编辑</span>
            </template>
          </el-table-column>
          <el-table-column prop="deptName" label="护卫点" />
          <el-table-column prop="jobName" label="岗位" width="100" />
          <el-table-column prop="empNumb" label="员工编号" />
          <el-table-column prop="empName" label="姓名" />
          <el-table-column prop="certificateNumb" label="身份证号码" />
          <el-table-column prop="sexName" label="性别" width="80" />
          <el-table-column prop="age" label="年龄" width="80" />
          <el-table-column prop="educationName" label="最高学历" width="100" />
          <el-table-column prop="nativePlaceName" label="籍贯" width="100" />
          <el-table-column prop="telePhone" label="联系电话" />
          <el-table-column prop="entryDate" label="入职日期" width="100" />
          <el-table-column prop="empStatus" label="员工状态" width="100">
            <template slot-scope="{row}">
              {{ transEmpStatus(row.empStatus) }}
            </template>
          </el-table-column>
        </el-table>
        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="pagination.num"
          :limit.sync="pagination.size"
          @pagination="search"
        />
      </el-main>
    </el-container>
    <el-dialog title="新增员工" :visible.sync="dialogShowXzyg" width="50%">
      <el-form
        ref="empBaseInfoForm"
        :model="empBaseInfoForm"
        :rules="empBaseInfoRules"
        label-position="right"
        label-width="120px"
      >
        <el-row>
          <el-col :span="12">
            <el-form-item label="档案号" prop="archivesNumb">
              <el-input v-model="empBaseInfoForm.archivesNumb" />
            </el-form-item>
            <el-form-item label="员工编号" prop="empNumb">
              <el-input v-model="empBaseInfoForm.empNumb" />
            </el-form-item>
            <el-form-item label="身份证号码" prop="certificateNumb">
              <el-input
                v-model="empBaseInfoForm.certificateNumb"
                @input="generateUserInfo(0,empBaseInfoForm.certificateNumb)"
              />
            </el-form-item>
            <el-form-item label="员工类别" prop="empType">
              <el-select v-model="empBaseInfoForm.empType" placeholder="请选择员工类型">
                <el-option label="高层" value="01" />
                <el-option label="高级管理人员" value="02" />
                <el-option label="中级管理人员" value="03" />
                <el-option label="初级管理人员" value="04" />
                <el-option label="文职人员" value="05" />
                <el-option label="一般人员" value="06" />
                <el-option label="其他" value="07" />
              </el-select>
            </el-form-item>
            <el-form-item label="民族" prop="nation">
              <el-select v-model="empBaseInfoForm.nation" placeholder="请选择民族">
                <el-option label="汉族" value="01" />
                <el-option label="蒙古族" value="02" />
                <el-option label="回族" value="03" />
                <el-option label="藏族" value="04" />
                <el-option label="维吾尔族" value="05" />
                <el-option label="苗族" value="06" />
                <el-option label="彝族" value="07" />
                <el-option label="壮族" value="08" />
                <el-option label="布衣族" value="09" />
                <el-option label="朝鲜族" value="10" />
                <el-option label="满族" value="11" />
                <el-option label="侗族" value="12" />
                <el-option label="瑶族" value="13" />
                <el-option label="白族" value="14" />
                <el-option label="土家族" value="15" />
                <el-option label="哈尼族" value="16" />
                <el-option label="哈萨克族" value="17" />
                <el-option label="傣族" value="18" />
                <el-option label="黎族" value="19" />
                <el-option label="傈傈族" value="20" />
                <el-option label="瓦族" value="21" />
                <el-option label="畲族" value="22" />
                <el-option label="高山族" value="23" />
                <el-option label="拉祜族" value="24" />
                <el-option label="水族" value="25" />
                <el-option label="东乡族" value="26" />
                <el-option label="纳西族" value="27" />
                <el-option label="景颇族" value="28" />
                <el-option label="柯尔克孜族" value="29" />
                <el-option label="土族" value="30" />
                <el-option label="达斡尔族" value="31" />
                <el-option label="仫佬族" value="32" />
                <el-option label="羌族" value="33" />
                <el-option label="布朗族" value="34" />
                <el-option label="撒拉族" value="35" />
                <el-option label="毛难族" value="36" />
                <el-option label="仡佬族" value="37" />
                <el-option label="锡伯族" value="38" />
                <el-option label="阿昌族" value="39" />
                <el-option label="普米族" value="40" />
                <el-option label="塔吉克族" value="41" />
                <el-option label="怒族" value="42" />
                <el-option label="乌孜别克族" value="43" />
                <el-option label="俄罗斯族" value="44" />
                <el-option label="鄂温克族" value="45" />
                <el-option label="崩龙族" value="46" />
                <el-option label="保安族" value="47" />
                <el-option label="裕固族" value="48" />
                <el-option label="京族" value="49" />
                <el-option label="塔塔尔族" value="50" />
                <el-option label="独龙族" value="51" />
                <el-option label="鄂伦春" value="52" />
                <el-option label="郝哲族" value="53" />
                <el-option label="门巴族" value="54" />
                <el-option label="珞巴族" value="55" />
                <el-option label="基诺族" value="56" />
                <el-option label="其他族" value="91" />
                <el-option label="外国民族" value="98" />
              </el-select>
            </el-form-item>
            <el-form-item label="婚姻状态" prop="marriage">
              <el-select v-model="empBaseInfoForm.marriage" placeholder="请选择婚姻状态">
                <el-option label="未婚" value="1" />
                <el-option label="已婚" value="2" />
                <el-option label="丧偶" value="3" />
                <el-option label="离婚" value="4" />
                <el-option label="再婚" value="5" />
                <el-option label="其它" value="9" />
              </el-select>
            </el-form-item>
            <el-form-item label="身高(cm)" prop="stature">
              <el-input v-model="empBaseInfoForm.stature" />
            </el-form-item>
            <el-form-item label="政治面貌" prop="politics">
              <el-select v-model="empBaseInfoForm.politics" placeholder="请选择政治面貌">
                <el-option label="中共党员" value="01" />
                <el-option label="预备党员" value="02" />
                <el-option label="共青团员" value="03" />
                <el-option label="民革会员" value="04" />
                <el-option label="民盟盟员" value="05" />
                <el-option label="民建会员" value="06" />
                <el-option label="民进会员" value="07" />
                <el-option label="农工党员" value="08" />
                <el-option label="致公党员" value="09" />
                <el-option label="九三社员" value="10" />
                <el-option label="台盟盟员" value="11" />
                <el-option label="民主人士" value="12" />
                <el-option label="群众" value="13" />
              </el-select>
            </el-form-item>
            <el-form-item label="最高学历" prop="education">
              <el-select v-model="empBaseInfoForm.education" placeholder="请选择最高学历">
                <el-option label="博士" value="10" />
                <el-option label="硕士" value="11" />
                <el-option label="大学本科" value="21" />
                <el-option label="大学专科" value="31" />
                <el-option label="中专" value="41" />
                <el-option label="中技" value="42" />
                <el-option label="高中" value="61" />
                <el-option label="初中" value="71" />
                <el-option label="小学" value="81" />
                <el-option label="无学历" value="91" />
              </el-select>
            </el-form-item>
            <el-form-item label="籍贯" prop="nativePlaceName">
              <el-autocomplete
                v-model="empBaseInfoForm.nativePlaceName"
                class="inline-input"
                :fetch-suggestions="querySearch"
                placeholder="请选择籍贯"
                @select="placeNameSelect"
              />
            </el-form-item>
            <el-form-item label="现住址" prop="currentAddress">
              <el-input v-model="empBaseInfoForm.currentAddress" />
            </el-form-item>
            <el-form-item label="电话号码" prop="telePhone">
              <el-input v-model="empBaseInfoForm.telePhone" />
            </el-form-item>
            <el-form-item label="招聘介绍人" prop="introducer">
              <el-input v-model="empBaseInfoForm.introducer" />
            </el-form-item>
            <el-form-item label="银行名称" prop="bankName">
              <el-input v-model="empBaseInfoForm.bankName" />
            </el-form-item>
            <el-form-item label="保险类型" prop="insuranceType">
              <el-select v-model="empBaseInfoForm.insuranceType" placeholder="请选择保险类型">
                <el-option label="(深户)五险一档" value="1" />
                <el-option label="(非深户)五险一档" value="2" />
                <el-option label="(非深户)五险二档" value="3" />
                <el-option label="(非深户)五险三档" value="4" />
                <el-option label="(非深户)四险一档" value="5" />
              </el-select>
            </el-form-item>
            <el-form-item label="家庭成员及关系" prop="family">
              <el-input v-model="empBaseInfoForm.family" />
            </el-form-item>
            <el-form-item label="紧急联系电话" prop="urgencyPhone">
              <el-input v-model="empBaseInfoForm.urgencyPhone" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="姓名" prop="empName">
              <el-input v-model="empBaseInfoForm.empName" />
            </el-form-item>
            <el-form-item label="部门(护卫点)" required message="请选择护卫点" prop="deptId">
              <treeselect
                v-model="empBaseInfoForm.deptId"
                :multiple="false"
                :options="depts"
                :clear-value-text="$t('common.clear')"
                placeholder="请选择部门(护卫点)"
                style="width:100%"
              />
            </el-form-item>
            <el-form-item label="岗位" prop="jobName">
              <el-autocomplete
                v-model="empBaseInfoForm.jobName"
                class="inline-input"
                :fetch-suggestions="querySearchJob"
                placeholder="请输入岗位"
                @select="jobNameSelect"
              />
            </el-form-item>
            <el-form-item label="性别" prop="sex">
              <el-select v-model="empBaseInfoForm.sex" placeholder="请选择性别">
                <el-option label="男" value="1" />
                <el-option label="女" value="2" />
              </el-select>
            </el-form-item>
            <el-form-item label="身份证有效期" prop="certificateValidity">
              <el-date-picker
                v-model="empBaseInfoForm.certificateValidity"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
            <el-form-item label="年龄" prop="age">
              <el-input v-model="empBaseInfoForm.age" />
            </el-form-item>
            <el-form-item label="出生日期" prop="birthdate">
              <el-date-picker
                v-model="empBaseInfoForm.birthdate"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
            <el-form-item label="入职日期" prop="entryDate">
              <el-date-picker
                v-model="empBaseInfoForm.entryDate"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
                @input="calculateSeniority"
              />
            </el-form-item>
            <el-form-item label="入司工龄" prop="seniority">
              <el-input v-model="empBaseInfoForm.seniority" />
            </el-form-item>
            <el-form-item label="户籍地址" prop="censusAddress">
              <el-input v-model="empBaseInfoForm.censusAddress" />
            </el-form-item>
            <el-form-item label="保安员证号" prop="guardNumb">
              <el-input v-model="empBaseInfoForm.guardNumb" />
            </el-form-item>
            <el-form-item label="保安员回执" prop="returnReceipt">
              <el-input v-model="empBaseInfoForm.returnReceipt" />
            </el-form-item>
            <el-form-item label="档案情况" prop="archivesStatus">
              <el-select v-model="empBaseInfoForm.archivesStatus" placeholder="请选择档案情况">
                <el-option label="未移交" value="0" />
                <el-option label="已移交" value="1" />
              </el-select>
            </el-form-item>
            <el-form-item label="银行账号" prop="bankNumb">
              <el-input v-model="empBaseInfoForm.bankNumb" />
            </el-form-item>
            <el-form-item label="社保电脑号" prop="socialNumb">
              <el-input v-model="empBaseInfoForm.socialNumb" />
            </el-form-item>
            <el-form-item label="员工手册">
              <el-select v-model="empBaseInfoForm.handbookStatus" placeholder="请选择员工手册">
                <el-option label="未发" value="0" />
                <el-option label="已发" value="1" />
              </el-select>
            </el-form-item>
            <el-form-item label="工作证" prop="empCardStatus">
              <el-select v-model="empBaseInfoForm.empCardStatus" placeholder="请选择工作证">
                <el-option label="未发" value="0" />
                <el-option label="已发" value="1" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="相关证件" prop="certificateList">
              <el-select v-model="empBaseInfoForm.certificateList" placeholder="请选择相关证件">
                <el-option label="高中毕业证" value="1" />
                <el-option label="专科毕业证" value="2" />
                <el-option label="本科毕业证" value="3" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="putEmpBase('empBaseInfoForm')">保 存</el-button>
        <el-button type="primary" @click="putEmpBaseContinue('empBaseInfoForm')">保存并继续新增</el-button>
        <el-button @click="showXzyg()">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog title="员工调岗" :visible.sync="dialogShowYgdg" width="50%">
      <el-form ref="ygdgForm" :model="ygdgForm" :rules="ygdgRules" label-position="right" label-width="120px">
        <el-row>
          <el-col span="24">
            <el-form-item label="调岗人员">
              <input v-model="ygdgForm.empIds" type="hidden">
              <el-input v-model="ygdgForm.empNames" type="textarea" />
            </el-form-item>
            <el-form-item label="现部门(护卫点)" required message="请选择护卫点" prop="deptId">
              <treeselect
                v-model="ygdgForm.deptId"
                :multiple="false"
                :options="depts"
                :clear-value-text="$t('common.clear')"
                placeholder="请选择部门(护卫点)"
                style="width:100%"
                @select="deptNameSelect"
              />
            </el-form-item>
            <el-form-item label="现岗位" prop="jobId">
              <el-autocomplete
                v-model="ygdgForm.newJobName"
                class="inline-input"
                :fetch-suggestions="querySearchJob"
                placeholder="请输入岗位"
                @select="jobNameSelect"
              />
            </el-form-item>
            <el-form-item label="调岗类型" prop="changeType">
              <el-select v-model="ygdgForm.changeType" placeholder="请选择">
                <el-option label="升职" value="2" />
                <el-option label="调动" value="3" />
              </el-select>
            </el-form-item>
            <el-form-item label="调岗日期" prop="changeDate">
              <el-date-picker
                v-model="ygdgForm.changeDate"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
            <el-form-item label="理由描述" prop="changeReason">
              <el-input v-model="ygdgForm.changeReason" type="textarea" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="showYgdg(1,'')">取 消</el-button>
        <el-button type="primary" @click="showYgdg(2,'ygdgForm')">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="导入员工信息" :visible.sync="dialogShowDryg" width="50%">
      <el-form :model="baseicInformationForm" label-position="right" label-width="120px">
        <el-row>
          <el-col span="24">
            <el-form-item label="员工模板下载" prop="region">
              <a href="/员工信息.xls" target="_blank" style="color: #3A8EE6;">员工信息.xlxs</a>
              <span style="margin-left: 100px;">点击下载</span>
            </el-form-item>
            <el-form-item label="导入员工">
              <el-upload
                ref="upload"
                class="upload-demo"
                action="http://120.24.23.155:8301/hr/empBaseInfo/importEmp"
                accept=".xls, .xlsx, .excel"
                :headers="headers()"
                :file-list="fileList"
                :auto-upload="false"
              >
                <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
              </el-upload>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="showDryg(1)">取 消</el-button>
        <el-button type="primary" @click="showDryg(2)">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="关闭档案" :visible.sync="dialogShowGbda" width="50%">
      <el-form ref="gbdaForm" :model="gbdaForm" :rules="gbdaRules" label-position="right" label-width="120px">
        <el-row>
          <el-col span="24">
            <el-form-item label="离职类型" prop="dimissionType">
              <el-radio-group v-model="gbdaForm.dimissionType" @change="changeDimissionType">
                <el-radio :label="1">正常离职</el-radio>
                <el-radio :label="2">自动离职</el-radio>
                <el-radio :label="3">公司劝退</el-radio>
                <el-radio :label="4">公司辞退</el-radio>
                <el-radio :label="5">试用期内</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col v-if="selectDimissionType === 2" span="12">
            <el-form-item label="自离天数" prop="selfLeaveDay">
              <el-input v-model="gbdaForm.selfLeaveDay" onkeyup="value=value.replace(/[^0-9.]/g,'')" />
            </el-form-item>
          </el-col>
          <el-col v-if="selectDimissionType === 2" span="12">
            <el-form-item label="报告人" prop="reporter">
              <el-input v-model="gbdaForm.reporter" />
            </el-form-item>
          </el-col>
          <el-col span="24">
            <el-form-item label="关闭日期" prop="dimissionDate">
              <el-date-picker
                v-model="gbdaForm.dimissionDate"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
            <el-form-item label="备注说明" prop="remark">
              <el-input v-model="gbdaForm.remark" type="textarea" :rows="4" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="showGbda(1,'')">取 消</el-button>
        <el-button type="primary" @click="showGbda(2,'gbdaForm')">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="导出员工    请勾选需要导出的字段" :visible.sync="dialogShowDcyg" width="40%">
      <table id="dcygTable" width="100%">
        <tr>
          <td colspan="6" style="text-align: left;">
            <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange" />
            全部字段
          </td>
        </tr>
        <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
          <tr>
            <td>档案号</td>
            <td>
              <el-checkbox label="archivesNumb"><span /></el-checkbox>
            </td>
            <td>姓名</td>
            <td>
              <el-checkbox label="empName"><span /></el-checkbox>
            </td>
            <td>性别</td>
            <td>
              <el-checkbox label="sexName"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>部门(护卫点)</td>
            <td>
              <el-checkbox label="deptName"><span /></el-checkbox>
            </td>
            <td>所属岗位</td>
            <td>
              <el-checkbox label="jobName"><span /></el-checkbox>
            </td>
            <td>员工类别</td>
            <td>
              <el-checkbox label="empTypeName"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>民族</td>
            <td>
              <el-checkbox label="nationName"><span /></el-checkbox>
            </td>
            <td>身份证号码</td>
            <td>
              <el-checkbox label="certificateNumb"><span /></el-checkbox>
            </td>
            <td>年龄</td>
            <td>
              <el-checkbox label="age"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>婚姻状况</td>
            <td>
              <el-checkbox label="marriageName"><span /></el-checkbox>
            </td>
            <td>身份证有效期</td>
            <td>
              <el-checkbox label="certificateValidity"><span /></el-checkbox>
            </td>
            <td>身高</td>
            <td>
              <el-checkbox label="stature"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>政治面貌</td>
            <td>
              <el-checkbox label="politicsName"><span /></el-checkbox>
            </td>
            <td>出生日期</td>
            <td>
              <el-checkbox label="birthdate"><span /></el-checkbox>
            </td>
            <td>最高学历</td>
            <td>
              <el-checkbox label="educationName"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>籍贯</td>
            <td>
              <el-checkbox label="nativePlaceName"><span /></el-checkbox>
            </td>
            <td>户籍地址</td>
            <td>
              <el-checkbox label="censusAddress"><span /></el-checkbox>
            </td>
            <td>现住址</td>
            <td>
              <el-checkbox label="currentAddress"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>保安员证号</td>
            <td>
              <el-checkbox label="guardNumb"><span /></el-checkbox>
            </td>
            <td>保安员回执</td>
            <td>
              <el-checkbox label="returnReceipt"><span /></el-checkbox>
            </td>
            <td>档案情况</td>
            <td>
              <el-checkbox label="archivesStatusName"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>银行名称</td>
            <td>
              <el-checkbox label="bankName"><span /></el-checkbox>
            </td>
            <td>银行账号</td>
            <td>
              <el-checkbox label="bankNumb"><span /></el-checkbox>
            </td>
            <td>电话号码</td>
            <td>
              <el-checkbox label="telePhone"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>入职日期</td>
            <td>
              <el-checkbox label="entryDate"><span /></el-checkbox>
            </td>
            <td>保险类型</td>
            <td>
              <el-checkbox label="InsuranceTypeName"><span /></el-checkbox>
            </td>
            <td>社保电脑号</td>
            <td>
              <el-checkbox label="socialNumb"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>招聘介绍人</td>
            <td>
              <el-checkbox label="introducer"><span /></el-checkbox>
            </td>
            <td>入司工龄</td>
            <td>
              <el-checkbox label="seniority"><span /></el-checkbox>
            </td>
            <td>工作证</td>
            <td>
              <el-checkbox label="empCardStatus"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>相关证件</td>
            <td>
              <el-checkbox label="certificateList"><span /></el-checkbox>
            </td>
            <td>紧急联系电话</td>
            <td>
              <el-checkbox label="urgencyPhone"><span /></el-checkbox>
            </td>
            <td>员工手册</td>
            <td>
              <el-checkbox label="handbookStatusName"><span /></el-checkbox>
            </td>
          </tr>
          <tr>
            <td>家庭成员及关系</td>
            <td>
              <el-checkbox label="family"><span /></el-checkbox>
            </td>
            <td />
            <td />
            <td />
            <td />
          </tr>
        </el-checkbox-group>
      </table>
      <div slot="footer" class="dialog-footer">
        <el-button @click="showDcyg(1)">取 消</el-button>
        <el-button type="primary" @click="showDcyg(2)">确 定</el-button>
      </div>
    </el-dialog>
    <archives-edit
      ref="article"
      :dialog-visible="dialog.isVisible"
      :title="dialog.title"
      :type="dialog.type"
      @close="editClose"
    />
  </div>
</template>
<script>
 
import { getToken } from '@/utils/auth'
import Pagination from '@/components/Pagination'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { calculateSeniority, toCardGetUserInfo } from '@/utils/myUtil'
import ArchivesEdit from './archivesEdit'
 
export default {
  components: {
    ArchivesEdit,
    Pagination, Treeselect
  },
  data() {
    return {
      dialog: {
        isVisible: false,
        title: '',
        type: ''
      },
      total: 0, // 总数量
      queryParams: {
        empNumb: '',
        vague: '',
        sex: [],
        education: [],
        politics: [],
        ageStr: [],
        archivesStatus: [],
        insuranceType: [],
        empStatus: []
      }, // 查询参数
      sort: {}, // 排序
      pagination: { // 分页参数
        size: 10,
        num: 1
      },
      baseicInformationForm: {
      },
      empBaseInfoForm: {
        empId: '',
        customerId: '',
        archivesNumb: '',
        deptId: '',
        deptName: '',
        empNumb: '',
        empName: '',
        sex: '1',
        JobId: '',
        jobName: '',
        empType: '1',
        certificateType: '',
        certificateNumb: '',
        nation: '01',
        certificateValidity: '',
        marriage: '1',
        age: '',
        stature: '',
        birthdate: '',
        politics: '13',
        entryDate: '',
        education: '61',
        seniority: '',
        nativePlace: '',
        nativePlaceName: '',
        censusAddress: '',
        currentAddress: '',
        guardNumb: '',
        telePhone: '',
        returnReceipt: '',
        introducer: '',
        archivesStatus: '0',
        bankName: '',
        bankNumb: '',
        insuranceType: '',
        socialNumb: '',
        family: '',
        handbookStatus: '0',
        urgencyPhone: '',
        empCardStatus: '0',
        certificateList: '',
        createTime: '',
        creator: '',
        modifyTime: '',
        modifier: '',
        delFlag: '0',
        empStatus: 0,
        version: ''
      },
      ygdgForm: {},
      gbdaForm: {
        dgryIds: '',
        dimissionType: '1',
        dimissionDate: new Date(),
        remark: ''
      },
      depts: [],
      fileList: [],
      empBaseInfoRules: {
        archivesNumb: [{ required: true, message: '请输入档案号', trigger: 'blur' }, {
          max: 20,
          message: this.$t('rules.noMoreThan20'),
          trigger: 'blur'
        }],
        empName: [{ required: true, message: '请输入员工姓名', trigger: 'blur' },
          { min: 2, max: 32, message: '长度不超过32个字符', trigger: 'blur' }],
        empNumb: [{ required: true, message: '请输入员工编号', trigger: 'blur' },
          { min: 2, max: 20, message: this.$t('rules.noMoreThan20'), trigger: 'blur' }],
        deptName: [
          { required: true, message: '请选择护卫点', trigger: 'input' }
        ],
        certificateNumb: [{ required: true, message: '请输入身份证号', trigger: 'blur' }, {
          min: 15,
          max: 18,
          message: '身份证长度为15-18位',
          trigger: 'blur'
        }],
        jobName: [{ required: true, message: '请选择岗位', trigger: 'change' }],
        nativePlaceName: [{ required: true, message: '请选择籍贯', trigger: 'change' }],
        bankName: [{ required: true, message: '请输入银行名称', trigger: 'blur' }, {
          max: 36,
          message: '长度不超过36个字符',
          trigger: 'blur'
        }],
        insuranceType: [{ required: true, message: '请选择保险类型', trigger: 'change' }],
        entryDate: [{ required: true, message: '请选择入职日期', trigger: 'change' }],
        seniority: [{ required: true, message: '请输入入司工龄', trigger: 'blur' }],
        archivesStatus: [{ required: true, message: '请选择档案情况', trigger: 'change' }],
        bankNumb: [{ required: true, message: '请输入银行账号', trigger: 'blur' }, {
          max: 32,
          message: '长度不超过32个字符',
          trigger: 'blur'
        }],
        empType: [{ required: true, message: '请选择员工类型', trigger: 'change' }],
        censusAddress: [{ max: 128, message: '长度不超过128个字符', trigger: 'blur' }],
        currentAddress: [{ max: 128, message: '长度不超过128个字符', trigger: 'blur' }],
        guardNumb: [{ max: 40, message: '长度不超过40个字符', trigger: 'blur' }],
        telePhone: [{ max: 30, message: '长度不超过30个字符', trigger: 'blur' }],
        returnReceipt: [{ max: 40, message: '长度不超过40个字符', trigger: 'blur' }],
        introducer: [{ max: 32, message: '长度不超过32个字符', trigger: 'blur' }],
        socialNumb: [{ max: 40, message: '长度不超过40个字符', trigger: 'blur' }],
        family: [{ max: 128, message: '长度不超过128个字符', trigger: 'blur' }],
        certificateValidity: [{ required: true, message: '请选择身份证有效期', trigger: 'change' }],
        urgencyPhone: [{ max: 30, message: '长度不超过30个字符', trigger: 'blur' }]
      },
      gbdaRules: {
        dimissionType: [{ required: true, message: '请选择离职类型', trigger: 'change' }],
        dimissionDate: [{ required: true, message: '请选择关闭日期', trigger: 'change' }],
        selfLeaveDay: [{ required: true, validator: this.validSelfLeaveDay }],
        reporter: [{ required: true, validator: this.validReporter }],
        remark: [{ max: 500, message: '长度不超过500个字符', trigger: 'blur' }]
      },
      ygdgRules: {
        changeType: [{ required: true, message: '请选择调岗类型', trigger: 'change' }],
        changeDate: [{ required: true, message: '请选择调岗日期', trigger: 'change' }],
        jobId: [{ required: true, message: '请选择现岗位', trigger: 'change' }],
        deptId: [{ required: true, message: '请选择现部门', trigger: 'change' }],
        changeReason: [{ max: 500, message: '长度不超过500个字符', trigger: 'blur' }]
      },
      restaurants: [{ value: '北京市', code: '110000' },
        { value: '天津市', code: '120000' },
        { value: '河北省', code: '130000' },
        { value: '山西省', code: '140000' },
        { value: '内蒙古自治区', code: '150000' },
        { value: '辽宁省', code: '210000' },
        { value: '吉林省', code: '220000' },
        { value: '黑龙江省', code: '230000' },
        { value: '上海市', code: '310000' },
        { value: '江苏省', code: '320000' },
        { value: '浙江省', code: '330000' },
        { value: '安徽省', code: '340000' },
        { value: '福建省', code: '350000' },
        { value: '江西省', code: '360000' },
        { value: '山东省', code: '370000' },
        { value: '河南省', code: '410000' },
        { value: '湖北省', code: '420000' },
        { value: '湖南省', code: '430000' },
        { value: '广东省', code: '440000' },
        { value: '广西壮族自治区', code: '450000' },
        { value: '海南省', code: '460000' },
        { value: '重庆市', code: '500000' },
        { value: '四川省', code: '510000' },
        { value: '贵州省', code: '520000' },
        { value: '云南省', code: '530000' },
        { value: '西藏自治区', code: '540000' },
        { value: '陕西省', code: '610000' },
        { value: '甘肃省', code: '620000' },
        { value: '青海省', code: '630000' },
        { value: '宁夏回族自治区', code: '640000' },
        { value: '新疆维吾尔自治区', code: '650000' },
        { value: '台湾省', code: '710000' },
        { value: '香港特别行政区', code: '810000' },
        { value: '澳门特别行政区', code: '820000' }],
      restaurJob: [{ value: '总经理', code: '2942725270000031' },
        { value: '总秘', code: '2942725270000032' },
        { value: '总助', code: '2942725270000033' },
        { value: '经理', code: '2942725270000022' },
        { value: '副经理', code: '2942725270000015' },
        { value: '助理', code: '2942725270000030' },
        { value: '项目经理', code: '2942725270000027' },
        { value: '大队长', code: '2942725270000006' },
        { value: '大队长兼内勤', code: '2942725270000007' },
        { value: '中队长', code: '2942725270000029' },
        { value: '队长', code: '2942725270000011' },
        { value: '分队长', code: '2942725270000013' },
        { value: '副队长', code: '2942725270000014' },
        { value: '班长', code: '2942725270000002' },
        { value: '保安员', code: '2942725270000003' },
        { value: '内勤', code: '2942725270000024' },
        { value: '保洁', code: '2942725270000004' },
        { value: '电工', code: '2942725270000010' },
        { value: '绿化工', code: '2942725270000023' },
        { value: '出纳', code: '2942725270000005' },
        { value: '人事专员', code: '2942725270000025' },
        { value: '司机', code: '2942725270000026' },
        { value: '购买保险', code: '2942725270000016' },
        { value: '广州燃气中队长', code: '2942725270000018' },
        { value: '管理员', code: '2942725270000017' },
        { value: '监控员', code: '2942725270000021' },
        { value: '员工', code: '2942725270000028' }],
      headerHeight: '30px',
      advancedQueryShow: false,
      dialogTableVisible: false,
      dialogShowDcyg: false,
      dialogShowXzyg: false,
      dialogShowYgdg: false,
      dialogShowDryg: false,
      dialogShowGbda: false,
      exportUrl: '',
      checkAll: false,
      isIndeterminate: false,
      cityOptions: ['archivesNumb', 'deptName', 'jobName', 'empName', 'certificateNumb', 'certificateValidity', 'sexName', 'nationName', 'age', 'marriageName', 'stature', 'birthdate', 'politicsName', 'empTypeName', 'educationName', 'nativePlaceName', 'censusAddress', 'currentAddress', 'guardNumb', 'returnReceipt', 'archivesStatusName', 'bankName', 'bankNumb', 'telePhone', 'entryDate', 'InsuranceTypeName', 'socialNumb', 'introducer', 'seniority', 'empCardStatus', 'certificateList', 'urgencyPhone', 'handbookStatusName', 'family'],
      checkedCities: [],
      tableData: [],
      selectDimissionType: 1
    }
  },
  mounted() {
    this.fetch()
    this.initDept()
  },
  methods: {
    editArchives(row) {
      this.$refs.article.setArchives(row)
      this.dialog.title = '档案管理'
      this.dialog.isVisible = true
    },
    editClose() {
      this.dialog.isVisible = false
    },
    resetSearch() {
      this.queryParams = {
        empNumb: '',
        vague: '',
        sex: [],
        education: [],
        politics: [],
        ageStr: [],
        archivesStatus: [],
        insuranceType: [],
        empStatus: []
      }
      this.search()
    },
    // 翻页方法
    search() {
      this.fetch({
        ...this.queryParams,
        ...this.sort
      })
    },
    fetch(params = {}) {
      var that = this
      params.pageSize = this.pagination.size
      params.pageNum = this.pagination.num
      params.delFlag = 0
      params.empStatus = 0
      this.$get('hr/empBaseInfo/zslist', {
        ...params
      }).then((r) => {
        const data = r.data.data
        that.total = data.total
        that.tableData = data.rows
      })
    },
    vagueSearch() {
      this.fetch({
        empNumb: this.queryParams.vague,
        empName: this.queryParams.vague,
        deptName: this.queryParams.vague
      })
    },
    transEmpStatus(empStatus) {
      switch (empStatus) {
        case '0':
          return '在职'
        case '1':
          return '离职'
        case '2':
          return '退休'
      }
    },
    initDept() {
      this.$get('system/dept').then((r) => {
        this.depts = r.data.data.rows
        this.deptTree = this.depts
      }).catch((error) => {
        console.error(error)
        this.$message({
          message: this.$t('tips.getDataFail'),
          type: 'error'
        })
      })
    },
    advancedQueryShowMethods() {
      if (this.advancedQueryShow) {
        this.headerHeight = '30px'
        this.advancedQueryShow = false
      } else {
        this.headerHeight = 'auto'
        this.advancedQueryShow = true
      }
    },
    calculateSeniority(val) {
      this.empBaseInfoForm.seniority = calculateSeniority(val)
    },
    cleanEmpBase() {
      this.empBaseInfoForm.empId = ''
      this.empBaseInfoForm.customerId = ''
      this.empBaseInfoForm.archivesNumb = ''
      this.empBaseInfoForm.deptId = ''
      this.empBaseInfoForm.deptName = ''
      this.empBaseInfoForm.empNumb = ''
      this.empBaseInfoForm.empName = ''
      this.empBaseInfoForm.sex = ''
      this.empBaseInfoForm.JobId = ''
      this.empBaseInfoForm.jobName = ''
      this.empBaseInfoForm.empType = ''
      this.empBaseInfoForm.certificateType = ''
      this.empBaseInfoForm.certificateNumb = ''
      this.empBaseInfoForm.nation = ''
      this.empBaseInfoForm.certificateValidity = ''
      this.empBaseInfoForm.marriage = ''
      this.empBaseInfoForm.age = ''
      this.empBaseInfoForm.stature = ''
      this.empBaseInfoForm.birthdate = ''
      this.empBaseInfoForm.politics = ''
      this.empBaseInfoForm.entryDate = ''
      this.empBaseInfoForm.education = ''
      this.empBaseInfoForm.seniority = ''
      this.empBaseInfoForm.nativePlace = ''
      this.empBaseInfoForm.nativePlaceName = ''
      this.empBaseInfoForm.censusAddress = ''
      this.empBaseInfoForm.currentAddress = ''
      this.empBaseInfoForm.guardNumb = ''
      this.empBaseInfoForm.telePhone = ''
      this.empBaseInfoForm.returnReceipt = ''
      this.empBaseInfoForm.introducer = ''
      this.empBaseInfoForm.archivesStatus = ''
      this.empBaseInfoForm.bankName = ''
      this.empBaseInfoForm.bankNumb = ''
      this.empBaseInfoForm.InsuranceType = ''
      this.empBaseInfoForm.socialNumb = ''
      this.empBaseInfoForm.family = ''
      this.empBaseInfoForm.handbookStatus = ''
      this.empBaseInfoForm.urgencyPhone = ''
      this.empBaseInfoForm.empCardStatus = ''
      this.empBaseInfoForm.certificateList = ''
      this.empBaseInfoForm.createTime = ''
      this.empBaseInfoForm.creator = ''
      this.empBaseInfoForm.modifyTime = ''
      this.empBaseInfoForm.modifier = ''
      this.empBaseInfoForm.delFlag = ''
      this.empBaseInfoForm.version = ''
    },
    editEmpBase(row) {
      this.isAdd = false
      this.empBaseInfoForm.empId = row.empId
      this.empBaseInfoForm.customerId = row.customerId
      this.empBaseInfoForm.archivesNumb = row.archivesNumb
      this.empBaseInfoForm.deptId = row.deptId
      this.empBaseInfoForm.deptName = row.deptName
      this.empBaseInfoForm.empNumb = row.empNumb
      this.empBaseInfoForm.empName = row.empName
      this.empBaseInfoForm.sex = row.sex
      this.empBaseInfoForm.JobId = row.JobId
      this.empBaseInfoForm.jobName = row.jobName
      this.empBaseInfoForm.empType = row.empType
      this.empBaseInfoForm.certificateType = row.certificateType
      this.empBaseInfoForm.certificateNumb = row.certificateNumb
      this.empBaseInfoForm.nation = row.nation
      this.empBaseInfoForm.certificateValidity = row.certificateValidity
      this.empBaseInfoForm.marriage = row.marriage
      this.empBaseInfoForm.age = row.age
      this.empBaseInfoForm.stature = row.stature
      this.empBaseInfoForm.birthdate = row.birthdate
      this.empBaseInfoForm.politics = row.politics
      this.empBaseInfoForm.entryDate = row.entryDate
      this.empBaseInfoForm.education = row.education
      this.empBaseInfoForm.seniority = row.seniority
      this.empBaseInfoForm.nativePlace = row.nativePlace
      this.empBaseInfoForm.nativePlaceName = row.nativePlaceName
      this.empBaseInfoForm.censusAddress = row.censusAddress
      this.empBaseInfoForm.currentAddress = row.currentAddress
      this.empBaseInfoForm.guardNumb = row.guardNumb
      this.empBaseInfoForm.telePhone = row.telePhone
      this.empBaseInfoForm.returnReceipt = row.returnReceipt
      this.empBaseInfoForm.introducer = row.introducer
      this.empBaseInfoForm.archivesStatus = row.archivesStatus
      this.empBaseInfoForm.bankName = row.bankName
      this.empBaseInfoForm.bankNumb = row.bankNumb
      this.empBaseInfoForm.insuranceType = row.insuranceType
      this.empBaseInfoForm.insuranceTypeName = row.insuranceTypeName
      this.empBaseInfoForm.socialNumb = row.socialNumb
      this.empBaseInfoForm.family = row.family
      this.empBaseInfoForm.handbookStatus = row.handbookStatus
      this.empBaseInfoForm.urgencyPhone = row.urgencyPhone
      this.empBaseInfoForm.empCardStatus = row.empCardStatus
      this.empBaseInfoForm.certificateList = row.certificateList
      this.empBaseInfoForm.createTime = row.createTime
      this.empBaseInfoForm.creator = row.creator
      this.empBaseInfoForm.modifyTime = row.modifyTime
      this.empBaseInfoForm.modifier = row.modifier
      this.empBaseInfoForm.delFlag = row.delFlag
      this.empBaseInfoForm.version = row.version
      this.showXzyg(1)
    },
    putEmpBase(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.isAdd) {
            this.$post('hr/empBaseInfo', { ...this.empBaseInfoForm }).then(() => {
              this.buttonLoading = false
              this.$message({
                message: this.$t('tips.createSuccess'),
                type: 'success'
              })
              this.cleanEmpBase()
            })
          } else {
            this.$put('hr/empBaseInfo', { ...this.empBaseInfoForm }).then(() => {
              this.$message({
                message: this.$t('tips.updateSuccess'),
                type: 'success'
              })
              this.$emit('success')
              this.cleanEmpBase()
            })
          }
          this.fetch({
            ...this.queryParams,
            ...this.sort
          })
          this.cleanEmpBase()
          this.showXzyg()
        }
      })
    },
    putEmpBaseContinue(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.isAdd) {
            this.$post('hr/empBaseInfo', { ...this.empBaseInfoForm }).then(() => {
              this.buttonLoading = false
              this.$message({
                message: this.$t('tips.createSuccess'),
                type: 'success'
              })
              this.cleanEmpBase()
            })
          }
          this.cleanEmpBase()
          this.fetch({
            ...this.queryParams,
            ...this.sort
          })
        }
      })
    },
    delEmp() {
      var selection = this.$refs.multipleTable.store.states.selection
      if (selection.length === 0) {
        this.$message({
          message: '请先选中需要删除的数据',
          type: 'error'
        })
      } else {
        this.$confirm('您确认删除该员工么?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var empIds = []
          for (var i = 0; i < selection.length; i++) {
            var data = selection[i]
            empIds.push(data.empId)
          }
          this.$delete(`hr/empBaseInfo/` + empIds.join(',')).then(() => {
            this.$message({
              message: this.$t('tips.deleteSuccess'),
              type: 'success'
            })
            this.search()
          })
        })
      }
    },
    showEmpInfo() {
      this.dialogTableVisible = true
    },
    showXzyg(val) {
      if (val === 0) {
        this.isAdd = true
      }
      if (!this.dialogShowXzyg) {
        // this.isAdd = true
        this.dialogShowXzyg = true
      } else {
        // this.isAdd = false
        this.dialogShowXzyg = false
      }
      this.fetch({
        ...this.queryParams,
        ...this.sort
      })
    },
    handleCheckAllChange(val) {
      this.checkedCities = val ? this.cityOptions : []
      this.isIndeterminate = false
    },
    handleCheckedCitiesChange(value) {
      const checkedCount = value.length
      this.checkAll = checkedCount === this.cityOptions.length
      this.isIndeterminate = checkedCount > 0 && checkedCount < this.cityOptions.length
    },
    showDcyg(operate) {
      switch (operate) {
        case 0:
          this.dialogShowDcyg = true
          break
        case 1:
          this.dialogShowDcyg = false
          break
        case 2:
          var params = this.queryParams
          params.exportField = this.checkedCities.join(',')
          this.$download('hr/empBaseInfo/exportWithField', { ...params }, '在职员工列表.xls').then(() => {
            this.$message({
              message: '下载成功!',
              type: 'success'
            })
          })
          break
      }
    },
    showYgdg(operate, formName) {
      switch (operate) {
        case 0:
          var selection = this.$refs.multipleTable.store.states.selection
          if (selection.length === 0) {
            this.$message({
              message: '请先选中需要调岗的人员',
              type: 'error'
            })
          } else {
            var ids = []
            var names = []
            var deptNames = []
            var jobNames = []
            for (var i = 0; i < selection.length; i++) {
              var data = selection[i]
              ids.push(data.empId)
              names.push(data.empName)
              deptNames.push(data.deptName)
              jobNames.push(data.jobName)
            }
            this.ygdgForm = {
              empIds: ids.join(','),
              empNames: names.join(','),
              oldDeptNames: deptNames.join(','),
              oldJobNames: jobNames.join(',')
            }
            this.dialogShowYgdg = true
          }
          break
        case 1:
          this.dialogShowYgdg = false
          break
        case 2:
          this.$refs[formName].validate((valid) => {
            if (valid) {
              this.$post('hr/empBaseInfo/jobChange', { ...this.ygdgForm }).then(() => {
                this.dialogShowYgdg = false
                this.$message({
                  message: this.$t('员工调岗成功'),
                  type: 'success'
                })
                this.fetch({
                  ...this.queryParams,
                  ...this.sort
                })
              })
            }
          })
          break
      }
    },
    querySearch(queryString, cb) {
      var restaurants = this.restaurants
      var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
      // 调用 callback 返回建议列表的数据
      cb(results)
    },
    createFilter(queryString) {
      return (restaurant) => {
        return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
      }
    },
    placeNameSelect(item) {
      this.empBaseInfoForm.nativePlaceName = item.value
      this.empBaseInfoForm.nativePlace = item.code
    },
    deptNameSelect(node) {
      this.ygdgForm.newDeptName = node.label
    },
    querySearchJob(queryString, cb) {
      const restaurants = this.restaurJob
      const results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
      // 调用 callback 返回建议列表的数据
      cb(results)
    },
    jobNameSelect(item) {
      this.empBaseInfoForm.jobName = item.value
      this.empBaseInfoForm.JobId = item.code
 
      this.ygdgForm.newJobName = item.value
      this.ygdgForm.jobId = item.code
    },
    generateUserInfo(index, val) {
      var userinfo = toCardGetUserInfo(val)
      if (userinfo === null) {
        return
      }
      this.empBaseInfoForm.age = userinfo.age
      this.empBaseInfoForm.birthdate = userinfo.birth
      this.empBaseInfoForm.sex = userinfo.sex
    },
    showDryg(operate) {
      switch (operate) {
        case 0:
          this.dialogShowDryg = true
          break
        case 1:
          this.dialogShowDryg = false
          break
        case 2:
          this.$refs.upload.submit()
          break
      }
    },
    changeDimissionType(value) {
      this.selectDimissionType = value
      console.log('值:' + value)
    },
    validSelfLeaveDay(rule, value, callback) {
      const type = this.gbdaForm.dimissionType
      if (type === 2) {
        if (!value) {
          callback(new Error('自动离职时自离天数不能为空!'))
        } else {
          callback()
        }
      } else {
        callback()
      }
    },
    validReporter(rule, value, callback) {
      const type = this.gbdaForm.dimissionType
      if (type === 2) {
        if (!value) {
          callback(new Error('自动离职时报告人不能为空!'))
        } else {
          if (value.length > 32) {
            callback(new Error('自动离职时报告人最多32个字符!'))
          } else {
            callback()
          }
        }
      } else {
        callback()
      }
    },
    showGbda(operate, formName) {
      switch (operate) {
        case 0:
          var selection = this.$refs.multipleTable.store.states.selection
          if (selection.length === 0) {
            this.$message({
              message: '请先选中需要关闭档案的人员',
              type: 'error'
            })
          } else {
            var ids = []
            var names = []
            var dates = []
            for (var i = 0; i < selection.length; i++) {
              var data = selection[i]
              ids.push(data.empId)
              names.push(data.empName)
              dates.push(data.entryDate)
            }
            const nowDate = new Date()
            const year = nowDate.getFullYear()
            const month = nowDate.getMonth() + 1
            const day = nowDate.getDate()
            this.gbdaForm = {
              empIds: ids.join(','),
              dgryNames: names.join(','),
              entryDates: dates.join(','),
              dimissionType: '1',
              dimissionDate: year + '-' + month + '-' + day,
              remark: ''
            }
            this.dialogShowGbda = true
          }
          break
        case 1:
          this.dialogShowGbda = false
          break
        case 2:
          this.$refs[formName].validate((valid) => {
            if (valid) {
              this.$post('hr/empBaseInfo/dimission', { ...this.gbdaForm }).then(() => {
                this.dialogShowGbda = false
                this.$message({
                  message: this.$t('员工档案关闭成功'),
                  type: 'success'
                })
                this.fetch({
                  ...this.queryParams,
                  ...this.sort
                })
              })
            }
          })
          break
      }
    },
    doDcda() {
      this.$confirm('是否确定要导出档案?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '导出成功!'
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消'
        })
      })
    },
    selectAllSex(val) {
      if (val) {
        this.queryParams.sex = ['1', '2']
      } else {
        this.queryParams.sex = []
      }
    },
    selectAllEducation(val) {
      if (val) {
        this.queryParams.education = ['91', '81', '71', '61', '42', '41', '31', '21', '11', '10']
      } else {
        this.queryParams.education = []
      }
    },
    selectAllPolitics(val) {
      if (val) {
        this.queryParams.politics = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13']
      } else {
        this.queryParams.politics = []
      }
    },
    selectAllAgeStr(val) {
      if (val) {
        this.queryParams.ageStr = ['18-29', '30-39', '40-49', '50-59', '60-69', '69-999']
      } else {
        this.queryParams.ageStr = []
      }
    },
    selectAllArchivesStatus(val) {
      if (val) {
        this.queryParams.archivesStatus = ['0', '1']
      } else {
        this.queryParams.archivesStatus = []
      }
    },
    selectAllInsuranceType(val) {
      if (val) {
        this.queryParams.insuranceType = ['1', '2', '3', '4', '5']
      } else {
        this.queryParams.insuranceType = []
      }
    },
    selectAllEmpStatus(val) {
      if (val) {
        this.queryParams.empStatus = ['0', '1', '2', '3']
      } else {
        this.queryParams.empStatus = []
      }
    },
    headers() {
      const token = getToken()
      if (token) {
        return {
          Authorization: 'bearer ' + token
        }
      } else {
        return null
      }
    }
  }
}
</script>
<style lang="scss">
 
.fj-checkbox{
  .el-checkbox__input.is-checked .el-checkbox__inner {
      border-color: #a32c30;;
      background: #a32c30;;
  }
  .el-checkbox__label {
    color: #000 !important;
  }
}
</style>
<style lang="scss" scoped>
.el-main {
  height: 600px;
}
 
.el-autocomplete {
  width: 100%;
}
 
.el-select {
  width: 100%;
}
 
.el-aside {
  padding: 20px;
  background: #f3f5f8;
  height: 600px;
 
  .el-tree {
    height: 100%;
  }
}
 
.searchTable {
    margin-top: 10px;
    border-collapse: collapse;
    width: 100%;
  tr {
    border-bottom: 1px dashed #d9dadb;
  }
  .td {
    width: 90px;
    text-align: left;
  }
  .td-group {
    padding-left: 20px;
  }
}
.searchTable td,
.searchTable th {
    color: #000;
    height: 50px;
    background-color: #fff;
}
 
#ygxq table {
  border-collapse: collapse;
  margin: 0 auto;
  text-align: center;
  width: 100%;
  margin-top: 20px;
}
 
#ygxq table td,
#ygxq table th {
  border: 1px solid #DDDCDC;
  color: #666;
  height: 30px;
}
 
#ygxq table thead th {
  background-color: #CCE8EB;
  width: 100px;
}
 
#ygxq table tr:nth-child(odd) {
  background: #fff;
}
 
#ygxq table tr:nth-child(even) {
  background: #F5FAFA;
}
 
.tdTitle {
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
 
.link_button {
  color: #169BD5;
}
 
.del_button {
  color: #D9001B;
}
 
#dcygTable {
  border-collapse: collapse;
}
 
#dcygTable td {
  width: 130px;
  text-align: center;
  border: 1px solid darkgray;
  height: 30px;
  font-size:15px;
}
 
.search-btn {
  display: inline-block;
  width: 3.64vw;
  height: 3.2vh;
  line-height: 3.2vh;
  text-align: center;
  background-color: #a00515;
  color: #fff;
  margin-left: 1vw;
  box-sizing: border-box;
  cursor: pointer;
  vertical-align: middle;
}
.sup-search-btn {
  display: inline-block;
  width: 5.2vw;
  height: 3.2vh;
  line-height: 3.2vh;
  text-align: center;
  margin-left: 1vw;
  color: #a00515;
  border: 1px solid #a00515;
  box-sizing: border-box;
  cursor: pointer;
  vertical-align: middle;
}
</style>