From 648ddd53f3f0cc84d5fba81944b976d51e0c1372 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期三, 02 八月 2023 16:41:59 +0800
Subject: [PATCH] yxh

---
 src/views/project/fund/expertFeeFundApply/index.vue |    4 
 src/views/project/funddetail/index.vue              |  287 +++++++++++----------
 src/views/project/fund/overheadcosts/index.vue      |  485 ++++++++++++++++++------------------
 3 files changed, 400 insertions(+), 376 deletions(-)

diff --git a/src/views/project/fund/expertFeeFundApply/index.vue b/src/views/project/fund/expertFeeFundApply/index.vue
index 3e9dcff..eea3de7 100644
--- a/src/views/project/fund/expertFeeFundApply/index.vue
+++ b/src/views/project/fund/expertFeeFundApply/index.vue
@@ -866,7 +866,7 @@
         this.form.donorno = this.curCase.donorno;
         this.form.name = this.curCase.name;
         this.form.infoid = this.curCase.id;
-        console.log("defaultperson", this.defaultperson);
+        
         this.form.username = this.defaultperson.nickName;
         this.form.userno = this.defaultperson.userName;
         this.form.phone = this.defaultperson.phonenumber;
@@ -1405,8 +1405,8 @@
     //鑾峰彇褰撳墠鐢ㄦ埛淇℃伅
     getUsermsg() {
       getUserProfile().then((response) => {
+        console.log("getUserProfile", response);
         this.defaultperson = response.data;
-        console.log("this.defaultperson", this.defaultperson);
         this.standardlevel = response.data.standardlevel;
         if (this.defaultperson.createBy == "admin" || this.defaultperson.createBy == "001" || this.defaultperson.createBy == "002") {
           this.ismanager = true;
diff --git a/src/views/project/fund/overheadcosts/index.vue b/src/views/project/fund/overheadcosts/index.vue
index 1ebc354..73a37e6 100644
--- a/src/views/project/fund/overheadcosts/index.vue
+++ b/src/views/project/fund/overheadcosts/index.vue
@@ -536,7 +536,7 @@
   data() {
     //杩欓噷瀛樻斁鏁版嵁
     return {
-      currentApplyType: "3",
+      currentApplyType: "4",
       // 閬僵灞�
       loading: true,
       // 瀵煎嚭閬僵灞�
@@ -801,6 +801,248 @@
       this.resetForm("queryForm");
       this.handleQuery();
     },
+
+    /** 鏂板鎸夐挳鎿嶄綔 */
+    handleAdd() {
+      this.$router.push({
+        path: "/finance/funddetail/",
+        query: { id: 0, businesstype: 4, operationtype: "add" }
+      });
+
+      this.istrue += 2;
+      this.reset();
+      this.queryParams.params = {};
+      this.form.username = this.defaultperson.nickName;
+      this.form.userno = this.defaultperson.userName;
+      this.form.deptmentname = this.defaultperson.dept.deptName;
+      this.form.deptmentno = this.defaultperson.dept.deptId;
+      this.form.managername = this.defaultperson.dept.leader;
+
+      // this.form.createTime = nowdate;
+      //this.open = true;
+      //this.initFundApplyForm();
+      this.fundDetails = [];
+      this.addRow();
+      this.dialogOpen = true;
+      this.title = "娣诲姞璐圭敤鐢宠";
+      this.dialogType = "edit";
+    },
+    /** 淇敼鎸夐挳鎿嶄綔 */
+    handleUpdate(row) {
+      this.$router.push({
+        path: "/finance/funddetail/",
+        query: { id: row.id, businesstype: 4, operationtype: "edit" }
+      });
+
+      this.isopen = 0;
+      this.reset();
+      this.queryParams.params = {};
+      this.dialogType = "edit";
+      this.dialogOpen = true;
+      this.title = "淇敼璐圭敤鐢宠";
+
+
+      const id = row.id || this.ids;
+      getFund(id).then((response) => {
+        this.form = response.data;
+        this.form.name = this.curCase.name;
+        //闄勪欢澶勭悊
+        this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
+
+        getownFundDetail(id).then(async (res) => {
+          this.fundDetails = res.data;
+          for (let m = 0; m < this.fundDetails.length; m++) {
+            this.fundDetails[m].itemArr = [];
+            this.getItemArr(m, this.fundDetails[m]);
+          }
+        });
+      });
+    },
+
+    /** 鏌ョ湅鎸夐挳鎿嶄綔 */
+    handleDetail(row) {
+      this.$router.push({
+        path: "/finance/funddetail/",
+        query: { id: row.id, businesstype: 4, operationtype: "detail" }
+      });
+
+      this.isopen = 0;
+      this.reset();
+      this.queryParams.params = {};
+      this.form.donorno = this.curCase.donorno;
+      this.form.infoid = this.curCase.id;
+      this.dialogOpen = true;
+      this.title = "鏌ョ湅璐圭敤鐢宠";
+      this.dialogType = "detail";
+      const id = row.id || this.ids;
+
+      getFund(id).then((response) => {
+        this.form = response.data;
+        this.form.name = this.curCase.name;
+        let listFundflowparams = {
+          fundid: row.id,
+          fundtype: 2,
+        };
+        //闄勪欢澶勭悊
+        this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
+
+        listFundflow(listFundflowparams).then((res) => {
+          this.fundflowList = res.rows;
+        });
+        getownFundDetail(id).then((res) => {
+          this.fundDetails = res.data;
+          for (let m = 0; m < this.fundDetails.length; m++) {
+            this.fundDetails[m].itemArr = [];
+            this.getItemArr(m, this.fundDetails[m]);
+            this.fundDetails[m].fundblock = [];
+            this.fundDetails[m].fundblock.push({
+              expense: this.fundDetails[m].expense,
+              expensedescribe: this.fundDetails[m].servicesscopename,
+              remark: this.fundDetails[m].servicesscope,
+              servicesscope: this.fundDetails[m].servicesscope,
+            });
+          }
+        });
+      });
+    },
+
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal
+        .confirm("鏄惁纭鍒犻櫎璇ヨ褰曪紵")
+        .then(function () {
+          return delFund(ids);
+        })
+        .then(() => {
+          getownFundDetail(ids).then((res) => {
+            let listdetails = res.data;
+            for (let i = 0; i < listdetails.length; i++) {
+              delFunddetail(listdetails[i].id);
+            }
+          });
+          // this.getList();
+          this.getfundList();
+          this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        })
+        .catch(() => { });
+    },
+
+    /** 鎻愪氦鎸夐挳 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          let formData = this.form;
+          for (let k = 0; k < this.fundDetails.length; k++) {
+            let tempDetail = this.fundDetails[k];
+            if (tempDetail.itemid == null) {
+              this.$modal.msgWarning("璇烽�夋嫨鏈嶅姟椤圭洰");
+              return;
+            }
+            //鍒ゆ柇鍗曚綅 unitSel
+            // try {
+            //   //鑾峰彇鏈嶅姟椤圭洰鏄庣粏
+            //   let unitIndex = this.bankaccountlist.findIndex(
+            //     (item) => tempDetail.unitno == item.reportNo
+            //   );
+            //   if (unitIndex > -1) {
+            //     tempDetail.unitname = this.bankaccountlist[unitIndex].reportName;
+            //   } else {
+            //     tempDetail.unitname = tempDetail.unitno;
+            //   }
+            // } catch {
+            //   tempDetail.unitname = tempDetail.unitno;
+            // }
+          }
+          try {
+            this.form.unitname = this.$refs.orgSelecter.getOptionByValue(
+              this.form.unitno
+            ).organizationname;
+          } catch {
+            this.form.treatmenthospitalname = this.form.treatmenthospitalno;
+          }
+          this.loading = true;
+          //闄勪欢澶勭悊
+          let list = this.fileList;
+          if (list.length > 0) {
+            this.form.annexbankcard = list.map(item => item.url).join(",");
+          }
+
+          this.form.donorname = this.curCase.name;
+          this.form.pretaxcost = parseFloat(this.form.amountrequested).toFixed(
+            2
+          );
+
+          if (this.form.id != null) {
+            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;
+                }
+                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.fundtypeArr.findIndex(
+                (item) => tempData.applytype == item.value
+              );
+              if (applytypeIndex > -1) {
+                tempData.applytypename = this.fundtypeArr[applytypeIndex].label;
+              }
+              this.fundDetails[m] = tempData;
+            }
+
+            this.form.serviceFunddetails = this.fundDetails;
+            addorupdateFund(this.form).then((response) => {
+              if (response.code === 200) {
+                this.$modal.msgSuccess("鏂板鎴愬姛");
+                this.loading = false;
+              } else {
+                this.$modal.msgError("鏂板澶辫触锛�" + response.msg);
+                this.loading = false;
+              }
+            });
+
+            //鍏抽棴绐楀彛
+            this.loading = false;
+            this.dialogOpen = false;
+            this.getList();
+          }
+        }
+      });
+    },
     /** 鏌ヨ鎹愮尞浜洪亾鎱伴棶閲戝垪琛� */
     getList() {
       this.loading = true;
@@ -827,31 +1069,7 @@
       });
     },
 
-    /** 鏂板鎸夐挳鎿嶄綔 */
-    handleAdd() {
-      this.$router.push({
-        path: "/finance/funddetail/",
-        query: { id: 0, pos: 2,routerparam:this.defaultperson }
-      });
 
-      this.istrue += 2;
-      this.reset();
-      this.queryParams.params = {};
-      this.form.username = this.defaultperson.nickName;
-      this.form.userno = this.defaultperson.userName;
-      this.form.deptmentname = this.defaultperson.dept.deptName;
-      this.form.deptmentno = this.defaultperson.dept.deptId;
-      this.form.managername = this.defaultperson.dept.leader;
-
-      // this.form.createTime = nowdate;
-      //this.open = true;
-      //this.initFundApplyForm();
-      this.fundDetails = [];
-      this.addRow();
-      this.dialogOpen = true;
-      this.title = "娣诲姞璐圭敤鐢宠";
-      this.dialogType = "edit";
-    },
 
 
     getfundList() {
@@ -988,124 +1206,6 @@
       // });
     },
 
-    /** 鎻愪氦鎸夐挳 */
-    submitForm() {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          let formData = this.form;
-          for (let k = 0; k < this.fundDetails.length; k++) {
-            let tempDetail = this.fundDetails[k];
-            if (tempDetail.itemid == null) {
-              this.$modal.msgWarning("璇烽�夋嫨鏈嶅姟椤圭洰");
-              return;
-            }
-            //鍒ゆ柇鍗曚綅 unitSel
-            // try {
-            //   //鑾峰彇鏈嶅姟椤圭洰鏄庣粏
-            //   let unitIndex = this.bankaccountlist.findIndex(
-            //     (item) => tempDetail.unitno == item.reportNo
-            //   );
-            //   if (unitIndex > -1) {
-            //     tempDetail.unitname = this.bankaccountlist[unitIndex].reportName;
-            //   } else {
-            //     tempDetail.unitname = tempDetail.unitno;
-            //   }
-            // } catch {
-            //   tempDetail.unitname = tempDetail.unitno;
-            // }
-          }
-          try {
-            this.form.unitname = this.$refs.orgSelecter.getOptionByValue(
-              this.form.unitno
-            ).organizationname;
-          } catch {
-            this.form.treatmenthospitalname = this.form.treatmenthospitalno;
-          }
-          this.loading = true;
-          //闄勪欢澶勭悊
-          let list = this.fileList;
-          if (list.length > 0) {
-            this.form.annexbankcard = list.map(item => item.url).join(",");
-          }
-
-          this.form.donorname = this.curCase.name;
-          this.form.pretaxcost = parseFloat(this.form.amountrequested).toFixed(
-            2
-          );
-
-          if (this.form.id != null) {
-            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;
-                }
-                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.fundtypeArr.findIndex(
-                (item) => tempData.applytype == item.value
-              );
-              if (applytypeIndex > -1) {
-                tempData.applytypename = this.fundtypeArr[applytypeIndex].label;
-              }
-              this.fundDetails[m] = tempData;
-            }
-
-            this.form.serviceFunddetails = this.fundDetails;
-            addorupdateFund(this.form).then((response) => {
-              if (response.code === 200) {
-                this.$modal.msgSuccess("鏂板鎴愬姛");
-                this.loading = false;
-              } else {
-                this.$modal.msgError("鏂板澶辫触锛�" + response.msg);
-                this.loading = false;
-              }
-            });
-
-            //鍏抽棴绐楀彛
-            this.loading = false;
-            this.dialogOpen = false;
-            this.getList();
-          }
-
-
-        }
-      });
-    },
 
     getBankAccount() {
       //鑾峰彇閾惰璐﹀彿鍒楄〃锛岀被鍨嬫槸鏈烘瀯
@@ -1121,105 +1221,6 @@
       });
     },
 
