<template>
<!-- 实时库存 -->
  <div class="steel_real">
    	<div class="sache">
        <el-input placeholder="请输入内容" v-model="inputText" clearable>
        </el-input>
        <el-select v-model="warehouseId" placeholder="一棒库" style="width: auto;">
          <el-option label="不选择仓库" value="0"></el-option>
          <el-option label="一棒库" value="1"></el-option>
          <el-option label="二棒库" value="2"></el-option>
          <el-option label="高线库" value="3"></el-option>
          <el-option label="配送库" value="4"></el-option>
        </el-select>
        <el-select v-model="time" placeholder="一个月" style="width: auto;">
          <el-option label="不选择月份" value="0"></el-option>
          <el-option label="一个月" value="1"></el-option>
          <el-option label="半个月" value="2"></el-option>
        <!-- <el-option label="" value="3"></el-option> -->
        </el-select>
        <el-button type="primary" class="btn" @click="onClick">
          <i class="el-icon-search"></i>查询
        </el-button>
		</div>
    <dilTable v-bind.sync="option" :height="500" @func="func" :rowClassName="rowClassName"
    style="height: 300px">
    </dilTable>
    <!-- <dilTable v-bind.sync="options" >

    </dilTable> -->
    </div>
</template>

<script>
export default {
 name:"steel_real",
  data(){
    return {
      warehouseId:"",
      time:'',
      rowIndex:null,
      mapList:[],
      inputText:"",
      option: {
        requestUrl: "/api/v1/wms/selectGridMaterialList?apiId=167&warehouseId="+"0"+"&time="+"0",
      },
      rowId:''
    };
  },
  mounted(){

  },
  created(){

  },
  methods:{
    rowClassName({row, rowIndex}) {
        if (row.status === 1) {
          return 'success-row';
        }
        return '';
    },
    func(res){
      // console.log(res)
      res.list.forEach(e => {
        console.log(e.status)
        if(e.status == 0){
          // 表示这个物资已经达到库龄预警

        }
        // console.log(this.mapList)
      });
    },
    demotionClick(gridId){
      this.$router.push("/steel_realDown/" + gridId);
    },
    onClick(){
      this.option.requestUrl= "/api/v1/wms/selectGridMaterialList?apiId=167&warehouseId="+this.warehouseId+"&time="+this.time+"&con="+this.inputText;
      console.log(this.inputText)
    }
  },
};
</script>
<style lang="scss" scode>
.tableHeight{
  height: 300px;
}
.steel_real{
  .sache{
    padding: 1.25rem 0.375rem;
    .el-input {
      width: 20%;
      margin-right: 1.25rem;
    }
    .el-select {
      width: 100%;
      .el-input__inner {
        width: 150px;
      }
      .el-input__suffix{
        padding-left: 100px;
      }
    }
  }
}
</style>
