//出库作业
<template>
  <div class="gaoxian_outbound">
    <div class="sache">
      <span class="text">出库时间：</span>
      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
      </el-date-picker>
      <span class="text">至</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>
    </div>
    <div class="table">
      <dilTable v-bind.sync="options" @selection-change="selectionChange" ref="table">
      </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/getWmspOutboundResult?apiId=152&warehouseId="+3
        // 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);
      }
      // console.log(startTime)
      // console.log(endTime)
      if (startTime && endTime) {
        if (startTime < endTime) {
          // if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
          this.options.requestUrl = "/api/v1/wms/getWmspOutboundResult?apiId=152&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();

          // }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
          // this.options.requestUrl = "/api/v1/wms/getWmsInboundResults?apiId=371&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
          // }else{
          // this.options.requestUrl = '/api/v1/wms/getWmsInboundResults?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;
    }
  }
}
</script>

<style lang="scss" scoped>
  .gaoxian_outbound{
    margin-top: 40px;
    margin-left: 20px;
    .sache{
      display: flex;
      margin-bottom: 10px;
      padding-right: 10px;
      .text {
        text-align: left;
        line-height: 40px;
      }
      .el-date-editor {
        margin-right: 5px;
        margin-left: 5px;
      }
      .btn {
        margin-left: 10px;
      }
      .el-select {
      width: 100%;
      .el-input__inner {
        width: 150px;
      }
    }
    }
  }
</style>