inventroy.vue 58.2 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
<template>
    <el-row>
        <el-card  style="background-color: #F5F7FA">
            <!--            搜索区域-->
            <el-row class="toolbar" style="height: 100px">
                <el-row style="margin-top: -3px">
                    <el-col :span="6">
                        <el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search" size="small" style="width: 280px"
                                  placeholder="货物单号" clearable>
                            <template slot="prepend">主单号</template>
                        </el-input>
                    </el-col>
                    <el-col :span="6">
                        <el-input v-model="queryInfo.billfhl" prefix-icon="el-icon-search" size="small" style="width: 280px"
                                  placeholder="货物单号" clearable>
                            <template slot="prepend">分单号</template>
                        </el-input>
                    </el-col>
                    <el-col :span="6">
                        <el-input v-model="queryInfo.locationno" prefix-icon="el-icon-search" size="small" style="width: 280px"
                                  placeholder="货物单号" clearable>
                            <template slot="prepend">库位编号</template>
                        </el-input>
                    </el-col>
                    <el-col :span="6">
                        <el-input v-model="queryInfo.remark2" prefix-icon="el-icon-search" size="small" style="width: 280px"
                                  placeholder="货物单号" clearable>
                            <template slot="prepend">客户代码</template>
                        </el-input>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <div class="my-text-area">
                            <div class="el-input-group__prepend prepand">时间段</div>
                            <el-date-picker
                                    v-model="searchTime"
                                    type="daterange"
                                    unlink-panels clearable @change="handleCycleTime"
                                    range-separator="至"
                                    start-placeholder="开始日期"
                                    end-placeholder="结束日期"
                                    value-format="yyyy-MM-dd HH:mm:ss"
                                    format="yyyy-MM-dd HH:mm:ss"
                                    :picker-options="pickerOptions">
                            </el-date-picker>
                        </div>
                    </el-col>
                    <el-col :span="5">
                        <el-button type="primary" icon="el-icon-search" size="small" @click="getList()">
                            查询
                        </el-button>
                        <el-button type="success"  size="small" @click="changeFwb()" :disabled="this.sels.length===0">
                            更改主单号
                        </el-button>
                        <!--                    <el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>-->
                    </el-col>
                </el-row>
            </el-row>
            <el-row class="toolbar" style="height: 70px">
                        <el-col :span="7" >
                            <div class="analysis_title">总单数:</div>
                            <div class="analysis_text">
                                <el-input v-model="total"  readonly>
                                </el-input>
                            </div>
                        </el-col>
                        <el-col :span="1">
                            <el-divider direction="vertical"></el-divider>
                        </el-col>
                        <el-col :span="7">
                            <div class="analysis_title">总件数:</div>
                            <div class="analysis_text">
                                <el-input v-model="pcsSum" readonly>
                                </el-input>
                            </div>
                        </el-col>
                        <el-col :span="1">
                            <el-divider direction="vertical"></el-divider>
                        </el-col>
                        <el-col :span="7">
                            <div class="analysis_title">总重量:</div>
                            <div class="analysis_text">
                                <el-input v-model="weightSum" readonly>
                                </el-input>
                            </div>
                        </el-col>
            </el-row>
            <!--            列表区域-->
            <el-row>
                <template>
                    <el-table
                            :data="tableData"
                            border
                            @selection-change="selsChange"
                            :cell-style="{textAlign:'center'}"
                            style="border-radius: 10px 10px 0px 0px;line-height: 25px"
                            :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
                    >
                        <el-table-column type="selection" width="55" align="center"></el-table-column>
                        <el-table-column
                                fixed
                                label="操作"
                                width="160">
                            <template slot-scope="scope">
                                <el-button type="primary" size="mini" @click="queryDeta(scope.row)">查看货物明细</el-button>
                            </template>
                        </el-table-column>
                        <el-table-column
                                fixed
                                prop="waybill"
                                label="主单号"
                                width="120">
                        </el-table-column>
                        <el-table-column
                                prop="billfhl"
                                label="分单号"
                                width="120">
                        </el-table-column>
                        <el-table-column
                                prop="pcs"
                                label="件数"
                                width="80">
                        </el-table-column>
                        <el-table-column
                                prop="weight"
                                label="重量"
                                width="80">
                        </el-table-column>
                        <el-table-column
                                prop="location"
                                label="库位"
                                width="120">
                        </el-table-column>
                        <el-table-column
                                prop="remark2"
                                label="客户代码"
                                width="100">
                        </el-table-column>
                        <el-table-column
                                prop="createdate"
                                label="创建时间">
                        </el-table-column>
