From a79d67f8a9a9fa02f9d25f987b9611af965c484f Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 22 十月 2026 18:41:01 +0800
Subject: [PATCH] 修改了风格

---
 src/views/project/donorcharge/donorchargedetail/index.vue |  144 ++++++++++++++++++++++++++---------------------
 1 files changed, 79 insertions(+), 65 deletions(-)

diff --git a/src/views/project/donorcharge/donorchargedetail/index.vue b/src/views/project/donorcharge/donorchargedetail/index.vue
index 9ee3282..e4b94c7 100644
--- a/src/views/project/donorcharge/donorchargedetail/index.vue
+++ b/src/views/project/donorcharge/donorchargedetail/index.vue
@@ -147,8 +147,8 @@
               <template slot-scope="scope">
                 <el-input
                   v-model="scope.row.caseno"
-                  :disabled="true"
                   placeholder="绯荤粺缂栧彿"
+                  :disabled="true"
                 />
               </template>
             </el-table-column>
@@ -161,8 +161,8 @@
               <template slot-scope="scope">
                 <el-input
                   v-model="scope.row.amount"
-                  :disabled="true"
                   placeholder="瀹炴敹閲戦"
+                  :disabled="true"
                 />
               </template>
             </el-table-column>
@@ -179,7 +179,7 @@
                   size="small"
                   style="width: 100%"
                   v-model="scope.row.amounttime"
-                  type="date"
+                  type="date" format="yyyy-MM-dd"
                   value-format="yyyy-MM-dd HH:mm:ss"
                   placeholder="瀹炴敹鏃堕棿"
                 >
@@ -195,24 +195,24 @@
               <template slot-scope="scope">
                 <el-input
                   v-model="scope.row.organcharge"
-                  :disabled="true"
                   placeholder="鏍囧噯璐圭敤"
+                  :disabled="true"
                 />
               </template>
             </el-table-column>
             <el-table-column
-              prop="hospitalname"
+              prop="hospitalno"
               align="center"
               label="鎺ユ敹鍖婚櫌"
               width="280"
             >
               <template slot-scope="scope">
                 <org-selecter
-                  :disabled="true"
+                  v-model="scope.row.hospitalno"
                   ref="tranHosSelect"
                   :org-type="'4'"
-                  v-model="scope.row.hospitalno"
                   style="width: 100%"
+                  :disabled="true"
                 />
               </template>
             </el-table-column>
@@ -225,7 +225,6 @@
               <template slot-scope="scope">
                 <el-input
                   v-model="scope.row.name"
-                  :disabled="true"
                   placeholder="鍙椾綋濮撴皬"
                 />
               </template>
@@ -243,7 +242,7 @@
                   size="small"
                   style="width: 100%"
                   v-model="scope.row.organtime"
-                  type="date"
+                  type="date" format="yyyy-MM-dd"
                   value-format="yyyy-MM-dd HH:mm:ss"
                   placeholder="绉绘鏃堕棿"
                 >
@@ -295,6 +294,7 @@
 import Li_area_select from "@/components/Address";
 import { getUserProfile } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
+import { moneySum, moneyRound } from "@/utils/money";
 import debounce from "lodash/debounce";
 export default {
   components: {
@@ -309,7 +309,6 @@
     return {
       activeName: 1, //鏂囦欢绫诲瀷
       // 閮ㄩ棬鏍戦�夐」
-
       //绁ㄦ嵁鏂囦欢
       pdftitle: "",
       pdfimg: "",
@@ -352,8 +351,6 @@
       donorchargeorgans: [],
       // 寮瑰嚭灞傛爣棰�
       title: "",
-      // 鏄惁鏄剧ず寮瑰嚭灞�
-      open: false,
       // 鏌ヨ璐圭敤琛ㄥ弬鏁�
       queryParams: {
         pageNum: 1,
@@ -370,7 +367,6 @@
         pageSize: 10,
         donorchargeid: null
       },
-
       // 褰撳墠鐢ㄦ埛淇℃伅
       userprofile: {},
       // 琛ㄥ崟鍙傛暟
@@ -388,7 +384,7 @@
           { required: true, message: "璇疯緭鍏ユ墍灞炰笟鍔$粍", trigger: "blur" }
         ]
       },
-      gxinzt: false,
+
       baselist: [],
       donorList: [],
       organchargelist: [],
@@ -419,7 +415,6 @@
       headers: {
         Authorization: "Bearer " + getToken()
       },
-
       jurisdiction: false,
 
       //淇濆瓨鎸夐挳鎺у埗
@@ -437,7 +432,6 @@
       this.defaultperson = response.data;
       this.standardlevel = response.data.standardlevel;
     });
