feat:1.新增LMS 生箔缓存位管理。2.新增LMS 空辊缓存位管理。3.ACSToLMS称重完成上报接口。4.手持呼叫-上满下空。5.生箔任务反馈处理。

This commit is contained in:
2026-08-06 17:09:19 +08:00
parent 69301e5801
commit c31b925c93
56 changed files with 3489 additions and 78 deletions

View File

@@ -0,0 +1,67 @@
import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';
import { requestClient } from '#/api/request';
export namespace LmsRawFoilCashePositionApi {
/** 生箔母卷缓存位信息 */
export interface RawFoilCashePosition {
ivtId: number; // 库存记录标识
pointCode?: string; // 点位编码
containerName: string; // 母卷号
workorderId: string; // 母卷工单标识
fullVehicleCode: string; // 母卷轴编码
instorageTime: string | Dayjs; // 入库时间
productionArea: string; // 生产区域
pointLocation: string; // 位置
sortSeq?: number; // 顺序号
isUsed?: string; // 是否启用
remark: string; // 备注
coolIvtStatus?: string; // 库存状态
pointType: string; // 点位类型
}
}
/** 查询生箔母卷缓存位分页 */
export function getRawFoilCashePositionPage(params: PageParam) {
return requestClient.get<PageResult<LmsRawFoilCashePositionApi.RawFoilCashePosition>>(
'/lms/raw-foil-cashe-position/page',
{ params },
);
}
/** 查询生箔母卷缓存位详情 */
export function getRawFoilCashePosition(id: number) {
return requestClient.get<LmsRawFoilCashePositionApi.RawFoilCashePosition>(
`/lms/raw-foil-cashe-position/get?id=${id}`,
);
}
/** 新增生箔母卷缓存位 */
export function createRawFoilCashePosition(data: LmsRawFoilCashePositionApi.RawFoilCashePosition) {
return requestClient.post('/lms/raw-foil-cashe-position/create', data);
}
/** 修改生箔母卷缓存位 */
export function updateRawFoilCashePosition(data: LmsRawFoilCashePositionApi.RawFoilCashePosition) {
return requestClient.put('/lms/raw-foil-cashe-position/update', data);
}
/** 删除生箔母卷缓存位 */
export function deleteRawFoilCashePosition(id: number) {
return requestClient.delete(`/lms/raw-foil-cashe-position/delete?id=${id}`);
}
/** 批量删除生箔母卷缓存位 */
export function deleteRawFoilCashePositionList(ids: number[]) {
return requestClient.delete(
`/lms/raw-foil-cashe-position/delete-list?ids=${ids.join(',')}`,
);
}
/** 导出生箔母卷缓存位 */
export function exportRawFoilCashePosition(params: any) {
return requestClient.download('/lms/raw-foil-cashe-position/export-excel', { params });
}

View File

