From c91591e1acb14ce6002cf760255488da092c67b3 Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期五, 30 十月 2026 16:41:32 +0800
Subject: [PATCH] 同步捐献器官费用表明细

---
 src/views/project/unitCost/organfee/index.vue |  129 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 112 insertions(+), 17 deletions(-)

diff --git a/src/views/project/unitCost/organfee/index.vue b/src/views/project/unitCost/organfee/index.vue
index 09566e2..422f60c 100644
--- a/src/views/project/unitCost/organfee/index.vue
+++ b/src/views/project/unitCost/organfee/index.vue
@@ -8,10 +8,10 @@
       v-show="showSearch"
       label-width="90px"
     >
-      <el-form-item label="鎺ユ敹鍖婚櫌" prop="hospitalno">
+      <el-form-item label="浠樻鍖婚櫌" prop="hospitalno">
         <el-select
           v-model="queryParams.hospitalno"
-          placeholder="璇烽�夋嫨鎺ユ敹鍖婚櫌"
+          placeholder="璇烽�夋嫨浠樻鍖婚櫌"
           clearable
           filterable
           size="small"
@@ -34,7 +34,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="鎶ュ憡鏃ユ湡">
+      <el-form-item label="鎹愮尞鏃ユ湡">
         <el-date-picker
           v-model="donatetimeRange"
           type="daterange"
@@ -62,6 +62,17 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          >瀵煎嚭</el-button
+        >
+      </el-col>
       <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
@@ -72,7 +83,7 @@
       <el-table-column type="index" label="搴忓彿" width="55" align="center" />
       <el-table-column
         prop="donatetime"
-        label="鎶ュ憡鏃ユ湡"
+        label="鎹愮尞鏃ユ湡"
         width="120"
         align="center"
       >
@@ -80,6 +91,12 @@
           <span>{{ parseTime(scope.row.donatetime, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
+       <el-table-column
+        prop="hospitalname"
+        label="浠樻鍖婚櫌"
+        width="200"
+        align="center"
+      />
       <el-table-column
         prop="donorname"
         label="鎹愮尞鑰�"
@@ -93,17 +110,20 @@
         align="center"
       />
       <el-table-column
+        prop="payOrganName"
+        label="浠樻鍣ㄥ畼鍚嶇О"
+        width="140"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
         prop="caseno"
         label="鍣ㄥ畼鍒嗛厤缂栧彿"
         align="center"
         show-overflow-tooltip
       />
       <el-table-column prop="name" label="鍙椾綋濮撴皬" width="120" align="center" />
-      <el-table-column label="绉绘鏃ユ湡" width="120" align="center">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.receiveTime, "{y}-{m}-{d}") }}</span>
-        </template>
-      </el-table-column>
+      
       <el-table-column label="鍣ㄥ畼鐘舵��" width="120" align="center">
         <template slot-scope="scope">
           <span>{{ selectOrganState(scope.row.organState) }}</span>
@@ -115,12 +135,28 @@
         width="120"
         align="center"
       />
+      <el-table-column label="浠樻鐘舵��" width="100" align="center">
+        <template slot-scope="scope">
+          <span>{{ payStatus(scope.row) }}</span>
+        </template>
+      </el-table-column>
       <el-table-column
         prop="amount"
         label="瀹炴敹閲戦"
         width="120"
         align="center"
       />
+      <el-table-column label="鏈粯閲戦" width="160" align="center">
+        <template slot-scope="scope">
+          <span>{{ formatReceivableDiff(scope.row) }}</span>
+        </template>
+      </el-table-column>
+      
+      <el-table-column label="鏀舵鏃ユ湡" width="120" align="center">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.organtime, "{y}-{m}-{d}") }}</span>
+        </template>
+      </el-table-column>
       <el-table-column
         prop="organchargedesc"
         label="澶囨敞"
@@ -169,7 +205,14 @@
       append-to-body
       :close-on-click-modal="false"
     >
-      <el-form ref="editForm" :model="editForm" label-width="90px">
+      <el-form ref="editForm" :model="editForm" label-width="110px">
+        <el-form-item label="浠樻鍣ㄥ畼鍚嶇О" prop="payOrganName">
+          <el-input
+            v-model="editForm.payOrganName"
+            maxlength="100"
+            placeholder="璇疯緭鍏ヤ粯娆惧櫒瀹樺悕绉�"
+          />
+        </el-form-item>
         <el-form-item label="鍣ㄥ畼鐘舵��" prop="organState">
           <el-select
             v-model="editForm.organState"
