<template>
  <!-- 司机接单 -->
  <div class="homeworkPath">
    <div class="top">
       <el-input class="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>
    </div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <!-- 未下发 -->
      <el-tab-pane label="已接收" name="first">
        <dilTable v-bind.sync="option1" ref="table">
        </dilTable>
      </el-tab-pane>
      <!-- 已下发 -->
      <el-tab-pane label="已拒绝" name="second">
        <dilTable v-bind.sync="option2">
        </dilTable>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
export default {
  name: "inplantTMS",
  data() {
    return {
      input: "",
      Time: "",
      activeName: "first",
      option1: {
        // 表格请求数据的地址
        requestUrl: "/api/v1/oms/getReceiveRefuseOrder/1?apiId=117&orderType=8"
      },
      option2: {
        // 表格请求数据的地址
        requestUrl: "/api/v1/oms/getReceiveRefuseOrder/0?apiId=240&orderType=8",
      }
    };
  },
  methods: {
    onclick() {
        if(this.activeName == "first"){
        this.option1.requestUrl="/api/v1/oms/getReceiveRefuseOrder/1?apiId=117&orderType=8&con=" + this.input;
      }else{
        this.option2.requestUrl="/api/v1/oms/getReceiveRefuseOrder/0?apiId=117&orderType=8&con=" + this.input;
      }
    },
     handleClick(tab, event) {
      console.log(tab, event);
    },
  },
};
</script>
<style lang='scss' scoped>
.homeworkPath {
  .top {
    padding: 1.25rem 0.375rem;
    .el-input {
      width: 20%;
      margin-right: 1.25rem;
    }
  }
}
</style>