@@ -0,0 +1,68 @@
import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';
import { requestClient } from '#/api/request';
export namespace LmsRawFoilEmptyRollerCashePositionApi {
/** 空辊缓存位信息 */
export interface RawFoilEmptyRollerCashePosition {
pointId: number; // 点位标识
pointCode?: string; // 点位编码
vehicleCode: string; // 载具编码
productionArea: string; // 生产区域
pointLocation: string; // 位置
remark: string; // 备注
isUsed?: string; // 是否启用
creator: string; // 创建人
createTime?: string; // 创建时间
updater: string; // 修改人
updateTime?: string; // 修改时间
weight: number; // 重量
hasStock?: string; // 是否有货
sortSeq?: number; // 顺序号
}
}
/** 查询空辊缓存位分页 */
export function getRawFoilEmptyRollerCashePositionPage(params: PageParam) {
return requestClient.get<PageResult<LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition>>(
'/lms/raw-foil-empty-roller-cashe-position/page',
{ params },
);
}
/** 查询空辊缓存位详情 */
export function getRawFoilEmptyRollerCashePosition(id: number) {
return requestClient.get<LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition>(
`/lms/raw-foil-empty-roller-cashe-position/get?id=${id}`,
);
}
/** 新增空辊缓存位 */
export function createRawFoilEmptyRollerCashePosition(data: LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition) {
return requestClient.post('/lms/raw-foil-empty-roller-cashe-position/create', data);
}
/** 修改空辊缓存位 */
export function updateRawFoilEmptyRollerCashePosition(data: LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition) {
return requestClient.put('/lms/raw-foil-empty-roller-cashe-position/update', data);
}
/** 删除空辊缓存位 */
export function deleteRawFoilEmptyRollerCashePosition(id: number) {
return requestClient.delete(`/lms/raw-foil-empty-roller-cashe-position/delete?id=${id}`);
}
/** 批量删除空辊缓存位 */
export function deleteRawFoilEmptyRollerCashePositionList(ids: number[]) {
return requestClient.delete(
`/lms/raw-foil-empty-roller-cashe-position/delete-list?ids=${ids.join(',')}`,
);
}
/** 导出空辊缓存位 */
export function exportRawFoilEmptyRollerCashePosition(params: any) {
return requestClient.download('/lms/raw-foil-empty-roller-cashe-position/export-excel', { params });
}

View File

@@ -0,0 +1,286 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { LmsRawFoilCashePositionApi } from '#/api/lms/rawfoilcasheposition';
import { getDictOptions } from '@vben/hooks';
import { getRangePickerDefaultProps } from '#/utils';
import {DICT_TYPE} from "@vben/constants";
import {z} from "#/adapter/form";
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'ivtId',
component: 'Input',
dependencies: {
triggerFields: [''],
show: () => false,
},
},
{
fieldName: 'pointCode',
label: '点位编码',
rules: 'required',
component: 'Input',
componentProps: {
placeholder: '请输入点位编码',
},
},
{
fieldName: 'containerName',
label: '母卷号',
component: 'Input',
componentProps: {
placeholder: '请输入母卷号',
},
},
{
fieldName: 'workorderId',
label: '母卷工单标识',
component: 'Input',
componentProps: {
placeholder: '请输入母卷工单标识',
},
},
{
fieldName: 'fullVehicleCode',
label: '母卷轴编码',
component: 'Input',
componentProps: {
placeholder: '请输入母卷轴编码',
},
},
{
fieldName: 'instorageTime',
label: '入库时间',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
},
},
{
fieldName: 'productionArea',
label: '生产区域',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.PRODUCT_AREA),
placeholder: '请选择生产区域',
},
},
{
fieldName: 'pointLocation',
label: '位置',
component: 'Input',
componentProps: {
placeholder: '请输入位置',
},
},
{
fieldName: 'sortSeq',
label: '顺序号',
rules: 'required',
component: 'Input',
componentProps: {
placeholder: '请输入顺序号',
},
},
{
fieldName: 'isUsed',
label: '是否启用',
rules: z.string().default('1'),
component: 'RadioGroup',
componentProps: {
options: [{ label: '是', value: '1' }, { label: '否', value: '0' }],
buttonStyle: 'solid',
optionType: 'button',
},
},
{
fieldName: 'remark',
label: '备注',
component: 'Input',
componentProps: {
placeholder: '请输入备注',
},
},
{
fieldName: 'coolIvtStatus',
label: '库存状态',
rules: 'required',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.RAWFOIL_CASHEPOSITION_STATUS),
placeholder: '请选择库存状态',
},
},
{
fieldName: 'pointType',
label: '点位类型',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.RAWFOIL_CASHEPOSITION_TYPE),
placeholder: '请选择点位类型',
},
},
];
}
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'pointCode',
label: '点位编码',
component: 'Input',
componentProps: {
allowClear: true,
placeholder: '请输入点位编码',
},
},
{
fieldName: 'containerName',
label: '母卷号',
component: 'Input',
componentProps: {
allowClear: true,
placeholder: '请输入母卷号',
},
},
{
fieldName: 'instorageTime',
label: '入库时间',
component: 'RangePicker',
componentProps: {
...getRangePickerDefaultProps(),
allowClear: true,
},
},
{
fieldName: 'productionArea',
label: '生产区域',
component: 'Select',
componentProps: {
allowClear: true,
options: getDictOptions(DICT_TYPE.PRODUCT_AREA),
placeholder: '请选择生产区域',
},
},
{
fieldName: 'isUsed',
label: '是否启用',
component: 'Select',
componentProps: {
allowClear: true,
options: [
{ label: '是', value: '1' },
{ label: '否', value: '0' },
],
placeholder: '请输入是否启用',
},
},
{
fieldName: 'coolIvtStatus',
label: '库存状态',
component: 'Select',
componentProps: {
allowClear: true,
options: getDictOptions(DICT_TYPE.RAWFOIL_CASHEPOSITION_STATUS),
placeholder: '请选择库存状态',
},
},
];
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions<LmsRawFoilCashePositionApi.RawFoilCashePosition>['columns'] {
return [
{ type: 'checkbox', width: 40 },
{
field: 'ivtId',
title: '库存记录标识',
minWidth: 120,
},
{
field: 'pointCode',
title: '点位编码',
minWidth: 120,
},
{
field: 'containerName',
title: '母卷号',
minWidth: 120,
},
{
field: 'workorderId',
title: '母卷工单标识',
minWidth: 120,
},
{
field: 'fullVehicleCode',
title: '母卷轴编码',
minWidth: 120,
},
{
field: 'instorageTime',
title: '入库时间',
minWidth: 120,
formatter: 'formatDateTime',
},
{
field: 'productionArea',
title: '生产区域',
minWidth: 120,
},
{
field: 'pointLocation',
title: '位置',
minWidth: 120,
},
{
field: 'sortSeq',
title: '顺序号',
minWidth: 120,
},
{
field: 'isUsed',
title: '是否启用',
minWidth: 120,
},
{
field: 'coolIvtStatus',
title: '库存状态',
minWidth: 120,
},
{
field: 'pointType',
title: '点位类型',
minWidth: 120,
},
{
field: 'deleted',
title: '是否删除',
minWidth: 120,
},
{
title: '操作',
width: 200,
fixed: 'right',
slots: { default: 'actions' },
},
{
field: 'updateTime',
title: '修改时间',
minWidth: 120,
},
{
field: 'remark',
title: '备注',
minWidth: 120,
},
];
}

