lilei 8 місяців тому
батько
коміт
36367a031f

+ 26 - 25
pages/storeManage/addPerson.vue

@@ -23,30 +23,6 @@
 					</evanFormItem>
 					<evanFormItem label="岗位" v-if="!isEdit||formData.isManager==0" prop="roleNames">
 						<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;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 style="padding:1rem;min-height: 15rem;" 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.id"
-											:disabled="!item.isEnable"
-											:icon-size="30"
-											:label-size="32"
-										>
-											{{item.name}}
-										</u-radio>
-									</u-radio-group>
-								</view>
-								<view style="color: #999;text-align: center;padding:3rem 0;" v-else>
-									暂无岗位信息,请点击“新增岗位”
-								</view>
-							</view>
-						</u-popup>
 					</evanFormItem>
 				</evanForm>
 			</view>
@@ -54,6 +30,30 @@
 				<u-button shape="circle" v-if="isEdit&&formData.isManager==0" @click="delPerson()" :custom-style="{width:'300rpx',marginRight:'20rpx' }">删除</u-button>
 				<u-button shape="circle" type="info" :custom-style="{ background: '#066cff', color: '#fff',width:'300rpx' }" @click="save('formData')">保存</u-button>
 			</view>
+			<u-popup v-model="showRoles" mode="bottom">
+				<view style="width: 100%;">
+					<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:1rem;top:0.6rem;font-size:0.8rem;">新增岗位</text>
+						选择岗位
+					</view>
+					<view style="padding:0.5rem 1rem;min-height: 15rem;" 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.id"
+								:disabled="!item.isEnable"
+								:icon-size="30"
+								:label-size="32"
+							>
+								{{item.name}}
+							</u-radio>
+						</u-radio-group>
+					</view>
+					<view style="color: #999;text-align: center;padding:3rem 0;" v-else>
+						暂无岗位信息,请点击“新增岗位”
+					</view>
+				</view>
+			</u-popup>
 	</view>
 </template>
 
