<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>
      <el-button type="primary" class="btn" @click="insert"> 出库 </el-button>
    </div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <mergeRowTable v-bind.sync="option1" ref="table">
        <el-table-column fixed="right" label="操作" width="50">
          <template slot-scope="scope">
            <el-button
              @click="click(scope.row.resultId)"
              type="text"
              size="small"
              :disabled="scope.row.isEdit!=1"
              >修改</el-button
            >
            <!-- <el-button
            type="text"
            size="small"
            @click="deleteclick(scope.row.resultId)"
            >删除</el-button > -->
          </template>
        </el-table-column>
      </mergeRowTable>
    </el-tabs>
  </div>
</template>

<script>
import { getCookie } from "@/utils/util.js";
export default {
  name: "inplantTMS",
  data() {
    return {
      input: "",
      Time: "",
      activeName: "first",
      option1: {
        // 表格请求数据的地址
        requestUrl: "/api/v1/wmsh/getUnLockPortStock?apiId=494",
        comparison: "resultNumber",
        columnIndexs: [0, 1, 2, 3, 4, 5],
      },
    };
  },
  filters: {},
  methods: {
    onclick() {
      if (this.activeName == "first") {
        this.option1.requestUrl =
          "/api/v1/wmsh/getUnLockPortStock?apiId=494&con=" + this.input;
      }
    },
    insert() {
      this.$router.push("/addWagonLoadCopy");
    },
    handleClick(tab, event) {
      console.log(tab, event);
    },
    click(resultId) {
      console.log("res",getCookie("orgCode"));
      if (
        getCookie("orgCode") == "yuanliaogongsi" ||
        getCookie("orgCode") == "dagangadmin"
      ) {
       this.$router.push("/editOutBoundWagon/" + resultId);
      
      } else {
          this.$message.warning("权限不足,请联系部门管理员!");
        }
    },
  },
};
</script>
<style lang="scss" scoped>
.homeworkPath {
  .top {
    padding: 1.25rem 0.375rem;
    .el-input {
      width: 20%;
      margin-right: 40rpx;
    }
    .btn {
      width: 5.5%;
      margin-left: 0.25rem;
    }
  }
}
</style>
