From fea2d693c33fdbcb4c8304a96a4e584829cb437b Mon Sep 17 00:00:00 2001
From: sen <sen@qq.com>
Date: 星期四, 29 一月 2026 17:25:30 +0800
Subject: [PATCH] 申请开票和开票记录,科目管理界面

---
 ui/admin-ui3/src/components/ClaimBillDialog/index.vue |  102 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 75 insertions(+), 27 deletions(-)

diff --git a/ui/admin-ui3/src/components/ClaimBillDialog/index.vue b/ui/admin-ui3/src/components/ClaimBillDialog/index.vue
index 2254f28..744349a 100644
--- a/ui/admin-ui3/src/components/ClaimBillDialog/index.vue
+++ b/ui/admin-ui3/src/components/ClaimBillDialog/index.vue
@@ -1,5 +1,11 @@
 <template>
   <el-dialog v-model="visible" title="璐﹀崟璁ら" width="1150px" destroy-on-close :close-on-click-modal="false">
+    <div style="text-align: right;margin-bottom: 10px;">
+      <el-button type="warning" v-if="isViewMode" plain icon="Download" @click="handleExport"
+        v-hasPermi="['cwgl:fundFlowClaimDetail:export']">瀵煎嚭
+      </el-button>
+      <!-- <el-button type="primary" @click="handleFinalSubmit">纭� 瀹�</el-button> -->
+    </div>
     <div class="claim-wrapper">
       <!-- <div class="section-header">娴佹按璇︾粏淇℃伅</div> -->
       <el-descriptions :column="3" border class="mb-20">
@@ -29,8 +35,16 @@
 
         <el-descriptions-item label="寰呰棰嗛噾棰�">
           <span class="text-danger font-bold">{{ remainingAmountDr }}</span>
+        </el-descriptions-item v-if="isViewMode">
+        <el-descriptions-item label="鍏宠仈璐﹀崟绫诲瀷">
+          <span v-if="detail.incomeExpenseFlag == 0">
+            瀹㈡埛
+          </span>
+          <span v-if="detail.incomeExpenseFlag == 1">
+            渚涘簲鍟�
+          </span>
         </el-descriptions-item>
-        <el-descriptions-item label="" :span="2"></el-descriptions-item>
+        <el-descriptions-item label="" :span="1"></el-descriptions-item>
       </el-descriptions>
 
       <div class="section-header">{{ isViewMode ? '璐﹀崟璁ら鏄庣粏' : '璐﹀崟璁ら' }}</div>
@@ -53,7 +67,7 @@
             <el-input v-model="row.billNo" @click="openReceivableDialog($index)" :disabled="!row.$edit" readonly
               placeholder="鐐瑰嚮閫夋嫨璐﹀崟">
               <template v-if="row.$edit" #append>
-                <el-button icon="Search"  @click="openReceivableDialog($index)" :disabled="!row.$edit" />
+                <el-button icon="Search" @click="openReceivableDialog($index)" :disabled="!row.$edit" />
               </template>
             </el-input>
           </template>
@@ -114,6 +128,10 @@
           </template>
         </el-table-column>
       </el-table>
+
+      <pagination v-show="total > 10" :total="total" v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize" @pagination="getList" />
+
     </div>
 
     <template #footer>
@@ -140,6 +158,7 @@
 import { addFundFlowClaimDetailClaim } from "@/api/cwgl/fundFlow";
 import { delFundFlowClaimDetail, } from "@/api/cwgl/fundFlowClaimDetail";
 import { listFundFlowClaimDetail } from "@/api/cwgl/fundFlowClaimDetail";
+import { getFundFlow, } from "@/api/cwgl/fundFlow";
 
 const { proxy } = useCurrentInstance();
 const { sys_income_expenses } = proxy.useDict('sys_income_expenses');
@@ -229,11 +248,50 @@
   resetForm();
 };
 const isViewMode = ref(false); // 鏂板锛氭ā寮忔帶鍒�
