From 913e7cd145459ca10e80392819aa052454927103 Mon Sep 17 00:00:00 2001
From: ZN <zhang_12370@163.com>
Date: 星期三, 18 三月 2026 17:56:34 +0800
Subject: [PATCH] feat: 新增销售合同导出功能并增强多个模块交互

---
 src/views/basicData/customerFile/index.vue |  110 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 103 insertions(+), 7 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index ad1c5bb..4e9f87a 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -112,6 +112,14 @@
         </el-row>
         <el-row :gutter="30">
           <el-col :span="12">
+            <el-form-item label="寮�鎴烽摱琛岋細"
+                          prop="bankName">
+              <el-input v-model="form.bankName"
+                        placeholder="璇疯緭鍏�"
+                        clearable />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="寮�鎴疯鍙凤細"
                           prop="bankCode">
               <el-input v-model="form.bankCode"
@@ -119,6 +127,8 @@
                         clearable />
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="瀹㈡埛鍒嗙被锛�"
                           prop="customerType">
@@ -130,6 +140,47 @@
                 <el-option label="杩涢攢鍟嗗鎴�"
                            value="杩涢攢鍟嗗鎴�" />
               </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="娉曚汉"
+                          prop="corporation">
+              <el-input v-model="form.corporation"
+                        placeholder="璇疯緭鍏�"
+                        clearable />
+            </el-form-item>
+          </el-col>
+          
+        </el-row>
+        <el-row :gutter="30">
+          <el-col :span="12">
+            <el-form-item label="浠g悊浜�"
+                          prop="agent">
+              <el-select v-model="form.agent"
+                         placeholder="璇烽�夋嫨浠g悊浜�"
+                         clearable
+                         filterable
+                         :disabled="agentOptions.length === 0"
+                         :no-data-text="agentNoDataText">
+                <el-option v-for="(contact, index) in agentOptions"
+                           :key="getAgentOptionKey(contact, index)"
+                           :label="getAgentLabel(contact)"
+                           :value="contact.contactPhone"
+                           :disabled="!contact.contactPhone">
+                  <span>{{ contact.contactPerson || "-" }}</span>
+                  <span style="float: right; color: var(--el-text-color-secondary); font-size: 12px;">
+                    {{ contact.contactPhone || "" }}
+                  </span>
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="浼犵湡"
+                          prop="fax">
+              <el-input v-model="form.fax"
+                        placeholder="璇疯緭鍏�"
+                        clearable />
             </el-form-item>
           </el-col>
         </el-row>
@@ -418,12 +469,7 @@
             </el-col>
           </el-row>
           <el-row :gutter="20">
-            <el-col :span="12">
-              <div class="info-item">
-                <span class="info-label">閾惰璐﹀彿锛�</span>
-                <span class="info-value">{{ detailForm.bankAccount }}</span>
-              </div>
-            </el-col>
+            
             <el-col :span="12">
               <div class="info-item">
                 <span class="info-label">寮�鎴疯鍙凤細</span>
@@ -616,7 +662,7 @@
 </template>
 
 <script setup>
-  import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
+  import { onMounted, ref, reactive, getCurrentInstance, toRefs, computed, watch } from "vue";
   import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
   import {
     addCustomer,
@@ -690,6 +736,8 @@
     companyPhone: "",
     companyAddress: "",
     basicBankAccount: "",
+    corporation: "",
+    fax: "",
     bankAccount: "",
     bankCode: "",
     contactPerson: "",
@@ -768,6 +816,16 @@
     {
       label: "寮�鎴疯鍙�",
       prop: "bankCode",
+      width: 220,
+    },
+    {
+      label: "娉曚汉浠h〃",
+      prop: "corporation",
+      width: 220,
+    },
+    {
+      label: "浼犵湡",
+      prop: "fax",
       width: 220,
     },
     {
@@ -856,6 +914,8 @@
       maintenanceTime: "",
       basicBankAccount: "",
       bankAccount: "",
+      fax: "",
+      corporation: "",
       bankCode: "",
       customerType: "",
     },
@@ -874,6 +934,9 @@
       ],
       basicBankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
       bankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+      corporation: [{ required: true, message: "璇疯緭鍏ユ硶浜轰唬琛�", trigger: "blur" }],
+      agent: [{ required: true, message: "璇烽�夋嫨浠g悊浜�", trigger: "change" }],
+      bankName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
       bankCode: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
       customerType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
     },
@@ -934,6 +997,39 @@
     },
   });
   const { searchForm, form, rules } = toRefs(data);
+
+  const agentOptions = computed(() => {
+    const list = formYYs.value?.contactList || [];
+    return list.filter(item => item && (item.contactPerson || item.contactPhone));
+  });
+
+  const agentNoDataText = computed(() => {
+    if (agentOptions.value.length === 0) return "璇峰厛鏂板鑱旂郴浜�";
+    return "鏃犲尮閰嶈仈绯讳汉";
+  });
+
+  const getAgentLabel = contact => {
+    const person = (contact?.contactPerson || "").trim();
+    const phone = (contact?.contactPhone || "").trim();
+    if (person && phone) return `${person}锛�${phone}锛塦;
+    return person || phone || "-";
+  };
+
+  const getAgentOptionKey = (contact, index) => {
+    return contact?.contactPhone || contact?.contactPerson || index;
+  };
+
+  watch(
+    () => agentOptions.value.map(item => item.contactPhone),
+    phones => {
+      const val = form.value?.agent;
+      if (!val) return;
+      if (!phones.includes(val)) {
+        form.value.agent = "";
+      }
+    }
+  );
+
   const addNewContact = () => {
     formYYs.value.contactList.push({
       contactPerson: "",

--
Gitblit v1.9.3