@@ -208,7 +251,8 @@
 <script>
 import {
   listDonorchargeorgan,
-  updateDonorchargeorgan
+  updateDonorchargeorgan,
+  exportOrganfee
 } from "@/api/project/donorcharge";
 import { listOrganization } from "@/api/project/organization";
 
@@ -218,6 +262,8 @@
     return {
       // 閬僵灞�
       loading: false,
+      // 瀵煎嚭閬僵灞�
+      exportLoading: false,
       // 鏄剧ず鎼滅储鏉′欢
       showSearch: true,
       // 鎬绘潯鏁�
@@ -231,18 +277,19 @@
       // 鍣ㄥ畼鐘舵�侊紙瀵瑰簲 service_donorchargeorgan.organ_state锛�
       organStateList: [
         { value: "1", label: "绉绘" },
-        { value: "2", label: "澶卞姛" },
+        { value: "2", label: "寮冪敤" },
         { value: "3", label: "搴撳瓨" },
-        { value: "4", label: "宸茬Щ妞�" },
-        { value: "5", label: "寮冪敤" },
-        { value: "6", label: "鐩寸郴鍏嶉櫎" },
-        { value: "7", label: "涓嶈壇浜嬩欢" }
+        { value: "4", label: "澶卞姛" },
+        { value: "5", label: "鐩寸郴鍏嶉櫎" },
+        { value: "6", label: "涓嶈壇浜嬩欢" },
+        { value: "7", label: "绉戠爺" }
       ],
       // 淇敼寮圭獥
       editOpen: false,
       editLoading: false,
       editForm: {
         id: null,
+        payOrganName: null,
         organState: null,
         organchargedesc: null
       },
@@ -278,6 +325,53 @@
           this.loading = false;
         });
     },
+    /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$modal
+        .confirm("鏄惁纭瀵煎嚭鍣ㄥ畼璐圭敤鏁版嵁锛�")
+        .then(() => {
+          this.exportLoading = true;
+          return exportOrganfee(queryParams);
+        })
+        .then(response => {
+          this.$download.name(response.msg);
+        })
+        .catch(() => {})
+        .finally(() => {
+          this.exportLoading = false;
+        });
+    },
+    /** 搴旀敹閲戦-瀹炴敹閲戦鐨勫樊棰濓紙淇濈暀涓や綅灏忔暟锛夛紝搴旀敹閲戦涓虹┖鏃惰繑鍥� null */
+    receivableDiff(row) {
+      if (
+        row.organcharge === null ||
+        row.organcharge === undefined ||
+        row.organcharge === ""
+      ) {
+        return null;
+      }
+      const receivable = Number(row.organcharge);
+      if (isNaN(receivable)) {
+        return null;
+      }
+      const received = Number(row.amount);
+      const diff = receivable - (isNaN(received) ? 0 : received);
+      return Math.round(diff * 100) / 100;
+    },
+    /** 宸灞曠ず鏂囨湰锛屽浐瀹氫袱浣嶅皬鏁� */
+    formatReceivableDiff(row) {
+      const diff = this.receivableDiff(row);
+      return diff === null ? "" : diff.toFixed(2);
+    },
+    /** 宸涓� 0 涓哄凡浠橈紝鍏跺畠涓烘湭浠� */
+    payStatus(row) {
+      const diff = this.receivableDiff(row);
+      if (diff === null) {
+        return "";
+      }
+      return diff === 0 ? "宸蹭粯" : "鏈粯";
+    },
     /** 鏄惁鏈敹璐癸細organ_charge_state 涓� 0 鎴栦负绌� */
     isUncharged(row) {
       const state = row.organChargeState;
@@ -301,10 +395,11 @@
         })
         .catch(() => {});
     },
-    /** 鎵撳紑淇敼寮圭獥锛堝櫒瀹樼姸鎬併�佸娉級 */
+    /** 鎵撳紑淇敼寮圭獥锛堜粯娆惧櫒瀹樺悕绉般�佸櫒瀹樼姸鎬併�佸娉級 */
     handleEdit(row) {
       this.editForm = {
         id: row.id,
+        payOrganName: row.payOrganName || "",
         organState:
           row.organState === null || row.organState === undefined
             ? null

--
Gitblit v1.9.3