From 2e217b787931233134f5a656b3bc2503ed034eb7 Mon Sep 17 00:00:00 2001
From: sen <sen@qq.com>
Date: 星期二, 03 二月 2026 15:47:57 +0800
Subject: [PATCH] 增加开票,抬头关联发票抬头管理

---
 ui/admin-ui3/src/components/makeOutInvoice/index.vue |  123 ++++++++++++++++++++++++++++-------------
 1 files changed, 84 insertions(+), 39 deletions(-)

diff --git a/ui/admin-ui3/src/components/makeOutInvoice/index.vue b/ui/admin-ui3/src/components/makeOutInvoice/index.vue
index 505e202..0235fce 100644
--- a/ui/admin-ui3/src/components/makeOutInvoice/index.vue
+++ b/ui/admin-ui3/src/components/makeOutInvoice/index.vue
@@ -1,10 +1,5 @@
 <template>
-  <el-dialog 
-    v-model="visible" 
-    :title="dialogTitle" 
-    width="1200px" 
-    destroy-on-close
-  >
+  <el-dialog v-model="visible" :title="dialogTitle" width="1200px" destroy-on-close>
     <el-descriptions title="璐﹀崟鍩烘湰淇℃伅" :column="3" border class="mb-5">
       <el-descriptions-item label="绯荤粺缂栧彿">{{ billInfo.systemNo }}</el-descriptions-item>
       <el-descriptions-item label="璐﹀崟鍚嶇О">{{ billInfo.billName }}</el-descriptions-item>
@@ -12,30 +7,28 @@
         {{ type.includes('搴旀敹') ? billInfo.customerName : billInfo.supplierName }}
       </el-descriptions-item>
       <el-descriptions-item label="鍗曟嵁鏁伴噺">{{ billInfo.documentCount }}</el-descriptions-item>
-      <el-descriptions-item label="搴旂粨绠楅噾棰�"><span class="text-bold">{{ billInfo.totalAmount }}</span></el-descriptions-item>
+      <el-descriptions-item label="搴旂粨绠楅噾棰�"><span class="text-bold">{{ billInfo.totalAmount
+          }}</span></el-descriptions-item>
       <el-descriptions-item label="甯佸埗">{{ billInfo.currency }}</el-descriptions-item>
       <el-descriptions-item label="鍑忓厤閲戦">{{ billInfo.discountAmount }}</el-descriptions-item>
-      <el-descriptions-item :label="type.includes('搴旀敹') ? '宸叉敹閲戦' : '宸蹭粯閲戦'">{{ billInfo.receivedAmount }}</el-descriptions-item>
+      <el-descriptions-item :label="type.includes('搴旀敹') ? '宸叉敹閲戦' : '宸蹭粯閲戦'">{{ billInfo.receivedAmount
+        }}</el-descriptions-item>
       <el-descriptions-item :label="type.includes('搴旀敹') ? '寰呮敹閲戦' : '寰呬粯閲戦'">
         <span class="text-danger">{{ billInfo.pendingAmount }}</span>
       </el-descriptions-item>
       <el-descriptions-item label="鍛ㄦ湡绫诲瀷">{{ billInfo.periodType }}</el-descriptions-item>
-      <el-descriptions-item label="涓氬姟鏈熼棿">{{ billInfo.businessStartDate }} ~ {{ billInfo.businessEndDate }}</el-descriptions-item>
-      <el-descriptions-item label="璐﹀崟鍛ㄦ湡">{{ billInfo.billingStartDate }} ~ {{ billInfo.billingEndDate }}</el-descriptions-item>
+      <el-descriptions-item label="涓氬姟鏈熼棿">{{ billInfo.businessStartDate }} ~ {{ billInfo.businessEndDate
+        }}</el-descriptions-item>
+      <el-descriptions-item label="璐﹀崟鍛ㄦ湡">{{ billInfo.billingStartDate }} ~ {{ billInfo.billingEndDate
+        }}</el-descriptions-item>
     </el-descriptions>
 
