order-dispose2.vue 15.5 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
<!--订单受理:明细-->
<script>

  //初始化过滤器
            

  module.exports = {
    data: function () {
      return {
        sysdate:'',
        sysdate2:'',
        sysdate3:'',
        sysdate4:'',

        // 业务数据
        ywdata:{
          ywtag:'dange',// 操作的类型:单一处理,批量处理
          ywguid:'',// 业务guid
          ywchecked:'',// 选中哪一个
          planenddate:'',// 时间

          ywdate:''// 选择的时间
        },

        trpo:{},
        // 明细数据
        mxList: [],
        // 图片数据
        imgcache:[],
        // 查询条件
        search: {
          //total: 0,
          page: 1,
          pageSize: 5,
          totalPages: 0,
        },
      };
    },
    methods: {    
      initData:function(){
        var now = new Date();        
        this.sysdate = this.formDate(now);

        now.setDate(now.getDate()+1);
        this.sysdate2 = this.formDate(now);

        now.setDate(now.getDate()+1);
        this.sysdate3 = this.formDate(now);
      },
      // 初始化操作
      getData:function(){
        var self = this;
        var billno = this.$route.params.billno;
        self.search.search_EQ_billno = billno;

        // 1.获得订单详细信息
        Ajax.get('/trpo/get/'+billno)
          .then(function (response){
            var data = response.data.data;
            self.$set('trpo',data);
        })
        // 2.获得商品列表信息
        Ajax.get('/trpo/listGoodsDetail', this.search)
          .then(function (response){
            var data = response.data.data;
            self.$set('mxList',data.list);
            self.search.pageno = data.pageno;
            self.search.totalPages = data.totalPages;
            self.search.total = data.total;

            // 封存商品图片信息
            self.$set('imgcache',response.data.senData);
        })
      },
      // 打印
      goPrint:function(guid){
        
      },
      // 确定处理 
      doState:function(tag){
        var self = this;
        // 批量处理:按医院批量受理采购订单        
        self.MessageBox({
          title: '提示',
          message: "您确认受理该采购订单吗?",
          type: 'success',
          showCancelButton: true
        },function(action) {
          if(action=='confirm'){
            Ajax.post('/trpo/dostateByGuid', self.ywdata)
              .then(function (response){
                var data = response.data.data;
                // 重新刷新页面
                self.MessageBox({
                  title:'提示',
                  message:data.split("@")[1],
                  type:'alert'
                },function(action){    
                  var billno = self.billno;
                  self.$route.router.go('/trpo/orderDispose3/'+billno);
                }); 
            })
            return ;
          } 
        }); 
      },
      // 展示单个订单受理的页面
      showDialog:function(guid,billno,ywtag){
        var self = this;

        // 设置当前的弹出框的一些属性
        self.$set('ywdata.ywtag',ywtag);
        self.$set('ywdata.ywguid',guid);
        self.$set('ywdata.ywchecked',1);
        self.$set('ywdata.ywdate',self.sysdate);   


        self.$set('billno',billno);// 用于单一处理的时候


        $("#"+ywtag).attr("class","modal");         
      },
      // 关闭单个订单
      closeDialog:function(dialogId){
        this.ywguid = "";
        $("#"+dialogId).attr("class","modal hide");  
      },  
      // 初始化时间
      formDate:function(day){
        var Year = 0; 
        var Month = 0; 
        var Day = 0; 
        var CurrentDate = ""; 
        //初始化时间 
        Year= day.getFullYear();//ie火狐下都可以 
        Month= day.getMonth()+1; 
        Day = day.getDate(); 
        CurrentDate += Year + "-"; 
        if (Month >= 10 ){ 
          CurrentDate += Month + "-"; 
        }else { 
          CurrentDate += "0" + Month + "-"; 
        } 
        if (Day >= 10 ) { 
          CurrentDate += Day ; 
        }else { 
          CurrentDate += "0" + Day ; 
        } 
        return CurrentDate; 
      }
    },
    route: {
      activate: function () {
        this.getData();
        this.initData();
      }
    },
    watch:{
      // 判断选择的日期
      'ywdata.ywchecked':function(val){
        var self = this;        
        // 需要处理全选
        if(self.ywdata.ywchecked==4){      
          // self.ywdata.planenddate = self.ywdata.planenddate;
        }else if(self.ywdata.ywchecked==1){// 今天          
          self.ywdata.planenddate = self.sysdate;
        }else if(self.ywdata.ywchecked==2){// 明天          
          self.ywdata.planenddate = self.sysdate2;
        }else if(self.ywdata.ywchecked==3){// 后天  
          self.ywdata.planenddate = self.sysdate3;
        } 
      },
    }
  };