<!--                        <el-table-column-->
<!--                                prop="status"-->
<!--                                label="状态"-->
<!--                                width="80">-->
<!--                            <template slot-scope="scope">-->
<!--                                <span v-if="scope.row.status ==='0'">失败</span>-->
<!--                                <span v-if="scope.row.status ==='1'">成功</span>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
                        <el-table-column
                                fixed="right"
                                label="操作"
                                width="320">
                            <template slot-scope="scope">
                                <el-button type="warning" size="mini" @click="changeFhl(scope.row)">更改分单号</el-button>
                                <el-button type="primary" size="mini" @click="outBound(scope.row)">分批出库</el-button>
<!--                                件数重量尺寸-->
                                <el-button type="success" size="mini" @click="changeOrder(scope.row)">分批改单</el-button>
<!--                                单号-->
                                <!--                                <el-button type="success" size="mini" @click="applyEdit(scope.row)">编辑</el-button>-->
<!--                                <el-button type="danger" size="mini" @click="applyDel(scope.$index,scope.row)">删除</el-button>-->
                            </template>
                        </el-table-column>
                    </el-table>
                </template>
            </el-row>
            <el-row style="margin-top: 10px" class="toolbar">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="queryInfo.pageNum"
                        :page-size="queryInfo.pageSize"
                        :page-sizes="[10, 50, 100, 500]"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="total">
                </el-pagination>
            </el-row>
            <!--            分批出库-->
            <el-row>
                <el-dialog :title="detaOut" :visible.sync="outDialog" width="40%" >
                    <el-form  :model="outForm"  :rules="outRules" ref="outForm" style="margin-top: 40px">
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label=" " :label-width="formLabelWidth"  prop="batchpcs">
                                    <el-input placeholder="请输入件数" v-model="outForm.batchpcs" autocomplete="off" size="small" style="width: 400px">
                                        <template slot="prepend">件数:</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label=" " :label-width="formLabelWidth"  prop="batchweight">
                                    <el-input placeholder="请输入重量" v-model="outForm.batchweight" autocomplete="off" size="small" style="width: 400px">
                                        <template slot="prepend">重量:</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label=" " :label-width="formLabelWidth"  prop="batchgoodssize">
                                    <el-input placeholder="请输入尺寸" v-model="outForm.batchgoodssize" autocomplete="off" size="small" style="width: 400px">
                                        <template slot="prepend">尺寸:</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="outDialog = false" size="small">取 消</el-button>
                        <el-button type="primary" @click="outEdit()" size="small">提 交</el-button>
                    </div>
                </el-dialog>
            </el-row>
            <!--            分批改单-->
            <el-row>
                <el-dialog :title="detaChange" :visible.sync="changeDialog" width="40%" >
                    <el-form  :model="changeForm"  :rules="changeRules" ref="changeForm" style="margin-top: 40px">
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label=" " :label-width="formLabelWidth"  prop="newwaybill">
                                    <el-input placeholder="请输入更改后的单号" v-model="changeForm.newwaybill" autocomplete="off" size="small" style="width: 400px">
                                        <template slot="prepend">单号:</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="changeDialog = false" size="small">取 消</el-button>
                        <el-button type="primary" @click="changeEdit()" size="small">提 交</el-button>
                    </div>
                </el-dialog>
            </el-row>
