333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<template>
  <!-- 面包屑导航区 -->   
  <div>
   <el-input v-model="input" placeholder="请输入撤销凭证" style="width:200px"></el-input>
   &nbsp;&nbsp;
     <el-button type="info" @click="revocation" >sap凭证撤销</el-button>
     &nbsp;&nbsp;
      <el-input v-model="stockName" placeholder="请输入货位名称" style="width:200px"></el-input>
   &nbsp;&nbsp;
     <el-button type="danger" @click="stockDelete" >清除库位</el-button>
     <el-button type="success" @click="stockunlock" >解锁库位</el-button>
 &nbsp;&nbsp;
     
   <el-select v-model="deviceCodeValue" placeholder="选择拆叠盘设备">
    <el-option
      v-for="item in deviceCode"
      :key="item.value"
      :label="item.label"
      :value="item.value">
    </el-option>
  </el-select>
    <el-button type="primary"  @click="resetDeviceStatus" >复位拆叠盘机状态</el-button>
  </div>
</template>
<script>
import { userInfoCookie, menuListCookie } from "@/utils/auth";
export default {
  data() {
    return {
      input: "",
      stockName: "",
      deviceCode: [
        {
          value: "1",
          label: "大拆盘机"
        },
        {
          value: "2",
          label: "小拆盘机"
        },
        {
          value: "3",
          label: "大叠盘机"
        },
        {
          value: "4",
          label: "小叠盘机"
        }
      ],
      deviceCodeValue: ""
    };
  },
  created() {},
  mounted() {},
  methods: {
    revocation() {
      const url = "/api/task/reverser";
      const params = this.input;
 
      var callback = res => {
        this.input = "";
        return this.$message.error(res.data);
      };
      this.common.ajax(url, params, callback, true);
    },
 
    stockDelete() {
      this.$confirm("确定要删除库存吗?", "删除", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          const url = "/api/task/stockDelete";
          const params = {
            isremove: 1,
            positionName: this.stockName,
            username: userInfoCookie.getUserInfo().userTrueName
          };
          var callback = res => {
            this.stockName = "";
            debugger;
            if (res.result === true) return this.$message.success(res.data);
            return this.$message.error(res.data);
          };
          this.common.ajax(url, params, callback, true);
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消"
          });
        });
    },
    stockunlock() {
      this.$confirm("确定要解锁库位吗?", "删除", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          const url = "/api/task/stockDelete";
          const params = {
            isremove: 2,
            positionName: this.stockName,
            username: userInfoCookie.getUserInfo().userTrueName
          };
          var callback = res => {
            this.stockName = "";
            debugger;
            if (res.result === true) return this.$message.success(res.data);
            return this.$message.error(res.data);
          };
          this.common.ajax(url, params, callback, true);
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消"
          });
        });
    },
    resetDeviceStatus() {
      debugger;
      const url = "/api/task/resetDeviceStatus";
      const params = this.deviceCodeValue;
      var callback = res => {
        this.stockName = "";
        debugger;
        if (res.result === true) return this.$message.success(res.data);
        return this.$message.error(res.data);
      };
      this.common.ajax(url, params, callback, true);
    }
  }
 
  //
};
</script>
<style lang="postcss" scoped>
.el-table {
  margin-top: 10px;
  line-height: 30px;
}
.el-col {
  line-height: 30px;
}
</style>