cost-pre-admission.vue 56.7 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
<template>
    <div class="container resource close-left-menu contaNEW">

        <div class="pop-banner clearfix">
            <div class="operate-btns">
                <a class="fbtn fb-costfrom " @click="gettrsupplierhvdo()">选择送货单</a>
                <a class="fbtn fb-save" @click="saveTrmedHvwvs()">保存</a>
                <a class="fbtn fb-submit" @click="subMittrmedHvwvs()">预入库签收</a>
            </div>
            <h3 class="current-module">高值预入库</h3>
        </div>
        <div class="fpart pd-form pd-form-lg-label">


            <div class="fheader">
                <h4 class='fh-cost'>高值预入库信息</h4>
            </div>
            <div class="group-row">
                <div class="form-group form-label w1003">
                    <label for="cc0" class="label bar-code-img"></label>
                    <div class="control">
                        <input class="h-70 w1003 border-blue pl80 f-size24" type="text" id="cc0" v-model="barcode"
                               placeholder="请扫描条码" @keydown="keyCodeList($event)">
                    </div>
                </div>
            </div>
            <div class="group-row">
                <div class="form-group form-label">
                    <label for="cc1" class="label">入库单号</label>
                    <div class="control">
                        <input class="inp4" type="text" id="cc1" v-model="trmedplan.billno" readonly>
                    </div>
                </div>
                <div class="form-group form-label">
                    <label for="cc2" class="label">供应商</label>
                    <div class="control">
                        <input class="inp3" type="text" id="cc2" v-model="trmedplan.suppliername" readonly>
                    </div>
                </div>

            </div>
            <div class="group-row">
                <div class="form-group form-label must">
                    <label for="cc3" class="label">入库库房</label>
                    <div class="control">
                        <select name="" id="cc3" v-model="trmedplan.deptguid" class="inp4"
                                @change="getdeptstatelist(trmedplan.deptguid)">
                            <option v-for="item in getdeptlists" :value="item.guid">{{item.hdeptname}}</option>
                        </select>
                    </div>
                </div>
                <div class="form-group form-label must">
                    <label for="cc4" class="label">收货人</label>
                    <div class="control select-style">
                        <select v-model="trmedplan.medstaffguid" id="cc4" class="inp4"
                                @change="getrealname(trmedplan.medstaffguid)">
                            <option v-for="option in storeList" v-bind:value="option.guid">
                                {{option.realname}}
                            </option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="group-row">
                <div class="form-group form-label w1003">
                    <label for="cc5" class="label">备注</label>
                    <div class="control">
                        <textarea class="inp2 w1003" rows="1" type="text" id="cc5" v-model="trmedplan.memo"> </textarea>
                    </div>
                </div>
            </div>
        </div>

        <div class="ctable ct-parent mt-20 mb-30">
            <div class="ct-head" id='t_header'>
                <span class="ct-col w30"></span>
                <span class="ct-col w50">序号</span>
                <span class="ct-col w150">商品</span>
                <span class="ct-col w100">单价</span>
                <span class="ct-col w100">批号</span>
                <span class="ct-col w100">灭菌批号</span>
                <span class="ct-col w30"></span>
                <span class="ct-col w70">出库数</span>
                <span class="ct-col w70">入库数</span>
                <span class="ct-col w70">拒收数</span>
                <span class="ct-col w100">金额(元)</span>
                <span class="ct-col w120">操作</span>
            </div>
            <div class="ct-row mt-0 pt10" id="warpd{{$index}}" v-for="cus in getTrMedDeptDoList" track-by="$index">
                <div class="row-line">
                    <span class="ct-col w30 mt-5 v-top">
                       <span class="table-detail-text"> <img src="/images/consumable.png" alt=""
                                                             v-if='cus.goodscode=="耗材包"'
                                                             @click="slidedown2($index,cus.guid,cus.goodsguid)"></span>
                    </span>
                    <span class="ct-col w50 v-top"><span class="table-detail-text">{{$index+1 | getIndex}}</span></span>
                    <span class="ct-col w150 t-left pr10 v-top">{{cus.goodscode}}<br>
                                                  <span style="padding-bottom: 15px;position: relative"
                                                        @click="slidedown2($index,cus.parasite)">
                                                      <span class="p-tit-green" style=' color: #4aa8e5;'>{{cus.goodsname}}</span><br>
                                                  </span>
                        {{cus.goodsspec}}<br>{{cus.producer}}<br>{{cus.register}}</span>
                    <span class="ct-col w100 v-top t-right pr10"><span class="table-detail-text">{{cus.price | numDigit 2 | numFmt}}<br>元/{{cus.unit}}</span></span>
                    <span class="ct-col w100 t-left v-top">{{cus.lot}}<br>{{cus.productiondate | getYMD}}<br>{{cus.expiredate | getYMD}}</span>
                    <span class="ct-col w100 t-left pr10 v-top">{{cus.sterilantlot}}<br>{{cus.sterilantdate | getYMD}}<br>{{cus.sterilantexpdate | getYMD}}</span>
                    <span class="ct-col w30 v-top">
                         <span class="table-detail-icon"></span>
                        <span class="table-detail-icon"></span>
                    </span>
                    <span class="ct-col w70 activate isFocus v-top">
                        <span class="table-detail-text" v-if='cus.goodscode=="耗材包"'>
                        <a href="javascript:void(0);" @click="slidedown2($index,cus.guid,cus.goodsguid)"
                           class="txt_underline  status-switch text-color-blue" style="display: inline-block;">1套</a>
                        </span>
                        <span v-else class="table-detail-text">{{cus.pesentqty}}{{cus.unit}}</span>

                        <span class="table-detail-text" v-if='cus.goodscode=="耗材包"'>
                        <a href="javascript:void(0);" @click="slidedown2($index,cus.guid,cus.goodsguid)"
                           class="txt_underline  status-switch text-color-blue" style="display: inline-block;">1套</a>
                        </span>
                        <span v-else class="table-detail-text">{{cus.suppesentqty}}{{cus.unit}}</span>
                    </span>
                    <span class="ct-col w70 v-top">
                        <span v-if='cus.goodscode=="耗材包"' class="table-detail-text">{{cus.mvqty =cus.pesentqty - cus.rejectqty}}{{cus.unit}}</span>
                        <span v-else class="table-detail-text">{{cus.mvqty =cus.pesentqty - cus.rejectqty}}{{cus.unit}}</span>
                        <span v-if='cus.goodscode=="耗材包"' class="table-detail-text">{{cus.supmvqty = cus.suppesentqty - cus.suprejectqty}}{{cus.unit}}</span>
                        <span v-else class="table-detail-text">{{cus.supmvqty = cus.suppesentqty - cus.suprejectqty}}{{cus.unit}}</span>
                    </span>
                    <span class="ct-col w70 v-top">
                        <span v-if='cus.goodscode=="耗材包"' class="table-detail-text">{{cus.rejectqty}}{{cus.unit}}</span>
                        <span v-else class="table-detail-text">{{cus.rejectqty}}{{cus.unit}}</span>
                        <span v-if='cus.goodscode=="耗材包"' class="table-detail-text">{{cus.suprejectqty}}{{cus.unit}}</span>
                        <span v-else class="table-detail-text">{{cus.suprejectqty}}{{cus.unit}}</span>
                    </span>
                    <span class="ct-col w100 t-right v-top">
                    <span class="table-detail-text" v-if='cus.goodscode=="耗材包"'>
                                 {{cus.amount | numDigit 2 | numFmt}}
                    </span>
                    <span class="table-detail-text" v-else>
                                 {{cus.amount = cus.mvqty * cus.price | numDigit 2 | numFmt}}
                    </span>
                    </span>
                    <span class="ct-col w120 v-top" v-if='cus.goodscode=="耗材包"'>
                            <span class="table-detail-text">
                            <a class="btn button-red" v-if="cus.mvqty == 1"
                               @click="updparentpackage($index,cus.guid,cus.goodsguid,'N',cus.rowno)">拒 收</a>
                            <a class="btn button-green" v-else
                               @click="updparentpackage($index,cus.guid,cus.goodsguid,'Y',cus.rowno)">签 收</a>
                            </span>
                    </span>
                    <span class="ct-col w120 v-top" v-else>
                            <span class="table-detail-text">
                                <a class="btn button-red" @click="onModelShow(cus.guid,cus.rowno)">拒 收</a>
                            </span>
                    </span>
                </div>
                <div class="row-launch mb-30" style="display: none;">
                    <h3>出库数({{cus.goodList.length}})</h3>
                    <table class="itable">
                        <thead>
                        <tr>
                            <th class="w50">序号</th>
                            <th class="w150">商品信息</th>
                            <th class="w100">批号</th>
                            <th class="w100">灭菌批号</th>
                            <th class="w80">单价</th>
                            <th class="w30"></th>
                            <th class="w70">出库数</th>
                            <th class="w70">入库数</th>
                            <th class="w70">拒收数</th>
                            <th class="w80">金额(元)</th>
                            <th class="w100">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-if="getTrMedDeptDoList[$index].goodList==null || getTrMedDeptDoList[$index].goodList==0">
                            <td colspan="12">暂无符合条件的记录</td>
                        </tr>
                        <tr v-for="(inx,variation) in cus.goodList">
                            <td class=" v-top">
                                {{ $index + 1 | getIndex}}
                            </td>
                            <td class='t-left v-top pr10'>{{variation.goodscode}}<br>{{variation.goodsname}}<br>{{variation.goodsspec}}<br>{{variation.producer}}<br>{{variation.register}}</td>
                            <td>
                                {{variation.lot}}
                                <br>
                                {{variation.productiondate | getYMD}}
                                <br>
                                {{variation.expiredate | getYMD}}
                            </td>
                            <td>
                                {{variation.sterilantlot}}
                                <br>
                                {{variation.sterilantdate| getYMD}}
                                <br>
                                {{variation.sterilantexpdate| getYMD}}
                            </td>
                            <td class="t-right v-top pr10"> {{variation.price | numDigit 2 | numFmt}}<br>元/{{variation.unit}}
                            </td>
                            <td class="w30">
                                <span class="table-detail-icon"></span>
                                <span class="table-detail-icon"></span>
                            </td>
                            <td class=" v-top">
                                <span class="table-detail-text">{{variation.pesentqty}}{{variation.unit}}</span>
                                <span class="table-detail-text">{{variation.suppesentqty}}{{variation.unit}}</span>
                            </td>
                            <td class=" v-top">
                            <span class="table-detail-text">{{variation.mvqty = variation.pesentqty - variation.rejectqty}}{{variation.unit}}</span>
                            <span class="table-detail-text">{{variation.supmvqty = variation.suppesentqty - variation.suprejectqty}}{{variation.unit}}</span>
                            </td>
                            <td class=" v-top">
                            <span class="table-detail-text">{{variation.rejectqty}}{{variation.unit}}</span>
                            <span class="table-detail-text">{{variation.suprejectqty}}{{variation.unit}}</span>
                            </td>
                            <td class="t-right v-top pr10">{{variation.amount = variation.mvqty * variation.price | numDigit 2 | numFmt}}
                            </td>
                            <td class=" v-top">
                                <a v-if="variation.arrivalqty != variation.rejectqty" class="btn button-red"
                                   @click="onModelShow(variation.guid,variation.rowno)">拒 收</a>
                                <a v-else class="btn button-green" @click="onModelShow(variation.guid,variation.rowno)">
