addppeople.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view style="height: 100vh;" class=" ccc u-p-l-30 u-p-r-30 u-p-t-28 u-relative">
  3. <c-search @serbtn="serbtn()" />
  4. <view class="m-w u-m-t-34 ">
  5. <view class="m-w">
  6. <scroll-view class="m-w u-m-t-35 addscheight" :scroll-y="true">
  7. <block v-for="(item,index) in list" :key="index">
  8. <label @click="reove(item)" class="u-flex u-p-b-32 u-m-b-32 "
  9. style="border-bottom: 1px solid #E6E6E6;">
  10. <u-checkbox class="che" @click="reove(item)" :disabled="false" v-model="item.boll">
  11. {{item.name}}
  12. </u-checkbox>
  13. </label>
  14. </block>
  15. </scroll-view>
  16. <view @click="sumit" class="submit">确定</view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import cSearch from '@/components/c-search/index.vue'
  23. import {
  24. syslist2
  25. } from '@/api/index.js'
  26. export default {
  27. components: {
  28. cSearch
  29. },
  30. data() {
  31. return {
  32. list: [],
  33. querform: {
  34. keyword: "",
  35. page: 1,
  36. size: 50,
  37. }
  38. }
  39. },
  40. onLoad() {
  41. this.init()
  42. },
  43. methods: {
  44. init() {
  45. syslist2(this.querform)
  46. .then(({
  47. data
  48. }) => {
  49. this.list = []
  50. data.list.forEach(Element => {
  51. this.list.push({
  52. boll: false,
  53. id: Element.id,
  54. name: Element.name
  55. })
  56. })
  57. })
  58. },
  59. reove(row) {
  60. row.boll = !row.boll
  61. },
  62. sumit() {
  63. let arr = [];
  64. this.list.forEach(Element => {
  65. if (Element.boll) {
  66. arr.push(
  67. {
  68. execUserId: Element.id,
  69. execUserName: Element.name
  70. }
  71. )
  72. }
  73. })
  74. this.$store.state.user.people = arr;
  75. uni.navigateBack(1)
  76. },
  77. serbtn({
  78. text
  79. }) {
  80. if (text == 10000000000) {
  81. this.querform.keyword = ""
  82. } else {
  83. this.querform.keyword = text
  84. }
  85. this.$nextTick(() => {
  86. this.init()
  87. })
  88. },
  89. }
  90. }
  91. </script>
  92. <style scoped lang="scss">
  93. .title-back {
  94. width: 10rpx;
  95. height: 38rpx;
  96. background: #4A8BFF;
  97. }
  98. .addscheight {
  99. height: calc(100vh - 315rpx);
  100. }
  101. .che {
  102. width: 100%;
  103. }
  104. .submit {
  105. width: 690rpx;
  106. height: 90rpx;
  107. background: #4A8BFF;
  108. border-radius: 4rpx;
  109. font-size: 28rpx;
  110. line-height: 90rpx;
  111. text-align: center;
  112. font-family: Microsoft YaHei-3970(82674968);
  113. font-weight: bold;
  114. color: #FFFFFF;
  115. margin-top: 50rpx;
  116. }
  117. </style>