info.vue 62.5 KB
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">

    <!-- 添加或修改处理场所管理对话框 -->
    <h3>
      基础信息
    </h3>
    <el-form ref="form" :model="form" :rules="rules" label-width="80px"  label-position="top">
      <el-row :gutter="30">
        <el-col :span="6">
          <el-form-item label="建筑垃圾处理场所名称" prop="name">
            <el-input v-model="form.name" placeholder="请输入建筑垃圾处理场所名称" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="证书编号" prop="certificateNumber">
            <el-input v-model="form.certificateNumber" placeholder="请输入证书编号" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="所在地址" prop="address" class="is-required">
            <el-input v-model="form.address" placeholder="请输入所在地址"  @focus="openMapDialog"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="6">
          <el-form-item label="所在区域" prop="localArea">
            <el-select v-model="form.localArea" placeholder="请选择所在区域" style="width: 100%">
              <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="建筑垃圾处理场所类型" prop="siteType">
            <el-select v-model="form.siteType" placeholder="请选择建筑垃圾处理场所类型" style="width: 100%">
              <el-option label="消纳(回填)场所" value="消纳(回填)场所" />
              <el-option label="建筑垃圾资源化处置场" value="建筑垃圾资源化处置场" />
              <el-option label="盾构土环保处置场" value="盾构土环保处置场" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="消纳(回填)场所工程性质" prop="engineeringProperty">
            <el-select v-model="form.engineeringProperty" placeholder="请选择消纳(回填)场所工程性质" style="width: 100%">
              <el-option label="消纳(回填)场" value="消纳(回填)场" />
              <el-option label="房建市政工程" value="房建市政工程" />
              <el-option label="交通工程" value="交通工程" />
              <el-option label="水利工程" value="水利工程" />
              <el-option label="国有土地整理" value="国有土地整理" />
              <el-option label="平场工程" value="平场工程" />
              <el-option label="生态修复" value="生态修复" />
              <el-option label="覆绿造景工程" value="覆绿造景工程" />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="6">
          <el-form-item label="作业区域" prop="operatingArea">
            <el-select v-model="form.operatingArea" placeholder="请选择作业区域" style="width: 100%">
              <el-option label="核心区域" value="核心区域" />
              <el-option label="中心区域" value="中心区域" />
              <el-option label="外环区域" value="外环区域" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="可受纳建筑垃圾类型" prop="trashType">
            <treeselect v-model="form.trashType" :multiple="true" :options="options" placeholder="请选择"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="建设(施工)单位名称" prop="constructionUnit">
            <el-input v-model="form.constructionUnit" placeholder="请输入建设(施工)单位名称" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="6">
          <el-form-item label="建设(施工)单位责任人" prop="constructionUnitPerson">
            <el-input v-model="form.constructionUnitPerson" placeholder="请输入建设(施工)单位责任人" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="责任人联系电话" prop="constructionUnitPersonPhone">
            <el-input v-model="form.constructionUnitPersonPhone" placeholder="请输入责任人联系电话" :maxlength="11" show-word-limit/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
        </el-col>
      </el-row>

      <el-row :gutter="30">
        <el-col :span="6">
          <el-form-item label="有限期开始时间" prop="validityBeginDate">
            <el-date-picker clearable size="small" style="width: 100%"
                            v-model="form.validityBeginDate"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择有限期开始时间">
            </el-date-picker>
          </el-form-item>

        </el-col>
        <el-col :span="6">
          <el-form-item label="有限期结束时间" prop="validityEndDate">
            <el-date-picker clearable size="small" style="width: 100%"
                            v-model="form.validityEndDate"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择有限期结束时间">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="审批方量(m³)" prop="squareMeasure">
            <el-input v-model="form.squareMeasure" placeholder="请输入审批方量(m³)" />
          </el-form-item>
        </el-col>
      </el-row>
      <!--        <el-form-item label="剩余方量" prop="surplusSquareMeasure">-->
      <!--          <el-input v-model="form.surplusSquareMeasure" placeholder="请输入剩余方量" />-->
      <!--        </el-form-item>-->
      <el-row :gutter="30">
        <el-col :span="6">
          <el-form-item label="洗车作业设施" prop="carWashingFacilities">
            <el-select v-model="form.carWashingFacilities" placeholder="请选择洗车作业设施" style="width: 100%">
              <el-option label="钢架洗车平台" value="钢架洗车平台" />
              <el-option label="钢架洗车平台、过水槽" value="钢架洗车平台、过水槽" />
              <el-option label="全自动洗车平台、过水槽" value="全自动洗车平台、过水槽" />
              <el-option label="特殊事项" value="特殊事项" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="出口道路状况" prop="exitRoadCondition">
            <el-select v-model="form.exitRoadCondition" placeholder="请选择出口道路状况" style="width: 100%">
              <el-option label="硬化" value="硬化" />
              <el-option label="未硬化" value="未硬化" />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="6">
          <el-form-item label="照明设施" prop="lightingFacility">
            <el-select v-model="form.lightingFacility" placeholder="请选择照明设施" style="width: 100%">
              <el-option label="有" value="有" />
              <el-option label="无" value="无" />
              <el-option label="不适用" value="不适用" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="视频监控设施" prop="videoSurveillanceFacility">
            <el-select v-model="form.videoSurveillanceFacility" placeholder="请选择视频监控设施" style="width: 100%">
              <el-option label="有" value="有" />
              <el-option label="无" value="无" />
              <el-option label="不适用" value="不适用" />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="6">
          <el-form-item label="填表人" prop="preparer">
            <el-input v-model="form.preparer" placeholder="请输入填表人" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="办理意见" prop="handlingAdvice">
            <el-input v-model="form.handlingAdvice" placeholder="请输入内容" />
          </el-form-item>
        </el-col>
      </el-row>




      <!--        <el-form-item label="消纳来源" prop="absorbSource">-->
      <!--          <el-input v-model="form.absorbSource" placeholder="请输入消纳来源" />-->
      <!--        </el-form-item>-->
      <el-form-item label="电子围栏" prop="electronicFence">
        <template v-slot:label>
          <el-tooltip class="item" placement="right" style="float:left;">
            <div slot="content">
              请保证经度在前,维度在后,中间用,隔开。多个坐标点之间用“;”隔开,示例:118.121,110.112;118.111,110.112
            </div>
            <div class="tips">
              <span class="tipsSpan">
                电子围栏
              </span>
              <i class="el-icon-question"></i>
            </div>
          </el-tooltip>
          <el-button @click="draw" type="text" style="float: left;margin-left: 10px">绘制围栏</el-button>
        </template>

        <el-input v-model="form.electronicFence" type="textarea" placeholder="请输入内容" style="width: 49%"/>
      </el-form-item>
      <!--        <el-form-item label="信用状态">-->
      <!--          <el-radio-group v-model="form.creditStatus">-->
      <!--            <el-radio label="1">请选择字典生成</el-radio>-->
      <!--          </el-radio-group>-->
      <!--        </el-form-item>-->
      <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
        <el-col :span="3">
          <div class="upload_lable">
            批准文件
            <el-upload
              ref="upload"
              action=""
              accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
              :on-change="fileChange"
              :auto-upload="false"
              :show-file-list="false"
              multiple
              :file-list="approvalDocument">

              <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
            </el-upload>
          </div>
        </el-col>
        <el-col :span="21">
          <div class="upload_btn">
            <div v-for="(item,index) in approvalDocument">
              <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
                <div class="upload_close" @click="approvalDocument.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <el-image
                  style="width: 110px; height: 95px; margin: 5px;float:left;"
                  :src="createUrl(item)"
                  :preview-src-list="[createUrl(item)]"
                  :z-index="999">
                </el-image>
              </div>
              <div  v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
                <div class="upload_close_file" @click="approvalDocument.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
                <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
        <el-col :span="3">
          <div class="upload_lable">
            审批资料
            <el-upload
              ref="upload"
              action=""
              accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
              :on-change="fileChange1"
              :auto-upload="false"
              :show-file-list="false"
              multiple
              :file-list="approvalData">
              <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
            </el-upload>
          </div>
        </el-col>
        <el-col :span="21">
          <div class="upload_btn">
            <div v-for="(item,index) in approvalData">
              <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
                <div class="upload_close" @click="approvalData.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <el-image
                  style="width: 110px; height: 95px; margin: 5px;float:left;"
                  :src="createUrl(item)"
                  :preview-src-list="[createUrl(item)]"
                  :z-index="999">
                </el-image>
              </div>
              <div  v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
                <div class="upload_close_file" @click="approvalData.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
                <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
        <el-col :span="3">
          <div class="upload_lable">
            现场照片
            <el-upload
              ref="upload"
              action=""
              accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
              :on-change="fileChange2"
              :auto-upload="false"
              :show-file-list="false"
              multiple
              :file-list="scenePhoto">
              <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
            </el-upload>
          </div>
        </el-col>
        <el-col :span="21">
          <div class="upload_btn">
            <div v-for="(item,index) in scenePhoto">
              <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
                <div class="upload_close" @click="scenePhoto.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <el-image
                  style="width: 110px; height: 95px; margin: 5px;float:left;"
                  :src="createUrl(item)"
                  :preview-src-list="[createUrl(item)]"
                  :z-index="999">
                </el-image>
              </div>
              <div  v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
                <div class="upload_close_file" @click="scenePhoto.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
                <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
        <el-col :span="3">
          <div class="upload_lable">
            洗车设施照片
            <el-upload
              ref="upload"
              action=""
              accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
              :on-change="fileChange3"
              :auto-upload="false"
              :show-file-list="false"
              multiple
              :file-list="carWashingFacilitiesImage">
              <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
            </el-upload>
          </div>
        </el-col>
        <el-col :span="21">
          <div class="upload_btn">
            <div v-for="(item,index) in carWashingFacilitiesImage">
              <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
                <div class="upload_close" @click="carWashingFacilitiesImage.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <el-image
                  style="width: 110px; height: 95px; margin: 5px;float:left;"
                  :src="createUrl(item)"
                  :preview-src-list="[createUrl(item)]"
                  :z-index="999">
                </el-image>
              </div>
              <div  v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
                <div class="upload_close_file" @click="carWashingFacilitiesImage.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
                <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
        <el-col :span="3">
          <div class="upload_lable">
            安全评估报告
            <el-upload
              ref="upload"
              action=""
              accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
              :on-change="fileChange4"
              :auto-upload="false"
              :show-file-list="false"
              multiple
              :file-list="safetyAssessmentReport">
              <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
            </el-upload>
          </div>
        </el-col>
        <el-col :span="21">
          <div class="upload_btn">
            <div v-for="(item,index) in safetyAssessmentReport">
              <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
                <div class="upload_close" @click="safetyAssessmentReport.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <el-image
                  style="width: 110px; height: 95px; margin: 5px;float:left;"
                  :src="createUrl(item)"
                  :preview-src-list="[createUrl(item)]"
                  :z-index="999">
                </el-image>
              </div>
              <div  v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
                <div class="upload_close_file" @click="safetyAssessmentReport.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
                <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
        <el-col :span="3">
          <div class="upload_lable">
            环评报告及环保部门批复
            <el-upload
              ref="upload"
              action=""
              accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
              :on-change="fileChange5"
              :auto-upload="false"
              :show-file-list="false"
              multiple
              :file-list="environmentalApproval">
              <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
            </el-upload>
          </div>
        </el-col>
        <el-col :span="21">
          <div class="upload_btn">
            <div v-for="(item,index) in environmentalApproval">
              <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
                <div class="upload_close" @click="environmentalApproval.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <el-image
                  style="width: 110px; height: 95px; margin: 5px;float:left;"
                  :src="createUrl(item)"
                  :preview-src-list="[createUrl(item)]"
                  :z-index="999">
                </el-image>
              </div>
              <div  v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
                <div class="upload_close_file" @click="environmentalApproval.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
                <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
        <el-col :span="3">
          <div class="upload_lable">
            签署消纳合同授权委托书
            <el-upload
              ref="upload"
              action=""
              accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
              :on-change="fileChange6"
              :auto-upload="false"
              :show-file-list="false"
              multiple
              :file-list="authorization">
              <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
            </el-upload>
          </div>
        </el-col>
        <el-col :span="21">
          <div class="upload_btn">
            <div v-for="(item,index) in authorization">
              <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
                <div class="upload_close" @click="authorization.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <el-image
                  style="width: 110px; height: 95px; margin: 5px;float:left;"
                  :src="createUrl(item)"
                  :preview-src-list="[createUrl(item)]"
                  :z-index="999">
                </el-image>
              </div>
              <div  v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
                <div class="upload_close_file" @click="authorization.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
                <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
        <el-col :span="3">
          <div class="upload_lable">
            其他资料
            <el-upload
              ref="upload"
              action=""
              accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
              :on-change="fileChange7"
              :auto-upload="false"
              :show-file-list="false"
              multiple
              :file-list="otherInformation">
              <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
            </el-upload>
          </div>
        </el-col>
        <el-col :span="21">
          <div class="upload_btn">
            <div v-for="(item,index) in otherInformation">
              <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
                <div class="upload_close" @click="otherInformation.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <el-image
                  style="width: 110px; height: 95px; margin: 5px;float:left;"
                  :src="createUrl(item)"
                  :preview-src-list="[createUrl(item)]"
                  :z-index="999">
                </el-image>
              </div>
              <div  v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
                <div class="upload_close_file" @click="otherInformation.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
                <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
                <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <!--        <el-form-item label="" prop="environmentalApproval">-->
      <!--          <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
      <!--        </el-form-item>-->
      <!--        <el-form-item label="" prop="authorization">-->
      <!--          <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
      <!--        </el-form-item>-->
      <!--        <el-form-item label="" prop="otherInformation">-->
      <!--          <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
      <!--        </el-form-item>-->
      <!--        <el-form-item label="运输企业" prop="companyIds">-->
      <!--          <el-input v-model="form.companyIds" placeholder="请输入运输企业" />-->
      <!--        </el-form-item>-->
      <!--        <el-form-item label="审批状态,0=审批中,1=审批通过,2=被驳回">-->
      <!--          <el-radio-group v-model="form.status">-->
      <!--            <el-radio label="1">请选择字典生成</el-radio>-->
      <!--          </el-radio-group>-->
      <!--        </el-form-item>-->
      <!--        <el-form-item label="二维码" prop="qrCode">-->
      <!--          <el-input v-model="form.qrCode" placeholder="请输入二维码" />-->
      <!--        </el-form-item>-->
    </el-form>
    <div slot="footer" class="dialog-footer" style="margin-top: 20px">
      <el-button type="primary" @click="submitForm">确 定</el-button>
      <el-button @click="cancel">取 消</el-button>
    </div>
    <el-dialog title="高德地图" :visible.sync="openMap" width="1600px" height="750px" append-to-body>
      <div class="serach_map">
        搜索:
        <el-select
          v-model="keywords"
          filterable
          remote
          placeholder="请输入关键词"
          :remote-method="remoteMethod"
          :loading="loading"
          :clearable="true"
          size="mini"
          @change="currentSelect"
          style="width: 250px"
        >
          <el-option
            v-for="item in mapOptions"
            :key="item.id"
            :label="item.name"
            :value="item"
            class="one-text"
          >
            <span style="float: left">{{ item.name }}</span>
            <span style="float: right; color: #8492a6; font-size: 13px">{{
                item.district
              }}</span>
          </el-option>
        </el-select>
      </div>
      <div v-loading="loading" id="zcContainer" class="am-map" style="width:100%;height: 700px;"></div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="clearPolyEditor">清 空</el-button>
        <el-button @click="closeMap">取 消</el-button>
        <el-button type="primary" @click="openMap = false">确 定</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { listDisposalSite, getDisposalSite, delDisposalSite, addDisposalSite, updateDisposalSite, exportDisposalSite } from "@/api/unit/disposalSite";
