From 2540d86f0dbd77f654f558c3bf9d5ddbe7422f16 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 03 七月 2026 17:22:09 +0800
Subject: [PATCH] fix: 完成设计项目和归档台账接口对接,功能联调

---
 src/views/mes/pd/project/modules/document-form.vue |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 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..b08d6fa 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,14 +53,14 @@
       rules: 'selectRequired',
     },
     {
-      fieldName: 'name',
+      fieldName: 'documentName',
       label: '璧勬枡鍚嶇О',
       component: 'Input',
       componentProps: { placeholder: '璇疯緭鍏ヨ祫鏂欏悕绉�' },
       rules: 'required',
     },
     {
-      fieldName: 'version',
+      fieldName: 'documentVersion',
       label: '鐗堟湰鍙�',
       component: 'Input',
       componentProps: { placeholder: '濡� V1.0' },
@@ -65,21 +68,23 @@
     },
     {
       fieldName: 'fileUrl',
-      label: '鏂囦欢鍦板潃',
-      component: 'Input',
-      componentProps: { placeholder: '璇疯緭鍏ユ枃浠� URL 鎴栦笂浼犲悗濉叆' },
+      label: '鏂囦欢',
+      component: markRaw(FileUpload),
+      componentProps: {
+        directory: 'mes/pd',
+        maxNumber: 1,
+        onChange: async (url: string) => {
+          if (url) {
+            await formApi?.setFieldValue('fileUrl', url);
+          }
+        },
+      },
     },
     {
       fieldName: 'fileName',
       label: '鏂囦欢鍚�',
       component: 'Input',
-      componentProps: { placeholder: '濡� bom-list.xlsx' },
-    },
-    {
-      fieldName: 'remark',
-      label: '澶囨敞',
-      component: 'Textarea',
-      componentProps: { placeholder: '璇疯緭鍏ュ娉�', rows: 3 },
+      componentProps: { placeholder: '涓婁紶鍚庤嚜鍔ㄥ~鍏ワ紝涔熷彲鎵嬪姩杈撳叆' },
     },
   ],
   showDefaultActions: false,
@@ -113,10 +118,10 @@
     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 {
@@ -136,7 +141,7 @@
 </script>
 
 <template>
-  <Modal class="w-[560px]">
+  <Modal class="w-[720px]">
     <Form class="mx-4" />
   </Modal>
 </template>

--
Gitblit v1.9.3