From ca4261a5d05d0359d02e332b88ed149a0656eae1 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 27 七月 2023 13:47:57 +0800
Subject: [PATCH] 修改了专家费用保存

---
 src/views/project/fund/expertFeeFundApply/index.vue |  523 +++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 353 insertions(+), 170 deletions(-)

diff --git a/src/views/project/fund/expertFeeFundApply/index.vue b/src/views/project/fund/expertFeeFundApply/index.vue
index d4b0c3f..e6fad70 100644
--- a/src/views/project/fund/expertFeeFundApply/index.vue
+++ b/src/views/project/fund/expertFeeFundApply/index.vue
@@ -9,7 +9,6 @@
               @keyup.enter.native="handleQuery" />
           </el-form-item>
         </el-col>
-
         <el-col :span="6">
           <el-form-item label="鎹愮尞杩涘害" prop="recordstate">
             <el-select v-model="queryParams.recordstate" placeholder="璇烽�夋嫨璁板綍鐘舵��" clearable size="small">
@@ -87,14 +86,11 @@
                 </el-table-column>
                 <el-table-column label="鎵�灞炵粍鍒�" align="center" prop="deptmentname" width="220px" />
                 <el-table-column label="缁勯暱" align="center" prop="managername" width="150px" />
-                <!-- <el-table-column
-                  label="鐢宠閲戦"
-                  align="center"
-                  prop="amountrequested"
-                  width="120px"
-                                      />    
+                <!-- 
+                <el-table-column label="鐢宠閲戦" align="center" prop="amountrequested" width="120px" />    
                 <el-table-column label="鑱旂郴鐢佃瘽" align="center" prop="phone" width="150px" />
-                <el-table-column label="宸ヤ綔鍗曚綅" align="center" prop="unitname" width="220px" /> -->
+                <el-table-column label="宸ヤ綔鍗曚綅" align="center" prop="unitname" width="220px" /> 
+                -->
                 <el-table-column label="鎿嶄綔" fixed="right" align="center" class-name="small-padding fixed-width"
                   width="280px">
                   <template slot-scope="scope">
@@ -284,7 +280,7 @@
                   placeholder="璇烽�夋嫨"
                 >
                   <el-option
-                    v-for="item in arrr3"
+                    v-for="item in expertlist"
                     :key="item.reportNo"
                     :label="item.reportName"
                     :value="item.reportName"
@@ -439,21 +435,29 @@
       </div>
     </el-dialog>
 
-    <el-dialog :visible.sync="detailInfoDialogShow" :close-on-click-modal="false" :title="'淇℃伅淇敼'" width="500px"
+    <el-dialog :visible.sync="showDetailInfoDialog" :close-on-click-modal="false" :title="'瀵煎叆淇℃伅'" width="500px"
       style="text-align: center" v-loading="loading">
       <el-form ref="funddetailForm" :model="funddetailForm">
         <el-row>
-          <el-col :span="24" v-if="detailInfoDialogShowType == 'name'">
+          <el-col :span="24" v-if="showDetailInfoDialogType == 'name'">
+            <el-form-item label="璇烽�夋嫨涓撳淇℃伅锛�" prop="expertfrom">
+              <el-radio-group v-model="expertfrom" style="margin-bottom: 0">
+                <el-radio label="1">涓撳搴�</el-radio>
+                <el-radio label="2">鏂板涓撳</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-if="showDetailInfoDialogType == 'name' && expertfrom == '1'">
             <el-form-item label="涓撳濮撳悕" prop="beneficiaryname" label-width="80px">
               <el-select filterable allow-create ref="beneficiaryname" default-first-option
                 v-model="funddetailForm.beneficiaryname" placeholder="璇烽�夋嫨" style="width: 100%">
-                <el-option v-for="item in arrr3" :key="item.reportNo" :label="item.reportName" :value="item.reportName">
+                <el-option v-for="item in expertlist" :key="item.reportNo" :label="item.reportName"
+                  :value="item.reportName">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
-
-          <el-col :span="24" v-if="detailInfoDialogShowType == 'unit'">
+          <el-col :span="24" v-if="showDetailInfoDialogType == 'unit'">
             <el-form-item label="鍗曚綅鍚嶇О" prop="unitno" label-width="80px">
               <el-select v-model="funddetailForm.unitno" placeholder="鍗曚綅鍚嶇О" clearable filterable allow-create
                 style="width: 100%">
