feat:载具信息表
This commit is contained in:
@@ -3,7 +3,7 @@ VITE_BASE=/
|
||||
# 请求路径
|
||||
VITE_BASE_URL=http://127.0.0.1:48080
|
||||
# 接口地址
|
||||
VITE_GLOB_API_URL=http://127.0.0.1:48080/admin-api
|
||||
VITE_GLOB_API_URL=/admin-api
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
|
||||
@@ -23,4 +23,4 @@ VITE_INJECT_APP_LOADING=true
|
||||
VITE_ARCHIVER=true
|
||||
|
||||
# 验证码的开关
|
||||
VITE_APP_CAPTCHA_ENABLE=true
|
||||
VITE_APP_CAPTCHA_ENABLE=true
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace WmsStorageVehicleInfoApi {
|
||||
/** 载具信息信息 */
|
||||
export interface StorageVehicleInfo {
|
||||
storageVehicleId?: string;
|
||||
storageVehicleCode?: string; // 载具编码
|
||||
storageVehicleName: string; // 载具名称
|
||||
oneCode: string; // 一维码
|
||||
twoCode: string; // 二维码
|
||||
isUsed?: boolean; // 是否启用
|
||||
storageVehicleType?: string; // 载具类型
|
||||
vehicleWidth: number; // 载具宽度
|
||||
vehicleLong: number; // 载具长度
|
||||
vehicleHeight: number; // 载具高度
|
||||
weigth: number; // 托盘重量
|
||||
overStructType?: string; // 载具是否超仓位
|
||||
occupyStructQty?: number; // 占仓位数
|
||||
boxNo?: string; // 木箱号
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询载具信息分页 */
|
||||
export function getStorageVehicleInfoPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<WmsStorageVehicleInfoApi.StorageVehicleInfo>>(
|
||||
'/wms/storage-vehicle-info/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询载具信息详情 */
|
||||
export function getStorageVehicleInfo(id: number) {
|
||||
return requestClient.get<WmsStorageVehicleInfoApi.StorageVehicleInfo>(
|
||||
`/wms/storage-vehicle-info/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增载具信息 */
|
||||
export function createStorageVehicleInfo(data: WmsStorageVehicleInfoApi.StorageVehicleInfo) {
|
||||
return requestClient.post('/wms/storage-vehicle-info/create', data);
|
||||
}
|
||||
|
||||
/** 修改载具信息 */
|
||||
export function updateStorageVehicleInfo(data: WmsStorageVehicleInfoApi.StorageVehicleInfo) {
|
||||
return requestClient.put('/wms/storage-vehicle-info/update', data);
|
||||
}
|
||||
|
||||
/** 删除载具信息 */
|
||||
export function deleteStorageVehicleInfo(id: number) {
|
||||
return requestClient.delete(`/wms/storage-vehicle-info/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除载具信息 */
|
||||
export function deleteStorageVehicleInfoList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/wms/storage-vehicle-info/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出载具信息 */
|
||||
export function exportStorageVehicleInfo(params: any) {
|
||||
return requestClient.download('/wms/storage-vehicle-info/export-excel', { params });
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,374 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { WmsStorageVehicleInfoApi } from '#/api/wms/storagevehicleinfo';
|
||||
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'storageVehicleId',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
triggerFields: [''],
|
||||
show: () => false,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'storageVehicleCode',
|
||||
label: '载具编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
placeholder: '后台自动生成',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'storageVehicleName',
|
||||
label: '载具名称',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入载具名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'oneCode',
|
||||
label: '一维码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入一维码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'twoCode',
|
||||
label: '二维码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入二维码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'isUsed',
|
||||
label: '是否启用',
|
||||
rules: 'required',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [],
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'storageVehicleType',
|
||||
label: '载具类型',
|
||||
rules: 'required',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: [],
|
||||
placeholder: '请选择载具类型',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'vehicleWidth',
|
||||
label: '载具宽度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入载具宽度',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'vehicleLong',
|
||||
label: '载具长度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入载具长度',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'vehicleHeight',
|
||||
label: '载具高度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入载具高度',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'weigth',
|
||||
label: '托盘重量',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入托盘重量',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'overStructType',
|
||||
label: '载具是否超仓位',
|
||||
rules: 'required',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: [],
|
||||
placeholder: '请选择载具是否超仓位',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'occupyStructQty',
|
||||
label: '占仓位数',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入占仓位数',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'boxNo',
|
||||
label: '木箱号',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入木箱号',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'storageVehicleCode',
|
||||
label: '载具编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入载具编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'storageVehicleName',
|
||||
label: '载具名称',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入载具名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'oneCode',
|
||||
label: '一维码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入一维码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'twoCode',
|
||||
label: '二维码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入二维码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'isUsed',
|
||||
label: '是否启用',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: [],
|
||||
placeholder: '请选择是否启用',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'storageVehicleType',
|
||||
label: '载具类型',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: [],
|
||||
placeholder: '请选择载具类型',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'vehicleWidth',
|
||||
label: '载具宽度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入载具宽度',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'vehicleLong',
|
||||
label: '载具长度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入载具长度',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'vehicleHeight',
|
||||
label: '载具高度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入载具高度',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'weigth',
|
||||
label: '托盘重量',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入托盘重量',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'overStructType',
|
||||
label: '载具是否超仓位',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: [],
|
||||
placeholder: '请选择载具是否超仓位',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'occupyStructQty',
|
||||
label: '占仓位数',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入占仓位数',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'boxNo',
|
||||
label: '木箱号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入木箱号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'createTime',
|
||||
label: '创建时间',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
...getRangePickerDefaultProps(),
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns(): VxeTableGridOptions<WmsStorageVehicleInfoApi.StorageVehicleInfo>['columns'] {
|
||||
return [
|
||||
{ type: 'checkbox', width: 40 },
|
||||
{
|
||||
field: 'storageVehicleCode',
|
||||
title: '载具编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'storageVehicleName',
|
||||
title: '载具名称',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'oneCode',
|
||||
title: '一维码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'twoCode',
|
||||
title: '二维码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'isUsed',
|
||||
title: '是否启用',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'storageVehicleType',
|
||||
title: '载具类型',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'vehicleWidth',
|
||||
title: '载具宽度',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'vehicleLong',
|
||||
title: '载具长度',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'vehicleHeight',
|
||||
title: '载具高度',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'weigth',
|
||||
title: '托盘重量',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'overStructType',
|
||||
title: '载具是否超仓位',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'occupyStructQty',
|
||||
title: '占仓位数',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'boxNo',
|
||||
title: '木箱号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'extId',
|
||||
title: '外部标识',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'creator',
|
||||
title: '创建者',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
minWidth: 120,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'updater',
|
||||
title: '更新者',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '更新时间',
|
||||
minWidth: 120,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'actions' },
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { WmsStorageVehicleInfoApi } from '#/api/wms/storagevehicleinfo';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { confirm, Page, useVbenModal } from '@vben/common-ui';
|
||||
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||
|
||||
import { message } from 'antdv-next';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteStorageVehicleInfo,
|
||||
deleteStorageVehicleInfoList,
|
||||
exportStorageVehicleInfo,
|
||||
getStorageVehicleInfoPage,
|
||||
} from '#/api/wms/storagevehicleinfo';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 创建载具信息 */
|
||||
function handleCreate() {
|
||||
formModalApi.setData(null).open();
|
||||
}
|
||||
|
||||
/** 编辑载具信息 */
|
||||
function handleEdit(row: WmsStorageVehicleInfoApi.StorageVehicleInfo) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除载具信息 */
|
||||
async function handleDelete(row: WmsStorageVehicleInfoApi.StorageVehicleInfo) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.id]),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteStorageVehicleInfo(row.id!);
|
||||
message.success($t('ui.actionMessage.deleteSuccess', [row.id]));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 批量删除载具信息 */
|
||||
async function handleDeleteBatch() {
|
||||
await confirm($t('ui.actionMessage.deleteBatchConfirm'));
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deletingBatch'),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteStorageVehicleInfoList(checkedIds.value);
|
||||
checkedIds.value = [];
|
||||
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: WmsStorageVehicleInfoApi.StorageVehicleInfo[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
async function handleExport() {
|
||||
const data = await exportStorageVehicleInfo(await gridApi.formApi.getValues());
|
||||
downloadFileFromBlobPart({ fileName: '载具信息.xls', source: data });
|
||||
}
|
||||
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
return await getStorageVehicleInfoPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<WmsStorageVehicleInfoApi.StorageVehicleInfo>,
|
||||
gridEvents: {
|
||||
checkboxAll: handleRowCheckboxChange,
|
||||
checkboxChange: handleRowCheckboxChange,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="handleRefresh" />
|
||||
<Grid table-title="载具信息列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('ui.actionTitle.create', ['载具信息']),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.ADD,
|
||||
auth: ['wms:storage-vehicle-info:create'],
|
||||
onClick: handleCreate,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.export'),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.DOWNLOAD,
|
||||
auth: ['wms:storage-vehicle-info:export'],
|
||||
onClick: handleExport,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.deleteBatch'),
|
||||
type: 'primary',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['wms:storage-vehicle-info:delete'],
|
||||
disabled: isEmpty(checkedIds),
|
||||
onClick: handleDeleteBatch,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
icon: ACTION_ICON.EDIT,
|
||||
auth: ['wms:storage-vehicle-info:update'],
|
||||
onClick: handleEdit.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
type: 'link',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['wms:storage-vehicle-info:delete'],
|
||||
popConfirm: {
|
||||
title: $t('ui.actionMessage.deleteConfirm', [row.id]),
|
||||
confirm: handleDelete.bind(null, row),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
@@ -0,0 +1,82 @@
|
||||
<script lang="ts" setup>
|
||||
import type { WmsStorageVehicleInfoApi } from '#/api/wms/storagevehicleinfo';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'antdv-next';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createStorageVehicleInfo, getStorageVehicleInfo, updateStorageVehicleInfo } from '#/api/wms/storagevehicleinfo';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<WmsStorageVehicleInfoApi.StorageVehicleInfo>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.storageVehicleId
|
||||
? $t('ui.actionTitle.edit', ['载具信息'])
|
||||
: $t('ui.actionTitle.create', ['载具信息']);
|
||||
});
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
labelWidth: 80,
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: useFormSchema(),
|
||||
showDefaultActions: false,
|
||||
});
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as WmsStorageVehicleInfoApi.StorageVehicleInfo;
|
||||
try {
|
||||
await (formData.value?.id ? updateStorageVehicleInfo(data) : createStorageVehicleInfo(data));
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
formData.value = undefined;
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<WmsStorageVehicleInfoApi.StorageVehicleInfo>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
formData.value = await getStorageVehicleInfo(data.id);
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal :title="getTitle">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
||||
Reference in New Issue
Block a user