procurement-catalog-audit.vue 7.97 KB
<template>
<div class="container resource close-left-menu contaNEW">
  <div class="pop-banner clearfix">
    <div class="operate-btns">
      <a @click="audit()" class="fbtn fb-to-examine" >审核</a>
      <a @click="closeUp(true)" class="fbtn fb-reject hide">驳回</a>
    </div>
    <h3 class="current-module">采购目录审核</h3>
  </div>

        <div class="pop-refused-reasons" style="z-index:10;" v-show="showPopupUp">
          <div class="pop-rr-tit text-color-blue" style="text-align:left;">驳回理由</div>
          <textarea class="input-border" v-model="rejectionreason"></textarea>
          <div class="from-button fr mt-10">
               <a href="javascript:;" class="red-button p-lr-10" @click="close(false)">取 消<i>|</i></a>
               <a href="javascript:;" class="green-button p-lr-10" @click="rebuitApprove(idList,'V01',false,$route.params.clientType)">提 交</a>
          </div>
        </div>
  <!--supply-supplylist start-->
  <div class="supplylist clearfix supply-select">
    <div class="supplylist-root pt0 w245">
        <form class="search-bar" style="min-width: 215px;" active="###">
          <div class="search-btn fr cur-poin" @click='getMedList'>
          </div>
          <input type="text" class="w163" maxlength="20" v-rule placeholder="输入供应商搜索" v-model="medname">
        </form>
        <div class="root-node-news">
            <b class="fl w30 t-center">序号</b>
            <b class="fl w180 t-center">供应商</b>
         </div>
        <div class="root-node-list" id="sortable" style='height: 480px;'>
            <template v-for="(indexI,medlist) in getMedLists">
            <div class="list-node" style='min-height:50px;line-height:25px;' :class="{ 'active': activeI == indexI }" @click="getMed(indexI,medlist.contentguid,medlist.supplierguid)">
              <div class="fl w30 t-center">{{$index + 1}}</div><div class="fl w180 t-left"><a style="cursor: default;" title="{{ medlist.medsuppliername }}">{{ medlist.medsuppliername }}</a></div>
            </div>
            </template>
          </div>
    </div>
    <div class="supplylist-table ml-265">
      <div class="w613 h-50">
             <form class="search-bar w370 fl" active="###">
                <div class="search-btn fr cur-poin" @click='getMedListClick'>
                </div>
                <input type="text"  maxlength="50" v-rule placeholder="录入商品编码、商品名称、注册证号模糊搜索" v-model="goodsinfo">
             </form>
       </div>
      <div class="fheader no-bottom pd0">
        <h4 class="fh-good">商品列表</h4>
      </div>
      <table class="itable itable-thead-13px">
        <thead>
          <tr>
            <th class="w30">序号</th>
            <th class="w100">医院商品</th>
            <th class="w100">供应商商品</th>
            <th class="w30"></th>
            <th class="w50">单位系数转换</th>
            <th class="w100">采购价</th>
            <th class="w70">结算方式</th>
            <th class="w100">委托配送商</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="mFMedGoods in getMedcontentList">
            <td>{{ $index + 1 }}</td>
            <td><div class="t-left pr10">{{ mFMedGoods.mgoodscode  }}<br>{{mFMedGoods.mgoodsname}}<br/>{{mFMedGoods.mgoodsspec}}<br/>{{mFMedGoods.mproducer}}<br/>{{mFMedGoods.mregistkey}}</div></td>
            <td v-if="mFMedGoods.contentstate != 'P4'"><div class="t-left pr10">{{ mFMedGoods.sgoodscode  }}<br>{{mFMedGoods.sgoodsname}}<br/>{{mFMedGoods.sgoodsspec}}<br/>{{mFMedGoods.sproducer}}<br/>{{mFMedGoods.mregistkey}}</div></td>
            <td v-else class="text-color-red"><div class="t-left pr10 mt-50"><b>供应商放弃供应</b></div></td>
            <td>
              <span class="ct-col w30">
                <span class="table-detail-icon icon-green"></span>
                <span class="table-detail-icon icon-green mt-20"></span>
              </span>
              </td>
            <td>
              {{mFMedGoods.purconverratio}}{{mFMedGoods.unitstyle}}<br><br>
              {{mFMedGoods.supconverratio}}{{mFMedGoods.supplyunit}}
            </td>
            <td>{{ mFMedGoods.purchaserprice | numDigit 2 | numFmt }}</td>
            <td>{{  mFMedGoods.settlemethod | method}}</td>
            <td>{{mFMedGoods.distribuname}}</td>
          </tr>
        </tbody>
      </table>
      <div class="pagination m-20-0">
        <em class="page">明细条目数【{{ search.total }}】</em>
        <pagination
          @page-change="getMedListClick"
          :class="['m-20-0']"
          :page-no.sync="search.page"
          :total-pages.sync="search.totalPages">
        </pagination>
      </div>
    </div>
  </div>
  <!--supply-supplylist end-->