View File

@@ -0,0 +1,186 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { LmsRawFoilCashePositionApi } from '#/api/lms/rawfoilcasheposition';
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 {
deleteRawFoilCashePosition,
deleteRawFoilCashePositionList,
exportRawFoilCashePosition,
getRawFoilCashePositionPage,
} from '#/api/lms/rawfoilcasheposition';
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: LmsRawFoilCashePositionApi.RawFoilCashePosition) {
formModalApi.setData(row).open();
}
/** 删除生箔母卷缓存位 */
async function handleDelete(row: LmsRawFoilCashePositionApi.RawFoilCashePosition) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.ivtId]),
duration: 0,
});
try {
await deleteRawFoilCashePosition(row.ivtId!);
message.success($t('ui.actionMessage.deleteSuccess', [row.ivtId]));
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 deleteRawFoilCashePositionList(checkedIds.value);
checkedIds.value = [];
message.success($t('ui.actionMessage.deleteSuccess'));
handleRefresh();
} finally {
hideLoading();
}
}
const checkedIds = ref<number[]>([]);
function handleRowCheckboxChange({
records,
}: {
records: LmsRawFoilCashePositionApi.RawFoilCashePosition[];
}) {
checkedIds.value = records.map((item) => item.ivtId!);
}
/** 导出表格 */
async function handleExport() {
const data = await exportRawFoilCashePosition(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 getRawFoilCashePositionPage({
pageNo: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
search: true,
},
} as VxeTableGridOptions<LmsRawFoilCashePositionApi.RawFoilCashePosition>,
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: ['lms:raw-foil-cashe-position:create'],
onClick: handleCreate,
},
{
label: $t('ui.actionTitle.export'),
type: 'primary',
icon: ACTION_ICON.DOWNLOAD,
auth: ['lms:raw-foil-cashe-position:export'],
onClick: handleExport,
},
{
label: $t('ui.actionTitle.deleteBatch'),
type: 'primary',
danger: true,
icon: ACTION_ICON.DELETE,
auth: ['lms:raw-foil-cashe-position:delete'],
disabled: isEmpty(checkedIds),
onClick: handleDeleteBatch,
},
]"
/>
</template>
<template #actions="{ row }">
<TableAction
:actions="[
{
label: $t('common.edit'),
type: 'link',
icon: ACTION_ICON.EDIT,
auth: ['lms:raw-foil-cashe-position:update'],
onClick: handleEdit.bind(null, row),
},
{
label: $t('common.delete'),
type: 'link',
danger: true,
icon: ACTION_ICON.DELETE,
auth: ['lms:raw-foil-cashe-position:delete'],
popConfirm: {
title: $t('ui.actionMessage.deleteConfirm', [row.ivtId]),
confirm: handleDelete.bind(null, row),
},
},
]"
/>
</template>
</Grid>
</Page>
</template>