@@ -463,9 +467,65 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row>
+          <el-col :span="12" v-if="expertfrom == '2'">
+            <el-form-item label="涓撳濮撳悕" prop="expertname" label-width="80px">
+              <el-input v-model="funddetailForm.expertname" placeholder="蹇呭~椤�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12" v-if="expertfrom == '2'">
+            <el-form-item label="鑱�    绉�" prop="experttitle" label-width="80px">
+              <el-select v-model="funddetailForm.experttitle" placeholder="蹇呭~椤�">
+                <el-option v-for="dict in dict.type.sys_professionaltitle" :key="dict.value" :label="dict.label"
+                  :value="dict.label"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24" v-if="expertfrom == '2'">
+            <el-form-item label="韬唤璇佸彿" prop="expertidcardno" label-width="80px">
+              <el-input v-model="funddetailForm.expertidcardno" placeholder="蹇呭~椤�" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <!--
+        <el-row>
+          <el-col :span="12" v-if="expertfrom == '2'">
+            <el-form-item label="浜哄憳绫诲埆" prop="usertype" label-width="80px">
+              <el-select v-model="funddetailForm.usertype" placeholder="蹇呭~椤�">
+                <el-option v-for="dict in dict.type.sys_UserType" :key="dict.value" :label="dict.label"
+                  :value="dict.value"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>          
+        </el-row>
+      -->
+        <el-row>
+          <el-col :span="24" v-if="expertfrom == '2'">
+            <el-form-item label="鍗曚綅鍚嶇О" prop="expertunitno" label-width="80px">
+              <el-select v-model="funddetailForm.expertunitno" placeholder="鍗曚綅鍚嶇О" clearable filterable allow-create
+                style="width: 100%">
+                <el-option v-for="(spec, index) in unitList" :key="index" :label="spec.organizationname"
+                  :value="spec.organizationid"></el-option>
+              </el-select>
+            </el-form-item></el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24" v-if="expertfrom == '2'">
+            <el-form-item label="寮�鎴烽摱琛�" prop="expertdepositbank" label-width="80px">
+              <el-input v-model="funddetailForm.expertdepositbank" placeholder="蹇呭~椤�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-if="expertfrom == '2'">
+            <el-form-item label="閾惰鍗″彿" prop="expertbankcardno" label-width="80px">
+              <el-input v-model="funddetailForm.expertbankcardno" placeholder="蹇呭~椤�" />
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
       <span slot="footer" class="dialog-footer">
-        <el-button @click="detailInfoDialogShow = false">鍙� 娑�</el-button>
+        <el-button @click="showDetailInfoDialog = false">鍙� 娑�</el-button>
         <el-button type="primary" @click="ConfirmDetailDialog()">纭� 瀹�</el-button>
       </span>
     </el-dialog>
@@ -477,7 +537,7 @@
 //渚嬪锛歩mport 銆婄粍浠跺悕绉般�� from '銆婄粍浠惰矾寰勩��';
 import {
   listDonatebaseinfo,
-  getDonatebaseinfo,
+  getDonatebaseinfo
 } from "@/api/project/donatebaseinfo";
 import {
   onelistFund,
@@ -493,7 +553,7 @@
   getdownloadYX,
   getdownloadBX,
   batchUploadFund,
-  getdetailsByItemId,
+  getdetailsByItemId
 } from "@/api/project/fund";
 import {
   onelistFunds,
@@ -520,7 +580,7 @@
   listOrganization,
   getOrganization,
   listReportname,
-  listUser,
+  listUser
 } from "@/api/project/organization";
 import {
   listExternalperson,
@@ -529,7 +589,7 @@
   delExternalperson,
   addExternalperson,
   updateExternalperson,
-  exportExternalperson,
+  exportExternalperson
 } from "@/api/project/externalperson";
 import { getUserProfile } from "@/api/system/user";
 import Li_area_select from "@/components/Address";
