//倒库
<template>
  <div class="steel_inbound">
    <div class="sache">
      <el-input
        placeholder="请输入内容"
        v-model="inputText"
        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="toInsert">
        <i class="el-icon-plus"></i>新增
      </el-button>
    </div>
    <div class="table">
      <dilTable v-bind.sync="options">
        <el-table-column fixed="right" label="操作" width="240">
          <template slot-scope="scope">
             <el-button type="text" size="mini" @click="selectContract(scope)">
              查看
            </el-button>
            <el-button type="text" size="mini" @click="deleted(scope)">
              删除
            </el-button>
          </template>
        </el-table-column>
      </dilTable>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      inputText:"",
      options:{
        // first请求数据的地址
        requestUrl: "/api/v1/wms/getIvboundMakeResultList?apiId=372",
      },
    }
  },
  methods:{
     toInsert() {
      this.$router.push("/addTransfer");
    },
    onclick(){
      console.log("点击事件");
    },
    deleted(scope){   
      console.log(scope.row)
      this.$confirm("是否删除", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true,
      })
      .then(() => {
      this.axios
            .post(
              "/api/v1/wms/deleteIvboundMakeResult/" + scope.row.resultId
            )
            .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: "取消删除!",
          });
        });
    }
  }
}
</script>

<style lang="scss" >
.steel_inbound {
  .sache {
    padding: 40px;
    .el-input {
      width: 250px;
      margin-right: 20px;
    }
  }
}
</style>