|
|
@@ -209,6 +209,7 @@ import { showToast, showLoadingToast, closeToast } from 'vant'
|
|
|
import { useStore } from '@/store/modules/user'
|
|
|
import { getWorkingDetailsByBox, getBoxSplitCode, boxInbound, reissueTask, getBoxStatus, type BoxRelatedMergeDetailsVO, type LocationMergeDetails } from '@/api/location/merge'
|
|
|
import { getInventory, inventoryMovement } from '@/api/inventory'
|
|
|
+import { boxAndStationUnbindTask } from '@/api/haikang'
|
|
|
import { showConfirmDialog } from 'vant'
|
|
|
import { getHeader, androidFocus, scanError, scanSuccess } from '@/utils/android'
|
|
|
|
|
|
@@ -811,6 +812,11 @@ const handleStationClick = (station: StationItem) => {
|
|
|
showReissueConfirm(station)
|
|
|
return
|
|
|
}
|
|
|
+ // 空料箱状态弹出解绑确认框
|
|
|
+ if (station.status === 'emptyBox') {
|
|
|
+ showUnbindConfirm(station)
|
|
|
+ return
|
|
|
+ }
|
|
|
// 分割的料箱不处理,由子库位处理
|
|
|
if (station.splitCount) return
|
|
|
// 其他状态正常选择
|
|
|
@@ -831,6 +837,45 @@ const showReissueConfirm = (station: StationItem) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 显示解绑确认框
|
|
|
+const showUnbindConfirm = (station: StationItem) => {
|
|
|
+ showConfirmDialog({
|
|
|
+ title: '解绑确认',
|
|
|
+ message: '您正在进行解绑操作,是否继续?'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ doUnbindTask(station)
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // 用户取消
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 执行解绑任务
|
|
|
+const doUnbindTask = async (station: StationItem) => {
|
|
|
+ try {
|
|
|
+ showLoadingToast({ message: '正在解绑...', forbidClick: true })
|
|
|
+ const data = {
|
|
|
+ warehouse,
|
|
|
+ boxCode: station.boxCode,
|
|
|
+ stationCode: station.stationCode,
|
|
|
+ releaseStation: false
|
|
|
+ }
|
|
|
+ await boxAndStationUnbindTask(data)
|
|
|
+ closeToast()
|
|
|
+ scanSuccess()
|
|
|
+ showToast('料箱解绑成功')
|
|
|
+ // 局部刷新料箱状态
|
|
|
+ setTimeout(() => {
|
|
|
+ refreshBoxStatus()
|
|
|
+ }, 500)
|
|
|
+ } catch (error: any) {
|
|
|
+ closeToast()
|
|
|
+ scanError()
|
|
|
+ showToast(error.message || '解绑失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 获取当前所有料箱编码列表
|
|
|
const getBoxCodeList = (): string[] => {
|
|
|
return stationList.value
|