From 9ea5ff67655241271bdf04bb50ca3a8d60c4e22a Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期二, 11 八月 2026 15:07:02 +0800
Subject: [PATCH] fix: 用河南鹤壁代码覆盖山西长治

---
 src/views/financialManagement/receivable/outputInvoice.vue |  148 +++++++-----------------------------------------
 1 files changed, 23 insertions(+), 125 deletions(-)

diff --git a/src/views/financialManagement/receivable/outputInvoice.vue b/src/views/financialManagement/receivable/outputInvoice.vue
index effb0af..d746aea 100644
--- a/src/views/financialManagement/receivable/outputInvoice.vue
+++ b/src/views/financialManagement/receivable/outputInvoice.vue
@@ -37,7 +37,7 @@
       <div class="actions">
         <div></div>
         <div>
-          <el-button type="primary" @click="add" icon="Plus">褰曞叆鍙戠エ</el-button>
+          <!-- <el-button type="primary" @click="add" icon="Plus">褰曞叆鍙戠エ</el-button> -->
           <el-button type="success" @click="handleExport" icon="Download">瀵煎嚭</el-button>
         </div>
       </div>
@@ -46,8 +46,6 @@
         v-loading="tableLoading"
         :column="columns"
         :tableData="dataList"
-        isShowSummary
-        :summaryMethod="getSummaries"
         :page="{
           current: pagination.currentPage,
           size: pagination.pageSize,
@@ -93,7 +91,7 @@
       @confirm="submitForm"
       @cancel="closeDialog"
     >
-      <el-form :model="form" :rules="rules" ref="formRef" label-width="100px">
+      <el-form :model="form" :rules="rules" ref="formRef" label-width="120px">
         <el-row v-if="isView" :gutter="20">
           <el-col :span="12">
             <el-form-item label="鐘舵��">
@@ -111,25 +109,13 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="瀹㈡埛" prop="customerId">
-              <el-select @change="checkCustomer" v-model="form.customerId" placeholder="璇烽�夋嫨瀹㈡埛" style="width: 100%;" :disabled="isView">
+              <el-select v-model="form.customerId" placeholder="璇烽�夋嫨瀹㈡埛" style="width: 100%;" :disabled="isView">
                 <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="20">
-          <el-col :span="12">
-            <el-form-item label="鍏宠仈寮�绁ㄧ敵璇�" prop="accountInvoiceApplicationId">
-              <el-select v-model="form.accountInvoiceApplicationId"
-                        placeholder="璇峰厛閫夋嫨瀹㈡埛"
-                        readonly
-                         @change="selectionApply"
-                        :disabled="!form.customerId || isView"
-                        class="outbound-batch-select">
-                <el-option v-for="(item,index) in applyList" :key="index" :label="item.invoiceApplicationNo" :value="item.id"></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
             <el-form-item label="寮�绁ㄦ棩鏈�" prop="invoiceDate">
               <el-date-picker
@@ -142,15 +128,14 @@
               />
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="鍙戠エ绫诲瀷" prop="invoiceType">
               <el-select
-                  v-model="form.invoiceType"
-                  placeholder="璇烽�夋嫨鍙戠エ绫诲瀷"
-                  style="width: 100%;"
-                  :disabled="isView"
+                v-model="form.invoiceType"
+                placeholder="璇烽�夋嫨鍙戠エ绫诲瀷"
+                style="width: 100%;"
+                :disabled="isView"
+                @change="handleInvoiceTypeChange"
               >
                 <el-option label="澧炲�肩◣涓撶敤鍙戠エ" value="澧炲�肩◣涓撶敤鍙戠エ" />
                 <el-option label="澧炲�肩◣鏅�氬彂绁�" value="澧炲�肩◣鏅�氬彂绁�" />
@@ -158,6 +143,8 @@
               </el-select>
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="绋庣巼" prop="taxRate">
               <el-select
@@ -165,7 +152,7 @@
                 placeholder="璇烽�夋嫨绋庣巼"
                 style="width: 100%;"
                 :disabled="isView"
-                @change="handleTaxRateChange"
+                @change="calculateTax"
               >
                 <el-option
                   v-for="dict in tax_rate"
@@ -178,7 +165,7 @@
           </el-col>
         </el-row>
         <el-row :gutter="20">
-          <el-col :span="10">
+          <el-col :span="8">
             <el-form-item label="閲戦(涓嶅惈绋�)" prop="amount">
               <el-input-number
                 v-model="form.amount"
@@ -186,18 +173,18 @@
                 :precision="2"
                 style="width: 100%;"
                 :disabled="isView"
-                @change="handleTaxRateChange"
+                @change="calculateTax"
               />
             </el-form-item>
           </el-col>
-          <el-col :span="7">
+          <el-col :span="8">
             <el-form-item label="绋庨">
-              <el-input v-model="form.taxAmount" style="width: 100%;" disabled />
+              <el-input v-model="form.taxAmount" disabled />
             </el-form-item>
           </el-col>
-          <el-col :span="7">
+          <el-col :span="8">
             <el-form-item label="浠风◣鍚堣">
-              <el-input v-model="form.totalAmount" style="width: 100%;" disabled />
+              <el-input v-model="form.totalAmount" disabled />
             </el-form-item>
           </el-col>
         </el-row>
@@ -235,7 +222,6 @@
   cancelAccountSalesInvoice,
   deleteAccountSalesInvoice,
 } from "@/api/financialManagement/accountSalesInvoice.js";
