From 40e702344f3d35e251bb098d1227fdea74ee8e4e Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 20 三月 2024 17:50:24 +0800
Subject: [PATCH] 11

---
 src/views/project/ethicalReview/index.vue         |   12 +
 src/views/project/relativesconfirmation/index.vue |   26 +-
 src/views/project/donatebaseinfo/index.vue        |   29 +-
 src/views/project/organallocation/index.vue       |    9 +
 src/views/project/tallage/computingBill/index.vue |  381 +++++++++++++++++++----------------------
 src/views/project/donatefinish/index.vue          |    9 
 src/views/project/medicalevaluation/index.vue     |   23 +-
 src/api/project/tallage.js                        |   20 ++
 src/views/project/unitCost/index.vue              |    4 
 src/views/project/donationwitness/index.vue       |    9 +
 10 files changed, 279 insertions(+), 243 deletions(-)

diff --git a/src/api/project/tallage.js b/src/api/project/tallage.js
index 7cd97c1..8825402 100644
--- a/src/api/project/tallage.js
+++ b/src/api/project/tallage.js
@@ -2,7 +2,7 @@
 
 
 // 鑾峰彇鍗曟嵁鏈�澶ч『搴�
-export function getMaxFundTaxId(query) {
+export function getMaxFundTaxId() {
     return request({
       url: '/project/fundtax/getMaxFundTaxId',
       method: 'get',
@@ -24,6 +24,14 @@
     params: query
     })
   }
+   // 鏍规嵁鏉冮檺鏌ヨ瀹℃牳鍒楄〃
+export function ExpertfeeListnb(query) {
+  return request({
+    url: '/project/fund/getExpertfeeList',
+  method: 'post',
+  data: query
+  })
+}
   // 鏌ヨ涓撳璐圭敤绠楃◣鐢宠涓昏缁�
 export function getFundtax(id) {
   return request({
@@ -35,7 +43,7 @@
 // 鏂板涓撳璐圭敤绠楃◣鐢宠涓�
 export function addFundtax(data) {
   return request({
-    url: '/project/fundtax/add',
+    url: '/project/fundtax/addFundTax',
     method: 'post',
     data: data
   })
@@ -49,6 +57,14 @@
     data: data
   })
 }
+// 淇敼涓撳璐圭敤绠楃◣鐢宠鏄庣粏鍏宠仈
+export function CalculationDetail(data) {
+  return request({
+    url: '/project/fund/editFundTaxId',
+    method: 'post',
+    data: data
+  })
+}
 
 // 鍒犻櫎涓撳璐圭敤绠楃◣鐢宠涓�
 export function delFundtax(id) {
diff --git a/src/views/project/donatebaseinfo/index.vue b/src/views/project/donatebaseinfo/index.vue
index b939ea5..15e7d3b 100644
--- a/src/views/project/donatebaseinfo/index.vue
+++ b/src/views/project/donatebaseinfo/index.vue
@@ -1201,7 +1201,12 @@
       ]
     };
   },
-  created() {},
+  created() {
+    if (sessionStorage.getItem("donatebaseinfo")) {
+      this.queryParams = JSON.parse(sessionStorage.getItem("donatebaseinfo"));
+      console.log(this.queryParams, "queryParams");
+    }
+  },
 
   mounted(e) {
     // let idd = this.$route.query.userid
@@ -1216,8 +1221,7 @@
     if (this.$route.params.starttime != null && this.$route.params.endtime) {
       this.selecttime = [
         this.$moment(this.$route.params.starttime).format("YYYY-MM-DD"),
-        this.$moment(this.$route.params.endtime)
-          .format("YYYY-MM-DD")
+        this.$moment(this.$route.params.endtime).format("YYYY-MM-DD")
       ];
     }
     if (this.$route.params.reporterno != "") {
@@ -1249,7 +1253,7 @@
     }
 
     this.getTimeList();
-
+    
     this.getList();
   },
 
@@ -1457,18 +1461,15 @@
     },
 
     /** 鏌ヨ鎹愮尞鍩虹鍒楄〃 */