<!--            更改分单号-->
            <el-row>
                <el-dialog :title="detaFhl" :visible.sync="fhlDialog" width="40%" >
                    <el-form  :model="fhlForm"  :rules="fhlRules" ref="fhlForm" style="margin-top: 40px">
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label=" " :label-width="formLabelWidth"  prop="billfhl">
                                    <el-input placeholder="请输入更改后的分单号" v-model="fhlForm.billfhl" autocomplete="off" size="small" style="width: 400px">
                                        <template slot="prepend">更改分单号为:</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="fhlDialog = false" size="small">取 消</el-button>
                        <el-button type="primary" @click="fhlEdit()" size="small">提 交</el-button>
                    </div>
                </el-dialog>
            </el-row>
            <!--            更改主单号-->
            <el-row>
                <el-dialog :title="detaFwb" :visible.sync="fwbDialog" width="40%" >
                    <el-form  :model="fwbForm"  :rules="fwbRules" ref="fwbForm" style="margin-top: 40px">
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="waybill">
                                    <el-input placeholder="请输入更改后的主单号" v-model="fwbForm.waybill" autocomplete="off" size="small" style="width: 400px">
                                        <template slot="prepend">更改主单号为:</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="fwbDialog = false" size="small">取 消</el-button>
                        <el-button type="primary" @click="fwbEdit()" size="small">提 交</el-button>
                    </div>
                </el-dialog>
            </el-row>
<!--            新增和编辑-->
            <el-row>
                <el-dialog :title="dialogMap[dialogApply]" :visible.sync="apply_dialog.addDialog" width="80%" >
                    <el-form  :model="addForm"  :rules="rules" ref="addForm" style="margin-top: 40px">
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="goodno">
                                    <el-input v-model="addForm.goodno" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">货物单号</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="weight">
                                    <el-input v-model="addForm.weight" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">重&emsp;&emsp;量</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="vol">
                                    <el-input v-model="addForm.vol" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">体&emsp;&emsp;积</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="pcs">
                                    <el-input v-model="addForm.pcs" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">件&emsp;&emsp;数</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="billweight">
                                    <el-input v-model="addForm.billweight" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">计费重量</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="area">
                                    <el-input v-model="addForm.area" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">库&emsp;&emsp;区</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="location">
                                    <el-input v-model="addForm.location" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">库&emsp;&emsp;位</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="serialnumber">
                                    <el-input v-model="addForm.serialnumber" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">流水&emsp;号</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="transtype">
                                    <el-input v-model="addForm.transtype" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">交易类型</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="house">
                                    <el-input v-model="addForm.house" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库仓库</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="opttime">
                                    <el-input v-model="addForm.opttime" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库时间</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="station">
                                    <el-input v-model="addForm.station" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库场站</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="goodstype">
                                    <el-input v-model="addForm.goodstype" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库货物类型</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="opter">
                                    <el-input v-model="addForm.opter" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库经办人</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="customername">
                                    <el-input v-model="addForm.customername" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库客户名称</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="transcar">
                                    <el-input v-model="addForm.transcar" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">运输车辆信息</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="ietype">
                                    <div class="my-text-area">
                                        <div class="el-input-group__prepend prepand">出入库类型</div>
                                        <el-select v-model="addForm.ietype" placeholder="出入库类型" size="mini" style="width: 210px">
                                            <el-option label="出入库类型-进" value="I"></el-option>
                                            <el-option label="出入库类型-出" value="E"></el-option>
                                        </el-select>
                                    </div>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="status">
                                    <div class="my-text-area">
                                        <div class="el-input-group__prepend prepand">请选择状态</div>
                                        <el-select v-model="addForm.status" placeholder="请选择状态" size="mini" style="width: 210px">
                                            <el-option label="状态-失败" value="0"></el-option>
                                            <el-option label="状态-成功" value="1"></el-option>
                                        </el-select>
                                    </div>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="custel">
                                    <el-input v-model="addForm.custel" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库客户联系电话</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="10">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="customer">
                                    <el-input v-model="addForm.customer" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库客户联系人姓名</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="apply_dialog.addDialog = false" size="small">取 消</el-button>
                        <el-button type="primary" @click="dialogApply==='create'?add():edit()" size="small">提 交</el-button>
                    </div>
                </el-dialog>
            </el-row>