</script>
<template>
 
  <div class="container resource close-left-menu contaNEW">
    <div class="pop-banner clearfix">
        <!-- <div class="current-operate"></div>
      -->
      <div class="operate-btns">
        <a v-on:click="showDialog(trpo.guid,trpo.billno,'dange')" 
          :style="trpo.billstate!='P02'? 'color:#DCDCDC':''"
          v-if="'/supplier/trpo:doState' | myqx"
          class="fbtn fb-dispose">受理</a>
        <!--
        <a href="javascript:;" class="fbtn fb-Print">打印</a>
        -->
      </div>
      <h3 class="current-module">供应商采购订单详情</h3>
    </div>
    <!--order-orderlist-view start-->
    <div class="order-orderlist-view clearfix">
      <div class="pd-form mb-20">
        <div class="group-row group-row-3">
          <div class="form-group form-label">
            <label for="cn1" class="label">采购订单</label>
            <div class="control">
              <input type="text" id="cn1" :value="trpo.billno" readonly="readonly" class="inp4"></div>
          </div>
          <div class="form-group form-label">
            <label for="cn2" class="label w120">要求到货日期</label>
            <div class="control">
              <input type="text" id="cn2" :value="trpo.planenddate | getYMD" readonly="readonly" class="inp6"></div>
          </div>
          <div class="form-group form-label">
            <label for="cn3" class="label">执行状态</label>
            <div class="control">
              <input type="text" id="cn3" :value="trpo.billstate | billstate_trpo" readonly="readonly" class="inp4"></div>
          </div>
        </div>
        <div class="group-row group-row-3">
          <div class="form-group form-label">
            <label for="cn4" class="label">计划单号</label>
            <div class="control">
              <input type="text" value="" id="cn4" :value="trpo.medplanbillno" readonly="readonly" class="inp4"></div>
          </div>
          <div class="form-group form-label">
            <label for="cn5" class="label">业务员</label>
            <div class="control">
              <input type="text" id="cn5" :value="trpo.buyername" readonly="readonly" class="inp3"></div>
          </div>
          <div class="form-group form-label">
            <label for="cn6" class="label">订货日期</label>
            <div class="control">
              <input type="text" id="cn6" :value="trpo.billdate | getYMD" readonly="readonly" class="inp4"></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" :value="trpo.medname" id="cn5" readonly="readonly" class="inp4"></div>
          </div>
          <div class="form-group form-label">
            <label for="cn7" class="label">单据类型</label>
            <div class="control">
              <input type="text" id="cn7" :value="trpo.billtype | billtype" readonly="readonly" class="inp4"></div>
          </div>
          
        </div>
        <div class="group-row">
          <div class="form-group form-label">
            <label for="cn6" class="label">收货地点</label>
            <div class="control w700">
              <input type="text" id="cn6" :value="trpo.address" readonly="readonly" class="inp4"></div>
          </div>
        </div>
   <!--      <div class="group-row">
          <div class="form-group form-label">
            <label class="label" for='cn8'>供应商</label>
            <div class="control w700">
              <input type="text" id="cn8" :value="trpo.suppliername" readonly="readonly" class="inp3"></div>
          </div>
        </div> -->
      </div>


      <table class="itable itable-td-long-text">
        <thead id="t_header">
          <tr>
            <th class="w40">序号</th>
            <th class="w240">商品</th>
            <th class="w50"></th>
            <th class="w100">订货数</th>
            <th class="w10"></th>
            <th class="w100">价格</th>
            <th class="w10"></th>
            <th class="w100">含税金额(元)</th>
            <th class="w10"></th>
            <th class="w130">备注</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td colspan="7" v-if="mxList.length==0">
            暂无符合条件的记录
            </td>
          </tr>
          <tr v-for="mxpo in mxList">
            <td>
              {{$index+1 | getIndex}}
              <!--
              <div class="pro-pic" style="background-image: url()">
                <span class="pic-max blue-search"></span>
              </div>
              -->
              <imagebox v-bind:imgarr= "imgcache [ mxpo.supplierGoodsguid ] | original " >
                <img 
                  v-if="mxpo.supplierGoodsguid!=null && imgcache[mxpo.supplierGoodsguid]!='NOPIC'"  
                  class="pro-pic" style="margin-top:0px;"
                  v-bind:src="imgcache[mxpo.supplierGoodsguid] | thumbnail" >
                <span class="pic-max blue-search">
                </span>
              </imagebox>
              <div class="pro-pic" 
                v-if="mxpo.supplierGoodsguid==null || imgcache[mxpo.supplierGoodsguid]=='NOPIC'"  
                style="background-image: url(../images/default.jpg)"> </div>
            </td>
            <td class="t-left">
              <div class="p-lr-10">
                {{mxpo.supplierGoodscode}}
                <br>
                <span class="p-tit-green">{{mxpo.supplierGoodsname}}</span>
                <br>
                {{mxpo.supplierGoodsspec}}
                <br>
                {{mxpo.manufacturer}}
                <br>{{mxpo.registkey}}</div>
            </td>
            <td class="w50">
              <span class="table-detail-icon"></span>
              <span class="table-detail-icon"></span>
            </td>
            <td class="t-right">
              <!--医院订货数:现在计算不出供应商应该有多少-->
              <span class="table-detail-text">
                {{mxpo.purchaserPoqty}}{{mxpo.purchaserUnit}}
                </span>
              <span class="table-detail-text">
                {{mxpo.supplierPoqty}}{{mxpo.supplierUnit}}
                </span>
            </td>
            <td></td>
            <td class="t-right">
              {{mxpo.purchaserPrice | numDigit 2 | numFmt}}
              <br>元/{{mxpo.purchaserUnit}}</td>
            <td></td>
            <td class="t-right">{{mxpo.amount | numDigit 2 | numFmt}}</td>
            <td></td>
            <td>{{mxpo.memo}}</td>
          </tr>
        </tbody>
      </table>
      <div class="pagination m-20-0" v-if="mxList.length">
        <pagination
           @page-change="getData"
           :page-no.sync="search.page"
           :total-pages.sync="search.totalPages">          
        </pagination>
      </div>
      
    </div>



    <!--star 9-9 受理弹出-->
    <!--单个订单受理弹出框-->
    <div id="dange" class="modal hide">
      <div class="container resource">
        <div class="audit-detail" 
        style="width:540px;">
          <span class="close-win" v-on:click="closeDialog('dange')"></span>

            <div class="sdiv-9-9b"
            style="">            
              <a class="btn-d btn-d-activate btn-d-lg" href="javascript:;">单个订单受理</a>
            </div>

          <div class="status-process wbe-0 clearfix pd20" style="padding-top:0px;">
            <p style="color:#606f7a;font-size:14px;">
            请选择送货日期</p>

            <div class="sp-head sp-headb" >
              <span class="sp-col w300"  >
                <span class="control radio-control ">
                  <input type="radio" id="radio_d_01" name="radio_d" 
                    value="1" v-model="ywdata.ywchecked">
                  <label class="radio mr-0" for="radio_d_01" style="line-height:20px;"> 
                  <span>{{sysdate}} (今天送货)  </span>
                  </label>
                </span>
              </span>
            </div>
            <div class="sp-head sp-headb" >
              <span class="sp-col w300"  >
                <span class="control radio-control ">
                  <input type="radio" id="radio_d_02" name="radio_d"
                    value="2"  v-model="ywdata.ywchecked">
                  <label class="radio mr-0" for="radio_d_02" style="line-height:20px;"> 
                  <span>{{sysdate2}} (明天送货)  </span>
                  </label>
                </span>
              </span>
            </div>
            <div class="sp-head sp-headb" >
              <span class="sp-col w300"  >
                <span class="control radio-control ">
                  <input type="radio" id="radio_d_03" name="radio_d"
                    value="3"  v-model="ywdata.ywchecked">
                  <label class="radio mr-0" for="radio_d_03" style="line-height:20px;"> 
                  <span>{{sysdate3}} (后天送货)  </span>
                  </label> 
                </span>
              </span>
            </div>
            <div class="sp-head sp-headb"  style="height: auto;">
              <span class="sp-col w300"  >
                <span class="control radio-control ">
                  <input type="radio" id="radio_d_04" name="radio_d" 
                    value="4"  v-model="ywdata.ywchecked">
                             <label class="radio mr-0 fl" for="radio_d_04" style="line-height:20px;"> 其他日期  </label>
                    <!--<input class="cert-numd2 "v-if="ywdata.ywchecked=='4'" v-model="ywdata.planenddate" >
                    <input class="cert-numd2 "v-if="ywdata.ywchecked!='4'"  >-->
                   <div class="form-group form-label w180 fl pl10">                   	
                    <datepicker v-if="ywdata.ywchecked=='4'" :target.sync="ywdata.planenddate | getYMD"></datepicker>
                      <datepicker v-if="ywdata.ywchecked!='4'" :target.sync=""></datepicker>
     </div>      
                    
                    
                  <!--<label class="radio mr-0" for="radio_d_04" style="line-height:20px;"> 
                  <span>其他日期
                    <input class="cert-numd2 "v-if="ywdata.ywchecked=='4'" v-model="ywdata.planenddate" >
                    <input class="cert-numd2 "v-if="ywdata.ywchecked!='4'"  >
                  </span>
                  </label>-->
                </span>
              </span>
            </div>




            <div class="sdiv9-9">
                <button v-on:click="doState('dange')" class="btn button-green">确定</button>
                <button v-on:click="closeDialog('dange')" class="btn button-green">关闭</button>
            </div>          
          </div> 






        </div>
      </div>
    </div>
    <!--star 9-9 受理弹出-->


  </div>
</template>