peoChoose.vue 3.6 KB

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