import Treeselect from "@riophae/vue-treeselect";
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import {getAreaList} from "@/api/casefile/remoteServer";
import AMapLoader from '@amap/amap-jsapi-loader';

// 设置安全密钥
window._AMapSecurityConfig = {
  securityJsCode: 'aa1db7d8f534f3da3f6d8a6a71382802',
}
export default {
  name: "DisposalSite",
  components: {Treeselect,AMapLoader},
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 处理场所管理表格数据
      disposalSiteList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        name: [
          { required: true, message: "请输入处置场所名称", trigger: "blur" },
        ],
        localArea: [
          { required: true, message: "请选择所属区域", trigger: "blur" },
        ],
        siteType: [
          { required: true, message: "请选择处置场所类型", trigger: "blur" },
        ],
        operatingArea: [
          { required: true, message: "请选择锁业区域", trigger: "blur" },
        ],
        trashType: [
          { required: true, message: "请选择可受纳建筑垃圾类型", trigger: "blur" },
        ],
        constructionUnit: [
          { required: true, message: "请输入建设(施工)单位", trigger: "blur" },
        ],
        constructionUnitPerson: [
          { required: true, message: "请输入建设(施工)单位责任人", trigger: "blur" },
        ],
        constructionUnitPersonPhone: [
          { required: true, message: "请输入责任人联系电话", trigger: "blur" },
          {
            pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
            message: '手机号格式错误',
            trigger: 'change'
          }
        ],
        validityBeginDate: [
          { required: true, message: "请选择有限期开始时间", trigger: "blur" },
        ],
        validityEndDate: [
          { required: true, message: "请选择有限期结束时间", trigger: "blur" },
        ],
        electronicFence: [
          { required: true, message: "请输入电子围栏", trigger: "blur" },
        ],
        squareMeasure: [
          { required: true, message: "请输入审批方量", trigger: "blur" },
        ],
        carWashingFacilities: [
          { required: true, message: "请选择洗车作业设施", trigger: "blur" },
        ],
        exitRoadCondition: [
          { required: true, message: "请选择出口道路状况", trigger: "blur" },
        ],
        lightingFacility: [
          { required: true, message: "请选择照明设施", trigger: "blur" },
        ],
        videoSurveillanceFacility: [
          { required: true, message: "请选择视频监控设施", trigger: "blur" },
        ],
        preparer: [
          { required: true, message: "请输入填表人", trigger: "blur" },
        ],
        handlingAdvice: [
          { required: true, message: "请输入办理意见", trigger: "blur" },
        ],

      },
      areas:[],
      options:[{id:1,label:"工程渣土"},{id:2,label:"工程淤泥"},{id:3,label:"盾构渣土"},{id:4,label:"拆除垃圾"},{id:5,label:"其他建筑垃圾"}],
      approvalDocument:[],
      approvalDocumentSlide:[],
      approvalData:[],
      approvalDataSlide:[],
      scenePhoto:[],
      scenePhotoSlide:[],
      carWashingFacilitiesImage:[],
      carWashingFacilitiesImageSlide:[],
      safetyAssessmentReport:[],
      safetyAssessmentReportSlide:[],
      environmentalApproval:[],
      environmentalApprovalSlide:[],
      authorization:[],
      authorizationSlide:[],
      otherInformation:[],
      otherInformationSlide:[],
      openMap:false,
      // 地图
      map: null,
      // 编辑工具
      polyEditor: null,
      // 电子围栏数据集
      polygonArr: [],
      // 当前电子围栏
      nowPolygon: null,
      keywords: "",
      mapOptions: [],
      AutoComplete: null,
      searchMarker: null,
    };
  },
  created() {
    getAreaList().then(res => {
      this.areas = res.data;
    });
    this.initData();
  },
  watch: {
    '$route.query.disposalSiteId': 'initData'
  },
  methods: {
    openMapDialog(){
      this.openMap = true;
      this.initAMap("address");
      this.keywords = this.form.address;

    },
    reset(){
      this.form = {};
      this.approvalDocument = [];
      this.approvalData = [];
      this.scenePhoto = [];
      this.carWashingFacilitiesImage = [];
      this.safetyAssessmentReport = [];
      this.environmentalApproval = [];
      this.authorization = [];
      this.otherInformation = [];
    },
    initData(){
      this.reset();
      let id = this.$route.query.disposalSiteId;
      if(id!=null){
        getDisposalSite(id).then(response => {
          this.form = response.data;
          //将字符串转换为int数组
          let trashTypeArr = this.form.trashType.split(",").map(str => parseInt(str, 10));
          this.form.trashType = trashTypeArr;
          //将附件转换为前端可视化数组
          if(this.form.approvalDocument!=null&&this.form.approvalDocument!==""){
            let approvalDocument = this.form.approvalDocument.split(";");
            approvalDocument.map(item=>{
              let name = item.substring(item.lastIndexOf("/")+1);
              this.approvalDocument.push({name:name,url:item})
            })
          }
          if(this.form.approvalData!=null&&this.form.approvalData!==""){
            let approvalData = this.form.approvalData.split(";");
            approvalData.map(item=>{
              let name = item.substring(item.lastIndexOf("/")+1);
              this.approvalData.push({name:name,url:item})
            })
          }
          if(this.form.scenePhoto!=null&&this.form.scenePhoto!==""){
            let scenePhoto = this.form.scenePhoto.split(";");
            scenePhoto.map(item=>{
              let name = item.substring(item.lastIndexOf("/")+1);
              this.scenePhoto.push({name:name,url:item})
            })
          }
          if(this.form.carWashingFacilitiesImage!=null&&this.form.carWashingFacilitiesImage!==""){
            let carWashingFacilitiesImage = this.form.carWashingFacilitiesImage.split(";");
            carWashingFacilitiesImage.map(item=>{
              let name = item.substring(item.lastIndexOf("/")+1);
              this.carWashingFacilitiesImage.push({name:name,url:item})
            })
          }
          if(this.form.safetyAssessmentReport!=null&&this.form.safetyAssessmentReport!==""){
            let safetyAssessmentReport = this.form.safetyAssessmentReport.split(";");
            safetyAssessmentReport.map(item=>{
              let name = item.substring(item.lastIndexOf("/")+1);
              this.safetyAssessmentReport.push({name:name,url:item})
            })
          }
          if(this.form.environmentalApproval!=null&&this.form.environmentalApproval!==""){
            let environmentalApproval = this.form.environmentalApproval.split(";");
            environmentalApproval.map(item=>{
              let name = item.substring(item.lastIndexOf("/")+1);
              this.environmentalApproval.push({name:name,url:item})
            })
          }
          if(this.form.authorization!=null&&this.form.authorization!==""){
            let authorization = this.form.authorization.split(";");
            authorization.map(item=>{
              let name = item.substring(item.lastIndexOf("/")+1);
              this.authorization.push({name:name,url:item})
            })
          }
          if(this.form.otherInformation!=null&&this.form.otherInformation!==""){
            let otherInformation = this.form.otherInformation.split(";");
            otherInformation.map(item=>{
              let name = item.substring(item.lastIndexOf("/")+1);
              this.otherInformation.push({name:name,url:item})
            })
          }
        });
      }
    },
    closeMap(){
      this.openMap = false;
      this.form.electronicFence = null;
      //清空地图图层
      this.map.remove(this.nowPolygon);
    },
    // 选中提示
    currentSelect(val) {
      // 清空时不执行后面代码
      if (!val) {
        return ;
      }

      //清除marker
      if (this.searchMarker){
        this.map.remove(this.searchMarker)
      }
      //设置marker
      this.searchMarker = new AMap.Marker({
        map: this.map,
        position: [val.location.lng, val.location.lat],
      });

      this.keywords = val.name
      //定位
      this.map.setCenter([val.location.lng, val.location.lat])
      // 自动适应显示想显示的范围区域
      this.map.setFitView();
      this.form.addressGps = val.location.lng+","+val.location.lat;
      this.form.address = val.district + val.name;
    },
    // 搜索地址
    remoteMethod(query) {
      if (query !== "") {
        this.loading = true;
        setTimeout(() => {
          this.loading = false;
          this.AutoComplete.search(query, (status, result) => {
            this.mapOptions = result.tips;
          });
        }, 200);
      } else {
        this.mapOptions = [];
      }
    },
    initAMap(type) {
      const _this = this
      // 加载高德地图
      AMapLoader.load({
        key: _this.$aMapKey,  //设置高德地图申请的key
        version: "2.0",  // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
        plugins: ['AMap.ToolBar', 'AMap.PolygonEditor','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Marker'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
        AMapUI: {
          version: "1.1",
          plugins: []
        },
        Loca: {
          version: "2.0"
        },
      }).then(async (AMap) => {
        _this.map = await new AMap.Map("zcContainer", { //设置地图容器id
          viewMode: "2D",  // 默认使用 2D 模式
          center: [113.01814545605467, 28.201039299894283], // 初始化地图中心点位置
          zoom: 11, //初始化地图层级
          resizeEnable: true,
          willreadoften: true
        });

        _this.AutoComplete = await new AMap.AutoComplete({city:'长沙'});

        // 图层样式切换控件(卫星图)
        AMapUI.loadUI(['control/BasicControl'], function(BasicControl) {

          //图层切换控件
          _this.map.addControl(new BasicControl.LayerSwitcher({
            position: 'rb' // 右下角
          }));

        });
        if(type==="draw"){
          _this.polyEditor = new AMap.PolygonEditor(_this.map);
          if(_this.form.electronicFence!=null){
            // 电子围栏经纬度
            let path = _this.form.electronicFence.split(";");
            path.map(item=>{
              let arr = item.split(",");
              //将电子围栏经纬度转换为double类型数组
              _this.polygonArr.push([parseFloat(arr[0]),parseFloat(arr[1])]);
            });
            _this.nowPolygon = new AMap.Polygon({
              path: _this.polygonArr
            })
            _this.map.add([_this.nowPolygon]);
            _this.map.setFitView();
            _this.polyEditor.addAdsorbPolygons([_this.nowPolygon]);
            _this.nowPolygon.on('dblclick', () => {
              _this.polyEditor.setTarget(_this.nowPolygon);
              _this.polyEditor.open();
            })
          }
          _this.polyEditor.on('add', function (data) {
            _this.nowPolygon = data.target;
            _this.polyEditor.addAdsorbPolygons(_this.nowPolygon);
            _this.nowPolygon.on('dblclick', () => {
              _this.polyEditor.setTarget(_this.nowPolygon);
              _this.polyEditor.open();
            })

            // 加个右击监听 双击图层进行编辑
            _this.map.on("rightclick",function (e){
              if (_this.polyEditor) {
                const arr = _this.nowPolygon.getPath()
                let pathArr = []
                // 将获取的停车场坐标点转换格式后存入数组
                for (let item of arr) {
                  const list = [item.lng, item.lat]
                  pathArr.push(list)
                }

                var maxDistance = 0; // 最大距离
                var maxPointIndex = []; // 记录最大距离对应的点索引

                // 计算所有点对之间的距离
                for (var i = 0; i < pathArr.length; i++) {
                  for (var j = i + 1; j < pathArr.length; j++) {
                    var distance = AMap.GeometryUtil.distance(pathArr[i], pathArr[j]);
                    if (distance > maxDistance) {
                      maxDistance = distance;
                      maxPointIndex = [i, j];
                    }
                  }
                }

                if(_this.nowPolygon!=null){
                  // 通过最大距离的点索引获取对应的点坐标
                  let mybounds  = new AMap.Bounds(pathArr[maxPointIndex[0]],pathArr[maxPointIndex[1]]);
                  // 设置地图显示范围
                  _this.map.setBounds(mybounds);
                }
                //将经纬度存到form中
                _this.form.electronicFence = pathArr.join(";");
                _this.polyEditor.close();
              }
            });
          })

          if(_this.nowPolygon===null){
            _this.polyEditor.close();
            _this.polyEditor.setTarget();
            _this.polyEditor.open();
          }
        }

        if(type==="address" && _this.form.addressGps.indexOf(",")>=0){
          let lng = _this.form.addressGps.split(",")[0];
          let lat = _this.form.addressGps.split(",")[1];
          //清除marker
          if (_this.searchMarker){
            _this.map.remove(_this.searchMarker)
          }
          //设置marker
          _this.searchMarker = new AMap.Marker({
            map: this.map,
            position: [lng, lat],
          });
          //定位
          _this.map.setCenter([lng, lat])
          // 自动适应显示想显示的范围区域
          _this.map.setFitView();
        }

      }).catch(e => {
        console.log(e);
      });
      this.loading = false;
      // this.openMap = false;
    },
    clearPolyEditor(){
      this.form.electronicFence = null;
      this.map.remove(this.nowPolygon);
      // 关闭一下编辑器,防止出bug
      this.polyEditor.close();
      // 置空编辑区即为新增
      this.polyEditor.setTarget();
      // 打开编辑器即可开始绘制
      this.polyEditor.open();
    },
    draw(){
      // if(this.polyEditor!=null){
      //   if(this.form.electronicFence==null){
      //     // 关闭一下编辑器,防止出bug
      //     this.polyEditor.close();
      //     // 置空编辑区即为新增
      //     this.polyEditor.setTarget();
      //     // 打开编辑器即可开始绘制
      //     this.polyEditor.open();
      //   }
      // }else{

      // }
      this.openMap = true;
      this.initAMap("draw");
      this.$alert('左键单击地图添加点,左键双击编辑,右键双击地图结束绘制', '温馨提示', {
        confirmButtonText: '确定',
        callback: action => {
          if(this.form.electronicFence!=null){
            let path = this.form.electronicFence.split(";");
            path.map(item=>{
              let arr = item.split(",");
              this.polygonArr.push([arr[0],arr[1]]);
            });
          }

        }
      });
    },
    createUrl(file){
      if(file.raw!=null){
        return URL.createObjectURL(file.raw);
      }else{
        return process.env.VUE_APP_BASE_API + file.url;
      }

    },
    tempDownload(row){
      let name = row.name;
      let url = "";
      if(row.raw!=null){
        url = URL.createObjectURL(row.raw);
      }else{
        url = process.env.VUE_APP_BASE_API + row.url;
      }
      console.log(url)
      const a = document.createElement('a')
      a.setAttribute('download', name)
      a.setAttribute('target', '_blank')
      a.setAttribute('href', url);
      a.click()
    },
    // 取消按钮
    cancel() {
      this.$tab.closePage({path:"/disposalSite/info"}).then(() => {
        this.$tab.openPage("处理场所管理", "/tool/disposalSite",{disposalSiteRefresh:1})
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          let formData = new FormData();
          let form = this.form;
          //去掉params属性
          delete form.params;
          // formData.append('approvalDocument', null);
          // formData.append('approvalData', null);
          // formData.append('scenePhoto', null);
          // formData.append('carWashingFacilitiesImage', null);
          // formData.append('authorization', null);
          // formData.append('safetyAssessmentReport', null);
          // formData.append('environmentalApproval', null);
          // formData.append('otherInformation', null);
          //将新增的文件放入formData

          //先清空原有的附件
          form.approvalDocument = null;
          form.approvalData = null;
          form.scenePhoto = null;
          form.carWashingFacilitiesImage = null;
          form.authorization = null;
          form.safetyAssessmentReport = null;
          form.environmentalApproval = null;
          form.otherInformation = null;
          form.trashType = this.form.trashType.join(",");

          this.approvalDocument.forEach(item => {
            if (item.raw != null) {
              formData.append('approvalDocumentFiles', item.raw)
            }else{
              //将原有的附件拼接到form中
              form.approvalDocument = form.approvalDocument!==null?form.approvalDocument+";"+item.url:item.url;
            }
          })

          this.approvalData.forEach(item => {
            if (item.raw != null) {
              formData.append('approvalDataFiles', item.raw)
            }else{
              //将原有的附件拼接到form中
              form.approvalData = form.approvalData!==null?form.approvalData+";"+item.url:item.url;
            }
          })
          this.scenePhoto.forEach(item => {
            if (item.raw != null) {
              formData.append('scenePhotoFiles', item.raw)
            }else{
              //将原有的附件拼接到form中
              form.scenePhoto = form.scenePhoto!==null?form.scenePhoto+";"+item.url:item.url;
            }
          })
          this.carWashingFacilitiesImage.forEach(item => {
            if (item.raw != null) {
              formData.append('carWashingFacilitiesImageFiles', item.raw)
            }else{
              //将原有的附件拼接到form中
              form.carWashingFacilitiesImage = form.carWashingFacilitiesImage!==null?form.carWashingFacilitiesImage+";"+item.url:item.url;
            }
          })
          this.safetyAssessmentReport.forEach(item => {
            if (item.raw != null) {
              formData.append('safetyAssessmentReportFiles', item.raw)
            }else{
              //将原有的附件拼接到form中
              form.safetyAssessmentReport = form.safetyAssessmentReport!==null?form.safetyAssessmentReport+";"+item.url:item.url;
            }
          })
          this.environmentalApproval.forEach(item => {
            if (item.raw != null) {
              formData.append('environmentalApprovalFiles', item.raw)
            }else{
              //将原有的附件拼接到form中
              form.environmentalApproval = form.environmentalApproval!==null?form.environmentalApproval+";"+item.url:item.url;
            }
          })
          this.authorization.forEach(item => {
            if (item.raw != null) {
              formData.append('authorizationFiles', item.raw)
            }else{
              //将原有的附件拼接到form中
              form.authorization = form.authorization!==null?form.authorization+";"+item.url:item.url;
            }
          })
          this.otherInformation.forEach(item => {
            if (item.raw != null) {
              formData.append('otherInformationFiles', item.raw)
            }else{
              //将原有的附件拼接到form中
              form.otherInformation = form.otherInformation!==null?form.otherInformation+";"+item.url:item.url;
            }
          })
          for (let key in form) {
            formData.append(key, form[key] == null ? "" : form[key])
          }
          if (this.form.id != null) {
            updateDisposalSite(formData).then(response => {
              this.msgSuccess("修改成功");
              this.$tab.closePage({path:"/disposalSite/infoEdit"}).then(() => {
                this.$tab.openPage("处理场所管理", "/tool/disposalSite",{disposalSiteRefresh:1})
              })
            });
          } else {
            addDisposalSite(formData).then(response => {
              this.msgSuccess("新增成功");
              this.$tab.closePage({path:"/disposalSite/info"}).then(() => {
                this.$tab.openPage("处理场所管理", "/tool/disposalSite",{disposalSiteRefresh:1})
              })
            });
          }
        }
      });
    },
    /**
     * 文件改变时,限制文件上传格式和大小
     * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
     * 大小不超过20M
     * */
    fileChange(file, fileList) {
      let count = 0;
      for (let i = 0; i < fileList.length; i++) {
        // console.log(fileList.length)
        // console.log(this.fileEntityList[i].name+"111"+file.name)
        if (fileList[i].name == file.name) {
          count++;
          if (count == 2) {
            this.$message({
              message: '已存在此文件!',
              type: 'warning'
            });
            for (let j = fileList.length; j > 0; j--) {
              //如果存在此文件,去除新选择的重复文件
              if (fileList[j - 1].name == file.name) {
                fileList.splice(j - 1, 1);
                i--;
                return false;
              }
            }
          }
        }
      }
      let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
      //格式符合后判断大小
      if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
        let max5M = file.size / 1024 / 1024 < 100;
        if (!max5M) {
          this.$message({
            message: '上传文件大小不得超过100M!',
            type: 'warning'
          });
          fileList = fileList.splice(fileList.length - 1, 1);
        } else {
          //符合条件后进行添加
          this.approvalDocument = fileList
        }
      } else {
        this.$message({
          message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
          type: 'warning'
        });
        fileList = fileList.splice(fileList.length - 1, 1);
      }
    },
    fileChange1(file, fileList) {
      let count = 0;
      for (let i = 0; i < fileList.length; i++) {
        // console.log(fileList.length)
        // console.log(this.fileEntityList[i].name+"111"+file.name)
        if (fileList[i].name == file.name) {
          count++;
          if (count == 2) {
            this.$message({
              message: '已存在此文件!',
              type: 'warning'
            });
            for (let j = fileList.length; j > 0; j--) {
              //如果存在此文件,去除新选择的重复文件
              if (fileList[j - 1].name == file.name) {
                fileList.splice(j - 1, 1);
                i--;
                return false;
              }
            }
          }
        }
      }
      let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
      //格式符合后判断大小
      if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
        let max5M = file.size / 1024 / 1024 < 100;
        if (!max5M) {
          this.$message({
            message: '上传文件大小不得超过100M!',
            type: 'warning'
          });
          fileList = fileList.splice(fileList.length - 1, 1);
        } else {
          //符合条件后进行添加
          this.approvalData = fileList
        }
      } else {
        this.$message({
          message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
          type: 'warning'
        });
        fileList = fileList.splice(fileList.length - 1, 1);
      }
    },
    fileChange2(file, fileList) {
      let count = 0;
      for (let i = 0; i < fileList.length; i++) {
        // console.log(fileList.length)
        // console.log(this.fileEntityList[i].name+"111"+file.name)
        if (fileList[i].name == file.name) {
          count++;
          if (count == 2) {
            this.$message({
              message: '已存在此文件!',
              type: 'warning'
            });
            for (let j = fileList.length; j > 0; j--) {
              //如果存在此文件,去除新选择的重复文件
              if (fileList[j - 1].name == file.name) {
                fileList.splice(j - 1, 1);
                i--;
                return false;
              }
            }
          }
        }
      }
      let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
      //格式符合后判断大小
      if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
        let max5M = file.size / 1024 / 1024 < 100;
        if (!max5M) {
          this.$message({
            message: '上传文件大小不得超过100M!',
            type: 'warning'
          });
          fileList = fileList.splice(fileList.length - 1, 1);
        } else {
          //符合条件后进行添加
          this.scenePhoto = fileList
        }
      } else {
        this.$message({
          message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
          type: 'warning'
        });
        fileList = fileList.splice(fileList.length - 1, 1);
      }
    },
    fileChange3(file, fileList) {
      let count = 0;
      for (let i = 0; i < fileList.length; i++) {
        // console.log(fileList.length)
        // console.log(this.fileEntityList[i].name+"111"+file.name)
        if (fileList[i].name == file.name) {
          count++;
          if (count == 2) {
            this.$message({
              message: '已存在此文件!',
              type: 'warning'
            });
            for (let j = fileList.length; j > 0; j--) {
              //如果存在此文件,去除新选择的重复文件
              if (fileList[j - 1].name == file.name) {
                fileList.splice(j - 1, 1);
                i--;
                return false;
              }
            }
          }
        }
      }
      let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
      //格式符合后判断大小
      if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
        let max5M = file.size / 1024 / 1024 < 100;
        if (!max5M) {
          this.$message({
            message: '上传文件大小不得超过100M!',
            type: 'warning'
          });
          fileList = fileList.splice(fileList.length - 1, 1);
        } else {
          //符合条件后进行添加
          this.carWashingFacilitiesImage = fileList
        }
      } else {
        this.$message({
          message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
          type: 'warning'
        });
        fileList = fileList.splice(fileList.length - 1, 1);
      }
    },
    fileChange4(file, fileList) {
      let count = 0;
      for (let i = 0; i < fileList.length; i++) {
        // console.log(fileList.length)
        // console.log(this.fileEntityList[i].name+"111"+file.name)
        if (fileList[i].name == file.name) {
          count++;
          if (count == 2) {
            this.$message({
              message: '已存在此文件!',
              type: 'warning'
            });
            for (let j = fileList.length; j > 0; j--) {
              //如果存在此文件,去除新选择的重复文件
              if (fileList[j - 1].name == file.name) {
                fileList.splice(j - 1, 1);
                i--;
                return false;
              }
            }
          }
        }
      }
      let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
      //格式符合后判断大小
      if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
        let max5M = file.size / 1024 / 1024 < 100;
        if (!max5M) {
          this.$message({
            message: '上传文件大小不得超过100M!',
            type: 'warning'
          });
          fileList = fileList.splice(fileList.length - 1, 1);
        } else {
          //符合条件后进行添加
          this.safetyAssessmentReport = fileList
        }
      } else {
        this.$message({
          message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
          type: 'warning'
        });
        fileList = fileList.splice(fileList.length - 1, 1);
      }
    },
    fileChange5(file, fileList) {
      let count = 0;
      for (let i = 0; i < fileList.length; i++) {
        // console.log(fileList.length)
        // console.log(this.fileEntityList[i].name+"111"+file.name)
        if (fileList[i].name == file.name) {
          count++;
          if (count == 2) {
            this.$message({
              message: '已存在此文件!',
              type: 'warning'
            });
            for (let j = fileList.length; j > 0; j--) {
              //如果存在此文件,去除新选择的重复文件
              if (fileList[j - 1].name == file.name) {
                fileList.splice(j - 1, 1);
                i--;
                return false;
              }
            }
          }
        }
      }
      let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
      //格式符合后判断大小
      if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
        let max5M = file.size / 1024 / 1024 < 100;
        if (!max5M) {
          this.$message({
            message: '上传文件大小不得超过100M!',
            type: 'warning'
          });
          fileList = fileList.splice(fileList.length - 1, 1);
        } else {
          //符合条件后进行添加
          this.environmentalApproval = fileList
        }
      } else {
        this.$message({
          message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
          type: 'warning'
        });
        fileList = fileList.splice(fileList.length - 1, 1);
      }
    },
    fileChange6(file, fileList) {
      let count = 0;
      for (let i = 0; i < fileList.length; i++) {
        // console.log(fileList.length)
        // console.log(this.fileEntityList[i].name+"111"+file.name)
        if (fileList[i].name == file.name) {
          count++;
          if (count == 2) {
            this.$message({
              message: '已存在此文件!',
              type: 'warning'
            });
            for (let j = fileList.length; j > 0; j--) {
              //如果存在此文件,去除新选择的重复文件
              if (fileList[j - 1].name == file.name) {
                fileList.splice(j - 1, 1);
                i--;
                return false;
              }
            }
          }
        }
      }
      let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
      //格式符合后判断大小
      if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
        let max5M = file.size / 1024 / 1024 < 100;
        if (!max5M) {
          this.$message({
            message: '上传文件大小不得超过100M!',
            type: 'warning'
          });
          fileList = fileList.splice(fileList.length - 1, 1);
        } else {
          //符合条件后进行添加
          this.authorization = fileList
        }
      } else {
        this.$message({
          message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
          type: 'warning'
        });
        fileList = fileList.splice(fileList.length - 1, 1);
      }
    },
    fileChange7(file, fileList) {
      let count = 0;
      for (let i = 0; i < fileList.length; i++) {
        // console.log(fileList.length)
        // console.log(this.fileEntityList[i].name+"111"+file.name)
        if (fileList[i].name == file.name) {
          count++;
          if (count == 2) {
            this.$message({
              message: '已存在此文件!',
              type: 'warning'
            });
            for (let j = fileList.length; j > 0; j--) {
              //如果存在此文件,去除新选择的重复文件
              if (fileList[j - 1].name == file.name) {
                fileList.splice(j - 1, 1);
                i--;
                return false;
              }
            }
          }
        }
      }
      let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
      //格式符合后判断大小
      if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
        let max5M = file.size / 1024 / 1024 < 100;
        if (!max5M) {
          this.$message({
            message: '上传文件大小不得超过100M!',
            type: 'warning'
          });
          fileList = fileList.splice(fileList.length - 1, 1);
        } else {
          //符合条件后进行添加
          this.otherInformation = fileList
        }
      } else {
        this.$message({
          message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
          type: 'warning'
        });
        fileList = fileList.splice(fileList.length - 1, 1);
      }
    },
  }
};
</script>
<style  lang="scss"  scoped>
.upload_lable{
  border-right: 1px solid #dcdfe6;
  padding: 27px 30px;
  background: #fafafa;
  text-align: center;
}
.upload_btn{
  max-height: 106px;
}
.upload_close{
  position: absolute;
  left: 105px;
  z-index:99;
  top:-1px;
  font-size:18px;
  color:red;
}
.upload_close_file{
  position: absolute;
  left: 80px;
  z-index:99;
  top:-1px;
  font-size:18px;
  color:red;
}
.upload_div_image{
  display: inline-block;
  width: 110px;
  height: 95px;
  position: relative;
  float: left;
  margin-left: 5px;
}
.upload_div_file{
  display: inline-block;
  width: 110px;
  height: 95px;
  text-align: center;
  float:left;
  margin: 5px;
  position: relative;
}
.serach_map{
  position: absolute;
  top: 100px;
  left: 25px;
  z-index: 999;
  background: #fff;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0,0,0,.2);
}
</style>