lilei 2 年 前
コミット
f43d9a767e

+ 0 - 1
main.js

@@ -20,7 +20,6 @@ Vue.prototype.$hasPermissions = function (value) {
  	 return true
  }
  let permissionsStr = uni.getStorageSync('permCodes');
- console.log(permissionsStr)
  if (permissionsStr == undefined || permissionsStr == null || !permissionsStr) {
   return false;
  }

+ 1 - 1
pages/index/index.vue

@@ -176,7 +176,7 @@
 		methods: {
 			pageInit(){
 				if(this.hasLogin){
-					this.avatarUrl = this.userInfo.avatarUrl
+					this.avatarUrl = this.userInfo.extInfo.userExtInfo ? this.userInfo.extInfo.userExtInfo.headImage : ''
 					// 获取扫描记录
 					this.getVinLog()
 					

+ 2 - 4
pages/personData/personData.vue

@@ -90,7 +90,6 @@
 		  onChooseAvatar(e) {
 			const _this = this
 			const { avatarUrl } = e.detail 
-			this.avatarUrl = avatarUrl
 			uni.uploadFile({
 				url: baseUrl + '/upload',
 				filePath: avatarUrl,
@@ -99,6 +98,7 @@
 					const ret = JSON.parse(uploadFileRes.data)
 					console.log(ret,'uploadFileRes')
 					if(ret.status == 200){
+						_this.avatarUrl = ret.data
 						saveEmployee({id:_this.userInfo.userid,photo: ret.data}).then(res => {
 							if(res.status == 200){
 								uni.showToast({
@@ -130,10 +130,8 @@
 		  }
         },
 		onLoad() {
+			this.avatarUrl = this.userInfo.extInfo.userExtInfo ? this.userInfo.extInfo.userExtInfo.headImage : ''
 		},
-        onReady() {
-            
-        }
     }
 </script>
 

+ 26 - 5
pages/storeManage/addPerson.vue

@@ -25,16 +25,18 @@
 						<u-input type="select" style="width:100%" input-align="right" placeholder="请选择岗位" @click="showRoles=true" v-model="formData.roleNames"/>
 						<u-popup v-model="showRoles" mode="bottom">
 							<view style="padding: 1rem;width: 100%;">
-								<view style="position: relative;padding: 0.5rem;width: 100%;text-align: center;">
-									<text style="color:#066cff;position: absolute;left:0;top:0;">新增岗位</text>
+								<view style="position: relative;padding: 0.5rem;width: 100%;text-align: center;border-bottom: 1px solid #eee;font-size:1.1rem;">
+									<text @click="toAddRole()" style="color:#066cff;position: absolute;left:0;top:0.5rem;font-size:0.9rem;">新增岗位</text>
 									选择岗位
 								</view>
-								<view v-if="roleList.length">
-									<u-radio-group v-model="formData.roleIds" @change="radioGroupChange">
+								<view style="padding-top: 1rem;" v-if="roleList.length">
+									<u-radio-group wrap v-model="formData.roleIds" @change="radioGroupChange">
 										<u-radio 
 											v-for="(item, index) in roleList" :key="item.id" 
-											:name="item.name"
+											:name="item.id"
 											:disabled="!item.isEnable"
+											:icon-size="30"
+											:label-size="32"
 										>
 											{{item.name}}
 										</u-radio>
@@ -100,6 +102,15 @@
 		onLoad() {
 			this.init()
 			this.getRole()
+			
+			const _this = this;
+			uni.$on("refashRoleList",function(data){
+				_this.getRole()
+				if(data){
+					_this.formData.roleIds = data.id;
+					_this.formData.roleNames = data.name;
+				}
+			})
 		},
 		methods:{
 			//  初始化数据
@@ -125,6 +136,16 @@
 			},
 			radioGroupChange(e) {
 				console.log(e);
+				this.formData.roleIds = e;
+				const roleNames = this.roleList.find(item => item.id == e);
+				this.formData.roleNames = roleNames?roleNames.name:'';
+				this.showRoles = false
+			},
+			toAddRole(){
+				this.showRoles = false
+				uni.navigateTo({
+					url:'/pages/storeManage/roleSetting/addRole?type=add'
+				})
 			},
 			//  保存
 			save(name){

+ 1 - 0
pages/storeManage/roleSetting/addRole.vue

@@ -93,6 +93,7 @@
 						  saveRoleMenu(this.formData).then(res=>{
 						  	if(res.status == 200){
 						  		this.cancel()
+								uni.$emit('refashRoleList',res.data)
 						  	}
 						  	uni.showToast({icon: 'none', title: res.message})
 						  	this.loading = false