+
+// --- 鏂板锛氬垎椤典笌鎼滅储鐩稿叧鐨勫搷搴斿紡鍙橀噺 ---
+const total = ref(0);
+const loading = ref(false);
+const queryParams = ref({
+  pageNum: 1,
+  pageSize: 10,
+  fundFlowId: null as any // 鍏宠仈鐨勬祦姘碔D
+});
+
+// --- 鏂板锛氳幏鍙栧垪琛ㄦ暟鎹殑鏂规硶 ---
+const getList = async () => {
+  if (!detail.value.id) return;
+
+  loading.value = true;
+  try {
+    const res = await listFundFlowClaimDetail({
+      ...queryParams.value,
+      fundFlowId: detail.value.id
+    });
+    if (res.code === 200) {
+      detail.value.claimDetails = res.rows;
+      detail.value.claimDetails.forEach((item: any) => {
+        if (item.$edit === undefined) {
+          item.$edit = false;
+        }
+      });
+      total.value = res.total;
+    }
+  } catch (error) {
+    console.error("鑾峰彇鏄庣粏鍒楄〃澶辫触", error);
+  } finally {
+    loading.value = false;
+  }
+};
+const handleExport = () => {
+  proxy.download("/cwgl/fundFlowClaimDetail/export", { ...queryParams.value })
+}
+
 // 鎵撳紑寮圭獥
 const open = (rowData: any, mode: 'view' | 'edit' = 'edit') => {
   // 1. 鍏堥噸缃竴娆★紝闃叉涓婃娈嬬暀
   resetForm();
-   isViewMode.value = mode === 'view'; // 璁剧疆妯″紡
+  isViewMode.value = mode === 'view'; // 璁剧疆妯″紡
   // 2. 娴呮嫹璐濆熀纭�鏁版嵁
   detail.value = {
     ...rowData,
@@ -244,18 +302,8 @@
     // 鍙栧嚭绗竴鏉℃槑缁嗙殑鍏宠仈浼佷笟绫诲瀷
     const firstCompanyType = detail.value.claimDetails[0].relatedCompanyType;
 
-    if (firstCompanyType === '瀹㈡埛') {
-      billType.value = 'RECEIVABLE';
-    } else if (firstCompanyType === '渚涘簲鍟�') {
-      billType.value = 'PAYABLE';
-    }
-
     // 纭繚宸叉湁鐨勬暟鎹涓嶄細鍙樻垚缂栬緫妯″紡
-    detail.value.claimDetails.forEach((item: any) => {
-      if (item.$edit === undefined) {
-        item.$edit = false;
-      }
-    });
+    getList()
   }
 
   visible.value = true;
@@ -280,7 +328,7 @@
 // 淇敼鏂板琛岄�昏緫
 const handleAddRow = () => {
 
-  const defaultCompanyType = detail.value.incomeExpenseFlag == '0' ? '瀹㈡埛' : '渚涘簲鍟�';
+  const defaultCompanyType = detail.value.incomeExpenseFlag == 0 ? '瀹㈡埛' : '渚涘簲鍟�';
 
   // 鑾峰彇褰撳墠鏃堕棿鐨� YYYY-MM-DD HH:mm:ss 鏍煎紡
   const now = new Date();
@@ -335,14 +383,14 @@
   }
   addFundFlowClaimDetailClaim(row, detail.value.id).then((response) => {
     if (response.code == 200) {
-      listFundFlowClaimDetail({ fundFlowId: detail.value.id }).then((res) => {
+      proxy.$modal.msgSuccess("淇濆瓨鎴愬姛");
+      getFundFlow(detail.value.id).then((res) => {
         if (res.code == 200) {
-          detail.value.claimDetails = res.rows;
-          proxy.$modal.msgSuccess("淇濆瓨鎴愬姛");
-          row.$edit = false;
-        }
-      })
+          detail.value = res.data;
+          getList(); // 浣跨敤缁熶竴鐨� getList 鏂规硶
 
+        }
+      });
     }
   })
 };
@@ -352,12 +400,13 @@
     return delFundFlowClaimDetail(row.id);
   }).then((res) => {
     if (res.code == 200) {
-      listFundFlowClaimDetail({ fundFlowId: detail.value.id }).then((res) => {
+      getFundFlow(detail.value.id).then((res) => {
         if (res.code == 200) {
-          detail.value.claimDetails = res.rows;
+          detail.value = res.data;
+          getList(); // 浣跨敤缁熶竴鐨� getList 鏂规硶
           proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
         }
-      })
+      });
     }
 
 
@@ -380,7 +429,7 @@
 
 // 鍥炲~寮圭獥閫変腑鐨勬暟鎹�
 const receivablForm = (data: any) => {
-  const defaultCompanyType = billType.value === 'RECEIVABLE' ? '瀹㈡埛' : '渚涘簲鍟�';
+  const defaultCompanyType = detail.value.incomeExpenseFlag == 0 ? '瀹㈡埛' : '渚涘簲鍟�';
 
   if (currentRowIndex.value !== null && data) {
     const row = detail.value.claimDetails[currentRowIndex.value];
@@ -398,8 +447,7 @@
 };
 
 const accountsForm = (data: any) => {
-  const defaultCompanyType = billType.value === 'RECEIVABLE' ? '瀹㈡埛' : '渚涘簲鍟�';
-
+  const defaultCompanyType = detail.value.incomeExpenseFlag == 0 ? '瀹㈡埛' : '渚涘簲鍟�';
   if (currentRowIndex.value !== null && data) {
     const row = detail.value.claimDetails[currentRowIndex.value];
     row.billNo = data.systemNo

--
Gitblit v1.8.0