@@ -135,7 +135,7 @@
 			},
 			// 获取角色
 			getRole(){
-				getRoleList().then(res => {
+				getRoleList({isEnable: '1'}).then(res => {
 					this.roleList = res.data || []
 				})
 			},
@@ -146,6 +146,7 @@
 				this.formData.roleNames = roleNames?roleNames.name:'';
 				this.showRoles = false
 			},
+			// 新增岗位
 			toAddRole(){
 				this.showRoles = false
 				uni.navigateTo({

+ 8 - 32
pages/storeManage/editAdminAuth.vue

@@ -31,7 +31,7 @@
 </template>
 
 <script>
-	import { getPowerRoleList } from '@/api/powerRole-md.js'
+	import { getRoleList } from '@/api/powerRole-md.js'
 	import {saveEmployee,setManager} from '@/api/employee'
 	import { getCurrUserInfo } from '@/api/data.js';
 	export default{
@@ -41,8 +41,7 @@
 				noDataText: '暂无数据',
 				// 查询参数
 				queryParam: {
-				  name: '',
-				  isEnable: ''
+				  isEnable: '1'
 				},
 				formData:{},
 				pageSize: 100,
@@ -59,16 +58,6 @@
 			this.userInfo = this.$store.state.vuex_nowStaffData
 			this.getCurrUserInfo()
 		},
-		// 下一页
-		onReachBottom() {
-			console.log('next page')
-			if(this.roleList.length < this.total){
-				this.pageNo += 1
-				this.getRoleList()
-			}else{
-				this.status = "nomore"
-			}
-		},
 		methods:{
 			radioGroupChange(e){
 				this.formData.roleIds = e;
@@ -79,25 +68,12 @@
 			getRoleList(){
 				let _this = this
 				this.status = "loading"
-				 getPowerRoleList(Object.assign({pageNo: this.pageNo, pageSize: this.pageSize}, this.queryParam)).then(res => {
-				   uni.hideLoading()
-				   if (res.code == 200 || res.status == 204 || res.status == 200) {
-				     if(_this.pageNo>1){
-				   	  _this.roleList = _this.roleList.concat(res.data.list || [])
-				     }else{
-				   	  _this.roleList = res.data.list || []
-				     }
-				     _this.total = res.data.count || 0
-					 _this.roleList.map(item => {
-					 	item.roleState = item.isEnable == 1
-					 })
-				   } else {
-				     _this.roleList = []
-				     _this.total = 0
-				     _this.noDataText = res.message
-				   }
-				   _this.status = "loadmore"
-				 })
+				getRoleList({isEnable: '1'}).then(res => {
+					uni.hideLoading()
+					_this.roleList = res.data || []
+					_this.noDataText = res.message
+					_this.status = "loadmore"
+				})
 			},
 			getCurrUserInfo(){
 				uni.showLoading({

+ 10 - 46
pages/storeManage/editIsManage.vue

@@ -5,18 +5,9 @@
 				<scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
 					<view style="height: 20rpx;" ></view>
 					<view class="check-order-list">
-						 <u-radio-group wrap @change="radioGroupChange">
-						 	<u-radio 
-						 		v-model="item.checked" 
-						 		v-for="(item, index) in list" :key="item.userId" 
-						 		:name="item.userId"
-								v-if="item.isManager == 0"
-						 	>
-						 	<view class="u-name">
-						 		{{item.name}}/{{item.mobile}}
-						 	</view>
-						 	</u-radio>
-						 </u-radio-group>
+						 <u-cell-group>
+						 	<u-cell-item v-for="(item, index) in list" :key="item.userId" @click="setNewAdmin(item)" :title="item.name+'/'+item.mobile"></u-cell-item>
+						 </u-cell-group>
 					 </view>
 					 <view style="padding:0 30upx 30upx;">
 						 <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
@@ -25,11 +16,6 @@
 				</scroll-view>
 			</swiper-item>
 		</swiper>
-		<view class="footer flex align_center justify_center">
-			<u-button @click="setNewAdmin()" :throttle-time="100" :custom-style="{ background: '#066cff', color: '#fff' }" shape="circle" type="info">
-				设为新负责人
-			</u-button>
-		</view>
 	</view>
 </template>
 
@@ -49,7 +35,6 @@
 				pageSize: 20,
 				list: [],
 				total: 0,
-				curPerson: null
 			}
 		},
 		onShow() {
@@ -61,20 +46,16 @@
 			},
 		},
 		methods:{
-			radioGroupChange(e){
-				console.log(e)
-				this.curPerson = e
-			},
 			// 查询列表
 			getRow (pageNo) {
 			  let _this = this
 			  if (pageNo) {
 			    this.pageNo = pageNo
 			  }
-			  
 			  let params = {
 			    pageNo:this.pageNo,
-			    pageSize:this.pageSize
+			    pageSize:this.pageSize,
+				isManager: 0
 			  }
 			  this.status = "loading"
 			  searchEmployee(params).then(res => {
@@ -96,7 +77,6 @@
 			},
 			// scroll-view到底部加载更多
 			onreachBottom() {
-				console.log(this.list.length, this.total)
 				if(this.list.length < this.total){
 					this.pageNo += 1
 					this.getRow()
@@ -105,19 +85,11 @@
 				}
 			},
 			// 设为负责人
-			setNewAdmin(){
-				console.log(this.curPerson)
-				if(!!this.curPerson){
-					const row = this.list.find(item => item.userId == this.curPerson )
-					this.$store.state.vuex_nowStaffData = row
-					uni.redirectTo({
-						url: "/pages/storeManage/editAdminAuth"
-					})
-				}else{
-					uni.showToast({
-						title: "请选择员工"
-					})
-				}
+			setNewAdmin(row){
+				this.$store.state.vuex_nowStaffData = row
+				uni.navigateTo({
+					url: "/pages/storeManage/editAdminAuth"
+				})
 			},
 		}
 	}
@@ -145,13 +117,5 @@
 				}
 			}
 		}
-		.footer{
-			padding: 0.6rem;
-			background: #ffffff;
-			u-button{
-				width: 45%;
-				margin: 0 2%;
-			}
-		}
 	}
 </style>

+ 0 - 2
pages/storeManage/personnel.vue

@@ -80,7 +80,6 @@
 			  if (pageNo) {
 			    this.pageNo = pageNo
 			  }
-			  
 			  let params = {
 			    pageNo:this.pageNo,
 			    pageSize:this.pageSize
@@ -105,7 +104,6 @@
 			},
 			// scroll-view到底部加载更多
 			onreachBottom() {
-				console.log(this.list.length, this.total)
 				if(this.list.length < this.total){
 					this.pageNo += 1
 					this.getRow()