feat:载具信息表1

This commit is contained in:
2026-07-22 13:24:30 +08:00
parent bae3a33088
commit 73c401477c
10 changed files with 436 additions and 417 deletions

View File

@@ -47,12 +47,12 @@ spring:
primary: master primary: master
datasource: datasource:
master: master:
url: jdbc:mysql://127.0.0.1:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 url: jdbc:mysql://192.168.10.41:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
username: root username: root
password: root password: root
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
lazy: true # 开启懒加载,保证启动速度 lazy: true # 开启懒加载,保证启动速度
url: jdbc:mysql://127.0.0.1:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 url: jdbc:mysql://192.168.10.41:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
username: root username: root
password: root password: root

View File

@@ -5,7 +5,7 @@ import { requestClient } from '#/api/request';
export namespace WmsGroupPlateApi { export namespace WmsGroupPlateApi {
/** 组盘记录信息 */ /** 组盘记录信息 */
export interface GroupPlate { export interface GroupPlate {
groupId: string; groupId?: number;
vehicleCode: string; // 载具编码 vehicleCode: string; // 载具编码
status?: string; // 状态 status?: string; // 状态
materialId: string; // 物料id materialId: string; // 物料id

View File

@@ -5,7 +5,7 @@ import { requestClient } from '#/api/request';
export namespace WmsStorageVehicleInfoApi { export namespace WmsStorageVehicleInfoApi {
/** 载具信息信息 */ /** 载具信息信息 */
export interface StorageVehicleInfo { export interface StorageVehicleInfo {
storageVehicleId?: string; storageVehicleId?: number;
storageVehicleCode?: string; // 载具编码 storageVehicleCode?: string; // 载具编码
storageVehicleName: string; // 载具名称 storageVehicleName: string; // 载具名称
oneCode: string; // 一维码 oneCode: string; // 一维码

View File

@@ -44,12 +44,12 @@ function handleEdit(row: WmsGroupPlateApi.GroupPlate) {
/** 删除组盘记录 */ /** 删除组盘记录 */
async function handleDelete(row: WmsGroupPlateApi.GroupPlate) { async function handleDelete(row: WmsGroupPlateApi.GroupPlate) {
const hideLoading = message.loading({ const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.id]), content: $t('ui.actionMessage.deleting', [row.groupId]),
duration: 0, duration: 0,
}); });
try { try {
await deleteGroupPlate(row.id!); await deleteGroupPlate(row.groupId!);
message.success($t('ui.actionMessage.deleteSuccess', [row.id])); message.success($t('ui.actionMessage.deleteSuccess', [row.groupId]));
handleRefresh(); handleRefresh();
} finally { } finally {
hideLoading(); hideLoading();
@@ -79,7 +79,7 @@ function handleRowCheckboxChange({
}: { }: {
records: WmsGroupPlateApi.GroupPlate[]; records: WmsGroupPlateApi.GroupPlate[];
}) { }) {
checkedIds.value = records.map((item) => item.id!); checkedIds.value = records.map((item) => item.groupId!);
} }
/** 导出表格 */ /** 导出表格 */
@@ -109,7 +109,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
}, },
}, },
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'groupId',
isHover: true, isHover: true,
}, },
toolbarConfig: { toolbarConfig: {
@@ -174,7 +174,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
icon: ACTION_ICON.DELETE, icon: ACTION_ICON.DELETE,
auth: ['wms:group-plate:delete'], auth: ['wms:group-plate:delete'],
popConfirm: { popConfirm: {
title: $t('ui.actionMessage.deleteConfirm', [row.id]), title: $t('ui.actionMessage.deleteConfirm', [row.groupId]),
confirm: handleDelete.bind(null, row), confirm: handleDelete.bind(null, row),
}, },
}, },

View File

@@ -115,7 +115,7 @@ const [Modal, modalApi] = useVbenModal({
// 提交表单 // 提交表单
const data = (await formApi.getValues()) as WmsGroupPlateApi.GroupPlate; const data = (await formApi.getValues()) as WmsGroupPlateApi.GroupPlate;
try { try {
await (formData.value?.id ? updateGroupPlate(data) : createGroupPlate(data)); await (formData.value?.groupId ? updateGroupPlate(data) : createGroupPlate(data));
// 关闭并提示 // 关闭并提示
await modalApi.close(); await modalApi.close();
emit('success'); emit('success');
@@ -131,12 +131,12 @@ const [Modal, modalApi] = useVbenModal({
} }
// 加载数据 // 加载数据
const data = modalApi.getData<WmsGroupPlateApi.GroupPlate>(); const data = modalApi.getData<WmsGroupPlateApi.GroupPlate>();
if (!data || !data.id) { if (!data || !data.groupId) {
return; return;
} }
modalApi.lock(); modalApi.lock();
try { try {
formData.value = await getGroupPlate(data.id); formData.value = await getGroupPlate(data.groupId);
// 设置到 values // 设置到 values
await formApi.setValues(formData.value); await formApi.setValues(formData.value);
} finally { } finally {

View File

@@ -3,6 +3,8 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { WmsStorageVehicleInfoApi } from '#/api/wms/storagevehicleinfo'; import type { WmsStorageVehicleInfoApi } from '#/api/wms/storagevehicleinfo';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
import {getDictOptions} from "@vben/hooks";
import {DICT_TYPE} from "@vben/constants";
/** 新增/修改的表单 */ /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
@@ -54,10 +56,11 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required', rules: 'required',
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: [], options: getDictOptions(DICT_TYPE.COMMON_TRUE_FALSE, 'boolean'),
buttonStyle: 'solid', buttonStyle: 'solid',
optionType: 'button', optionType: 'button',
}, },
defaultValue: true,
}, },
{ {
fieldName: 'storageVehicleType', fieldName: 'storageVehicleType',
@@ -65,39 +68,47 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required', rules: 'required',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [], options: getDictOptions(DICT_TYPE.WMS_VEHICLE_TYPE),
placeholder: '请选择载具类型', placeholder: '请选择载具类型',
}, },
}, },
{ {
fieldName: 'vehicleWidth', fieldName: 'vehicleWidth',
label: '载具宽度', label: '载具宽度',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
placeholder: '请输入载具宽度', placeholder: '请输入载具宽度',
}, },
}, },
{ {
fieldName: 'vehicleLong', fieldName: 'vehicleLong',
label: '载具长度', label: '载具长度',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
placeholder: '请输入载具长度', placeholder: '请输入载具长度',
}, },
}, },
{ {
fieldName: 'vehicleHeight', fieldName: 'vehicleHeight',
label: '载具高度', label: '载具高度',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
placeholder: '请输入载具高度', placeholder: '请输入载具高度',
}, },
}, },
{ {
fieldName: 'weigth', fieldName: 'weigth',
label: '托盘重量', label: '托盘重量',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
placeholder: '请输入托盘重量', placeholder: '请输入托盘重量',
}, },
}, },
@@ -107,23 +118,25 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required', rules: 'required',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [], options: getDictOptions(DICT_TYPE.WMS_OVER_STRUCT_TYPE),
placeholder: '请选择载具是否超仓位', placeholder: '请选择载具是否超仓位',
}, },
defaultValue: '00'
}, },
{ {
fieldName: 'occupyStructQty', fieldName: 'occupyStructQty',
label: '占仓位数', label: '占仓位数',
rules: 'required', rules: 'required',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
placeholder: '请输入占仓位数', placeholder: '请输入占仓位数',
}, },
}, },
{ {
fieldName: 'boxNo', fieldName: 'boxNo',
label: '木箱号', label: '木箱号',
rules: 'required',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
placeholder: '请输入木箱号', placeholder: '请输入木箱号',
@@ -153,24 +166,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
placeholder: '请输入载具名称', placeholder: '请输入载具名称',
}, },
}, },
{
fieldName: 'oneCode',
label: '一维码',
component: 'Input',
componentProps: {
allowClear: true,
placeholder: '请输入一维码',
},
},
{
fieldName: 'twoCode',
label: '二维码',
component: 'Input',
componentProps: {
allowClear: true,
placeholder: '请输入二维码',
},
},
{ {
fieldName: 'isUsed', fieldName: 'isUsed',
label: '是否启用', label: '是否启用',
@@ -187,15 +182,17 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
allowClear: true, allowClear: true,
options: [], options: getDictOptions(DICT_TYPE.WMS_VEHICLE_TYPE),
placeholder: '请选择载具类型', placeholder: '请选择载具类型',
}, },
}, },
{ {
fieldName: 'vehicleWidth', fieldName: 'vehicleWidth',
label: '载具宽度', label: '载具宽度',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
allowClear: true, allowClear: true,
placeholder: '请输入载具宽度', placeholder: '请输入载具宽度',
}, },
@@ -203,8 +200,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
{ {
fieldName: 'vehicleLong', fieldName: 'vehicleLong',
label: '载具长度', label: '载具长度',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
allowClear: true, allowClear: true,
placeholder: '请输入载具长度', placeholder: '请输入载具长度',
}, },
@@ -212,8 +211,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
{ {
fieldName: 'vehicleHeight', fieldName: 'vehicleHeight',
label: '载具高度', label: '载具高度',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
allowClear: true, allowClear: true,
placeholder: '请输入载具高度', placeholder: '请输入载具高度',
}, },
@@ -221,8 +222,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
{ {
fieldName: 'weigth', fieldName: 'weigth',
label: '托盘重量', label: '托盘重量',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
allowClear: true, allowClear: true,
placeholder: '请输入托盘重量', placeholder: '请输入托盘重量',
}, },
@@ -233,15 +236,17 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
allowClear: true, allowClear: true,
options: [], options: getDictOptions(DICT_TYPE.WMS_OVER_STRUCT_TYPE, 'boolean'),
placeholder: '请选择载具是否超仓位', placeholder: '请选择载具是否超仓位',
}, },
}, },
{ {
fieldName: 'occupyStructQty', fieldName: 'occupyStructQty',
label: '占仓位数', label: '占仓位数',
component: 'Input', component: 'InputNumber',
componentProps: { componentProps: {
class: '!w-full',
min: 0,
allowClear: true, allowClear: true,
placeholder: '请输入占仓位数', placeholder: '请输入占仓位数',
}, },
@@ -295,11 +300,19 @@ export function useGridColumns(): VxeTableGridOptions<WmsStorageVehicleInfoApi.S
field: 'isUsed', field: 'isUsed',
title: '是否启用', title: '是否启用',
minWidth: 120, minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.COMMON_TRUE_FALSE },
},
}, },
{ {
field: 'storageVehicleType', field: 'storageVehicleType',
title: '载具类型', title: '载具类型',
minWidth: 120, minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.WMS_VEHICLE_TYPE },
},
}, },
{ {
field: 'vehicleWidth', field: 'vehicleWidth',
@@ -325,6 +338,10 @@ export function useGridColumns(): VxeTableGridOptions<WmsStorageVehicleInfoApi.S
field: 'overStructType', field: 'overStructType',
title: '载具是否超仓位', title: '载具是否超仓位',
minWidth: 120, minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.WMS_OVER_STRUCT_TYPE },
},
}, },
{ {
field: 'occupyStructQty', field: 'occupyStructQty',

View File

@@ -44,12 +44,12 @@ function handleEdit(row: WmsStorageVehicleInfoApi.StorageVehicleInfo) {
/** 删除载具信息 */ /** 删除载具信息 */
async function handleDelete(row: WmsStorageVehicleInfoApi.StorageVehicleInfo) { async function handleDelete(row: WmsStorageVehicleInfoApi.StorageVehicleInfo) {
const hideLoading = message.loading({ const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.id]), content: $t('ui.actionMessage.deleting', [row.storageVehicleId]),
duration: 0, duration: 0,
}); });
try { try {
await deleteStorageVehicleInfo(row.id!); await deleteStorageVehicleInfo(row.storageVehicleId!);
message.success($t('ui.actionMessage.deleteSuccess', [row.id])); message.success($t('ui.actionMessage.deleteSuccess', [row.storageVehicleId]));
handleRefresh(); handleRefresh();
} finally { } finally {
hideLoading(); hideLoading();
@@ -109,7 +109,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
}, },
}, },
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'storageVehicleId',
isHover: true, isHover: true,
}, },
toolbarConfig: { toolbarConfig: {

View File

@@ -44,7 +44,7 @@ const [Modal, modalApi] = useVbenModal({
// 提交表单 // 提交表单
const data = (await formApi.getValues()) as WmsStorageVehicleInfoApi.StorageVehicleInfo; const data = (await formApi.getValues()) as WmsStorageVehicleInfoApi.StorageVehicleInfo;
try { try {
await (formData.value?.id ? updateStorageVehicleInfo(data) : createStorageVehicleInfo(data)); await (formData.value?.storageVehicleId ? updateStorageVehicleInfo(data) : createStorageVehicleInfo(data));
// 关闭并提示 // 关闭并提示
await modalApi.close(); await modalApi.close();
emit('success'); emit('success');
@@ -60,12 +60,12 @@ const [Modal, modalApi] = useVbenModal({
} }
// 加载数据 // 加载数据
const data = modalApi.getData<WmsStorageVehicleInfoApi.StorageVehicleInfo>(); const data = modalApi.getData<WmsStorageVehicleInfoApi.StorageVehicleInfo>();
if (!data || !data.id) { if (!data || !data.storageVehicleId) {
return; return;
} }
modalApi.lock(); modalApi.lock();
try { try {
formData.value = await getStorageVehicleInfo(data.id); formData.value = await getStorageVehicleInfo(data.storageVehicleId);
// 设置到 values // 设置到 values
await formApi.setValues(formData.value); await formApi.setValues(formData.value);
} finally { } finally {

View File

@@ -21,7 +21,7 @@ function getClassTypeLabel(classType?: string): string {
if (!classTypeLabelMap[classType]) { if (!classTypeLabelMap[classType]) {
const dictOptions = getDictOptions(DICT_TYPE.WMS_STRATEGY_CLASS_TYPE); const dictOptions = getDictOptions(DICT_TYPE.WMS_STRATEGY_CLASS_TYPE);
for (const opt of dictOptions) { for (const opt of dictOptions) {
classTypeLabelMap[opt.value] = opt.label; classTypeLabelMap[String(opt.value)] = opt.label;
} }
} }
return classTypeLabelMap[classType] || classType; return classTypeLabelMap[classType] || classType;

View File

@@ -285,6 +285,8 @@ const WMS_DICT = {
WMS_LOCK_TYPE: 'wms_lock_type', // WMS 锁定类型 WMS_LOCK_TYPE: 'wms_lock_type', // WMS 锁定类型
WMS_STRATEGY_CLASS_TYPE: 'wms_strategy_class_type', // WMS 处理类类型 WMS_STRATEGY_CLASS_TYPE: 'wms_strategy_class_type', // WMS 处理类类型
WMS_GROUP_PLATE_STATUS: 'wms_group_plate_status', // 组盘记录 WMS_GROUP_PLATE_STATUS: 'wms_group_plate_status', // 组盘记录
WMS_VEHICLE_TYPE: 'wms_vehicle_type', // 载具类型
WMS_OVER_STRUCT_TYPE: 'wms_over_struct_type', // 是否超限
} as const; } as const;
/** ========== TASK - 任务管理模块 ========== */ /** ========== TASK - 任务管理模块 ========== */