From 3cbb8936b9f9f977741bb9e465fb1f904836b71b Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期一, 07 八月 2023 16:39:17 +0800
Subject: [PATCH] yxh

---
 src/views/project/fund/overheadcosts/index.vue |  485 +++++++++++++++++++++++++++--------------------------
 1 files changed, 243 insertions(+), 242 deletions(-)

diff --git a/src/views/project/fund/overheadcosts/index.vue b/src/views/project/fund/overheadcosts/index.vue
index 1ebc354..c3d4f8b 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("鏄惁纭鍒犻櫎?", "鎻愮ず", {

--
Gitblit v1.9.3