View File

@@ -0,0 +1,82 @@
<script lang="ts" setup>
import type { LmsRawFoilCashePositionApi } from '#/api/lms/rawfoilcasheposition';
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { message } from 'antdv-next';
import { useVbenForm } from '#/adapter/form';
import { createRawFoilCashePosition, getRawFoilCashePosition, updateRawFoilCashePosition } from '#/api/lms/rawfoilcasheposition';
import { $t } from '#/locales';
import { useFormSchema } from '../data';
const emit = defineEmits(['success']);
const formData = ref<LmsRawFoilCashePositionApi.RawFoilCashePosition>();
const getTitle = computed(() => {
return formData.value?.ivtId
? $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 LmsRawFoilCashePositionApi.RawFoilCashePosition;
try {
await (formData.value?.ivtId ? updateRawFoilCashePosition(data) : createRawFoilCashePosition(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<LmsRawFoilCashePositionApi.RawFoilCashePosition>();
if (!data || !data.ivtId) {
return;
}
modalApi.lock();
try {
formData.value = await getRawFoilCashePosition(data.ivtId);
// 设置到 values
await formApi.setValues(formData.value);
} finally {
modalApi.unlock();
}
},
});
</script>
<template>
<Modal :title="getTitle">
<Form class="mx-4" />
</Modal>
</template>

View File

@@ -0,0 +1,232 @@
import {type VbenFormSchema, z} from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { LmsRawFoilEmptyRollerCashePositionApi } from '#/api/lms/rawfoilemptyrollercasheposition';
import { getDictOptions } from '@vben/hooks';
import { getRangePickerDefaultProps } from '#/utils';
import {DICT_TYPE} from "@vben/constants";
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'pointId',
component: 'Input',
dependencies: {
triggerFields: [''],
show: () => false,
},
},
{
fieldName: 'pointCode',
label: '点位编码',
rules: 'required',
component: 'Input',
componentProps: {
placeholder: '请输入点位编码',
},
},
{
fieldName: 'vehicleCode',
label: '载具编码',
component: 'Input',
componentProps: {
placeholder: '请输入载具编码',
},
},
{
fieldName: 'productionArea',
label: '生产区域',
component: 'Select',
componentProps: {
placeholder: '请输入生产区域',
options: getDictOptions(DICT_TYPE.PRODUCT_AREA),
},
},
{
fieldName: 'pointType',
label: '点位类型',
component: 'Select',
componentProps: {
placeholder: '请输入点位',
options: getDictOptions(DICT_TYPE.EMPTYROLLER_CASHEPOSITION_TYPE),
},
},
{
fieldName: 'sortSeq',
label: '顺序号',
rules: 'required',
component: 'Input',
componentProps: {
placeholder: '请输入顺序号',
},
},
{
fieldName: 'pointLocation',
label: '位置',
component: 'Input',
componentProps: {
placeholder: '请输入位置',
},
},
{
fieldName: 'isUsed',
label: '是否启用',
rules: z.string().default('1'),
component: 'RadioGroup',
componentProps: {
options: [{ label: '是', value: '1' }, { label: '否', value: '0' }],
buttonStyle: 'solid',
optionType: 'button',
},
},
{
fieldName: 'hasStock',
label: '是否有货',
rules: z.string().default('0'),
component: 'RadioGroup',
componentProps: {
options: [{ label: '有货', value: '1' }, { label: '无货', value: '0' }],
buttonStyle: 'solid',
optionType: 'button',
},
},
{
fieldName: 'weight',
label: '重量',
component: 'Input',
componentProps: {
placeholder: '请输入重量',
},
},
{
fieldName: 'remark',
label: '备注',
component: 'TextArea',
componentProps: {
placeholder: '请输入备注',
},
},
];
}
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'pointCode',
label: '点位编码',
component: 'Input',
componentProps: {
allowClear: true,
placeholder: '请输入点位编码',
},
},
{
fieldName: 'productionArea',
label: '生产区域',
component: 'Select',
componentProps: {
allowClear: true,
options: getDictOptions(DICT_TYPE.PRODUCT_AREA),
placeholder: '请输入生产区域',
},
},
{
fieldName: 'isUsed',
label: '是否启用',
component: 'Select',
componentProps: {
allowClear: true,
options: [
{ label: '是', value: '1' },
{ label: '否', value: '0' },
],
placeholder: '请选择是否启用',
},
},
{
fieldName: 'hasStock',
label: '是否有货',
component: 'Select',
componentProps: {
allowClear: true,
options: [
{ label: '有货', value: '1' },
{ label: '无货', value: '0' },
],
placeholder: '请选择是否有货',
},
},
];
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions<LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition>['columns'] {
return [
{ type: 'checkbox', width: 40 },
{
field: 'pointId',
title: '点位标识',
minWidth: 120,
},
{
field: 'pointCode',
title: '点位编码',
minWidth: 120,
},
{
field: 'vehicleCode',
title: '载具编码',
minWidth: 120,
},
{
field: 'productionArea',
title: '生产区域',
minWidth: 120,
},
{
field: 'pointLocation',
title: '位置',
minWidth: 120,
},
{
field: 'remark',
title: '备注',
minWidth: 120,
},
{
field: 'isUsed',
title: '是否启用',
minWidth: 120,
},
{
field: 'updateTime',
title: '修改时间',
minWidth: 120,
},
{
field: 'weight',
title: '重量',
minWidth: 120,
},
{
field: 'hasStock',
title: '是否有货',
minWidth: 120,
},
{
field: 'sortSeq',
title: '顺序号',
minWidth: 120,
},
{
title: '操作',
width: 200,
fixed: 'right',
slots: { default: 'actions' },
},
];
}

