completedcheckorderlist.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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. <view class="search-block">
  20. <view class="adcd-adnm">
  21. <uni-data-picker placeholder="请选择地区" popup-title="请选择所在地区" :localdata="regionTree"
  22. v-model="selectedTreeNode" @change="onTreeChange" @nodeclick="onTreeNodeClick"
  23. @popupopened="onTreePopupOpened" @popupclosed="onTreePopupClosed" :clear-icon="false">
  24. </uni-data-picker>
  25. </view>
  26. <view class="rtu-code">
  27. <uni-easyinput :styles="inputStyles" @input="searchRtuCodeValClear" prefixIcon="search"
  28. v-model="searchRtuCodeVal" placeholder="请输入测站编码">
  29. </uni-easyinput>
  30. </view>
  31. <view class="rtu-name">
  32. <uni-easyinput :styles="inputStyles" @input="searchRtuNameValClear" prefixIcon="search"
  33. v-model="searchRtuNameVal" placeholder="请输入测站名称">
  34. </uni-easyinput>
  35. </view>
  36. <view class="submit-btn">
  37. <button type="default" @click="search">查 询</button>
  38. </view>
  39. </view>
  40. </uni-section>
  41. <uni-list>
  42. <uni-list-item v-for="item in list" :key="item.id">
  43. <template v-slot:body>
  44. <view class="list-item-block">
  45. <view class="items-line">
  46. <image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
  47. src="/static/images/list/order_item.png" mode="widthFix">
  48. </image>
  49. <text class="item-title-rtu-name">{{item.rtuName}}</text>
  50. <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
  51. </view>
  52. <view class="items-line">
  53. <uni-icons class="input-uni-icon" type="loop" size="18" color="lightblue" />
  54. <text class="item-text-lable">维修时长:</text>
  55. <text class="item-text-content" style="color: red;">{{item.taskProcessDuration}}</text>
  56. </view>
  57. <view class="items-line">
  58. <uni-icons class="input-uni-icon" type="location" size="18" color="lightblue" />
  59. <text class="item-text-lable">行政区划:</text>
  60. <text class="item-text-content">{{item.areaName}}</text>
  61. </view>
  62. <view class="items-line">
  63. <uni-icons class="input-uni-icon" type="home" size="18" color="lightblue" />
  64. <text class="item-text-lable">运维公司:</text>
  65. <text class="item-text-content">
  66. {{item.manageCompany}}
  67. </text>
  68. </view>
  69. <view class="items-line">
  70. <uni-icons class="input-uni-icon" type="person" size="18" color="lightblue" />
  71. <text class="item-text-lable">填报人:</text>
  72. <text class="item-text-content">{{item.processUserName}}</text>
  73. </view>
  74. <view class="items-line">
  75. <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
  76. <text class="item-text-lable">联系电话:</text>
  77. <view v-if="item.processUserPhone != null" @click="call(item.processUserPhone)">
  78. <text class="item-text-content-phone">{{item.processUserPhone}}</text>
  79. </view>
  80. </view>
  81. <view class="item-button-group">
  82. <view class="item-button" @click="call(item.processUserPhone)">
  83. <view class="items-line">
  84. <uni-icons class="input-uni-icon" type="phone" size="18" color="coral" />
  85. <text class="button-text">电话</text>
  86. </view>
  87. </view>
  88. <view class="item-button" @click="onDetailViewClick(item.id)">
  89. <view class="items-line">
  90. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  91. <text class="button-text">维修详情</text>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. </uni-list-item>
  98. </uni-list>
  99. <uni-group>
  100. <view class="pagination-block">
  101. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  102. @change="pageChange" />
  103. </view>
  104. </uni-group>
  105. </view>
  106. </view>
  107. </template>
  108. <script>
  109. import {
  110. role
  111. } from "@/api/role.js";
  112. import http from '@/http/api.js';
  113. export default {
  114. components: {
  115. },
  116. onLoad(option) {
  117. if (this.userInfo.role_name === role['admin']) {
  118. this.permission.admin = true;
  119. } else if (this.userInfo.role_name === role['orgAdmin']) {
  120. this.permission.orgAdmin = true;
  121. } else if (this.userInfo.role_name === role['companyAdmin']) {
  122. this.permission.companyAdmin = true;
  123. } else if (this.userInfo.role_name === role['companyServciePerson']) {
  124. this.permission.companyServciePerson = true;
  125. }
  126. this.getRegionTree();
  127. },
  128. data() {
  129. return {
  130. title: '维修任务历史信息',
  131. permission: {
  132. 'admin': false,
  133. 'orgAdmin': false,
  134. 'companyAdmin': false,
  135. 'companyServciePerson': false,
  136. },
  137. pageSize: 10,
  138. pageCurrent: 1,
  139. total: 0,
  140. list: [],
  141. regionTree: [],
  142. regionCode: '',
  143. selectedTreeNode: '',
  144. searchRtuNameVal: '',
  145. searchRtuCodeVal: '',
  146. query: {},
  147. inputStyles: {
  148. color: '#808080',
  149. borderColor: '#d3d3d3'
  150. }
  151. }
  152. },
  153. computed: {
  154. },
  155. onShow() {
  156. this.pageCurrent = 1;
  157. this.getPage()
  158. },
  159. methods: {
  160. //返回上一页
  161. toBack() {
  162. uni.navigateBack({
  163. delta: 1
  164. })
  165. },
  166. onBackPress() {
  167. // #ifdef APP-PLUS
  168. plus.key.hideSoftKeybord();
  169. // #endif
  170. },
  171. // 分页触发
  172. pageChange(e) {
  173. this.pageCurrent = e.current;
  174. this.getPage()
  175. },
  176. //行政区划选择
  177. onTreeNodeClick(node) {
  178. console.log(JSON.stringify(node))
  179. },
  180. onTreePopupOpened(e) {
  181. console.log(JSON.stringify(e))
  182. },
  183. onTreePopupClosed(e) {
  184. console.log(JSON.stringify(e))
  185. },
  186. onTreeChange(e) {
  187. console.log(JSON.stringify(e))
  188. let nodes = e.detail.value;
  189. if (nodes.length > 0) {
  190. let node = nodes[nodes.length - 1];
  191. this.regionCode = node.value;
  192. this.query = {};
  193. this.query['adCode'] = this.regionCode;
  194. this.searchRtuNameVal = '';
  195. this.searchRtuCodeVal = '';
  196. this.pageCurrent = 1;
  197. this.getPage();
  198. } else {
  199. this.regionCode = '';
  200. this.query = {};
  201. this.searchRtuNameVal = '';
  202. this.searchRtuCodeVal = '';
  203. this.pageCurrent = 1;
  204. this.getPage();
  205. }
  206. },
  207. //录入查询
  208. search() {
  209. this.pageCurrent = 1;
  210. let params = {};
  211. if (this.searchRtuCodeVal.length > 0) {
  212. params['rtuCode'] = this.searchRtuCodeVal;
  213. }
  214. if (this.searchRtuNameVal.length > 0) {
  215. params['rtuName'] = this.searchRtuNameVal;
  216. }
  217. this.getPage(params);
  218. },
  219. searchRtuNameValClear(e) {
  220. if (e == null || e.length == 0) {
  221. this.searchRtuNameVal = '';
  222. if (this.searchRtuNameVal.length == 0) {
  223. let params = {};
  224. if (this.searchRtuCodeVal.length > 0) {
  225. params['rtuCode'] = this.searchRtuCodeVal;
  226. }
  227. this.getPage(params);
  228. }
  229. }
  230. },
  231. searchRtuCodeValClear(e) {
  232. if (e == null || e.length == 0) {
  233. this.searchRtuCodeVal = '';
  234. if (this.searchRtuCodeVal.length == 0) {
  235. let params = {};
  236. if (this.searchRtuNameVal.length > 0) {
  237. params['rtuName'] = this.searchRtuNameVal;
  238. }
  239. this.getPage(params);
  240. }
  241. }
  242. },
  243. call(phone) {
  244. console.log(phone)
  245. uni.showModal({
  246. content: '是否需要拨打[' + phone + ']?',
  247. showCancel: true,
  248. success(res) {
  249. if (res.confirm) {
  250. uni.makePhoneCall({
  251. phoneNumber: phone
  252. });
  253. }
  254. }
  255. });
  256. },
  257. onDetailViewClick(id) {
  258. let url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
  259. uni.navigateTo({
  260. url: url
  261. })
  262. },
  263. onLocationClick(item) {
  264. let lat = item.lat;
  265. let lng = item.lng;
  266. let name = item.rtuName;
  267. let add = item.locationDesc;
  268. uni.openLocation({
  269. latitude: Number(lat),
  270. longitude: Number(lng),
  271. name: name,
  272. address: "",
  273. success() {}
  274. })
  275. },
  276. onManuallyCloseOrderClick(id) {
  277. uni.navigateTo({
  278. url: '/pages/check-order/manuallyclosecheckorder?id=' + id
  279. })
  280. },
  281. onComfireCheckOrderClick(id) {
  282. let url =
  283. '/pages/check-order/orderconfirm?id=' + id;
  284. uni.navigateTo({
  285. url: url
  286. })
  287. },
  288. getRegionTree() {
  289. var that = this;
  290. http.request({
  291. url: '/galaxy-business/baseinfo/region/tree',
  292. method: 'GET',
  293. }).then(res => {
  294. if (res.data != null) {
  295. that.regionTree = res.data;
  296. that.regionCode = that.regionTree[0].id;
  297. that.selectedTreeNode = that.regionTree[0].id;
  298. that.query = {};
  299. that.query['adCode'] = that.regionCode;
  300. that.getPage();
  301. }
  302. }).catch(err => {
  303. console.log(err)
  304. })
  305. },
  306. getPage(params = {}) {
  307. const current = this.pageCurrent;
  308. const size = this.pageSize;
  309. params['orderClose'] = 1;
  310. params['orderReportStatus'] = 1;
  311. let postData = Object.assign(params, this.query);
  312. let that = this;
  313. http.request({
  314. url: '/galaxy-business/rtu/check/order/page',
  315. method: 'GET',
  316. params: {
  317. current,
  318. size,
  319. },
  320. data: postData,
  321. }).then(res => {
  322. if (res.data.records != null) {
  323. that.list = res.data.records;
  324. }
  325. this.total = res.data.total;
  326. }).catch(err => {
  327. console.log(err)
  328. })
  329. },
  330. }
  331. }
  332. </script>
  333. <style lang="scss" scoped>
  334. .nav-title {
  335. width: 100%;
  336. display: flex;
  337. flex-direction: row;
  338. justify-content: center;
  339. align-items: center;
  340. text {
  341. color: white;
  342. font-size: 1rem;
  343. }
  344. }
  345. .container {
  346. padding: 0 0 100rpx;
  347. }
  348. </style>