app.vue 3.53 KB

<template>

<div class="contentpanel shopsReport">
    <div class="panel">
        <div class="panel-heading">
            <h1>库存统计</h1>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="panel-col">
                    <input type="text" name="SKN" v-model="params.productSkn" class="form-control" placeholder="SKN">
                </div>
                <div class="panel-col">
                    <input type="text" name="SKU" id="SKU" class="form-control" placeholder="SKU" v-model="params.productSku">
                </div>
                <div class="panel-col">
                    <input type="text" class="form-control" placeholder="厂家编号" v-model="params.factory_code">
                </div>
                <div class="panel-col">
                    <a href="javascript:;" class="btn btn-info" @click="reload">搜索</a>
                </div>
            </div>

            <uc-Card :rows="card.rows"></uc-Card>
        </div>
    </div>

    <div class="panel">
        <div class="panel-heading">
            <h2>——4月19日库存报表——</h2>
        </div>

        <div class="panel-body nopadding">
          <com-grid :columns="grid.columns" :url="grid.url">
          </com-grid>
        </div>
    </div>

</div>
</template>



<script>
import grid from '../../../../components/grid/index';
import card from './card';

export default {
  components: {
    comGrid: grid,
    ucCard:card,
  },
  data() {
    return {
      // checkedFields: [],
      card:{
        rows:[
          {name:"库存总数量",value:"0"},
          {name:"库存总金额(元)",value:"0"},
          {name:"已上架商品数",value:"0"},
          {name:"待上架商品数",value:"0"},
          {name:"已下架商品数",value:"0"}
        ]
      },
      params:{
        productSkn:"",
        factory_code:"",
        productSku:"",
        shopId:"",
        brandId:"",
        maxSortId:"",
        middleSortId:"",
        smallSortId:""
      },
      grid:{
        url:'/bigdata/getStorageStatisticsList',
        columns:[
          {display:'图片',name:'imageUrl',render:function(item){
            return item.imageUrl?'<img src="'+item.imageUrl+'">':"";
          }},
          {display:'SKN/SKU',name:'skn',render:function(item){
            return '<p>SKN:'+item.productSkn+'</p><p>SKU:'+item.productSku+'</p>';
          }},
          {display:'厂家编号',name:'skn'},//goodsName
          {display:'商品名称',name:'goodsName'},
          {display:'进货价',name:'purchasePrice'},
          {display:'颜色/尺码',name:'skn',render:function(item){
            return [item.colorName,item.sizeName].join('/');
          }},
          {display:'商品分类',name:'skn',render:function(item){
            return [item.maxSortName,item.middleSortName,item.smallSortName].join('-');
          }},
          {display:'库存数量',name:'storeNums'},
          {display:'库存金额(元)',name:'storageAmount'}
        ]
      }
    }
  },
  methods: {
    reload() {
      var data={
        productSkn:this.params.productSkn,
      }
      this.$broadcast('grid-reload',data);
    }
  },
  events:{
    complete(data){
      let result=data.additionInfo;
      if(result){
        this.card.rows[0].value=result.storageTotalNum;
        this.card.rows[1].value=result.storageTotalMoney;
        this.card.rows[2].value=result.onSaleTotalNum;
        this.card.rows[3].value=result.preSaleTotalNum;
        this.card.rows[4].value=result.outSaleTotalNum;
      }
      
    }
  }
}
</script>