orgManifest.vue 52.9 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
<template>
    <div class="app-container">
        <div class="filter-container">
            <el-input v-model="listQuery.awba" clearable style="width: 200px;" class="filter-item" placeholder="运单号"/>
            <el-input v-model="listQuery.flightno" clearable style="width: 200px;" class="filter-item" placeholder="航班号"/>
            <el-date-picker v-model="listQuery.flightdate" clearable type="date" style="width: 200px;" placeholder="航班日期"
                            value-format="yyyy-MM-dd" class="filter-item"></el-date-picker>

            <el-select v-model="listQuery.customcode" clearable style="width: 200px;" class="filter-item" placeholder="请选择关区代码">
                <el-option v-for="item in manifestCustoms" :key="item" :label="item" :value="item"></el-option>
            </el-select>
            <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleSearch">{{
                $t('table.search') }}
            </el-button>
            <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit"
                       @click="handleCreate">{{ $t('table.add') }}
            </el-button>
            <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-message"
                       @click="handleDelList">批量发送
            </el-button>
        </div>
        <tree-table :data="orgData" :eval-func="func" :expand-all="expandAll" stripe
                    style="font-size: 12px" border @selection-change="handleSelectionChange">
            <el-table-column label="主单号" width="130px" align="center">
                <template slot-scope="scope">
                    <span>{{ scope.row.awba }}</span>
                </template>
            </el-table-column>
            <el-table-column label="分单号" width="120px" align="center">
                <template slot-scope="scope">
                    <span>{{ scope.row.awbh }}</span>
                </template>
            </el-table-column>
            <el-table-column label="航班号" width="90px" align="center">
                <template slot-scope="scope">
                    <span>{{ scope.row.flightno }}</span>
                </template>
            </el-table-column>
            <el-table-column label="航班日期" width="120px" align="center">
                <template slot-scope="scope">
                    <span>{{ scope.row.flightdate }}</span>
                </template>
            </el-table-column>
            <el-table-column label="起始站" width="70px" align="center">
                <template slot-scope="scope">
                    <span>{{ scope.row.originstation }}</span>
                </template>
            </el-table-column>
            <el-table-column label="目的站" width="70px" align="center">
                <template slot-scope="scope">
                    <span>{{ scope.row.destinationstation }}</span>
                </template>
            </el-table-column>
            <el-table-column label="件数" width="70px" align="center">
                <template slot-scope="scope">
                    <span>{{ scope.row.piece }}</span>
                </template>
            </el-table-column>
            <el-table-column label="重量" width="70px" align="center">
                <template slot-scope="scope">
                    <span>{{ scope.row.weight }}</span>
                </template>
            </el-table-column>
            <!--<el-table-column :label="$t('table.status')" width="90px" sortable>-->
            <!--<template slot-scope="scope">-->
            <!--<el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>-->
            <!--</template>-->
            <!--</el-table-column>-->
            <el-table-column label="回执内容"  align="center">
                <template slot-scope="scope">
                    <span>{{ scope.row.customText }}</span>
                    <!--<div>-->
                    <!--<el-progress :percentage="scope.row.customComplate" :status="scope.row.status | statusFilter"/>-->
                    <!--</div>-->
                </template>
            </el-table-column>
            <el-table-column :label="$t('table.actions')" width="500px" align="center">
                <template slot-scope="scope">
                    <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
                    <el-button size="mini" type="success" @click="handleSend(scope.row)">发送</el-button>
                    <el-button size="mini" @click="handleFeedBack(scope.row)">客服反馈</el-button>
                    <el-button size="mini" type="danger" @click="handleDel(scope.$index,scope.row)">删除</el-button>
                    <el-button size="mini" type="warning" @click="handleSwitch(scope.row)">更改状态</el-button>
                    <el-button size="mini" type="primary" v-if="scope.row.awbh ===null" @click="handleAddAwbh(scope.row)">新增分单</el-button>
                    <!--<el-button size="mini" type="primary" @click="handleRedirct(scope.row)">跳转测试</el-button>-->
                </template>
            </el-table-column>
        </tree-table>
        <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
                    @pagination="getList"/>

        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
            <el-form ref="formData" :inline="true" :rules="rules" :model="temp" label-width="110px"
                     style="font-size: 13px" class="el-dialog-div">
                <div class="tags">
                    <el-tag type="info" effect="plain">
                        航班信息
                    </el-tag>
                </div>
                <div class="row-bg">
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="航班号" prop="flightno">
                                <el-input :disabled="dialogStatus !== 'create'" v-model="flightno"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="航班日期" prop="flightdate">
                                <el-date-picker :disabled="dialogStatus !== 'create'" :picker-options="pickerOptions"
                                                value-format="yyyy-MM-dd"
                                                v-model="temp.flightdate" align="right"
                                                type="date" placeholder="请输入航班日期" style="width: 87%"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="起始站" prop="originstation">
                                <el-input :disabled="dialogStatus !== 'create'" v-model="originstation"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="目的站" prop="destinationstation">
                                <el-input :disabled="dialogStatus !== 'create'" v-model="destinationstation"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="是否分批" prop="splitcode">
                                <el-select v-model="temp.splitcode" class="filter-item" placeholder="请选择是否分批"
                                           style="width: 93%">
                                    <el-option v-for="item in splitcodes" :key="item.value" :label="item.value"
                                               :value="item.value">
                                        <span>{{item.label}}</span>
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>

                <div class="tags">
                    <el-tag type="info" effect="plain">
                        航程信息
                    </el-tag>
                </div>
                <div class="row-bg">
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="起始航站" prop="awbinfo.sairportid">
                                <el-input v-model="sairportid"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="目的地" prop="destinationstation">
                                <el-input v-model="destinationstation"/>
                            </el-form-item>
                        </el-col>

                    </el-row>
                    <el-row>
                        <el-row>
                            <el-col :span="10">
                                <el-form-item label="承运人" prop="carrier">
                                    <el-input v-model="carrier"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="10">
                                <el-form-item label="到达航站" prop="awbinfo.eairportid">
                                    <el-input v-model="eairportid"/>
                                </el-form-item>
                            </el-col>

                        </el-row>
                        <el-col :span="10">
                            <el-form-item label="承运人1" >
                                <el-input v-model="by1"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="到达航站1">
                                <el-input v-model="dest1"></el-input>
                            </el-form-item>
                        </el-col>

                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="承运人2">
                                <el-input v-model="by2"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="到达航站2">
                                <el-input v-model="dest2"/>
                            </el-form-item>
                        </el-col>

                    </el-row>

                </div>
                <div class="tags">
                    <el-tag type="info" effect="plain">
                        运单信息
                    </el-tag>
                </div>
                <div class="row-bg">
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="主单号" prop="awba">
                                <el-input :disabled="dialogStatus !== 'create'" v-model="awba"/>
                            </el-form-item>
                        </el-col>

                        <el-col :span="10">
                            <el-form-item label="分单号">
                                <el-input :disabled="dialogStatus !== 'addAwh'" v-model="awbh"/>
                            </el-form-item>
                        </el-col>
                    </el-row>

                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="舱单件数" prop="piece">
                                <el-input v-model.number="temp.piece"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="舱单重量" prop="weight">
                                <el-input v-model.number="temp.weight"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="关区代码" prop="customcode">
                                <el-select v-model="temp.customcode" class="filter-item" placeholder="请选择关区代码"
                                           style="width: 93%">
                                    <el-option v-for="item in manifestCustoms" :key="item" :label="item"
                                               :value="item"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="海关状态" prop="ex5">
                                <el-select v-model="temp.ex5" class="filter-item" placeholder="请录入货物类型"
                                           style="width: 93%">
                                    <el-option v-for="item in customTypes" :key="item" :label="item" :value="item"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="付费方式" prop="awbinfo.collected">
                                <el-select v-model="temp.awbinfo.collected" class="filter-item" placeholder="付费方式"
                                           style="width: 93%">
                                    <el-option
                                            v-for="item in payTypes"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="特货代码">
                                <el-input v-model="specopeid"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="货物描述" prop="goodsname">
                                <el-input v-model="goodsname"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
                <div class="tags">
                    <el-tag type="info" effect="plain">
                        发货人信息
                    </el-tag>
                </div>
                <div class="row-bg">
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="发货人名称" prop="awbinfo.shprname">
                                <el-input v-model="shprname"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="地址" prop="awbinfo.shpraddress">
                                <el-input v-model="shpraddress"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="电话" prop="awbinfo.shprtel">
                                <el-input v-model="temp.awbinfo.shprtel"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="传真">
                                <el-input v-model="temp.awbinfo.shprmobiletype"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="国家代码" prop="awbinfo.shprcountyr">
                                <el-select
                                        :remote-method="remoteMethod"
                                        :loading="loading"
                                        v-model="shprcountyr"
                                        filterable
                                        remote
                                        placeholder="请选择" style="width: 93%;">
                                    <el-option
                                            v-for="item in countryOption"
                                            :key="item.value"
                                            :label="item.value"
                                            :value="item.value">
                                        <span style="float: left">{{ item.label }}</span>
                                        <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <!--<el-col :span="14">-->
                            <!--<el-col :span="16">-->
                                <!--<el-form-item label="企业代码类型" prop="awbinfo.shpcomidpre">-->
                                    <!--<el-select-->
                                            <!--v-model="shpcomidpre"-->
                                            <!--filterable-->
                                            <!--placeholder="请选择企业代码类型">-->
                                        <!--<el-option-->
                                                <!--v-for="item in shpCompnyTypeOption"-->
                                                <!--:key="item.value"-->
                                                <!--:label="item.label"-->
                                                <!--:value="item.value"/>-->
                                    <!--</el-select>-->
                                <!--</el-form-item>-->
                            <!--</el-col>-->
                            <!--<el-col :span="7">-->
                                <!--<el-form-item prop="awbinfo.shpcomidpno">-->
                                    <!--<el-input v-model="shpcomidpno" placeholder="企业代码"/>-->
                                <!--</el-form-item>-->
                            <!--</el-col>-->
                        <!--</el-col>-->
                    </el-row>
                </div>
                <div class="tags">
                    <el-tag type="info" effect="plain">
                        收货人信息
                    </el-tag>
                </div>

                <div class="row-bg">
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="收货人名称" prop="awbinfo.cnsnname">
                                <el-input v-model="cnsnname"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="地址" prop="awbinfo.cnsnaddress">
                                <el-input v-model="cnsnaddress"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="电话" prop="awbinfo.cnsntel">
                                <el-input v-model="temp.awbinfo.cnsntel"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="传真">
                                <el-input v-model="temp.awbinfo.cnsrmobiletype"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="国家代码" prop="awbinfo.cnscountyr">
                                <el-select
                                        :remote-method="remoteMethod"
                                        :loading="loading"
                                        v-model="cnscountyr"
                                        filterable
                                        remote
                                        placeholder="请选择" style="width: 93%;">
                                    <el-option
                                            v-for="item in countryOption"
                                            :key="item.value"
                                            :label="item.value"
                                            :value="item.value">
                                        <span style="float: left">{{ item.label }}</span>
                                        <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <!--<el-col :span="14">
                            <el-col :span="16">
                            <el-form-item label="企业代码类型" prop="awbinfo.csgcustomerid">
                                <el-select
                                        v-model="cnscomidpre"
                                        filterable
                                        placeholder="请选择企业代码类型">
                                    <el-option
                                            v-for="item in shpCompnyTypeOption"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                            <el-col :span="7">
                                <el-form-item prop="awbinfo.cnscomidno">
                                    <el-input v-model="cnscomidno" placeholder="企业代码"/>
                                </el-form-item>
                            </el-col>
                        </el-col>-->
                    </el-row>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="具体收货人名称" prop="awbinfo.cnsrctcname">
                                <el-input v-model="cnsrctcname"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="具体收货人电话" prop="awbinfo.cnsrctctel">
                                <el-input v-model="temp.awbinfo.cnsrctctel"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
            </el-form>

            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">{{ $t('table.cancel') }}</el-button>
                <el-button type="primary" @click="dialogStatus==='update'?createData():updateData()">{{
                    $t('table.confirm') }}
                </el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    import treeTable from '@/components/TreeTable'
    import treeToArray from '@/utils/customEval'
    import Pagination from '@/components/Pagination'
    import waves from '@/directive/waves' // Waves directive
    import country from '@/utils/country.js'

    import dangerGoods from '@/utils/dangerGoods.js'
    import goodsPackage from '@/utils/goodsPackage.js'
    import {getCountry, getByCountryCode, getByCountryCodeForName} from "@/api/country";

    import {addMt1201, updateMT1201, updateStatus, deleteByIsDelete, getMt1201ListForParam} from '@/api/orgManifest'
    import {Message} from "element-ui";

    import {validAwb, validFlightNo} from '@/utils/validate'
    import util from '@/common/js/util'

    export default {
        name: 'OrgManifest',
        components: {treeTable, Pagination},
        directives: {waves},
        filters: {
            statusFilter(status) {
                const statusMap = {
                    10003: '',
                    41301: 'success',
                    10002: 'info',
                    10000: 'danger',
                    45103: 'warning',
                    wrong: 'exception'
                }
                return statusMap[status]
            },
            typeFilter(type) {
                return calendarTypeKeyValue[type]
            }
        },
        data() {
            const validatorAwb = (rule, value, callback) =>{
                if(!validAwb(value)){
                    callback("请正确书写主单号")
                }
                callback()
            }
            const validatorFlightno = (rule, value, callback) =>{
                if(!validFlightNo(value)){
                    callback("请正确书写航班号")
                }
                callback()
            }
            return {
                func: treeToArray,
                expandAll:true,
                total: 0,
                loading: false,
                listLoading: false,
                downloadLoading: false,
                multipleSelection: [],
                dialogFormVisible: false,
                dialogStatus: '',
                countryOption: [],
                shpCompnyTypeOption: [],
                textMap: {
                    update: '编辑',
                    create: '添加',
                    addAwbh:'新增分单'
                },
                listQuery: {
                    pageSize: 1,
                    limitSize: 20,
                    awba: undefined,
                    flightno: undefined,
                    flightdate: undefined,
                    customcode: undefined
                },
                //实体对象声明最好使用undefined,后台不会更改数据库默认值
                temp: {
                    awba: undefined,
                    awbh: undefined,
                    customcode: undefined,
                    flightno: undefined,
                    carrier: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    piece: undefined,
                    weight: undefined,
                    goodsname: undefined,
                    splitcode: undefined,
                    uldType: undefined,
                    uldNo: undefined,
                    status: undefined,
                    ex5:undefined,
                    awbinfo: {
                        specopeid: undefined,
                        shprname: undefined,
                        shprmobiletype: undefined,
                        shprtel: undefined,
                        shpraddress: undefined,
                        shprcountyr: undefined,
                        shpcomidpre: undefined,
                        shpcomidpno: undefined,
                        shpcustomerid: undefined,
                        cnsnname: undefined,
                        cnsrmobiletype: undefined,
                        cnsntel: undefined,
                        cnsnaddress: undefined,
                        cnscountyr: undefined,
                        cnscomidpre: undefined,
                        cnscomidno: undefined,
                        cnsrctcname: undefined,
                        cnsrctctel: undefined,
                        cargonm: undefined,
                        sairportid: undefined,
                        dest1city: undefined,
                        by1: undefined,
                        dest1: undefined,
                        by2: undefined,
                        dest2: undefined,
                        by3: undefined,
                        dest3: undefined,
                        eairportid: undefined,
                        csgcustomerid: undefined,
                        collected: '0'
                    }
                },
                manifestCustoms: ['4604', '4620', '4613'],
                customTypes: ['普通货物', '国际转运货物', '国内转关', '空箱', '快件'],
                payTypes: [{label: '预付', value: '0'}, {label: '到付', value: '1'}],
                splitcodes:[{label: '是', value: 'T'}, {label: '否', value: 'P'}],
                orgData: [],
                countryList: [],
                countryResultList: [],
                shpCompnyList: [],
                pickerOptions: {
                    shortcuts: [
                        {
                            text: '今天',
                            onClick(picker) {
                                picker.$emit('pick', new Date())
                            }
                        },
                        {
                            text: '昨天',
                            onClick(picker) {
                                const date = new Date()
                                date.setTime(date.getTime() - 3600 * 1000 * 24)
                                picker.$emit('pick', date)
                            }
                        },
                        {
                            text: '明天',
                            onClick(picker) {
                                const date = new Date()
                                date.setTime(date.getTime() + 3600 * 1000 * 24)
                                picker.$emit('pick', date)
                            }
                        },
                        {
                            text: '一周前',
                            onClick(picker) {
                                const date = new Date()
                                date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
                                picker.$emit('pick', date)
                            }
                        }
                    ]
                },
                args: [null, null, 'timeLine'],
                selectCountry: {
                    countryNameCn: undefined,
                    countryCode: undefined
                },
                rules: {
                    weight: [{type: 'number', required: true, message: '重量必须为数字', trigger: 'change'}],
                    piece: [{type: 'number', required: true, message: '件数必须为数字', trigger: 'change'}],
                    destinationstation: [{required: true, message: '运单目的地必须输入', trigger: 'change'}],
                    originstation: [{required: true, message: '运单起始站必须数据', trigger: 'change'}],
                    flightdate: [{required: true, message: '航班日期必须输入', trigger: 'change'}],
                    flightno: [{required: true, trigger: 'blur', validator: validatorFlightno}],
                    carrier: [{required: true, trigger: 'blur', message: '承运人不能为空'}],
                    customcode: [{required: true, message: '关区代码必须选择', trigger: 'change'}],
                    awba: [{required: true,  trigger:'blur', validator: validatorAwb}],
                    'awbinfo.collected': [{required: true, message: '付款方式必选', trigger: 'change'}],
                    goodsname: [{required: true, message: '货物描述不能为空', trigger: 'change'}],
                    ex5: [{required: true, message: '货物描述不能为空', trigger: 'change'}],
                    'awbinfo.shprname': [{required: true, message: '发货人不能为空', trigger: 'change'}],
                    'awbinfo.shprtel': [{required: true, message: '发货电话不能为空', trigger: 'change'}],
                    'awbinfo.shpraddress': [{required: true, message: '发货地址不能为空', trigger: 'change'}],
                    'awbinfo.shprcountyr': [{required: true, message: '国家代码不能为空', trigger: 'change'}],
                    'awbinfo.shpcomidpre': [{required: true, message: '企业代码类型不能为空', trigger: 'change'}],
                    'awbinfo.shpcomidpno': [{required: true, message: '企业代码不能为空', trigger: 'change'}],
                    'awbinfo.cnsnname': [{required: true, message: '收货人不能为空', trigger: 'change'}],
                    'awbinfo.cnsntel': [{required: true, message: '收货电话不能为空', trigger: 'change'}],
                    'awbinfo.cnsnaddress': [{required: true, message: '收获地址不能为空', trigger: 'change'}],
                    'awbinfo.cnscountyr': [{required: true, message: '国家代码不能为空', trigger: 'change'}],
                    'awbinfo.cnscomidpre': [{required: true, message: '企业代码类型不能为空', trigger: 'change'}],
                    'awbinfo.cnscomidno': [{required: true, message: '企业代码不能为空', trigger: 'change'}],

                }
            }
        },
        created() {
            this.getList()
            this.getCountryList()
        },
        mounted() {
            // 延迟加载,否则会出错
            setTimeout(() => {
                this.countryResultList = this.countryList.map(item => {
                    return {value: item.countryCode, label: item.countryNameCn}
                })
            }, 1000)
        },
        computed: {
            awba: {
                get: function () {
                    return this.temp.awba
                },
                set: function (val) {
                    if(val.length==3){
                        val = val+"-"
                    }
                    this.temp.awba = val.trim()
                }
            },
            awbh: {
                get: function () {
                    return this.temp.awbh
                },
                set: function (val) {
                    this.temp.awbh = val.toUpperCase().trim()
                }
            },
            flightno: {
                get: function () {
                    return this.temp.flightno
                },
                set: function (val) {
                    this.temp.flightno = val.toUpperCase().trim()
                }
            },
            carrier:{
                get: function () {
                    return this.temp.carrier
                },
                set: function (val) {
                    this.temp.carrier = val.toUpperCase().trim()
                }
            },
            originstation: {
                get: function () {
                    return this.temp.originstation
                },
                set: function (val) {
                    this.temp.originstation = val.toUpperCase().trim()
                }
            },
            destinationstation: {
                get: function () {
                    return this.temp.destinationstation
                },
                set: function (val) {
                    this.temp.destinationstation = val.toUpperCase().trim()
                }
            },

            goodsname: {
                get: function () {
                    return this.temp.goodsname
                },
                set: function (val) {
                    this.temp.goodsname = val.toUpperCase().trim()
                }
            },
            specopeid: {
                get: function () {
                    return this.temp.awbinfo.specopeid
                },
                set: function (val) {
                    this.temp.awbinfo.specopeid = val.toUpperCase().trim()
                }
            },
            shprname: {
                get: function () {
                    return this.temp.awbinfo.shprname
                },
                set: function (val) {
                    this.temp.awbinfo.shprname = val.toUpperCase().trim()
                }
            },
            shpraddress: {
                get: function () {
                    return this.temp.awbinfo.shpraddress
                },
                set: function (val) {
                    this.temp.awbinfo.shpraddress = val.toUpperCase().trim()
                }
            },
            shprcountyr: {
                get: function () {
                    return this.temp.awbinfo.shprcountyr
                },
                set: function (val) {
                    this.temp.awbinfo.shprcountyr = val.toUpperCase().trim()
                }
            },
            shpcomidpre: {
                get: function () {
                    return this.temp.awbinfo.shpcomidpre
                },
                set: function (val) {
                    this.temp.awbinfo.shpcomidpre = val.toUpperCase().trim()
                }
            },
            shpcomidpno: {
                get: function () {
                    return this.temp.awbinfo.shpcomidpno
                },
                set: function (val) {
                    this.temp.awbinfo.shpcomidpno = val.toUpperCase().trim()
                }
            },
            cnsnname: {
                get: function () {
                    return this.temp.awbinfo.cnsnname
                },
                set: function (val) {
                    this.temp.awbinfo.cnsnname = val.toUpperCase().trim()
                }
            },
            cnsnaddress: {
                get: function () {
                    return this.temp.awbinfo.cnsnaddress
                },
                set: function (val) {
                    this.temp.awbinfo.cnsnaddress = val.toUpperCase().trim()
                }
            },
            cnscountyr: {
                get: function () {
                    return this.temp.awbinfo.cnscountyr
                },
                set: function (val) {
                    this.temp.awbinfo.cnscountyr = val.toUpperCase().trim()
                }
            },
            cnscomidno: {
                get: function () {
                    return this.temp.awbinfo.cnscomidno
                },
                set: function (val) {
                    this.temp.awbinfo.cnscomidno = val.toUpperCase().trim()
                }
            },
            cnsrctcname: {
                get: function () {
                    return this.temp.awbinfo.cnsrctcname
                },
                set: function (val) {
                    this.temp.awbinfo.cnsrctcname = val.toUpperCase().trim()
                }
            },
            sairportid: {
                get: function () {
                    return this.temp.awbinfo.sairportid
                },
                set: function (val) {
                    this.temp.awbinfo.sairportid = val.toUpperCase().trim()
                }
            },
            by1: {
                get: function () {
                    return util.checkNull(this.temp.awbinfo.by1)?'':this.temp.awbinfo.by1
                },
                set: function (val) {
                    this.temp.awbinfo.by1 = val.toUpperCase().trim()
                }
            },
            dest1: {
                get: function () {
                    return this.temp.awbinfo.dest1
                },
                set: function (val) {
                    this.temp.awbinfo.dest1 = val.toUpperCase().trim()
                }
            },
            by2: {
                get: function () {
                    return this.temp.awbinfo.by2
                },
                set: function (val) {
                    this.temp.awbinfo.by2 = val.toUpperCase().trim()
                }
            },
            dest2: {
                get: function () {
                    return this.temp.awbinfo.dest2
                },
                set: function (val) {
                    this.temp.awbinfo.dest2 = val.toUpperCase().trim()
                }
            },
            by3: {
                get: function () {
                    return this.temp.awbinfo.by3
                },
                set: function (val) {
                    this.temp.awbinfo.by3 = val.toUpperCase().trim()
                }
            },
            dest3: {
                get: function () {
                    return this.temp.awbinfo.dest3
                },
                set: function (val) {
                    this.temp.awbinfo.dest3 = val.toUpperCase().trim()
                }
            },
            eairportid: {
                get: function () {
                    return this.temp.awbinfo.eairportid
                },
                set: function (val) {
                    this.temp.awbinfo.eairportid = val.toUpperCase().trim()
                }
            },
            cnscomidpre: {
                get: function () {
                    return this.temp.awbinfo.cnscomidpre
                },
                set: function (val) {
                    this.temp.awbinfo.cnscomidpre = val.toUpperCase().trim()
                }
            }
        },
        watch: {
            'temp.awbinfo.cnscountyr': function (newValue, oldValue) {
                if (newValue != null && newValue != '') {
                    this.selectCountry.countryCode = newValue
                    getByCountryCode(this.selectCountry).then(res => {
                        this.temp.awbinfo.cnscomidpre = res.data.dataList[0].enterpriseCode
                    })
                }
            },
            'temp.awbinfo.shprcountyr': function (newValue, oldValue) {
                if (newValue != null && newValue != '') {
                    this.selectCountry.countryCode = newValue
                    getByCountryCode(this.selectCountry).then(res => {
                        this.temp.awbinfo.shpcomidpre = res.data.dataList[0].enterpriseCode
                    })
                }
            }
        },
        methods: {
            //  >>>>>>>>>>>>>>>>页面加载运行<<<<<<<<<<<<<<<<<<
            //获取MT1201列表
            getList() {
                getMt1201ListForParam(this.listQuery).then(res => {
                    this.total = res.data.count
                    this.orgData = res.data.dataList
                    setTimeout(() => {
                        this.listLoading = false
                    }, 1.5 * 1000)
                })
            },
            //获取城市列表
            getCountryList() {
                getCountry().then(res => {
                    this.countryList = res.data.dataList
                })
            },
            // >>>>>>>>>>>>>>>>页面加载运行<<<<<<<<<<<<<<<<<<


            message(row) {
                this.$message.info(row.event)
            },


            sortChange(data) {
                const {prop, order} = data
                if (prop === 'id') {
                    this.sortByID(order)
                }
            },
            sortByID(order) {
                if (order === 'ascending') {
                    this.listQuery.sort = '+id'
                } else {
                    this.listQuery.sort = '-id'
                }
                this.handleSearch()
            },
            handleDownload() {

            },

            // >>>>>>>>>>>>>>>>批量删除<<<<<<<<<<<<<<<<<<
            handleSelectionChange(val) {
                this.multipleSelection = val
            },
            handleDelList() {
                const val = this.multipleSelection
                if (val) {
                    val.forEach((val, index) => {

                    })
                }
            },

            // >>>>>>>>>>>>>>>>搜索<<<<<<<<<<<<<<<<<<
            handleSearch() {
                this.getList()
            },

            // >>>>>>>>>>>>>>>>更新数据<<<<<<<<<<<<<<<<<<
            handleUpdate(row) {
                this.temp = Object.assign({}, row) // copy obj
                this.dialogStatus = 'update'
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.formData.clearValidate()
                })
            },
            updateData() {
                this.$refs.formData.validate(valid => {
                    if (valid) {
                        updateMT1201(this.temp).then(res => {
                            if (res.data.count > 0) {
                                this.dialogFormVisible = false
                                this.getList()
                                Message.success(res.data.respMessage)
                            } else {
                                Message.success("数据异常清稍后重试")
                            }
                        })
                    }
                })
            },

            //  >>>>>>>>>>>>>>>>客服反馈<<<<<<<<<<<<<<<<<<
            handleFeedBack(row) {
                this.$message({
                    message: '操作成功,请前往微信查看',
                    type: 'success'
                })
            },

            // >>>>>>>>>>>>>>>>重置实体<<<<<<<<<<<<<<<<<<
            resetTemp() {
                this.temp = {
                    awba: undefined,
                    awbh: undefined,
                    customcode: undefined,
                    customcode: undefined,
                    carrier: undefined,
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    piece: undefined,
                    weight: undefined,
                    goodsname: undefined,
                    splitcode: undefined,
                    awbinfo: {
                        specopeid: undefined,
                        shprname: undefined,
                        shprmobiletype: undefined,
                        shprtel: undefined,
                        shpraddress: undefined,
                        shprcountyr: undefined,
                        shpcomidpre: undefined,
                        shpcomidpno: undefined,
                        cnsnname: undefined,
                        cnsrmobiletype: undefined,
                        cnsntel: undefined,
                        cnsnaddress: undefined,
                        cnscountyr: undefined,
                        cnscomidpre: undefined,
                        cnscomidno: undefined,
                        cnsrctcname: undefined,
                        cnsrctctel: undefined,
                        cargonm: undefined,
                        sairportid: undefined,
                        dest1city: undefined,
                        by1: undefined,
                        dest1: undefined,
                        by2: undefined,
                        dest2: undefined,
                        by3: undefined,
                        dest3: undefined,
                        eairportid: undefined,
                        csgcustomerid: undefined,
                        collected: '0'
                    }
                }
            },

            //  >>>>>>>>>>>>>>>>新增数据<<<<<<<<<<<<<<<<<<
            handleCreate() {
                this.resetTemp()
                this.dialogStatus = 'create'
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.formData.clearValidate()
                })
            },
            createData() {
                this.$refs.formData.validate(valid => {
                    if (valid) {
                        addMt1201(this.temp).then(res => {
                            if (res.data.count > 0) {
                                this.dialogFormVisible = false
                                this.getList()
                                Message.success(res.data.respMessage)
                            } else {
                                Message.success("数据异常清稍后重试")
                            }
                        })

                    }
                })
            },

            // >>>>>>>>>>>>>>>>下拉远程搜索<<<<<<<<<<<<<<<<<<
            remoteMethod(query) {
                if (query !== '') {
                    this.loading = true
                    setTimeout(() => {
                        this.loading = false
                        this.countryOption = this.countryResultList.filter(item => {
                            return item.value.toUpperCase().trim()
                                .indexOf(query.toUpperCase()) > -1
                        })
                    }, 200)
                    if (query.length > 1) {
                        this.selectCountry.countryCode = query
                        getByCountryCode(this.selectCountry).then(res => {
                            this.shpCompnyList = res.data.dataList
                            this.shpCompnyTypeOption = this.shpCompnyList.map(item => {
                                return {value: item.enterpriseCode, label: item.enterpriseCode}
                            })
                        })
                    }

                } else {
                    this.countryOption = []
                }



            },

            // >>>>>>>>>>>>>>>>更新发送状态<<<<<<<<<<<<<<<<<<
            handleSwitch(row) {
                this.$confirm("是否发送更改状态", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '确认更改',
                    cancelButtonText: '取消更改'
                }).then(() => {
                    this.$message({
                        type: 'success',
                        message: '状态更改成功'
                    })
                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消状态更改'
                            : '停留在当前页面'
                    })
                })
            },

            // >>>>>>>>>>>>>>>>删除<<<<<<<<<<<<<<<<<<
            handleDel(index, row) {
                this.$confirm("是否删除", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '删除',
                    cancelButtonText: '取消'
                }).then(() => {
                    deleteByIsDelete(row).then(res => {
                        if (res.data.count > 0) {
                            this.$message({
                                type: 'success',
                                message: '删除成功'
                            })
                            this.orgData.splice(index, 1)
                        } else {
                            this.$message({
                                type: 'danger',
                                message: '删除异常,请稍后重试'
                            })
                        }
                    })
                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消删除'
                            : '停留在当前页面'
                    })
                })

            },

            // >>>>>>>>>>>>>>>>发送<<<<<<<<<<<<<<<<<<
            handleSend(row) {
                console.log(row)
            },
            // >>>>>>>>>>>>>>>>新增分单<<<<<<<<<<<<<<<<<<
            handleAddAwbh(row){
                const template = Object.assign({}, row) // copy obj
                console.log(template)
                this.temp.awba = template.awba
                this.temp.flightdate = template.flightdate
                this.temp.flightno = template.flightno
                this.temp.destinationstation = template.destinationstation
                this.temp.customcode = template.customcode
                this.temp.carrier = template.carrier
                this.temp.awbinfo.shprcountyr = template.awbinfo.shprcountyr
                this.temp.originstation = template.originstation
                this.temp.goodsname = template.goodsname
                this.temp.awbinfo.collected = template.awbinfo.collected
                this.temp.awbinfo.sairportid = template.awbinfo.sairportid
                this.temp.awbinfo.eairportid = template.awbinfo.eairportid
                this.temp.awbinfo.ex5 = template.awbinfo.ex5

                this.dialogStatus = 'addAwh'
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.formData.clearValidate()
                })
            },

            handleRedirct(row){
                this.$router.push({name:'预配',params:{scopeRow: row}})
            }

        }
    }
</script>
<style scoped>
    .row-bg {
        padding: 10px 0;
        background-color: #f9fafc;
    }

    .remark textarea {
        width: 575px;
    }

    .el-dialog-div {
        height: 60vh;
        overflow: auto;
    }

    .tags {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .disabledClass {
    }

</style>