-import {getAccountInvoiceApplicationList} from "@/api/financialManagement/invoiceApply.js";
 
 const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
 
@@ -283,9 +269,6 @@
 const fileDialogVisible = ref(false);
 const currentRecordId = ref(0);
 
-const applySelectVisible = ref(false);
-const applyList = ref([]);
-
 const openFileDialog = (row) => {
   if (!row.accountInvoiceApplicationId) {
     ElMessage.warning("鏈叧鑱斿紑绁ㄧ敵璇凤紝鏃犳硶鏌ョ湅闄勪欢");
@@ -328,14 +311,12 @@
   totalAmount: 0,
   content: "",
   remark: "",
-  deptId: undefined,
   accountInvoiceApplicationId: undefined,
   storageAttachmentId: undefined,
 });
 
 const rules = {
   invoiceNo: [{ required: true, message: "璇疯緭鍏ュ彂绁ㄥ彿鐮�", trigger: "blur" }],
-  accountInvoiceApplicationId: [{ required: true, message: "璇烽�夋嫨寮�绁ㄧ敵璇�", trigger: "change" }],
   customerId: [{ required: true, message: "璇烽�夋嫨瀹㈡埛", trigger: "change" }],
   invoiceDate: [{ required: true, message: "璇烽�夋嫨寮�绁ㄦ棩鏈�", trigger: "change" }],
   invoiceType: [{ required: true, message: "璇烽�夋嫨鍙戠エ绫诲瀷", trigger: "change" }],
@@ -343,99 +324,18 @@
   amount: [{ required: true, message: "璇疯緭鍏ラ噾棰�", trigger: "blur" }],
 };
 
-// 閫夋嫨瀹㈡埛
-const checkCustomer = (val) =>{
-  loadApplyList(val);
-}
-
-//鏌ヨ寮�绁ㄧ敵璇峰垪琛�
-const loadApplyList = (customerId) => {
-  if (!customerId) {
-    applyList.value = [];
-    return Promise.resolve();
-  }
-  return getAccountInvoiceApplicationList({ customerId })
-      .then(res => {
-        if (res.code === 200) {
-          const list = res.data?.records ?? res.data ?? [];
-          applyList.value = Array.isArray(list) ? list : [];
-        } else {
-          applyList.value = [];
-        }
-      })
-      .catch(() => {
-        applyList.value = [];
-      })
+const formatMoney = (value) => {
+  if (value === undefined || value === null) return "0.00";
+  return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
 };
 
-const selectionApply = (val)=>{
-  const applyObj = applyList.value.find(item=>item.id === val);
-  if(!applyObj){
-    ElMessage.warning("璇烽�夋嫨鍏宠仈鐨勫紑绁ㄧ敵璇�");
-    return;
-  }
-  form.remark = applyObj.remark;
-  form.content = applyObj.invoiceContent;
-  form.invoiceDate = applyObj.applyDate;
-  form.invoiceType = applyObj.invoiceType;
-  form.deptId = applyObj.deptId;
-  form.taxRate = applyObj.taxRate;
-  form.totalAmount = applyObj.invoiceAmount
-  handleTaxRateChange();
-}
-
-/** 浠风◣鍚堣鍙樻洿锛氭寜绋庣巼鍙嶇畻涓嶅惈绋庨噾棰濄�佺◣棰� */
-const calculateTaxFromInclusive = (inclusiveTotal) => {
-  const total = Number(inclusiveTotal ?? form.totalAmount ?? 0);
-  if (total <= 0) {
-    form.amount = 0;
-    form.taxAmount = 0;
-    form.totalAmount = 0;
-    return;
-  }
-  const rate = Number(form.taxRate) / 100;
-  form.totalAmount = Number(total.toFixed(2));
-  form.amount = Number((form.totalAmount / (1 + rate)).toFixed(2));
-  form.taxAmount = Number((form.totalAmount - form.amount).toFixed(2));
-};
-
-const calculateTaxFromExclusive = () => {
+const calculateTax = () => {
   form.taxAmount = Number((form.amount * form.taxRate / 100).toFixed(2));
   form.totalAmount = Number((form.amount + form.taxAmount).toFixed(2));
 };
 
-const handleTaxRateChange = () => {
-  if (form.totalAmount > 0) {
-    calculateTaxFromInclusive(form.totalAmount);
-  } else {
-    calculateTaxFromExclusive();
-  }
-};
-
-const getSummaries = ({ columns, data }) => {
-  const sums = [];
-  columns.forEach((col, index) => {
-    if (index === 0) {
-      sums[index] = "鍚堣";
-    } else if (col.property === "amount") {
-      const total = data.reduce((prev, cur) => {
-        const v = Number(cur.amount);
-        return prev + (isNaN(v) ? 0 : v);
-      }, 0);
-      sums[index] = total.toLocaleString("zh-CN", {
-        minimumFractionDigits: 2,
-        maximumFractionDigits: 2,
-      });
-    } else {
-      sums[index] = "";
-    }
-  });
-  return sums;
-};
-
-const formatMoney = (value) => {
-  if (value === undefined || value === null) return "0.00";
-  return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+const handleInvoiceTypeChange = () => {
+  calculateTax();
 };
 
 const normalizeTableRow = (row) => ({
@@ -583,8 +483,6 @@
 
 const closeDialog = () => {
   dialogVisible.value = false;
-  applySelectVisible.value = false;
-  isView.value = false;
   isView.value = false;
 };
 

--
Gitblit v1.9.3