</div>
</template>
<script>
module.exports={
data: function(){
  return {
    getMedLists: [],     //左侧列表
        medname:'',
        goodsinfo:'',
        getMedcontentList:[],
        search: {
        pageSize: 5,
        page: 1,
        total: 0,
        totalPages: 0
        },
        getNoMedGoods:'',
        getNoGoods:'',
        guid:'',
        supplierguid:'',
        showPopupUp:false,
        rejectionreason:'',
        activeI :[],
        noAudit:false,//防止重复点击审核
  };
},
methods: {
      //左侧列表 加载数据
      getMedList:function(){
         var self = this;
         Ajax.post('/procurment/getSuppliers',{'medname':self.medname})
          .then(function(response){
          var data=response.data.data;
          if (response.data.errorCode == 0) {
               self.$set("getMedLists",data);
               for (var i = 0; i < data.length; i++) {
                     self.guid =data[0].contentguid;
                     self.supplierguid =data[0].supplierguid;
               }
               self.getMedListClick();
            }else{
              layer.msg(response.data.message);
            }
         })
      },
      getMed:function(indexI,guid,supplierguid){
         var self =this;
          self.activeI = indexI;
          self.guid = guid;
          self.supplierguid = supplierguid;
          self.search.page = 1;
          self.getMedListClick();
      },
      //加载右侧商品数据
      getMedListClick:function(){
         var self = this;
         Ajax.post('/procurment/getWaitAuditGoods',{'page':self.search.page,'pageSize':self.search.pageSize,'totalPages':self.search.totalPages,'contentguid':self.guid,'goodsinfo':self.goodsinfo})
          .then(function(response){
          var data=response.data.data;
          self.$set("getMedcontentList",data.list);
          self.search.totalPages=data.totalPages;
          self.search.total=data.total;
         })
      },
      //审核
      audit:function(){
         var self = this;
         if(self.guid == null || self.guid == ''){
                layer.msg('请选择需要审批的供应商!');
                return;
         }
          if(self.noAudit){
              return;
          }
          self.noAudit = true;
         Ajax.post('/procurment/audit',{'contentguid':self.guid,'supplierguid':self.supplierguid})
          .then(function(response){
          self.noAudit = false;
          var data=response.data.data;
          self.getMedList();
          if (response.data.errorCode == 0) {
            if(response.data.data == 0){
                self.MessageBox({title:'提示', message:'审核成功!', type: 'alert'},function(action){
                    //跳转
                    /*self.$router.go({
                      path: '/procurementList'
                    });*/
                });
             }else{
                layer.msg('审核成功!');
                return;
             }
            }else{
               layer.msg('审核失败!');
            }
         })
      },
      closeUp:function(flag) {
        var self = this;
        self.$set('showPopupUp',flag);
     },
     close:function(flag) {
        var self = this;
        self.$set('showPopupUp',flag);
     },
},
    route:{
        activate : function(){
            this.getMedList();
        }
    }
};
</script>