servicepersoncheckorderlist.vue 7.3 KB

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