|
|
@ -288,22 +288,15 @@ |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 起点站点选择 --> |
|
|
|
|
|
|
|
|
<!-- 起点站点显示(只读,从栈板位置自动获取) --> |
|
|
<div class="input-group"> |
|
|
<div class="input-group"> |
|
|
<label class="input-label">起点站点</label> |
|
|
<label class="input-label">起点站点</label> |
|
|
<el-select |
|
|
|
|
|
v-model="selectedStartStation" |
|
|
|
|
|
placeholder="请选择起点站点" |
|
|
|
|
|
style="width: 100%;" |
|
|
|
|
|
@change="handleStartStationChange" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="station in startStationOptions" |
|
|
|
|
|
:key="station.stationCode" |
|
|
|
|
|
:label="`${station.stationCode} - ${station.stationName}`" |
|
|
|
|
|
:value="station.stationCode" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="currentPalletStation" |
|
|
|
|
|
placeholder="当前栈板位置" |
|
|
|
|
|
class="form-input" |
|
|
|
|
|
readonly |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 目标站点选择 --> |
|
|
<!-- 目标站点选择 --> |
|
|
@ -311,15 +304,14 @@ |
|
|
<label class="input-label">目标站点</label> |
|
|
<label class="input-label">目标站点</label> |
|
|
<el-select |
|
|
<el-select |
|
|
v-model="selectedTargetStation" |
|
|
v-model="selectedTargetStation" |
|
|
placeholder="请先选择起点站点" |
|
|
|
|
|
|
|
|
placeholder="请选择目标站点" |
|
|
style="width: 100%;" |
|
|
style="width: 100%;" |
|
|
:disabled="!selectedStartStation" |
|
|
|
|
|
> |
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="target in targetStationOptions" |
|
|
|
|
|
:key="target.stationCode" |
|
|
|
|
|
:label="`${target.stationCode} - ${target.stationName}`" |
|
|
|
|
|
:value="target.stationCode" |
|
|
|
|
|
|
|
|
v-for="station in transportStationOptions" |
|
|
|
|
|
:key="station.stationCode" |
|
|
|
|
|
:label="`${station.stationCode} - ${station.stationName}`" |
|
|
|
|
|
:value="station.stationCode" |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
@ -343,11 +335,28 @@ |
|
|
:append-to-body="true" |
|
|
:append-to-body="true" |
|
|
> |
|
|
> |
|
|
<div class="call-modal-content"> |
|
|
<div class="call-modal-content"> |
|
|
|
|
|
<!-- 起始站点选择 --> |
|
|
|
|
|
<div class="input-group"> |
|
|
|
|
|
<label class="input-label">起始站点</label> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="selectedCallStartStation" |
|
|
|
|
|
placeholder="请选择起始站点" |
|
|
|
|
|
style="width: 100%;" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="station in callStationOptions" |
|
|
|
|
|
:key="station.stationCode" |
|
|
|
|
|
:label="`${station.stationCode} - ${station.stationName}`" |
|
|
|
|
|
:value="station.stationCode" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 目标站点选择 --> |
|
|
<!-- 目标站点选择 --> |
|
|
<div class="input-group"> |
|
|
<div class="input-group"> |
|
|
<label class="input-label">目标站点</label> |
|
|
<label class="input-label">目标站点</label> |
|
|
<el-select |
|
|
<el-select |
|
|
v-model="selectedCallStation" |
|
|
|
|
|
|
|
|
v-model="selectedCallTargetStation" |
|
|
placeholder="请选择目标站点" |
|
|
placeholder="请选择目标站点" |
|
|
style="width: 100%;" |
|
|
style="width: 100%;" |
|
|
> |
|
|
> |
|
|
@ -381,9 +390,8 @@ import { |
|
|
getLayersForEdit, |
|
|
getLayersForEdit, |
|
|
updatePalletDetailPosition, |
|
|
updatePalletDetailPosition, |
|
|
getAgvStations, |
|
|
getAgvStations, |
|
|
getTargetStations, |
|
|
|
|
|
createPalletTransportTask, |
|
|
|
|
|
callPalletToStation |
|
|
|
|
|
|
|
|
callPalletToStation, |
|
|
|
|
|
callPalletToStationWithUpdateZuPan |
|
|
} from '../../../api/automatedWarehouse/palletPacking' |
|
|
} from '../../../api/automatedWarehouse/palletPacking' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
@ -413,15 +421,15 @@ export default { |
|
|
|
|
|
|
|
|
// 运输任务模态框 |
|
|
// 运输任务模态框 |
|
|
transportModalVisible: false, |
|
|
transportModalVisible: false, |
|
|
startStationOptions: [], |
|
|
|
|
|
targetStationOptions: [], |
|
|
|
|
|
selectedStartStation: '', |
|
|
|
|
|
|
|
|
transportStationOptions: [], |
|
|
|
|
|
currentPalletStation: '', |
|
|
selectedTargetStation: '', |
|
|
selectedTargetStation: '', |
|
|
|
|
|
|
|
|
// Call栈板模态框 |
|
|
// Call栈板模态框 |
|
|
callPalletModalVisible: false, |
|
|
callPalletModalVisible: false, |
|
|
callStationOptions: [], |
|
|
callStationOptions: [], |
|
|
selectedCallStation: '', |
|
|
|
|
|
|
|
|
selectedCallStartStation: '', |
|
|
|
|
|
selectedCallTargetStation: '', |
|
|
|
|
|
|
|
|
// 修改位置模态框 |
|
|
// 修改位置模态框 |
|
|
editPositionModalVisible: false, |
|
|
editPositionModalVisible: false, |
|
|
@ -452,7 +460,6 @@ export default { |
|
|
if (data.code === 0) { |
|
|
if (data.code === 0) { |
|
|
this.palletScanned = true; |
|
|
this.palletScanned = true; |
|
|
this.positionOptions = data.positions || []; |
|
|
this.positionOptions = data.positions || []; |
|
|
this.$message.success('栈板验证成功'); |
|
|
|
|
|
this.refreshTable(); |
|
|
this.refreshTable(); |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(data.msg || '栈板不存在'); |
|
|
this.$message.error(data.msg || '栈板不存在'); |
|
|
@ -466,7 +473,8 @@ export default { |
|
|
// Call栈板 - 调用空托盘 |
|
|
// Call栈板 - 调用空托盘 |
|
|
handleCallPallet() { |
|
|
handleCallPallet() { |
|
|
this.callPalletModalVisible = true; |
|
|
this.callPalletModalVisible = true; |
|
|
this.selectedCallStation = ''; |
|
|
|
|
|
|
|
|
this.selectedCallStartStation = ''; |
|
|
|
|
|
this.selectedCallTargetStation = ''; |
|
|
|
|
|
|
|
|
// 获取AGV站点列表 |
|
|
// 获取AGV站点列表 |
|
|
getAgvStations({}).then(({ data }) => { |
|
|
getAgvStations({}).then(({ data }) => { |
|
|
@ -725,49 +733,47 @@ export default { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.transportModalVisible = true; |
|
|
|
|
|
this.selectedStartStation = ''; |
|
|
|
|
|
this.selectedTargetStation = ''; |
|
|
|
|
|
this.targetStationOptions = []; |
|
|
|
|
|
|
|
|
|
|
|
// 获取AGV站点列表 |
|
|
|
|
|
getAgvStations({}).then(({ data }) => { |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
this.startStationOptions = data.stations || []; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '获取站点列表失败'); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
console.error('获取站点列表失败:', error); |
|
|
|
|
|
this.$message.error('获取站点列表失败'); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 起点站点选择变化 |
|
|
|
|
|
handleStartStationChange() { |
|
|
|
|
|
this.selectedTargetStation = ''; |
|
|
|
|
|
this.targetStationOptions = []; |
|
|
|
|
|
|
|
|
|
|
|
if (this.selectedStartStation) { |
|
|
|
|
|
getTargetStations({ |
|
|
|
|
|
startStation: this.selectedStartStation |
|
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
this.targetStationOptions = data.targets || []; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '获取目标站点失败'); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
console.error('获取目标站点失败:', error); |
|
|
|
|
|
this.$message.error('获取目标站点失败'); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 首先获取当前栈板信息 |
|
|
|
|
|
checkPalletExists({ |
|
|
|
|
|
site: this.site, |
|
|
|
|
|
palletId: this.palletCode |
|
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
|
if (data.code == 0) { |
|
|
|
|
|
// 从返回数据中获取栈板位置信息 |
|
|
|
|
|
this.currentPalletStation = data.locationCode || ''; |
|
|
|
|
|
if (!this.currentPalletStation) { |
|
|
|
|
|
this.$message.error('无法获取当前栈板位置'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.transportModalVisible = true; |
|
|
|
|
|
this.selectedTargetStation = ''; |
|
|
|
|
|
this.transportStationOptions = []; |
|
|
|
|
|
|
|
|
|
|
|
// 获取所有AGV站点列表(和Call栈板一样的逻辑) |
|
|
|
|
|
getAgvStations({}).then(({ data }) => { |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
this.transportStationOptions = data.stations || []; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '获取站点列表失败'); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
console.error('获取站点列表失败:', error); |
|
|
|
|
|
this.$message.error('获取站点列表失败'); |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '获取栈板信息失败'); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
console.error('获取栈板信息失败:', error); |
|
|
|
|
|
this.$message.error('获取栈板信息失败'); |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 确认创建运输任务 |
|
|
// 确认创建运输任务 |
|
|
confirmTransportTask() { |
|
|
confirmTransportTask() { |
|
|
if (!this.selectedStartStation) { |
|
|
|
|
|
this.$message.error('请选择起点站点'); |
|
|
|
|
|
|
|
|
if (!this.currentPalletStation) { |
|
|
|
|
|
this.$message.error('无法获取当前栈板位置'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!this.selectedTargetStation) { |
|
|
if (!this.selectedTargetStation) { |
|
|
@ -775,15 +781,23 @@ export default { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
createPalletTransportTask({ |
|
|
|
|
|
|
|
|
// 前端验证:起始站点和目标站点不能一样 |
|
|
|
|
|
if (this.currentPalletStation === this.selectedTargetStation) { |
|
|
|
|
|
this.$message.error('起始站点和目标站点不能相同'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 调用包含组盘处理的接口 |
|
|
|
|
|
callPalletToStationWithUpdateZuPan({ |
|
|
site: this.site, |
|
|
site: this.site, |
|
|
palletId: this.palletCode, |
|
|
|
|
|
startStation: this.selectedStartStation, |
|
|
|
|
|
endStation: this.selectedTargetStation |
|
|
|
|
|
|
|
|
startStation: this.currentPalletStation, |
|
|
|
|
|
targetStation: this.selectedTargetStation |
|
|
}).then(({ data }) => { |
|
|
}).then(({ data }) => { |
|
|
if (data.code === 0) { |
|
|
if (data.code === 0) { |
|
|
this.$message.success('运输任务创建成功'); |
|
|
|
|
|
|
|
|
this.$message.success('栈板运输任务创建成功'); |
|
|
this.closeTransportModal(); |
|
|
this.closeTransportModal(); |
|
|
|
|
|
// 可能需要刷新栈板明细来反映组盘状态的变化 |
|
|
|
|
|
this.refreshTable(); |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(data.msg || '创建运输任务失败'); |
|
|
this.$message.error(data.msg || '创建运输任务失败'); |
|
|
} |
|
|
} |
|
|
@ -796,22 +810,32 @@ export default { |
|
|
// 关闭运输任务模态框 |
|
|
// 关闭运输任务模态框 |
|
|
closeTransportModal() { |
|
|
closeTransportModal() { |
|
|
this.transportModalVisible = false; |
|
|
this.transportModalVisible = false; |
|
|
this.selectedStartStation = ''; |
|
|
|
|
|
|
|
|
this.currentPalletStation = ''; |
|
|
this.selectedTargetStation = ''; |
|
|
this.selectedTargetStation = ''; |
|
|
this.startStationOptions = []; |
|
|
|
|
|
this.targetStationOptions = []; |
|
|
|
|
|
|
|
|
this.transportStationOptions = []; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 确认Call栈板 |
|
|
// 确认Call栈板 |
|
|
confirmCallPallet() { |
|
|
confirmCallPallet() { |
|
|
if (!this.selectedCallStation) { |
|
|
|
|
|
this.$message.error('请选择站点'); |
|
|
|
|
|
|
|
|
if (!this.selectedCallStartStation) { |
|
|
|
|
|
this.$message.error('请选择起始站点'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.selectedCallTargetStation) { |
|
|
|
|
|
this.$message.error('请选择目标站点'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 前端验证:两个站点不能一样 |
|
|
|
|
|
if (this.selectedCallStartStation === this.selectedCallTargetStation) { |
|
|
|
|
|
this.$message.error('起始站点和目标站点不能相同'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
callPalletToStation({ |
|
|
callPalletToStation({ |
|
|
site: this.site, |
|
|
site: this.site, |
|
|
station: this.selectedCallStation |
|
|
|
|
|
|
|
|
startStation: this.selectedCallStartStation, |
|
|
|
|
|
targetStation: this.selectedCallTargetStation |
|
|
}).then(({ data }) => { |
|
|
}).then(({ data }) => { |
|
|
if (data.code === 0) { |
|
|
if (data.code === 0) { |
|
|
this.$message.success('空托盘调用任务创建成功'); |
|
|
this.$message.success('空托盘调用任务创建成功'); |
|
|
@ -828,7 +852,8 @@ export default { |
|
|
// 关闭Call栈板模态框 |
|
|
// 关闭Call栈板模态框 |
|
|
closeCallPalletModal() { |
|
|
closeCallPalletModal() { |
|
|
this.callPalletModalVisible = false; |
|
|
this.callPalletModalVisible = false; |
|
|
this.selectedCallStation = ''; |
|
|
|
|
|
|
|
|
this.selectedCallStartStation = ''; |
|
|
|
|
|
this.selectedCallTargetStation = ''; |
|
|
this.callStationOptions = []; |
|
|
this.callStationOptions = []; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|