-    <div  v-if="InvoiceDetails !== '寮�绁ㄦ槑缁�'"  class="section-header">
+    <div v-if="InvoiceDetails !== '寮�绁ㄦ槑缁�'" class="section-header">
       <h3 class="section-title">鍙戠エ鍟嗗搧鏄庣粏</h3>
-      <el-button 
-       
-        type="primary" 
-        size="small" 
-        icon="Plus" 
-        @click="addItemRow"
-      >鏂板</el-button>
+      <el-button type="primary" size="small" icon="Plus" @click="addItemRow">鏂板</el-button>
     </div>
-    
-    <el-table  v-if="InvoiceDetails !== '寮�绁ㄦ槑缁�'"  :data="form.invoiceBillDetails" border class="mb-5">
+
+    <el-table v-if="InvoiceDetails !== '寮�绁ㄦ槑缁�'" :data="form.invoiceBillDetails" border class="mb-5">
       <el-table-column label="鍟嗗搧鍚嶇О" prop="goodsName">
         <template #default="{ row }">
           <el-input v-if="!row.isSaved && InvoiceDetails !== '寮�绁ㄦ槑缁�'" v-model="row.goodsName" placeholder="鍟嗗搧鍚嶇О" />
@@ -44,7 +37,8 @@
       </el-table-column>
       <el-table-column label="鍗曚环" prop="price" width="200">
         <template #default="{ row }">
-          <el-input-number v-if="!row.isSaved && InvoiceDetails !== '寮�绁ㄦ槑缁�'" v-model="row.price" :precision="2" style="width:100%" />
+          <el-input-number v-if="!row.isSaved && InvoiceDetails !== '寮�绁ㄦ槑缁�'" v-model="row.price" :precision="2"
+            style="width:100%" />
           <span v-else>{{ row.price }}</span>
         </template>
       </el-table-column>
@@ -70,8 +64,16 @@
       <el-form ref="formRef" :model="form" :rules="formRules" label-width="130px">
         <el-row :gutter="20">
           <el-col :span="8">
-            <el-form-item label="鎶ご鍏徃" prop="invoiceCompanyName">
+            <!-- <el-form-item label="鎶ご鍏徃" prop="invoiceCompanyName">
               <el-input v-model="form.invoiceCompanyName" placeholder="璇疯緭鍏�" />
+            </el-form-item> -->
+            <el-form-item label="鎶ご鍏徃" prop="invoiceCompanyName">
+              <el-input v-model="form.invoiceCompanyName" @click="openBankDialog" readonly
+                placeholder="璇疯緭鍏ユ姮澶村叕鍙�">
+                <template #append>
+                  <el-button icon="Search" @click="openBankDialog" />
+                </template>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -86,15 +88,18 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="8"><el-form-item label="寮�鎴烽摱琛�"><el-input v-model="form.invoiceBankName" /></el-form-item></el-col>
+          <el-col :span="8"><el-form-item label="寮�鎴烽摱琛�"><el-input
+                v-model="form.invoiceBankName" /></el-form-item></el-col>
           <el-col :span="8"><el-form-item label="鍩烘湰璐﹀彿"><el-input v-model="form.invoiceBankNo" /></el-form-item></el-col>
-          <el-col :span="8"><el-form-item label="宸插紑绁ㄩ噾棰�"><el-input v-model="billInfo.invoicedAmount" disabled /></el-form-item></el-col>
+          <el-col :span="8"><el-form-item label="宸插紑绁ㄩ噾棰�"><el-input v-model="billInfo.invoicedAmount"
+                disabled /></el-form-item></el-col>
           <el-col :span="8">
             <el-form-item label="鏈寮�绁ㄩ噾棰�" prop="currentInvoicedAmount">
               <el-input-number v-model="form.currentInvoicedAmount" disabled :precision="2" style="width:100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="16"><el-form-item label="鍙戠エ澶囨敞"><el-input v-model="form.invoiceRemark" type="textarea" /></el-form-item></el-col>
