// 分解计划
<template>
  <div class="steel_inbound">
    <div class="sache">
      <el-input placeholder="请输入内容" v-model="inputText" clearable>
      </el-input>
      <el-button type="primary" class="btn">
        <i class="el-icon-search"></i>查询
      </el-button>
    </div>
    <template>
      <div>
        <dilTable v-bind.sync="second">
          <el-table-column fixed="right" label="操作" width="50">
            <template slot-scope="scope">
              <el-button
                type="text"
                size="mini"
                @click="desponseRailPlan(scope)"
              >
                分解
              </el-button>
            </template>
          </el-table-column>
        </dilTable>
      </div>
    </template>
  </div>
</template>
<script>
export default {
  data() {
    return {
      inputText: "",
      first: {
        // first请求数据的地址
        requestUrl:
          "/api/v1/ams/getRailOffsetDayplan?apiId=183&dayplanReceiveStatus=0&carrierId=9",
      },
      second: {
        // second请求数据的地址
        requestUrl:
          "/api/v1/ams/getRailOffsetDayplan?apiId=183&dayplanReceiveStatus=1&carrierId=9",
      },
      activeName: "first",
    };
  },
  methods: {
    // allReceive(){

    // },
    receiver(scope) {
      this.$confirm("是否接收", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true,
      })
        .then(() => {
          this.$axios
            .post("/api/v1/ams//receiveInwardPlan/" + scope.row.planId)
            .then((res) => {
              if (res.data.code == 200) {
                this.$message({
                  type: "success",
                  message: "接收成功!",
                });
                this.$router.go(0);
              } else {
                this.$message({
                  message: "接收失败",
                  type: "warning",
                });
              }
            });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "接收操作已取消!",
          });
        });
    },
    selectionChange(selection) {
      this.second.mapList = selection;
    },
    desponseRailPlan(scope) {
      this.$router.push("/decomposeRailPlan/" + scope.row.dayPlanId);
    },
  }
};
</script>
<style lang="scss">
.steel_inbound {
  .sache {
    height: 5rem;
    display: flex;
    align-items: center;
    padding-left: 1.875rem;
  }
}
</style>
