peoChoose.vue 3.2 KB

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