From 0ac2d43fce4d74f6eea5a51a2e16af4e6a536c7c Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 14 八月 2024 14:19:24 +0800
Subject: [PATCH] 11

---
 src/views/project/donationdetails/index.vue      |    5 +++++
 src/store/modules/user.js                        |   23 ++++++++++++++++++++++-
 src/views/project/components/orgselect/index.vue |   16 +++++++++++++++-
 src/store/getters.js                             |    1 +
 4 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/src/store/getters.js b/src/store/getters.js
index da6ab39..7650799 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -7,6 +7,7 @@
   token: state => state.user.token,
   avatar: state => state.user.avatar,
   name: state => state.user.name,
+  organization: state => state.user.organization,
   introduction: state => state.user.introduction,
   roles: state => state.user.roles,
   permissions: state => state.user.permissions,
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 20c0e33..efaed5b 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -1,6 +1,8 @@
 import { login, logout, getInfo } from '@/api/login'
 import { getToken, setToken, removeToken } from '@/utils/auth'
 import {  Message } from 'element-ui'
+import { listOrganization } from "@/api/project/organization";
+
 
 
 const user = {
@@ -11,7 +13,8 @@
     code: '',
     msg: '',
     roles: [],
-    permissions: []
+    permissions: [],
+    organization:[],
   },
 
   mutations: {
@@ -35,6 +38,9 @@
     },
     SET_PERMISSIONS: (state, permissions) => {
       state.permissions = permissions
+    },
+    SET_organization: (state, organization) => {
+      state.organization = organization
     }
   },
 
@@ -101,6 +107,21 @@
         })
       })
     },
+    // 鎷垮彇鏈烘瀯淇℃伅
+    getdataList({commit}){
+      return new Promise((resolve, reject) => {
+        listOrganization({
+          organizationtype: 4, //浼犲叆鐨勭被鍨�
+          pageNum: 1,
+          pageSize: 100000
+        }).then((res) => {
+          commit('SET_organization', res.rows)
+          resolve()
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
 
     // 鍓嶇 鐧诲嚭
     FedLogOut({ commit }) {
diff --git a/src/views/project/components/orgselect/index.vue b/src/views/project/components/orgselect/index.vue
index f33b57f..be20106 100644
--- a/src/views/project/components/orgselect/index.vue
+++ b/src/views/project/components/orgselect/index.vue
@@ -130,7 +130,6 @@
     renderSelecter() {
       this.pageData.PageSize = 100;
       this.myValue = this.value;
-
       this.getdataList();
     },
 
@@ -144,6 +143,21 @@
       }; //鎼滅储鏉′欢
 
       let userType = { userType: "1" };
+      if (this.orgType == 4) {
+        let arr = this.$store.state.user.organization;
+        this.dataList.push(...arr);
+        if (this.isAll) {
+          let all = {
+            organizationid: "",
+            organizationname: "鍏ㄩ儴"
+          };
+          this.dataList.unshift(all);
+        }
+        this.tempList = this.dataList.map(item => item);
+        this.focusEvents.loaded = true;
+        this.isLoading = false;
+        return;
+      }
 
       listOrganization(searchData)
         .then(response => {
diff --git a/src/views/project/donationdetails/index.vue b/src/views/project/donationdetails/index.vue
index ad38fa3..e15b466 100644
--- a/src/views/project/donationdetails/index.vue
+++ b/src/views/project/donationdetails/index.vue
@@ -2756,6 +2756,7 @@
 
   created() {
     this.Getnetworkheader();
+    this.getdataList();
     this.infoid = this.$route.query.id;
   },
   mounted() {
@@ -3361,6 +3362,10 @@
       }
       // }
     },
+    // 鑾峰彇閮ㄩ棬鏁版嵁缂撳瓨
+    getdataList() {
+      this.$store.dispatch("getdataList").then(() => {});
+    },
     // 鍣ㄥ畼鍒嗛厤鏍忕洰鎺у埗
     changeorganState(value) {
       let selectedIndex = this.organList.organallocated.findIndex(

--
Gitblit v1.9.3