cert-price.vue 44.1 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
<template>
    <div>
        <div class="container resource close-left-menu contaNEW">
            <div class="pop-banner clearfix">
                <div class="operate-btns">
                    <a href="javascript:void(0)" v-if="'/supplier/price:modify' | myqx !canModify" style="color:#DCDCDC" class="fbtn fb-modify">修改</a>
                    <a href="javascript:void(0)" @click="modifyInfo" v-if="'/supplier/price:modify' | myqx canModify" class="fbtn fb-modify">修改</a>
                    <a href="javascript:void(0)" v:disabled="false" v-if="'/supplier/price:deletePricePO' | myqx !canDelete"  style="color:#DCDCDC" class="fbtn fb-add">添加</a>
                    <a href="javascript:void(0)" v-if="'/supplier/price:deletePricePO' | myqx canDelete" @click="addPrice" class="fbtn fb-add">添加</a>
                    <a href="javascript:void(0)" v:disabled="false" v-if="'/supplier/price:saveOrUpdatePricePO' | myqx !canSave"  style="color:#DCDCDC"  class="fbtn fb-save">保存</a>
                    <a href="javascript:void(0)" v-if="'/supplier/price:saveOrUpdatePricePO' | myqx canSave" @click="savePrice" class="fbtn fb-save">保存</a>
                     <a v-if="countTrs==0" v:disabled="false" style="color:#DCDCDC" href="javascript:void(0)" class="fbtn fb-book">业务资料</a>
                    <a href="javascript:void(0)" v-if="countTrs>0" class="fbtn fb-book" v-link="{path:'/certPrice2/'+curPricepoGuid}">业务资料</a>
                </div>
                <h3 class="current-module">维护物价信息</h3>
            </div>
            <div class="pd-form">
                <div class="group-row">
                    <div class="form-group form-label">
                        <label for="cn1" class="label">商品名称</label> 
                        <div class="control ">
                            <input type="text" id="cn1" @click="setTrue" v-model="goodsnameLis" class="inp4" v-if="cs1">
                            <input type="text" id="cn1"  v-model="goodsnameLis" class="inp4"  v-if="!cs1" readonly="readonly">
                            <div class="select-template" id="searchMore" style="display:none;">
                                <div class="div-select before-none" style="width:100%;">
                                  <ul  style="z-index:999;top:0px;width:100%;">
                                    <li class="div-select-item pl10" v-for="goods in listGoods">
                                        <span style="width:100%;" @click="chooseGoods(goods)">{{goods.goodsname}}</span>
                                    </li>
                                    <li class="div-select-item pl10" v-if="listGoods.length==0">
                                        <span style="width:100%;" v-if="isShowTips">未查询到结果!</span>
                                        <span style="width:100%;">&nbsp;</span>
                                        <span style="width:100%;">&nbsp;</span>
                                    </li>
                                  </ul> 
                              </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cn2" class="label">注册证号</label>
                        <div class="control">
                            <input type="text" id="cn2" v-model="pricepo.registkey" readonly class="inp4">
                        </div>
                    </div>
                </div>
                <div class="group-row group-row-3">
                    <div class="form-group form-label">
                        <label for="cn3" class="label">规格</label>
                        <div class="control">
                            <input type="text" id="cn3" v-model="pricepo.goodsspec" readonly class="inp2"></div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cn6" class="label">单位</label>
                        <div class="control">
                            <input type="text" id="cn6" v-model="pricepo.unitstyle" readonly class="inp2"></div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cn4" class="label">大包装数量</label>
                        <div class="control">
                            <input type="text" id="cn4" v-model="pricepo.bigunitqty" readonly class="inp5"></div>
                    </div>
                </div>
                <div class="group-row">
                    <div class="form-group form-label">
                        <label for="cn5" class="label">生产厂家</label>
                        <div class="control">
                            <input type="text" v-model="pricepo.producer" readonly id="cn5" class="inp4"></div>
                    </div>
                </div> 
            </div>



            <div class="pri-form no-border mt-0">
                
                <div class="fheader mb-20">
                  <h4 class="fh-query">物价</h4>
                  <span class="form-tips fr">*为必填项</span>
                </div>
                <!-- <div class="pf-head border-bottom-blue2">物价<span class="form-tips">*为必填项</span></div> -->
                <div class="pf-edit pd0">
                 <!--    <div class="pf-item">
                        <label class="label">物价类型</label>
                        <div class="control">
                            <select-ui  :list="pricetypeList" :selected.sync="pricepo.pricetype" empty-text="请选择物价类型" style="width: 100%;height: 30px;border: 1px solid rgba(96,111,122,.2);">
                            </select-ui>
                        </div>
                    </div> -->
                    <div class="pf-item w310 require-item form-label mt-20  mb-0">
                        <label class="label" for='cn16'>物价类型</label>
                        <div class="control w310 ml-0">
                             <select-ui  :list="pricetypeList" :selected.sync="pricepo.pricetype" v-if="cs1" empty-text="请选择物价类型" style="width: 100%;border: 1px solid rgba(96,111,122,.2);" class='inp4' id='cn16'>
                            </select-ui>
                            <select-ui  :list="pricetypeList" :selected.sync="pricepo.pricetype" v-if="!cs1"  readonly="readonly"  empty-text="请选择物价类型" style="width: 100%;border: 1px solid rgba(96,111,122,.2);" class='inp4' id='cn16'>
                            </select-ui>
                        </div>
                    </div>
             <!--        <div class="pf-item w504 ml-0">
                        <label class="label">招标地区</label>
                        <div class="control">
                            <city-long :province.sync="pricepo.province"
                                  :city.sync="pricepo.city"
                                  :area.sync="pricepo.district"
                                  ></city-long>
                        </div>
                    </div> -->
                    <div class="pf-item w310 require-item w655 ml-35 mt-10  mb-0">
                        <label class="label lable-xf pl10 lh-34" for='cn7'>招标地区</label>
                        <div class="control w655 ml-0">
                            <city-long :province.sync="pricepo.province"
                                  :city.sync="pricepo.city"
                                  :area.sync="pricepo.district"
                                  v-if="cs1"
                                  styles='width:655px;' id='cn7'></city-long>
                                  <city-long :province.sync="pricepo.province"
                                      :city.sync="pricepo.city"
                                      :area.sync="pricepo.district"
                                      v-if="!cs1"
                                       disabled="disabled" styles='width:655px;'
                                      ></city-long>  
                        </div>
                    </div>
              <!--       <div class="pf-item ml-0">
                        <label class="label">医疗机构</label>
                        <div class="control">
                            <select-ui  :list="selHospital" :selected.sync="pricepo.purchasemedguid" empty-text="请选择医疗机构" style="width: 100%;height: 30px;border: 1px solid rgba(96,111,122,.2);">
                            </select-ui>
                        </div>
                    </div> -->
                    <div class="pf-item w310 ml-0 form-label  mb-0">
                        <label class="label pl0 lh-34" for='cn8'>医疗机构</label>
                        <div class="control w310 ml-0">
                             <select-ui  :list="selHospital" :selected.sync="pricepo.purchasemedguid" v-if="cs1" empty-text="请选择医疗机构" style="width: 100%;height: 34px;border: 1px solid rgba(96,111,122,.2);" class='inp4' id='cn8'>
                            </select-ui>
                            <select-ui  :list="selHospital" :selected.sync="pricepo.purchasemedguid" v-if="!cs1" disabled="disabled" empty-text="请选择医疗机构" style="width: 100%;height: 34px;border: 1px solid rgba(96,111,122,.2);" class='inp4' id='cn8'>
                            </select-ui>
                        </div>
                    </div>
                  <!--   <div class="pf-item require-item ml-0">
                        <label class="label">价格</label>
                        <div class="control">
                            <input type="text" v-model="pricepo.price"></div>
                    </div> -->
                    <div class="pf-item w310 ml-35 form-label  mb-0">
                        <label class="label lh-34" for='cn9'>价格</label>
                        <div class="control w310 ml-0">
                            <input type="text" v-model="pricepo.price" v-if="cs1" class="inp2" id='cn9'>
                            <input type="text" v-model="pricepo.price" v-if="!cs1" readonly="readonly" class="inp2" id='cn9'>
                        </div>
                    </div>
                    <!-- <div class="pf-item require-item ml-0">
                        <label class="label">包装单位</label>
                        <div class="control">
                            <input type="text" v-model="pricepo.unit"></div>
                    </div> -->
                    
                    <div class="pf-item w310 require-item ml-35  mb-0">
                        <label class="label lable-xf pl5 lh-34" for='cn10'>包装单位</label>
                        <div class="control w310 ml-0">
                            <input type="text" class="pl75" v-if="cs1" v-model="pricepo.unit" id='cn10'>
                            <input type="text" class="pl75" v-if="!cs1" readonly="readonly" v-model="pricepo.unit" id='cn10'>
                        </div>
                    </div>
                    <div class="pf-item w310 ml-0  mb-0">
                        <label class="label lable-xf pl5 lh-34" for='cn11'>医保编号</label>
                        <div class="control w310 ml-0">
                            <input type="text" class="pl75" value="YK0002" v-if="cs1" v-model="pricepo.hinumber" id='cn11'>
                            <input type="text" class="pl75" value="YK0002" v-if="!cs1" readonly="readonly" v-model="pricepo.hinumber" id='cn11'>
                        </div>
                    </div>
            <!--         <div class="pf-item ml-0">
                        <label class="label">招标时间</label>
                        <div class="control">
                            <datepicker :target.sync="pricepo.tenderdatetime | getYMD"></datepicker></div>
                    </div> -->
                    <div class="pf-item w310 ml-35 form-label  mb-0">
                        <label class="label lh-34" for='cn12'>招标时间</label>
                        <div class="control w310 ml-0">
                            <datepicker :target.sync="pricepo.tenderdatetime | getYMD" v-if="cs1" inpclass='inp4 h-34' id='cn12'></datepicker>
                            <datepicker :target.sync="pricepo.tenderdatetime | getYMD"  v-if="!cs1" readonly="readonly" :disabled="true" inpclass='inp4 h-34' id='cn12'></datepicker>
                        </div>
                            <!-- <input type="text" class="pl75" value="2015-10-16"> -->
                        </div>
                    
                     <!-- <div class="pf-item ml-0">
                        <label class="label">价格有效期</label>
                        <div class="control">
                             <datepicker :target.sync="pricepo.enddate | getYMD"></datepicker></div>
                    </div> -->
                    <div class="pf-item w310 mt-10 ml-35 form-label mb-0">
                        <label class="label" for='cn13'>价格有效期</label>
                        <div class="control w310 ml-0">
                            <datepicker :target.sync="pricepo.enddate | getYMD" v-if="cs1" inpclass='inp5 h-34' id='cn13'></datepicker>
                            <datepicker :target.sync="pricepo.enddate | getYMD"  v-if="!cs1" readonly="readonly" :disabled="true" inpclass='inp5 h-34' id='cn13'></datepicker>
                            <!-- <input type="text" class="pl95"> -->
                        </div>
                    </div>

                 <!--    <div class="pf-item ml-0">
                        <label class="label"></label>
                        <div class="control">
                            <input type="text" v-model="pricepo.year"></div>
                    </div> -->
                   
                    <div class="pf-item w310 ml-0 mt-10 mb-0">
                        <div class="control w310 ml-0 fl">
                            <input type="text" class="pr30 t-right" v-model="pricepo.year" id='cn14' v-if="cs1">
                            <input type="text" class="pr30 t-right" v-model="pricepo.year" id='cn14' v-if="!cs1" readonly="readonly">
                        </div>
                        <label class="lh-34 fr lable-right-xf text-color-gray2" for='cn14'></label> 
                    </div>
                     <!-- <div class="pf-item ml-0">
                        <label class="label"></label>
                        <div class="control">
                            <input type="text" v-model="pricepo.issue"></div>
                    </div> -->
                    <div class="pf-item w310 mt-10 ml-35 mb-0">
                        <div class="control w310 ml-0 fl">
                            <input type="text" class="pr30 t-right"  v-model="pricepo.issue" id='cn15' v-if="cs1">
                            <input type="text" class="pr30 t-right"  v-model="pricepo.issue" id='cn15' v-if="!cs1" readonly="readonly">
                        </div>
                        <label class="lh-34 fr lable-right-xf text-color-gray2" for='cn15'></label> 
                    </div>
                 <!--     <div class="pf-item ml-0">
                        <label class="label"></label>
                        <div class="control">
                            <input type="text" v-model="pricepo.page"></div>
                    </div> -->
                    
                    <div class="pf-item w310 mt-10 ml-35 mb-0"> 
                        <div class="control w310 ml-0 fl">
                            <input type="text" class="pr30 t-right" v-model="pricepo.page" id='cn17' v-if="cs1">
                            <input type="text" class="pr30 t-right" v-model="pricepo.page" id='cn17' v-if="!cs1" readonly="readonly">
                        </div>
                        <label class="lh-34 fr lable-right-xf text-color-gray2" for='cn17'></label> 
                    </div> 
                   <!--  <div class="pf-item ml-0">
                        <label class="label">备注</label>
                        <div class="control">
                            <textarea class="w504" rows="2" v-model="pricepo.memo"></textarea>
                        </div>
                    </div> -->
                    <div class="pf-item w1003 ml-0 mt-10">
                        <label for="cn10" class="label lable-xf pl10" for='cn18'>备注</label>
                        <div class="control ml-0 w1003">
                          <textarea id="cn10" rows="2" class="pl45" v-model="pricepo.memo" id='cn18' v-if="cs1"></textarea>
                          <textarea id="cn10" rows="2" class="pl45" v-model="pricepo.memo" id='cn18' v-if="!cs1" readonly="readonly"></textarea>
                        </div>
                    </div>
                    </div>
                    <div class="price-pics-list">
                   <!--      <div class="price-pic">
                            物价表封面
                            
                            <div class="pic-box" v-if="!show0"  v-if="uploads0.length>0" :style="{backgroundImage:'url('+(uploads0.length>
                              0?uploads0[0].path:'')+')'}">
                              <span class="rm-pic" v-if="cs1" @click="modifyPic(0)">修改照片</span>

                                <imagebox v-bind:imgarr="uploads0[0].pic | original" >
                                    <div class="big-imgs"  style="top:260px;left:195px;z-index: 99;">
                                    </div>
                                </imagebox>


                            </div>
                        </div> -->
                        <div class="price-pic ml-210">
                            物价表封面
                            <uploads v-bind:class="['h-255 w180 fr mb-15']" 
                                style="float:right;background: url(../images/default-one.png) 50% 50% no-repeat;background-size: 80px;" 
                                v-if="show0"
                                :display="'block'"  
                                v-on:file-change="fileChange0" 
                                v-bind:multiple="false" 
                                v-bind:readonly="picReadonly">
                                <!-- <span>选择照片</span>               -->
                            </uploads>
                    
                            <div class="h-255 w180 fr mb-15" v-if="!show0"  v-if="uploads0.length>0" :style="{backgroundImage:'url('+(uploads0.length>
                              0?uploads0[0].path:'')+')'}">
                              <!-- <span class="rm-pic" v-if="cs1" @click="modifyPic(0)">修改照片</span> -->

                               <!--  <imagebox v-bind:imgarr="uploads0[0].pic | original" >
                                    <div class="big-imgs"  style="top:260px;left:195px;z-index: 99;">
                                    </div>
                                </imagebox> -->

                            </div>
                            <!-- <div class="h-255 w180 fr mb-15" style="background-image: url(../assets/c23.jpg)"></div><br> -->
                            <div class="license-btn w180 ml-84">
                                <span class="fbtn modify-btn" title="修改" style="width:90px;padding:5px 38px;" @click="modifyPic(0)"><i>|</i></span>
                                 <imagebox v-bind:imgarr="uploads0[0].pic | original" >
                                    <span class="fbtn magnify-btn" title="放大" style="width:89px;padding:5px 7px;padding-left:38px;"></span>
                                </imagebox>
                                
                            </div>
                        </div>
                   <!--       <div class="price-pic">
                            物价表内页 -->
                           <!--  <uploads v-bind:class="['pic-box']" 
                                style="float:right;" 
                                :display="'block'" 
                                v-if="show1"
                                v-on:file-change="fileChange1" 
                                v-bind:multiple="false" 
                                v-bind:readonly="readonly">
                                <span>选择照片</span>              
                            </uploads> -->
                             <!--  <div class="pic-box" v-if="!show1" v-if="uploads1.length>0" :style="{backgroundImage:'url('+(uploads1.length>
                                  0?uploads1[0].path:'')+')'}">
                                  <span class="rm-pic" v-if="cs1" @click="modifyPic(1)">修改照片</span>

                                  <imagebox v-bind:imgarr="uploads1[0].pic | original" >
                                     <div class="big-imgs"  style="top:260px;left:195px;z-index: 99;">
                                     </div>
                                  </imagebox>

                             </div> -->