-    /** 淇敼鎸夐挳鎿嶄綔 */
-    handleUpdate(row) {
-      this.$router.push({
-        path: "/finance/funddetail/",
-        query: { id: row.id, pos: 2 }
-      });
-
-      this.isopen = 0;
-      this.reset();
-      this.queryParams.params = {};
-      this.dialogType = "edit";
-      this.dialogOpen = true;
-      this.title = "淇敼璐圭敤鐢宠";
-
-
-      const id = row.id || this.ids;
-      getFund(id).then((response) => {
-        this.form = response.data;
-        this.form.name = this.curCase.name;
-        //闄勪欢澶勭悊
-        this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
-
-        getownFundDetail(id).then(async (res) => {
-          this.fundDetails = res.data;
-          for (let m = 0; m < this.fundDetails.length; m++) {
-            this.fundDetails[m].itemArr = [];
-            this.getItemArr(m, this.fundDetails[m]);
-          }
-        });
-      });
-    },
-
-    /** 鏌ョ湅鎸夐挳鎿嶄綔 */
-    handleDetail(row) {
-      this.$router.push({
-        path: "/finance/funddetail/",
-        query: { id: row.id, pos: 2 }
-      });
-
-      this.isopen = 0;
-      this.reset();
-      this.queryParams.params = {};
-      this.form.donorno = this.curCase.donorno;
-      this.form.infoid = this.curCase.id;
-      this.dialogOpen = true;
-      this.title = "鏌ョ湅璐圭敤鐢宠";
-      this.dialogType = "detail";
-      const id = row.id || this.ids;
-
-      getFund(id).then((response) => {
-        this.form = response.data;
-        this.form.name = this.curCase.name;
-        let listFundflowparams = {
-          fundid: row.id,
-          fundtype: 2,
-        };
-        //闄勪欢澶勭悊
-        this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
-
-        listFundflow(listFundflowparams).then((res) => {
-          this.fundflowList = res.rows;
-        });
-        getownFundDetail(id).then((res) => {
-          this.fundDetails = res.data;
-          for (let m = 0; m < this.fundDetails.length; m++) {
-            this.fundDetails[m].itemArr = [];
-            this.getItemArr(m, this.fundDetails[m]);
-            this.fundDetails[m].fundblock = [];
-            this.fundDetails[m].fundblock.push({
-              expense: this.fundDetails[m].expense,
-              expensedescribe: this.fundDetails[m].servicesscopename,
-              remark: this.fundDetails[m].servicesscope,
-              servicesscope: this.fundDetails[m].servicesscope,
-            });
-          }
-        });
-      });
-    },
-
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal
-        .confirm("鏄惁纭鍒犻櫎璇ヨ褰曪紵")
-        .then(function () {
-          return delFund(ids);
-        })
-        .then(() => {
-          getownFundDetail(ids).then((res) => {
-            let listdetails = res.data;
-            for (let i = 0; i < listdetails.length; i++) {
-              delFunddetail(listdetails[i].id);
-            }
-          });
-          // this.getList();
-          this.getfundList();
-          this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-        })
-        .catch(() => { });
-    },
 
     deleteRows(row, index, rows) {
       this.$confirm("鏄惁纭鍒犻櫎?", "鎻愮ず", {
diff --git a/src/views/project/funddetail/index.vue b/src/views/project/funddetail/index.vue
index 6807d23..734cebc 100644
--- a/src/views/project/funddetail/index.vue
+++ b/src/views/project/funddetail/index.vue
@@ -46,7 +46,7 @@
           -->
         <el-col :span="5">
           <el-form-item label="璐圭敤绫诲瀷">
-            <el-radio v-model="form.applytype" label="4">鏉傞」璐圭敤鐢宠</el-radio>
+            <el-radio v-model="form.applytype" label="1">鏉傞」璐圭敤鐢宠</el-radio>
           </el-form-item>
         </el-col>
         <el-col :span="10">
@@ -125,7 +125,7 @@
             <template slot-scope="scope">
               <el-select v-model="scope.row.itemid" placeholder="鏈嶅姟椤圭洰鍚嶇О" filterable @change="verifyFeeItem(scope.row)"
                 :filter-method="(val) => searchItemType(val, scope)">
-                <el-option v-for="dict in scope.row.itemArr" :key="dict.index" :label="dict.itemName"
+                <el-option v-for="dict in scope.row.itemlist" :key="dict.index" :label="dict.itemName"
                   :value="dict.id"></el-option>
               </el-select>
             </template>
@@ -199,7 +199,7 @@
                                       </el-select> -->
             </template>
           </el-table-column>
-          <el-table-column prop="quantity" align="center" label="鏁伴噺" width="120" v-if="form.applytype == '3'">
+          <el-table-column prop="quantity" align="center" label="鏁伴噺" width="120" v-if="form.applytype == '4'">
             <template slot-scope="scope">
               <el-input v-model="scope.row.quantity" placeholder="鏁伴噺" @blur="(val) => {
                 sumTotalFee(scope.row);
@@ -207,7 +207,7 @@
                 " />
             </template>
           </el-table-column>
-          <el-table-column prop="price" align="center" label="浠锋牸" width="120" v-if="form.applytype == '3'">
+          <el-table-column prop="price" align="center" label="浠锋牸" width="120" v-if="form.applytype == '4'">
             <template slot-scope="scope">
               <el-input v-model="scope.row.price" placeholder="浠锋牸" @blur="(val) => {
                 sumTotalFee(scope.row);
@@ -215,7 +215,7 @@
                 " />
             </template>
           </el-table-column>
-          <el-table-column prop="remark" align="center" label="澶囨敞" width="210" v-if="form.applytype == '3'">
+          <el-table-column prop="remark" align="center" label="澶囨敞" width="210" v-if="form.applytype == '4'">
             <template slot-scope="scope">
               <el-input v-model="scope.row.remark" placeholder="澶囨敞" />
             </template>
@@ -241,7 +241,7 @@
               <el-input v-model="scope.row.bankcardno" placeholder="閾惰鍗″彿" />
             </template>
           </el-table-column>
-          <el-table-column fixed="right" align="center" label="鎿嶄綔" width="180" v-if="dialogType == 'edit'">
+          <el-table-column fixed="right" align="center" label="鎿嶄綔" width="180" v-if="operationtype == 'edit'">
             <template slot-scope="scope">
               <el-button type="text" size="mini" @click="addRow(scope.$index)">鏂板</el-button>
               <el-button @click.native.prevent="
@@ -300,14 +300,14 @@
             <el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="fileList" multiple :limit="20"
               :headers="headers" :on-success="(response, file, fileList) =>
                 uploadSccess(response, file, fileList)
-                " :on-preview="downFile" :disabled='dialogType == "detail"' :on-error="handleUploadError"
+                " :on-preview="downFile" :disabled='operationtype == "detail"' :on-error="handleUploadError"
               :on-exceed="handleExceed" :on-remove="remove" accept="image/*,.pdf">
-              <el-button :disabled='dialogType == "detail"' size="small" type="primary">涓婁紶</el-button>
+              <el-button :disabled='operationtype == "detail"' size="small" type="primary">涓婁紶</el-button>
             </el-upload>
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row v-if="dialogType == 'detail'">
+      <el-row v-if="operationtype == 'detail'">
         <el-table :data="fundflowList" border>
           <el-table-column label="瀹℃牳浜�" align="center" width="120" prop="checkusername" />
           <el-table-column label="瀹℃牳鏃ユ湡" align="center" width="160" prop="createTime" />
@@ -320,7 +320,7 @@
       </el-row>
     </el-form>
     <div slot="footer" class="dialog-footer">
-      <el-button type="primary" @click="submitForm" v-if="dialogType == 'edit'">淇� 瀛�</el-button>
+      <el-button type="primary" @click="submitForm" v-if="operationtype == 'edit'">淇� 瀛�</el-button>
       <!-- <el-button type="success" @click="print">鎵� 鍗�</el-button> -->
       <el-button @click="cancel">鍙� 娑�</el-button>
     </div>
@@ -524,7 +524,8 @@
       loading: false,
       // 瀵煎嚭閬僵灞�
       exportLoading: false,
-      total: 0,
+
+      //鏌ヨ鍙傛暟
       queryParams: {
         organizationname: null,
         organizationtype: null,
@@ -541,6 +542,7 @@
         reportername: null,
         reporttime: null,
       },
+
       fundQueryParam: {
         pageNum: 1,
         pageSize: 100,
@@ -548,10 +550,7 @@
         applytype: "4",
         createBy: null,
       },
-      // 琛ㄥ崟鍙傛暟
-      form: {},
-      //鎵�鏈変汉鍛樿〃
-      personlist: [],
+
       expertQueryParam: {
         pageNum: 1,
         pageSize: 10000,
@@ -560,21 +559,30 @@
         usertype: null,
       },
 
-      //
-      amount: 0.00,
-
-      //鐢宠鍗曠被鍨�
-      currentApplyType: "4",
-      //涓撳鍒楄〃
-      expertlist: [],
-      //涓撳璐归�夋嫨锛�1鏄笓瀹跺簱锛�2鏄柊澧�
-      expertfrom: "1",
       //璁$畻涓◣鍙傛暟
       taxParam: {
         beneficiaryNo: '',
         money: '0',
         startTime: '',
       },
+
+      // 琛ㄥ崟鍙傛暟
+      form: {},
+
+      total: 0,
+
+      //鐢宠鍗曠被鍨�
+      businesstype: "4",
+      //鎿嶄綔绫诲瀷
+      operationtype: "edit",
+      //鎵�鏈変汉鍛樿〃
+      personlist: [],
+      //
+      amount: 0.00,
+      //涓撳鍒楄〃
+      expertlist: [],
+      //涓撳璐归�夋嫨锛�1鏄笓瀹跺簱锛�2鏄柊澧�
+      expertfrom: "1",
       // 琛ㄥ崟鏍¢獙
       rules: {
         username: [
@@ -592,15 +600,9 @@
       },
 
       //鎹愮尞妗堜緥鍒楄〃鏁版嵁
-      // donationCaseTableData:[],
       donatebaseinfoList: [],
       //褰撳墠閫変腑鎹愮尞妗堜緥
       curCase: {},
-      //鏄惁鏄剧ず璐圭敤鐢宠寮圭獥
-      dialogOpen: false,
-      // title: "",
-      //璐圭敤鐢宠琛ㄥ崟title
-      applyFormTitle: "",
 
       // 鎹愮尞浜洪亾鎱伴棶閲戣〃鏍兼暟鎹�
       donateconsolationfundList: [],
@@ -611,10 +613,10 @@
       totalAfterTaxAmount: 0.0,
       totalAmount: 0.0,
 
-      // 寮瑰嚭灞傛爣棰�
+      //璐圭敤鐢宠琛ㄥ崟title
       title: "",
       userlist: [],
-      itemArr: [],
+      itemlist: [],
       reporters: [],
 
       //琛岃褰曠殑璐圭敤绫诲瀷鏁扮粍
@@ -623,12 +625,11 @@
       feeItemTypes: [],
       //璐圭敤璇存槑
       rowfeeblocks: [],
-      defaultperson: {},
+      userprofile: {},
 
       //鏄惁鏄笓瀹惰垂鐨凮PO瀹℃壒浜哄憳
       ismanager: false,
       unitList: [],
-      dialogType: "edit",
       fundflowList: [],
 
       showDetailInfoDialog: false,
@@ -679,7 +680,7 @@
       fileList: [],
       //涓婁紶闄勪欢璺緞
       uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
-
+      //鏂囦欢涓婁紶token
       headers: {
         Authorization: "Bearer " + getToken(),
       },
@@ -692,22 +693,23 @@
   watch: {},
   //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛�    
   created() {
-    this.getList();
-    this.getBaseInfoList();
+    //鑾峰彇鍗曟嵁绫诲瀷鍜屾搷浣滆姹�
     this.getCurFundType();
-    this.getUserList();
-    this.getUnitList();
-
+    this.getUserProfile();    
+    this.getroute();
   },
 
   //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛�
-  mounted() {
+  mounted() {    
+    this.getUserList();
+    this.getUnitList();
     this.selectReporters();
-    this.getUsermsg();
     this.getExternalpersonList();
+    this.getBaseInfoList();    
   },
 
-  beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠
+  beforeCreate() {
+  }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠
   beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠
   beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠
   updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗
@@ -717,11 +719,52 @@
 
   //鏂规硶闆嗗悎
   methods: {
+    /** 閫氳繃鍙傛暟鑾峰彇涓氬姟绫诲瀷 */
+    getroute() {
+      //閫夋嫨涓氬姟绫诲瀷:1銆佹柊澧烇紱2銆佷慨鏀癸紱3銆佹煡鐪�
+      let ids = this.$route.query.id;
+      let tempbusinesstype = this.$route.query.businesstype;
+      let tempoperationtype = this.$route.query.operationtype;
+      // this.userprofile = this.$route.query.routerparam;
+      if (tempbusinesstype == 1) {
+        this.businesstype = tempbusinesstype;
+        this.title = '涓撳鍔冲姟璐圭敵璇峰崟';
+        this.handleAdd(ids);
+      } else if (tempbusinesstype == 2) {
+        this.businesstype = tempbusinesstype;
+        this.title = '浼︾悊涓撳鍔冲姟璐圭敵璇峰崟';
+        this.handleUpdate(ids);
+      }
+      else if (tempbusinesstype == 3) {
+        this.businesstype = tempbusinesstype;
+        this.title = '鍖诲鎴愭湰鎶ラ攢鍗�';
+        this.handleDetail(ids);
+      }
+      else if (tempbusinesstype == 4) {
+        this.businesstype = tempbusinesstype;
+        this.title = '鏉傝薄璐圭敤鎶ラ攢鍗�';
+        // this.handleCheck(ids);
+      }
 
-    /** 鎼滅储鎸夐挳鎿嶄綔 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      if (tempoperationtype == 1) {
+        this.operationtype = 'add';
+        this.title += '鏂板缓'
+        this.handleAdd(ids);
+      } else if (tempoperationtype == 2) {
+        this.operationtype = 'update';
+        this.title += '淇敼'
+        this.handleUpdate(ids);
+      }
+      else if (tempoperationtype == 3) {
+        this.operationtype = 'detail';
+        this.title += '鏌ョ湅'
+        this.handleDetail(ids);
+      } else if (tempoperationtype == 4) {
+        this.title += '瀹℃牳'
+        this.handleCheck(ids);
+      }
+      console.log(
+        this.businesstype = tempbusinesstype, this.title);
     },
 
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
@@ -733,35 +776,40 @@
 
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
-      if (this.curCase.id) {
-        this.istrue += 2;
-        this.reset();
-        this.queryParams.params = {};
-        this.form.donorno = this.curCase.donorno;
-        this.form.name = this.curCase.name;
-        this.form.infoid = this.curCase.id;
-        console.log("defaultperson", this.defaultperson);
-        this.form.username = this.defaultperson.nickName;
-        this.form.userno = this.defaultperson.userName;
-        this.form.phone = this.defaultperson.phonenumber;
-        this.form.deptmentname = this.defaultperson.dept.deptName;
-        this.form.deptmentno = this.defaultperson.dept.deptId;
-        this.form.managername = this.defaultperson.dept.leader;
+      this.reset();
+      this.queryParams.params = {};
 
-        // this.form.createTime = nowdate;
-        //this.open = true;
-        //this.initFundApplyForm();
-        this.fundDetails = [];
-        this.addRow();
-        this.dialogOpen = true;
-        this.dialogType = "edit";
-        this.title = "璐圭敤鐢宠";
-      } else {
-        const h = this.$createElement;
-        this.$message({
-          message: h("p", null, [h("span", null, "璇峰厛閫夋嫨宸︽柟鎹愮尞妗堜緥 ")]),
-        });
+      /** businesstype锛�4锛氭潅椤硅垂鐢ㄦ姤閿�鐢宠 */
+      if (this.businesstype != "4") {
+        if (this.curCase.id) {
+          this.istrue += 2;
+          this.form.donorno = this.curCase.donorno;
+          this.form.name = this.curCase.name;
+          this.form.infoid = this.curCase.id;
+
+          // this.form.createTime = nowdate;
+          //this.open = true;
+          //this.initFundApplyForm();
+        } else {
+          const h = this.$createElement;
+          this.$message({
+            message: h("p", null, [h("span", null, "璇峰厛閫夋嫨宸︽柟鎹愮尞妗堜緥 ")]),
+          });
+          return;
+        }
       }
+
+      this.form.username = this.userprofile.nickName;
+      this.form.userno = this.userprofile.userName;
+      this.form.phone = this.userprofile.phonenumber;
+      this.form.deptmentname = this.userprofile.dept.deptName;
+      this.form.deptmentno = this.userprofile.dept.deptId;
+      this.form.managername = this.userprofile.dept.leader;
+
+//鍒濆鍖栨槑缁�
+      this.fundDetails = [];
+      this.addRow();
+
     },
 
     /** 淇敼鎸夐挳鎿嶄綔 */
@@ -771,9 +819,8 @@
       this.queryParams.params = {};
       this.form.donorno = this.curCase.donorno;
       this.form.infoid = this.curCase.id;
-      this.dialogOpen = true;
       this.title = "淇敼璐圭敤鐢宠";
-      this.dialogType = "edit";
+      this.operationtype = "edit";
 
       const id = row.id || this.ids;
       getFund(id).then((response) => {
@@ -786,8 +833,8 @@
         getownFundDetail(id).then((res) => {
           this.fundDetails = res.data;
           for (let m = 0; m < this.fundDetails.length; m++) {
-            this.fundDetails[m].itemArr = [];
-            this.getItemArr(m, this.fundDetails[m]);
+            this.fundDetails[m].itemlist = [];
+            this.getitemlist(m, this.fundDetails[m]);
 
             //鑾峰彇璐圭敤椤圭洰鐨勮缁嗕俊鎭�
             this.fundDetails[m].rowfeeblocks = [];
@@ -825,9 +872,8 @@
       this.queryParams.params = {};
       this.form.donorno = this.curCase.donorno;
       this.form.infoid = this.curCase.id;
-      this.dialogOpen = true;
       this.title = "鏌ョ湅璐圭敤鐢宠";
-      this.dialogType = "detail";
+      this.operationtype = "detail";
       const id = row.id || this.ids;
 
       getFund(id).then((response) => {
@@ -846,8 +892,8 @@
         getownFundDetail(id).then((res) => {
           this.fundDetails = res.data;
           for (let m = 0; m < this.fundDetails.length; m++) {
-            this.fundDetails[m].itemArr = [];
-            this.getItemArr(m, this.fundDetails[m]);
+            this.fundDetails[m].itemlist = [];
+            this.getitemlist(m, this.fundDetails[m]);
             this.fundDetails[m].rowfeeblocks = [];
             this.fundDetails[m].rowfeeblocks.push({
               expense: this.fundDetails[m].expense,
@@ -878,7 +924,6 @@
               delFunddetail(listdetails[i].id);
             }
           });
-          // this.getList();
           this.getfundList();
           this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
         })
@@ -972,13 +1017,13 @@
           for (let i = 0; i < this.fundDetails.length; i++) {
             let tempDetail = this.fundDetails[i];
             //鑾峰彇鏈嶅姟椤圭洰鏄庣粏
-            let tempItemArr = tempDetail.itemArr;
-            let itemIndex = tempItemArr.findIndex(
+            let tempitemlist = tempDetail.itemlist;
+            let itemIndex = tempitemlist.findIndex(
               (item) => tempDetail.itemid == item.id
             );
             if (itemIndex > -1) {
-              tempDetail.itemname = tempItemArr[itemIndex].itemName;
-              tempDetail.itemid = tempItemArr[itemIndex].id;
+              tempDetail.itemname = tempitemlist[itemIndex].itemName;
+              tempDetail.itemid = tempitemlist[itemIndex].id;
             }
 
             //鑾峰彇applytypename銆佹湇鍔¤垂鐢ㄥぇ绫�
@@ -1006,13 +1051,13 @@
                   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 (tempDetail.amount == undefined || tempDetail.amount == null || tempDetail.amount == 0 || tempDetail.amount == '') {
               //鑾峰彇鍙傛暟
@@ -1022,7 +1067,7 @@
                   tempDetail.taxamount = res.data.nowTax;
                   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);
@@ -1087,9 +1132,7 @@
 
           //鍏抽棴绐楀彛
           this.loading = false;
-          this.dialogOpen = false;
           // this.getfundList();
-          this.getList();
           this.selectDonotor(this.curCase);
 
         }
@@ -1098,7 +1141,6 @@
 
     // 鍙栨秷鎸夐挳
     cancel() {
-      this.dialogOpen = false;
       this.reset();
     },
 
@@ -1277,12 +1319,11 @@
     },
 
     //鑾峰彇褰撳墠鐢ㄦ埛淇℃伅
-    getUsermsg() {
+    getUserProfile() {
       getUserProfile().then((response) => {
-        this.defaultperson = response.data;
-        console.log("this.defaultperson", this.defaultperson);
+        this.userprofile = response.data;
         this.standardlevel = response.data.standardlevel;
-        if (this.defaultperson.createBy == "admin" || this.defaultperson.createBy == "001" || this.defaultperson.createBy == "002") {
+        if (this.userprofile.createBy == "admin" || this.userprofile.createBy == "001" || this.userprofile.createBy == "002") {
           this.ismanager = true;
         } else {
           this.ismanager = false;
@@ -1315,7 +1356,7 @@
 
     //鏍¢獙鏀惰垂椤圭洰鏄惁閲嶅
     verifyFeeItem(row) {
-      row.itemArr.map((res) => {
+      row.itemlist.map((res) => {
         if (row.itemid === res.id) {
           row.remark = res.itemDescribe;
           row.itemcode = res.itemCode;
@@ -1357,24 +1398,6 @@
         if (item.expense === row.amount) {
           row.remark = item.expensedescribe;
         }
-      });
-    },
-
-    /** 鏌ヨ鎹愮尞浜洪亾鎱伴棶閲戝垪琛� */
-    getList() {
-      console.log("getList", "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];
-      }
-      // this.queryParams.residencetown = this.$refs.areaSelect.getQu();
-      listDonatebaseinfo(this.queryParams).then((response) => {
-        this.donatebaseinfoList = response.rows;
-        this.total = response.total;
-        this.loading = false;
       });
     },
 
@@ -1441,7 +1464,7 @@
               recordstatus: "-1",
               beneficiaryname: "鐐瑰嚮閫夋嫨",
               unitname: "鐐瑰嚮閫夋嫨",
-              itemArr: this.feeItemTypes[i].itemDetails,
+              itemlist: this.feeItemTypes[i].itemDetails,
               rowfeeblocks: null,
               servicesscope: null,
               servicesscopename: ""
@@ -1484,11 +1507,11 @@
     },
 
     addAll(row, i, arr) {
-      row.itemArr.map((res) => {
+      row.itemlist.map((res) => {
         if (res.id !== row.itemid) {
           let a = arr.length;
           this.addRow();
-          arr[a].itemArr = row.itemArr;
+          arr[a].itemlist = row.itemlist;
           arr[a].applytype = row.applytype;
           arr[a].itemid = res.id;
 
@@ -1550,7 +1573,7 @@
         updateTime: null,
         uploadflag: null,
         uploadtime: null,
-        itemArr: [],
+        itemlist: [],
         servicesscope: null,
         rowfeeblocks: [],
       };
@@ -1567,14 +1590,14 @@
     //鍔犺浇鏈嶅姟椤圭洰
     loadItemType(row) {
       let list = this.feeItemTypes.filter((r) => r.itemType == row.applytype);
-      row.itemArr = list[0].itemDetails;
+      row.itemlist = list[0].itemDetails;
       row.itemid = null;
       this.$forceUpdate();
       //this.loading = true;
       // getItemNames(row.applytype).then((res) => {
       //   this.loading = false;
       //   row.itemid = null;
-      //   row.itemArr = res.data;
+      //   row.itemlist = res.data;
       //   this.$forceUpdate();
       // });
     },
@@ -1635,19 +1658,19 @@
     searchItemType(val, scope) {
       let result = [];
       if (val != "") {
-        let tempItemArr = scope.row.itemArr;
-        for (let i = 0; i < tempItemArr.length; i++) {
-          let pym = tempItemArr[i].itempinyin;
+        let tempitemlist = scope.row.itemlist;
+        for (let i = 0; i < tempitemlist.length; i++) {
+          let pym = tempitemlist[i].itempinyin;
           if (pym != null && pym != undefined && pym != "") {
             if (pym.indexOf(val) != -1) {
-              result.push(tempItemArr[i]);
+              result.push(tempitemlist[i]);
             }
           }
         }
-        scope.row.itemArr = result;
+        scope.row.itemlist = result;
       } else {
         getItemNames(scope.row.applytype).then((res) => {
-          scope.row.itemArr = res.data;
+          scope.row.itemlist = res.data;
           //this.$set(this.fundDetails, rowindex, row);
         });
       }
@@ -1736,7 +1759,7 @@
 
     //鑾峰彇璐圭敤绫诲瀷
     getCurFundType() {
-      getFundTypeAll(this.currentApplyType).then((res) => {
+      getFundTypeAll(this.businesstype).then((res) => {
         let dataList = res.data;
         this.feeItemTypes = dataList;
         this.rowfeeItemTypes = [];
@@ -1751,14 +1774,14 @@
       });
     },
 
-    getItemArr(rowindex, row) {
+    getitemlist(rowindex, row) {
       let list = this.feeItemTypes.filter((r) => r.itemType == row.applytype);
-      row.itemArr = list[0].itemDetails;
+      row.itemlist = list[0].itemDetails;
       this.$set(this.fundDetails, rowindex, row);
       //this.loading = true;
       // getItemNames(row.applytype).then((res) => {
       //   this.loading = false;
-      //   row.itemArr = res.data;
+      //   row.itemlist = res.data;
       //   this.$set(this.fundDetails, rowindex, row);
       // });
     },

--
Gitblit v1.9.3