From dd159ea51a7a77bd8cc00c70c0e900f472fb3395 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期四, 05 六月 2025 18:00:17 +0800
Subject: [PATCH] 完善基础管理 供应商、客户、煤种等功能

---
 src/views/basicInformation/mould/coal.vue |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/views/basicInformation/mould/coal.vue b/src/views/basicInformation/mould/coal.vue
index 59eafad..ae905ed 100644
--- a/src/views/basicInformation/mould/coal.vue
+++ b/src/views/basicInformation/mould/coal.vue
@@ -32,12 +32,12 @@
                     />
                 </el-form-item>
                     
-                <el-form-item>
+                <el-form-item class="dialog-footer">
+                    <el-button v-if="addOrEdit === 'edit'" @click="resetForm">閲嶇疆</el-button>
+                    <el-button v-if="addOrEdit === 'add'" @click="cancelForm">鍙栨秷</el-button>
                     <el-button type="primary" @click="submitForm">
                         纭畾
                     </el-button>
-                    <el-button v-if="addOrEdit === 'edit'" @click="resetForm">閲嶇疆</el-button>
-                    <el-button v-if="addOrEdit === 'add'" @click="cancelForm">鍙栨秷</el-button>
                 </el-form-item>
             </el-form>
         </el-dialog>
@@ -69,18 +69,16 @@
         default: ''
     },
 })
-
+const copyForm = defineModel("copyForm", {
+  required: true,
+  type: Object,
+});
 // 鍦ㄧ粍浠舵寕杞芥椂鑾峰彇鐢ㄦ埛淇℃伅
 onMounted(async () => {
     // 濡傛灉store涓病鏈夌敤鎴蜂俊鎭紝鍒欒幏鍙栫敤鎴蜂俊鎭�
     if (!userStore.name) {
         try {
             await userStore.getInfo()
-            console.log('鐢ㄦ埛淇℃伅:', {
-                id: userStore.id,
-                name: userStore.name,
-                nickName: userStore.nickName
-            })
             // 鑷姩濉厖缁存姢浜篒D
             if (props.addOrEdit === 'add') {
                 formData.value.maintainerId = userStore.id
@@ -89,11 +87,6 @@
             console.error('鑾峰彇鐢ㄦ埛淇℃伅澶辫触:', error)
         }
     } else {
-        console.log('鐢ㄦ埛淇℃伅:', {
-            id: userStore.id,
-            name: userStore.name,
-            nickName: userStore.nickName
-        })
         // 鑷姩濉厖缁存姢浜篒D
         if (props.addOrEdit === 'add') {
             formData.value.maintainerId = userStore.id
@@ -159,7 +152,8 @@
 // 閲嶇疆琛ㄥ崟
 const resetForm = () => {
     if (!formRef.value) return
-    formRef.value.resetFields()
+  formData.value = JSON.parse(JSON.stringify(copyForm.value));
+    // formRef.value.resetFields()
 }
 // 鍏抽棴寮圭獥
 const handleClose = () => {
@@ -186,5 +180,11 @@
 }
 </script>
 
-<style lang="sass" scoped>
+<style lang="scss" scoped>
+.dialog-footer {
+    display: flex;
+    margin-top: 20px;
+    flex-direction: column;
+    align-items: flex-end;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3