department-store-list.vue 5.8 KB
 <template>
  <div class="container resource close-left-menu">
    <div class="pop-banner clearfix">
     <div class="operate-btns">
     <a class="fbtn  fb-Print2 ml-10" @click='printCkAndThReport'>打印</a>
    </div>
    <h3 class="current-module">库存出库汇总查询</h3>
  </div>
  <div class="order-orderlist-view clearfix">
    <div class="pd-form form-label4em mb-40 fast-search-form">
      <div class="group-row">
        <div class="form-group">
          <div class="control">
          <input type="text" maxlength="10" v-rule v-model="medDeptName" placeholder='科室名称' title='科室名称'>
          </div>
        </div>
        <div class="form-group form-label">
          <!-- <label for="cn1" class="label">结算日期</label> -->
          <div class="control control-date" style="height:34px;overflow: inherit;">
            <div style="width:44%;float:left;">
              <datepicker :target.sync="startDate" :readonly="readonlyFlag" placeholder="申领开始日期" title='结算开始日期' styleobj="width:100% !important;border-radius:8px 0px 0px 8px !important;"></datepicker>
            </div>
            <div class="text-and"></div>
            <div style="width:48%;float:left;">
              <datepicker :target.sync="endDate"  :readonly="readonlyFlag" title='申领结束日期' placeholder="申领结束日期" styleobj="width:100% !important;border-radius:0px 8px 8px 0px !important;"></datepicker>
            </div>
          </div>
        </div>
      </div>
      <div class="group-row t-right">
        <button  v-on:click="getData(false)" class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle">查 询</button>
      </div>
    </div>
    <div class="statistics">
      出库总金额<em>{{sum.doAccount | numDigit 2 | numFmt}}</em>元,退货总金额<em>{{sum.rpiAccount | numDigit 2 | numFmt}}</em>元,合计总金额<em>{{sum.account | numDigit 2 | numFmt}}</em>
    </div>
    <div class="line-footer"></div>
    <table class="itable itable-td-long-text">
      <thead id="t_header">
        <tr>
          <th class="w40">序号</th>
          <th class="w100">科室名称</th>
          <!--<th class="w100">出库数量</th>-->
          <th class="w100">出库金额(元)</th>
          <!--<th class="w100">退货数量</th>-->
          <th class="w100">退货金额(元)</th>
          <!--<th class="w100">合计数量</th>-->
          <th class="w100">合计金额(元)</th>
        </tr>
      </thead>
      <tbody class="txt_v">
        <tr v-if="list.length==0">
          <td colspan="5" >
          暂无符合条件的记录
          </td>
        </tr>
        <tr v-else v-for='item in list'>
          <td>{{$index+1}}</td>
          <td>{{item.medDeptName}}</td>
          <!--<td>{{item.doDetailsum}}</td>-->
          <td class="t-right">{{item.doAccount  | numDigit 2 | numFmt}}</td>
          <!--<td>{{item.rpiDetailsum}}</td>-->
          <td class="pr10 t-right">{{item.rpiAccount  | numDigit 2 | numFmt}}</td>
          <!--<td>{{item.detailsum}}</td>-->
          <td class="t-right">{{item.account  | numDigit 2 | numFmt}}</td>
        </tr>
      </tbody>
    </table>

  </div>

</div>
</template>
<script >
  module.exports = {
    data: function () {
      return {
        list:[],
        startDate:'',
        endDate:'',
        medDeptName:'',
        sum:{//总金额
            doAccount:0,
            rpiAccount:0,
            account:0
        }
      };
    },
    methods: {
      // 获取当前时间和之前一个月时间
      Date:function(){
        var self = this;
        // 结束日趋
        var nowdate = new Date();
        var y = nowdate.getFullYear();
        var m = nowdate.getMonth()+1;
        m=m<10?'0'+m:m;
        var d = nowdate.getDate();
        d=d<10?'0'+d:d;
        self.endDate = y+'-'+m+'-'+d;

        // 开始日期
        nowdate.setMonth(nowdate.getMonth()-1);
        var yn = nowdate.getFullYear();
        var mn = nowdate.getMonth()+1;

        mn=mn<10?'0'+mn:mn;

        var dn= nowdate.getDate();
        dn=dn<10?'0'+dn:dn;
        self.startDate = yn+'-'+mn+'-'+dn;
      },
      getData: function () {
        var self = this;
        self.list=[];
        Ajax.post('/procurment/getCkAndThReport',{'medDeptName':self.medDeptName,'startDate':self.startDate,'endDate':self.endDate})
          .then(function (response){
            var data = response.data.data;
            if(response.data.errorCode==0){
                self.$set('list',data);
                self.sum.doAccount = 0;
                self.sum.rpiAccount = 0;
                self.sum.account = 0;
                if(Array.isArray(data) && data.length >0){
                    for(var i = 0,len = data.length;i<len;i++){
                        self.sum.doAccount += (data[i].doAccount-0);
                        self.sum.rpiAccount += (data[i].rpiAccount-0);
                        self.sum.account += (data[i].account-0);
                    }
                }
            }else {
                self.MessageBox({
                    title: '警告',
                    message: response.data.message,
                    type: 'alert'
                }, function(action) {});
            }
        })
      },
      printCkAndThReport:function(){
        var self = this;
         Ajax.post('/procurment/printCkAndThReport',{'medDeptName':self.medDeptName,'startDate':self.startDate,'endDate':self.endDate})
          .then(function (response){
            var res = response.data.data;
              window.open(res);
        })
      },
    },
    route: {
      activate: function () {
        this.Date();
        this.getData();
      }
    },
    watch:{
    }
  };
</script>
 <style scoped>
   .line-footer{
     color: #4aa8e5;
     overflow: hidden;
     line-height: 34px;
     border-bottom: 2px solid #4aa8e5;
     margin-bottom: 20px;
   }

 </style>