Browse Source

提交栈板

master
常熟吴彦祖 4 months ago
parent
commit
40d708da7d
  1. 12
      src/api/automatedWarehouse/palletPacking.js
  2. 343
      src/views/modules/automatedWarehouse/palletPacking.vue

12
src/api/automatedWarehouse/palletPacking.js

@ -26,3 +26,15 @@ export const getLayersForEdit = data => createAPI(`/wcsIntegration/getLayersForE
// 更新栈板明细位置 - AI制作
export const updatePalletDetailPosition = data => createAPI(`/wcsIntegration/updatePalletDetailPosition`,'post',data)
// 获取AGV站点列表 - AI制作
export const getAgvStations = data => createAPI(`/wcsIntegration/getAgvStations`,'post',data)
// 根据起点站点获取可达目标站点 - AI制作
export const getTargetStations = data => createAPI(`/wcsIntegration/getTargetStations`,'post',data)
// 创建栈板运输任务 - AI制作
export const createPalletTransportTask = data => createAPI(`/wcsIntegration/createPalletTransportTask`,'post',data)
// Call栈板到指定站点 - AI制作
export const callPalletToStation = data => createAPI(`/wcsIntegration/callPalletToStation`,'post',data)

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

@ -103,8 +103,11 @@
</div>
<!-- 栈板明细表格 (扫描栈板后显示) -->
<div v-if="palletScanned && detailList.length > 0" class="rma-list">
<div class="list-title">栈板明细</div>
<div v-if="palletScanned" class="rma-list">
<div class="list-title-row">
<div class="list-title">栈板明细</div>
<button class="action-btn secondary" style="margin-left: 10px;" @click="handleTransportOrder">运输指令</button>
</div>
<div class="detail-table">
<div class="table-header">
<div class="col-position">位置</div>
@ -123,13 +126,12 @@
<div class="col-serial">{{ detail.serialNo }}</div>
<div class="col-part">{{ detail.partNo }}</div>
</div>
<!-- 暂无数据提示 -->
<div v-if="detailList.length === 0" class="table-row empty-row">
<div class="empty-hint">暂无栈板明细数据</div>
</div>
</div>
</div>
<!-- 暂无数据提示 -->
<div v-if="palletScanned && detailList.length === 0" class="rma-list">
<div class="empty-hint">暂无栈板明细数据</div>
</div>
</div>
<!-- 扫码模态框 -->
@ -262,6 +264,119 @@
<button class="action-btn secondary" style="margin-left: 10px;" @click="closeEditPositionModal">取消</button>
</div>
</el-dialog>
<!-- 运输任务模态框 -->
<el-dialog
title="创建运输任务"
:visible.sync="transportModalVisible"
width="90%"
:close-on-click-modal="false"
:show-close="false"
:modal="true"
:modal-append-to-body="true"
:append-to-body="true"
>
<div class="transport-modal-content">
<!-- 栈板号只读 -->
<div class="input-group">
<label class="input-label">栈板号</label>
<el-input
v-model="palletCode"
placeholder="栈板号"
class="form-input"
readonly
/>
</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>
</div>
<!-- 目标站点选择 -->
<div class="input-group">
<label class="input-label">目标站点</label>
<el-select
v-model="selectedTargetStation"
placeholder="请先选择起点站点"
style="width: 100%;"
:disabled="!selectedStartStation"
>
<el-option
v-for="target in targetStationOptions"
:key="target.stationCode"
:label="`${target.stationCode} - ${target.stationName}`"
:value="target.stationCode"
/>
</el-select>
</div>
</div>
<div slot="footer" class="dialog-footer">
<button class="action-btn primary" @click="confirmTransportTask">确定</button>
<button class="action-btn secondary" style="margin-left: 10px;" @click="closeTransportModal">取消</button>
</div>
</el-dialog>
<!-- Call栈板模态框 -->
<el-dialog
title="Call栈板"
:visible.sync="callPalletModalVisible"
width="90%"
:close-on-click-modal="false"
:show-close="false"
:modal="true"
:modal-append-to-body="true"
:append-to-body="true"
>
<div class="call-modal-content">
<!-- 栈板号只读 -->
<div class="input-group">
<label class="input-label">栈板号</label>
<el-input
v-model="palletCode"
placeholder="栈板号"
class="form-input"
readonly
/>
</div>
<!-- 目标站点选择 -->
<div class="input-group">
<label class="input-label">目标站点</label>
<el-select
v-model="selectedCallStation"
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>
<div slot="footer" class="dialog-footer">
<button class="action-btn primary" @click="confirmCallPallet">确定</button>
<button class="action-btn secondary" style="margin-left: 10px;" @click="closeCallPalletModal">取消</button>
</div>
</el-dialog>
</div>
</template>
@ -275,7 +390,11 @@ import {
savePalletDetail,
deletePalletDetail,
getLayersForEdit,
updatePalletDetailPosition
updatePalletDetailPosition,
getAgvStations,
getTargetStations,
createPalletTransportTask,
callPalletToStation
} from '../../../api/automatedWarehouse/palletPacking'
export default {
@ -303,6 +422,18 @@ export default {
//
detailList: [],
//
transportModalVisible: false,
startStationOptions: [],
targetStationOptions: [],
selectedStartStation: '',
selectedTargetStation: '',
// Call
callPalletModalVisible: false,
callStationOptions: [],
selectedCallStation: '',
//
editPositionModalVisible: false,
editSerialNo: '',
@ -343,10 +474,27 @@ export default {
});
},
// Call -
// Call -
handleCallPallet() {
// TODO: Call
this.$message.info('Call栈板功能待实现');
if (!this.palletCode) {
this.$message.error('请先扫描栈板编码');
return;
}
this.callPalletModalVisible = true;
this.selectedCallStation = '';
// AGV
getAgvStations({}).then(({ data }) => {
if (data.code === 0) {
this.callStationOptions = data.stations || [];
} else {
this.$message.error(data.msg || '获取站点列表失败');
}
}).catch(error => {
console.error('获取站点列表失败:', error);
this.$message.error('获取站点列表失败');
});
},
//
@ -585,6 +733,152 @@ export default {
this.editOriginalPosition = '';
this.editOriginalLayer = '';
},
//
handleTransportOrder() {
if (!this.palletCode) {
this.$message.error('请先扫描栈板');
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('获取目标站点失败');
});
}
},
//
confirmTransportTask() {
if (!this.selectedStartStation) {
this.$message.error('请选择起点站点');
return;
}
if (!this.selectedTargetStation) {
this.$message.error('请选择目标站点');
return;
}
createPalletTransportTask({
site: this.site,
palletId: this.palletCode,
startStation: this.selectedStartStation,
endStation: this.selectedTargetStation
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('运输任务创建成功');
this.closeTransportModal();
} else {
this.$message.error(data.msg || '创建运输任务失败');
}
}).catch(error => {
console.error('创建运输任务失败:', error);
this.$message.error('创建运输任务失败');
});
},
//
closeTransportModal() {
this.transportModalVisible = false;
this.selectedStartStation = '';
this.selectedTargetStation = '';
this.startStationOptions = [];
this.targetStationOptions = [];
},
// Call
confirmCallPallet() {
if (!this.selectedCallStation) {
this.$message.error('请选择站点');
return;
}
callPalletToStation({
site: this.site,
palletId: this.palletCode,
station: this.selectedCallStation
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('Call栈板任务创建成功');
this.closeCallPalletModal();
} else {
this.$message.error(data.msg || 'Call栈板失败');
}
}).catch(error => {
console.error('Call栈板失败:', error);
this.$message.error('Call栈板失败');
});
},
// Call
closeCallPalletModal() {
this.callPalletModalVisible = false;
this.selectedCallStation = '';
this.callStationOptions = [];
},
// Call
confirmCallPallet() {
if (!this.selectedCallStation) {
this.$message.error('请选择站点');
return;
}
callPalletToStation({
site: this.site,
palletId: this.palletCode,
targetStation: this.selectedCallStation
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('Call栈板成功');
this.closeCallPalletModal();
} else {
this.$message.error(data.msg || 'Call栈板失败');
}
}).catch(error => {
console.error('Call栈板失败:', error);
this.$message.error('Call栈板失败');
});
},
// Call
closeCallPalletModal() {
this.callPalletModalVisible = false;
this.selectedCallStation = '';
this.callStationOptions = [];
},
},
mounted() {
this.$nextTick(() => {
@ -687,4 +981,31 @@ export default {
::v-deep .el-radio__label {
font-size: 14px;
}
/* 标题行样式 */
.list-title-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.list-title-row .list-title {
margin: 0;
flex: 1;
}
/* 空数据行样式 */
.empty-row {
justify-content: center;
align-items: center;
padding: 20px;
border-bottom: none;
}
.empty-row .empty-hint {
text-align: center;
color: #999;
width: 100%;
}
</style>
Loading…
Cancel
Save