浏览代码

机构信息修改后,更新到store

zhengchengwu 6 年前
父节点
当前提交
e9c613ba44
共有 2 个文件被更改,包括 28 次插入0 次删除
  1. 26 0
      src/store/modules/xt_user.js
  2. 2 0
      src/xt_pages/org/orginfo.vue

+ 26 - 0
src/store/modules/xt_user.js 查看文件

@@ -93,6 +93,10 @@ const xt_user = {
93 93
       state.user.user_name = payload.user_name
94 94
       state.user.avatar = payload.avatar
95 95
     },
96
+    MODIFY_ORG_INFO:(state, payload) => {
97
+      state.org.org_name = payload.org_name
98
+      state.org.org_short_name = payload.org_short_name
99
+    },
96 100
 
97 101
     SET_SUBSCIBE_PATIENT: (state) => {
98 102
       state.subscibe.patients += 1
@@ -230,6 +234,28 @@ const xt_user = {
230 234
         })
231 235
       )
232 236
     },
237
+    ModifyOrgInfo({
238
+      commit,
239
+      state
240
+    }, params) {
241
+      commit('MODIFY_ORG_INFO', {
242
+        org_name: params.org_name,
243
+        org_short_name: params.org_short_name
244
+      })
245
+      cacheAdminUserInfo(
246
+        JSON.stringify({
247
+          user: state.user,
248
+          org: state.org,
249
+          current_org_id: state.org_id,
250
+          current_app_id: state.app_id,
251
+          urlfors: state.urlfors,
252
+          subscibe: state.subscibe,
253
+          scrm_role_exist: state.scrm_role_exist,
254
+          cdm_role_exist: state.cdm_role_exist,
255
+          mall_role_exist: state.mall_role_exist
256
+        })
257
+      )
258
+    },
233 259
 
234 260
     // InitAdminUserInfo( {commit, state} ) {
235 261
     //   var cacheInfo = getAdminUserInfoCache()

+ 2 - 0
src/xt_pages/org/orginfo.vue 查看文件

@@ -562,6 +562,8 @@ import Neditor from '@/components/Neditor'
562 562
             EditOrgInfo(this.form).then(response=>{
563 563
                 var res = response.data;
564 564
                 if(res.state==1) {
565
+                    this.$store.dispatch("ModifyOrgInfo", { org_name: this.form.org_name, org_short_name: this.form.org_name })
566
+                    
565 567
                     this.$message.success("修改成功");
566 568
                 }else {
567 569
                     this.$message.error(res.msg);