@@ -545,25 +605,24 @@
   },
   name: "fundApply",
   dicts: [
-    "sys_consolationfundlevel",
-    "sys_OrganizationType",
+    //"sys_consolationfundlevel",
+    //"sys_OrganizationType",
     "sys_DonationStatus",
-    "sys_depositbank",
-    "sys_FamilyRelation",
-    "sys_IDType",
-    "sys_ConsolationType",
-    "sys_fund_type",
-    "sys_finsubject",
-    "sys_financeitemtype",
-    "sys_expensetype",
+    //"sys_depositbank",
+    //"sys_FamilyRelation",
+    //"sys_IDType",
+    //"sys_ConsolationType",
+    //"sys_fund_type",
+    //"sys_finsubject",
+    //"sys_financeitemtype",
+    //"sys_expensetype",
     "sys_recordstatus",
+    "sys_professionaltitle"
   ],
   data() {
     //杩欓噷瀛樻斁鏁版嵁
     return {
-      arrr2: [],
-      arrr3: [],
-      currentApplyType: "1",
+
       // 閬僵灞�
       loading: true,
       // 瀵煎嚭閬僵灞�
@@ -592,17 +651,33 @@
         applytype: "1",
         createBy: null,
       },
+      // 琛ㄥ崟鍙傛暟
+      form: {},
+      //鎵�鏈変汉鍛樿〃
+      personlist: [],
+      expertQueryParam: {
+        pageNum: 1,
+        pageSize: 10000,
+        userno: null,
+        username: null,
+        usertype: null,
+      },
 
+      //
+      amount: 0.00,
+
+      //鐢宠鍗曠被鍨�
+      currentApplyType: "1",
+      //涓撳鍒楄〃
+      expertlist: [],
+      //涓撳璐归�夋嫨锛�1鏄笓瀹跺簱锛�2鏄柊澧�
+      expertfrom: "1",
       //璁$畻涓◣鍙傛暟
       taxParam: {
         beneficiaryNo: '',
         money: '0',
         startTime: '',
       },
-
-      // 琛ㄥ崟鍙傛暟
-      form: {},
-      personlist: [],
       // 琛ㄥ崟鏍¢獙
       rules: {
         username: [
@@ -634,6 +709,10 @@
       donateconsolationfundList: [],
       //璐圭敤鏄庣粏鍒楄〃
       fundDetails: [],
+      formData: {},
+      totalPreTaxAmount: 0.0,
+      totalAfterTaxAmount: 0.0,
+      totalAmount: 0.0,
 
       // 寮瑰嚭灞傛爣棰�
       title: "",
@@ -652,18 +731,54 @@
       //鏄惁鏄笓瀹惰垂鐨凮PO瀹℃壒浜哄憳
       ismanager: false,
 
+
+
       unitList: [],
       dialogType: "edit",
       fundflowList: [],
 
-      detailInfoDialogShow: false,
-      detailInfoDialogShowType: "",
+      showDetailInfoDialog: false,
+      showDetailInfoDialogType: "",
       funddetailForm: {
+        index: null,
         beneficiaryname: null,
         beneficiaryno: null,
         unitno: null,
         unitname: null,
-        index: null,
+        expertname: null,
+        expertidcardno: null,
+        expertunitno: null,
+        expertunitname: null,
+        experttitle: null,
+        expertdepositbank: null,
+        expertbankcardno: null,
+      },
+      expertform: {
+        id: null,
+        address: null,
+        bankcardno: null,
+        branchbankname: null,
+        createBy: null,
+        createTime: null,
+        del_flag: null,
+        depositbank: null,
+        idcardno: null,
+        personnelunitno: null,
+        pym: null,
+        remark: null,
+        searchValue: null,
+        sex: null,
+        telephone: null,
+        title: null,
+        unitname: null,
+        unitno: null,
+        updateBy: null,
+        updateTime: null,
+        username: null,
+        userno: null,
+        userstatus: 1,
+        usertype: null,
+        wbm: null,
       },
 
       //闄勪欢鍒楄〃
@@ -687,13 +802,22 @@
   //鏂规硶闆嗗悎
   methods: {
     ShowDetailDialog(spoce, showType) {
+      this.expertfrom = "1";
       this.funddetailForm.index = spoce.$index;
       this.funddetailForm.beneficiaryname = spoce.row.beneficiaryname;
       this.funddetailForm.beneficiaryno = spoce.row.beneficiaryno;
       this.funddetailForm.unitno = spoce.row.unitno;
       this.funddetailForm.unitname = spoce.row.unitname;
-      this.detailInfoDialogShow = true;
-      this.detailInfoDialogShowType = showType;
+      this.funddetailForm.expertname = "";
+      this.funddetailForm.expertidcardno = "";
+      this.funddetailForm.expertunitno = "";
+      this.funddetailForm.expertunitname = "";
+      this.funddetailForm.experttitle = "";
+      this.funddetailForm.expertdepositbank = "";
+      this.funddetailForm.expertbankcardno = "";
+
+      this.showDetailInfoDialog = true;
+      this.showDetailInfoDialogType = showType;
     },
 
     ConfirmDetailDialog() {
@@ -701,23 +825,90 @@
       let tempName = this.funddetailForm.beneficiaryname;
       let tempUnitname = this.funddetailForm.unitname;
       let singleDetail = this.fundDetails[tempIndex];
-      if (this.detailInfoDialogShowType == "name") {
-        this.personlist.map((res) => {
-          if (tempName == res.username) {
-            singleDetail.beneficiaryno = res.userno;
-            singleDetail.beneficiaryname = res.username;
-            singleDetail.bankcardno = res.bankcardno;
-            singleDetail.branchbankname = res.branchbankname;
-            singleDetail.depositbank = res.depositbank;
-            singleDetail.idcardno = res.idcardno;
-            singleDetail.phone = res.telephone;
-            singleDetail.title = res.title;
-            singleDetail.unitname = res.unitname;
-            singleDetail.unitno = parseInt(res.unitno);
-          }
-        });
 
-      } else if (this.detailInfoDialogShowType == "unit") {
+      if (this.showDetailInfoDialogType == "name") {
+
+        if (this.expertfrom == "1") {
+          //浠庝笓瀹跺垪琛ㄨ幏鍙栦俊鎭�
+          this.personlist.map((res) => {
+            if (tempName == res.username) {
+              console.log("閫夋嫨涓撳", res);
+              singleDetail.beneficiaryno = res.userno;
+              singleDetail.beneficiaryname = res.username;
+              singleDetail.bankcardno = res.bankcardno;
+              singleDetail.branchbankname = res.branchbankname;
+              singleDetail.depositbank = res.depositbank;
+              singleDetail.idcardno = res.idcardno;
+              singleDetail.phone = res.telephone;
+              singleDetail.title = res.title;
+              singleDetail.unitname = res.unitname;
+              singleDetail.unitno = parseInt(res.unitno);
+            }
+          });
+        } else {
+          //淇濆瓨鏂板涓撳
+          this.expertform.id = null;
+          this.expertform.userno = this.personlist[this.personlist.length - 1].id + 1;
+          this.expertform.usertype = "expert";
+          this.expertform.username = this.funddetailForm.expertname;
+          this.expertform.idcardno = this.funddetailForm.expertidcardno;
+          this.expertform.sex = null;
+          this.expertform.telephone = null;
+          this.expertform.address = null;
+          this.expertform.wbm = null;
+          this.expertform.pym = null;
+
+          this.expertform.unitno = this.funddetailForm.expertunitno;
+          try {
+            let unitIndex = this.unitList.findIndex(
+              (item) => this.expertform.unitno == item.organizationid
+            );
+            if (unitIndex > -1) {
+              this.expertform.unitname = this.unitList[unitIndex].organizationname;
+            } else {
+              this.expertform.unitname = this.expertform.unitno;
+            }
+          } catch {
+            this.expertform.unitname = this.expertform.unitno;
+          }
+          this.expertform.title = this.funddetailForm.experttitle;
+          this.expertform.personnelunitno = null;
+
+          this.expertform.depositbank = this.funddetailForm.expertdepositbank;
+          this.expertform.bankcardno = this.funddetailForm.expertbankcardno;
+          this.expertform.branchbankname = null;
+          this.expertform.remark = null;
+          this.expertform.del_flag = "0";
+
+          addExternalperson(this.expertform).then((response) => {
+            if (response.code == 200) {
+              this.$modal.msgSuccess("鏂板涓撳淇℃伅鎴愬姛锛�");
+
+              listExternalperson().then((res) => {
+                this.personlist = res.rows;
+                console.log("new personlist", this.personlist);
+                //浠庝笓瀹跺垪琛ㄨ幏鍙栦俊鎭�
+                this.personlist.map((res) => {
+                  if (res.username == this.funddetailForm.expertname) {
+                    console.log("鏂板涓撳", res);
+                    singleDetail.beneficiaryno = res.userno;
+                    singleDetail.beneficiaryname = res.username;
+                    singleDetail.bankcardno = res.bankcardno;
+                    singleDetail.branchbankname = res.branchbankname;
+                    singleDetail.depositbank = res.depositbank;
+                    singleDetail.idcardno = res.idcardno;
+                    singleDetail.phone = res.telephone;
+                    singleDetail.title = res.title;
+                    singleDetail.unitname = res.unitname;
+                    singleDetail.unitno = parseInt(res.unitno);
+                  }
+                });
+              });
+            }
+          });
+        }
+
+      } else if (this.showDetailInfoDialogType == "unit") {
         singleDetail.unitno = this.funddetailForm.unitno;
         try {
           let unitIndex = this.unitList.findIndex(
@@ -734,7 +925,7 @@
       }
 
       this.fundDetails[tempIndex] = singleDetail;
-      this.detailInfoDialogShow = false;
+      this.showDetailInfoDialog = false;
     },
 
     handleup(row) {
@@ -1165,16 +1356,21 @@
     submitForm() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
-          let formData = this.form;
-          let totalPreTaxAmount = 0.0;
-          let totalAfterTaxAmount = 0.0;
-          let totalAmount = 0.0;
+          this.formData = this.form;
+          // let totalPreTaxAmount = 0.0;
+          // let totalAfterTaxAmount = 0.0;
+          // let totalAmount = 0.0;
 
           //淇濆瓨鍓嶆牎楠屾暟鎹�
           for (let k = 0; k < this.fundDetails.length; k++) {
             let tempDetail = this.fundDetails[k];
             if (tempDetail.itemid == null) {
-              this.$modal.msgWarning("鏈嶅姟椤圭洰鏄繀閫夐」锛岃閫夋嫨鏈嶅姟椤圭洰鍚庡啀鎻愪氦淇濆瓨锛�");
+              this.$modal.msgWarning("鏈嶅姟椤圭洰琛ㄤ腑锛岀" + (k + 1).toString() + "琛岀殑鏈嶅姟椤圭洰鏈�夋嫨锛岃鍏堥�夋嫨鏈嶅姟椤圭洰鍚庡啀鎻愪氦淇濆瓨锛�");
+              return;
+            }
+
+            if (tempDetail.servicesscope == null) {
+              this.$modal.msgWarning("鏈嶅姟椤圭洰琛ㄤ腑锛岀" + (k + 1).toString() + "琛岀殑璐圭敤璇存槑鏈�夋嫨,璇烽�夋嫨璐圭敤璇存槑鍚庡啀鎻愪氦淇濆瓨锛�");
               return;
             }
 
@@ -1197,134 +1393,111 @@
             //   tempDetail.unitname = tempDetail.unitno;
             // }
 
+
+          }
+
+          //闄勪欢澶勭悊
+          let list = this.fileList;
+          if (list.length > 0) {
+            this.form.annexfiles = list.map(item => item.url).join(",");
+          }
+
+          //澶勭悊鏄庣粏
+          for (let i = 0; i < this.fundDetails.length; i++) {
+            let tempDetail = this.fundDetails[i];
+            //鑾峰彇鏈嶅姟椤圭洰鏄庣粏
+            let tempItemArr = tempDetail.itemArr;
+            let itemIndex = tempItemArr.findIndex(
+              (item) => tempDetail.itemid == item.id
+            );
+            if (itemIndex > -1) {
+              tempDetail.itemname = tempItemArr[itemIndex].itemName;
+              tempDetail.itemid = tempItemArr[itemIndex].id;
+            }
+
+            //鑾峰彇applytypename銆佹湇鍔¤垂鐢ㄥぇ绫�
+            let applytypeIndex = this.rowfeeItemTypes.findIndex(
+              (item) => tempDetail.applytype == item.value
+            );
+            if (applytypeIndex > -1) {
+              tempDetail.applytypename = this.rowfeeItemTypes[applytypeIndex].label;
+              tempDetail.subjecttype = this.rowfeeItemTypes[applytypeIndex].subjecttype;
+              tempDetail.subjecttypename = this.rowfeeItemTypes[applytypeIndex].subjecttypename;
+            }
+            this.fundDetails[k] = tempDetail;
+            /*
             //璁$畻涓◣            
             //if (isNaN(parseFloat(tempDetail.taxedamount)))
+            //鑾峰彇鍙傛暟
+            this.taxParam.beneficiaryNo = tempDetail.beneficiaryno;
+            this.taxParam.startTime = this.form.createTime.substring(0, 10);
+            // 璁$畻绋庡悗閲戦
             if (tempDetail.taxedamount == undefined || tempDetail.taxedamount == null || tempDetail.taxedamount == 0 || tempDetail.taxedamount == '') {
               //鑾峰彇鍙傛暟
-              this.taxParam.beneficiaryNo = tempDetail.beneficiaryno;
               this.taxParam.money = tempDetail.amount.toString();
-              this.taxParam.startTime = this.form.createTime.substring(0, 10); 
               getTaxByBeneFiciaryNo(this.taxParam).then((res) => {
                 if (res.code == 200) {
                   tempDetail.taxamount = res.data;
                   tempDetail.taxedamount = tempDetail.amount - tempDetail.taxamount;
+                  this.fundDetails[k] = tempDetail;
+
+                  this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount);
+                  this.totalAmount += parseFloat(tempDetail.amount);
                 }
               });
             }
 
-            //if (isNaN(parseFloat(tempDetail.amount)))
+            // 璁$畻绋庡墠閲戦
             if (tempDetail.amount == undefined || tempDetail.amount == null || tempDetail.amount == 0 || tempDetail.amount == '') {
               //鑾峰彇鍙傛暟
-              this.taxParam.beneficiaryNo = tempDetail.beneficiaryno;
               this.taxParam.money = tempDetail.taxedamount.toString();
-              this.taxParam.startTime = this.form.createTime.substring(0, 10);
-
               getTaxBeforeByAfterMoney(this.taxParam).then((res) => {
-                console.log("",res);
                 if (res.code == 200) {
                   tempDetail.taxamount = res.data.nowTax;
-                  tempDetail.amount = res.data.nowTaxBeforeMoney;
+                  tempDetail.amount = parseFloat(res.data.nowTaxBeforeMoney);
+                  this.fundDetails[k] = tempDetail;
+
+                  this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount);
+                  this.totalAmount += parseFloat(tempDetail.amount);
+                  console.log("1", this.amount);
                 }
               });
             }
-
-            totalAfterTaxAmount += parseFloat(tempDetail.taxedamount);
-            totalAmount += parseFloat(tempDetail.amount);
-            this.fundDetails[k] = tempDetail;
+            */
           }
+          //璐圭敤鍚堣
+          // this.form.pretaxcost = parseFloat(this.totalPreTaxAmount).toFixed(2);
+          // this.form.taxedcost = parseFloat(this.totalAfterTaxAmount).toFixed(2);
+          // this.form.amountrequested = this.totalAmount.toFixed(2);
 
+          //淇濆瓨鏁版嵁
           this.loading = true;
-          //闄勪欢澶勭悊
-          let list = this.fileList;
-          if (list.length > 0) {
-            this.form.annexbankcard = list.map(item => item.url).join(",");
-          }
+          this.form.serviceFunddetails = 0;
+          this.fundDetails.map((item) => {
+            this.form.serviceFunddetails += item.amount;
+          });
+          this.form.serviceFunddetails = this.fundDetails;
 
-          this.form.donorname = this.curCase.name;
-          this.form.pretaxcost = parseFloat(totalPreTaxAmount).toFixed(2);
-          this.form.taxedcost = parseFloat(totalAfterTaxAmount).toFixed(2);
-          this.form.amountrequested = totalAmount.toFixed(2);
           if (this.form.id != null) {
-            this.form.recordstatus = -1;
-            updateFund(this.form).then((response) => {
-              this.getfundList();
-              this.dialogOpen = false;
-              this.getList();
-              this.selectDonotor(this.curCase);
-              this.$modal.msgSuccess("淇敼鎴愬姛");
-              this.loading = false;
-              for (let m = 0; m < this.fundDetails.length; m++) {
-                let tempData = this.fundDetails[m];
-                let tempItemArr = tempData.itemArr;
-                tempData.fundid = formData.id;
-                //鑾峰彇鏈嶅姟椤圭洰鏄庣粏
-                let itemIndex = tempItemArr.findIndex(
-                  (item) => tempData.itemid == item.id
-                );
-                if (itemIndex > -1) {
-                  tempData.itemname = tempItemArr[itemIndex].itemName;
-                  tempData.itemid = tempItemArr[itemIndex].id;
-                }
-
-                //鑾峰彇applytypename
-                let applytypeIndex = this.rowfeeItemTypes.findIndex(
-                  (item) => tempData.applytype == item.value
-                );
-                if (applytypeIndex > -1) {
-                  tempData.applytypename = this.rowfeeItemTypes[applytypeIndex].label;
-                }
-
-                if (tempData.id > 0) {
-                  updateFunddetail(tempData).then((response2) => { });
-                } else {
-                  addFunddetail(tempData).then((response2) => { });
-                }
-              }
-            });
-          } else {
-            //淇濆瓨璐圭敤鐢宠
-            for (let m = 0; m < this.fundDetails.length; m++) {
-              let tempData = this.fundDetails[m];
-              let tempUtemArr = tempData.itemArr;
-
-              //鑾峰彇鏈嶅姟椤圭洰鏄庣粏
-              let itemIndex = tempUtemArr.findIndex(
-                (item) => tempData.itemid == item.id
-              );
-              if (itemIndex > -1) {
-                tempData.itemname = tempUtemArr[itemIndex].itemName;
-                tempData.itemid = tempUtemArr[itemIndex].id;
-              }
-
-              //鑾峰彇applytypename
-              let applytypeIndex = this.rowfeeItemTypes.findIndex(
-                (item) => tempData.applytype == item.value
-              );
-              if (applytypeIndex > -1) {
-                tempData.applytypename = this.rowfeeItemTypes[applytypeIndex].label;
-              }
-              this.fundDetails[m] = tempData;
-            }
-
-            this.form.serviceFunddetails = 0;
-            this.fundDetails.map((item) => {
-              this.form.serviceFunddetails += item.amount;
-            });
-            this.form.serviceFunddetails = this.fundDetails;
-            this.form.recordstatus = -1;
-
-            batchUploadFund(this.form).then((response) => {
-              if (response.code === 200) {
-                this.$modal.msgSuccess("鏂板鎴愬姛");
-                this.loading = false;
-                this.selectDonotor(this.curCase);
-              } else {
-                this.$modal.msgError("鏂板澶辫触锛�" + response.msg);
-                this.loading = false;
-              }
-            });
-            this.dialogOpen = false;
+            //鎹愮尞鑰�
+            this.form.donorname = this.curCase.name;
           }
+          else {
+            this.form.recordstatus = -1;
+          }
+
+          batchUploadFund(this.form).then((response) => {
+            if (response.code === 200) {
+              this.$modal.msgSuccess("涓撳鍔冲姟璐逛繚瀛樻垚鍔燂紒");
+              this.selectDonotor(this.curCase);
+            } else {
+              this.$modal.msgError("涓撳鍔冲姟璐逛繚瀛樺け璐ワ細" + response.msg);
+            }
+          });
+
+          //鍏抽棴绐楀彛
+          this.loading = false;
+          this.dialogOpen = false;
         }
       });
     },
@@ -1338,18 +1511,18 @@
 
     //涓撳浜哄憳鍒楄〃
     selectReporters() {
-      let arr = ["expert"];
-      let arrreportlist = [];
-      for (let i = 0; i < arr.length; i++) {
-        this.arrr2 = [];
-        listReportname(arr[i]).then((res) => {
+      let types = ["expert"];
+      let templist = [];
+      for (let i = 0; i < types.length; i++) {
+        templist = [];
+        listReportname(types[i]).then((res) => {
           for (let j = 0; j < res.data.length; j++) {
-            this.arrr2.push({
+            templist.push({
               reportName: res.data[j].reportName,
               reportNo: res.data[j].reportNo,
             });
           }
-          this.arrr3 = this.arrr3.concat(this.arrr2);
+          this.expertlist = this.expertlist.concat(templist);
         });
       }
     },
@@ -1426,6 +1599,10 @@
             //   });
             // });
           }
+
+          if (this.fundDetails.length == 0) {
+            this.addRow();
+          }
         });
       });
     },
@@ -1467,6 +1644,10 @@
               remark: this.fundDetails[m].servicesscope,
               servicesscope: this.fundDetails[m].servicesscope,
             });
+          }
+
+          if (this.fundDetails.length == 0) {
+            this.addRow();
           }
         });
       });
@@ -1584,6 +1765,8 @@
           this.rowfeeItemTypes.push({
             value: dataList[m].itemType,
             label: dataList[m].itemTypeName,
+            subjecttype: dataList[m].subjecttype,
+            subjecttypename: dataList[m].subjecttypename,
           });
         }
       });

--
Gitblit v1.9.3