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/customer.vue |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/views/basicInformation/mould/customer.vue b/src/views/basicInformation/mould/customer.vue
index 4053cd7..f0f25c1 100644
--- a/src/views/basicInformation/mould/customer.vue
+++ b/src/views/basicInformation/mould/customer.vue
@@ -38,12 +38,12 @@
         <el-form-item label="鑱旂郴浜鸿缁�" prop="contactAddress">
           <el-input v-model="formData.contactAddress" placeholder="璇疯緭鍏ヨ仈绯讳汉璇︾粏鍦板潃" />
         </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>
@@ -83,6 +83,10 @@
   "handleBeforeClose",
   "update:customerDialogFormVisible",
 ]);
+const copyForm = defineModel("copyForm", {
+  required: true,
+  type: Object,
+});
 onMounted(() => {
   fetchAreaOptions()
 })
@@ -159,7 +163,6 @@
         let result = await addOrEditCustomer({
           ...formData.value,
         })
-        console.log(result);
         obj.value = {
           title: "缂栬緫",
           ...formData.value,
@@ -178,7 +181,9 @@
 // 閲嶇疆琛ㄥ崟
 const resetForm = () => {
   if (!formRef.value) return;
-  formRef.value.resetFields();
+  formData.value = JSON.parse(JSON.stringify(copyForm.value));
+
+  // formRef.value.resetFields();
 };
 // 鍏抽棴寮圭獥
 const handleClose = () => {
@@ -213,5 +218,11 @@
 });
 </script>
 
-<style lang="sass" scoped>
+<style lang="scss" scoped>
+.dialog-footer {
+  display: flex;
+  justify-content: flex-end;
+  margin-top: 20px;
+  flex-direction: column;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3