View File

@@ -0,0 +1,186 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { LmsRawFoilEmptyRollerCashePositionApi } from '#/api/lms/rawfoilemptyrollercasheposition';
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 {
deleteRawFoilEmptyRollerCashePosition,
deleteRawFoilEmptyRollerCashePositionList,
exportRawFoilEmptyRollerCashePosition,
getRawFoilEmptyRollerCashePositionPage,
} from '#/api/lms/rawfoilemptyrollercasheposition';
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: LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition) {
formModalApi.setData(row).open();
}
/** 删除空辊缓存位 */
async function handleDelete(row: LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.pointId]),
duration: 0,
});
try {
await deleteRawFoilEmptyRollerCashePosition(row.pointId!);
message.success($t('ui.actionMessage.deleteSuccess', [row.pointId]));
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 deleteRawFoilEmptyRollerCashePositionList(checkedIds.value);
checkedIds.value = [];
message.success($t('ui.actionMessage.deleteSuccess'));
handleRefresh();
} finally {
hideLoading();
}
}
const checkedIds = ref<number[]>([]);
function handleRowCheckboxChange({
records,
}: {
records: LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition[];
}) {
checkedIds.value = records.map((item) => item.pointId!);
}
/** 导出表格 */
async function handleExport() {
const data = await exportRawFoilEmptyRollerCashePosition(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 getRawFoilEmptyRollerCashePositionPage({
pageNo: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
search: true,
},
} as VxeTableGridOptions<LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition>,
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: ['lms:raw-foil-empty-roller-cashe-position:create'],
onClick: handleCreate,
},
{
label: $t('ui.actionTitle.export'),
type: 'primary',
icon: ACTION_ICON.DOWNLOAD,
auth: ['lms:raw-foil-empty-roller-cashe-position:export'],
onClick: handleExport,
},
{
label: $t('ui.actionTitle.deleteBatch'),
type: 'primary',
danger: true,
icon: ACTION_ICON.DELETE,
auth: ['lms:raw-foil-empty-roller-cashe-position:delete'],
disabled: isEmpty(checkedIds),
onClick: handleDeleteBatch,
},
]"
/>
</template>
<template #actions="{ row }">
<TableAction
:actions="[
{
label: $t('common.edit'),
type: 'link',
icon: ACTION_ICON.EDIT,
auth: ['lms:raw-foil-empty-roller-cashe-position:update'],
onClick: handleEdit.bind(null, row),
},
{
label: $t('common.delete'),
type: 'link',
danger: true,
icon: ACTION_ICON.DELETE,
auth: ['lms:raw-foil-empty-roller-cashe-position:delete'],
popConfirm: {
title: $t('ui.actionMessage.deleteConfirm', [row.pointId]),
confirm: handleDelete.bind(null, row),
},
},
]"
/>
</template>
</Grid>
</Page>
</template>

