taskOwnerSelect.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!--
  2. * @Title:
  3. * @Description: 当前维修任务列表
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="wrap">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <uni-section title="人员信息" type="line">
  19. <uni-list>
  20. <uni-list-item v-for="item in list" :key="item.id" showArrow clickable @click="onClick(item)">
  21. <template v-slot:body>
  22. <view class="list-item-block">
  23. <view class="line">
  24. <text class="title">{{item.personName}}</text>
  25. </view>
  26. <view class="line">
  27. <uni-icons class="input-uni-icon" type="person-filled" size="18"
  28. color="lightblue" />
  29. <text class="text">岗位:{{item.postName}}</text>
  30. </view>
  31. <view class="line">
  32. <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
  33. <text class="text">电话:{{item.contactPhone}}</text>
  34. </view>
  35. </view>
  36. </template>
  37. </uni-list-item>
  38. </uni-list>
  39. <uni-group>
  40. <view class="pagination-block">
  41. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  42. @change="pageChange" />
  43. </view>
  44. </uni-group>
  45. </uni-section>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. role
  52. } from "@/api/role.js";
  53. import http from '@/http/api.js';
  54. export default {
  55. components: {
  56. },
  57. data() {
  58. return {
  59. title: '指定任务负责人',
  60. pageSize: 10,
  61. pageCurrent: 1,
  62. total: 0,
  63. list: [],
  64. query: {},
  65. inputStyles: {
  66. color: '#808080',
  67. borderColor: '#d3d3d3'
  68. },
  69. }
  70. },
  71. computed: {
  72. },
  73. onLoad(option) {
  74. this.pageCurrent = 1;
  75. this.getPage()
  76. },
  77. onShow() {
  78. this.getPage();
  79. },
  80. methods: {
  81. //返回上一页
  82. toBack() {
  83. uni.navigateBack({
  84. delta: 1
  85. })
  86. },
  87. onBackPress() {
  88. // #ifdef APP-PLUS
  89. plus.key.hideSoftKeybord();
  90. // #endif
  91. },
  92. // 分页触发
  93. pageChange(e) {
  94. this.pageCurrent = e.current;
  95. this.getPage()
  96. },
  97. onClick(e) {
  98. console.log('执行click事件', JSON.stringify(e))
  99. let p = {
  100. 'taskOwnerId': e.id,
  101. 'taskOwnerName': e.personName,
  102. };
  103. uni.$emit('taskOwnerInfo', JSON.stringify(p))
  104. this.toBack();
  105. },
  106. getPage(params = {}) {
  107. const current = this.pageCurrent;
  108. const size = this.pageSize;
  109. let postData = Object.assign(params, this.query);
  110. let that = this;
  111. http.request({
  112. url: '/galaxy-business/serviceperson/xjgd/org/user/page',
  113. method: 'GET',
  114. params: {
  115. current,
  116. size,
  117. },
  118. data: postData,
  119. }).then(res => {
  120. if (res.data.records != null) {
  121. that.list = res.data.records;
  122. }
  123. this.total = res.data.total;
  124. }).catch(err => {
  125. console.log(err)
  126. })
  127. },
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. .select-checkbox {
  133. margin-top: 0px;
  134. margin-bottom: 5px;
  135. padding-left: 15px;
  136. }
  137. </style>