123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <template>
- <view class="page-body flex flex_column">
- <swiper class="scroll-list" :current="swiperCurrent">
- <swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;">
- <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>
- </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>
- <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
- </view>
- </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>
- <script>
- import {searchEmployee} from '@/api/employee'
- import moment from 'moment'
- export default{
- name:'personnel',
- data(){
- return{
- status: 'loading',
- noDataText: '暂无数据',
- current: 0,
- swiperCurrent: 0,
- // 查询条件
- pageNo: 1,
- pageSize: 20,
- list: [],
- total: 0,
- curPerson: null
- }
- },
- onShow() {
- this.getRow(1)
- },
- computed:{
- userInfo(){
- return this.$store.state.vuex_userInfo
- },
- },
- 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
- }
- this.status = "loading"
- searchEmployee(params).then(res => {
- if (res.code == 200 || res.status == 204 || res.status == 200) {
- if(_this.pageNo>1){
- _this.list = _this.list.concat(res.data.list || [])
- }else{
- _this.list = res.data.list || []
- }
- _this.total = res.data.count || 0
- } else {
- _this.list = []
- _this.total = 0
- _this.noDataText = res.message
- }
-
- _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
- })
- },
- // scroll-view到底部加载更多
- onreachBottom() {
- console.log(this.list.length, this.total)
- if(this.list.length < this.total){
- this.pageNo += 1
- this.getRow()
- }else{
- this.status = "nomore"
- }
- },
- // 设为负责人
- 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: "请选择员工"
- })
- }
- },
- }
- }
- </script>
- <style lang="less">
- .page-body{
- height: 100vh;
- padding:0;
- .scroll-list{
- flex-grow: 1;
- .check-order-list{
- padding: 10upx 20upx;
- u-radio{
- > view{
- background: #ffffff;
- border-radius: 20upx;
- box-shadow: 1px 1px 3px #EEEEEE;
- margin: 10rpx 0;
- padding: 20rpx;
- >view:last-child{
- flex-grow: 1;
- }
- }
- }
- }
- }
- .footer{
- padding: 0.6rem;
- background: #ffffff;
- u-button{
- width: 45%;
- margin: 0 2%;
- }
- }
- }
- </style>
|