zouling 2 mēneši atpakaļ
vecāks
revīzija
60b10b451f

+ 29 - 7
property_ui/api/login.js

@@ -51,6 +51,28 @@ export function gettenantList() {
     'method': 'get'
   })
 }
+// 获取用户租户列表
+export function gettenantUserName() {
+  return request({
+    'url': '/system/tenant/userName/list',
+    'method': 'get'
+  })
+}
+// 切换租户
+export function gettenantCheck(data) {
+  return request({
+    'url': '/auth/dynamic/loginBody',
+    'method': 'post',
+	'data':data
+  })
+}
+// 切换租户
+// export function gettenantCheck(data) {
+//   return request({
+//     'url': '/system/tenant/dynamic/'+data,
+//     'method': 'get',
+//   })
+// }
 // 注册方法
 export function register(data) {
   return request({
@@ -85,6 +107,13 @@ export function sendSmsCode(data) {
 	data:data
   })
 }
+export function getRoleNopage(data) {
+  return request({
+    'url': '/system/role/listNoPage',
+    'method': 'get',
+	data:data
+  })
+}
 // 退出方法
 export function logout() {
   return request({
@@ -92,13 +121,6 @@ export function logout() {
     'method': 'post'
   })
 }
-// 切换租户
-export function gettenantCheck(data) {
-  return request({
-    'url': '/system/tenant/dynamic/'+data,
-    'method': 'get',
-  })
-}
 // 获取验证码 
 export function getCodeImg() {
   return request({

+ 7 - 0
property_ui/api/work/people.js

@@ -148,6 +148,13 @@ export function staffrzDet(data) {
     method: 'get',
   })
 }
+// 员工管理-详情过滤租户
+export function staffglrzDet(data) {
+  return request({
+    url: '/wuYe/staffManage/authentication/'+data,
+    method: 'get',
+  })
+}
 // 员工管理-删除员工信息和权限wuYe:staffManage:deleteStaffManage
 export function staffglyDel(data) {
   return request({

+ 9 - 3
property_ui/mine/pages/info/authen.vue

@@ -2,7 +2,7 @@
 	<view class="car">
 		<!-- 列表 -->
 		<view class="carlists">
-			<car-list :datainfo="list" :ygztList="ygztList" :yglbList="yglbList" :wtdt="wtdt" type='staff' @getDetail="getDetail" @getDelFn="getDelFn" @getShFn="getShFn"></car-list>
+			<car-list :datainfo="list" :ygztList="ygztList" :yglbList="yglbList" :wtdt="wtdt" type='rzstaff' @getDetail="getDetail" @getDelFn="getDelFn" @getShFn="getShFn"></car-list>
 		</view>
 		<block>
 			<view style="height: 100rpx;"></view>
@@ -111,10 +111,16 @@
 			},
 			getAddFn(){
 				var type='rzadd';
-				this.$tab.navigateTo(`/people/pages/people/staffadd?type=${type}`) 
+				if(this.list&&this.list.length){
+					var id=this.list[0].staffId
+					this.$tab.navigateTo(`/people/pages/people/staffadd?type=${type}&id=${id}`) 
+				}else{
+					this.$tab.navigateTo(`/people/pages/people/staffadd?type=${type}`) 
+				}
+				
 			},
 			getDetail(e){
-				this.$tab.navigateTo("/people/pages/people/staffadd?id="+e)
+				this.$tab.navigateTo("/people/pages/people/staffadd?type=rz&id="+e)
 			},
 			getConfirm(){
 				this.getrefreshData()

+ 48 - 75
property_ui/pages/index/index.vue

@@ -3,22 +3,10 @@
 		<view class="navbox">
 			<uni-nav-bar  color="#ffffff" leftWidth='520rpx'  :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
 				<block slot="left">
-					<view class="flexc">
 					<view class="topl flexc">
 						<image :src="adrimg" ></image>
 						<view class="over">{{city}}</view>
 					</view>
-					<view style="flex: 0 1 auto;overflow: hidden;">
-						<!-- <picker range-key='dictLabel' :value="voindex" :range="xxList"	@change='bindDateChangeb'>
-							<view class="pay_btn flexcc" >
-								<view class="tit over">
-									{{companyName||"请选择物业"}}</view>
-								<image :src="aupimg" class="rimgs"></image>
-							</view>
-						</picker> -->
-						
-					</view>
-					</view>
 				</block>
 			</uni-nav-bar>
 		</view>
@@ -29,14 +17,16 @@
 				<view class="flexc mb14">
 					<image :src="adraimg" class="adr"></image>
 					<view class="adrtit flex0">智慧<text>社区</text></view>
-					<view style="height: 100rpx;">
+					<view>
 						<w-select
 						      style="margin-left: 20rpx;" 
 						     v-model="chooseValue"
 						      :list='voList'
+							  width='200rpx'
 						      valueName='dictLabel' 
 						      keyName="dictValue"
-							  :chosevalue="tenantId"
+							  :valuea="tenantId"
+							  :chosevalue="tenantName?tenantName:statusFormats(tenantId,voList,'tenant')"
 							  :filterable='filterable'
 						      @change='getchange'
 						    >
@@ -248,11 +238,14 @@ import notice from '@/components/swiper/notice.vue'
 import popUp from "@/components/box/popup.vue"
 import {getUserProfile} from "@/api/system/user.js"
 import {repairList} from "@/api/work/service.js"
-import {gettenantList,gettenantCheck} from "@/api/login.js"
+import {gettenantUserName,gettenantCheck} from "@/api/login.js"
 import self from '@/utils/location.js';
 import wSelect from "@/people/components/w-select/w-select.vue"
 import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
 import {getCount,getCountTips} from "@/api/work/index.js"
+import {selectValueKey} from "@/utils/common.js"
+import config from '@/config'
+const Clientid = config.Clientid
   export default {
 	components:{footers,notice,popUp,wSelect},
 	data(){
@@ -319,6 +312,7 @@ import {getCount,getCountTips} from "@/api/work/index.js"
 	},
 	onShow() {
 		this.initFace=this.$store.state.user.initFace;
+		// this.tenantId=this.$store.state.user.tenantId;
 	},
     onLoad: function() {
 		var that=this;
@@ -328,15 +322,15 @@ import {getCount,getCountTips} from "@/api/work/index.js"
 			}
 		})
 		this.gettenantList()
-		if(checkPermi(['wuYe:statistics:num:app'])){
-			this.getCount()
-		}
-		if(checkPermi(['wuYe:statistics:wuYeTips'])){
-			this.getCountTips()
-		}
-		if(checkPermi(['wuYe:repair:list'])){
-			this.repairList()
-		}
+		// if(checkPermi(['wuYe:statistics:num:app'])){
+		// 	this.getCount()
+		// }
+		// if(checkPermi(['wuYe:statistics:wuYeTips'])){
+		// 	this.getCountTips()
+		// }
+		// if(checkPermi(['wuYe:repair:list'])){
+		// 	this.repairList()
+		// }
 		// #ifndef H5
 		self.getLocation(function(res){
 			if(res==-1){
@@ -349,44 +343,54 @@ import {getCount,getCountTips} from "@/api/work/index.js"
     },
 	methods:{
 		checkPermi, checkRole,
+		statusFormats(data, list,type) {
+			var aite=selectValueKey(list, data);
+			if(type=='tenant'){
+				this.tenantName=aite.actions
+			}
+			return aite.actions;
+		},
 		// 获取租户列表
 		gettenantList(){
-			gettenantList().then(res=>{
+			 var params={
+				 userId:this.userId
+			 }
+			gettenantUserName().then(res=>{
 				if(res.code==200){
-					if(res.data.voList&&res.data.voList.length){
-						this.voList = res.data.voList.map(v => {
+					if(res.data&&res.data.length){
+						this.voList = res.data.map(v => {
 							return {
 								dictLabel: v.companyName,
 								dictValue: v.tenantId
 							}
 						})
 					}
-					
 				}else{
 					this.$toast(res.msg)
 				}
 			})
 		},
 		getchange(e){
-			var tenantId=e.dictValue;
-			gettenantCheck(tenantId).then(res=>{
-				this.$store.dispatch('GetInfo').then(res => {
-					
-				})
-				// var data=res.data;
+			var id=e.dictValue;
+			var name=e.dictLabel;
+			var that=this;
+			this.tenantId=id;
+			this.tenantName=name;
+			var params={
+				tenantId:id,
+				clientId:Clientid,
+				grantType:'password'
+			}
+			gettenantCheck(params).then(res=>{
+				var token=res.msg;
 				// 切换token
-				// this.$store.dispatch('checkToken', data.access_token).then(() => {
-				// 	that.getClassFn('GetInfo');
-				// 	// 刷新其余的页面
-				// 	var newArr=[false,true,true,true,true]
-				// 	that.$store.dispatch('checkRefresh', newArr).then(() => {
+				this.$store.dispatch('checkToken', token).then(() => {
+					this.$store.dispatch('GetInfo').then(res => {
 						
-				// 	}).catch(() => {
+					})
+				}).catch(() => {
 					 
-				// 	})
-				// }).catch(() => {
-							 
-				// })
+				})	
 			})
 		},
 		getXxwsFn(){
@@ -396,37 +400,6 @@ import {getCount,getCountTips} from "@/api/work/index.js"
 		getClose(){
 			this.initFace='N';
 		},
-		bindDateChangeb(e){
-			var that=this;
-			var val=e.detail.value;
-			var id=this.xxList[val].dictValue
-			this.companyName=this.xxList[val].dictLabel;
-			// if(id!=this.tenantId){
-				this.tenantId=id;
-				var params={
-					tenantId:id,
-					clientId:Clientid,
-					grantType:'password'
-				}
-				gettenantCheck(params).then(res=>{
-					var data=res.data;
-					// 切换token
-					this.$store.dispatch('checkToken', data.access_token).then(() => {
-						that.getClassFn('GetInfo');
-						// 刷新其余的页面
-						var newArr=[false,true,true,true,true]
-						that.$store.dispatch('checkRefresh', newArr).then(() => {
-							
-						}).catch(() => {
-						 
-						})
-					}).catch(() => {
-		 
-					})
-					
-				})
-			// }	
-		},
 		getNoticeDet(data){
 			this.$tab.navigateTo(`/service/pages/service/warrantydetail?id=`+data) 
 		},

+ 1 - 0
property_ui/pages/register.vue

@@ -88,6 +88,7 @@
 			datainfo: {
 				phonenumber: "",
 				code: "",
+				tenantId:'000000',
 				clientId:config.Clientid,
 				grantType:'sms',
 				userType:config.userType

+ 7 - 4
property_ui/people/components/car/list.vue

@@ -108,7 +108,7 @@
 			</view>
 		</block>
 		<!-- 维修人员管理 -->
-		<view v-if="type=='staff'" class="flecw">
+		<view v-if="type=='staff'||type=='rzstaff'" class="flecw">
 			<view class="stafflist" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail(ite.staffId)">
 				<view class="statop">
 					<image class="head" :src="baseUrl+ite.avatarPhoto" v-if="ite.avatarPhoto"></image>
@@ -116,12 +116,15 @@
 						<image class="head" :src="man" v-if="ite.gender==1"></image>
 						<image class="head" :src="woman" v-else></image>
 					</block>
-					<view class="flex1">
-						<view class="statit">{{ite.staffName}}</view>
+					<view class="flex1 over">
+						<view class="statit over">{{ite.staffName}}</view>
 						<view class="statxt flexc" :class="{'co06':ite.status==1,'coff':ite.status==2}"><text class="cir" :class="{'bga':ite.status==1,'bgb':ite.status==2}"></text>{{kaType(ite.status,ygztList)}}</view>
 						<!-- <view class="statxt flexc cof6"><text class="cir bgb"></text>指派中</view> -->
 					</view>
-					<image :src="pdel" class="stadel" v-if="checkPermi(['wuYe:staffManage:remove'])" @click.stop="getDelFn(ite)"></image>
+					<block v-if="checkPermi(['wuYe:staffManage:remove'])">
+						<image :src="pdel" class="stadel" v-if="type=='rzstaff'&&ite.examine!=2" @click.stop="getDelFn(ite)"></image>
+						<image :src="pdel" class="stadel" v-if="type=='staff'" @click.stop="getDelFn(ite)"></image>
+					</block>
 				</view>
 				<view class="stalist">
 					<view class="imgs"><image :src="gzlx" class="gzlximg"></image></view>{{kaType(ite.staffCategory,yglbList)}}

+ 8 - 3
property_ui/people/components/w-select/w-select.vue

@@ -85,7 +85,7 @@
 				  res => res[keyName] === item[keyName]
 				)
 				? 'item-active'
-				: value == item[keyName]
+				: valuea == item[keyName]
 				  ? 'item-active'
 				  : ''
 			"
@@ -175,6 +175,11 @@
 		default: ''
 	  },
 	  // #endif
+	  // 双向绑定的值
+	  valuea: {
+	  		type: [Array, String, Number],
+	  		default: ''
+	  },
 	  // 默认显示的内容
 	  defaultValue: {
 		type: String,
@@ -221,7 +226,7 @@
   
 			// #ifdef VUE2
 			
-			if (item[this.keyName] === this.value) {
+			if (item[this.keyName] === this.valuea) {
 			  isItem = true
 			} else {
 			  isItem = false
@@ -253,7 +258,7 @@
 		multiSelectList: this.multiple ? this.modelValue : [],
 		// #endif
 		// #ifdef VUE2
-		multiSelectList: this.multiple ? this.value : [],
+		multiSelectList: this.multiple ? this.valuea : [],
 		// #endif
 		isShow: false,
 		optionsShow: false,

+ 53 - 21
property_ui/people/pages/people/staffadd.vue

@@ -33,6 +33,7 @@
 						      :list='voList'
 						      valueName='dictLabel' 
 						      keyName="dictValue"
+							  :valuea="datainfo.tenantId"
 							  :chosevalue="tenantName?tenantName:statusFormats(datainfo.tenantId,voList,'tenant')"
 							  :filterable='filterable'
 						      @change='getchange'
@@ -117,11 +118,11 @@
 	import config from '@/config'
 	const userType=config.userType;
 	import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
-	import {staffAdd,staffPut,staffDet,staffAddgly,staffrzDet,staffPutgly} from "@/api/work/people.js"
+	import {staffAdd,staffPut,staffDet,staffAddgly,staffrzDet,staffPutgly,staffglrzDet} from "@/api/work/people.js"
 	import {getDictionaryFn} from "@/api/system/user.js"
 	import {selectValueKey,uploadIdentify} from "@/utils/common.js"
 	import wSelect from "@/people/components/w-select/w-select.vue"
-	import {gettenantList} from "@/api/login.js"
+	import {gettenantList,getRoleNopage} from "@/api/login.js"
 	import {getOcrIdCard} from "@/api/system/card.js"
 	export default {
 		components: {wSelect},
@@ -188,8 +189,10 @@
 				this.rzflag=true;
 				this.datainfo.phoneNumber=this.$store.state.user.phonenumber;
 				this.datainfo.userId=this.$store.state.user.userId;
-				var userId=this.$store.state.user.userId;
-				this.staffrzDet(userId)
+				// var userId=this.$store.state.user.userId;
+				// this.staffrzDet(userId)
+			}else{
+				this.datainfo.tenantId=this.$store.state.user.tenantId
 			}
 			this.gettenantList();
 			if(e.id){
@@ -236,16 +239,16 @@
 			},
 			init(){
 				// 员工类别
-				getDictionaryFn('yaungong').then(res=>{
-					if(res.code==200){
-						this.yglbList = res.data.map(v => {
-							return {
-								dictLabel: v.dictLabel,
-								dictValue: v.dictValue
-							}
-						})
-					}
-				})
+				// getDictionaryFn('yaungong').then(res=>{
+				// 	if(res.code==200){
+				// 		this.yglbList = res.data.map(v => {
+				// 			return {
+				// 				dictLabel: v.dictLabel,
+				// 				dictValue: v.dictValue
+				// 			}
+				// 		})
+				// 	}
+				// })
 				// 维修类别
 				getDictionaryFn('weixiutype').then(res=>{
 					if(res.code==200){
@@ -270,13 +273,26 @@
 				})
 			},
 			getchange(e){
-				console.log(e)
 				this.datainfo.tenantId=e.dictValue;
+				this.getRoleNopage(e.dictValue)
 				// this.datainfo.houseAddress=e.dictLabel;
 				// if(this.tabval=='1'){
 				// 	this.datainfo.detailAddress=e.location;
 				// }
 			},
+			getRoleNopage(id){
+				var params={
+					tenantId:id
+				}
+				getRoleNopage(params).then(res=>{
+					this.yglbList = res.rows.map(v => {
+						return {
+							dictLabel: v.roleName,
+							dictValue: v.roleKey
+						}
+					})
+				})
+			},
 			bindDateChange(e){
 				var val=e.detail.value;
 				var vala=this.yglbList[val].dictValue;
@@ -346,6 +362,7 @@
 						}
 					}else{
 						if(this.rzflag){
+							params.isFilter=true;
 							staffPut(params).then(res=>{
 								if(res.code==200){
 									this.$toast("修改成功")
@@ -380,20 +397,35 @@
 					
 				})
 			},
+			filterObjectByChar(obj, char) {
+			    const filteredEntries = Object.entries(obj).filter(([key]) => !key.includes(char));
+			    return Object.fromEntries(filteredEntries);
+			},
 			// 员工信息详情
 			getDetailFn(){
-				staffDet(this.id).then(res=>{
-					if(res.code==200){
-						this.datainfo=res.data;
-					}
-				})
+				if(this.rzflag){
+					staffglrzDet(this.id).then(res=>{
+						if(res.code==200){
+							// this.datainfo=res.data;
+							var tenantId=res.data.tenantId
+							this.getRoleNopage(tenantId)
+							this.datainfo=this.filterObjectByChar(res.data,'staffId');
+						}
+					})
+				}else{
+					staffDet(this.id).then(res=>{
+						if(res.code==200){
+							this.datainfo=res.data;
+						}
+					})
+				}
 			},
 			// 认证信息详情 ,admin,首页切换到幸福里,修改
 			staffrzDet(id){
 				staffrzDet(id).then(res=>{
 					if(res.code==200&&res.data){
 						if(this.rztype=='rzadd'){
-							// this.datainfo=res.data.filter()
+							this.datainfo=res.data
 						}else{
 							this.ptype='edit';
 							this.datainfo=res.data;

+ 1 - 0
property_ui/store/getters.js

@@ -15,5 +15,6 @@ const getters = {
   loading: state => state.user.loading,
   tenantId: state => state.user.tenantId,
   initFace: state => state.user.initFace,
+  tenantId: state => state.user.tenantId,
 }
 export default getters

+ 6 - 0
property_ui/store/modules/user.js

@@ -108,6 +108,11 @@ const user = {
 	checkInitFace({commit},data){
 		commit('SET_INITFACE', data)
 	},
+	//修改token
+	checkToken({commit},data){
+		setToken(data)
+		commit('SET_TOKEN', data)
+	},
     // 登录
     Login({ commit }, userInfo) {
       const username = userInfo.username.trim()
@@ -193,6 +198,7 @@ const user = {
             commit('SET_ROLES', ['ROLE_DEFAULT'])
 			commit('SET_PERMISSIONS', [])
           }
+		  commit('SET_PERMISSIONS', res.permissions||[])
           commit('SET_NAME', username)
 		  commit('SET_NICKNAME', nickName)
           commit('SET_AVATAR', avatar)

+ 1 - 0
property_ui/utils/constant.js

@@ -12,6 +12,7 @@ const constant = {
    deptId: 'vuex_deptId',
    deptName: 'vuex_deptName',
    initFace:'vuex_initFace',
+   tenantId:'vuex_tenantId',
  }
 
  export default constant

+ 1 - 1
property_ui/utils/storage.js

@@ -4,7 +4,7 @@ import constant from './constant'
 let storageKey = 'storage_data'
 
 // 存储节点变量名
-let storageNodeKeys = [constant.avatar, constant.name,constant.nickName, constant.roles,constant.roleName,constant.permissions,constant.autologin,constant.wgtcode,constant.userId,constant.phonenumber,constant.deptId,constant.deptName,constant.initFace,]
+let storageNodeKeys = [constant.avatar, constant.name,constant.nickName, constant.roles,constant.roleName,constant.permissions,constant.autologin,constant.wgtcode,constant.userId,constant.phonenumber,constant.deptId,constant.deptName,constant.initFace,constant.tenantId]
 
 const storage = {
   set: function(key, value) {