zhuban.vue 3.1 KB

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