<!--            //查看货物明细-->
<!--            <el-row>-->
<!--                <el-dialog :title="detaMap" :visible.sync="detaDialog" width="70%" >-->
<!--                    <el-form  :model="detaForm"  :rules="detaRules" ref="detaForm" style="margin-top: 40px;padding-bottom: 30px">-->
<!--                        <el-row>-->
<!--                            <el-col :span="7">-->
<!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="dest4">-->
<!--                                    <el-input disabled v-model="detaForm.dest4" autocomplete="off" size="small" style="width: 300px">-->
<!--                                        <template slot="prepend">代理人名称</template>-->
<!--                                    </el-input>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                            <el-col :span="8">-->
<!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="shpcomid">-->
<!--                                    <el-input disabled v-model="detaForm.shpcomid" autocomplete="off" size="small" style="width: 300px">-->
<!--                                        <template slot="prepend">代理人代码</template>-->
<!--                                    </el-input>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                            <el-col :span="8">-->
<!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="optime">-->
<!--                                    <el-input disabled v-model="detaForm.optime" autocomplete="off" size="small" style="width: 300px">-->
<!--                                        <template slot="prepend">入库时间</template>-->
<!--                                    </el-input>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                        </el-row>-->
<!--                        <el-row>-->
<!--                            <el-col :span="7">-->
<!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="pcs">-->
<!--                                    <el-input disabled v-model="detaForm.pcs" autocomplete="off" size="small" style="width: 300px">-->
<!--                                        <template slot="prepend">件&emsp;&emsp;&emsp;数</template>-->
<!--                                    </el-input>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                            <el-col :span="8">-->
<!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="weight">-->
<!--                                    <el-input disabled v-model="detaForm.weight" autocomplete="off" size="small" style="width: 300px">-->
<!--                                        <template slot="prepend">重&emsp;&emsp;&emsp;量</template>-->
<!--                                    </el-input>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                            <el-col :span="8">-->
<!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="feewt">-->
<!--                                    <el-input disabled v-model="detaForm.feewt" autocomplete="off" size="small" style="width: 300px">-->
<!--                                        <template slot="prepend">计费重量</template>-->
<!--                                    </el-input>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                        </el-row>-->
<!--                        <el-row>-->
<!--                            <el-col :span="7">-->
<!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="pack">-->
<!--                                    <el-input disabled v-model="detaForm.pack" autocomplete="off" size="small" style="width: 300px">-->
<!--                                        <template slot="prepend">包&emsp;&emsp;&emsp;装</template>-->
<!--                                    </el-input>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                            <el-col :span="8">-->
<!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="meas">-->
<!--                                    <el-input disabled v-model="detaForm.meas" autocomplete="off" size="small" style="width: 300px">-->
<!--                                        <template slot="prepend">尺&emsp;&emsp;&emsp;寸</template>-->
<!--                                    </el-input>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                            <el-col :span="8">-->
<!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="area">-->
<!--                                    <el-input disabled v-model="detaForm.vol" autocomplete="off" size="small" style="width: 300px">-->
<!--                                        <template slot="prepend">体&emsp;&emsp;积</template>-->
<!--                                    </el-input>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                        </el-row>-->
<!--                    </el-form>-->
<!--                </el-dialog>-->
<!--            </el-row>-->
<!--            <el-row>-->
<!--                <el-dialog :title="detaWaybill" :visible.sync="waybillDialog" width="40%" >-->
<!--                    -->
<!--                </el-dialog>-->
<!--            </el-row>-->
        </el-card>
    </el-row>
</template>