-
     //鑾峰彇鍙傛暟
     this.getroute();
   },
@@ -531,8 +525,6 @@
       this.operationType = this.$route.query.operation;
       this.curId = this.$route.query.id;
       this.curCase = this.$route.query.data;
-      this.gxinzt = this.$route.query.gxinzt;
-      console.log(this.curCase);
       console.log("this.$route.query", this.$route.query);
 
       if (this.operationType == "add") {
@@ -572,7 +564,6 @@
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
       this.reset();
-      this.open = true;
       this.title = "鏂板鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�";
 
       if (this.curCase) {
@@ -585,13 +576,46 @@
         this.form.age = this.curCase.age;
         this.form.donationcategory = this.curCase.donationcategory;
 
-        this.organParams.infoid = this.curCase.id;
-        listDonorchargeorgan(this.organParams).then(res => {
-          console.log("listDonorchargeorgan", res);
-          this.donorchargeorgans = res.rows;
-          if (this.donorchargeorgans.length > 0) {
-          } else {
-            this.addRow(0);
+        //鑾峰彇瀹屾垚鐧昏鐨勫櫒瀹樿〃
+        if (this.curCase.id > 0) {
+        } else {
+          this.curCase.id = 0;
+        }
+        let searchParam = {
+          infoid: this.curCase.id
+        };
+        listDonatecomporgan(searchParam).then(res => {
+          if (res.code == 200) {
+            // 鏌ヨ鍣ㄥ畼璐圭敤琛�
+            let tempParam = {
+              organcode: null,
+              organname: null,
+              charge: null
+            };
+            listOrgancharge(tempParam).then(res1 => {
+              if (res1.code == 200) {
+                this.organchargelist = res1.rows;
+              }
+              //鎻掑叆鍣ㄥ畼琛�
+              res.rows.forEach(item => {
+                //鑾峰彇璐圭敤閲戦
+                this.organchargelist.map(rescharge => {
+                  if (rescharge.organcode == item.organno) {
+                    this.donorchargeorgans.push({
+                      organno: item.organno,
+                      caseno: item.caseno,
+                      organname: item.organname,
+                      organcharge: rescharge.charge,
+                      infoid: item.infoid,
+                      hospitalname: item.hospitalname,
+                      hospitalno: item.hospitalno,
+                      organtime: item.transplanttime,
+                      chargestate: "0"
+                    });
+                  }
+                });
+              });
+            });
           }
         });
       }
@@ -600,14 +624,13 @@
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate() {
       this.reset();
-      this.open = true;
       this.title = "淇敼鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�";
 
       getDonorcharge(this.curId).then(response => {
         this.form = response.data;
         console.log("getDonorcharge", response);
         //鍣ㄥ畼璐圭敤淇℃伅
-        this.organParams.infoid = this.form.infoid;
+        this.organParams.donorchargeid = this.curId;
         console.log("this.organParams", this.organParams);
         listDonorchargeorgan(this.organParams).then(res => {
           console.log("listDonorchargeorgan", res);
@@ -617,9 +640,6 @@
           } else {
             this.addRow(0);
           }
-          if ((this.gxinzt = true)) {
-            this.submitForm();
-          }
         });
       });
     },
@@ -627,15 +647,13 @@
     /** 淇敼鏌ョ湅鎿嶄綔 */
     handleDetail() {
       this.reset();
-      this.open = true;
 
       getDonorcharge(this.curId).then(response => {
         this.form = response.data;
-        this.open = true;
         this.title = "鏌ョ湅鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�";
 
         //鍣ㄥ畼璐圭敤淇℃伅
-        this.organParams.infoid = this.form.infoid;
+        this.organParams.donorchargeid = this.curId;
         listDonorchargeorgan(this.organParams).then(res => {
           this.donorchargeorgans = res.rows;
           if (this.donorchargeorgans.length > 0) {
@@ -650,27 +668,23 @@
     submitForm: debounce(function(data) {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          //鏍¢獙銆佽垂鐢ㄥ悎璁�
-          let ChargeSum = 0;
-          let ChargeamountSum = 0;
+          //鏍¢獙銆佽垂鐢ㄥ悎璁★紙閲戦涓�寰嬭蛋绮剧‘杩愮畻锛�
           let organname = "";
 
           try {
             for (let i = 0; i < this.donorchargeorgans.length; i++) {
               organname += this.donorchargeorgans[i].organname + ",";
-              if (!isNaN(parseFloat(this.donorchargeorgans[i].organcharge))) {
-                ChargeSum += parseFloat(this.donorchargeorgans[i].organcharge);
-              }
-              if (!isNaN(parseFloat(this.donorchargeorgans[i].amount))) {
-                ChargeamountSum += parseFloat(this.donorchargeorgans[i].amount);
-              }
             }
             this.form.donateorgan = organname.substring(
               0,
               organname.lastIndexOf(",")
             );
-            this.form.chargeamount = ChargeSum.toFixed(2);
-            this.form.chargeamounted = ChargeamountSum.toFixed(2);
+            this.form.chargeamount = moneyRound(
+              moneySum(this.donorchargeorgans, "organcharge")
+            ).toFixed(2);
+            this.form.chargeamounted = moneyRound(
+              moneySum(this.donorchargeorgans, "amount")
+            ).toFixed(2);
           } catch {}
 
           //淇濆瓨
@@ -678,13 +692,13 @@
             for (let k = 0; k < this.donorchargeorgans.length; k++) {
               this.donorchargeorgans[k].donorchargeID = this.form.id;
             }
-
             updateDonorcharge(this.form).then(res1 => {
               if (res1.code == 200) {
                 saveDonorchargeorgan(this.donorchargeorgans).then(res2 => {
                   if (res2.code == 200) {
                     this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�");
-                    this.open = false;
+        this.$router.go(-1);
+                    
                   }
                 });
               }
@@ -700,7 +714,8 @@
                 saveDonorchargeorgan(this.donorchargeorgans).then(res2 => {
                   if (res2.code == 200) {
                     this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�");
-                    this.open = false;
+        this.$router.go(-1);
+
                   }
                 });
               }
@@ -710,24 +725,16 @@
       });
     }, 500),
 
-    //璁$畻璐圭敤鍚堣
+    //璁$畻璐圭敤鍚堣锛堥噾棰濅竴寰嬭蛋绮剧‘杩愮畻锛�
     chargeSum() {
-      let ChargeSum = 0;
-      let ChargeamountSum = 0;
-
       //璐圭敤鍚堣
       try {
-        for (let i = 0; i < this.donorchargeorgans.length; i++) {
-          if (!isNaN(parseFloat(this.donorchargeorgans[i].organcharge))) {
-            ChargeSum += parseFloat(this.donorchargeorgans[i].organcharge);
-          }
-          if (!isNaN(parseFloat(this.donorchargeorgans[i].amount))) {
-            ChargeamountSum += parseFloat(this.donorchargeorgans[i].amount);
-          }
-        }
-
-        this.form.chargeamount = ChargeSum.toFixed(2);
-        this.form.chargeamounted = ChargeamountSum.toFixed(2);
+        this.form.chargeamount = moneyRound(
+          moneySum(this.donorchargeorgans, "organcharge")
+        ).toFixed(2);
+        this.form.chargeamounted = moneyRound(
+          moneySum(this.donorchargeorgans, "amount")
+        ).toFixed(2);
       } catch {}
     },
 
@@ -740,10 +747,11 @@
         "organname",
         "caseno",
         "amounttime",
-        "organcharge",
+        "name",
         "hospitalname",
         "organtime",
-        "remark"
+        "remark",
+        'organchargedesc'
       ];
       columns.forEach((column, index) => {
         if (index === 0) {
@@ -852,6 +860,12 @@
     text-align: center;
   }
 }
+::v-deep .el-input.is-disabled .el-input__inner {
+    background-color: #F5F7FA;
+    border-color: #dfe4ed;
+    color: #000000;
+    cursor: not-allowed;
+}
 
 ::v-deep .el-input--medium .el-input__inner {
   height: 36px;

--
Gitblit v1.9.3