|
|
@ -107,10 +107,11 @@ |
|
|
|
|
|
|
|
|
<!-- 底部操作按钮 --> |
|
|
<!-- 底部操作按钮 --> |
|
|
<div class="bottom-actions" v-if="scannedItems.length > 0"> |
|
|
<div class="bottom-actions" v-if="scannedItems.length > 0"> |
|
|
<button class="action-btn primary" @click="confirmMove"> |
|
|
|
|
|
确认移库 |
|
|
|
|
|
|
|
|
<button class="action-btn primary" @click="confirmMove" :disabled="loading"> |
|
|
|
|
|
<i v-if="loading" class="el-icon-loading"></i> |
|
|
|
|
|
{{ loading ? '移库中...' : '确认移库' }} |
|
|
</button> |
|
|
</button> |
|
|
<button class="action-btn secondary" style="margin-left: 10px;" @click="cancelProcess"> |
|
|
|
|
|
|
|
|
<button class="action-btn secondary" style="margin-left: 10px;" @click="cancelProcess" :disabled="loading"> |
|
|
取消 |
|
|
取消 |
|
|
</button> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
@ -132,7 +133,8 @@ export default { |
|
|
targetLocationId: '' |
|
|
targetLocationId: '' |
|
|
}, |
|
|
}, |
|
|
scannedItems: [], |
|
|
scannedItems: [], |
|
|
site: localStorage.getItem('site') || 'SITE01' |
|
|
|
|
|
|
|
|
site: localStorage.getItem('site') || 'SITE01', |
|
|
|
|
|
loading: false |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
@ -307,8 +309,12 @@ export default { |
|
|
scannedItems: this.scannedItems |
|
|
scannedItems: this.scannedItems |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 开始loading |
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
|
// 调用后端API |
|
|
// 调用后端API |
|
|
confirmInventoryMove(params).then(({ data }) => { |
|
|
confirmInventoryMove(params).then(({ data }) => { |
|
|
|
|
|
this.loading = false; |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.$message({ |
|
|
this.$message({ |
|
|
message: '移库成功!处理单元: ' + handlingUnitIds.length + '个', |
|
|
message: '移库成功!处理单元: ' + handlingUnitIds.length + '个', |
|
|
@ -316,19 +322,43 @@ export default { |
|
|
duration: 3000 |
|
|
duration: 3000 |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 跳转回其他出入库页面 |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.$router.push({ path: '/otherinout' }); |
|
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
// 清空页面内容,留在当前页面 |
|
|
|
|
|
this.clearPageContent(); |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(data.msg || '移库失败'); |
|
|
this.$message.error(data.msg || '移库失败'); |
|
|
} |
|
|
} |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
|
|
|
this.loading = false; |
|
|
console.error('移库失败:', error); |
|
|
console.error('移库失败:', error); |
|
|
this.$message.error('移库失败,请重试'); |
|
|
this.$message.error('移库失败,请重试'); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 清空页面内容 |
|
|
|
|
|
clearPageContent() { |
|
|
|
|
|
// 清空表单数据 |
|
|
|
|
|
this.moveForm = { |
|
|
|
|
|
moveReason: '', |
|
|
|
|
|
targetLocationId: '' |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 清空已扫描的物料列表 |
|
|
|
|
|
this.scannedItems = []; |
|
|
|
|
|
|
|
|
|
|
|
// 清空扫描框 |
|
|
|
|
|
this.scanCode = ''; |
|
|
|
|
|
|
|
|
|
|
|
// 重置为添加模式 |
|
|
|
|
|
this.isRemoveMode = false; |
|
|
|
|
|
|
|
|
|
|
|
// 让扫描框重新获得焦点 |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
if (this.$refs.scanInput) { |
|
|
|
|
|
this.$refs.scanInput.focus(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 取消处理 |
|
|
// 取消处理 |
|
|
cancelProcess() { |
|
|
cancelProcess() { |
|
|
if (this.scannedItems.length > 0) { |
|
|
if (this.scannedItems.length > 0) { |
|
|
@ -656,6 +686,27 @@ export default { |
|
|
transform: scale(0.98); |
|
|
transform: scale(0.98); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.action-btn:disabled { |
|
|
|
|
|
background: #c0c4cc !important; |
|
|
|
|
|
border-color: #c0c4cc !important; |
|
|
|
|
|
color: white !important; |
|
|
|
|
|
cursor: not-allowed !important; |
|
|
|
|
|
transform: none !important; |
|
|
|
|
|
box-shadow: none !important; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.action-btn:disabled:hover { |
|
|
|
|
|
background: #c0c4cc !important; |
|
|
|
|
|
transform: none !important; |
|
|
|
|
|
box-shadow: none !important; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.action-btn.secondary:disabled { |
|
|
|
|
|
background: #f5f7fa !important; |
|
|
|
|
|
color: #c0c4cc !important; |
|
|
|
|
|
border-color: #e4e7ed !important; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/* 响应式设计 */ |
|
|
/* 响应式设计 */ |
|
|
@media (max-width: 360px) { |
|
|
@media (max-width: 360px) { |
|
|
.status-bar { |
|
|
.status-bar { |
|
|
|