123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <template>
- <view style="background-color: #fff;padding-bottom: 110rpx;">
- <u-radio-group v-model="checkboxValue1" placement="column" iconPlacement="right" @change="checkboxChange">
- <u-collapse accordion @open="open">
- <u-collapse-item v-for="item in arrChushi" :title="item" :name="item" :key="item">
- <view style="color: #2979ff;">
- <view v-for=" i in chushiList" :key="i[0].deptName" v-if="item == i[0].deptName">
- <view class="checkitem" v-for="v in i" :key="v.userName">
- <u-radio shape='square' :label="v.userName" :name="v.nickName" size="24"
- @change="change2(v)">
- </u-radio>
- </view>
- </view>
- </view>
- </u-collapse-item>
- </u-collapse>
- </u-radio-group>
- <view
- style="position: fixed;bottom: 0;left: 0;width: 100%;height: 100rpx;background-color: #fff;box-sizing: border-box;padding: 20rpx;">
- <u-button type="primary" text="确认" @click="submit"></u-button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- chushiList: {},
- arrChushi: {},
- checkboxValue1: [],
- userList: [],
- deptList: [],
- allUserList: [],
- nameList: '',
- idList: ''
- }
- },
- onLoad(options) {
- this.getchishi()
- },
- onNavigationBarButtonTap(e) {
- },
- methods: {
- //获取下一节点接收人信息
- getchishi() {
- let deptId = null
- uni.$u.http.get(`/system/user/getNormalUserDept/` + deptId).then((res) => {
- console.log('res', res.data)
- this.chushiList = {
- ...res.data
- }
- this.arrChushi = {
- ...Object.keys(this.chushiList)
- }
- console.log(this.arrChushi)
- })
- },
- //选择人员
- checkboxChange(e) {
- // console.log(e)
- },
- //折叠面板打开
- open(e) {
- // console.log(e)
- },
- change2(e) {
- console.log(e)
- // if (this.nameList.indexOf(e.deptName + '--' + e.userName) == -1) {
- // this.nameList.push(e.deptName + '--' + e.userName)
- // } else {
- // this.nameList.splice(this.nameList.indexOf(e.deptName + '--' + e.userName), 1)
- // }
- this.nameList = e.deptName + '--' + e.userName
- this.idList = e.userId
- console.log(this.nameList)
- },
- submit() {
- if (this.checkboxValue1.length == 0) {
- uni.showToast({
- title: "请选择人员",
- icon: "none"
- })
- } else {
- // getApp().globalData.peoList = this.nameList.join(",")
- // getApp().globalData.peoIdList = this.checkboxValue1.join(",")
- // getApp().globalData.peoDeptList = this.idList.join(",")
- getApp().globalData.tihuanList = this.nameList
- getApp().globalData.thList = this.idList
- // getApp().globalData.nickNameList = this.idList.join(",")
- uni.$emit('query', {
- a: 'three'
- })
- uni.navigateBack()
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .checkitem {
- // display: flex;
- // align-items: center;
- // justify-content: space-between;
- font-size: 32rpx;
- padding: 20rpx 0;
- border-bottom: 1px solid #eaeaea;
- }
- ::v-deep .u-collapse-item__content__text {
- background-color: #f7f7f7;
- }
- ::v-deep .u-cell__title-text {
- font-size: 32rpx;
- }
- </style>
|