|
@@ -0,0 +1,141 @@
|
|
|
|
+<template>
|
|
|
|
+ <view class="page-body scroll-list">
|
|
|
|
+ <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
|
|
|
|
+ <view style="height: 20rpx;" ></view>
|
|
|
|
+ <view
|
|
|
|
+ class="check-order-list"
|
|
|
|
+ v-for="(item,index) in list"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ >
|
|
|
|
+ <view class="flex align_center justify_between" @click="editPerson(item)">
|
|
|
|
+ <view class="u-name">
|
|
|
|
+ <text style="margin-right: 0.5rem;">{{item.name}}</text>
|
|
|
|
+ <u-icon :name="item.sex==1?'man':'woman'" size="28" :color="item.sex==1?'#00aaff':'#ffaaaa'"></u-icon>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="u-mobile">
|
|
|
|
+ <text v-if="item.isManager == 1">门店负责人\ </text>
|
|
|
|
+ <text v-if="item.isManager == 0 && item.roleNames">{{item.roleNames}} / </text>
|
|
|
|
+ {{item.mobile}}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="set-item flex align_center justify_between">
|
|
|
|
+ 商城是否显示:
|
|
|
|
+ <u-radio-group @change="e=>changeShow(e,item)" v-model="item.show" :width="150">
|
|
|
|
+ <u-radio :name="1">是</u-radio>
|
|
|
|
+ <u-radio :name="0">否</u-radio>
|
|
|
|
+ </u-radio-group>
|
|
|
|
+ </view>
|
|
|
|
+ </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>
|
|
|
|
+ </view>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import {searchEmployee, delEmployee } from '@/api/employee'
|
|
|
|
+ import moment from 'moment'
|
|
|
|
+ export default{
|
|
|
|
+ name:'personnel',
|
|
|
|
+ data(){
|
|
|
|
+ return{
|
|
|
|
+ status: 'loading',
|
|
|
|
+ noDataText: '暂无数据',
|
|
|
|
+ // 查询条件
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 20,
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onShow() {
|
|
|
|
+ this.getRow(1)
|
|
|
|
+ },
|
|
|
|
+ computed:{
|
|
|
|
+ userInfo(){
|
|
|
|
+ return this.$store.state.vuex_userInfo
|
|
|
|
+ },
|
|
|
|
+ hasOnlyAdmin(){
|
|
|
|
+ return this.list.length ==1 && this.list[0].isManager == 1 || this.list.length == 0
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods:{
|
|
|
|
+ // 查询列表
|
|
|
|
+ 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) {
|
|
|
|
+ const list = res.data.list || []
|
|
|
|
+ list.forEach(item=>{
|
|
|
|
+ item.show = 0
|
|
|
|
+ })
|
|
|
|
+ if(_this.pageNo>1){
|
|
|
|
+ _this.list = _this.list.concat(list)
|
|
|
|
+ }else{
|
|
|
|
+ _this.list = 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() {
|
|
|
|
+ if(this.list.length < this.total){
|
|
|
|
+ this.pageNo += 1
|
|
|
|
+ this.getRow()
|
|
|
|
+ }else{
|
|
|
|
+ this.status = "nomore"
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ changeShow(e,item){
|
|
|
|
+ console.log(e,item)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less">
|
|
|
|
+ .page-body{
|
|
|
|
+ height: 100vh;
|
|
|
|
+ padding:0;
|
|
|
|
+ }
|
|
|
|
+ .scroll-list{
|
|
|
|
+ .check-order-list{
|
|
|
|
+ background: #ffffff;
|
|
|
|
+ padding: 10upx 20upx;
|
|
|
|
+ margin: 0 25rpx 25rpx 25rpx;
|
|
|
|
+ border-radius: 20upx;
|
|
|
|
+ box-shadow: 1px 1px 3px #EEEEEE;
|
|
|
|
+ > view{
|
|
|
|
+ padding: 0.5rem;
|
|
|
|
+ .u-name{
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
+ }
|
|
|
|
+ .u-mobile{
|
|
|
|
+ color: #666;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .set-item {
|
|
|
|
+ /deep/ .u-radio__label{
|
|
|
|
+ flex: 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|