View File

@@ -0,0 +1,82 @@
<script lang="ts" setup>
import type { LmsRawFoilEmptyRollerCashePositionApi } from '#/api/lms/rawfoilemptyrollercasheposition';
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { message } from 'antdv-next';
import { useVbenForm } from '#/adapter/form';
import { createRawFoilEmptyRollerCashePosition, getRawFoilEmptyRollerCashePosition, updateRawFoilEmptyRollerCashePosition } from '#/api/lms/rawfoilemptyrollercasheposition';
import { $t } from '#/locales';
import { useFormSchema } from '../data';
const emit = defineEmits(['success']);
const formData = ref<LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition>();
const getTitle = computed(() => {
return formData.value?.id
? $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 LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition;
try {
await (formData.value?.pointId ? updateRawFoilEmptyRollerCashePosition(data) : createRawFoilEmptyRollerCashePosition(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<LmsRawFoilEmptyRollerCashePositionApi.RawFoilEmptyRollerCashePosition>();
if (!data || !data.pointId) {
return;
}
modalApi.lock();
try {
formData.value = await getRawFoilEmptyRollerCashePosition(data.pointId);
// 设置到 values
await formApi.setValues(formData.value);
} finally {
modalApi.unlock();
}
},
});
</script>
<template>
<Modal :title="getTitle">
<Form class="mx-4" />
</Modal>
</template>

View File

@@ -306,6 +306,9 @@ const TASK_DICT = {
/** ========== RawFoil - 生箔管理模块 ========== */
const RawFoil_DICT = {
RAWFOIL_WORKORDER_STATUS: 'rawfoil_workorder_status', // 生箔工序工单状态
RAWFOIL_CASHEPOSITION_TYPE: 'rawfoil_casheposition_type', // 生箔母卷缓存位点位类型
RAWFOIL_CASHEPOSITION_STATUS: 'rawfoil_casheposition_status', // 生箔母卷缓存位库存状态
EMPTYROLLER_CASHEPOSITION_TYPE: 'emptyroller_casheposition_type', // 空辊缓存位点位类型
} as const;
/** 字典类型枚举 - 统一导出 */