feat:入库、移库功能页面完善

This commit is contained in:
zhouz
2026-07-31 09:57:09 +08:00
parent 04ffd865a3
commit 79017f74f1
21 changed files with 861 additions and 26 deletions

View File

@@ -1,10 +1,24 @@
import type { Dayjs } from 'dayjs';
import type { PageParam, PageResult } from '@vben/request';
import type { WmsStrucAttrApi } from '#/api/wms/structAttr';
import { requestClient } from '#/api/request';
export namespace WmsIostorInvApi {
export interface InboundGroupPlate {
groupId: string;
vehicleCode?: string;
status: string;
materialId?: string;
materialCode: string;
pcsn?: string;
qty: number;
qtyUnitId?: string;
qtyUnitName?: string;
extCode?: string;
}
/** 出入库单主表信息 */
export interface IostorInv {
iostorinvId: string; // 出入单标识
@@ -127,8 +141,11 @@ export namespace WmsIostorInvApi {
qtyUnitName?: string;
sectId?: string;
sectName?: string;
structId?: string;
structCode?: string;
structName?: string;
pointCode?: string;
taskId?: string;
}
export interface ManualAllocationInventory {
@@ -157,6 +174,75 @@ export function getIostorInvPage(params: PageParam) {
);
}
export function getInboundGroupPlates(storId: string) {
return requestClient.get<WmsIostorInvApi.InboundGroupPlate[]>(
'/wms/iostor-inv/inbound-group-plates',
{ params: { storId } },
);
}
export function createInbound(data: {
billType: string;
bizDate: string;
groupIds: string[];
remark?: string;
storId: string;
}) {
return requestClient.post('/wms/iostor-inv/create-inbound', data);
}
export function updateInbound(data: {
billType: string;
bizDate: string;
groupIds: string[];
iostorinvId: string;
remark?: string;
storId: string;
}) {
return requestClient.put('/wms/iostor-inv/update-inbound', data);
}
export function deleteInbound(iostorinvId: string) {
return requestClient.delete('/wms/iostor-inv/delete-inbound', {
params: { iostorinvId },
});
}
export function allocateInbound(data: {
autoAllocate?: boolean;
iostorinvId: string;
items: { iostorinvdtlId: string; sectId: string; structId: string }[];
}) {
return requestClient.post('/wms/iostor-inv/allocate-inbound', data);
}
export function cancelInboundAllocation(iostorinvId: string, iostorinvdtlId: string) {
return requestClient.delete('/wms/iostor-inv/cancel-inbound-allocation', {
params: { iostorinvId, iostorinvdtlId },
});
}
export function getInboundAvailableStructs(storId: string, sectId: string) {
return requestClient.get<WmsStrucAttrApi.StrucAttr[]>(
'/wms/iostor-inv/inbound-available-structs',
{ params: { storId, sectId } },
);
}
export function setInboundPoint(data: {
iostorinvId: string;
iostorinvdtlId: string;
pointCode: string;
}) {
return requestClient.post('/wms/iostor-inv/set-inbound-point', data);
}
export function completeInbound(iostorinvId: string) {
return requestClient.post('/wms/iostor-inv/complete-inbound', undefined, {
params: { iostorinvId },
});
}
/** 查询出入库单主表详情 */
export function getIostorInv(id: string) {
return requestClient.get<WmsIostorInvApi.IostorInv>(

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { WmsIostorInvApi } from '#/api/wms/iostorinv';
import { ref } from 'vue';
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
@@ -17,6 +17,8 @@ const header = ref<WmsIostorInvApi.IostorInv>();
const details = ref<WmsIostorInvApi.OutboundDisplayDetail[]>([]);
const allocations = ref<WmsIostorInvApi.OutboundAllocation[]>([]);
const loading = ref(false);
const isInbound = computed(() => header.value?.ioType === '0');
const modalTitle = computed(() => isInbound.value ? '入库单详情' : '出库单详情');
const detailColumns = [
{ key: 'index', title: '序号', width: 60 },
@@ -38,7 +40,7 @@ const allocationColumns = [
{ dataIndex: 'materialName', title: '物料名称', width: 170 },
{ dataIndex: 'storagevehicleCode', title: '箱号', width: 150 },
{ dataIndex: 'pcsn', title: '批次', width: 140 },
{ dataIndex: 'planQty', title: '出库重量', width: 120 },
{ dataIndex: 'planQty', key: 'allocationQty', title: '分配重量', width: 120 },
{ dataIndex: 'sectName', title: '库区', width: 130 },
{ dataIndex: 'structCode', title: '仓位编码', width: 130 },
{ dataIndex: 'structName', title: '仓位名称', width: 160 },
@@ -80,7 +82,7 @@ const [Modal, modalApi] = useVbenModal({
</script>
<template>
<Modal class="w-[1500px] max-w-[98vw]" title="出入库单详情">
<Modal class="w-[1500px] max-w-[98vw]" :title="modalTitle">
<div class="px-3 pb-3">
<Descriptions bordered class="mb-4" size="small" :column="4">
<DescriptionsItem label="单据编号">{{ header?.billCode }}</DescriptionsItem>
@@ -130,6 +132,9 @@ const [Modal, modalApi] = useVbenModal({
<template v-else-if="column.dataIndex === 'workStatus'">
{{ statusLabel(record.workStatus) }}
</template>
<template v-else-if="column.key === 'allocationQty'">
{{ record.planQty }}
</template>
</template>
</Table>
</div>

View File

@@ -393,6 +393,13 @@ export function useGridColumns(): VxeTableGridOptions<WmsStrucAttrApi.StrucAttr>
{ field: 'blockNum', title: '块', minWidth: 120 },
{ field: 'isTempstruct', title: '是否临时仓位', minWidth: 120, formatter: boolFormatter },
{ field: 'isUsed', title: '是否启用', minWidth: 120, formatter: boolFormatter },
{ field: 'storagevehicleCode', title: '存储载具号', minWidth: 150 },
{
field: 'lockType',
title: '锁定类型',
minWidth: 120,
cellRender: { name: 'CellDict', props: { type: DICT_TYPE.WMS_LOCK_TYPE } },
},
{ field: 'isZdepth', title: '是否判断高度', minWidth: 120, formatter: boolFormatter },
{ field: 'createTime', title: '创建时间', minWidth: 120, formatter: 'formatDateTime' },
{ field: 'remark', title: '备注', minWidth: 120 },