-    getList(e) {
+    getList() {
       this.loading = true;
       this.queryParams.params = {};
-      // if (null != this.daterangeReporttime && "" != this.daterangeReporttime) {
-      //   this.queryParams.params["beginReporttime"] =
-      //     this.daterangeReporttime[0];
-      //   this.queryParams.params["endReporttime"] = this.daterangeReporttime[1];
-      // }
+      sessionStorage.removeItem("donatebaseinfo");
+      sessionStorage.setItem(
+        "donatebaseinfo",
+        JSON.stringify(this.queryParams)
+      );
       // 璺宠浆鏃剁殑榛樿杩涘害
-      if (e != null && e != undefined && !isNaN(e)) {
-        this.queryParams.recordstate = e;
-      }
 
       if (this.reportervalue != "") {
         this.queryParams.reportno = this.reportervalue;
@@ -1487,6 +1488,8 @@
       this.queryParams.residenceprovince = this.$refs.areaSelect.getSheng();
       this.queryParams.residencecity = this.$refs.areaSelect.getShi();
       this.queryParams.residencetown = this.$refs.areaSelect.getQu();
+      console.log(this.queryParams);
+
       listDonatebaseinfo(this.queryParams).then(response => {
         this.donatebaseinfoList = response.rows;
         //console.log("listDonatebaseinfo", response.rows);
diff --git a/src/views/project/donatefinish/index.vue b/src/views/project/donatefinish/index.vue
index 9b7f714..fc5c30a 100644
--- a/src/views/project/donatefinish/index.vue
+++ b/src/views/project/donatefinish/index.vue
@@ -705,9 +705,10 @@
     };
   },
   created() {
-    // this.getDicts('country').then(res=>{
-    //   this.nationality =res.data
-    // })
+    if (sessionStorage.getItem("donatefinish")) {
+      this.queryParams = JSON.parse(sessionStorage.getItem("donatefinish"));
+      console.log(this.queryParams, "queryParams");
+    }
   },
   activated() {
     this.selecttime = "";
@@ -956,6 +957,8 @@
     getList() {
       this.loading = true;
       this.queryParams.params = {};
+      sessionStorage.removeItem("donatefinish");
+      sessionStorage.setItem("donatefinish", JSON.stringify(this.queryParams));
       if (null != this.daterangeReporttime && "" != this.daterangeReporttime) {
         this.queryParams.params[
           "beginReporttime"
diff --git a/src/views/project/donationwitness/index.vue b/src/views/project/donationwitness/index.vue
index 87dbb83..53ba2a5 100644
--- a/src/views/project/donationwitness/index.vue
+++ b/src/views/project/donationwitness/index.vue
@@ -1032,6 +1032,10 @@
     };
   },
   created() {
+    if (sessionStorage.getItem("donationwitness")) {
+      this.queryParams = JSON.parse(sessionStorage.getItem("donationwitness"));
+      console.log(this.queryParams, "queryParams");
+    }
     this.getCoordinatorList1();
     this.getCoordinatorList2();
   },
@@ -1191,6 +1195,11 @@
     getList(e) {
       this.loading = true;
       this.queryParams.params = {};
+      sessionStorage.removeItem("donationwitness");
+      sessionStorage.setItem(
+        "donationwitness",
+        JSON.stringify(this.queryParams)
+      );
       if (this.starttime != "") {
         this.queryParams.starttime = this.starttime;
       }
diff --git a/src/views/project/ethicalReview/index.vue b/src/views/project/ethicalReview/index.vue
index 5a420d8..3cc0263 100644
--- a/src/views/project/ethicalReview/index.vue
+++ b/src/views/project/ethicalReview/index.vue
@@ -636,6 +636,10 @@
       this.queryParams.city = this.$route.params.city;
     }
     this.getuserlist();
+    if (sessionStorage.getItem("ethicalReview")) {
+      this.queryParams = JSON.parse(sessionStorage.getItem("ethicalReview"));
+      console.log(this.queryParams, "queryParams");
+    }
     this.getList();
   },
   activated() {},
@@ -736,8 +740,12 @@
     getList() {
       this.loading = true;
       this.queryParams.params = {};
-      console.log(this.starttime, "this.starttime");
-      console.log(this.endtime, "this.endtime");
+      sessionStorage.removeItem("ethicalReview");
+      sessionStorage.setItem(
+        "ethicalReview",
+        JSON.stringify(this.queryParams)
+      );
+
       if (null != this.daterangeReporttime && "" != this.daterangeReporttime) {
         this.queryParams.params[
           "beginReporttime"
diff --git a/src/views/project/medicalevaluation/index.vue b/src/views/project/medicalevaluation/index.vue
index 80c906e..19a75cc 100644
--- a/src/views/project/medicalevaluation/index.vue
+++ b/src/views/project/medicalevaluation/index.vue
@@ -885,22 +885,17 @@
     getList(e) {
       this.loading = true;
       this.queryParams.params = {};
-      // if (null != this.daterangeReporttime && "" != this.daterangeReporttime) {
-      //   this.queryParams.params["beginReporttime"] =
-      //     this.daterangeReporttime[0];
-      //   this.queryParams.params["endReporttime"] = this.daterangeReporttime[1];
-      // }
+      sessionStorage.removeItem("medicalevaluation");
+      sessionStorage.setItem(
+        "medicalevaluation",
+        JSON.stringify(this.queryParams)
+      );
+     
       // 璺宠浆鏃剁殑榛樿杩涘害
       if (e != null && e != undefined && !isNaN(e)) {
         this.queryParams.recordstate = e;
       }
-      // if (this.selecttime[0] != null && this.selecttime[1] != null) {
-      //   this.queryParams.params["starttime"] = this.selecttime[0];
-      //   this.queryParams.params["endReporttime"] = this.selecttime[1];
-      // }
-
-      // this.queryParams.city='001'
-      //console.log(JSON.stringify(this.queryParams));
+   
       if (this.starttime != "") {
         this.queryParams.starttime = this.starttime;
       }
@@ -1344,6 +1339,10 @@
     //鑾峰彇鐢ㄦ埛鍒楄〃
     this.getuserlist();
     //鑾峰彇鍒楄〃
+    if (sessionStorage.getItem("medicalevaluation")) {
+      this.queryParams = JSON.parse(sessionStorage.getItem("medicalevaluation"));
+      console.log(this.queryParams, "queryParams");
+    }
     this.getList();
   }
   // //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛�
diff --git a/src/views/project/organallocation/index.vue b/src/views/project/organallocation/index.vue
index 1a3fb06..5d1e5f1 100644
--- a/src/views/project/organallocation/index.vue
+++ b/src/views/project/organallocation/index.vue
@@ -686,6 +686,11 @@
     /** 鏌ヨ鎹愮尞鍩虹鍒楄〃 */
     getBaseInfoList(e) {
       this.loading = true;
+      sessionStorage.removeItem("organallocation");
+      sessionStorage.setItem(
+        "organallocation",
+        JSON.stringify(this.queryParams)
+      );
       if (this.queryParams.recordstate == "") {
         this.queryParams.recordstate = null;
       }
@@ -1104,6 +1109,10 @@
   },
   //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛�
   created() {
+    if (sessionStorage.getItem("organallocation")) {
+      this.queryParams = JSON.parse(sessionStorage.getItem("organallocation"));
+      console.log(this.queryParams, "queryParams");
+    }
     this.getBaseInfoList();
     this.resetForm();
   }
diff --git a/src/views/project/relativesconfirmation/index.vue b/src/views/project/relativesconfirmation/index.vue
index 4b60609..af87770 100644
--- a/src/views/project/relativesconfirmation/index.vue
+++ b/src/views/project/relativesconfirmation/index.vue
@@ -1112,6 +1112,10 @@
     // this.getDicts('country').then(res=>{
     //   this.nationality =res.data
     // })
+    if (sessionStorage.getItem("relativesconfirmation")) {
+      this.queryParams = JSON.parse(sessionStorage.getItem("relativesconfirmation"));
+      console.log(this.queryParams, "queryParams");
+    }
     this.getuserlist();
     this.getLeaderList();
     this.getCoordinatorList1();
@@ -1429,7 +1433,11 @@
     /** 鏌ヨ鎹愮尞鍩虹鍒楄〃 */
     getList(e) {
       this.loading = true;
-
+      sessionStorage.removeItem("relativesconfirmation");
+      sessionStorage.setItem(
+        "relativesconfirmation",
+        JSON.stringify(this.queryParams)
+      );
       if (null != this.daterangeReporttime && "" != this.daterangeReporttime) {
         this.queryParams.params[
           "beginReporttime"
@@ -1578,14 +1586,14 @@
     },
     /** 瀹跺睘纭鎿嶄綔 */
     handleAdd(row) {
-      // this.$router.push({
-      //   path: "/organ/donationdetails/",
-      //   query: {
-      //     id: row.id,
-      //     organType: "edit",
-      //   }
-      // });
-      // return ;
+      this.$router.push({
+        path: "/organ/donationdetails/",
+        query: {
+          id: row.id,
+          organType: "edit",
+        }
+      });
+      return ;
       console.log("ppppppp", row);
       this.showSaveBtn = false;
       this.flowname = "瀹跺睘纭鐧昏";
diff --git a/src/views/project/tallage/computingBill/index.vue b/src/views/project/tallage/computingBill/index.vue
index 0427c66..a617bec 100644
--- a/src/views/project/tallage/computingBill/index.vue
+++ b/src/views/project/tallage/computingBill/index.vue
@@ -29,7 +29,7 @@
             <el-form-item label="绠楃◣鐘舵��" prop="sex">
               <el-select v-model="form.istax" placeholder="璇烽�夋嫨鐘舵��">
                 <el-option
-                  v-for="dict in gatheringlist"
+                  v-for="dict in swgatheringlist"
                   :key="dict.label"
                   :label="dict.label"
                   :value="dict.value"
@@ -55,6 +55,7 @@
             ><el-form-item label="绋庡墠閲戦" prop="donateno">
               <el-input
                 v-model="form.pretaxamount"
+                :disabled="true"
                 placeholder="璇疯緭鍏ョ◣鍓嶉噾棰�"
               />
             </el-form-item>
@@ -63,6 +64,7 @@
             ><el-form-item label="鎵g◣閲戦" prop="donateno">
               <el-input
                 v-model="form.taxMoney"
+                :disabled="true"
                 placeholder="璇疯緭鍏ユ墸绋庨噾棰�"
               />
             </el-form-item>
@@ -72,6 +74,7 @@
             <el-form-item label="绋庡悗閲戦" prop="donationcategory">
               <el-input
                 v-model="form.taxedamount"
+                :disabled="true"
                 placeholder="璇疯緭鍏ユ敹娆捐鍙�"
               />
             </el-form-item>
@@ -112,15 +115,15 @@
             show-summary
           >
             <el-table-column
-              prop="organno"
+              prop="donorname"
               align="center"
               fixed
               label="妗堜緥鎹愮尞鑰�"
-              width="90"
+              width="120"
             >
               <template slot-scope="scope">
                 <el-input
-                  v-model="scope.row.organno"
+                  v-model="scope.row.donorname"
                   placeholder="妗堜緥鎹愮尞鑰�"
                   :disabled="true"
                 />
@@ -131,39 +134,32 @@
               label="鐢宠浜�"
               align="center"
               width="120"
-              prop="caseno"
+              prop="username"
             >
               <template slot-scope="scope">
                 <el-input
-                  v-model="scope.row.caseno"
+                  v-model="scope.row.username"
                   :disabled="true"
                   placeholder="鐢宠浜�"
                 />
               </template>
             </el-table-column>
             <el-table-column
-              prop="hospitalno"
+              prop="deptmentname"
               align="center"
               label="鎵�灞炵粍鍒�"
               width="280"
             >
               <template slot-scope="scope">
-                <!-- <el-input
-                    v-model="scope.row.hospitalname"
-                    :disabled="true"
-                    placeholder="鎺ユ敹鍖婚櫌"
-                  /> -->
-                <org-selecter
-                  ref="tranHosSelect"
-                  :org-type="'4'"
+                <el-input
+                  v-model="scope.row.deptmentname"
                   :disabled="true"
-                  v-model="scope.row.hospitalno"
-                  style="width: 100%"
+                  placeholder="鎺ユ敹鍖婚櫌"
                 />
               </template>
             </el-table-column>
             <el-table-column
-              prop="receiveTime"
+              prop="applyTime"
               align="center"
               label="鐢宠鏃ユ湡"
               width="200"
@@ -173,7 +169,7 @@
                   clearable
                   size="small"
                   style="width: 100%"
-                  v-model="scope.row.receiveTime"
+                  v-model="scope.row.applyTime"
                   :disabled="true"
                   type="date"
                   value-format="yyyy-MM-dd HH:mm:ss"
@@ -182,52 +178,37 @@
                 </el-date-picker>
               </template>
             </el-table-column>
-            <el-table-column
-              prop="organname"
-              fixed
-              align="center"
-              label="绋庡墠閲戦"
-              width="120"
-            >
+            <el-table-column prop="pretaxcost" align="center" label="绋庡墠閲戦">
               <template slot-scope="scope">
                 <el-input
-                  v-model="scope.row.organname"
+                  v-model="scope.row.pretaxcost"
                   :disabled="true"
                   placeholder="绋庡墠閲戦"
                 />
               </template>
             </el-table-column>
-            <el-table-column
-              label="鎵g◣閲戦"
-              align="center"
-              width="120"
-              prop="name"
-            >
+            <el-table-column label="鎵g◣閲戦" align="center" prop="taXmoney">
               <template slot-scope="scope">
                 <el-input
-                  v-model="scope.row.name"
+                  v-model="scope.row.taXmoney"
                   :disabled="true"
                   placeholder="鎵g◣閲戦"
                 />
               </template>
             </el-table-column>
 
-            <el-table-column
-              prop="organcharge"
-              align="center"
-              label="绋庡悗閲戦"
-              width="150"
-            >
+            <el-table-column prop="taxedcost" align="center" label="绋庡悗閲戦">
               <template slot-scope="scope">
                 <el-input
                   @blur="chargeSum"
-                  v-model="scope.row.organcharge"
+                  :disabled="true"
+                  v-model="scope.row.taxedcost"
                   placeholder="绋庡悗閲戦"
                 />
               </template>
             </el-table-column>
             <el-table-column
-              prop="organchargedesc"
+              prop="remark"
               width="280"
               align="center"
               label="澶囨敞"
@@ -236,17 +217,13 @@
                 <el-input
                   type="textarea"
                   :rows="1"
-                  v-model="scope.row.organchargedesc"
+                  :disabled="true"
+                  v-model="scope.row.remark"
                   placeholder="澶囨敞"
                 />
               </template>
             </el-table-column>
-            <el-table-column
-              label="鎿嶄綔"
-              fixed="right"
-              width="260"
-              align="center"
-            >
+            <el-table-column label="鎿嶄綔" fixed="right" align="center">
               <template slot-scope="scope">
                 <el-button
                   type="text"
@@ -275,6 +252,12 @@
           v-if="operationType == 'add' || operationType == 'update'"
           >淇� 瀛�</el-button
         >
+        <el-button
+          @click="calculateFn"
+          v-if="operationType == 'add' || operationType == 'update'"
+          >绠楃◣</el-button
+        >
+
         <el-button type="info" @click="cancel">鍏抽棴</el-button>
       </div>
       <!-- 娣诲姞鎮h�� -->
@@ -297,7 +280,7 @@
               >
                 <el-form-item label="鎹愮尞妗堜緥" prop="status">
                   <el-select
-                    v-model="patientqueryParams.donorchargeid"
+                    v-model="patientqueryParams.donorno"
                     filterable
                     placeholder="璇烽�夋嫨"
                   >
@@ -343,39 +326,39 @@
                 </el-table-column>
 
                 <el-table-column
-                  prop="organname"
+                  prop="deptmentname"
                   label="鎵�灞炵粍鍒�"
                   show-overflow-tooltip
                 >
                 </el-table-column>
-                <el-table-column prop="organno" label="鐢宠浜�" width="120">
+                <el-table-column prop="username" label="鐢宠浜�" width="120">
                 </el-table-column>
                 <el-table-column
-                  prop="caseno"
+                  prop="applyTime"
                   label="鐢宠鏃ユ湡"
                   show-overflow-tooltip
                 >
                 </el-table-column>
                 <el-table-column
-                  prop="name"
+                  prop="pretaxcost"
                   label="绋庡墠閲戦"
                   show-overflow-tooltip
                 >
                 </el-table-column>
                 <el-table-column
-                  prop="hospitalname"
-                  label="鎵g◣閲戦"
+                  prop="taXmoney"
+                  label="鎵g◣閲戦(缂�)"
                   show-overflow-tooltip
                 >
                 </el-table-column>
                 <el-table-column
-                  prop="receiveTime"
+                  prop="taxedcost"
                   label="绋庡悗閲戦"
                   show-overflow-tooltip
                 >
                 </el-table-column>
                 <el-table-column
-                  prop="address"
+                  prop="remark"
                   label="澶囨敞"
                   show-overflow-tooltip
                 >
@@ -538,10 +521,12 @@
 import { getUserProfile } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
 import {
-  addFundTax,
-  getExpertfeeList,
+  ExpertfeeListnb,
   getFundtax,
   getMaxFundTaxId,
+  updateFundtax,
+  addFundtax,
+  CalculationDetail,
   listbxiaostatistics
 } from "@/api/project/tallage";
 export default {
@@ -555,39 +540,21 @@
   name: "Donorchargemanager",
   data() {
     return {
-      activeName: 1, //鏂囦欢绫诲瀷
-      tableData: [
-        {
-          date: "2016-05-03",
-          name: "鐜嬪皬铏�",
-          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�"
-        },
-        {
-          date: "2016-05-02",
-          name: "鐜嬪皬铏�",
-          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�"
-        },
-        {
-          date: "2016-05-04",
-          name: "鐜嬪皬铏�",
-          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�"
-        },
-        {
-          date: "2016-05-01",
-          name: "鐜嬪皬铏�",
-          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�"
-        }
+      swgatheringlist: [
+        { label: "鏈畻绋�", value: 0 },
+        { label: "宸茬畻绋�", value: 1 }
       ],
       gatheringlist: [
-        { label: "鏈畻绋�", value: "0" },
-        { label: "宸茬畻绋�", value: "1" }
+        { label: "鏈粯娆�", value: "0" },
+        { label: "宸蹭粯娆�", value: "1" }
       ],
       multipleSelection: [],
       patientqueryParams: {
+        paApplyType: 1,
+        pacheckno: "047",
+        checkstatus: 0,
         pageNum: 1,
-        pageSize: 10,
-        hospitalno: null,
-        paymentid: null
+        pageSize: 10
       },
       dialogVisiblepatient: false,
       patienttotal: 0, //
@@ -595,10 +562,7 @@
       pdftitle: "",
       pdfimg: "",
       pdfVisible: false,
-      costtypeobj: {
-        value: 0,
-        label: ""
-      },
+      maxTaxId: "",
       pdfimgsrcList: [],
       Savereminder: false, //鎻愰啋淇濆瓨寮规
       Reminderquantity: 0, //鎻愰啋鏁伴噺
@@ -656,7 +620,11 @@
       // 褰撳墠鐢ㄦ埛淇℃伅
       userprofile: {},
       // 琛ㄥ崟鍙傛暟
-      form: {},
+      form: {
+        istax: 0,
+        isdistribute: "0"
+      },
+      MaxFundTaxId: null, // 鏈�澶d
       // 鍒楄〃鍙傛暟
       table: {},
       reimbursementList: [],
@@ -695,7 +663,6 @@
 
       // 褰撳墠鍗曟嵁ID
       curId: 0,
-      curCase: null,
       //涓氬姟鎿嶄綔绫诲瀷
       operationType: "edit",
 
@@ -722,14 +689,7 @@
 
   created() {
     console.log(234);
-    this.Getnetworkheader();
-
-    //鑾峰彇鐧诲綍鑰呬俊鎭�
-    getUserProfile().then(response => {
-      this.userprofile = response.data;
-      this.defaultperson = response.data;
-      this.standardlevel = response.data.standardlevel;
-    });
+    this.GetMaxTaxid();
 
     //鑾峰彇鍙傛暟
     this.getroute();
@@ -783,7 +743,72 @@
       this.donorchargeorgans = this.donorchargeorgans.concat(
         this.multipleSelection
       );
+      console.log(this.donorchargeorgans, "donorchargeorgans");
+      this.donorchargeorgans.forEach(item => {
+        CalculationDetail({ id: item.id, fundTaxId: this.form.id });
+      });
+      this.donorchargeorgans.forEach(item => {
+        item.taXmoney = item.pretaxcost - item.taxedcost;
+        item.taXmoney = item.taXmoney.toFixed(2);
+        this.accumulation();
+      });
+      this.$modal.msgSuccess("娣诲姞鎴愬姛锛�");
+
       this.dialogVisiblepatient = false;
+    },
+    // 璁$畻涓◣
+    calculateFn() {
+      if (this.form.id >= this.MaxFundTaxId) {
+        this.$modal.loading("姝e湪鎻愪氦锛岃绋嶅�欙紒");
+        this.$modal
+          .confirm("鍗冲皢杩涜绠楃◣鏄惁宸蹭繚瀛樺叏閮ㄦ暟鎹�?")
+          .then(res => {
+            listbxiaostatistics({
+              fundTaxId: Number(this.form.id),
+              addOrupdate: 1
+            }).then(res1 => {
+              if (res1.code == 200) {
+                this.$modal.msgSuccess("璁$畻鎴愬姛");
+                this.$modal.closeLoading();
+                getFundtax(this.form.id).then(response => {
+                  this.form = response.data;
+                  if (this.form.serviceFunds[0]) {
+                    this.donorchargeorgans = this.form.serviceFunds;
+                    this.donorchargeorgans.forEach(item => {
+                      item.taXmoney = item.pretaxcost - item.taxedcost;
+                      item.taXmoney = item.taXmoney.toFixed(2);
+                      this.accumulation();//璁$畻
+                      this.form.istax = 1;
+                      this.submitForm();
+                    });
+                  }
+                });
+              } else {
+                this.$modal.closeLoading();
+                this.$modal.msgError(res1.msg);
+              }
+            });
+          })
+
+          .catch(() => {});
+      } else {
+        this.$modal.msgError("褰撳墠鍗曟嵁涓嶄负鏈�鏂扮敵璇峰崟");
+      }
+    },
+    // 閲戦鍚堣
+    accumulation() {
+      this.form.pretaxamount = this.donorchargeorgans.reduce(
+        (acc, obj) => acc + obj.pretaxcost,
+        0
+      );
+      this.form.taxMoney = this.donorchargeorgans.reduce(
+        (acc, obj) => acc + Number(obj.taXmoney),
+        0
+      );
+      this.form.taxedamount = this.donorchargeorgans.reduce(
+        (acc, obj) => acc + obj.taxedcost,
+        0
+      );
     },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(val) {
@@ -792,50 +817,18 @@
     // 鐐瑰嚮鏂板
     handleAddpatient(row) {
       this.dialogVisiblepatient = true;
-      this.patientqueryParams.hospitalno = this.form.hospitalno;
-      this.patientqueryParams.paymentid = null;
-      this.patientqueryParams.paymentidIsNotNull = false;
-      listDonorchargeorgan(this.patientqueryParams).then(res => {
+      this.patientqueryParams.fundTaxid = -1;
+      ExpertfeeListnb(this.patientqueryParams).then(res => {
         this.donorchargeList = res.rows;
         this.patienttotal = res.total;
-        this.patientqueryParams.paymentidIsNotNull = true;
         console.log(this.donorchargeList);
       });
     },
-    // 鑾峰彇璇锋眰澶�
-    Getnetworkheader() {
-      let string = window.location.href;
-      if (string.includes("9091")) {
-        const index = string.indexOf("9091");
-        this.Networkheader = string.slice(0, index + 4); // 鎴彇9091鍙婂叾鍓嶉儴瀛楃
-      } else {
-        const index = string.indexOf("8032");
-        this.Networkheader = string.slice(0, index + 4); // 鎴彇8032鍙婂叾鍓嶉儴瀛楃
-      }
-    },
-    // 琛ㄥ崟閲嶇疆
-    reset() {
-      this.form = {
-        id: null,
-        infoid: null,
-        donateno: null,
-        donatetime: null,
-        name: null,
-        borthdate: null,
-        sex: null,
-        age: null,
-        donationcategory: null,
-        donateorgan: null,
-        chargeamount: null,
-        chargeamounted: null,
-        remark: null,
-        delFlag: null,
-        createBy: null,
-        createTime: null,
-        updateBy: null,
-        updateTime: null
-      };
-      this.resetForm("form");
+    // 鑾峰彇鏈�澶axid
+    GetMaxTaxid() {
+      getMaxFundTaxId().then(res => {
+        this.MaxFundTaxId = Number(res.msg);
+      });
     },
 
     /** 閫氳繃鍙傛暟鑾峰彇涓氬姟绫诲瀷 */
@@ -843,8 +836,6 @@
       //閫夋嫨涓氬姟绫诲瀷:1銆佹柊澧烇紱2銆佷慨鏀癸紱3銆佹煡鐪�
       this.operationType = this.$route.query.operation;
       this.curId = this.$route.query.id;
-      this.curCase = this.$route.query.data;
-      this.patientqueryParams.paymentid = this.curId;
       console.log("this.$route.query", this.$route.query);
 
       if (this.operationType == "add") {
@@ -879,40 +870,42 @@
 
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
-      this.reset();
-      this.title = "鏂板鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�";
-
-      if (this.curCase) {
-        this.form.infoid = this.curCase.id;
-        this.form.paystatus = "1";
-        this.form.hospitalname = this.curCase.organizationname;
-        this.form.hospitalno = this.curCase.organizationid;
-        this.form.borthdate = this.curCase.birthday;
-      }
+      this.title = "鏂板涓撳璐规眹鎬诲崟";
+      //鑾峰彇鐧诲綍鑰呬俊鎭�
+      getUserProfile().then(res => {
+        this.form.username = res.createBy;
+      });
     },
 
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate() {
-      this.reset();
-      this.title = "鏀舵缁撶畻鐢宠鍗曠紪杈�";
-      getFundtax(this.curId ).then(response => {
+      this.title = "涓撳璐规眹鎬诲崟缂栬緫";
+      getFundtax(this.curId).then(response => {
         this.form = response.data;
-       
+        if (this.form.serviceFunds[0]) {
+          this.donorchargeorgans = this.form.serviceFunds;
+          this.donorchargeorgans.forEach(item => {
+            item.taXmoney = item.pretaxcost - item.taxedcost;
+            item.taXmoney = item.taXmoney.toFixed(2);
+            this.accumulation();
+          });
+        }
       });
     },
 
     /** 鏌ョ湅鎿嶄綔 */
     handleDetail() {
-      this.reset();
-      listDonorpayment({ id: this.curId }).then(response => {
-        this.title = "鏌ョ湅鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�";
-        this.form = response.rows[0];
-        //鍣ㄥ畼璐圭敤淇℃伅
-        listDonorchargeorgan(this.patientqueryParams).then(res => {
-          console.log("listDonorchargeorgan", res);
-          this.donorchargeorgans = res.rows;
-          console.log(this.donorchargeorgans, "donorchargeorgans");
-        });
+      this.title = "鏌ョ湅涓撳璐规眹鎬诲崟";
+      getFundtax(this.curId).then(response => {
+        this.form = response.data;
+        if (this.form.serviceFunds[0]) {
+          this.donorchargeorgans = this.form.serviceFunds;
+          this.donorchargeorgans.forEach(item => {
+            item.taXmoney = item.pretaxcost - item.taxedcost;
+            item.taXmoney = item.taXmoney.toFixed(2);
+            this.accumulation();
+          });
+        }
       });
     },
 
@@ -922,43 +915,23 @@
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.$modal.loading("姝e湪鎻愪氦锛岃绋嶅�欙紒");
-
           //淇濆瓨
+          this.form.serviceFunds = this.donorchargeorgans;
           if (this.form.id != null) {
-            for (let k = 0; k < this.donorchargeorgans.length; k++) {
-              this.donorchargeorgans[k].paymentid = this.form.id;
-            }
-
-            editDonorpayment(this.form).then(res1 => {
+            updateFundtax(this.form).then(res1 => {
               if (res1.code == 200) {
-                saveDonorchargeorgan(this.donorchargeorgans).then(res2 => {
-                  if (res2.code == 200) {
-                    this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�");
-                  } else {
-                    this.$modal.msgError(res2.msg);
-                  }
-                  this.$modal.closeLoading();
-                });
+                this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�");
+                this.$modal.closeLoading();
               } else {
                 this.$modal.closeLoading();
                 this.$modal.msgError(res1.msg);
               }
             });
           } else {
-            addDonorpayment(this.form).then(response => {
+            addFundtax(this.form).then(response => {
               if (response.code == 200) {
-                this.form.id = response.msg;
-                //淇濆瓨鍓嶆牎楠屾暟鎹�
-                for (let k = 0; k < this.donorchargeorgans.length; k++) {
-                  this.donorchargeorgans[k].paymentid = response.msg;
-                }
-                saveDonorchargeorgan(this.donorchargeorgans).then(res2 => {
-                  if (res2.code == 200) {
-                    this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�");
-                  } else {
-                    this.$modal.msgError(res2.msg);
-                  }
-                });
+                this.form.id = response.data.fundTaxId;
+                this.$modal.msgSuccess("鏂板鎴愬姛锛�");
                 this.$modal.closeLoading();
               } else {
                 this.$modal.msgError(response.msg);
@@ -970,7 +943,6 @@
       });
     },
     //淇敼鎬诲疄鏀跺悗瑙﹀彂
-
     chargeSumall() {
       if (this.form.receivedamount == this.form.receivableamount) {
         this.donorchargeorgans.forEach(item => {
@@ -1002,17 +974,22 @@
 
     handleDelete(row) {
       this.$modal
-        .confirm("鏄惁纭鍒犻櫎璇ユ潯鍣ㄥ畼璐圭敤鏁版嵁椤癸紵")
+        .confirm("鏄惁纭鍒犻櫎璇ユ潯涓撳璐圭敤鏁版嵁椤癸紵")
         .then(() => {
-          let value = row;
-          value.paymentid = null;
-          this.delogans.push(value);
-
-          saveDonorchargeorgan(this.delogans).then(res2 => {
+          CalculationDetail({ id: row.id }).then(res2 => {
             if (res2.code == 200) {
-              let index = this.donorchargeorgans.indexOf(row);
-              this.donorchargeorgans.splice(index, 1);
               this.$modal.msgSuccess("鍒犻櫎鎴愬姛锛�");
+              getFundtax(this.curId).then(response => {
+                this.form = response.data;
+                if (this.form.serviceFunds[0]) {
+                  this.donorchargeorgans = this.form.serviceFunds;
+                  this.donorchargeorgans.forEach(item => {
+                    item.taXmoney = item.pretaxcost - item.taxedcost;
+                    item.taXmoney = item.taXmoney.toFixed(2);
+                    this.accumulation();
+                  });
+                }
+              });
             }
           });
         })
diff --git a/src/views/project/unitCost/index.vue b/src/views/project/unitCost/index.vue
index 291cb22..229c77e 100644
--- a/src/views/project/unitCost/index.vue
+++ b/src/views/project/unitCost/index.vue
@@ -227,6 +227,7 @@
 import { listOrganization } from "@/api/project/organization";
 
 import OrgSelecter from "@/views/project/components/orgselect";
+import { getToken } from "@/utils/auth";
 
 export default {
   name: "Donorcharge",
@@ -291,6 +292,9 @@
         pageSize: 10,
         donorchargeid: null
       },
+      headers: {
+        Authorization: "Bearer " + getToken()
+      },
       // 琛ㄥ崟鍙傛暟
       form: {},
       // 琛ㄥ崟鏍¢獙

--
Gitblit v1.9.3