Browse Source

提交栈板

master
常熟吴彦祖 4 months ago
parent
commit
2492a31f95
  1. 3
      src/api/automatedWarehouse/palletPacking.js
  2. 187
      src/views/modules/automatedWarehouse/palletPacking.vue

3
src/api/automatedWarehouse/palletPacking.js

@ -38,3 +38,6 @@ export const createPalletTransportTask = data => createAPI(`/wcsIntegration/crea
// Call栈板到指定站点 - AI制作
export const callPalletToStation = data => createAPI(`/wcsIntegration/callPalletToStation`,'post',data)
// Call栈板到指定站点(包含组盘处理) - AI制作
export const callPalletToStationWithUpdateZuPan = data => createAPI(`/wcsIntegration/callPalletToStationWithUpdateZuPan`,'post',data)

187
src/views/modules/automatedWarehouse/palletPacking.vue

@ -288,22 +288,15 @@
/>
</div>
<!-- 起点站点选择 -->
<!-- 起点站点显示只读从栈板位置自动获取 -->
<div class="input-group">
<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>
<!-- 目标站点选择 -->
@ -311,15 +304,14 @@
<label class="input-label">目标站点</label>
<el-select
v-model="selectedTargetStation"
placeholder="请先选择起点站点"
placeholder="请选择目标站点"
style="width: 100%;"
:disabled="!selectedStartStation"
>
<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>
</div>
@ -343,11 +335,28 @@
:append-to-body="true"
>
<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">
<label class="input-label">目标站点</label>
<el-select
v-model="selectedCallStation"
v-model="selectedCallTargetStation"
placeholder="请选择目标站点"
style="width: 100%;"
>
@ -381,9 +390,8 @@ import {
getLayersForEdit,
updatePalletDetailPosition,
getAgvStations,
getTargetStations,
createPalletTransportTask,
callPalletToStation
callPalletToStation,
callPalletToStationWithUpdateZuPan
} from '../../../api/automatedWarehouse/palletPacking'
export default {
@ -413,15 +421,15 @@ export default {
//
transportModalVisible: false,
startStationOptions: [],
targetStationOptions: [],
selectedStartStation: '',
transportStationOptions: [],
currentPalletStation: '',
selectedTargetStation: '',
// Call
callPalletModalVisible: false,
callStationOptions: [],
selectedCallStation: '',
selectedCallStartStation: '',
selectedCallTargetStation: '',
//
editPositionModalVisible: false,
@ -452,7 +460,6 @@ export default {
if (data.code === 0) {
this.palletScanned = true;
this.positionOptions = data.positions || [];
this.$message.success('栈板验证成功');
this.refreshTable();
} else {
this.$message.error(data.msg || '栈板不存在');
@ -466,7 +473,8 @@ export default {
// Call -
handleCallPallet() {
this.callPalletModalVisible = true;
this.selectedCallStation = '';
this.selectedCallStartStation = '';
this.selectedCallTargetStation = '';
// AGV
getAgvStations({}).then(({ data }) => {
@ -725,49 +733,47 @@ export default {
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 = [];
// AGVCall
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() {
if (!this.selectedStartStation) {
this.$message.error('请选择起点站点');
if (!this.currentPalletStation) {
this.$message.error('无法获取当前栈板位置');
return;
}
if (!this.selectedTargetStation) {
@ -775,15 +781,23 @@ export default {
return;
}
createPalletTransportTask({
//
if (this.currentPalletStation === this.selectedTargetStation) {
this.$message.error('起始站点和目标站点不能相同');
return;
}
//
callPalletToStationWithUpdateZuPan({
site: this.site,
palletId: this.palletCode,
startStation: this.selectedStartStation,
endStation: this.selectedTargetStation
startStation: this.currentPalletStation,
targetStation: this.selectedTargetStation
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('运输任务创建成功');
this.$message.success('栈板运输任务创建成功');
this.closeTransportModal();
//
this.refreshTable();
} else {
this.$message.error(data.msg || '创建运输任务失败');
}
@ -796,22 +810,32 @@ export default {
//
closeTransportModal() {
this.transportModalVisible = false;
this.selectedStartStation = '';
this.currentPalletStation = '';
this.selectedTargetStation = '';
this.startStationOptions = [];
this.targetStationOptions = [];
this.transportStationOptions = [];
},
// Call
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;
}
callPalletToStation({
site: this.site,
station: this.selectedCallStation
startStation: this.selectedCallStartStation,
targetStation: this.selectedCallTargetStation
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('空托盘调用任务创建成功');
@ -828,7 +852,8 @@ export default {
// Call
closeCallPalletModal() {
this.callPalletModalVisible = false;
this.selectedCallStation = '';
this.selectedCallStartStation = '';
this.selectedCallTargetStation = '';
this.callStationOptions = [];
},

Loading…
Cancel
Save