feat:新增LMS 生箔工序工单管理。
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace LmsRawFoilWorkOrderApi {
|
||||
/** 生箔工序工单信息 */
|
||||
export interface RawFoilWorkOrder {
|
||||
workorderId: number; // 工单标识
|
||||
containerName?: string; // 母卷号
|
||||
productionOrder?: string; // 生产工单
|
||||
productCode?: string; // 产品编码
|
||||
productName?: string; // 产品名称
|
||||
productWeight: number; // 重量
|
||||
realstartTime: string | Dayjs; // 开始时间
|
||||
realendTime: string | Dayjs; // 结束时间
|
||||
status?: string; // 状态
|
||||
agvno: string; // 车号
|
||||
remark: string; // 备注
|
||||
creator: string; // 创建人
|
||||
createTime?: string | Dayjs; // 创建时间
|
||||
updater: string; // 修改人
|
||||
updateTime?: string | Dayjs; // 修改时间
|
||||
deleted?: string; // 是否删除
|
||||
productionArea: string; // 生产区域
|
||||
pointCode: string; // 点位编码
|
||||
windRollWeight: number; // 收卷辊重量
|
||||
windRollCode: string; // 收卷辊编码
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询生箔工序工单分页 */
|
||||
export function getRawFoilWorkOrderPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>>(
|
||||
'/lms/raw-foil-work-order/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询生箔工序工单详情 */
|
||||
export function getRawFoilWorkOrder(id: number) {
|
||||
return requestClient.get<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>(
|
||||
`/lms/raw-foil-work-order/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增生箔工序工单 */
|
||||
export function createRawFoilWorkOrder(data: LmsRawFoilWorkOrderApi.RawFoilWorkOrder) {
|
||||
return requestClient.post('/lms/raw-foil-work-order/create', data);
|
||||
}
|
||||
|
||||
/** 修改生箔工序工单 */
|
||||
export function updateRawFoilWorkOrder(data: LmsRawFoilWorkOrderApi.RawFoilWorkOrder) {
|
||||
return requestClient.put('/lms/raw-foil-work-order/update', data);
|
||||
}
|
||||
|
||||
/** 称重:修改生箔工序工单重量 */
|
||||
export function updateRawFoilWorkOrderWeight(id: number, productWeight: number) {
|
||||
return requestClient.put('/lms/raw-foil-work-order/update-weight', null, {
|
||||
params: { id, productWeight },
|
||||
});
|
||||
}
|
||||
|
||||
/** 强制结束生箔工序工单 */
|
||||
export function forceEndRawFoilWorkOrder(id: number) {
|
||||
return requestClient.put('/lms/raw-foil-work-order/force-end', null, {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/** 检验:修改生箔工序工单备注 */
|
||||
export function updateRawFoilWorkOrderRemark(id: number, remark: string) {
|
||||
return requestClient.put('/lms/raw-foil-work-order/update-remark', null, {
|
||||
params: { id, remark },
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除生箔工序工单 */
|
||||
export function deleteRawFoilWorkOrder(id: number) {
|
||||
return requestClient.delete(`/lms/raw-foil-work-order/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除生箔工序工单 */
|
||||
export function deleteRawFoilWorkOrderList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/lms/raw-foil-work-order/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出生箔工序工单 */
|
||||
export function exportRawFoilWorkOrder(params: any) {
|
||||
return requestClient.download('/lms/raw-foil-work-order/export-excel', { params });
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'workorderId',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
triggerFields: [''],
|
||||
show: () => false,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'containerName',
|
||||
label: '母卷号',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入母卷号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: '点位编码',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入点位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productionOrder',
|
||||
label: '生产工单',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入生产工单',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productCode',
|
||||
label: '产品编码',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入产品编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productName',
|
||||
label: '产品名称',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入产品名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productWeight',
|
||||
label: '重量',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入重量',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'realstartTime',
|
||||
label: '开始时间',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'x',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'agvno',
|
||||
label: '车号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入车号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'windRollWeight',
|
||||
label: '收卷辊重量',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入收卷辊重量',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'windRollCode',
|
||||
label: '收卷辊编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入收卷辊编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'remark',
|
||||
label: '备注',
|
||||
component: 'TextArea',
|
||||
componentProps: {
|
||||
placeholder: '请输入备注',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'containerName',
|
||||
label: '母卷号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入母卷号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'timeRange',
|
||||
label: '时间范围',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
...getRangePickerDefaultProps(),
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'status',
|
||||
label: '状态',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: getDictOptions(DICT_TYPE.RAWFOIL_WORKORDER_STATUS),
|
||||
placeholder: '请选择状态',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productionArea',
|
||||
label: '生产区域',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: getDictOptions(DICT_TYPE.PRODUCT_AREA),
|
||||
placeholder: '请选择生产区域',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: '点位编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入点位编码',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
{ type: 'checkbox', width: 40 },
|
||||
{
|
||||
field: 'productionOrder',
|
||||
title: '生产工单',
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
minWidth: 120,
|
||||
cellRender: {
|
||||
name: 'CellDict',
|
||||
props: { type: DICT_TYPE.RAWFOIL_WORKORDER_STATUS },
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'containerName',
|
||||
title: '母卷号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointCode',
|
||||
title: '点位编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'productCode',
|
||||
title: '产品编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'productWeight',
|
||||
title: '重量',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'realstartTime',
|
||||
title: '开始时间',
|
||||
minWidth: 160,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'realendTime',
|
||||
title: '结束时间',
|
||||
minWidth: 160,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'agvno',
|
||||
title: '车号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '修改时间',
|
||||
minWidth: 160,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'productionArea',
|
||||
title: '生产区域',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'windRollWeight',
|
||||
title: '收卷辊重量',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'windRollCode',
|
||||
title: '收卷辊编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'actions' },
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { LmsRawFoilWorkOrderApi } from '#/api/lms/rawfoilworkorder';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { confirm, Page, useVbenModal } from '@vben/common-ui';
|
||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
||||
|
||||
import { message } from 'antdv-next';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteRawFoilWorkOrder,
|
||||
exportRawFoilWorkOrder,
|
||||
forceEndRawFoilWorkOrder,
|
||||
getRawFoilWorkOrderPage,
|
||||
} from '#/api/lms/rawfoilworkorder';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
import Remark from './modules/remark.vue';
|
||||
import Weight from './modules/weight.vue';
|
||||
|
||||
/** 开始状态码:仅开始状态的工单可修改/删除 */
|
||||
const STATUS_START = '01';
|
||||
/** 结束状态码:结束状态的工单不可强制结束 */
|
||||
const STATUS_END = '09';
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
const [WeightModal, weightModalApi] = useVbenModal({
|
||||
connectedComponent: Weight,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
const [RemarkModal, remarkModalApi] = useVbenModal({
|
||||
connectedComponent: Remark,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 创建生箔工序工单 */
|
||||
function handleCreate() {
|
||||
formModalApi.setData(null).open();
|
||||
}
|
||||
|
||||
/** 编辑生箔工序工单 */
|
||||
function handleEdit(row: LmsRawFoilWorkOrderApi.RawFoilWorkOrder) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除生箔工序工单 */
|
||||
async function handleDelete(row: LmsRawFoilWorkOrderApi.RawFoilWorkOrder) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.workorderId]),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteRawFoilWorkOrder(row.workorderId!);
|
||||
message.success($t('ui.actionMessage.deleteSuccess', [row.workorderId]));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 选中的表格行(称重/强制结束/检验需要整行数据判断状态) */
|
||||
const checkedRows = ref<LmsRawFoilWorkOrderApi.RawFoilWorkOrder[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: LmsRawFoilWorkOrderApi.RawFoilWorkOrder[];
|
||||
}) {
|
||||
checkedRows.value = records;
|
||||
}
|
||||
|
||||
/** 清空表格勾选状态 */
|
||||
async function clearChecked() {
|
||||
checkedRows.value = [];
|
||||
await gridApi.grid?.clearCheckboxRow();
|
||||
}
|
||||
|
||||
/** 称重:弹框录入重量 */
|
||||
function handleWeight() {
|
||||
weightModalApi.setData(checkedRows.value[0]).open();
|
||||
}
|
||||
|
||||
/** 称重成功:清空选中并刷新 */
|
||||
async function handleWeightSuccess() {
|
||||
await clearChecked();
|
||||
handleRefresh();
|
||||
}
|
||||
|
||||
/** 强制结束工单 */
|
||||
async function handleForceEnd() {
|
||||
const row = checkedRows.value[0]!;
|
||||
// 结束状态不允许强制结束
|
||||
if (row.status === STATUS_END) {
|
||||
message.warning('不能对完成状态的工单强制结束');
|
||||
return;
|
||||
}
|
||||
await confirm(`确认强制结束工单「${row.productionOrder}」吗?`);
|
||||
const hideLoading = message.loading({
|
||||
content: '正在强制结束工单...',
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await forceEndRawFoilWorkOrder(row.workorderId!);
|
||||
await clearChecked();
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 检验:弹框修改备注 */
|
||||
function handleRemark() {
|
||||
remarkModalApi.setData(checkedRows.value[0]).open();
|
||||
}
|
||||
|
||||
/** 检验成功:清空选中并刷新 */
|
||||
async function handleRemarkSuccess() {
|
||||
await clearChecked();
|
||||
handleRefresh();
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
async function handleExport() {
|
||||
const data = await exportRawFoilWorkOrder(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 getRawFoilWorkOrderPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'workorderId',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>,
|
||||
gridEvents: {
|
||||
checkboxAll: handleRowCheckboxChange,
|
||||
checkboxChange: handleRowCheckboxChange,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="handleRefresh" />
|
||||
<WeightModal @success="handleWeightSuccess" />
|
||||
<RemarkModal @success="handleRemarkSuccess" />
|
||||
<Grid table-title="生箔工序工单列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('ui.actionTitle.create', ['生箔工序工单']),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.ADD,
|
||||
auth: ['lms:raw-foil-work-order:create'],
|
||||
onClick: handleCreate,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.export'),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.DOWNLOAD,
|
||||
auth: ['lms:raw-foil-work-order:export'],
|
||||
onClick: handleExport,
|
||||
},
|
||||
{
|
||||
label: '称重',
|
||||
type: 'primary',
|
||||
auth: ['lms:raw-foil-work-order:update'],
|
||||
disabled: checkedRows.length !== 1,
|
||||
onClick: handleWeight,
|
||||
},
|
||||
{
|
||||
label: '检验',
|
||||
type: 'primary',
|
||||
auth: ['lms:raw-foil-work-order:update'],
|
||||
disabled: checkedRows.length !== 1,
|
||||
onClick: handleRemark,
|
||||
},
|
||||
{
|
||||
label: '强制结束',
|
||||
type: 'primary',
|
||||
danger: true,
|
||||
auth: ['lms:raw-foil-work-order:update'],
|
||||
disabled: checkedRows.length !== 1,
|
||||
onClick: handleForceEnd,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
icon: ACTION_ICON.EDIT,
|
||||
auth: ['lms:raw-foil-work-order:update'],
|
||||
disabled: row.status !== STATUS_START,
|
||||
onClick: handleEdit.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
type: 'link',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['lms:raw-foil-work-order:delete'],
|
||||
disabled: row.status !== STATUS_START,
|
||||
popConfirm: {
|
||||
title: $t('ui.actionMessage.deleteConfirm', [row.workorderId]),
|
||||
confirm: handleDelete.bind(null, row),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
@@ -0,0 +1,82 @@
|
||||
<script lang="ts" setup>
|
||||
import type { LmsRawFoilWorkOrderApi } from '#/api/lms/rawfoilworkorder';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'antdv-next';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createRawFoilWorkOrder, getRawFoilWorkOrder, updateRawFoilWorkOrder } from '#/api/lms/rawfoilworkorder';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.workorderId
|
||||
? $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 LmsRawFoilWorkOrderApi.RawFoilWorkOrder;
|
||||
try {
|
||||
await (formData.value?.workorderId ? updateRawFoilWorkOrder(data) : createRawFoilWorkOrder(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<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>();
|
||||
if (!data || !data.workorderId) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
formData.value = await getRawFoilWorkOrder(data.workorderId);
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal :title="getTitle">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
||||
@@ -289,6 +289,11 @@ const TASK_DICT = {
|
||||
TASK_ACS_TASK_TYPE: 'task_acs_task_type', // 任务状态
|
||||
} as const;
|
||||
|
||||
/** ========== RawFoil - 生箔管理模块 ========== */
|
||||
const RawFoil_DICT = {
|
||||
RAWFOIL_WORKORDER_STATUS: 'rawfoil_workorder_status', // 生箔工序工单状态
|
||||
} as const;
|
||||
|
||||
/** 字典类型枚举 - 统一导出 */
|
||||
const DICT_TYPE = {
|
||||
...AI_DICT,
|
||||
@@ -307,6 +312,7 @@ const DICT_TYPE = {
|
||||
...SYSTEM_DICT,
|
||||
...COMMON_DICT,
|
||||
...TASK_DICT,
|
||||
...RawFoil_DICT,
|
||||
} as const;
|
||||
|
||||
export { DICT_TYPE };
|
||||
|
||||
Reference in New Issue
Block a user