//卸货
<template>
  <!-- 零星物资卸货卸货实绩页面 -->
  <div class="homeworkPath">
   <div class="top">
      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
      <el-button type="primary" class="btn" @click="onclick">
        <i class="el-icon-search"></i>查询
      </el-button>
      <span class="text">流向：</span>
      <el-select
        class="select"
        v-model="flow"
        placeholder="请选择"
        @change="onchange()"
      >
        <el-option
          v-for="item in flowList"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
      <span class="span"></span>
    </div>
    <dilTable v-bind.sync="option"></dilTable>
  </div>
</template>

<script>
import { getCookie } from "@/utils/util.js";
export default {
  name: "homeworkPath",
  data() {
    return {
      restaurants: [],
      input: "",
      option: {
        // 表格请求数据的地址
        requestUrl: "",
      },
      flow:null,
      flowList:[{
          value: 12,
          label: "进厂",
        },
        {
          value: 13,
          label: "出厂",
        },
        {
          value: 14,
          label: "中转",
        },
        {
          value: 19,
          label: "退货",
        },
        ]
    };
  },
  created(){
      if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu" || getCookie("orgCode") == "baowei"){
          this.option.requestUrl = "/api/v1/tms/getAllLoadResult?apiId=430&orderType=100&status=0"
      }else{
          this.option.requestUrl = "/api/v1/tms/getAllLoadResult?apiId=430&orderType=100&status=0&userId=" + getCookie("orgCode")
      }
  },
  methods: {
    onchange(){
      if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu" || getCookie("orgCode") == "baowei"){
          this.option.requestUrl = "/api/v1/tms/getAllLoadResult?apiId=430&status=0" + "&orderType=" + this.flow
      }else{
          this.option.requestUrl = "/api/v1/tms/getAllLoadResult?apiId=430&status=0&userId=" + getCookie("orgCode") + "&orderType=" + this.flow
      }
    },
    onclick() {
          this.$message.info("功能暂时关闭")
    },
   }
};
</script>
<style lang='scss' scoped>
.homeworkPath {
  .top {
    padding: 1.25rem 1.875rem;
    .el-input{
      width: 20%;
    }
  }
}
</style>