+          <el-col :span="16"><el-form-item label="鍙戠エ澶囨敞"><el-input v-model="form.invoiceRemark"
+                type="textarea" /></el-form-item></el-col>
         </el-row>
       </el-form>
     </template>
@@ -110,7 +115,8 @@
         <el-table-column label="璐拱鏂瑰悕绉�" prop="buyerName" align="center" />
         <el-table-column label="閿�鍞柟鍚嶇О" prop="sellerName" align="center" />
       </el-table>
-      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="fetchRecords" />
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize" @pagination="fetchRecords" />
     </template>
 
     <template #footer>
@@ -118,11 +124,15 @@
       <el-button @click="openIshpw">鍏抽棴</el-button>
     </template>
   </el-dialog>
+
+     <invoiceManagementDialog v-model:visible="supplierBankIsible" :default-selected-id="form.invoiceInfoId"
+        @confirm="handleBankCardfirm" />
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, computed,watch } from 'vue'
+import { ref, reactive, computed, watch } from 'vue'
 import useCurrentInstance from "@/utils/useCurrentInstance";
+import invoiceManagementDialog from "../invoiceManagementDialog/index.vue";
 
 const { proxy } = useCurrentInstance();
 const { sys_invoice_type } = proxy.useDict('sys_invoice_type');
@@ -174,7 +184,7 @@
   billInfo.value = row;
   recordList.value = row.recordList || [];
   queryParams.billId = row.id;
-  
+
   if (props.InvoiceDetails === '寮�绁ㄦ槑缁�') {
     fetchRecords();
   } else {
@@ -185,11 +195,11 @@
 
 // 5. 鏂板琛屽垵濮嬪寲
 const addItemRow = () => {
-  form.invoiceBillDetails.push({ 
-    goodsName: '', 
-    price: 0, 
-    withTaxFlag: 0, 
-    isSaved: false 
+  form.invoiceBillDetails.push({
+    goodsName: '',
+    price: 0,
+    withTaxFlag: 0,
+    isSaved: false
   });
 }
 const emit = defineEmits(['success']);
@@ -246,13 +256,48 @@
 const openIshpw = () => {
   visible.value = false;
 }
-defineExpose({ open,openIshpw })
+const supplierBankIsible = ref(false);
+
+const openBankDialog = () => {
+  supplierBankIsible.value = true;
+}
+const handleBankCardfirm = (data) => {
+        form.invoiceCompanyName = data.invoiceCompanyName;
+        form.invoiceCreditCode = data.invoiceCreditCode;
+        form.invoiceType = data.invoiceType;
+        form.invoiceBankName = data.invoiceBankName;
+        form.invoiceBankNo = data.invoiceBankNo;
+        form.invoiceInfoId = data.id; // 寤鸿鍦� formData 澧炲姞姝� ID 瀛楁鐢ㄤ簬鍥炴樉
+};
+// 寮圭獥鏄剧ず鐘舵��
+defineExpose({ open, openIshpw })
 </script>
 
 <style scoped>
-.mb-5 { margin-bottom: 20px; }
-.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
-.section-title { font-size: 16px; font-weight: bold; border-left: 4px solid #409eff; padding-left: 10px; margin: 15px 0; }
-.text-bold { font-weight: bold; }
-.text-danger { color: #f56c6c; }
+.mb-5 {
+  margin-bottom: 20px;
+}
+
+.section-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 10px;
+}
+
+.section-title {
+  font-size: 16px;
+  font-weight: bold;
+  border-left: 4px solid #409eff;
+  padding-left: 10px;
+  margin: 15px 0;
+}
+
+.text-bold {
+  font-weight: bold;
+}
+
+.text-danger {
+  color: #f56c6c;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.8.0