//入库
<template>
  <div class="steel_inbound">
    <div class="sache">
      <!-- <el-input
        placeholder="请输入内容"
        v-model="inputText"
        clearable>
      </el-input>
       -->
      <span>入库时间：</span>
      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
      </el-date-picker>
      <span>至</span>
      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
      </el-date-picker>
      <el-button type="primary" class="btn" @click="onclick">
        <i class="el-icon-search"></i>查询
      </el-button>
      <el-button type="primary" class="btn" @click="onreserved">
        预留
      </el-button>
    </div>
    <div class="table">
      <dilTable v-bind.sync="options" >
        <!-- <el-table-column fixed="right" label="操作" width="150">
								<template slot-scope="scope">
									<el-button type="text" size="mini" @click="inboundDetails(scope)">
										详情
									</el-button>
								</template>
				</el-table-column> -->
      </dilTable>
    </div>
  </div>
</template>

<script>
import { sjTime } from "@/utils/sharedJsFile";
import { getCookie } from '@/utils/util.js';
export default {
  data(){
    return{
      inputText:"",
      startTime: null,
      endTime: null,
      options:{
        // first请求数据的地址
        requestUrl: "/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId="+2,
        // selectionType: "select",
        // mapList: [],
      },
    }
  },
  methods:{
    // inboundDetails(scope){
    //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
    // },
    onclick(){

      let startTime = null;
      let endTime = null;
      if (this.startTime) {
        startTime = sjTime(this.startTime);
      }
      if (this.endTime) {
        endTime = sjTime(this.endTime);
      }
      if (startTime && endTime) {
        if (startTime < endTime) {
          // if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
          this.options.requestUrl = "/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId="+2+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
          // }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
          // this.options.requestUrl = "/api/v1/wms/getWmsInboundResult?apiId=371&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
          // }else{
          // this.options.requestUrl = '/api/v1/wms/getWmsInboundResult?apiId=371&userId=' + getCookie("orgCode") +"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
          // }
        } else {
          this.startTime = null;
          this.endTime = null;
          this.$message.warning("开始时间要比结束时间早");
        }
      } else {
        this.getRequestUrl()
      }
    },
    selectionChange(selection) {
      this.options.mapList = selection;
    },
    onreserved(){
      this.$router.push({
        path: "/bar1_addSteelInbound",
      });
    }
  }
}
</script>

<style lang="scss" scode>
.steel_inbound{
  .sache{
    height: 5rem;
    display: flex;
    align-items: center;
    padding-left: 1.875rem;
  }
}
</style>