|
|
|
@ -602,6 +602,7 @@ import {
|
|
|
|
|
postloadArriveCarByLoadId, |
|
|
|
|
postloadCancelArriveCarByLoadId, |
|
|
|
|
postUnloadByLoadId, |
|
|
|
|
postUnloadByLoadIdBefore, |
|
|
|
|
} from '@/api/distribution/VehicleArrivalManagement'; |
|
|
|
|
import { |
|
|
|
|
postStartCarByLoadId, |
|
|
|
@ -1348,47 +1349,62 @@ const packageInputsc = (value, row) => {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 卸车确认 */ |
|
|
|
|
const handleUnloadByLoadId = (type: 1 | 2) => { |
|
|
|
|
if (!ChecksWhetherTheWarehouseIsSelected()) |
|
|
|
|
return ElMessage.warning('多仓权限无法操作,请选择仓库'); |
|
|
|
|
const handleUnloadByLoadId = async (type: 1 | 2) => { |
|
|
|
|
try { |
|
|
|
|
if (!ChecksWhetherTheWarehouseIsSelected()) |
|
|
|
|
return ElMessage.warning('多仓权限无法操作,请选择仓库'); |
|
|
|
|
|
|
|
|
|
if (details.selectionList.length === 0) return ElMessage.warning('请选择需要卸车的数据'); |
|
|
|
|
if (details.selectionList.length > 1) return ElMessage.warning('只支持单条数据操作'); |
|
|
|
|
if (details.selectionList.length === 0) return ElMessage.warning('请选择需要卸车的数据'); |
|
|
|
|
if (details.selectionList.length > 1) return ElMessage.warning('只支持单条数据操作'); |
|
|
|
|
details.loadingObj.pageLoading = true; |
|
|
|
|
|
|
|
|
|
ElMessageBox.confirm( |
|
|
|
|
'请确认卸车数据是否完成,未卸车数据将进入异常列表。', |
|
|
|
|
type === 1 ? '中途卸车确认' : '终点卸车确认', |
|
|
|
|
{ |
|
|
|
|
confirmButtonText: '确认', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
} |
|
|
|
|
).then(async () => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.pageLoading = true; |
|
|
|
|
const item = details.selectionList[0]; |
|
|
|
|
const res = await postUnloadByLoadIdBefore({ loadId: item.id }); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
|
|
|
|
|
const submitData = { |
|
|
|
|
loadId: details.selectionList.map(val => val.id).join(','), |
|
|
|
|
unloadType: type, |
|
|
|
|
}; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
|
|
|
|
|
const res = await postUnloadByLoadId(submitData); |
|
|
|
|
const { code } = res.data; |
|
|
|
|
if (code !== 200) { |
|
|
|
|
return; |
|
|
|
|
ElMessageBox.confirm( |
|
|
|
|
'请确认卸车数据是否完成,未卸车数据将进入异常列表。', |
|
|
|
|
type === 1 ? '中途卸车确认' : '终点卸车确认', |
|
|
|
|
{ |
|
|
|
|
confirmButtonText: '确认', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
} |
|
|
|
|
ElMessage({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '卸车成功', |
|
|
|
|
}); |
|
|
|
|
) |
|
|
|
|
.then(async () => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.pageLoading = true; |
|
|
|
|
|
|
|
|
|
onLoad(); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.pageLoading = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
const submitData = { |
|
|
|
|
loadId: item.id, |
|
|
|
|
unloadType: type, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const res = await postUnloadByLoadId(submitData); |
|
|
|
|
const { code } = res.data; |
|
|
|
|
if (code !== 200) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ElMessage({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '卸车成功', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
onLoad(); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.pageLoading = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.pageLoading = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 显示装载清单 */ |
|
|
|
|