From 3eb3749396d66c599dfb80e7708610a120d3cfdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E5=B0=8F=E7=8E=8B=E5=91=80=5C24601?= <819653817@qq.com> Date: Wed, 5 Mar 2025 16:20:54 +0800 Subject: [PATCH] =?UTF-8?q?tab-bar=E6=98=BE=E7=A4=BA=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/custom-tab-bar/index.js | 23 ++++++++++++++++++----- utils/api.js | 3 ++- utils/statisticsApi.js | 4 ++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/components/custom-tab-bar/index.js b/components/custom-tab-bar/index.js index 215f5ac..8c87117 100644 --- a/components/custom-tab-bar/index.js +++ b/components/custom-tab-bar/index.js @@ -1,10 +1,11 @@ import {getStaffbasicinfo} from "../../utils/api"; const app = getApp() -import {getOwnedRolesOfStaffId} from '../../utils/statisticsApi.js' +import {getOwnedRolesOfStaffId,editstaffinit} from '../../utils/statisticsApi.js' Component({ data: { + manageOrgNameList:[], selected: 0, color: "#999", selectedColor: "#3A80E7", @@ -57,23 +58,35 @@ Component({ selected: app.globalData.selected }) // secretary 书记 admin 管理员 - console.log( app.globalData.roleList.filter(item => item.roleKey === 'secretary')) if(app.globalData.roleList.length <= 0) { getStaffbasicinfo().then(res=>{ + editstaffinit({ + agencyId: res.data.agencyId, + staffId: res.data.id + }).then(res4 => { + this.setData({ + manageOrgNameList: res4.data.manageOrgNameList + }) + }) getOwnedRolesOfStaffId(res.data.id).then(res2 => { app.globalData.user = res.data this.setData({ - "list[3].show": res2.data.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0 + "list[3].show": res2.data.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0||manageOrgNameList }) }) }) } else { + editstaffinit({ agencyId:app.globalData.user.agencyId, staffId:app.globalData.user.id}).then(res4=>{ + this.setData({ + manageOrgNameList:res4.data.manageOrgNameList + }) + }) + this.setData({ - "list[3].show": app.globalData.roleList.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0 + "list[3].show": app.globalData.roleList.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0 ||manageOrgNameList }) } - console.log(app.globalData.roleList, 'userss') }, methods: { switchTab(e) { diff --git a/utils/api.js b/utils/api.js index 8152962..000c25f 100644 --- a/utils/api.js +++ b/utils/api.js @@ -90,7 +90,7 @@ module.exports = { Enterpriseambiguity, hotResidentSearch, hotHouseSearch, - customerlist + customerlist, } // 获取公钥 @@ -144,6 +144,7 @@ function getCommunityHouse(para) { function getStaffbasicinfo(para) { return fly.post('epmetuser/customerstaff/staffbasicinfo', para) } + // 新增居民 function resiAdd(para) { return fly.post('actual/base/residentBaseInfo/save', para) diff --git a/utils/statisticsApi.js b/utils/statisticsApi.js index fcb222c..957c05c 100644 --- a/utils/statisticsApi.js +++ b/utils/statisticsApi.js @@ -277,6 +277,10 @@ export function dwdEventEventList(params) { export function getOwnedRolesOfStaffId(id) { return request.get('gov/access/govroleuser/getOwnedRolesOfStaffId/'+id) } +//修改信息 +export function editstaffinit(para) { + return request.post('gov/org/staff/editstaffinit', para) +} // 房屋性质 export function getHouseType(params) { return request.post('sys/dict/data/house',params)