<script>
    import {
        selectNewInventroys,
        delInventroy,
        addInventory,batchoutbound,batchchangewaybill,
        ediInventroy, selectBylocationno,selectBywaybillandFhl,ediNewInventroyByfhl,ediNewInventroyBywaybill,
    } from '../../api/consigner/station';
    import jsutil from "@/common/js/util";
    import {loginedUserInfo} from "../../api/user";
    import WaybillQuery from "../nmms_import/WaybillQuery"


    export default {
        //name: "inventroy",
        props:['parentLoId'],
        // components: {
        //     WaybillQuery
        // },
        data() {
            var checkInputArea = (rule, value, callback) => {
                let err = {
                    name:'',
                    message:''
                }
                let _this = this
                let tempVol = 0
                if (!value) {
                    err  = new Error('体积信息必填')
                    return callback(err);
                }
                setTimeout(() => {
                    value = value.replaceAll('*','x')
                    var lineStr = value.replace('\r').split('\n')
                    lineStr.forEach(((v,index) => {
                        // eslint-disable-next-line no-useless-escape
                        var pattern = /^[0-9\.]+[xX][0-9\.]+[xX][0-9\.]+[xX][0-9\.]+$/;
                        if(!pattern.test(v)){
                            err  = new Error('行'+(index+1)+'的值:'+v+'的体积格式输入错误,格式为1x1x1x1支持小数点')
                            return callback(err);
                        }else {
                            const volV = this.multiply(v)
                            tempVol += volV
                        }
                    }))

                    // console.log(err.name + '  '+ err.message)
                    callback();
                    if (err && err.message===''){
                        _this.addForm.goodsvol = (tempVol/1000000).toFixed(2)
                        _this.volAreatextMerge(lineStr)
                    }

                }, 200);
            };
            return {
                pickerOptions: {
                    shortcuts: [{
                        text: '最近一周',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近一个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近三个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                            picker.$emit('pick', [start, end]);
                        }
                    }]
                },
                queryInfo: {
                    waybill:'',
                    billfhl:'',
                    locationno:'',
                    // 当前页数
                    pageNum: 1,
                    // 每页大小
                    pageSize: 10,
                    starttime:'',
                    endtime:'',
                    remark2:''
                },
                creattime:'',
                total: 0,
                pcsSum:'',
                weightSum:'',
                tableData:[],
                //新增编辑
                dialogMap: {
                    update: '编辑',
                    create: '新增'
                },
                dialogApply: 'create',
                apply_dialog: {
                    // 添加对话框
                    addDialog: false,
                    // 编辑对话框
                    editDialog: false
                },
                addForm: {
                    area: '',
                    billweight: '',
                    custel: '',
                    customer: '',
                    customername: '',
                    goodstype: '',
                    house:'',
                    ietype:'',
                    locationno:'',
                    opter:'',
                    opttime: '',
                    pcs: '',
                    serialnumber: '',
                    station: '',
                    status: '',
                    transcar: '',
                    transtype:'',
                    vol:'',
                    goodno:'',
                    weight:'',
                    remark:'',
                    remark1:'',
                    remark2:'',
                    remark3:'',
                    remark4:'',
                    remark5:'',
                    newwaybill:'',
                    newfhl:'',
                    batchpcs:'',
                    batchweight:'',
                    batchgoodssize:'',
                },
                rules: {
                    userName: [
                        //     { required: true, message: '请输入申请人', trigger: 'blur' },
                        //     // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
                        // ],
                        // applyTime: [
                        //     {  required: true, message: '请选择时间', trigger: 'change' }
                        // ],
                        // needCount: [
                        //     { required: true, message: '请输入需要车辆数量', trigger: 'blur' },
                        // ],
                        // orginStation: [
                        //     { required: true, message: '请输入起始场站', trigger: 'blur' },
                        // ],
                        // endStation: [
                        //     { required: true, message: '请输入目的场站', trigger: 'blur' },
                        // ],
                    ],
                },
                //货物明细
                detaDialog: false,
                detaMap:'货物明细',
                detaForm:{
                    dest4: '',
                    shpcomid: '',
                    optime:'',
                    pcs: '',
                    weight: '',
                    feewt: '',
                    vol:'',
                    pack: '',
                    meas:'',
                    billid: '',
                    stocktypeid: '',
                    stockpre:'',
                    stockno: '',
                    productid: '',
                    carrierproductid: '',
                    delflag:'',
                    previousbillid: '',
                    domint:'',
                    customctl: '',
                    specopeid: '',
                    specopeidext:'',
                    sairportid: '',
                    scityid: '',
                    eairportid: '',
                    ecityid:'',
                    by1: '',
                    dest1:'',
                    dest1city: '',
                    by2: '',
                    dest2:'',
                    dest2city: '',
                    by3: '',
                    dest3: '',
                    dest3city:'',
                    by4: '',
                    cargono:'',
                    cargonm: '',
                    ctrlopedepartment: '',
                    shprname:'',
                    shprmobiletype: '',
                    shprtel: '',
                    shpraddress: '',
                    shprcountyr:'',
                    shpaeocode:'',
                    shpcustomerid: '',
                    cnsnname: '',
                    cnsrmobiletype:'',
                    cnsntel: '',
                    cnsnaddress: '',
                    cnscountyr: '',
                    cnscomid:'',
                    cnsaeocode: '',
                    cnsrctcname:'',
                    cnsrctctel:'',
                    csgcustomerid: '',
                    collected: '',
                    exchagerate:'',
                    comat: '',
                    refrigerated: '',
                    whshold: '',
                    expcusttransit:'',
                    impcusttransit: '',
                    shorttrans:'',
                    shorttransbup: '',
                    cargoowner: '',
                    chargetime:'',
                    isinstruction: '',
                    notify: '',
                    fileattached: '',
                    ratetype:'',
                    processingmethod: '',
                    handlingcircs:'',
                    reservedtonnage:'',
                },
                formLabelWidth: '80px',
                detaRules:{},
                //更改分单号
                fhlDialog: false,
                detaFhl:'更改分单号',
                fhlForm:{
                    billfhl:'',
                },
                fhlRules:{
                    billfhl: [
                        { required: true, message: '必填', trigger: 'blur' },
                    ],
                },
                //更改主单号
                /* 批量选中的列表 */
                sels: [],
                fwbDialog: false,
                detaFwb:'更改主单号',
                fwbForm:{
                    waybill:'',
                },
                fwbRules:{
                },
                //出库
                outDialog: false,
                detaOut:'批量出库',
                outForm:{
                    batchpcs:'',
                    batchweight:'',
                    batchgoodssize:'',
                },
                outRules:{
                    batchgoodssize:[
                        {  required: true, message: '尺寸', trigger: 'blur' },
                        {  validator: checkInputArea,  trigger: 'blur' }
                        // { pattern: /^[0-9\.x]+$/gm, message: '体积信息只能输入数字和(.)点符号与x小写字母' }
                    ],
                    batchpcs: [
                        { required: true, message: '必填', trigger: 'blur' },
                        { type:"number", message: ''}
                    ],
                    batchweight: [
                        { required: true, message: '必填', trigger: 'blur' },
                        { type:"number", message: ''}
                    ],
                },
                //批量改单
                changeDialog: false,
                detaChange:'改单',
                changeForm:{
                    newwaybill:'',
                },
                changeRules:{
                    newwaybill: [
                        { required: true, message: '必填', trigger: 'blur' },
                    ],
                },
                //明细
                waybillDialog: false,
                detaWaybill:'更改分单号',
            }
        },
        computed:{
            //选中的时间段
            searchTime: {
                get:function () {
                    return this.creattime
                },
                set:function (val) {
                    this.creattime = val
                    if (val && val.length===2){
                        this.queryInfo.starttime = val[0]
                        this.queryInfo.endtime = val[1]
                    }
                }
            },
        },
        methods: {
            handleCycleTime(date) {
                this.queryInfo.starttime = date ? date[0] : undefined;
                this.queryInfo.endtime = date ? date[1] : undefined;
            },
            //获取所属库位
            // getLo:function(query){
            //     this.locationnos=[];
            //     this.loading = true;
            //     selectBylocationno({locationno:query}).then(res =>{
            //         if (res !== '') {
            //             setTimeout(() => {
            //                 this.locationnos=res.data.data;
            //             }, 200);
            //         } else {
            //             this.locationnos = [];
            //         }
            //     }).finally(() =>{
            //         this.loading = false;
            //     });
            // },
            //查询货物明细
            //打开更改主单号
            selsChange: function (sels) {
                this.sels = sels;
            },
            changeFwb() {
                this.fwbDialog = true;
                // this.addForm=row;
            },
            fwbEdit() {
                this.$confirm('是否更改?',  {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }
                ).then(() => {
                    for(var i=0;i<this.sels.length;i++){
                        this.sels[i]['newwaybill']=this.fwbForm.waybill;
                    }
                    // console.log(this.sels)
                    ediNewInventroyBywaybill(this.sels).then(response => {
                        const res = response.data
                        if (res.code !== '200') {
                            return this.$message.error(res.msg)
                        }
                        this.$message.success(res.msg)
                        this.fwbDialog = false
                        this.getList()
                    }).catch(error => {
                        this.$message.error(error.toString())
                    })
                }).catch(() => {
                })
            },
            //出库
            outBound(row) {
                this.outDialog = true;
                this.addForm=row;
            },
            outEdit() {
                const _this=this;
                // 进行表单的预验证
                _this.$refs.outForm.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return
                    this.addForm.batchpcs=this.outForm.batchpcs;
                    this.addForm.batchweight=this.outForm.batchweight;
                    this.addForm.batchgoodssize=this.outForm.batchgoodssize;
                    batchoutbound(this.addForm).then((response) => {
                        // console.log(row)
                        const res = response.data
                        // console.log(res)
                        if (res.code != '200') {
                            return this.$message.error(res.msg)
                        }
                        this.$message.success(res.msg)
                        // 隐藏对话框
                        this.outDialog = false
                        // 刷新列表
                        this.getList()
                    }).catch(error => {
                        this.$message.error(error.toString())

                    })
                })
            },
            //批量改单
            changeOrder(row) {
                this.changeDialog = true;
                this.addForm=row;
            },
            changeEdit() {
                const _this=this;
                // 进行表单的预验证
                _this.$refs.changeForm.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return
                    this.addForm.newwaybill=this.changeForm.newwaybill;
                    batchchangewaybill(this.addForm).then((response) => {
                        // console.log(row)
                        const res = response.data
                        // console.log(res)
                        if (res.code != '200') {
                            return this.$message.error(res.msg)
                        }
                        this.$message.success(res.msg)
                        // 隐藏对话框
                        this.changeDialog = false
                        // 刷新列表
                        this.getList()
                    }).catch(error => {
                        this.$message.error(error.toString())

                    })
                })
            },
            //打开更改分单号
            changeFhl(row) {
                this.fhlDialog = true;
                this.addForm=row;
            },
            fhlEdit() {
                const _this=this;
                // 进行表单的预验证
                _this.$refs.fhlForm.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return
                    this.addForm.newfhl=this.fhlForm.billfhl;
                    ediNewInventroyByfhl(this.addForm).then((response) => {
                        // console.log(row)
                        const res = response.data
                        // console.log(res)
                        if (res.code != '200') {
                            return this.$message.error(res.msg)
                        }
                        this.$message.success(res.msg)
                        // 隐藏对话框
                        this.fhlDialog = false
                        // 刷新列表
                        this.getList()
                    }).catch(error => {
                        this.$message.error(error.toString())

                    })
                })
            },
            //查询货物明细
            // queryDeta(row) {
            //     const _this = this
            //     this.detaDialog = true;
            //     // console.log(row);
            //     selectBywaybillandFhl({waybill:row.waybill,billfhl:row.billfhl}).then((response) => {
            //         const res = response.data
            //         // console.log(response.data)
            //         if (res.code !== '200') {
            //             return _this.$message.error('获取货物明细,失败!')
            //         }
            //         // 获取表单数据
            //         _this.detaForm = res.data
            //         _this.$message.success('获取货物明细,成功!')
            //     }).catch(error => {
            //         // 关闭加载
            //         _this.$message.error(error.toString())
            //     })
            // },
            queryDeta(row) {
                // this.form=row
                // this.form.awba=this.form.waybill
                // console.log("queryinfo---->"+this.form.awba)
                // this.$refs.WaybillQuery.getList(this.form)
                this.$router.push(
                    {
                        path:'WaybillQuery',
                        query:row
                    }
                )
            },
            handleSizeChange(val) {
                this.queryInfo.pageSize = val
                this.getList()
            },
            handleCurrentChange(val) {
                this.queryInfo.pageNum = val
                this.getList()
            },
            getList() {
                const _this = this
                let ld = this.$loading({
                    text:"获取数据中..."
                })
                selectNewInventroys(this.queryInfo).then((response) => {
                    const res = response.data
                    console.log(response.data)
                    if (res.code !== '200') {
                        return _this.$message.error('获取消息收发记录,失败!')
                    }
                    // 获取列表数据
                    _this.tableData = res.data.list
                    // 获取列表的总记录数
                    _this.total = res.data.total
                    _this.pcsSum = res.data.pcsSum
                    _this.weightSum  = res.data.weightSum
                    _this.$message.success('获取消息收发记录,成功!')
                }).catch(error => {
                    // 关闭加载
                    _this.$message.error(error.toString())
                }).finally(()=>{
                    ld.close()
                })
            },
            // 添加对话框,打开事件
            applyAdd() {
                this.addForm = {
                    area: '',
                    billweight: '',
                    custel: '',
                    customer: '',
                    customername: '',
                    goodstype: '',
                    house:'',
                    ietype:'',
                    location:'',
                    opter:'',
                    opttime: '',
                    pcs: '',
                    serialnumber: '',
                    station: '',
                    status: '',
                    transcar: '',
                    transtype:'',
                    vol:'',
                    waybill:'',
                    weight:'',
                    remark:'',
                    remark1:'',
                    remark2:'',
                    remark3:'',
                    remark4:'',
                    remark5:'',
                    uuid:''
                };
                this.dialogApply= 'create';
                this.apply_dialog.addDialog = true;
            },
            // 添加功能
            add() {
                this.$refs.addForm.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return;
                    addInventory(this.addForm).then((response) => {
                        let res = response.data;
                        // 添加失败
                        if (res.code !== '200') {
                            return this.$message.error(res.msg);
                        }
                        // 添加,成功
                        this.$message.success(res.msg);
                        // 隐藏对话框
                        this.apply_dialog.addDialog = false;
                        // 刷新列表
                        this.getList();
                    }).catch(error => {
                        this.$message.error(error.toString());
                    });
                })
            },
