123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586 |
- <template>
- <view class="drawer-content">
- <!--右抽屉-->
- <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
- <view
- class="drawer-container clearfix"
- scroll-y
- :style="{ paddingTop: '0px', paddingBottom: isIphoneX ? '180rpx' : '146rpx' }"
- >
- <scroll-view class="tui-drawer-scroll" scroll-y :style="{ height: drawerH + 'px' }">
- <view class="drawer-title">更多筛选</view>
- <view class="drawer-main">
- <view class="drawer-main-name">日期</view>
- <view class="drawer-main-time">
- <view class="drawer-main-time-input">
- <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindStartDateChange">
- <text class="input-text">{{ queryData.startAddTime }}</text>
- </picker>
- <text class="iconfont icon-riqi"></text>
- </view>
- <view class="line">-</view>
- <view class="drawer-main-time-input">
- <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindEndDateChange">
- <text class="input-text">{{ queryData.endAddTime }}</text>
- </picker>
- <text class="iconfont icon-riqi"></text>
- </view>
- </view>
- <view class="drawer-main-name">咨询类别</view>
- <view class="drawer-main-brand clearfix">
- <view
- class="drawer-brand-list"
- :class="category.isChecked ? 'checked' : ''"
- v-for="(category, index) in categorys"
- :key="index"
- @click="choiceCategorys(category, index)"
- >
- {{ category.className }}
- </view>
- </view>
- <template v-if="manager > 0">
- <view class="drawer-main-name">小组</view>
- <view class="drawer-main-brand clearfix">
- <view
- class="drawer-brand-list"
- :class="isCheckedGroups ? 'checked' : ''"
- @click="choiceGroupsAll"
- >全部</view
- >
- <view
- class="drawer-brand-list"
- :class="group.isChecked ? 'checked' : ''"
- v-for="(group, index) in groups"
- :key="index"
- @click="choiceGroups(group, index)"
- >
- {{ group.leaderName }}
- </view>
- </view>
- </template>
- <template v-if="manager>0 || leaderId>0">
- <view class="drawer-main-name" v-if="members.length>0">组员</view>
- <view class="drawer-main-brand clearfix" v-if="members.length>0">
- <view
- class="drawer-brand-list"
- :class="member.isChecked ? 'checked' : ''"
- v-for="(member, index) in members"
- :key="index"
- @click="choiceMembers(member, index)"
- >
- {{ member.groupName }}
- </view>
- </view>
- </template>
- <view class="drawer-main-name">价格敏感度:</view>
- <view class="drawer-main-radiov">
- <view class="drawer-main-radio">
- <picker @change="bindPickerChange(1,$event)" :value="index" :range="priceActions" range-key="name">
- <input class="input" type="text" disabled="false" v-model="priceFlagText" value="" placeholder="请选择"/>
- <text class="iconfont icon-xiangyou"></text>
- </picker>
- </view>
- </view>
- <view class="drawer-main-name">意向程度:</view>
- <view class="drawer-main-radiov">
- <view class="drawer-main-radio">
- <picker @change="bindPickerChange(2,$event)" :value="index" :range="intenActions" range-key="name">
- <input class="input" type="text" disabled="false" v-model="intenFlagText" value="" placeholder="请选择"/>
- <text class="iconfont icon-xiangyou"></text>
- </picker>
- </view>
- </view>
- <view class="drawer-main-name">跟进状态:</view>
- <view class="drawer-main-radiov">
- <view class="drawer-main-radio">
- <picker @change="bindPickerChange(3,$event)" :value="index" :range="stateActions" range-key="name">
- <input class="input" type="text" disabled="false" v-model="followStateText" value="" placeholder="请选择"/>
- <text class="iconfont icon-xiangyou"></text>
- </picker>
- </view>
- </view>
- <view class="drawer-main-name">报备状态:</view>
- <view class="drawer-main-radiov">
- <view class="drawer-main-radio">
- <picker @change="bindPickerChange(4,$event)" :value="index" :range="reportActions" range-key="name">
- <input class="input" type="text" disabled="false" v-model="reportText" value="" placeholder="请选择"/>
- <text class="iconfont icon-xiangyou"></text>
- </picker>
- </view>
- </view>
- <template v-if="popupType === 1">
- <view class="drawer-main-name">新增分配机构:</view>
- <view class="drawer-main-radiov">
- <view class="drawer-main-radio">
- <picker @change="bindPickerChange(5,$event)" :value="index" :range="clubActions" range-key="name">
- <input class="input" type="text" disabled="false" v-model="clubStateText" value="" placeholder="请选择"/>
- <text class="iconfont icon-xiangyou"></text>
- </picker>
- </view>
- </view>
- </template>
- </view>
- </scroll-view>
- <view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
- <view class="drawer-btn clear" @click="closeDrawer">取消</view>
- <view class="drawer-btn comfrim" @click="handSearchConfirm">确定</view>
- </view>
- </view>
- </tui-drawer>
- </view>
- </template>
- <script>
- export default {
- name: 'rightDrawer',
- props: {
- rightDrawer: {
- type: Boolean,
- default: false
- },
- popupType:{
- type:Number,
- },
- },
- data() {
- const currentDate = this.getDate({
- format: true
- })
- return {
- CustomBar: this.CustomBar, // 顶部导航栏高度
- isIphoneX: this.$store.state.isIphoneX,
- isCheckedGroups:false,
- checkedIndex: 0,
- checkedGroupsIndex: 0,
- checkedMemberIndex: 0,
- isShowClose: false,
- dataList: [],
- date: currentDate,
- manager:0,
- leaderId:0,
- height: 0,
- drawerH: 0 ,// 抽屉内部scrollview高度
- categorys:[],
- checkedCategorysList:[],
- groups:[],
- members:[],
- reportText:'',
- priceFlagText:'',
- intenFlagText:'',
- followStateText:'',
- clubStateText:'',
- queryData:{
- startAddTime:'',
- endAddTime:'',
- consult:'',
- leaderId:0,
- groupId:0,
- pinceSensitve:0,//价格敏感度
- satisfied:0,// 意向程度
- followup:0,// 跟进状态
- },
- priceActions:[
- {name:'全部',value:0},
- {name:'敏感',value:1},
- {name: '适中',value:2},
- {name: '不敏感',value:3},
- {name: '不明确',value:4}
- ],
- intenActions:[
- {name:'全部',value:0},
- {name:'意向强烈',value:1},
- {name: '意向一般',value:2},
- {name: '意向平淡',value:3},
- {name: '随便看看',value:4}
- ],
- stateActions:[
- {name:'全部',value:0},
- {name:'跟进中',value:1},
- {name: '跟进完成',value:2},
- {name: '已放弃',value:3},
- ],
- reportActions:[
- {name:'全部',value:0},
- {name:'待审核',value:1},
- {name: '审核通过',value:2},
- {name: '审核未通过',value:3},
- ],
- clubActions:[
- {name:'全部',value:0},
- {name:'是',value:1},
- {name: '否',value:2},
- ],
- }
- },
- created() {
- this.SetScrollHeight()
- this.getUserClubConsults()
- },
- computed: {
- startDate() {
- return this.getDate('start')
- },
- endDate() {
- return this.getDate('end')
- }
- },
- methods: {
- async getUserClubConsults() {
- const userInfo = await this.$api.getStorage()
- this.manager = userInfo.manager ? userInfo.manager : 0
- this.leaderId = userInfo.leaderId ? userInfo.leaderId : 0
- //查询咨询类别
- this.UserService.getUserClubConsults()
- .then(response => {
- this.categorys = response.data.map((el, index) => {
- el.isChecked = false
- return el
- })
- if(this.manager > 0){
- this.getUserClubTeams()
- }
- if(this.leaderId > 0){
- this.getUserClubTeamsRroups(this.leaderId)
- }
- })
- .catch(error => {
- console.log('=========>获取咨询类别列表失败')
- })
- },
- getUserClubTeams() {
- this.UserService.getUserClubTeams()
- .then(response => {
- this.groups = response.data.map((el, index) => {
- el.isChecked = false
- return el
- })
- })
- .catch(error => {
- console.log('=========>获取小组列表失败')
- })
- },
- getUserClubTeamsRroups(leaderId) {
- this.UserService.getUserClubTeamsRroups({leaderId:leaderId})
- .then(response => {
- this.members = response.data.map((el, index) => {
- el.isChecked = false
- return el
- })
- })
- .catch(error => {
- console.log('=========>获取咨询类别列表失败')
- })
- },
- choiceCategorys(category,idx){
- //选择分类
- category.isChecked = !category.isChecked
- if (category.isChecked) {
- if(!this.contains(this.checkedCategorysList,category.id)){
- this.checkedCategorysList.push(category.id)
- }
- } else {
- this.checkedCategorysList.splice(this.checkedCategorysList.indexOf(category.id),1)
- }
- this.queryData.consult = this.checkedCategorysList.join(',')
- },
- contains(arr, val) {// 校验
- return arr.some(item => item === val)
- },
- choiceGroupsAll() {
- // 点击选择全部小组
- this.isCheckedGroups = true
- this.queryData.leaderId = ''
- this.groups.forEach(el => {
- el.isChecked = false
- })
- },
- choiceGroups(group,idx){
- //选择小组
- this.isCheckedGroups = false
- this.checkedGroupsIndex = idx
- this.groups.forEach((el, index) => {
- if (this.checkedGroupsIndex == index) {
- el.isChecked = true
- this.queryData.leaderId = group.leaderId
- this.getUserClubTeamsRroups(group.leaderId)
- } else {
- el.isChecked = false
- }
- })
- },
- choiceMembers(member, idx) {
- //选择组员
- this.checkedMemberIndex = idx
- this.members.forEach((el, index) => {
- if (this.checkedMemberIndex == index) {
- el.isChecked = true
- this.queryData.groupId = member.groupId
- } else {
- el.isChecked = false
- }
- })
- },
- bindPickerChange(type,e) {//选择筛选条件
- switch(type){
- case 1:
- this.priceFlagText = this.priceActions[e.target.value].name
- this.queryData.pinceSensitve = this.priceActions[e.target.value].value
- break
- case 2:
- this.intenFlagText = this.intenActions[e.target.value].name
- this.queryData.satisfied = this.intenActions[e.target.value].value
- break
- case 3:
- this.followStateText = this.stateActions[e.target.value].name
- this.queryData.followup = this.stateActions[e.target.value].value
- break
- case 4:
- this.reportText = this.reportActions[e.target.value].name
- this.queryData.status = this.reportActions[e.target.value].value
- break
- case 5:
- this.clubStateText = this.clubActions[e.target.value].name
- this.queryData.newDeal = this.clubActions[e.target.value].value
- break
- }
- },
- closeDrawer(){
- this.$parent.isScreenDrawer = false
- },
- handSearchConfirm(){
- //确定筛选
- this.$emit('handSearchConfirm', this.queryData)
- this.$parent.isScreenDrawer = false
- },
- bindStartDateChange(event){
- //开始时间
- console.log('开始时间==>',event.detail.value)
- this.queryData.startAddTime = event.detail.value
- },
- bindEndDateChange(event){
- //结束时间
- console.log('结束时间==>',event.detail.value)
- this.queryData.endAddTime = event.detail.value
- },
- SetScrollHeight() {
- let obj = {}
- const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
- uni.getSystemInfo({
- success: res => {
- this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
- this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
- }
- })
- this.windowHeight = windowHeight - 1
- this.scrollHeight = windowHeight - 1
- },
- getDate(type) {
- const date = new Date()
- let year = date.getFullYear()
- let month = date.getMonth() + 1
- let day = date.getDate()
- if (type === 'start') {
- year = year - 1
- } else if (type === 'end') {
- year = year + 1
- }
- month = month > 9 ? month : '0' + month
- day = day > 9 ? day : '0' + day
- return `${year}-${month}-${day}`
- }
- }
- }
- </script>
- <style lang="scss">
- /*screen*/
- .drawer-container {
- width: 580rpx;
- height: 100%;
- padding: 80rpx 0;
- overflow: hidden;
- box-sizing: border-box;
- background-color: #FFFFFF;
- .drawer-title {
- width: 100%;
- height: 72rpx;
- line-height: 72rpx;
- box-sizing: border-box;
- padding: 0 30rpx;
- float: left;
- background-color: #f7f7f7;
- font-size: $font-size-26;
- color: #333333;
- font-weight: bold;
- text-align: left;
- }
- .drawer-main {
- width: 100%;
- height: auto;
- box-sizing: border-box;
- float: left;
- .drawer-main-name{
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- text-align: left;
- font-size: $font-size-26;
- color: #333333;
- box-sizing: border-box;
- padding: 0 20rpx;
- font-weight: bold;
- }
- .drawer-main-time{
- width: 100%;
- height: 56rpx;
- box-sizing: border-box;
- .line{
- color: #999999;
- float: left;
- line-height: 56rpx;
- }
- .drawer-main-time-input{
- width: 228rpx;
- height: 56rpx;
- background: #F7F7F7;
- border-radius: 28rpx;
- box-sizing: border-box;
- padding: 0 20rpx;
- line-height: 56rpx;
- float: left;
- margin: 0 20rpx;
- position: relative;
- .input-text{
- display: block;
- height: 56rpx;
- font-size: 26rpx;
- color: #666666;
- }
- .icon-riqi{
- color: #E15616;
- display: block;
- width: 40rpx;
- height: 56rpx;
- position: absolute;
- right: 10rpx;
- top: 0;
- line-height: 56rpx;
- }
- }
- }
- .drawer-main-brand {
- width: 100%;
- height: auto;
- box-sizing: border-box;
- padding: 0 20rpx;
- background-color: #ffffff;
- .drawer-brand-list {
- width: 160rpx;
- height: 56rpx;
- line-height: 56rpx;
- text-align: center;
- font-size: 26rpx;
- background-color: #f7f7f7;
- color: #999999;
- border-radius: 30rpx;
- box-sizing: border-box;
- padding: 0 15rpx;
- float: left;
- margin: 12rpx 24rpx 12rpx 0;
- text-overflow: ellipsis;
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- line-clamp: 1;
- -webkit-box-orient: vertical;
- &.checked {
- background-color: #fef6f3;
- color: #e15616;
- }
- &:nth-child(3n) {
- margin-right: 0;
- }
- }
- }
- .drawer-main-radiov{
- width: 100%;
- height: auto;
- box-sizing: border-box;
- padding: 0 20rpx;
- .drawer-main-radio{
- width: 100%;
- height: 80rpx;
- box-sizing: border-box;
- padding: 0 10rpx;
- border: 1px solid rgba(0,0,0,0.2);
- border-radius: 6rpx;
- margin-bottom: 30rpx;
- position: relative;
- &.btn{
- border: none;
- margin-top: 40rpx;
- }
- .input{
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- float: left;
- box-sizing: border-box;
- font-size: $font-size-24;
- color: #333333;
- padding: 0 10rpx;
- padding-right: 68rpx;
- }
- .iconfont{
- width: 50rpx;
- height: 80rpx;
- display: block;
- line-height: 80rpx;
- text-align: center;
- font-size: 30rpx;
- color: #999999;
- position: absolute;
- right: 0;
- top: 0;
- }
- }
- }
- }
- .drawer-input {
- width: 100%;
- float: left;
- box-sizing: border-box;
- padding: 24rpx 10rpx 0 10rpx;
- border: 1px solid rgba(0, 0, 0, 0.2);
- border-radius: 4rpx;
- position: relative;
- background-color: #ffffff;
- &.btn {
- border: none;
- display: flex;
- position: fixed;
- left: 0;
- bottom: 0;
- }
- .drawer-btn {
- width: 210rpx;
- height: 84rpx;
- border-radius: 42rpx;
- background: $btn-confirm;
- line-height: 84rpx;
- text-align: center;
- font-size: $font-size-26;
- color: #ffffff;
- flex: 1;
- margin: 0 10rpx;
- &.comfrim {
- background: $btn-confirm;
- }
- &.clear {
- background: #FFE6DC;
- color: $color-system;
- }
- }
- }
- }
- </style>
|