<!--                         </div> -->
                        <div class="price-pic ml-40">
                            物价表内页
                            <uploads v-bind:class="['h-255 w180 fr mb-15']" 
                                style="float:right;background: url(../images/default-one.png) 50% 50% no-repeat;background-size: 80px;" 
                                :display="'block'" 
                                v-if="show1"
                                v-on:file-change="fileChange1" 
                                v-bind:multiple="false" 
                                v-bind:readonly="picReadonly">
                                <!-- <span>选择照片</span>               -->
                            </uploads>
                            <div class="h-255 w180 fr mb-15" v-if="!show1" v-if="uploads1.length>0" :style="{backgroundImage:'url('+(uploads1.length>
                                  0?uploads1[0].path:'')+')'}">
                             </div>
                            <!-- <div class="h-255 w180 fr mb-15" style="background-image: url(../assets/c23.jpg)"></div><br> -->
                            <div class="license-btn w180 ml-84">
                                <span class="fbtn modify-btn" title="修改" style="width:90px;padding:5px 38px;"@click="modifyPic(1)"><i>|</i></span>
                                <imagebox v-bind:imgarr="uploads1[0].pic | original" widthnum='width:49%;'>
                                   <span class="fbtn magnify-btn" title="放大" style="width:89px;padding:5px 7px;padding-left:38px;"></span>
                                </imagebox>
                                
                            </div>
                        </div>
                    </div>
            </div>
            <div class="m-20-0">
                <span class="text-color-green">全选</span>
                <div class="checkbox-control checkbox-green checkbox-alone mr-10">
                    <input type="checkbox" v-model="selAllPrice" name="cb" id="selAll">
                    <label class="checkbox" for="selAll"></label>
                </div>
                <a href="javascript:;" class="btn button-red fr"@click="deletePrice">删除</a>
                <!-- <button class="btn-d btn-d-lg btn-d-activate btn-icon-remove " @click="deletePrice">删除</button> -->
            </div>
            <table class="itable itable-thead-13px">
                <thead>
                    <tr>
                        <th class="w30">选择</th>
                        <th class="w60">序号</th>
                        <th class="w100">物价类型</th>
                        <th class="w70">地区</th>
                        <th class="w70">包装单位</th>
                        <th class="w120">医疗机构</th>
                        <th class="w60">价格</th>
                        <th class="w50"></th>
                        <th class="w60"></th>
                        <th class="w60"></th>
                        <th class="w100">医保编号</th>
                        <th class="w60">照片</th>
                    </tr>
                </thead>
                <tbody class="txt_v">
                    <tr v-for="price in listPrices" @click="modifyPO(price)">
                        <td>
                            <div class="checkbox-control checkbox-alone">
                                <input type="checkbox" v-model="checkPrice" value="{{price.guid}}" name="cb" id="cb{{$index}}">
                                <label class="checkbox" for="cb{{$index}}"></label>
                            </div>
                        </td>
                        <td>{{$index+1}}</td>
                        <td class="t-left">{{price.pricetype | pricetype}}</td>
                        <td class="t-left">{{price.province}}</td>
                        <td class="t-left">{{price.unit}}</td>
                        <td class="t-left">{{price.purchasemedname}}</td>
                        <td class="t-right pr10">{{price.price}}</td>
                        <td class="t-right pr10">{{price.year}}</td>
                        <td class="t-right pr10">{{price.issue}}</td>
                        <td class="t-right pr10">{{price.page}}</td>
                        <td class="t-left">{{price.hinumber}}</td>
                        <td> 
                            <imagebox v-bind:imgarr="price.coverpictcontent | original" v-if="price.coverpictcontent!=null">
                             <!--    <span class="pic-max blue-search">
                                    <div class="big-imgs" style="top:60px;left:0px;z-index: 99;">
                                    </div>
                                    <img class="yb-img" :src="price.coverpictcontent | original">
                                </span> -->
                            </imagebox>
                            <img src="/images/default.jpg" class="yb-img" v-if="price.coverpictcontent==null">
                        </td>
                    </tr>
                    <tr v-if="listPrices.length==0">
                        <td colspan="99">
                           未查询相关数据!
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="pagination m-20-0">
                <pagination 
                   @page-change="listPricesData" 
                   :page-no.sync="searchPrices.page" 
                   :total-pages.sync="searchPrices.totalPages"></pagination>
            </div>
        </div>
    </div>
