| | |
| | | <view class="bg-box"> |
| | | <view class="title">选择随行人员</view> |
| | | <u-search v-model="nickName" @search="enforceList" @clear="clearContent" @confirm="enforceList" @custom="enforceList()"></u-search> |
| | | <scroll-view scroll-y="true" style="height: 600rpx;margin-top: 20rpx;"> |
| | | <scroll-view scroll-y="true" style="height: 500rpx;margin-top: 20rpx; margin-bottom: 100rpx;"> |
| | | <view v-if="checkboxList1.length"> |
| | | <u-checkbox-group iconPlacement="right" v-model="checkboxValue1" placement="column" @change="checkboxChange"> |
| | | <u-checkbox :customStyle="{marginBottom: '40rpx', }" v-for="(item, index) in checkboxList1" :key="index" |
| | |
| | | }, |
| | | methods: { |
| | | clearContent() { |
| | | this.companyName = "" |
| | | this.enforceList() |
| | | this.nickName = "" |
| | | //this.enforceList() |
| | | }, |
| | | checkboxChange(n) { |
| | | // console.log('change', n); |
| | |
| | | }, |
| | | open(list) { |
| | | this.show = true |
| | | this.checkboxValue1 = [] |
| | | this.nickName = "" |
| | | this.checkboxList1 = [] |
| | | this.enforceList() |
| | | }, |
| | | enteryResult() { |
| | |
| | | this.close() |
| | | }, |
| | | enforceList() { |
| | | enforceList({nickName: this.nickName}).then(val => { |
| | | // if(this.nickName==''){ |
| | | // uni.showToast({ |
| | | // title: '请输入关键字搜索', |
| | | // icon: 'none' |
| | | // }) |
| | | // return |
| | | // } |
| | | const value = uni.getStorageSync('userInfo') |
| | | const id = value.deptId |
| | | enforceList({nickName:this.nickName,deptId:id}).then(val => { |
| | | this.checkboxList1 = val.data.data |
| | | }) |
| | | } |
| | |
| | | this.$refs.perpage.open(this.list) |
| | | }, |
| | | selectValue(value) { |
| | | this.form.peers = value |
| | | |
| | | value.forEach(val => { |
| | | this.form.peers.push(val) |
| | | }); |
| | | this.form.peers = this.uniqueArrJson(this.form.peers,'peerId') |
| | | }, |
| | | uniqueArrJson(arr,key) { |
| | | var newobj = {},newArr = []; |
| | | for(var i=0;i<arr.length;i++){ |
| | | var item = arr[i]; |
| | | if(!newobj[item[key]]){ |
| | | newobj[item[key]] = newArr.push(item); |
| | | } |
| | | } |
| | | return newArr; |
| | | } |
| | | } |
| | | } |