123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <view class="dialog_mask" @touchmove.stop.prevent="moveStop" @click="clearMask">
- <scroll-view class="mask_container" scroll-y="true" :class="bg_type=='dark'?'dialog_dark_mask':''" @click.stop="moveStop">
- <view :class="['userFilterItem',staffInfo.id == 0 ? 'active':'']" @click="changeUser('all')">全部</view>
- <view :class="['userFilterItem',staffInfo.id == item.id ? 'active':'']" v-for="(item,index) in staffList" :key="index+'staffList'" @click="changeUser(index)">{{item.real_name}}</view>
- </scroll-view>
- </view>
- </template>
-
- <script>
- // 工作人员筛选
- export default {
- name: "user-filter",
- props:['staffInfo','bg_type'],
- data() {
- return {
- staffList:[]
- };
- },
- mounted() {
- // if(this.$store.state.staffList&&this.$store.state.staffList.length!=0){
- // this.staffList= this.$store.state.staffList
- // }else{
- this.get_staffList()
- // }
- },
- methods: {
- clearMask(){
- this.$emit('clearMask')
- },
- changeUser(val){
- let data = val
- if(val=='all'){
- data = {name:'全部',id:0}
- }else{
- data = this.staffList[val]
- }
- this.$emit('changeUser',data)
- },
- moveStop() {},
- get_staffList() {//工作人员
- uni.showLoading({title: '加载中'});
- this.$req(this.$api.userListForFilter, 'get', {}, (res) => {
- uni.hideLoading()
- if (res && res.errno == 0) {
- this.$store.state.staffList = res.rst;
- this.staffList = res.rst;
- } else if (res.errno != 4002) {
- this.$message({
- message: res.err,
- type: "warning"
- })
- }
- }, (err) => {
- uni.hideLoading()
- })
-
- },
-
- }
- }
- </script>
-
- <style scoped lang="scss">
- .dialog_mask {
- width: 100%;
- height: 100%;
- position: absolute;
- left: 0;
- background: rgba(0, 0, 0, 0.5);
- z-index: 3;
- }
-
- .mask_container {
- width: 100%;
- padding: 10rpx;
- background: #FFFFFF;
- overflow-y: auto;
- display: flex;
- align-items: flex-start;
- flex-wrap: wrap;
- max-height: 60vh;
- .userFilterItem{
- background: #F8F7FC;
- border: 2rpx solid #F8F7FC;
- font-size: 24rpx;
- line-height: 44rpx;
- height: 48rpx;
- margin: 15rpx;
- padding: 0 10rpx;
- border-radius: 8rpx;
- display: inline-block;
- color: #555555;
- &.active{
- color: #5B80F4;
- background: #FFFFFF;
- border-color: #5B80F4;
- }
- }
- }
- .dialog_dark_mask{
- background: #3D4453;
- .userFilterItem{
- background: #464D5B;
- color: #FFFFFF;
- border-color: #464D5B;
- &.active{
- color: #5B80F4;
- background: #3D4453;
- border-color: #5B80F4;
- }
- }
- }
- </style>
|