From fa42bcb7396e06e335bbbff67f5898b98f8d9aa0 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 24 七月 2026 17:09:28 +0800
Subject: [PATCH] refactor(mes): 移除工单模块中的BOM相关功能
---
src/views/mes/pd/project/modules/document-form.vue | 45 ++++++++++++++++++++++++++++-----------------
1 files changed, 28 insertions(+), 17 deletions(-)
diff --git a/src/views/mes/pd/project/modules/document-form.vue b/src/views/mes/pd/project/modules/document-form.vue
index 9d015cf..d32b29c 100644
--- a/src/views/mes/pd/project/modules/document-form.vue
+++ b/src/views/mes/pd/project/modules/document-form.vue
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { MesPdDocumentApi } from '#/api/mes/pd/document';
-import { ref } from 'vue';
+import { markRaw, ref } from 'vue';
import { useVbenModal } from '#/packages/effects/common-ui/src';
import { MesPdDocumentTypeEnum } from '#/packages/constants/src';
@@ -14,6 +14,7 @@
getPdDocument,
updatePdDocument,
} from '#/api/mes/pd/document';
+import { FileUpload } from '#/components/upload';
import { $t } from '#/locales';
import { getPdDocumentTypeOptions } from '../data';
@@ -25,9 +26,11 @@
const [Form, formApi] = useVbenForm({
commonConfig: {
componentProps: { class: 'w-full' },
+ formItemClass: 'col-span-1',
labelWidth: 100,
},
layout: 'horizontal',
+ wrapperClass: 'grid-cols-1',
schema: [
{
fieldName: 'id',
@@ -50,36 +53,35 @@
rules: 'selectRequired',
},
{
- fieldName: 'name',
+ fieldName: 'documentName',
label: '璧勬枡鍚嶇О',
component: 'Input',
componentProps: { placeholder: '璇疯緭鍏ヨ祫鏂欏悕绉�' },
rules: 'required',
},
{
- fieldName: 'version',
+ fieldName: 'documentVersion',
label: '鐗堟湰鍙�',
component: 'Input',
componentProps: { placeholder: '濡� V1.0' },
rules: 'required',
},
{
- fieldName: 'fileUrl',
- label: '鏂囦欢鍦板潃',
- component: 'Input',
- componentProps: { placeholder: '璇疯緭鍏ユ枃浠� URL 鎴栦笂浼犲悗濉叆' },
+ fieldName: 'blobIds',
+ label: '鏂囦欢',
+ component: markRaw(FileUpload),
+ componentProps: {
+ valueKey: 'id',
+ directory: 'mes/pd',
+ maxNumber: 10,
+ multiple: true,
+ },
},
{
fieldName: 'fileName',
label: '鏂囦欢鍚�',
component: 'Input',
- componentProps: { placeholder: '濡� bom-list.xlsx' },
- },
- {
- fieldName: 'remark',
- label: '澶囨敞',
- component: 'Textarea',
- componentProps: { placeholder: '璇疯緭鍏ュ娉�', rows: 3 },
+ componentProps: { placeholder: '涓婁紶鍚庤嚜鍔ㄥ~鍏ワ紝涔熷彲鎵嬪姩杈撳叆' },
},
],
showDefaultActions: false,
@@ -113,15 +115,24 @@
const data = modalApi.getData<{
id?: number;
projectId: number;
- documentType?: number;
+ documentType?: string;
}>();
isUpdate.value = !!data.id;
- modalApi.setState({ title: isUpdate.value ? '缂栬緫闄勪欢' : '涓婁紶闄勪欢' });
+ modalApi.setState({ title: isUpdate.value ? '缂栬緫璧勬枡' : '涓婁紶璧勬枡' });
if (data.id) {
modalApi.lock();
try {
const detail = await getPdDocument(data.id);
await formApi.setValues(detail);
+ if (detail.attachmentList?.length) {
+ await formApi.setFieldValue('blobIds', detail.attachmentList.map(item => ({
+ uid: String(item.id),
+ name: item.name || '',
+ url: item.url || '',
+ status: 'done',
+ id: item.id,
+ })));
+ }
} finally {
modalApi.unlock();
}
@@ -136,7 +147,7 @@
</script>
<template>
- <Modal class="w-[560px]">
+ <Modal class="w-[720px]">
<Form class="mx-4" />
</Modal>
</template>
--
Gitblit v1.9.3