烟花爆竹批发企业仓库安全风险监测前端
马宇豪
2025-04-16 e46a6e287f752825a8ae5f4024769cd3fbc39a4a
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
<template>
  <div class="app-container">
    <div class="filter-container">
      <el-button
          type="primary"
          plain
          icon="Plus"
          style="margin-right: 12px"
          @click="openLicenseForm('新增','')"
      >
        新增
      </el-button>
      <div class="basic_search">
        <span>区域:</span>
        <el-select style="margin-right: 12px" v-model="params.province" clearable filterable
                   @change="changeArea('province')">
          <el-option v-for="item in provinceList" :key="item.id" :label="item.name" :value="item.name"></el-option>
        </el-select>
        <el-select style="margin-right: 12px" v-model="params.city" prop="city" clearable filterable
                   @change="changeArea('city')">
          <el-option v-for="item in cityList" :key="item.id" :label="item.name" :value="item.name"></el-option>
        </el-select>
        <el-select style="margin-right: 12px" v-model="params.district" clearable filterable>
          <el-option v-for="item in districtList" :key="item.id" :label="item.name" :value="item.name"></el-option>
        </el-select>
      </div>
      <div class="basic_search">
        <span>创建时间:</span>
        <el-date-picker value-format="YYYY-MM-DD HH:mm:ss" v-model="validTime1" type="datetimerange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
        </el-date-picker>
      </div>
      <div class="basic_search">
        <span>发证时间:</span>
        <el-date-picker value-format="YYYY-MM-DD HH:mm:ss" v-model="validTime2" type="datetimerange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
        </el-date-picker>
      </div>
      <div class="basic_search">
        <span>企业名称:</span>
        <el-input v-model="params.name" style="width: 220px"></el-input>
      </div>
      <div class="basic_search">
        <span>企业类型:</span>
        <el-select filterable clearable v-model="params.type">
          <el-option label="烟花爆竹经营(生产)许可证" value="1">烟花爆竹经营(生产)许可证</el-option>
          <el-option label="烟花爆竹经营(批发)许可证" value="2">烟花爆竹经营(批发)许可证</el-option>
          <el-option label="烟花爆竹经营(长期零售)许可证" value="3">烟花爆竹经营(长期零售)许可证</el-option>
          <el-option label="烟花爆竹经营(短期零售)许可证" value="4">烟花爆竹经营(短期零售)许可证</el-option>
        </el-select>
      </div>
      <div class="basic_search">
        <span>审核状态:</span>
        <el-select filterable clearable v-model="params.reviewstatus">
          <el-option v-for="item in reviewStatusList" :key="item.id" :label="item.name" :value="item.id"/>
        </el-select>
      </div>
      <div class="basic_search">
        <span>许可证状态:</span>
        <el-select filterable clearable v-model="params.validstatus">
          <el-option v-for="item in validStatusList" :key="item.id" :label="item.name" :value="item.id"/>
        </el-select>
      </div>
      <div class="basic_search">
        <span>发证类型:</span>
        <el-select filterable clearable v-model="params.licensecode">
          <el-option v-for="item in licenseStatusList" :key="item.id" :label="item.name" :value="item.id"/>
        </el-select>
      </div>
      <el-button style="margin-left: 10px;" type="primary" @click="searchData()">查询</el-button>
      <el-button type="primary" plain @click="reset()">重置</el-button>
      <el-button style="margin-left: 10px;" type="primary" @click="exportRetail()">零售许可证台账导出</el-button>
      <el-button style="margin-left: 10px;" type="primary" @click="exportWholesale()">批发许可证台账导出</el-button>
 
    </div>
    <div class="table_content">
      <el-table v-loading="listLoading" :key="tableKey" :data="licenseList" border fit @sort-change="sortChange"
                highlight-current-row style="width: 100%;">
        <el-table-column label="序号" type="index" align="center" width="60"/>
        <el-table-column label="行政区划" prop="province" align="center" sortable="custom">
          <template #default="scope">
            {{ scope.row.province }}{{ scope.row.city }}{{ scope.row.district }}
          </template>
        </el-table-column>
        <el-table-column label="单位名称" prop="name" align="center" sortable="custom">
        </el-table-column>
        <el-table-column label="主要负责人" prop="mainpersonname" align="center" sortable="custom">
        </el-table-column>
        <el-table-column label="许可证编号" prop="licensecode" align="center" sortable="custom">
        </el-table-column>
        <el-table-column label="许可证类型" prop="type" align="center" sortable="custom">
          <template #default="scope">
            <div v-for="item in typeList">
              <div v-if="scope.row.type === item.id">
                {{ item.name }}
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="发证类型" prop="licensestatus" align="center" sortable="custom">
        </el-table-column>
        <el-table-column label="发证日期" prop="issuingdate" align="center" sortable="custom">
        </el-table-column>
        <el-table-column label="到期日期" prop="noeffectdate" align="center" sortable="custom">
        </el-table-column>
        <el-table-column label="发证机关" prop="issuingunit" align="center" sortable="custom">
        </el-table-column>
        <el-table-column label="审批状态" prop="reviewstatus" align="center" sortable="custom">
          <template #default="scope">
            <div v-for="item in reviewStatusList">
              <div v-if="scope.row.reviewstatus === item.id">
                {{ item.name }}
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="许可证状态" prop="validstatus" align="center" sortable="custom">
          <template #default="scope">
            <div v-for="item in validStatusList">
              <div v-if="scope.row.validstatus === item.id">
                {{ item.name }}
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
          <template #default="scope">
            <el-button type="text" @click="commit(scope.row.id)"
                       v-if="isSupervision!=='null' && (scope.row.reviewstatus== 0||scope.row.reviewstatus===3) ?true:false">
              提交
            </el-button>
            <el-button type="text" @click="openLicenseForm('修改',scope.row)" v-if="isSupervision==='null'?false:true">
              修改
            </el-button>
            <el-button type="text" @click="openLicenseForm('审核',scope.row)"
                       v-if="isSupervision ==='null' &&scope.row.reviewstatus !==2&&scope.row.reviewstatus !==3">审核
            </el-button>
            <el-button type="text" @click="refuse(scope.row.id)"
                       v-if="isSupervision ==='null'&&scope.row.reviewstatus !==3">驳回
            </el-button>
            <el-button type="text" @click="deleteById(scope.row.id)" v-if="isSupervision==='null'?false:true">删除
            </el-button>
            <br>
            <el-button type="text" v-print="printObj1" @click="giveData(scope.row)"
                       v-if="isSupervision==='null' && scope.row.reviewstatus === 2?true:false">打印正本(新)
            </el-button>
            <el-button type="text" v-print="printObj2" @click="giveDetail(scope.row)"
                       v-if="isSupervision==='null' && scope.row.reviewstatus === 2?true:false">打印副本(新)
            </el-button>
            <el-button type="text" v-print="printObj3" @click="giveData(scope.row)"
                       v-if="isSupervision==='null' && scope.row.reviewstatus === 2?true:false">打印正本(旧)
            </el-button>
            <el-button type="text" v-print="printObj4" @click="giveDetail(scope.row)"
                       v-if="isSupervision==='null' && scope.row.reviewstatus === 2?true:false">打印副本(旧)
            </el-button>
          </template>
        </el-table-column>
        <el-table-column label="其他操作" v-if="isSupervision === 'null'" align="center" width="180"
                         class-name="small-padding fixed-width">
          <template #default="scope">
            <el-button type="text" v-if="scope.row.reviewstatus === 2"
                       @click="openDelayLicenseDialog(scope.row)">延期
            </el-button>
            <el-button type="text" v-if="scope.row.reviewstatus === 2"
                       @click="openModLicenseDialog(scope.row)">变更
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <br>
      <el-pagination v-show="recordTotal>0" :current-page="currentPage" :page-sizes="[10, 20, 30, 50]"
                     :page-size="pageSize" :total="recordTotal" layout="total, sizes, prev, pager, next, jumper"
                     background
                     style="float:right;" @size-change="handleSizeChange" @current-change="handleCurrentChange"/>
      <br>
    </div>
    <div v-show="false">
      <div id="printMe1">
        <el-row style="height:130px;margin-left:140px;margin-top:197px">
          <el-col :span="3">
            <span style="display: inline-block;font-size: 20px;">统一社会信用代码</span>
          </el-col>
          <el-col :span="15">
            <span style="display: inline-block;font-size: 20px;">&nbsp;&nbsp;{{ code }}</span>
          </el-col>
          <el-col :span="6">
            <div style="width: 40%;height: 40%;margin-left:65px;padding-top: 35px" id="qrcode" ref="qrcode">
            </div>
          </el-col>
        </el-row>
        <el-row style="text-align: center;height:35px;font-size: 20px;margin-top:70px">
          <el-col :span="24">
            <span>编号&emsp;&emsp;</span>
            <span style="display: inline-block">{{ value }}</span>
          </el-col>
        </el-row>
        <el-row style="height:75px;margin-left:140px;margin-top:30px;">
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span v-if="type === 2">企业名称</span>
            <span v-if="type === 3 || type === 4">单位名称</span>
          </el-col>
          <el-col :span="11" style="font-size: 27px">
            <span>{{ name }}</span>
          </el-col>
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span v-if="type === 2">主要负责人</span>
            <span v-if="type === 3 || type === 4">许可类型</span>
          </el-col>
          <el-col :span="5" style="font-size: 27px">
            <span v-if="type === 2">{{ mainpersonname }}</span>
            <span v-if="type === 3 || type === 4">{{ licensetype }}</span>
          </el-col>
          <el-col :span="2" style="font-size: 27px;">
            <span></span>
          </el-col>
        </el-row>
        <el-row style="height:75px;margin-left:140px;">
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span v-if="type === 2">注册地址</span>
            <span v-if="type === 3  || type === 4">主要负责人</span>
          </el-col>
          <el-col :span="11" style="font-size: 27px">
                        <span
                            v-if="type === 2">{{ province === "新疆维吾尔自治区" ? "新疆" : province }}{{
                            city
                          }}{{ district }}{{ address }}</span>
            <span v-if="type === 3 || type === 4">{{ mainpersonname }}</span>
          </el-col>
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span v-if="type === 2">库区面积</span>
            <span v-if="type === 3 || type === 4">经营方式</span>
          </el-col>
          <el-col :span="5" style="font-size: 27px">
            <span v-if="type === 2">{{ area }}㎡</span>
            <span v-if="type === 3 || type === 4">{{ dealingtype }}</span>
          </el-col>
          <el-col :span="2" style="font-size: 27px;">
            <span></span>
          </el-col>
        </el-row>
        <el-row style="height:75px;margin-left:140px;">
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span v-if="type === 2">仓储地址</span>
            <span v-if="type === 3 || type === 4">单位地址</span>
          </el-col>
          <el-col :span="11" style="font-size: 27px">
                        <span
                            v-if="type === 2">{{
                            storageprovince === "新疆维吾尔自治区" ? "新疆" : storageprovince
                          }}{{ storagecity }}{{ storagedistrict }}{{ storageaddress }}</span>
            <span
                v-if="type === 3 || type === 4">{{ province === "新疆维吾尔自治区" ? "新疆" : province }}{{
                city
              }}{{ district }}{{ address }}</span>
          </el-col>
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span v-if="type === 2">库房面积</span>
            <span v-if="type === 3 || type === 4">经营面积</span>
          </el-col>
          <el-col :span="5" style="font-size: 27px">
            <span v-if="type === 2">{{ storagearea }}㎡</span>
            <span v-if="type === 3 || type === 4">{{ area }}㎡</span>
          </el-col>
          <el-col :span="2" style="font-size: 27px;">
            <span></span>
          </el-col>
        </el-row>
        <el-row style="height:100px;margin-left:140px;">
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span>许可范围</span>
          </el-col>
          <el-col :span="11" style="font-size: 22px;padding-right: 80px;">
            <span>{{ dealingrange }}</span>
          </el-col>
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span v-if="type === 2">核定药量</span>
            <span v-if="type === 3 || type === 4">核定储量</span>
          </el-col>
          <el-col :span="5" style="font-size: 27px;">
            <span>{{ powder }}kg</span>
            <span>({{ reservebox }}箱)</span>
          </el-col>
          <el-col :span="2" style="font-size: 27px;">
            <span></span>
          </el-col>
        </el-row>
        <el-row style="height:40px;margin-left:140px;">
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span>有效期</span>
          </el-col>
          <el-col :span="4" style="font-size: 27px">
            <span>{{ effectdate }}</span>
          </el-col>
          <el-col :span="1" style="font-size: 27px;font-weight: bold">
            <span>至</span>
          </el-col>
          <el-col :span="5" style="font-size: 27px">
            <span>{{ noeffectdate }}</span>
          </el-col>
          <el-col :span="11" style="font-size: 27px">
            <span></span>
          </el-col>
          <!--                    <el-col :span="8"  style="font-size: 27px;margin-top:38px;">-->
          <!--                        <span>{{issuingunit}}</span>-->
          <!--                    </el-col>-->
        </el-row>
        <el-row style="height:60px;margin-left:140px;">
          <el-col :span="14" style="font-size: 1px">
            <span>{{ "." }}</span>
          </el-col>
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span>发证机关</span>
          </el-col>
          <el-col :span="5" style="font-size: 27px;">
            <span>{{ issuingunit }}</span>
          </el-col>
          <el-col :span="2" style="font-size: 27px;">
            <span></span>
          </el-col>
        </el-row>
        <el-row style="height:60px;margin-left:140px;">
          <el-col :span="14" style="font-size: 1px">
            <span>{{ "." }}</span>
          </el-col>
          <el-col :span="3" style="font-size: 27px;font-weight: bold">
            <span>发证日期</span>
          </el-col>
          <el-col :span="2" style="font-size: 27px;">
            <span>{{ year }}</span>
            <span style="font-size: 27px;font-weight: bold">&nbsp;年</span>
          </el-col>
          <el-col :span="3" style="font-size: 27px;">
            <span>{{ month }}</span>
            <span style="font-size: 27px;font-weight: bold">月</span>
            <span>&nbsp;{{ day }}</span>
            <span style="font-size: 27px;font-weight: bold">日</span>
          </el-col>
          <el-col :span="2" style="font-size: 27px;">
            <span></span>
          </el-col>
        </el-row>
      </div>
    </div>
 
 
    <div v-show="false">
      <div id="printMe2">
        <el-row>
          <el-col :span="7" style="margin-top:670px;margin-left: 80px">
            <el-row style="height: 60px;">
              <el-col :span="6" style="font-weight: bold;">
                <span v-if="type === 2">企业名称</span>
                <span v-if="type === 3">单位名称</span>
              </el-col>
              <el-col :span="18">
                {{ name }}
              </el-col>
            </el-row>
            <el-row style="height: 60px;margin-top: 4px">
              <el-col :span="6" style="font-weight: bold;">
                <span v-if="type === 2">注册地址</span>
                <span v-if="type === 3">主要负责人</span>
              </el-col>
              <el-col :span="18">
                                <span
                                    v-if="type === 2">{{ province === "新疆维吾尔自治区" ? "新疆" : province }}{{
                                    city
                                  }}{{ district }}{{ address }}</span>
                <span v-if="type === 3">{{ mainpersonname }}</span>
              </el-col>
            </el-row>
            <el-row style="height: 60px;margin-top: 4px">
              <el-col :span="6" style="font-weight: bold;">
                <span></span>
                <span v-if="type === 2">仓储地址</span>
                <span v-if="type === 3">单位地址</span>
              </el-col>
              <el-col :span="18">
                                <span
                                    v-if="type === 2">{{ province === "新疆维吾尔自治区" ? "新疆" : province }}{{
                                    city
                                  }}{{ storagedistrict }}{{ storageaddress }}</span>
                <span
                    v-if="type === 3">{{ province === "新疆维吾尔自治区" ? "新疆" : province }}{{ city }}{{
                    district
                  }}{{ address }}</span>
              </el-col>
            </el-row>
            <el-row style="height: 60px;margin-top: 4px">
              <el-col :span="6" style="font-weight: bold;">
                <span>许可范围</span>
              </el-col>
              <el-col :span="18">
                {{ dealingrange }}
              </el-col>
            </el-row>
            <el-row style="height: 60px;margin-top: 4px">
              <el-col :span="6" style="font-weight: bold;">
                <span>有效期</span>
              </el-col>
              <el-col :span="8">
                {{ (effectdate) }}
              </el-col>
              <el-col :span="2" style="font-weight: bold">至</el-col>
              <el-col :span="7">
                {{ (noeffectdate) }}
              </el-col>
            </el-row>
          </el-col>
 
          <el-col :span="13" style="margin-top: 385px;">
            <el-row>
 
              <el-col :span="10">
                <el-row>
                  <el-col :span="10">
                    <span>编号</span>
                  </el-col>
                  <el-col :span="14">
                    <span>{{ value }}</span>
                  </el-col>
                </el-row>
                <el-row style="margin-top: 17px;">
                  <el-col :span="10">
                    <span>统一社会信用代码</span>
                  </el-col>
                  <el-col :span="14">
                    <span>{{ code }}</span>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="10">
                <div style="width:20px;height:20px;margin-top: 14px;margin-left: 28px" class="qrcode"
                     id="qrcode2" ref="qrcode"></div>
              </el-col>
            </el-row>
 
            <el-row style="margin-top: 92px;padding-left: 120px">
              <el-col :span="4" style="font-weight: bold;">
                <span v-if="type === 2">主要负责人</span>
                <span v-if="type === 3 || type === 4">许可类型</span>
              </el-col>
              <el-col :span="8">
                <span v-if="type === 2">{{ mainpersonname }}</span>
                <span v-if="type === 3 || type === 4">{{ licensetype }}</span>
              </el-col>
            </el-row>
            <el-row style="margin-top: 48px;margin-left: 120px;">
              <el-col :span="4" style="font-weight: bold;">
                <span v-if="type === 2">库区面积</span>
                <span v-if="type === 3">经营方式</span>
 
              </el-col>
              <el-col :span="8">
                <span v-if="type === 2">{{ area }}㎡</span>
                <span v-if="type === 3">{{ dealingtype }}</span>
              </el-col>
            </el-row>
            <el-row style="margin-top: 48px;margin-left: 120px;">
              <el-col :span="4" style="font-weight: bold;">
                <span v-if="type === 2">库房面积</span>
                <span v-if="type === 3">经营面积</span>
              </el-col>
              <el-col :span="8">
                <span v-if="type === 2">{{ storagearea }}㎡</span>
                <span v-if="type === 3">{{ area }}㎡</span>
              </el-col>
            </el-row>
            <el-row style="margin-top: 48px;margin-left: 120px;">
              <el-col :span="4" style="font-weight: bold;">
                <span v-if="type === 2">核定药量</span>
                <span v-if="type === 3">核定储量</span>
              </el-col>
              <el-col :span="8">
                <span>{{ powder }}kg</span>
                <span>({{ reservebox }}箱)</span>
              </el-col>
            </el-row>
            <el-row style="margin-top: 150px;margin-left: 120px;">
              <el-col :span="4" style="font-weight: bold;">
                <span>发证机关</span>
              </el-col>
              <el-col :span="8">
                {{ issuingunit }}
              </el-col>
            </el-row>
            <el-row style="margin-top: 30px;margin-left: 120px">
              <el-col :span="4" style="font-weight: bold;">
                <span>发证日期</span>
              </el-col>
              <el-col :span="3">
                <span>{{ year }}&emsp;</span>
                <span style="font-weight: bold;">年</span>
              </el-col>
              <el-col :span="3">
                <span>{{ month }}</span>
                <span style="font-weight: bold;">月</span>
                <span>&nbsp;{{ day }}</span>
                <span style="font-weight: bold;">日</span>
              </el-col>
 
            </el-row>
          </el-col>
        </el-row>
      </div>
    </div>
    <div v-show="false">
      <div id="printMe3">
        <el-row style="height:130px;margin-left:320px;padding-top:95px;padding-bottom: 95px">
          <el-col :span="18">
            <span style="display: inline-block;font-size: 25px;"></span>
          </el-col>
          <el-col :span="6">
            <div style="width: 40%;height: 40%;margin-left:20%;padding-top: 10px" id="qrcode3"
                 ref="qrcode"/>
          </el-col>
        </el-row>
        <el-row style="height:50px;font-size: 20px;margin-top:280px;margin-left:1050px;">
          <el-col :span="24">
            <span style="display: inline-block">{{ value }}</span>
          </el-col>
        </el-row>
        <el-row style="height:60px;margin-left:470px;margin-top:28px;">
          <el-col :span="13" style="font-size: 22px">
            <span>{{ name }}</span>
          </el-col>
          <el-col :span="8" style="font-size: 22px;padding-left: 50px">
            <span>{{ mainpersonname }}</span>
          </el-col>
        </el-row>
        <el-row style="height:80px;margin-left:470px;">
          <el-col :span="13" style="font-size: 22px;height: 90px;padding-right: 200px;">
            <span>{{ province === "新疆维吾尔自治区" ? "新疆" : province }}{{ city }}{{ district }}{{ address }}</span>
          </el-col>
          <!--<el-col :span="8"  style="font-size: 27px">
              <span>{{area}}㎡</span>
          </el-col>-->
          <el-col :span="7" style="font-size: 22px;padding-left: 50px;padding-top: 10px">
            <span>{{ economictype }}</span>
          </el-col>
        </el-row>
        <!--<el-row style="height:60px;margin-left:290px;">
            <el-col :span="16"  style="font-size: 27px">
                <span>{{storageaddress}}</span>
            </el-col>
            <el-col :span="8"  style="font-size: 27px">
                <span>{{storagearea}}㎡</span>
            </el-col>
        </el-row>-->
        <el-row style="height:100px;margin-left:470px;">
          <el-col :span="13" style="font-size: 22px;padding-right: 200px;">
            <span>{{ dealingrange }}</span><br>
            <span>核定药量:{{ powder }}kg</span>
            <span>({{ reservebox }}箱)</span>
          </el-col>
          <el-col :span="8" style="font-size: 22px;padding-left: 50px;height: 80px">
            <span>{{ storageprovince === "新疆维吾尔自治区" ? "新疆" : storageprovince }}{{
                storagecity
              }}{{ storagedistrict }}{{ storageaddress }}</span><br>
            <span>库区面积{{ area }}㎡</span>;
            <span>库房面积{{ storagearea }}㎡</span>
          </el-col>
          <!--<el-col :span="8"  style="font-size: 27px;margin-top:20px;">
              <span>{{powder}}kg</span>
          </el-col>-->
        </el-row>
        <el-row style="height:80px;margin-left:400px;">
          <el-col :span="10" style="font-size: 1px">
            <span>.</span>
          </el-col>
          <el-col :span="7" style="font-size: 18px;margin-top:24px;padding-left: 180px;">
            <span>{{ issuingunit }}</span>
          </el-col>
        </el-row>
        <el-row style="height:75px;margin-left:290px;">
          <el-col :span="2" style="font-size: 22px;margin-top: 15px;margin-left:45px">
            <span>{{ year1 }}</span>
          </el-col>
          <el-col :span="1" style="font-size: 22px;margin-top: 15px;margin-left:0px">
            <span>{{ month1 }}</span>
          </el-col>
          <el-col :span="1" style="font-size: 22px;margin-top: 15px;margin-left:20px">
            <span>{{ day1 }}</span>
          </el-col>
          <el-col :span="2" style="font-size: 22px;margin-top: 15px;margin-left:40px">
            <span>{{ year2 }}</span>
          </el-col>
          <el-col :span="1" style="font-size: 22px;margin-top: 15px;margin-left:7px">
            <span>{{ month2 }}</span>
          </el-col>
          <el-col :span="1" style="font-size: 22px;margin-top: 15px;margin-left:20px">
            <span>{{ day2 }}</span>
          </el-col>
          <el-col :span="2" style="font-size: 22px;margin-top: 15px;margin-left:210px">
            <span>{{ year }}</span>
          </el-col>
          <el-col :span="1" style="font-size: 22px;margin-top: 15px;margin-left:35px">
            <span>{{ month }}</span>
          </el-col>
          <el-col :span="1" style="font-size: 22px;margin-top: 15px;margin-left:35px">
            <span>{{ day }}</span>
          </el-col>
        </el-row>
      </div>
    </div>
    <div v-show="false">
      <div id="printMe4">
        <el-row>
          <el-col :span="8" style="margin-top:666px;margin-left: 170px">
            <el-row>
              <el-col :span="24" style="margin-top: 140px;margin-left: 70px">
                {{ value }}
              </el-col>
              <el-col :span="8" style="margin-top: 38px;margin-left: 70px;height: 60px">
                {{ issuingunit }}
              </el-col>
              <el-col style="margin-left: 70px">
                <el-col :span="2" style="margin-top: 17px;">
                  <span>{{ year }}</span>
                </el-col>
                <el-col :span="1" style="margin-top: 17px;margin-left:18px">
                  <span>{{ month }}</span>
                </el-col>
                <el-col :span="1" style="margin-top: 17px;margin-left:20px">
                  <span>{{ day }}</span>
                </el-col>
              </el-col>
            </el-row>
          </el-col>
          <el-col :span="12" style="margin-top: 386px;">
            <el-row style="margin-left: 225px">
              <el-col :span="8">
                <div style="width:20px;height:20px;" class="qrcode" id="qrcode4" ref="qrcode"/>
              </el-col>
            </el-row>
            <el-row style="margin-top: 58px;margin-left: 75px;padding-top: 20px;">
              <el-col :span="8">
                {{ name }}
              </el-col>
            </el-row>
            <el-row style="margin-top: 38px;margin-left: 75px">
              <el-col :span="8">
                {{ mainpersonname }}
              </el-col>
            </el-row>
            <el-row style="margin-top: 50px;margin-left: 75px;height: 35px">
              <el-col :span="8">
                <span>{{ province === "新疆维吾尔自治区" ? "新疆" : province }}{{ city }}{{ district }}{{
                    address
                  }}</span>
              </el-col>
            </el-row>
            <el-row style="margin-top: 22px;margin-left: 75px">
              <el-col :span="8">
                {{ economictype }}
              </el-col>
            </el-row>
            <el-row style="margin-top: 15px;margin-left: 75px;height: 35px">
              <el-col :span="8">
                <span>{{ storageprovince === "新疆维吾尔自治区" ? "新疆" : storageprovince }}{{
                    storagecity
                  }}{{ storagedistrict }}{{ storageaddress }}</span><br>
                <span>库区面积{{ area }}㎡</span>;
                <span>库房面积{{ storagearea }}㎡</span>
              </el-col>
            </el-row>
            <el-row style="margin-top: 60px;margin-left: 75px;height: 80px">
              <el-col :span="8">
                <span>{{ dealingrange }}</span><br>
                <span>核定药量:{{ powder }}kg</span>
                <span>({{ reservebox }}箱)</span>
              </el-col>
            </el-row>
            <el-row style="margin-top: 89px;margin-left: 8px">
              <el-col :span="2" style="font-size: 16px;margin-left:5px">
                <span>{{ year1 }}</span>
              </el-col>
              <el-col :span="1" style="font-size: 16px;margin-left:0px">
                <span>{{ month1 }}</span>
              </el-col>
              <el-col :span="1" style="font-size: 16px;margin-left:1px">
                <span>{{ day1 }}</span>
              </el-col>
              <el-col :span="1" style="font-size: 16px;margin-left:17px">
                <span>{{ year2 }}</span>
              </el-col>
              <el-col :span="1" style="font-size: 16px;margin-left:22px">
                <span>{{ month2 }}</span>
              </el-col>
              <el-col :span="1" style="font-size: 16px;margin-left:5px">
                <span>{{ day2 }}</span>
              </el-col>
            </el-row>
          </el-col>
        </el-row>
      </div>
    </div>
    <el-dialog :visible.sync="refuseVisible" append-to-body :close-on-click-modal="false" width="30%">
      <el-form ref="refuseForm" :model="refuseForm" label-position="right" label-width="80px">
        <el-form-item label="驳回理由:" prop="name">
          <el-input type="textarea" :rows="2" v-model="refuseForm.rejectnote"/>
        </el-form-item>
      </el-form>
      <div align="right">
        <el-button type="primary" @click="submitRefuse()">确认</el-button>
      </div>
    </el-dialog>
    <license-info-form ref="addFormRef" @getinfo="getLicenseListData"></license-info-form>
    <license-delay-form ref="delay-form" @getinfo="getLicenseListData"></license-delay-form>
    <license-mod-form ref="mod-form" @getinfo="getLicenseListData"></license-mod-form>
  </div>
