tihuanren.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view style="background-color: #fff;padding-bottom: 110rpx;">
  3. <u-radio-group v-model="checkboxValue1" placement="column" iconPlacement="right" @change="checkboxChange">
  4. <u-collapse accordion @open="open">
  5. <u-collapse-item v-for="item in arrChushi" :title="item" :name="item" :key="item">
  6. <view style="color: #2979ff;">
  7. <view v-for=" i in chushiList" :key="i[0].deptName" v-if="item == i[0].deptName">
  8. <view class="checkitem" v-for="v in i" :key="v.userName">
  9. <u-radio shape='square' :label="v.userName" :name="v.nickName" size="24"
  10. @change="change2(v)">
  11. </u-radio>
  12. </view>
  13. </view>
  14. </view>
  15. </u-collapse-item>
  16. </u-collapse>
  17. </u-radio-group>
  18. <view
  19. style="position: fixed;bottom: 0;left: 0;width: 100%;height: 100rpx;background-color: #fff;box-sizing: border-box;padding: 20rpx;">
  20. <u-button type="primary" text="确认" @click="submit"></u-button>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. chushiList: {},
  29. arrChushi: {},
  30. checkboxValue1: [],
  31. userList: [],
  32. deptList: [],
  33. allUserList: [],
  34. nameList: '',
  35. idList: ''
  36. }
  37. },
  38. onLoad(options) {
  39. this.getchishi()
  40. },
  41. onNavigationBarButtonTap(e) {
  42. },
  43. methods: {
  44. //获取下一节点接收人信息
  45. getchishi() {
  46. let deptId = null
  47. uni.$u.http.get(`/system/user/getNormalUserDept/` + deptId).then((res) => {
  48. console.log('res', res.data)
  49. this.chushiList = {
  50. ...res.data
  51. }
  52. this.arrChushi = {
  53. ...Object.keys(this.chushiList)
  54. }
  55. console.log(this.arrChushi)
  56. })
  57. },
  58. //选择人员
  59. checkboxChange(e) {
  60. // console.log(e)
  61. },
  62. //折叠面板打开
  63. open(e) {
  64. // console.log(e)
  65. },
  66. change2(e) {
  67. console.log(e)
  68. // if (this.nameList.indexOf(e.deptName + '--' + e.userName) == -1) {
  69. // this.nameList.push(e.deptName + '--' + e.userName)
  70. // } else {
  71. // this.nameList.splice(this.nameList.indexOf(e.deptName + '--' + e.userName), 1)
  72. // }
  73. this.nameList = e.deptName + '--' + e.userName
  74. this.idList = e.userId
  75. console.log(this.nameList)
  76. },
  77. submit() {
  78. if (this.checkboxValue1.length == 0) {
  79. uni.showToast({
  80. title: "请选择人员",
  81. icon: "none"
  82. })
  83. } else {
  84. // getApp().globalData.peoList = this.nameList.join(",")
  85. // getApp().globalData.peoIdList = this.checkboxValue1.join(",")
  86. // getApp().globalData.peoDeptList = this.idList.join(",")
  87. getApp().globalData.tihuanList = this.nameList
  88. getApp().globalData.thList = this.idList
  89. // getApp().globalData.nickNameList = this.idList.join(",")
  90. uni.$emit('query', {
  91. a: 'three'
  92. })
  93. uni.navigateBack()
  94. }
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .checkitem {
  101. // display: flex;
  102. // align-items: center;
  103. // justify-content: space-between;
  104. font-size: 32rpx;
  105. padding: 20rpx 0;
  106. border-bottom: 1px solid #eaeaea;
  107. }
  108. ::v-deep .u-collapse-item__content__text {
  109. background-color: #f7f7f7;
  110. }
  111. ::v-deep .u-cell__title-text {
  112. font-size: 32rpx;
  113. }
  114. </style>