// 打开编辑
            applyEdit(row) {
                this.apply_dialog.addDialog = true;
                this.dialogApply = 'update';
                this.addForm=row;
            },
            // 编辑功能
            edit() {
                // 进行表单的预验证
                this.$refs.addForm.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return
                    ediInventroy(this.addForm).then((response) => {
                        // console.log(row)
                        const res = response.data
                        if (res.code != '200') {
                            return this.$message.error(res.msg)
                        }
                        this.$message.success(res.msg)
                        // 隐藏对话框
                        this.apply_dialog.addDialog = false
                        // 刷新列表
                        this.getList()
                    }).catch(error => {
                        this.$message.error(error.toString())
                    })
                })
            },
            // 删除
            applyDel(index, row) {
                // 弹框询问是否删除?
                this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
                        confirmButtonText: '确定删除',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }
                ).then(() => {
                    // console.log(row);
                    delInventroy({uuid:row.uuid}).then((response) => {
                        // console.log(row)
                        const res = response.data
                        this.$message.success(res.msg)
                        this.getList()
                    }).catch(error => {
                        this.$message.error(error)
                    })
                }).catch(() => {
                })
            },
        },
        mounted() {
            if (jsutil.checkNull(this.parentLoId)){
                this.queryInfo.locationno = this.parentLoId;
            }
            this.getList();
            // this.getYardList();

        },
        watch: {
            parentLoId(value) {
                if (value && jsutil.checkNull(this.parentLoId)){
                  this.queryInfo.locationno = this.parentLoId;
                  this.getList();
                }

            }
        }

    }
</script>

<style scoped>
    .toolbar{
        height: 60px;
        background-color: white;
        /*line-height: 60px;*/
        vertical-align: middle;
        border-radius: 5px 5px 5px 5px;
        padding: 15px 0 0 20px;
        box-shadow: 0px 5px 5px #e5e8eb;
    }
    .my-text-area .prepand{
        float: left;
        width:89px;
        height: 28px;
        font-size: 12px;
        line-height: 28px;
    }
</style>
<style>
    .analysis_text .el-input--mini .el-input__inner{
        background-color: rgba(255,255,255,0.1) !important;
        border: 0px;
        font-size: 14px;
        color: rgb(64,158,255);
    }
    .my-text-area .el-textarea__inner{
        min-height: 28px;
        height: 28px;
        border-bottom-left-radius: 0;
        border-top-left-radius: 0;
    }
</style>