servicepersoncheckorderlist.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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-list>
  19. <uni-list-item v-for="item in list" :key="item.id">
  20. <template v-slot:body>
  21. <view class="list-item-block">
  22. <view class="items-line">
  23. <image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
  24. src="/static/images/list/order_item.png" mode="widthFix">
  25. </image>
  26. <text class="item-title-rtu-name">{{item.rtuName}}</text>
  27. <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
  28. </view>
  29. <view class="items-line">
  30. <uni-icons class="input-uni-icon" type="loop" size="18" color="lightblue" />
  31. <text class="item-text-lable">维修状态:</text>
  32. <text v-if="item.orderStatus==1" class="item-text-content"
  33. style="color: red;">等待确认</text>
  34. <text v-if="item.orderStatus==2" class="item-text-content"
  35. style="color: orange;">处理中</text>
  36. <text v-if="item.orderStatus==3" class="item-text-content"
  37. style="color: blue;">已处理</text>
  38. <text v-if="item.orderStatus==4" class="item-text-content"
  39. style="color: green;">已完成</text>
  40. </view>
  41. <view class="items-line">
  42. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  43. <text class="item-text-lable">维修时长:</text>
  44. <text class="item-text-content" style="color: red;">{{item.taskProcessDuration}}</text>
  45. </view>
  46. <view class="items-line">
  47. <uni-icons class="input-uni-icon" type="location" size="18" color="lightblue" />
  48. <text class="item-text-lable">行政区划:</text>
  49. <text class="item-text-content">{{item.areaName}}</text>
  50. </view>
  51. <view class="items-line">
  52. <uni-icons class="input-uni-icon" type="person" size="18" color="lightblue" />
  53. <text class="item-text-lable">处理人:</text>
  54. <text class="item-text-content">{{item.contactUserName}}</text>
  55. </view>
  56. <view class="items-line">
  57. <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
  58. <text class="item-text-lable">联系电话:</text>
  59. <view v-if="item.contactPhone != null"
  60. @click="call(item.contactPhone)">
  61. <text class="item-text-content-phone">{{item.contactPhone}}</text>
  62. </view>
  63. </view>
  64. <view v-if="item.orderStatus==3" class="item-button-group">
  65. <view class="item-button" style="background-color:lightblue"
  66. @click="onOrderReportItemClick(item.id)">
  67. <view class="items-line">
  68. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  69. <text class="button-text">维修详情</text>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. </uni-list-item>
  76. </uni-list>
  77. <uni-group>
  78. <view class="pagination-block">
  79. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  80. @change="pageChange" />
  81. </view>
  82. </uni-group>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import {
  88. role
  89. } from "@/api/role.js";
  90. import http from '@/http/api.js';
  91. export default {
  92. components: {},
  93. onLoad(option) {
  94. if (this.userInfo.role_name === role['admin']) {
  95. this.permission.admin = true;
  96. } else if (this.userInfo.role_name === role['orgAdmin']) {
  97. this.permission.orgAdmin = true;
  98. } else if (this.userInfo.role_name === role['companyAdmin']) {
  99. this.permission.companyAdmin = true;
  100. } else if (this.userInfo.role_name === role['companyServciePerson']) {
  101. this.permission.companyServciePerson = true;
  102. }
  103. this.type = option.type;
  104. if (this.type == '1') {
  105. this.query['orderClose'] = 0;
  106. this.title = "全部维修任务信息";
  107. } else if (this.type == '2') {
  108. this.query['orderStatus'] = 2;
  109. this.query['orderClose'] = 0;
  110. this.title = "处理中维修任务信息";
  111. } else if (this.type == '3') {
  112. this.query['orderStatus'] = 3;
  113. this.query['orderClose'] = 0;
  114. this.title = "已处理维修任务信息";
  115. }
  116. let userId = option.userId;
  117. if (userId) {
  118. this.query['servicePersonId'] = userId;
  119. }
  120. this.pageCurrent = 1;
  121. this.getPage()
  122. },
  123. data() {
  124. return {
  125. title: '维修任务信息',
  126. permission: {
  127. 'admin': false,
  128. 'orgAdmin': false,
  129. 'companyAdmin': false,
  130. 'companyServciePerson': false,
  131. },
  132. type: '',
  133. pageSize: 10,
  134. pageCurrent: 1,
  135. total: 0,
  136. list: [],
  137. query: {},
  138. inputStyles: {
  139. color: '#808080',
  140. borderColor: '#d3d3d3'
  141. }
  142. }
  143. },
  144. computed: {},
  145. onShow() {},
  146. methods: {
  147. //返回上一页
  148. toBack() {
  149. uni.navigateBack({
  150. delta: 1
  151. })
  152. },
  153. onBackPress() {
  154. // #ifdef APP-PLUS
  155. plus.key.hideSoftKeybord();
  156. // #endif
  157. },
  158. // 分页触发
  159. pageChange(e) {
  160. this.pageCurrent = e.current;
  161. this.getPage()
  162. },
  163. call(phone) {
  164. console.log(phone)
  165. uni.showModal({
  166. content: '是否需要拨打[' + phone + ']?',
  167. showCancel: true,
  168. success(res) {
  169. if (res.confirm) {
  170. uni.makePhoneCall({
  171. phoneNumber: phone
  172. });
  173. }
  174. }
  175. });
  176. },
  177. onDetailViewClick(id) {
  178. let url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
  179. uni.navigateTo({
  180. url: url
  181. })
  182. },
  183. onOrderReportItemClick(id) {
  184. console.log("opne record ", id)
  185. var url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
  186. uni.navigateTo({
  187. url: url
  188. })
  189. },
  190. onLocationClick(item) {
  191. let lat = item.lat;
  192. let lng = item.lng;
  193. let name = item.rtuName;
  194. let add = item.locationDesc;
  195. uni.openLocation({
  196. latitude: Number(lat),
  197. longitude: Number(lng),
  198. name: name,
  199. address: "",
  200. success() {}
  201. })
  202. },
  203. onManuallyCloseOrderClick(id) {
  204. uni.navigateTo({
  205. url: '/pages/check-order/manuallyclosecheckorder?id=' + id
  206. })
  207. },
  208. onComfireCheckOrderClick(id) {
  209. let url =
  210. '/pages/check-order/orderconfirm?id=' + id;
  211. uni.navigateTo({
  212. url: url
  213. })
  214. },
  215. getPage(params = {}) {
  216. const current = this.pageCurrent;
  217. const size = this.pageSize;
  218. let postData = Object.assign(params, this.query);
  219. let that = this;
  220. http.request({
  221. url: '/galaxy-business/rtu/check/order/page',
  222. method: 'GET',
  223. params: {
  224. current,
  225. size,
  226. },
  227. data: postData,
  228. }).then(res => {
  229. if (res.data.records != null) {
  230. that.list = res.data.records;
  231. }
  232. this.total = res.data.total;
  233. }).catch(err => {
  234. console.log(err)
  235. })
  236. },
  237. }
  238. }
  239. </script>
  240. <style lang="scss" scoped>
  241. </style>