checkorderlist.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  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. <view class="count-info-line">
  42. <view class="orderCount">
  43. <text class="name">任务数量:</text>
  44. <text class="count">{{ countInfo.orderCount }}</text>
  45. </view>
  46. <view class="unconfirmOrderCount">
  47. <text class="name">未确认任务:</text>
  48. <text class="count">{{
  49. countInfo.orderUnconfirm }}</text>
  50. </view>
  51. <view class="processOrderCount">
  52. <text class="name">处理中任务:</text>
  53. <text class="count">{{
  54. countInfo.orderProcessing }}</text>
  55. </view>
  56. </view>
  57. <view class="count-info-line">
  58. <view class="reportOrderCount">
  59. <text class="name">已处理任务:</text>
  60. <text class="count">{{
  61. countInfo.reportOrder }}</text>
  62. </view>
  63. </view>
  64. <view style="padding-left: 0px;padding-right: 0px;">
  65. <uni-collapse v-model="searchorderstatus">
  66. <uni-collapse-item title="任务状态筛选条件" :show-animation="true">
  67. <view class="select-checkbox">
  68. <uni-data-checkbox v-model="orderStatusOption" :localdata="orderStatusItems"
  69. @change="orderStatusOptionChange">
  70. </uni-data-checkbox>
  71. </view>
  72. </uni-collapse-item>
  73. </uni-collapse>
  74. </view>
  75. <view style="padding-left: 0px;padding-right: 0px;">
  76. <uni-collapse v-model="searchwarnstatus">
  77. <uni-collapse-item title="异常类别筛选条件" :show-animation="true">
  78. <view class="select-checkbox">
  79. <uni-data-checkbox v-model="warnKindOption" :localdata="warnKindItems"
  80. @change="warnKindOptionChange">
  81. </uni-data-checkbox>
  82. </view>
  83. </uni-collapse-item>
  84. </uni-collapse>
  85. </view>
  86. <uni-list>
  87. <uni-list-item v-for="item in list" :key="item.id">
  88. <template v-slot:body>
  89. <view class="list-item-block">
  90. <view class="items-line">
  91. <image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
  92. src="/static/images/list/order_item.png" mode="widthFix">
  93. </image>
  94. <text class="item-title-rtu-name">{{item.rtuName}}</text>
  95. <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
  96. </view>
  97. <view class="items-line">
  98. <uni-icons class="input-uni-icon" type="list" size="18" color="lightblue" />
  99. <text class="item-text-lable">维修状态:</text>
  100. <text v-if="item.orderStatus==1" class="item-text-content"
  101. style="color: red;">等待确认</text>
  102. <text v-if="item.orderStatus==2" class="item-text-content"
  103. style="color: orange;">处理中</text>
  104. <text v-if="item.orderStatus==3" class="item-text-content"
  105. style="color: blue;">已处理</text>
  106. <text v-if="item.orderStatus==4" class="item-text-content"
  107. style="color: green;">已完成</text>
  108. </view>
  109. <view class="items-line">
  110. <uni-icons class="input-uni-icon" type="bars" size="18" color="lightblue" />
  111. <text class="item-text-lable">异常类型:</text>
  112. <text class="item-text-content-ellipsis">{{item.warnKindInfo}}</text>
  113. </view>
  114. <view v-if="item.orderStatus==1" class="items-line">
  115. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  116. <text class="item-text-lable">创建时长:</text>
  117. <text class="item-text-content" style="color: red;">{{item.taskCreateDuration}}</text>
  118. </view>
  119. <view v-else class="items-line">
  120. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  121. <text class="item-text-lable">维修时长:</text>
  122. <text class="item-text-content" style="color: red;">{{item.taskProcessDuration}}</text>
  123. </view>
  124. <view class="items-line">
  125. <uni-icons class="input-uni-icon" type="location" size="18" color="lightblue" />
  126. <text class="item-text-lable">行政区划:</text>
  127. <text class="item-text-content">{{item.areaName}}</text>
  128. </view>
  129. <view v-if="item.orderStatus==1" class="items-line">
  130. <uni-icons class="input-uni-icon" type="person" size="18" color="lightblue" />
  131. <text class="item-text-lable">运维公司管理员:</text>
  132. <text class="item-text-content">{{item.manageCompanyAdminName}}</text>
  133. </view>
  134. <view v-else class="items-line">
  135. <uni-icons class="input-uni-icon" type="person" size="18" color="lightblue" />
  136. <text class="item-text-lable">处理人:</text>
  137. <text class="item-text-content">{{item.contactUserName}}</text>
  138. </view>
  139. <view v-if="item.orderStatus==1" class="items-line">
  140. <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
  141. <text class="item-text-lable">管理员联系电话:</text>
  142. <view v-if="item.manageCompanyAdminPhone != null" @click="call(item.manageCompanyAdminPhone)">
  143. <text class="item-text-content"
  144. style="color: skyblue;text-decoration-line: underline;">{{item.manageCompanyAdminPhone}}</text>
  145. </view>
  146. </view>
  147. <view v-else class="items-line">
  148. <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
  149. <text class="item-text-lable">处理人联系电话:</text>
  150. <view v-if="item.contactPhone != null" @click="call(item.contactPhone)">
  151. <text class="item-text-content"
  152. style="color: skyblue;text-decoration-line: underline;">{{item.contactPhone}}</text>
  153. </view>
  154. </view>
  155. <view class="item-button-group">
  156. <view v-if="item.orderStatus==1" class="item-button" @click="call(item.manageCompanyAdminPhone)">
  157. <view class="items-line">
  158. <uni-icons class="input-uni-icon" type="phone" size="18" color="coral" />
  159. <text class="button-text">电话</text>
  160. </view>
  161. </view>
  162. <view v-else class="item-button" @click="call(item.contactPhone)">
  163. <view class="items-line">
  164. <uni-icons class="input-uni-icon" type="phone" size="18" color="coral" />
  165. <text class="button-text">电话</text>
  166. </view>
  167. </view>
  168. <view class="item-button" @click="onLocationClick(item)">
  169. <view class="items-line">
  170. <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
  171. <text class="button-text">导航</text>
  172. </view>
  173. </view>
  174. <view v-if="permission.companyAdmin && item.orderClose == 0" class="item-button"
  175. @click="onCheckOrderChangeClick(item)">
  176. <view class="items-line">
  177. <uni-icons class="input-uni-icon" type="compose" size="18" color="coral" />
  178. <text class="button-text">任务指派</text>
  179. </view>
  180. </view>
  181. <view v-if="(permission.admin || permission.orgAdmin) && item.orderClose == 0"
  182. class="item-button" @click="onManuallyCloseOrderClick(item.id)">
  183. <view class="items-line">
  184. <uni-icons class="input-uni-icon" type="close" size="18" color="coral" />
  185. <text class="button-text">人工关闭</text>
  186. </view>
  187. </view>
  188. <view v-if="permission.companyAdmin && item.orderStatus==1" class="item-button"
  189. @click="onComfireCheckOrderClick(item.id)">
  190. <view class="items-line">
  191. <uni-icons class="input-uni-icon" type="auth" size="18" color="coral" />
  192. <text class="button-text">接受任务</text>
  193. </view>
  194. </view>
  195. <view class="item-button" style="background-color:lightblue"
  196. @click="onDetailViewClick(item.id)">
  197. <view class="items-line">
  198. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  199. <text class="button-text">维修详情</text>
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. </template>
  205. </uni-list-item>
  206. </uni-list>
  207. <uni-group>
  208. <view class="pagination-block">
  209. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  210. @change="pageChange" />
  211. </view>
  212. </uni-group>
  213. </view>
  214. </view>
  215. </template>
  216. <script>
  217. import {
  218. role
  219. } from "@/api/role.js";
  220. import http from '@/http/api.js';
  221. export default {
  222. components: {
  223. },
  224. onLoad(option) {
  225. if (this.userInfo.role_name === role['admin']) {
  226. this.permission.admin = true;
  227. } else if (this.userInfo.role_name === role['orgAdmin']) {
  228. this.permission.orgAdmin = true;
  229. } else if (this.userInfo.role_name === role['companyAdmin']) {
  230. this.permission.companyAdmin = true;
  231. } else if (this.userInfo.role_name === role['companyServciePerson']) {
  232. this.permission.companyServciePerson = true;
  233. }
  234. this.getRegionTree();
  235. },
  236. data() {
  237. return {
  238. title: '维修任务信息',
  239. permission: {
  240. 'admin': false,
  241. 'orgAdmin': false,
  242. 'companyAdmin': false,
  243. 'companyServciePerson': false,
  244. },
  245. searchorderstatus: ['0'],
  246. searchwarnstatus: [],
  247. orderStatusItems: [{
  248. 'value': 0,
  249. 'text': '全部'
  250. }, {
  251. 'value': 1,
  252. 'text': '未确认'
  253. }, {
  254. 'value': 2,
  255. 'text': '处理中'
  256. }, {
  257. 'value': 3,
  258. 'text': '已处理'
  259. }],
  260. orderStatusOption: 0,
  261. countInfo: {
  262. orderCount: 0,
  263. orderUnconfirm: 0,
  264. orderProcessing: 0,
  265. reportOrder: 0
  266. },
  267. warnKindItems: [{
  268. 'value': 0,
  269. 'text': '全部'
  270. }, {
  271. 'value': 1,
  272. 'text': '离线'
  273. }, {
  274. 'value': 2,
  275. 'text': '时钟异常'
  276. }, {
  277. 'value': 3,
  278. 'text': '雨量漏报'
  279. }, {
  280. 'value': 4,
  281. 'text': '水位漏报'
  282. }, {
  283. 'value': 5,
  284. 'text': '5分钟上报延时'
  285. }, {
  286. 'value': 6,
  287. 'text': '雨量小时上报延时'
  288. }, {
  289. 'value': 7,
  290. 'text': '水位小时上报延时'
  291. }, {
  292. 'value': 8,
  293. 'text': '雨量疑似异常值'
  294. }],
  295. warnKindOption: 0,
  296. selectUnconfirm: 0,
  297. selectProcess: 0,
  298. pageSize: 10,
  299. pageCurrent: 1,
  300. total: 0,
  301. list: [],
  302. regionTree: [],
  303. regionCode: '',
  304. selectedTreeNode: '',
  305. searchRtuNameVal: '',
  306. searchRtuCodeVal: '',
  307. query: {},
  308. inputStyles: {
  309. color: '#808080',
  310. borderColor: '#d3d3d3'
  311. }
  312. }
  313. },
  314. computed: {
  315. },
  316. onShow() {
  317. this.pageCurrent = 1;
  318. this.getPage()
  319. },
  320. methods: {
  321. //返回上一页
  322. toBack() {
  323. uni.navigateBack({
  324. delta: 1
  325. })
  326. },
  327. onBackPress() {
  328. // #ifdef APP-PLUS
  329. plus.key.hideSoftKeybord();
  330. // #endif
  331. },
  332. // 分页触发
  333. pageChange(e) {
  334. this.pageCurrent = e.current;
  335. this.getPage()
  336. },
  337. //行政区划选择
  338. onTreeNodeClick(node) {
  339. console.log(JSON.stringify(node))
  340. },
  341. onTreePopupOpened(e) {
  342. console.log(JSON.stringify(e))
  343. },
  344. onTreePopupClosed(e) {
  345. console.log(JSON.stringify(e))
  346. },
  347. onTreeChange(e) {
  348. console.log(JSON.stringify(e))
  349. let nodes = e.detail.value;
  350. if (nodes.length > 0) {
  351. let node = nodes[nodes.length - 1];
  352. this.regionCode = node.value;
  353. this.query = {};
  354. this.query['adCode'] = this.regionCode;
  355. this.searchRtuNameVal = '';
  356. this.searchRtuCodeVal = '';
  357. this.pageCurrent = 1;
  358. this.getPage();
  359. this.getCountInfo(this.regionCode);
  360. } else {
  361. this.regionCode = '';
  362. this.query = {};
  363. this.searchRtuNameVal = '';
  364. this.searchRtuCodeVal = '';
  365. this.pageCurrent = 1;
  366. this.getPage();
  367. this.getCountInfo(this.regionCode);
  368. }
  369. },
  370. //录入查询
  371. search() {
  372. this.pageCurrent = 1;
  373. let params = {};
  374. if (this.searchRtuCodeVal.length > 0) {
  375. params['rtuCode'] = this.searchRtuCodeVal;
  376. }
  377. if (this.searchRtuNameVal.length > 0) {
  378. params['rtuName'] = this.searchRtuNameVal;
  379. }
  380. this.getPage(params);
  381. },
  382. searchRtuNameValClear(e) {
  383. if (e == null || e.length == 0) {
  384. this.searchRtuNameVal = '';
  385. if (this.searchRtuNameVal.length == 0) {
  386. let params = {};
  387. if (this.searchRtuCodeVal.length > 0) {
  388. params['rtuCode'] = this.searchRtuCodeVal;
  389. }
  390. this.getPage(params);
  391. }
  392. }
  393. },
  394. searchRtuCodeValClear(e) {
  395. if (e == null || e.length == 0) {
  396. this.searchRtuCodeVal = '';
  397. if (this.searchRtuCodeVal.length == 0) {
  398. let params = {};
  399. if (this.searchRtuNameVal.length > 0) {
  400. params['rtuName'] = this.searchRtuNameVal;
  401. }
  402. this.getPage(params);
  403. }
  404. }
  405. },
  406. call(phone) {
  407. console.log(phone)
  408. uni.showModal({
  409. content: '是否需要拨打[' + phone + ']?',
  410. showCancel: true,
  411. success(res) {
  412. if (res.confirm) {
  413. uni.makePhoneCall({
  414. phoneNumber: phone
  415. });
  416. }
  417. }
  418. });
  419. },
  420. onDetailViewClick(id) {
  421. let url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
  422. uni.navigateTo({
  423. url: url
  424. })
  425. },
  426. onCheckOrderChangeClick(item) {
  427. let contactUserName = '无';
  428. if (item.orderConfirm == 1) {
  429. contactUserName = item.processorName;
  430. }
  431. let url = '/pages/check-order/orderprocesschange?orderId=' + item.id + "&contactUserName=" +
  432. contactUserName;
  433. uni.navigateTo({
  434. url: url
  435. })
  436. },
  437. onLocationClick(item) {
  438. if (item.lat && item.lat) {
  439. let lat = item.lat;
  440. let lng = item.lng;
  441. let name = item.rtuName;
  442. let add = '';
  443. if (item.locationDesc) {
  444. add = item.locationDesc;
  445. }
  446. uni.openLocation({
  447. latitude: Number(lat),
  448. longitude: Number(lng),
  449. name: name,
  450. address: "",
  451. success() {}
  452. })
  453. } else {
  454. uni.showModal({
  455. content: '经纬度为空,请确认!',
  456. showCancel: true,
  457. success(res) {
  458. if (res.confirm) {
  459. }
  460. }
  461. });
  462. }
  463. },
  464. onManuallyCloseOrderClick(id) {
  465. uni.navigateTo({
  466. url: '/pages/check-order/manuallyclosecheckorder?id=' + id
  467. })
  468. },
  469. onComfireCheckOrderClick(id) {
  470. let url =
  471. '/pages/check-order/orderconfirm?id=' + id;
  472. uni.navigateTo({
  473. url: url
  474. })
  475. },
  476. orderStatusOptionChange: function(evt) {
  477. console.log(JSON.stringify(evt))
  478. console.log(this.orderStatusOption)
  479. this.pageCurrent = 1;
  480. let params = {};
  481. this.getPage(params);
  482. },
  483. warnKindOptionChange: function(evt) {
  484. let params = {};
  485. this.pageCurrent = 1;
  486. this.getPage(params);
  487. },
  488. getRegionTree() {
  489. var that = this;
  490. http.request({
  491. url: '/galaxy-business/baseinfo/region/tree',
  492. method: 'GET',
  493. }).then(res => {
  494. if (res.data != null) {
  495. that.regionTree = res.data;
  496. that.regionCode = that.regionTree[0].id;
  497. that.selectedTreeNode = that.regionTree[0].id;
  498. that.query = {};
  499. that.query['adCode'] = that.regionCode;
  500. that.getPage();
  501. that.getCountInfo(that.regionCode);
  502. }
  503. }).catch(err => {
  504. console.log(err)
  505. })
  506. },
  507. getCountInfo(adCode) {
  508. let that = this;
  509. http.request({
  510. url: '/galaxy-business/rtu/check/order/count',
  511. method: 'GET',
  512. data: {
  513. adCode
  514. }
  515. }).then(res => {
  516. that.countInfo = res.data;
  517. })
  518. },
  519. getPage(params = {}) {
  520. if (this.orderStatusOption == 0) {
  521. params['orderClose'] = 0;
  522. } else if (this.orderStatusOption == 1) {
  523. params['orderStatus'] = 1;
  524. params['orderClose'] = 0;
  525. } else if (this.orderStatusOption == 2) {
  526. params['orderStatus'] = 2;
  527. params['orderClose'] = 0;
  528. } else if (this.orderStatusOption == 3) {
  529. params['orderStatus'] = 3;
  530. params['orderClose'] = 0;
  531. }
  532. if (this.warnKindOption == 0) {} else {
  533. params['warnKind'] = this.warnKindOption;
  534. }
  535. const current = this.pageCurrent;
  536. const size = this.pageSize;
  537. let postData = Object.assign(params, this.query);
  538. let that = this;
  539. http.request({
  540. url: '/galaxy-business/rtu/check/order/page',
  541. method: 'GET',
  542. params: {
  543. current,
  544. size,
  545. },
  546. data: postData,
  547. }).then(res => {
  548. console.log(JSON.stringify(res.data))
  549. if (res.data.records != null) {
  550. that.list = res.data.records;
  551. }
  552. this.total = res.data.total;
  553. }).catch(err => {
  554. console.log(err)
  555. })
  556. },
  557. }
  558. }
  559. </script>
  560. <style lang="scss" scoped>
  561. .select-checkbox {
  562. margin-top: 0px;
  563. margin-bottom: 5px;
  564. padding-left: 15px;
  565. }
  566. .count-info-line {
  567. padding-top: 5px;
  568. padding-bottom: 5px;
  569. padding-left: 10px;
  570. padding-right: 10px;
  571. display: flex;
  572. flex-direction: row;
  573. justify-content: flex-start;
  574. flex-wrap: wrap;
  575. }
  576. .count-info-line .orderCount {
  577. display: flex;
  578. flex-direction: row;
  579. align-items: center;
  580. .name {
  581. color: dimgray;
  582. font-size: 0.7rem;
  583. }
  584. .count {
  585. margin-left: 5px;
  586. color: dodgerblue;
  587. font-size: 0.7rem;
  588. }
  589. }
  590. .count-info-line .unconfirmOrderCount {
  591. margin-left: 10px;
  592. display: flex;
  593. flex-direction: row;
  594. align-items: center;
  595. .name {
  596. color: dimgray;
  597. font-size: 0.7rem;
  598. }
  599. .count {
  600. margin-left: 5px;
  601. color: red;
  602. font-size: 0.7rem;
  603. }
  604. }
  605. .count-info-line .processOrderCount {
  606. margin-left: 10px;
  607. display: flex;
  608. flex-direction: row;
  609. align-items: center;
  610. .name {
  611. color: dimgray;
  612. font-size: 0.7rem;
  613. }
  614. .count {
  615. margin-left: 5px;
  616. color: orange;
  617. font-size: 0.7rem;
  618. }
  619. }
  620. .count-info-line .reportOrderCount {
  621. margin-left: 0px;
  622. display: flex;
  623. flex-direction: row;
  624. align-items: center;
  625. .name {
  626. color: dimgray;
  627. font-size: 0.7rem;
  628. }
  629. .count {
  630. margin-left: 5px;
  631. color: green;
  632. font-size: 0.7rem;
  633. }
  634. }
  635. </style>