schangxiang@126.com
2025-09-10 3d43ffa3152110b7823f9fa6320c08a6ae02358a
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<template>
  <!-- 面包屑导航区 -->   
  <div>
    <br>
   <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;
     
  
  
 
     <div>
          <br>  <br>  <br>  <br>  <br>  <br>  <br>  <br>
       <h3>---------------------------------↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓异常任务处理↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓--------------------------------------------------------</h3>
       <br>
       <el-input v-model="deleteValue" placeholder="输入托盘号/器具编号" style="width:200px"></el-input>
   &nbsp;&nbsp;
     <el-button type="danger" @click="deleteTask" >删除任务</el-button> 
       &nbsp;&nbsp;  &nbsp;&nbsp;  &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>
  </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: '',
      deleteValue: ''
    }
  },
  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() {
      if (this.stockName.trim() == '') {
        return this.$message.error('请输入库位号!')
      }
      this.$confirm('确定要删除库存吗?', '删除', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          const url = '/api/task/stockDelete'
          const params = {
            isremove: 1,
            positionName: this.stockName.trim(),
            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() {
      if (this.stockName.trim() == '') {
        return this.$message.error('请输入库位号!')
      }
      this.$confirm('确定要解锁库位吗?', '删除', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          const url = '/api/task/stockDelete'
 
          const params = {
            isremove: 2,
            positionName: this.stockName.trim(),
            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: '已取消'
          })
        })
    },
    // 根据托盘号删除任务
    deleteTask() {
      debugger
 
      const url = '/api/task/deleteTask'
      const params = this.deleteValue.trim()
      if (params == '') {
        return this.$message.error('请输入托盘号!')
      }
      var callback = res => {
        this.stockName = ''
        debugger
        if (res.result === true) return this.$message.success(res.msg)
        return this.$message.error(res.msg)
      }
      this.common.ajax(url, params, callback, true)
    },
    resetDeviceStatus() {
      debugger
      const url = '/api/task/resetDeviceStatus'
      const params = this.deviceCodeValue.trim()
      if (params == '') {
        return this.$message.error('请选择设备号!')
      }
      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>