</template>
 
<script>
import {
  computePageCount,
  formatDateDay
} from '../../../utils/licence'
import {
  getLicenseList,
  getExportLicense,
  reviewLicenseInfo,
  deleteById,
  deleteCertificate,
  getCityListData,
  getProvinceListData,
  refuseLicense
} from "../../../api/monitor/permit";
import Cookies from "js-cookie";
import XLSX from 'xlsx-js-style';
// import QRCode from "qrcodejs2";
import LicenseInfoForm from "./components/licenseInfoForm";
import LicenseDelayForm from "./components/licenseDelayForm"
import LicenseModForm from "./components/licenseModForm"
import {ElMessage} from "element-plus";
 
export default {
  name: "carrier",
  data() {
    return {
      cityList: [],
      provinceList: [],
      districtList: [],
      streetList: [],
      committeeList: [],
      validTime1: [],
      validTime2: [],
      refuseVisible: false,
      enterprisenumber: '',
      value: '',
      code: '',
      name: '',
      mainpersonname: '11',
      province: '',
      city: '',
      district: '',
      address: '',
      area: '',
      storageaddress: '',
      storagearea: '',
      storageprovince: '',
      storagecity: '',
      storagedistrict: '',
      economictype: '',
      dealingrange: '',
      reservebox: '',
      powder: '',
      effectdate: '',
      noeffectdate: '',
      issuingunit: '',
      year: '',
      month: '',
      day: '',
      year1: '',
      month1: '',
      day1: '',
      year2: '',
      month2: '',
      day2: '',
      type: '',
      licensetype: '',
      dealingtype: '',
      tableKey: 0,
      listLoading: false,
      approveVisible: false,
      pageSize: 10,
      recordTotal: 0,
      currentPage: 1,
      pageTotal: 0,
      ruleForm: {},
      isSupervision: '',
      roleType: '',
      params: {
        pageIndex: 1,
        pageSize: 10,
        sort: '',
        order: "ASC",
        name: '',
        type: '',
        province: '',
        city: '',
        district: '',
        starttime1: '',
        endtime1: '',
        starttime2: '',
        endtime2: '',
        reviewstatus: '',
        validstatus: '',
        licensecode: '',
      },
      dataForm: {
        signperson: '',
        issueperson: '',
        issuepersonphone: '',
        id: '',
      },
      listQuery: {
        filter: {
          code: "",
          page: "approve",
        },
        pageIndex: 1,
        pageSize: 100,
      },
      refuseForm: {
        id: '',
        rejectnote: '',
      },
      searchContent: '',
      licenseList: [],
      reviewStatusList: [{
        id: 0,
        name: '等待提交'
      },
        {
          id: 1,
          name: '等待审核'
        },
        {
          id: 2,
          name: '审核通过'
        },
        {
          id: 3,
          name: '审核驳回'
        },
      ],
      licenseStatusList: [{
        id: 'NEW',
        name: '新发'
      },
        {
          id: 'POSTP',
          name: '延期'
        },
        {
          id: 'MOD',
          name: '变更'
        },
      ],
      validStatusList: [{
        id: -1,
        name: '已注销'
      },
        {
          id: 1,
          name: '有效'
        },
        {
          id: -2,
          name: '已过期'
        }
      ],
      typeList: [{
        id: 1,
        name: '烟花爆竹经营(生产)许可证'
      },
        {
          id: 2,
          name: '烟花爆竹经营(批发)许可证'
        },
        {
          id: 3,
          name: '烟花爆竹经营(长期零售)许可证'
        },
        {
          id: 4,
          name: '烟花爆竹经营(短期零售)许可证'
        }
      ],
      licensetypeList: [{
        id: 1,
        name: '长期'
      },
        {
          id: 2,
          name: '临时'
        }
      ],
      dealingtypeList: [{
        id: 1,
        name: '专柜'
      },
        {
          id: 2,
          name: '专店'
        }
      ],
      printObj1: {
        id: 'printMe1',
        extraHead: '<meta  http-equiv="Content-Language" content="zh-cn"/>'
      },
      printObj2: {
        id: 'printMe2',
        extraHead: '<meta  http-equiv="Content-Language" content="zh-cn"/>'
      },
      printObj3: {
        id: 'printMe3',
        extraHead: '<meta  http-equiv="Content-Language" content="zh-cn"/>'
      },
      printObj4: {
        id: 'printMe4',
        extraHead: '<meta  http-equiv="Content-Language" content="zh-cn"/>'
      },
    }
  },
  components: {
    LicenseInfoForm,
    LicenseDelayForm,
    LicenseModForm
  },
  created() {
    this.isSupervision = Cookies.get('isSupervision')
    this.roleType = Cookies.get('roleType')
    this.getProvince()
    this.getLicenseListData()
    console.log(this.isSupervision, this.roleType, 6666666666)
  },
 
  methods: {
    giveDetail(val) {
      console.log(val)
      this.code = val.code
      this.name = val.name
      this.mainpersonname = val.mainpersonname
      this.province = val.province
      this.city = val.city
      this.district = val.district
      this.address = val.address
      if (val.type === 2) {
        if (JSON.parse(val.licenseStorage)[0] && JSON.parse(val.licenseStorage)[0].area) {
          this.area = JSON.parse(val.licenseStorage)[0].area
        } else {
          this.area = 0
        }
        this.storagearea = JSON.parse(val.licenseStorage)[0].storagearea
        this.powder = JSON.parse(val.licenseStorage)[0].powder
      } else if (val.type === 3 || val.type === 4) {
        this.area = val.dealingarea
        this.powder = val.reservekg
        if (val.licensetype === 1) {
          this.licensetype = '长期零售'
        } else {
          this.licensetype = '短期零售'
        }
        if (val.dealingtype === 2 || val.dealingtype === 4) {
          this.dealingtype = '专店'
        } else {
          this.dealingtype = '专柜'
        }
      }
 
      this.reservebox = val.reservebox
      this.storageaddress = val.storageaddress
      this.storageprovince = val.storageprovince
      this.storagecity = val.storagecity
      this.storagedistrict = val.storagedistrict
      //带出口的特殊情况
      if (val.remark.indexOf("批发出口") != -1) {
        this.dealingrange = val.dealingRangeStr + " (批发出口) ★★★"
      } else {
        this.dealingrange = val.dealingRangeStr + "  ★★★"
      }
      // 乌鲁木齐局临时自定义许可范围
      // this.dealingrange="烟花类(C级、D级)、爆竹类(C级)、喷花类(C级、D级)、旋转类(C级、D级)、吐珠类(C级)、玩具类(C级、D级)、组合烟花类(C级、D级),储存能力76吨;烟花类储存(A类储存能力2吨、B类储存能力5吨,仅限于储存,储存库为4号库)  ★★★"
 
      this.effectdate = formatDateDay(val.effectdate)
      this.noeffectdate = formatDateDay(val.noeffectdate)
      this.issuingunit = val.issuingunit
      this.value = val.licensecode
      this.type = val.type
      this.enterprisenumber = val.enterprisenumber
      this.year = val.issuingdate.split('-')[0]
      this.month = val.issuingdate.split('-')[1]
      this.day = val.issuingdate.split('-')[2]
      this.year1 = val.effectdate.split('-')[0]
      this.month1 = val.effectdate.split('-')[1]
      this.day1 = val.effectdate.split('-')[2]
      this.year2 = val.noeffectdate.split('-')[0]
      this.month2 = val.noeffectdate.split('-')[1]
      this.day2 = val.noeffectdate.split('-')[2]
      this.economictype = val.economictype
      this.$nextTick(() => {
        this.qrcode()
      })
    },
    //打印正本
    giveData(val) {
      console.log(JSON.parse(val.licenseStorage)[0], '>>>>')
      this.code = val.code
      this.name = val.name
      this.mainpersonname = val.mainpersonname
      this.province = val.province
      this.city = val.city
      this.district = val.district
      this.address = val.address
      if (val.type === 2) {
        if (JSON.parse(val.licenseStorage)[0]) {
          this.area = JSON.parse(val.licenseStorage)[0].area
          this.storagearea = JSON.parse(val.licenseStorage)[0].storagearea
          this.powder = JSON.parse(val.licenseStorage)[0].powder
        } else {
          this.area = 0
          this.storagearea = 0
          this.powder = 0
        }
        // this.storagearea = JSON.parse(val.licenseStorage)[0].storagearea
        // this.powder = JSON.parse(val.licenseStorage)[0].powder
      } else if (val.type === 3 || val.type === 4) {
        this.area = val.dealingarea
        this.powder = val.reservekg
        if (val.licensetype === 1) {
          this.licensetype = '长期零售'
        } else {
          this.licensetype = '短期零售'
        }
        if (val.dealingtype === 2 || val.dealingtype === 4) {
          this.dealingtype = '专店'
        } else {
          this.dealingtype = '专柜'
        }
      }
 
      this.storageaddress = val.storageaddress
      this.storageprovince = val.storageprovince
      this.storagecity = val.storagecity
      this.storagedistrict = val.storagedistrict
      // 带出口的特殊情况
      if (val.remark.indexOf("批发出口") != -1) {
        this.dealingrange = val.dealingRangeStr + " (批发出口) ★★★"
      } else {
        this.dealingrange = val.dealingRangeStr + "  ★★★"
      }
      // 乌鲁木齐局临时自定义许可范围
      // this.dealingrange="烟花类(C级、D级)、爆竹类(C级)、喷花类(C级、D级)、旋转类(C级、D级)、吐珠类(C级)、玩具类(C级、D级)、组合烟花类(C级、D级),储存能力76吨;烟花类储存(A类储存能力2吨、B类储存能力5吨,仅限于储存,储存库为4号库)  ★★★"
 
      this.reservebox = val.reservebox
      this.effectdate = formatDateDay(val.effectdate)
      this.noeffectdate = formatDateDay(val.noeffectdate)
      this.issuingunit = val.issuingunit
      this.value = val.licensecode
      this.type = val.type
      this.enterprisenumber = val.enterprisenumber
      this.year = val.issuingdate.split('-')[0]
      this.month = val.issuingdate.split('-')[1]
      this.day = val.issuingdate.split('-')[2]
      this.year1 = val.effectdate.split('-')[0]
      this.month1 = val.effectdate.split('-')[1]
      this.day1 = val.effectdate.split('-')[2]
      this.year2 = val.noeffectdate.split('-')[0]
      this.month2 = val.noeffectdate.split('-')[1]
      this.day2 = val.noeffectdate.split('-')[2]
      this.economictype = val.economictype
      this.$nextTick(() => {
        this.qrcode()
      })
    },
    qrcode() {
      if (this.enterprisenumber != '') {
        document.getElementById("qrcode").innerHTML = ""
        let qrcode = new QRCode('qrcode', {
          width: 125,
          height: 125, // 高度
          text: this.enterprisenumber, // 二维码内容
          // render: 'canvas' ,   // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
          background: '#f0f', // 背景色
          // foreground: '#ff0'    // 前景色
 
        })
 
        document.getElementById("qrcode2").innerHTML = ""
        let qrcode2 = new QRCode('qrcode2', {
          width: 90,
          height: 90, // 高度
          text: this.enterprisenumber, // 二维码内容
          // render: 'canvas' ,   // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
          background: '#f0f', // 背景色
          // foreground: '#ff0'    // 前景色
 
        })
 
        document.getElementById("qrcode3").innerHTML = ""
        let qrcode3 = new QRCode('qrcode3', {
          width: 125,
          height: 125, // 高度
          text: this.enterprisenumber, // 二维码内容
          // render: 'canvas' ,   // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
          background: '#f0f', // 背景色
          // foreground: '#ff0'    // 前景色
 
        })
 
        document.getElementById("qrcode4").innerHTML = ""
        let qrcode4 = new QRCode('qrcode4', {
          width: 75,
          height: 75, // 高度
          text: this.enterprisenumber, // 二维码内容
          // render: 'canvas' ,   // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
          background: '#f0f', // 背景色
          // foreground: '#ff0'    // 前景色
 
        })
      }
    },
    async getLicenseListData() {
      this.listLoading = true
      if (this.validTime1 != null && this.validTime1.length > 0) {
        this.params.starttime1 = this.validTime1[0]
        this.params.endtime1 = this.validTime1[1]
      } else {
        this.params.starttime1 = ''
        this.params.endtime1 = ''
 
      }
 
      if (this.validTime2 != null && this.validTime2.length > 0) {
        this.params.starttime2 = this.validTime2[0]
        this.params.endtime2 = this.validTime2[1]
      } else {
        this.params.starttime2 = ''
        this.params.endtime2 = ''
      }
 
      let res = await getLicenseList(this.params)
      if (res.code === "200") {
        this.recordTotal = res.result.totalCount
        this.pageSize = res.result.pageSize
        this.pageTotal = computePageCount(res.result.totalCount, res.result.pageSize)
        this.currentPage = res.result.current
        this.licenseList = res.result.result
      }
      this.listLoading = false
    },
    openLicenseForm(title, value) {
      this.$refs.addFormRef.showLicenseForm(title, value, this.isSupervision, this.roleType)
    },
    searchData() {
      this.params.pageIndex = 1
      this.getLicenseListData()
    },
    reset() {
      this.params = {
        pageIndex: 1,
        pageSize: 10,
        sort: '',
        order: "ASC",
        name: '',
        type: '',
        province: '',
        city: '',
        district: '',
        starttime1: '',
        endtime1: '',
        starttime2: '',
        endtime2: '',
        reviewstatus: '',
        validstatus: '',
        licensecode: '',
      }
      this.validTime1 = []
      this.validTime2 = []
      this.getLicenseListData()
    },
    handleSizeChange: function (val) {
      this.params.pageSize = val
      this.getLicenseListData()
    },
    handleCurrentChange: function (val) {
      this.params.pageIndex = val
      this.getLicenseListData()
    },
    commit(val) {
      this.$confirm('提交此条信息,是否继续', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        reviewLicenseInfo({
          id: val,
          reviewstatus: 1
        }).then(() => {
          this.getLicenseListData()
          this.$notify({
            title: '成功',
            message: '提交成功',
            type: 'success',
            duration: 2000,
          })
        }).catch(error => {
          ElMessage.warning(error)
        })
      })
    },
    //删除
    deleteById(val) {
      this.$confirm('删除此条信息,是否继续', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        deleteById(val).then(response => {
          const res = response.data;
 
          if (res.code === "200") {
            this.$message({
              message: '删除成功',
              type: 'success'
            });
            this.getLicenseListData()
          } else {
            ElMessage.warning(res.message)
          }
        }).catch(error => {
          ElMessage.warning(error)
        })
      })
    },
    sortChange() {
 
    },
    //获取地区
    async changeArea(value) {
      if (value === 'province') {
        this.params.city = ''
        this.params.district = ''
        this.areaListQuery = {
          type: 2,
          parenttype: 1,
          parentname: this.params.province,
        }
        let res = await getCityListData(this.areaListQuery)
        if (res.code === "200") {
          this.cityList = res.result
        }
      } else if (value === 'city') {
        this.params.district = ''
        this.areaListQuery = {
          type: 3,
          parenttype: 2,
          parentname: this.params.city,
        }
        let res = await getCityListData(this.areaListQuery)
        if (res.code === "200") {
          this.districtList = res.result
        }
      }
    }, //市、镇、街道、委员会
    async getProvince() {
      let res = await getProvinceListData()
      if (res.code === "200") {
        this.provinceList = res.result.provinceList
      }
    },
 
    async exportRetail() {
      let params = {
        ...this.params
      }
      params.type = 3
      params.reviewstatus = 2
      const res = await getExportLicense(params)
      if (res.code == '200') {
        if(res.result && res.result.length>0){
          let mainData = res.result
          const data = mainData.map((item,index)=>{
            return [
              item.licensecode,
              item.issuingunit,
              item.issuingcode,
              item.mainpersonname,
              '自然人',
              '身份证',
              item.mainpersonidcardnum,
              item.issuingdate,
              item.effectdate,
              item.noeffectdate,
              item.effectdate,
              item.address,
              item.issuingdate,
              item.code,
              item.reservekg,
              item.noeffectdate,
              item.licensecode,
              this.licensetypeList.filter(it => it.id === item
                  .licensetype).name,
              item.dealingRangeStr,
              item.dealingarea,
              item.mainpersonname,
              item.issuingunit,
              item.name,
              this.dealingtypeList.filter(it => it.id === item
                  .dealingtype).name
            ]
          })
          console.log(data,'data')
          // 定义表头
          const headers = [
            ['证照编号',
              '颁发单位',
              '颁发单位统一社会信用代码',
              '持有人姓名',
              '持有人类型',
              '持有人证件类型',
              '持有人证件号码',
              '颁证日期',
              '有效期(起始)',
              '有效期(截止)',
              '有效期起',
              '单位地址',
              '发证日期',
              '统一社会信用代码',
              '核定储量',
              '有效期至',
              '编号',
              '许可类型',
              '许可范围',
              '经营面积',
              '主要负责人',
              '发证机关',
              '单位名称',
              '经营方式']
          ]
          // 创建工作表
          const ws = XLSX.utils.aoa_to_sheet([
            ...headers,      // 表头
            ...data,         // 数据
          ])
          const dataRowCount = data.length;
          const totalRows = dataRowCount + 1; // 标题、固定行和数据行的总数
          // 设置列宽,计算每列的最大宽度
          const MIN_COL_WIDTH = 40;
          const colWidths = [];
          for (let c = 0; c < 24; c++) {
            let maxLength = 0;
            // 计算每列最大单元格内容长度
            for (let r = 0; r < totalRows; r++) {
              const cellRef = `${String.fromCharCode(65 + c)}${r + 1}`; // 获取每个单元格的引用
              const cell = ws[cellRef];
              if (cell && cell.v) {
                if(cell.v == '序号'){
                  maxLength = 1
                }else {
                  maxLength = Math.max(maxLength, cell.v.toString().length);
                }
 
              }
            }
            // 根据最大长度设置列宽,添加额外的空间
            colWidths[c] = { wpx: Math.max(maxLength * 15, MIN_COL_WIDTH) }; // 你可以根据需要调整乘数
          }
          // 设置工作表的列宽
          ws['!cols'] = colWidths;
          // 设置行高,统一调整上下间距
          const rowHeight = 24; // 设置每一行的行高(可以根据需要调整)
          for (let r = 0; r < totalRows; r++) {
            ws['!rows'] = ws['!rows'] || [];
            ws['!rows'][r] = { hpx: rowHeight };  // 设置行高,单位是像素
          }
          // 创建工作簿
          const wb = XLSX.utils.book_new();
          XLSX.utils.book_append_sheet(wb, ws, "Sheet1")
          // 使用 Blob 和 URL 触发文件下载
          const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' })
          const blob = new Blob([wbout], { type: 'application/octet-stream' })
          const url = URL.createObjectURL(blob)
          // 创建下载链接并触发下载
          const a = document.createElement('a')
          a.href = url;
          a.download = '烟花爆竹经营(零售)许可证台账.xlsx'  // 设置下载文件名
          document.body.appendChild(a)
          a.click();
          document.body.removeChild(a)
          // 释放 URL 对象
          URL.revokeObjectURL(url)
        }else{
          this.$message({
            type: 'warning',
            message: '无数据可导出'
          })
        }
      } else {
        ElMessage.warning(res.msg)
      }
    },
 
    async exportWholesale() {
      let params = {
        ...this.params
      }
      params.type = 2
      params.reviewstatus = 2
      const res = await getExportLicense(params)
      if (res.code == '200') {
        if(res.result && res.result.length>0){
          let mainData = res.result
          const data = mainData.map((item,index)=>{
            return [
              item.licensecode,
              item.issuingunit,
              item.issuingcode,
              item.mainpersonname,
              '自然人',
              '身份证',
              item.mainpersonidcardnum,
              item.issuingdate,
              item.effectdate,
              item.noeffectdate,
              item.dealingRangeStr,
              item.mainpersonname,
              [item.province, item.city, item.district].join(
                  "-"),
              eval(item.licenseStorage).reduce((sum, e) =>
                  sum + Number(e.area || 0), 0),
              item.address,
              item.issuingdate,
              item.licensecode,
              item.name,
              item.noeffectdate,
              item.reservekg,
              item.code,
              item.effectdate,
              eval(item.licenseStorage).reduce((sum, e) =>
                  sum + Number(e.storagearea || 0), 0),
              item.issuingunit
            ]
          })
          console.log(data,'data')
          // 定义表头
          const headers = [
            ['证照编号',
              '颁发单位',
              '颁发单位统一社会信用代码',
              '持有人姓名',
              '持有人类型', //自然人
              '持有人证件类型',
              '持有人证件号码',
              '颁证日期',
              '有效期(起始)',
              '有效期(截止)',
              '许可范围',
              '主要负责人',
              '仓储地址',
              '库区面积',
              '注册地址',
              '发证日期',
              '编号',
              '企业名称',
              '有效期至',
              '核定药量',
              '统一社会信用代码',
              '有效期起',
              '库房面积',
              '发证机关']
          ]
          // 创建工作表
          const ws = XLSX.utils.aoa_to_sheet([
            ...headers,      // 表头
            ...data,         // 数据
          ])
          const dataRowCount = data.length;
          const totalRows = dataRowCount + 1; // 标题、固定行和数据行的总数
          // 设置列宽,计算每列的最大宽度
          const MIN_COL_WIDTH = 40;
          const colWidths = [];
          for (let c = 0; c < 24; c++) {
            let maxLength = 0;
            // 计算每列最大单元格内容长度
            for (let r = 0; r < totalRows; r++) {
              const cellRef = `${String.fromCharCode(65 + c)}${r + 1}`; // 获取每个单元格的引用
              const cell = ws[cellRef];
              if (cell && cell.v) {
                if(cell.v == '序号'){
                  maxLength = 1
                }else {
                  maxLength = Math.max(maxLength, cell.v.toString().length);
                }
 
              }
            }
            // 根据最大长度设置列宽,添加额外的空间
            colWidths[c] = { wpx: Math.max(maxLength * 15, MIN_COL_WIDTH) }; // 你可以根据需要调整乘数
          }
          // 设置工作表的列宽
          ws['!cols'] = colWidths;
          // 设置行高,统一调整上下间距
          const rowHeight = 24; // 设置每一行的行高(可以根据需要调整)
          for (let r = 0; r < totalRows; r++) {
            ws['!rows'] = ws['!rows'] || [];
            ws['!rows'][r] = { hpx: rowHeight };  // 设置行高,单位是像素
          }
          // 创建工作簿
          const wb = XLSX.utils.book_new();
          XLSX.utils.book_append_sheet(wb, ws, "Sheet1")
          // 使用 Blob 和 URL 触发文件下载
          const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' })
          const blob = new Blob([wbout], { type: 'application/octet-stream' })
          const url = URL.createObjectURL(blob)
          // 创建下载链接并触发下载
          const a = document.createElement('a')
          a.href = url;
          a.download = '烟花爆竹经营(批发)许可证台账.xlsx'  // 设置下载文件名
          document.body.appendChild(a)
          a.click();
          document.body.removeChild(a)
          // 释放 URL 对象
          URL.revokeObjectURL(url)
        }else{
          this.$message({
            type: 'warning',
            message: '无数据可导出'
          })
        }
      } else {
        ElMessage.warning(res.msg)
      }
    },
 
    refuse(val) {
      this.refuseForm.id = val
      this.refuseVisible = true
    },
    submitRefuse() {
      refuseLicense(this.refuseForm).then((res) => {
        if (res.code === '200') {
          this.getLicenseListData()
          this.refuseVisible = false
          this.$notify({
            title: '成功',
            duration: 2000,
            message: '驳回成功',
            type: 'success'
          })
        } else {
          this.$message({
            type: 'warning',
            message: res.message
          })
        }
      })
    },
    openDelayLicenseDialog(value) {
      this.$refs['delay-form'].showLicenseForm('延期', value, this.isSupervision, this.roleType)
    },
    openModLicenseDialog(value) {
      this.$refs['mod-form'].showLicenseForm('变更', value, this.isSupervision, this.roleType)
    },
 
  }
}
</script>
 
<style scoped>
.basic_search {
  display: inline-block;
  margin-right: 32px;
  margin-bottom: 18px;
}
 
.carrier_search {
  display: inline-block;
}
 
.carrier_search_input {
  width: 200px;
}
</style>