rtucheckorderlist.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <!--
  2. * @Title:
  3. * @Description: RTU维修任务列表,包括正在处理和历史的任务
  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/logo_pc.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="list" size="18" color="lightblue" />
  31. <text class="item-text-lable">维修状态:</text>
  32. <text v-if="item.orderStatus==1" class="item-text-content" style="color: red;">等待确认</text>
  33. <text v-if="item.orderStatus==2" class="item-text-content" style="color: orange;">处理中</text>
  34. <text v-if="item.orderStatus==3" class="item-text-content" style="color: blue;">已处理</text>
  35. <text v-if="item.orderStatus==4" class="item-text-content" style="color: green;">已完成</text>
  36. </view>
  37. <view v-if="item.orderStatus==1" class="items-line">
  38. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  39. <text class="item-text-lable">创建时长:</text>
  40. <text class="item-text-content" style="color: red;">{{item.taskCreateDuration}}</text>
  41. </view>
  42. <view v-else 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" style="color: red;">{{item.taskProcessDuration}}</text>
  46. </view>
  47. <view v-if="item.orderStatus==1" class="items-line">
  48. <uni-icons class="input-uni-icon" type="auth" size="18" color="lightblue" />
  49. <text class="item-text-lable">运维公司管理员:</text>
  50. <text class="item-text-content">{{item.manageCompanyAdminName}}</text>
  51. </view>
  52. <view v-else class="items-line">
  53. <uni-icons class="input-uni-icon" type="auth" size="18" color="lightblue" />
  54. <text class="item-text-lable">处理人:</text>
  55. <text class="item-text-content">{{item.contactUserName}}</text>
  56. </view>
  57. <view v-if="item.orderStatus==1" class="items-line">
  58. <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
  59. <text class="item-text-lable">联系电话:</text>
  60. <view v-if="item.manageCompanyAdminPhone != null" @click="call(item.manageCompanyAdminPhone)">
  61. <text class="item-text-content" style="text-decoration-line: underline;">{{item.manageCompanyAdminPhone}}</text>
  62. </view>
  63. </view>
  64. <view v-else class="items-line">
  65. <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
  66. <text class="item-text-lable">联系电话:</text>
  67. <view v-if="item.contactPhone != null" @click="call(item.contactPhone)">
  68. <text class="item-text-content" style="text-decoration-line: underline;">{{item.contactPhone}}</text>
  69. </view>
  70. </view>
  71. <view class="item-button-group">
  72. <view class="item-button"
  73. @click="onDetailViewClick(item.id)">
  74. <view class="items-line">
  75. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  76. <text class="button-text">维修详情</text>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. </uni-list-item>
  83. </uni-list>
  84. <uni-group>
  85. <view class="uni-pagination-box">
  86. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  87. @change="pageChange" />
  88. </view>
  89. </uni-group>
  90. </view>
  91. </view>
  92. </template>
  93. <script>
  94. import {
  95. role
  96. } from "@/api/role.js";
  97. import http from '@/http/api.js';
  98. export default {
  99. components: {
  100. },
  101. onLoad(option) {
  102. this.rtuCode = option.rtuCode;
  103. if (this.userInfo.role_name === role['admin']) {
  104. this.permission.admin = true;
  105. } else if (this.userInfo.role_name === role['orgAdmin']) {
  106. this.permission.orgAdmin = true;
  107. } else if (this.userInfo.role_name === role['companyAdmin']) {
  108. this.permission.companyAdmin = true;
  109. } else if (this.userInfo.role_name === role['companyServciePerson']) {
  110. this.permission.companyServciePerson = true;
  111. }
  112. let params = {};
  113. params['rtuCode'] = this.rtuCode;
  114. this.getPage(params);
  115. },
  116. data() {
  117. return {
  118. title: '维修任务信息',
  119. permission: {
  120. 'admin': false,
  121. 'orgAdmin': false,
  122. 'companyAdmin': false,
  123. 'companyServciePerson': false,
  124. },
  125. pageSize: 10,
  126. pageCurrent: 1,
  127. total: 0,
  128. list: [],
  129. query: {},
  130. rtuCode: '',
  131. }
  132. },
  133. computed: {
  134. },
  135. onShow() {
  136. },
  137. methods: {
  138. //返回上一页
  139. toBack() {
  140. uni.navigateBack({
  141. delta: 1
  142. })
  143. },
  144. onBackPress() {
  145. // #ifdef APP-PLUS
  146. plus.key.hideSoftKeybord();
  147. // #endif
  148. },
  149. // 分页触发
  150. pageChange(e) {
  151. this.pageCurrent = e.current;
  152. this.getPage()
  153. },
  154. onDetailViewClick(id) {
  155. let url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
  156. uni.navigateTo({
  157. url: url
  158. })
  159. },
  160. getAreaName(item) {
  161. let htmltext = '';
  162. if (item.adCity) {
  163. htmltext = htmltext + item.adCity;
  164. }
  165. if (item.adDist) {
  166. if (htmltext.length > 0) {
  167. htmltext = htmltext + ' / ';
  168. }
  169. htmltext = htmltext + item.adDist;
  170. }
  171. return htmltext;
  172. },
  173. getPage(params = {}) {
  174. const current = this.pageCurrent;
  175. const size = this.pageSize;
  176. let postData = Object.assign(params, this.query);
  177. let that = this;
  178. http.request({
  179. url: '/galaxy-business/rtu/check/order/page',
  180. method: 'GET',
  181. params: {
  182. current,
  183. size,
  184. },
  185. data: postData,
  186. }).then(res => {
  187. if (res.data.records != null) {
  188. that.list = res.data.records;
  189. }
  190. this.total = res.data.total;
  191. }).catch(err => {
  192. console.log(err)
  193. })
  194. },
  195. }
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. .nav-title {
  200. width: 100%;
  201. display: flex;
  202. flex-direction: row;
  203. justify-content: center;
  204. align-items: center;
  205. text {
  206. color: white;
  207. font-size: 1rem;
  208. }
  209. }
  210. .container {
  211. padding: 0 0 100rpx;
  212. }
  213. </style>