feat:新增木箱信息查询功能,库存信息查询功能
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace WmsBoxInfoApi {
|
||||
/** 木箱基础信息。 */
|
||||
export interface BoxInfo {
|
||||
boxId: number;
|
||||
boxNo: string;
|
||||
materialCode: string;
|
||||
materialName: string;
|
||||
num?: string;
|
||||
boxLength: string;
|
||||
boxWidth: string;
|
||||
boxHigh: string;
|
||||
insertTime: string;
|
||||
lashNum: string;
|
||||
vehicleType?: string;
|
||||
isPacking?: string;
|
||||
boxWeight?: string;
|
||||
status: string;
|
||||
outTime?: string;
|
||||
}
|
||||
|
||||
/** 木箱信息分页查询参数。 */
|
||||
export interface BoxInfoPageParam extends PageParam {
|
||||
boxNo?: string;
|
||||
materialCode?: string;
|
||||
materialName?: string;
|
||||
isPacking?: string;
|
||||
vehicleType?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询木箱基础信息分页。 */
|
||||
export function getBoxInfoPage(params: WmsBoxInfoApi.BoxInfoPageParam) {
|
||||
return requestClient.get<PageResult<WmsBoxInfoApi.BoxInfo>>(
|
||||
'/wms/box-info/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
@@ -35,6 +35,7 @@ export namespace WmsStrucAttrApi {
|
||||
storagevehicleCode: string; // 存储载具号
|
||||
storagevehicleType: string; // 载具类型
|
||||
storagevehicleQty: number; // 载具数量
|
||||
inventoryType: string; // 库存类型
|
||||
lockType?: string; // 锁定类型
|
||||
taskCode: string; // 锁定任务编码
|
||||
invType: string; // 锁定单据类型
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { WmsBoxInfoApi } from '#/api/wms/boxinfo';
|
||||
|
||||
/** 木箱信息查询表单。 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'boxNo',
|
||||
label: '木箱号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入木箱号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'materialCode',
|
||||
label: '物料编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入物料编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'materialName',
|
||||
label: '物料名称',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入物料名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'isPacking',
|
||||
label: '包装状态',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请选择包装状态',
|
||||
options: [
|
||||
{ label: '未包装', value: '0' },
|
||||
{ label: '已包装', value: '1' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'vehicleType',
|
||||
label: '载具类型',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入载具类型',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 木箱信息列表字段。 */
|
||||
export function useGridColumns(): VxeTableGridOptions<WmsBoxInfoApi.BoxInfo>['columns'] {
|
||||
return [
|
||||
{ field: 'boxNo', title: '木箱号', minWidth: 160, fixed: 'left' },
|
||||
{ field: 'materialCode', title: '物料编码', minWidth: 140 },
|
||||
{ field: 'materialName', title: '物料名称', minWidth: 180 },
|
||||
{ field: 'num', title: '数量', width: 90 },
|
||||
{ field: 'boxLength', title: '长度', width: 100 },
|
||||
{ field: 'boxWidth', title: '宽度', width: 100 },
|
||||
{ field: 'boxHigh', title: '高度', width: 100 },
|
||||
{ field: 'boxWeight', title: '木箱重量', width: 120 },
|
||||
{ field: 'lashNum', title: '捆扎数量', width: 110 },
|
||||
{ field: 'vehicleType', title: '载具类型', width: 110 },
|
||||
{
|
||||
field: 'isPacking',
|
||||
title: '包装状态',
|
||||
width: 110,
|
||||
formatter: ({ cellValue }: { cellValue?: string }) =>
|
||||
cellValue === '1' ? '已包装' : '未包装',
|
||||
},
|
||||
{ field: 'insertTime', title: '插入时间', minWidth: 170 },
|
||||
{
|
||||
field: 'status',
|
||||
title: '木箱状态',
|
||||
width: 110,
|
||||
formatter: ({ cellValue }: { cellValue?: string }) =>
|
||||
({ '0': '待入库', '1': '在库', '2': '已出库' })[
|
||||
cellValue || ''
|
||||
] || '-',
|
||||
},
|
||||
{ field: 'outTime', title: '出库时间', minWidth: 170 },
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { WmsBoxInfoApi } from '#/api/wms/boxinfo';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { getBoxInfoPage } from '#/api/wms/boxinfo';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
|
||||
const [Grid] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
height: 'auto',
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
return await getBoxInfoPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'boxId',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<WmsBoxInfoApi.BoxInfo>,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<Grid table-title="木箱信息列表" />
|
||||
</Page>
|
||||
</template>
|
||||
@@ -248,6 +248,21 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
component: 'Input',
|
||||
componentProps: { placeholder: '请输入载具数量' },
|
||||
},
|
||||
{
|
||||
fieldName: 'inventoryType',
|
||||
label: '库存类型',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: [
|
||||
{ label: '空', value: '0' },
|
||||
{ label: '成品', value: '1' },
|
||||
{ label: '空载具', value: '2' },
|
||||
{ label: '空木箱', value: '3' },
|
||||
],
|
||||
placeholder: '请选择库存类型',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'lockType',
|
||||
label: '锁定类型',
|
||||
@@ -394,6 +409,15 @@ export function useGridColumns(): VxeTableGridOptions<WmsStrucAttrApi.StrucAttr>
|
||||
{ field: 'isTempstruct', title: '是否临时仓位', minWidth: 120, formatter: boolFormatter },
|
||||
{ field: 'isUsed', title: '是否启用', minWidth: 120, formatter: boolFormatter },
|
||||
{ field: 'storagevehicleCode', title: '存储载具号', minWidth: 150 },
|
||||
{
|
||||
field: 'inventoryType',
|
||||
title: '库存类型',
|
||||
minWidth: 110,
|
||||
formatter: ({ cellValue }: { cellValue?: string }) =>
|
||||
({ '0': '空', '1': '成品', '2': '空载具', '3': '空木箱' })[
|
||||
cellValue || ''
|
||||
] || '-',
|
||||
},
|
||||
{
|
||||
field: 'lockType',
|
||||
title: '锁定类型',
|
||||
|
||||
Reference in New Issue
Block a user