</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <!-- <div class="pagination hide" style="margin: 20px 0">
                        <pagination @page-change="listTRSettleMVByMed($index,cus.guid)" :class="['m-20-0']"
                                    :page-no.sync="twoSearch[$index].page"
                                    :total-pages.sync="twoSearch[$index].totalPages"></pagination>
                    </div> -->
                    <div class="zip" @click="slideup2($index)"></div>
                </div>

            </div>
            <div class="ct-row" v-if="getTrMedDeptDoList.length==0">
                <div class="row-line t-center">
                    <div class="ct-col">未查询到相关数据!</div>
                </div>
            </div>
            <!--        <div class="mt-20" style="text-align: center" v-if="getTrMedDeptDoList.length==0">
                       未查询到相关数据!
                   </div> -->
            <div class="pagination hide" style="margin: 20px 0">
                <pagination @page-change="getDate" :class="['m-20-0']" :page-no.sync="search.page"
                            :total-pages.sync="search.totalPages"></pagination>
            </div>
        </div>

        <div class="modal" v-if='modelFlag' style="z-index: 400;">
            <div class="container resource">
                <div class="audit-detail" style="margin:200px auto;width:800px;padding:20px;">
                    <span class="close-win" v-on:click="close()"></span>
                    <a href="javascript:;" class="btn button-red icon1 allremove"
                       @click="updtrascendcodes('N')">全部拒收</a>
                    <a href="javascript:;" class="btn button-green ml-10 icon1 alladd"
                       @click="updtrascendcodes('Y')">全部签收</a>
                    <table class="itable itable-thead-13px itable-td-long-text">
                        <thead>
                        <tr>
                            <th class="w50">序号</th>
                            <th class="w200">商品追溯码</th>
                            <th class="w200">创建时间</th>
                            <th class="w100">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for='item in zsmsList' track-by="$index">
                            <td class=" v-top">
                                <div>{{$index+1 | getIndex}}</div>
                            </td>
                            <td class="t-left pr10 v-top">{{item.ascendcode}}</td>
                            <td class=" v-top">{{item.createTime | getYMD}}</td>
                            <td class=" v-top">
                                <a href="javascript:;" class="btn button-red" v-show="item.state == 'Y'"
                                   @click="updtrascendcode(item.guid,'N')">拒 收</a>
                                <a href="javascript:;" class="btn button-green" v-show="item.state == 'N'"
                                   @click="updtrascendcode(item.guid,'Y')">签 收</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <a href="javascript:;" class="btn button-red mt-20 icon cancel" style='margin-left:330px;'
                       v-on:click="close()">取消</a>
                </div>
            </div>
        </div>

        <div class="modal" v-if='modelFlags'>
            <div class="container resource">
                <div class="audit-detail" style="margin:200px auto;width:1003px;">
                    <span class="close-win" v-on:click="close1()"></span>
                    <div class="sdiv-9-9b no-border pb0">
                        <form class="search-bar" active="###">
                            <input type="text" style="width: 370px;" placeholder="输入商品名称查询" v-model="search1.goodsname">
                            <div class="search-btn">
                                <input type="button" @click="getparentpackagedetail()">
                            </div>
                        </form>
                    </div>
                    <table class="itable itable-thead-13px itable-td-long-text">
                        <thead>
                        <tr>
                            <th class="w50">序号</th>
                            <th class="w100">商品信息</th>
                            <th class="w80">单价</th>
                            <th class="w30"></th>
                            <th class="w70">出库数</th>
                            <th class="w70">入库数</th>
                            <th class="w70">拒收数</th>
                            <th class="w80">金额(元)</th>
                            <th class="w80">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for='item in goodsList' track-by="$index">
                            <td class=" v-top">
                                {{ $index + 1 | getIndex}}
                            </td>
                            <td class='t-left v-top pr10'>{{item.goodscode}}<br>{{item.goodsname}}<br>{{item.goodsspec}}<br>{{item.producer}}<br>{{item.register}}</td>
                            <td class="t-right v-top"> {{item.price | numDigit 2 | numFmt}}<br>元/{{item.unit}}</td>
                            <td class="w30">
                                <span class="table-detail-icon"></span>
                                <span class="table-detail-icon"></span>
                            </td>
                            <td class=" v-top">
                                <span class="table-detail-text">{{item.pesentqty}}{{item.unit}}</span>
                                <span class="table-detail-text">{{item.suppesentqty}}{{item.unit}}</span>
                            </td>
                            <td class=" v-top">
                                <span class="table-detail-text">{{item.mvqty = item.pesentqty - item.rejectqty}}{{item.unit}}</span>
                                <span class="table-detail-text">{{item.supmvqty = item.suppesentqty - item.suprejectqty}}{{item.unit}}</span>
                            </td>
                            <td class=" v-top">
                                <span class="table-detail-text">{{item.rejectqty}}{{item.unit}}</span>
                                <span class="table-detail-text">{{item.suprejectqty}}{{item.unit}}</span>
                            </td>
                            <td class="t-right v-top pr10">{{item.amount = item.supmvqty * item.price | numDigit 2 |
                                numFmt}}
                            </td>
                            <td class=" v-top"><a class="btn button-red"
                                                  @click="onModelShow(item.guid,item.rowno)">拒收</a></td>
                        </tr>
                        </tbody>
                    </table>
                    <div class="pagination" style="margin: 20px 0">
                        <pagination @page-change="getparentpackagedetail()" :class="['m-20-0']"
                                    :page-no.sync="search1.page" :total-pages.sync="search1.totalPages"></pagination>
                    </div>
                    <a href="javascript:;" class="btn button-red  icon cancel" style='margin-left:460px;'
                       v-on:click="close1()">取 消</a>
                </div>
            </div>
        </div>

        <!-- 选择送货单列表-->
        <div class="modal " :class="backMessage.showDialog=='Y'?'':'hide'">
            <div class="container resource">
                <div class="audit-detail ml-0 w1003">
                    <span class="close-win" v-on:click="closeDialog()"></span>
                    <div class="sdiv-9-9b no-border pb0">
                        <form class="search-bar" active="###">
                            <input type="text" style="width: 370px;" maxlength="17" v-rule placeholder="输入送货单号查询" v-model="search.billno">
                            <div class="search-btn">
                                <input type="button" @click="gettrsupplierhvdo()">
                            </div>
                        </form>
                    </div>
                    <div class="status-process wbe-0 clearfix pd20">
                        <p style="color:#606f7a;font-size:14px;">
                        </p>
                        <div class="sp-head sp-headb mb-0">
                            <div class="ctable ct-parentr mt-10"
                                 style="padding-top:0px; max-height: 350px; overflow-y: auto; padding-bottom:10px;">
                                <div class="ct-head">
                                    <span class="ct-col w50">序号</span>
                                    <span class="ct-col w120">供应商</span>
                                    <span class="ct-col w100">送货日期</span>
                                    <span class="ct-col w120">送货单号</span>
                                    <span class="ct-col w70">品规数</span>
                                    <span class="ct-col w100">单据类型</span>
                                    <span class="ct-col w150">要货单号</span>
                                    <span class="ct-col w100">要货日期</span>
                                    <span class="ct-col w100">操作</span>
                                </div>
                                <div class="ct-row" id="warp{{$index}}" v-for="voice in inVoiceList" track-by="$index">
                                    <div class="row-line">
                                       <span class="ct-col w50  v-top">
                                            {{$index + 1 | getIndex}}
                                      </span>
                                        <span class="ct-col w120 t-left break-it  v-top">
                                        <span class="table-detail-text">{{voice.suppliername}}</span>
                                        </span>
                                        <span class="ct-col w100 t-center  v-top">
                                        <span class="table-detail-text"> {{voice.dodate | getYMD}} </span>
                                        </span>
                                        <span class="ct-col w120 t-left  v-top">
                                        <span class="table-detail-text">  {{voice.billno}} </span>
                                        </span>
                                        <span class="ct-col w70 t-center v-top">
                                        <span class="table-detail-text isFocus">
                                        <a href="javascript:void(0);" @click="slidedown($index,voice.guid)"
                                           class="txt_underline  status-switch text-color-blue"
                                           style="display: inline-block;">{{voice.detailrecordsum}}</a>
                                      </span>
                                        </span>
                                        <span class="ct-col w100 t-center  v-top">
                                        <span class="table-detail-text">  {{voice.billtype | HvBillType}} </span>
                                        </span>
                                        <span class="ct-col w150 t-center v-top">
                                        <span class="table-detail-text">{{voice.medplanbillno}} </span>
                                        </span>
                                        <span class="ct-col w100 t-center v-top">
                                        <span class="table-detail-text">{{voice.planbegindate | getYMD}} </span>
                                        </span>
                                        <span class="ct-col w100 t-center v-top">
                                        <span class="table-detail-text"><a href="javascript:void(0);"
                                                                           class="btn button-green"
                                                                           @click="gettrmedhvwvlist(voice.guid)">选 择</a></span>
                                        </span>
                                        <div class="row-launch" style="display: none;">
                                            <h3>商品信息</h3>
                                            <table class="itable mb-30">
                                                <thead>
                                                <tr>
                                                    <th class="w50">序号</th>
                                                    <th class="w150">商品编号</th>
                                                    <th class="w120">商品</th>
                                                    <th class="w80">规格</th>
                                                    <th class="w120">生产厂商</th>
                                                    <th class="w150">注册证号/批准文号</th>
                                                    <th class="w60">单位</th>
                                                    <th class="w60">数量</th>
                                                </tr>
                                                </thead>
                                                <tbody>
                                                <tr v-if="inVoiceList[$index].mxList==null || inVoiceList[$index].mxList==0">
                                                    <td colspan="12">暂无符合条件的记录</td>
                                                </tr>
                                                <tr v-for="variation in voice.mxList">
                                                    <td class="v-top">{{ $index + 1 | getIndex}}</td>
                                                    <td class="t-left v-top">{{variation.supplierGoodscode}}</td>
                                                    <td class='t-left v-top'>{{variation.supplierGoodsname}}</td>
                                                    <td class="t-left v-top">{{variation.supplierGoodsspec}}</td>
                                                    <td class='t-left v-top'>{{variation.producer}}</td>
                                                    <td class="t-left v-top">{{variation.register}}</td>
                                                    <td class="v-top">{{variation.supplierUnit}}</td>
                                                    <td class="v-top">{{variation.purchaserPesentqty}}</td>
                                                </tr>
                                                </tbody>
                                            </table>
                                            <div class="pagination" style="margin: 20px 0">
                                                <pagination @page-change="gettrsupplierhvdodetail($index,voice.guid)"
                                                            :class="['m-20-0']" :page-no.sync="voice.search.pageNo"
                                                            :total-pages.sync="voice.search.totalPages"></pagination>
                                            </div>
                                            <div class="zip" @click="slideup($index)"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="pagination" style="margin: 20px 0">
                                <pagination @page-change="gettrsupplierhvdo()" :class="['m-20-0']"
                                            :page-no.sync="search.page"
                                            :total-pages.sync="search.totalPages"></pagination>
                            </div>
                            <div class="w240" style="margin:0 auto;">
                                <button class="btn button-red fl ml-80  icon cancel" v-on:click="closeDialog()">取 消
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="roll-bg " v-if='requestS' style="top: 0%;height: 100vh">
            <div class="w60" style="margin:0 auto;">
                <img src="/images/roll.gif">
            </div>
            <div class="container resource t-center text-color-red">
                正在处理中,请勿关闭!
            </div>
        </div>
    </div>