</template>
<script>
  
  module.exports = {
    data: function () {
      return {
            picReadonly:0,
            countTr:0,
            canModify:false,
            countTrs:0,
            cs1:false,
            isShowTips:true,
            trVO:{
               sdguid:'',
               variationtype:'V13',
            },
            fileType:'image',
            tagType:'div',
            fileLabel:'上传',
            pricetypeList :[{
                 value: '1',
                 label: '政府招标价'
            }, {
                 value: '2',
                 label: '医疗机构招标价'
            }, {
                 value: '3',
                 label: '医疗机构采购价' 
            }],
            pricepo:{},
            pricepo_bak:{},
            goodsnameLis:'',
            listGoods:[],
            search: {
              pageSize: 10,
              page: 1,
              totalPages: 0,
              total:0,
              param:{
                goodsname:'',
              },
            },
            listPrices:[],
            searchPrices: {
              pageSize: 5,
              page: 1,
              totalPages: 0,
              total:0,
              search_EQ_goodsguid:'',
            },
            uploads0:[],
            show0:true,
            uploads1:[],
            show1:true,
            picJson:'',
            canSave:false,
            canDelete:false,
            goOnSearch:true,
            selAllPrice:false,
            checkPrice:[],
            hospitals:[],
            searchHospital:{
               pageSize: 99999,
               page: 1,
               totalPages: 0,
               total:0,
               pricePage:'yes',
            },
            selHospital:[],
            curPricepoGuid:'',
        };
    },
    methods: {
      getData: function () {
        var self = this;
        if (this.$route.params.guid != '0') {
          Ajax.get('/supplierProductLic/Price/' + this.$route.params.guid)
            .then(function (response) {
                self.$set('pricepo', response.data.data);
                self.$set('pricepo_bak', response.data.data);
                self.canSave=false;
                self.canDelete=false;
                if(self.pricepo.pricetype==null){
                    self.pricepo.pricetype='';
                    self.pricepo.guid=null;
                }
                if(self.pricepo.purchasemedguid==null){
                    self.pricepo.purchasemedguid='';
                }
                self.goodsnameLis=self.pricepo.goodsname;
                self.goOnSearch=false;
                self.listPricesData();
            });
        } else {
          self.pricepo = {};
          self.listGoods=[];
          self.listPrices=[];
          self.goodsnameLis='';
          self.pricepo.pricetype='';
          self.pricepo.purchasemedguid='';
          //self.canSave=true;
          //self.canAdd=true;
          self.show0=true;
          self.show1=true;
        }
      },
      listPricesData: function () {
        var self = this;
        self.searchPrices.search_EQ_goodsguid=this.$route.params.guid;
        Ajax.get('/supplierProductLic/PriceByPage',self.searchPrices)
            .then(function (response) {
            var data=response.data.data;
            self.$set('listPrices', data.list);
            self.searchPrices.totalPages = data.totalPages;
            self.searchPrices.total = data.total;
            if(self.listPrices.length>0){
                //默认展示第一个
                self.modifyPO(self.listPrices[0]);
            }
        });
      },
      //查询医院信息
      listHospitalData: function () {
        var self = this;
        Ajax.get('/relation/hospital',self.searchHospital)
          .then(function (response) {
            var data = response.data.data;
            self.$set('hospitals', data.list);
            self.selHospital=_.map(self.hospitals,function(item){
                return{
                    label:item.name,
                    value:item.guid
                }
            });
        });
      },
      chooseGoods:function(g){
        var self=this;
        self.pricepo = {};
        self.goOnSearch = false;
        self.goodsnameLis = g.goodsname;
        self.pricepo.goodsguid = g.guid;
        self.pricepo.goodsname = g.goodsname;
        self.pricepo.goodsspec = g.goodsspec;
        self.pricepo.registkey = g.registkey;
        self.pricepo.producer = g.producer;
        self.pricepo.unitstyle = g.unitstyle;
        self.pricepo.bigunitqty = g.bigunitqty;
        $("#searchMore").css("display","none");
      },
      setTrue:function(){
         this.goOnSearch=true;
      },
      modifyPO:function(price){
         var self=this, imgReg = /\.(jpg|jpeg|png|gif|bmp)$/i; //判断字符串是否为图片路径;
         this.$set('pricepo', price);
         var g=self.pricepo_bak;
         self.pricepo.goodsguid = g.goodsguid;
         self.pricepo.goodsname = g.goodsname;
         self.pricepo.goodsspec = g.goodsspec;
         self.pricepo.registkey = g.registkey;
         self.pricepo.producer = g.producer;
         self.pricepo.unitstyle = g.unitstyle;
         self.pricepo.bigunitqty = g.bigunitqty;
         if(self.pricepo.purchasemedguid==null){
            self.pricepo.purchasemedguid='';
         }
         //物价表封面
         if(self.pricepo.coverpictcontent!=null){
              var picsStr=self.pricepo.coverpictcontent;
              var objPic=JSON.parse(picsStr);
              for(var i=0;i<objPic.length;i++){
                var path=imgReg.test(objPic[i].thumbnail.path) ? objPic[i].thumbnail.path : objPic[i].thumbnail.path+objPic[i].thumbnail.name;
                var json='{"path":"'+path+'"}';
                var obj=JSON.parse(json);
                obj.pic=JSON.stringify(objPic);
                self.uploads0.push(obj);
              }
              self.show0=false; 
          }else{
            self.uploads0=[];
            self.show0=true; 
          }
          //物价表内页
          if(self.pricepo.inpictcontent!=null){
              var picsStr=self.pricepo.inpictcontent
              var objPic=JSON.parse(picsStr);
              for(var i=0;i<objPic.length;i++){
                var path=imgReg.test(objPic[i].thumbnail.path) ? objPic[i].thumbnail.path : objPic[i].thumbnail.path+objPic[i].thumbnail.name;
                var json='{"path":"'+path+'"}';
                var obj=JSON.parse(json);
                obj.pic=JSON.stringify(objPic);
                self.uploads1.push(obj);
             } 
             self.show1=false; 
          }else{
            self.uploads1=[];
            self.show1=true; 
          }
          //是否有变更单
          self.curPricepoGuid=price.guid;
          self.existTr();
      },   
      savePrice: function () {
        var self = this;
        if(!self.pricepo.pricetype){ 
          self.MessageBox({title:'提示',message:'请输入物价类型!',type:'alert'
             },function(action){
              self.canSave =true; 
             });  
        }
        if(!self.pricepo.province){ 
          self.MessageBox({title:'提示',message:'请输入省!',type:'alert'
             },function(action){
              self.canSave =true; 
             });  
        }
        if(!self.pricepo.city){ 
          self.MessageBox({title:'提示',message:'请输入市!',type:'alert'
             },function(action){
              self.canSave =true; 
             });  
        }
        if(!self.pricepo.district){ 
          self.MessageBox({title:'提示',message:'请输入区!',type:'alert'
             },function(action){
              self.canSave =true; 
             });  
        }
        if(self.uploads0.length>0){
          self.pricepo.coverpictcontent=self.uploads0[0].pic;
        }
        if(self.uploads1.length>0){
          self.pricepo.inpictcontent=self.uploads1[0].pic;
        }
        if(self.pricepo.pricetype=='' || self.pricepo.pricetype==null){

            layer.msg('请选择物价类型!');
            return;
        }
        if(self.pricepo.province==null || self.pricepo.city==null  || self.pricepo.district==null){
            layer.msg('招标地区不能为空!');

            return;
        }
        if(self.pricepo.price=='' || self.pricepo.price==null){
            layer.msg('价格不能为空!');
            return;
        }
        if(self.pricepo.unit=='' || self.pricepo.unit==null){
            layer.msg('包装单位不能为空!');
            return;
        }
        if(self.selHospital.length>0){
            for(var i=0;i<self.selHospital.length;i++){
                var hps=self.selHospital[i];
                if(self.pricepo.purchasemedguid==hps.value){
                    self.pricepo.purchasemedname=hps.label;
                } 
            }
        }
        if(self.pricepo.purchasemedguid != null || self.pricepo.purchasemedguid != ''){ 
            console.log(self.selHospital);
            for (var i = 0; i < self.selHospital.length; i++) {
                 if(self.selHospital[i].value == self.pricepo.purchasemedguid){
                    var medName =  self.selHospital[i].label;
                 }
            }
        self.MessageBox({
                    title: '提示',
                    message: '保存之后将直接生成【' + medName + '】医院的专属资料,确认保存?',
                    type: 'alert',
                    showCancelButton: true
                }, function(action) {
                    if(action == 'cancel') { 

                    } else {
                                     Ajax.post('/supplierProductLic/Price/save', self.pricepo)
                                      .then(function (response) {
                                         if(response.data.errorCode==0){
                                            self.MessageBox({title:'提示',message:'保存成功!',type:'alert'
                                            },function(action){
                                                window.location.reload();
                                                   //跳转
                                                  self.$router.go({
                                                    path: '/cert/certPriceList'
                                                  });
                                            }); 
                                         }else{
                                             layer.msg('保存失败!');
                                         }
                                      }); 
                                }
                         }); 
                }else{
                         Ajax.post('/supplierProductLic/Price/save', self.pricepo)
                                          .then(function (response) {
                                             if(response.data.errorCode==0){
                                                self.MessageBox({title:'提示',message:'保存成功!',type:'alert'
                                                },function(action){
                                                    window.location.reload();
                                                       //跳转
                                                      self.$router.go({
                                                        path: '/cert/certPriceList'
                                                      }); 
                                                }); 
                                             }else{
                                                 layer.msg('保存失败!');
                                             }
                                          });  
                    }
       
      }, 
      deletePrice: function () {
        var self = this;
        if(self.checkPrice.length>0){
            var guids="";
            for(var i=0;i<self.checkPrice.length;i++){
                if(self.checkPrice.length==(i+1)){
                    guids+="'"+self.checkPrice[i]+"'";
                }else{
                    guids+="'"+self.checkPrice[i]+"',";
                }
            }
            self.pricepo.guid=guids;
        }else{
            layer.msg('请选择要删除的数据!');


            return;
        }
        Ajax.get('/supplierProductLic/Price/delete/' + self.pricepo.guid)
          .then(function (response) {
            if(response.data.errorCode==0){
                self.MessageBox({title:'提示',message:'删除成功!',type:'alert'
                },function(action){
                    self.listPricesData();
                }); 
             }else{
                layer.msg('删除失败!');
             }
        });
      },
      listGoodsByGoodsName:function(goodsname){
        var self = this;
        self.isShowTips=false;
        self.search.param.goodsname=goodsname;
        Ajax.post('/supplierGood', self.search)
          .then(function (response) {
            var data = response.data.data;
            self.$set('listGoods', data.list);
            if(self.listGoods.length==0){
                self.isShowTips=true;
            }
            self.search.totalPages = data.totalPages;
            self.search.total = data.total;
        });
      },
      // 特价表封面
      fileChange0:function(data){
        var backObj=JSON.parse(data), imgReg = /\.(jpg|jpeg|png|gif|bmp)$/i; //判断字符串是否为图片路径;
        this.uploads0=[];
        data=backObj.data;
        for(var i=0;i<data.length;i++){
          var path=imgReg.test(data[i].thumbnail.path) ? data[i].thumbnail.path : data[i].thumbnail.path+data[i].thumbnail.name;
          var json='{"path":"'+path+'"}';
          var obj=JSON.parse(json);
          obj.pic="["+JSON.stringify(data[i])+"]";
          this.uploads0.push(obj);
          this.show0=false;
        }
      },
      // 特价表内页
      fileChange1:function(data){
        var backObj=JSON.parse(data), imgReg = /\.(jpg|jpeg|png|gif|bmp)$/i; //判断字符串是否为图片路径;
        this.uploads1=[];
        data=backObj.data;
        for(var i=0;i<data.length;i++){
          var path=imgReg.test(data[i].thumbnail.path) ? data[i].thumbnail.path : data[i].thumbnail.path+data[i].thumbnail.name;
          var json='{"path":"'+path+'"}';
          var obj=JSON.parse(json);
          obj.pic="["+JSON.stringify(data[i])+"]";
          this.uploads1.push(obj);
          this.show1=false;
        }
      },
      addPrice:function(){
        var self=this;
        self.pricepo.pricetype='';
        self.pricepo.purchasemedname='';
        self.pricepo.price='';
        self.pricepo.issue='';
        self.pricepo.year='';
        self.pricepo.page='';
        self.pricepo.hinumber='';
        self.pricepo.unit='';
        self.pricepo.memo='';
        self.pricepo.tenderdatetime='';
        self.pricepo.enddate='';
        self.pricepo.province='';
        self.pricepo.city='';
        self.pricepo.district='';
        self.pricepo.guid=null;
        self.pricepo.coverpictcontent=null;
        self.pricepo.inpictcontent=null;
        self.uploads0=[];
        self.uploads1=[];
        self.show0=true;
        self.show1=true;
      },
      modifyPic: function(type){
        if(type==0){
            this.show0=true;
        }else{
            this.show1=true;
        }
      },
      deleteimg:function(index){
          this.uploads.splice(index,1);  
      },
      modifyInfo:function(){
          var self = this;
          if(self.countTr>0){
              layer.msg('该物价信息已有变更单,您可以进入【业务资料】修改并且提交审核!');
            return;
          }
          this.cs1=true;
          this.canSave=true;
          this.canDelete=true;
          this.picReadonly = 1;
      },
      existTr:function(){
        var self=this;
        self.trVO.guid=self.curPricepoGuid;
          Ajax.post('/businessData/isExistExc',self.trVO)
              .then(function(response){
                  if(response.data.data==0){
                      self.countTrs=0;
                      Ajax.post('/businessData/existTrvariation',{
                          guid:self.listPrices[0].supplierguid,
                          variationtype: self.trVO.variationtype,
                          sdguid:self.trVO.guid
                      })
                          .then(function(response){
                              if(!response.data.data || response.data.data == 'R'){
                                self.countTr=0;
                                self.canModify = true;
                              }else {
                                self.countTr=0;
                                self.canModify = false;
                                self.editMsg='该物价信息正在审核中,审核通过后请前往业务资料中修改。'
                              }
                          });
                  }else {
                      self.countTr=0;
                      self.countTrs=1;
                      self.canModify = false;//不能改
                      self.editMsg='该物价信息已有变更单,您可以进入【业务资料】修改并且提交审核!'
                  }

              });
      }
    },
    route: {
      activate: function () {
          this.countTr=0;
          this.cs1=false;
          this.canModify=false;
          if(this.$route.params && this.$route.params.guid == '0'){
              this.canModify=true;//修改允许修改
              this.countTrs = 0;//新增,业务资料不能修改
          }
          this.picReadonly = 0;
          this.getData();
          this.listHospitalData();
      }
    },
    watch: {
        //商品名称查询
        'goodsnameLis': function (val) {
            if(val!='' && this.goOnSearch){
                $("#searchMore").css("display","block");
                this.listGoodsByGoodsName(val);
            }else{
                $("#searchMore").css("display","none");
            }
        },
        'selAllPrice':function(val){
            this.checkPrice=[];
            if(val && this.listPrices.length>0){
                for(var i=0;i<this.listPrices.length;i++){
                    this.checkPrice.push(this.listPrices[i].guid);
                }
            }
        }
    },
  };

</script>