</template>
<script>
    module.exports = {
        data: function () {
            return {
                requestS:false,
                backMessage: {
                    showDialog: 'N',
                    mList: [], // 提示信息
                },
                getdeptlists: [],
                storeList: [],
                getTrMedDeptDoList: [],
                barcode: '',
                inVoiceList: '',
                search: {
                    billno: '',
                    pageSize: 5,
                    page: 1,
                    totalPages: 0,
                    total: 0,
                    pageNo: 0
                },
                search1: {
                    pageSize: 5,
                    page: 1,
                    totalPages: 0,
                    total: 0,
                    pageNo: 0,
                    guid: '',
                    purchasergoodsguid: '',
                    goodsname: '',
                    index: '',
                },
                trmedplan: {
                    deptguid: '',
                    deptname: '',
                    medstaffguid: '',
                    medstaffname: '',
                    billno: '',
                    suppliername: '',
                    memo: '',
                },
                modelFlag: false,
                modelFlags: false,
                rowno: '',
                guid: '',
                supplierdoguid: '',
                goodsList: [],
                zsmsList: [],
            };

        },
        methods: {
            // 关闭信息提示弹出框
            closeDialog: function () {
                var self = this;
                self.$set('backMessage.showDialog', 'N');
                self.inVoiceList = [];
            },
            close: function () {
                var self = this;
                self.modelFlag = false;
                self.getDate();
                self.getparentpackagedetail();
            },
            close1: function () {
                var self = this;
                self.modelFlags = false;
                self.getDate();
            },
            keyCodeList: function (ev) {
                if (ev.keyCode == 13) {

                    this.getDate();
                }
            },
            //高值入库单明细
            getDate: function () {
                var self = this;
                self.getTrMedDeptDoList = [];
                var item = [];
                Ajax.post('/cost/gettrmedhvwv', {
                    'barcode': self.barcode,
                    'supplierdoguid': self.supplierdoguid
                }).then(function (response) {
                    var data = response.data.data;
                    if (response.data.errorCode == 0) {
                        console.log('2222',data);
                        data.forEach(function(value) {
                            value.goodList = [];
                            if(self.getTrMedDeptDoList.length > 0){
                                for (var k = 0; k < self.getTrMedDeptDoList.length; k++) {
                                    if(self.getTrMedDeptDoList[k].billno + self.getTrMedDeptDoList[k].supplierguid + self.getTrMedDeptDoList[k].goodsguid == value.billno + value.supplierguid + value.goodsguid){
                                            layer.msg("数据已存在!");
                                            return;
                                    }
                                }
                            }

                            if (value.ispackage == 'N') {

                                self.getTrMedDeptDoList.push(value);
                                self.addTwoList(value, data);
                            }
                            console.log(self.getTrMedDeptDoList);
                            if (self.getTrMedDeptDoList.length > 0) {
                                self.trmedplan.billno = self.getTrMedDeptDoList[0].billno;
                                self.trmedplan.suppliername = self.getTrMedDeptDoList[0].suppliername;
                            }


                        });
                        self.trmedplan.memo = data[0].memo;
                        // self.$set('trmedplan.deptguid', data[0].medstoreguid)
                        for (var i = 0; i < data.length; i++) {
                            if (data[i].mvqty == 0 && data[i].rejectqty == 0) {
                                data[i].mvqty = data[i].arrivalqty;
                            } else {
                                data[i].mvqty = data[i].arrivalqty - data[i].rejectqty < 0 ? 0 : data[i].arrivalqty - data[i].rejectqty;
                                data[i].rejectqty = data[i].arrivalqty - data[i].rejectqty < 0 ? data[i].arrivalqty : data[i].rejectqty
                            }
                            var goodList = [];

                            /*   var item = data[i];
                               item.goodList =[];
                               if(item.ispackage == 'N'){
                                 self.getTrMedDeptDoList.push(item);
                                 self.addTwoList(item,data);
                               }
                               self.trmedplan.billno =self.getTrMedDeptDoList[0].billno;
                               self.trmedplan.suppliername =self.getTrMedDeptDoList[0].suppliername;*/
                        }
                        var cooperativeCostSum = 0;
                        for (var d = 0; d < self.getTrMedDeptDoList.length; d++) {
                            for (var j = 0; j < self.getTrMedDeptDoList[d].goodList.length; j++) {
                                cooperativeCostSum += self.getTrMedDeptDoList[d].goodList[j].mvqty * self.getTrMedDeptDoList[d].goodList[j].price;
                            }
                            self.getTrMedDeptDoList[d].amount = cooperativeCostSum;
                            cooperativeCostSum = 0;
                        }
                    } else {
                        layer.msg(response.data.message)
                    }
                })
            },
            //递归耗材包商品数据
            addTwoList: function (item, elems) {
                for (var i = 0; i < elems.length; i++) {
                    var elem = elems[i];
                    if (elem.parentpackageguid == item.goodsguid) {
                        if (item) {
                            item.goodList ? item.goodList.push(elem) : (item.goodList = [elem]);
                        }
                    }
                }
            },
            slideup2: function (index) {
                $('#warpd' + index).find(".row-launch").slideUp(400, function () {
                    $('#warpd' + index).removeClass('active');
                    $('#warpd' + index).find(".isFocus").removeClass("focus");
                })
            },
            slidedown2: function (index, guid, goodsguid) {
                this.search1.guid = guid;
                this.search1.purchasergoodsguid = goodsguid;
                this.search1.index = index;
                this.getparentpackagedetail();
            },
            slidedown3: function (index) {
                var cls = $("#warpd" + index).attr("class");
                if (cls.indexOf("active") != -1) {
                    this.slideup2(index);
                    return;
                }
                $('#warpd' + index).addClass("active");
                $('#warpd' + index).find(".row-launch").slideDown(400, function () {
                    $('#warpd' + index).find(".isFocus").addClass("focus active");
                })
            },
            slideup: function (index) {
                $('#warp' + index).find(".row-launch").slideUp(400, function () {
                    $('#warp' + index).removeClass('active');
                    $('#warp' + index).find(".isFocus").removeClass("focus");
                })
            },
            slidedown: function (index, guid) {
                var clss = $("#warp" + index).attr("class");
                if (clss.indexOf("active") != -1) {
                    this.slideup(index);
                    return;
                }
                this.gettrsupplierhvdodetail(index, guid);
                $('#warp' + index).addClass("active");
                $('#warp' + index).find(".row-launch").slideDown(400, function () {
                    $('#warp' + index).find(".isFocus").addClass("focus active");
                })
            },
            // (手风琴效果)大于10条
            getparentpackagedetail: function () {
                var self = this;
                Ajax.post('/cost/getparentpackagedetail', self.search1)
                    .then(function (response) {
                        var data = response.data.data;
                        self.$set('goodsList', data.list);
                        if (data.list.length >= 10) {
                            self.modelFlags = true;
                        } else {
                            self.slidedown3(self.search1.index);
                        }
                        self.search1.pageNo = data.pageNo;
                        self.search1.totalPages = data.totalPages;
                        self.search1.total = data.total;
                    });
            },
            //选择送货单 查询列表
            gettrsupplierhvdo: function () {
                var self = this;
                Ajax.post('/cost/gettrsupplierhvdo', self.search)
                    .then(function (response) {
                        var data = response.data.data;
                        if (response.data.errorCode == 0) {
                            self.$set('inVoiceList', data.list);
                            self.$set('backMessage.showDialog', 'Y');
                            self.search.pageNo = data.pageNo;
                            self.search.totalPages = data.totalPages;
                            self.search.total = data.total;
                        } else {
                            layer.msg(response.data.message)
                        }
                    })
            },
            // 品规格数目(手风琴效果)
            gettrsupplierhvdodetail: function (index, guid) {
                var self = this;
                var dpoObj = self.inVoiceList[index];
                if (dpoObj.search == null) {
                    // 设置每组的查询条件
                    dpoObj.search = {
                        pageSize: 5,
                        page: 1,
                        pageNo: 1,
                        totalPages: 0,
                        guid: guid
                    };
                }
                dpoObj.search.page = dpoObj.search.pageNo;
                Ajax.post('/cost/gettrsupplierhvdodetail', dpoObj.search)
                    .then(function (response) {
                        var data = response.data.data;
                        self.$set('inVoiceList[' + index + '].mxList', data.list);
                        dpoObj.search.pageNo = data.pageNo;
                        dpoObj.search.totalPages = data.totalPages;
                        dpoObj.search.total = data.total;
                        self.$set('inVoiceList[' + index + '].search', dpoObj.search);
                    });
            },
            //选择要货单
            gettrmedhvwvlist: function (guid) {
                var self = this;
                self.supplierdoguid = guid;
                self.getTrMedDeptDoList = [];
                var item = [];
                Ajax.post('/cost/gettrmedhvwv', {'supplierdoguid': guid}).then(function (response) {
                    var data = response.data.data;
                    if (response.data.errorCode == 0) {
                        self.$set('trmedplan.memo', data[0].memo)
                        self.$set('trmedplan.deptguid', data[0].medstoreguid)
                        self.getdeptstatelist(data[0].medstoreguid, true);
                        self.$set('trmedplan.mkstaffguid', data[0].mkstaffguid)
                        self.$set('trmedplan.medstaffname', data[0].mkstaffname)

                        data.forEach(function (value, index, arr) {
                            value.goodList = [];
                            if(self.getTrMedDeptDoList.length > 0){
                                for (var k = 0; k < self.getTrMedDeptDoList.length; k++) {
                                     if(self.getTrMedDeptDoList[k].billno + self.getTrMedDeptDoList[k].supplierguid + self.getTrMedDeptDoList[k].goodsguid == value.billno + value.supplierguid + value.goodsguid){
                                            layer.msg("数据已存在!");
                                            return;
                                    }
                                }
                            }
                            if (value.ispackage == 'N') {
                                self.getTrMedDeptDoList.push(value);
                                self.addTwoList(value, data);
                            }
                            console.log(self.getTrMedDeptDoList);
                            if (self.getTrMedDeptDoList.length > 0) {
                                self.trmedplan.billno = self.getTrMedDeptDoList[0].billno;
                                self.trmedplan.suppliername = self.getTrMedDeptDoList[0].suppliername;
                            }

                        });
                        for (var i = 0; i < data.length; i++) {
                            if (data[i].mvqty == 0 && data[i].rejectqty == 0) {
                                data[i].mvqty = data[i].arrivalqty;
                            } else {
                                data[i].mvqty = data[i].arrivalqty - data[i].rejectqty < 0 ? 0 : data[i].arrivalqty - data[i].rejectqty;
                                data[i].rejectqty = data[i].arrivalqty - data[i].rejectqty < 0 ? data[i].arrivalqty : data[i].rejectqty
                            }
                            /* var item = data[i];
                             item.goodList =[];
                             if(item.ispackage == 'N'){
                                 self.getTrMedDeptDoList.push(item);
                                 self.addTwoList(item,data);
                             }
                             self.trmedplan.billno =self.getTrMedDeptDoList[0].billno;
                             self.trmedplan.suppliername =self.getTrMedDeptDoList[0].suppliername;*/
                        }
                        self.$set('backMessage.showDialog', 'N');
                        self.inVoiceList = [];
                    } else {
                        layer.msg(response.data.message)
                    }
                })
            },
            //选择拒收 查询追溯码
            onModelShow: function (guid, rowno) {
                var self = this;
                self.guid = guid;
                self.rowno = rowno;
                Ajax.post('/cost/gettrsupplierdoascenddetail', {
                    'guid': guid,
                    'rowno': rowno
                }).then(function (response) {
                    var data = response.data.data;
                    if (response.data.errorCode == 0) {
                        self.$set('zsmsList', data);
                        self.modelFlag = true;
                    } else {
                        layer.msg(response.data.message)
                    }
                })
            },
            //修改追溯码
            updtrascendcode: function (guid, state) {
                var self = this;
                Ajax.post('/cost/updtrsupplierdoascenddetail', {
                    'guid': guid,
                    'state': state
                }).then(function (response) {
                    var data = response.data.data;
                    if (response.data.errorCode == 0) {
                        self.$set('zsmsList', data);
                    } else {
                        layer.msg(response.data.message)
                    }
                })
            },
            //批量修改追溯码
            updtrascendcodes: function (state) {
                var self = this;
                Ajax.post('/cost/updtrsupplierdoascenddetails', {
                    'medwvguid': self.guid,
                    'medwvrowno': self.rowno,
                    'state': state
                }).then(function (response) {
                    var data = response.data.data;
                    if (response.data.errorCode == 0) {
                        self.$set('zsmsList', data);
                    } else {
                        layer.msg(response.data.message)
                    }
                })
            },
            //批量修改追溯码 耗材包
            updparentpackage: function (index, guid, goodsguid, state, rowno) {
                var self = this;
                Ajax.post('/cost/updparentpackage', {
                    'guid': guid,
                    'parentpackageguid': goodsguid,
                    'state': state,
                    'rowno': rowno
                }).then(function (response) {
                    var data = response.data.data;
                    if (response.data.errorCode == 0) {
                        self.getDate();
                    } else {
                        layer.msg(response.data.message)
                    }
                })
            },
            //保存
            saveTrmedHvwvs: function (state) {
                var self = this;
                if (self.trmedplan.deptguid == '' || self.trmedplan.deptguid == null) {
                    layer.msg('请选择入库库房!')
                    return;
                }
                if (self.trmedplan.medstaffguid == '' || self.trmedplan.medstaffguid == null) {
                    layer.msg('请选择收货人!')
                    return;
                }
                if (self.getTrMedDeptDoList.length == 0) {
                    layer.msg('请选择商品!')
                    return;
                }
                var goodWvList = [];
                for (var i = 0; i < self.getTrMedDeptDoList.length; i++) {
                    var item = {
                        deptguid: self.trmedplan.deptguid,
                        deptname: self.trmedplan.deptname,
                        medstaffguid: self.trmedplan.medstaffguid,
                        medstaffname: self.trmedplan.medstaffname,
                        memo: self.trmedplan.memo,
                        guid: self.getTrMedDeptDoList[i].guid,
                        rowno: self.getTrMedDeptDoList[i].rowno,
                        goodscode: self.getTrMedDeptDoList[i].goodscode,
                        mvqty: self.getTrMedDeptDoList[i].mvqty,
                        rejectqty: self.getTrMedDeptDoList[i].rejectqty,
                        amount: self.getTrMedDeptDoList[i].amount,
                        supmvqty: self.getTrMedDeptDoList[i].supmvqty,
                        suprejectqty: self.getTrMedDeptDoList[i].suprejectqty,
                        rejectionpict: ''
                    }
                    goodWvList.push(item);
                    for (var j = 0; j < self.getTrMedDeptDoList[i].goodList.length; j++) {
                        var item = {
                            deptguid: self.trmedplan.deptguid,
                            deptname: self.trmedplan.deptname,
                            medstaffguid: self.trmedplan.medstaffguid,
                            medstaffname: self.trmedplan.medstaffname,
                            memo: self.trmedplan.memo,
                            guid: self.getTrMedDeptDoList[i].goodList[j].guid,
                            rowno: self.getTrMedDeptDoList[i].goodList[j].rowno,
                            goodscode: self.getTrMedDeptDoList[i].goodList[j].goodscode,
                            mvqty: self.getTrMedDeptDoList[i].goodList[j].mvqty,
                            rejectqty: self.getTrMedDeptDoList[i].goodList[j].rejectqty,
                            amount: self.getTrMedDeptDoList[i].goodList[j].amount,
                            supmvqty: self.getTrMedDeptDoList[i].goodList[j].supmvqty,
                            suprejectqty: self.getTrMedDeptDoList[i].goodList[j].suprejectqty,
                            rejectionpict: ''
                        }
                        goodWvList.push(item);
                    }
                }
                Ajax.post('/cost/saveTrmedhvwvs', {'list': goodWvList}).then(function (response) {
                    var data = response.data.data;
                    if (response.data.errorCode == 0) {
                        goodWvList = [];
                        layer.msg(response.data.message)
                    } else {
                        layer.msg(response.data.message)
                    }
                })
            },
            //提交
            subMittrmedHvwvs: function (state) {
                var self = this;
                if (self.trmedplan.deptguid == '' || self.trmedplan.deptguid == null) {
                    layer.msg('请选择入库库房!')
                    return;
                }
                if (self.trmedplan.medstaffguid == '' || self.trmedplan.medstaffguid == null) {
                    layer.msg('请选择收货人!')
                    return;
                }
                if (self.getTrMedDeptDoList.length == 0) {
                    layer.msg('请选择商品!')
                    return;
                }
                var goodWvList = [];
                for (var i = 0; i < self.getTrMedDeptDoList.length; i++) {
                    var item = {
                        deptguid: self.trmedplan.deptguid,
                        deptname: self.trmedplan.deptname,
                        medstaffguid: self.trmedplan.medstaffguid,
                        medstaffname: self.trmedplan.medstaffname,
                        memo: self.trmedplan.memo,
                        guid: self.getTrMedDeptDoList[i].guid,
                        rowno: self.getTrMedDeptDoList[i].rowno,
                        goodscode: self.getTrMedDeptDoList[i].goodscode,
                        mvqty: self.getTrMedDeptDoList[i].mvqty,
                        rejectqty: self.getTrMedDeptDoList[i].rejectqty,
                        amount: self.getTrMedDeptDoList[i].amount,
                        supmvqty: self.getTrMedDeptDoList[i].supmvqty,
                        suprejectqty: self.getTrMedDeptDoList[i].suprejectqty,
                        rejectionpict: ''
                    }
                    goodWvList.push(item);
                    for (var j = 0; j < self.getTrMedDeptDoList[i].goodList.length; j++) {
                        var item = {
                            deptguid: self.trmedplan.deptguid,
                            deptname: self.trmedplan.deptname,
                            medstaffguid: self.trmedplan.medstaffguid,
                            medstaffname: self.trmedplan.medstaffname,
                            memo: self.trmedplan.memo,
                            guid: self.getTrMedDeptDoList[i].goodList[j].guid,
                            rowno: self.getTrMedDeptDoList[i].goodList[j].rowno,
                            goodscode: self.getTrMedDeptDoList[i].goodList[j].goodscode,
                            mvqty: self.getTrMedDeptDoList[i].goodList[j].mvqty,
                            rejectqty: self.getTrMedDeptDoList[i].goodList[j].rejectqty,
                            amount: self.getTrMedDeptDoList[i].goodList[j].amount,
                            supmvqty: self.getTrMedDeptDoList[i].goodList[j].supmvqty,
                            suprejectqty: self.getTrMedDeptDoList[i].goodList[j].suprejectqty,
                            rejectionpict: ''
                        }
                        goodWvList.push(item);
                    }
                }
                if (!self.requestS){
                    self.requestS=true;
                Ajax.post('/cost/submittrmedhvwvs', {'list': goodWvList}).then(function (response) {
                    var data = response.data.data;
                    self.requestS=false;

                    if (response.data.errorCode == 0) {
                        goodWvList = [];
                        self.MessageBox({
                            title: '提示',
                            message: response.data.message,
                            type: 'alert'
                        }, function (action) {

                            window.sessionStorage.setItem('billno', self.trmedplan.billno);
                            self.$route.router.go('/cost/costPreAdmissionList');
                        });
                    } else {
                        layer.msg(response.data.message)
                    }
                })
                }

            },
            //库房
            getdeptlist: function () {
                var self = this;
                Ajax.post('/cost/getdeptlist', {}).then(function (response) {
                    var data = response.data.data;
                    if (response.data.errorCode == 0) {
                        self.$set('getdeptlists', data);
                    } else {
                        layer.msg(response.data.message)
                    }
                })
            },
            //收货人
            getdeptstatelist: function (guid, inte) {
                var self = this;
                for (var i = 0; i < self.getdeptlists.length; i++) {
                    if (guid == self.getdeptlists[i].guid) {
                        self.trmedplan.deptname = self.getdeptlists[i].hdeptname;
                    }
                }
                Ajax.post('/cost/getdeptstatelist', {'deptguid': guid}).then(function (response) {
                    var data = response.data.data;
                    if (response.data.errorCode == 0) {
                        self.$set('storeList', data);
                        if (inte) {
                            self.$set('trmedplan.medstaffguid', self.trmedplan.mkstaffguid)
                        }
                    } else {
                        layer.msg(response.data.message)
                    }
                })
            },
            getrealname: function (guid) {
                var self = this;
                for (var i = 0; i < self.storeList.length; i++) {
                    if (guid == self.storeList[i].guid) {
                        self.trmedplan.medstaffname = self.storeList[i].realname;
                    }
                }
            },


        },
        route: {
            activate: function () {
                // this.getDate();
                this.getdeptlist();
            }
        },
        ready: function () {
            var self = this;
            $("#cc0").focus();
        }
    };
</script>