workOrderManagement.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. <template>
  2. <view>
  3. <view class="navbar-c">
  4. <view class="back" @click="toWorkOrderMap">
  5. <image class="img" src="@/assets/img/riLine-road-map-line.svg" mode=""></image>
  6. </view>
  7. <view class="title">
  8. 工单管理
  9. </view>
  10. <view class="right" @click="gotoUrl('/pages/workOrderManagement/faultReport')">
  11. 故障上报
  12. </view>
  13. </view>
  14. <!-- 搜索 -->
  15. <view class="search-box">
  16. <u-search placeholder="搜索" bg-color="#fff" height="80" :show-action="true" v-model="queryForm.qkey"
  17. @custom="searchWorkOrder">
  18. </u-search>
  19. </view>
  20. <!-- 我的工单 -->
  21. <view class="my-work-order">
  22. <view class="title">
  23. <view class="name">
  24. <view class="icon">
  25. <image class="img" src="@/assets/img/riFill-bar-chart-fill.svg" mode=""></image>
  26. </view>
  27. 我的工单
  28. </view>
  29. <view class="more" @click="toWorkOrderStatistics">
  30. 工单统计<u-icon name="arrow-right" color="#777777"></u-icon>
  31. </view>
  32. </view>
  33. <!-- 分类 -->
  34. <view class="classify">
  35. <view class="item" v-for="(item,index) in classificationList" :key="index"
  36. :class="classificationIndex==index ? 'item-checked' : ''" @click="classificationClick(item,index)">
  37. {{item.name}}18
  38. <view class="checked-circle" v-if="classificationIndex==index">
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 工单详情 -->
  43. <view class="work-order" v-for="(item,index) in workOrderList" :key="index">
  44. <!-- 紧急 -->
  45. <view @click="gotoUrl('/pages/workOrderManagement/workOrderDetails?id='+item.id)">
  46. <view class="urgency" v-if="item.urgentIf">
  47. 紧急
  48. </view>
  49. <view class="order-item">
  50. <view class="item-icon">
  51. <image class="img" src="@/assets/img/riFill-building-fill1.svg" mode=""></image>
  52. </view>
  53. <view class="item-value value-bold">
  54. {{item.ownerOrgName}}-{{item.deviceName}}
  55. </view>
  56. </view>
  57. <view class="order-item">
  58. <view class="item-icon">
  59. <image class="img" src="@/assets/img/riFill-alert-fill.svg" mode=""></image>
  60. </view>
  61. <view class="item-value value-bold">
  62. {{item.faultTypeName}}
  63. </view>
  64. </view>
  65. <view class="order-item">
  66. <view class="item-icon">
  67. <image class="img" src="@/assets/img/riFill-map-pin-fill.svg" mode=""></image>
  68. </view>
  69. <view class="item-value">
  70. {{item.deviceAddress}}
  71. </view>
  72. </view>
  73. <view class="order-item">
  74. <view class="item-icon">
  75. <image class="img" src="@/assets/img/riFill-time-fill.svg" mode=""></image>
  76. </view>
  77. <view class="item-value">
  78. {{item.createTime}}
  79. </view>
  80. </view>
  81. </view>
  82. <view class="button">
  83. <view class="state" v-if="item.status == 'created'">
  84. 待指派
  85. </view>
  86. <view class="state state2" v-if="item.status == 'dispatched'">
  87. 进行中
  88. </view>
  89. <view class="state state3" v-if="item.status == 'ended'">
  90. 已解决
  91. </view>
  92. <view class="state state4" v-if="item.status == 'closed'">
  93. 已关闭
  94. </view>
  95. <view class="btn">
  96. <button class="close" @click="closePopupShow(item)" v-if="item.status == 'created'">关闭</button>
  97. <button class="reminder" @click="reminderShow=true" v-if="item.status == 'created'">催单</button>
  98. <button class="resolved" v-if="item.status == 'dispatched'"
  99. @click="gotoUrl('/pages/workOrderManagement/workOrderDetails?id='+item.id)">确认解决</button>
  100. <button class="view" v-if="item.status == 'ended' || item.status == 'closed'"
  101. @click="gotoUrl('/pages/workOrderManagement/workOrderDetails?id='+item.id)">查看详情</button>
  102. </view>
  103. </view>
  104. </view>
  105. <u-divider :isnone="workOrderList.length==0" nonetext="暂无工单" border-color="#CFD2D5"></u-divider>
  106. </view>
  107. <!-- 关闭原因 -->
  108. <u-popup v-model="closeShow" mode="bottom" closeable close-icon-size="24" close-icon-color="#101010"
  109. border-radius="24">
  110. <view class="close-reason">
  111. <view class="title">
  112. 请选择关闭原因:
  113. </view>
  114. <view class="reason-content">
  115. <view class="reason-item" v-for="(item,index) in reasonList" :key="index">
  116. <view class="item-title">
  117. {{item}}
  118. </view>
  119. <view class="item-value" @click="reasonClick(item,index)">
  120. <label class="radio">
  121. <radio name="reason" :checked="index === current" /><text></text>
  122. </label>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="button-box">
  127. <button class="think" @click="closeShow=false">我在想想</button>
  128. <button class="confirm" @click="closeWorkOrder">确认关闭</button>
  129. </view>
  130. </view>
  131. </u-popup>
  132. <!-- 催单 -->
  133. <u-popup v-model="reminderShow" mode="bottom" closeable close-icon-size="24" close-icon-color="#101010"
  134. border-radius="24">
  135. <view class="reminder-content">
  136. <view class="title">
  137. 催单
  138. </view>
  139. <view class="content">
  140. 我们已催促平台尽快指派工程师处理工单。
  141. </view>
  142. <button class="know" @click="reminderClick">知道了</button>
  143. </view>
  144. </u-popup>
  145. <energyCenterTabbar :current="1"></energyCenterTabbar>
  146. </view>
  147. </template>
  148. <script>
  149. import energyCenterTabbar from '@/components/energyCenterTabbar.vue'
  150. import * as API_workOrder from '@/apis/pagejs/workOrder.js'
  151. export default {
  152. components: {
  153. energyCenterTabbar
  154. },
  155. data() {
  156. return {
  157. workOrderId: '', //工单id
  158. classificationIndex: 0, //分类
  159. classificationList: [
  160. {value: '', name: '全部'},
  161. {value: 'created', name: '待指派'},
  162. {value: 'dispatched', name: '进行中'},
  163. {value: 'ended', name: '已解决'}
  164. ],
  165. workOrderList: [], //工单列表
  166. recordsTotal: 0,
  167. queryForm: {
  168. pageIndex: 1,
  169. pageSize: 5,
  170. qkey: '', //关键字(工单编号/设备名/故障信息)
  171. startDate: '', //开始日期
  172. endDate: '', //截止日期
  173. status: '' //工单状态
  174. },
  175. keyword: '',
  176. closeShow: false,
  177. reminderShow: false,
  178. reasonList: ['错误告警','设备已自动恢复','不需要上门解决','平台移桩,可忽视','其他'],
  179. current: 0
  180. }
  181. },
  182. onLoad() {
  183. this.getQueryMy();
  184. },
  185. onReachBottom() {
  186. if (this.workOrderList.length < this.recordsTotal) {
  187. this.myLoadmore();
  188. }
  189. },
  190. methods: {
  191. //打开关闭原因
  192. closePopupShow(item) {
  193. this.closeShow = true;
  194. this.workOrderId = item.id;
  195. },
  196. //催单
  197. reminderClick() {
  198. this.reminderShow = false;
  199. },
  200. //搜索
  201. searchWorkOrder() {
  202. this.getQueryMy(true);
  203. },
  204. //分类
  205. classificationClick(item,index) {
  206. this.classificationIndex = index;
  207. this.queryForm.status = item.value;
  208. this.getQueryMy(true);
  209. },
  210. myLoadmore() {
  211. this.queryForm.pageIndex += 1;
  212. this.getAbnormalAlarmRecord();
  213. },
  214. getQueryMy(bl) {
  215. uni.showLoading({
  216. title: "加载中",
  217. mask: true,
  218. })
  219. if (bl) {
  220. this.workOrderList = [];
  221. this.queryForm.pageIndex = 1;
  222. }
  223. API_workOrder.queryMy(this.queryForm).then((res) => {
  224. uni.hideLoading();
  225. this.workOrderList = [
  226. ...this.workOrderList,
  227. ...res.data.data
  228. ];
  229. this.recordsTotal = res.data.recordsTotal;
  230. }).catch(error => {
  231. uni.showToast({
  232. title: error,
  233. icon: "none"
  234. })
  235. })
  236. },
  237. //选择关闭原因
  238. reasonClick(item,index) {
  239. this.current = index;
  240. this.closeReason = item;
  241. },
  242. //关闭工单
  243. closeWorkOrder() {
  244. uni.showLoading({
  245. title: "加载中",
  246. mask: true,
  247. })
  248. API_workOrder.usClose({
  249. id: this.workOrderId,
  250. closeReason: this.closeReason
  251. }).then((res) => {
  252. uni.hideLoading();
  253. this.closeShow = false;
  254. uni.navigateTo({
  255. url: '/pages/workOrderManagement/workOrderDetails?id='+this.workOrderId
  256. })
  257. }).catch(error => {
  258. uni.showToast({
  259. title: error,
  260. icon: "none"
  261. })
  262. })
  263. },
  264. toWorkOrderMap() {
  265. uni.navigateTo({
  266. url: '/pages/workOrderManagement/workOrderMap'
  267. })
  268. },
  269. toWorkOrderStatistics() {
  270. uni.navigateTo({
  271. url: '/pages/workOrderManagement/workOrderStatistics'
  272. })
  273. }
  274. }
  275. }
  276. </script>
  277. <style lang="scss" scoped>
  278. .navbar-c {
  279. .back {
  280. z-index: 999;
  281. width: 200rpx;
  282. }
  283. .right {
  284. z-index: 999;
  285. // width: 200rpx;
  286. }
  287. }
  288. page {
  289. padding-bottom: 100px;
  290. }
  291. // 搜索
  292. .search-box {
  293. padding: 16rpx 32rpx;
  294. position: sticky;
  295. top: 88rpx;
  296. z-index: 999;
  297. background-color: #F2F4F6;
  298. ::v-deep.u-content {
  299. border-radius: 8px !important;
  300. }
  301. ;
  302. ::v-deep.u-search {
  303. position: relative
  304. }
  305. ;
  306. ::v-deep.u-action {
  307. width: 96rpx;
  308. line-height: 56rpx;
  309. border-radius: 4px;
  310. background-color: rgba(22, 119, 255, 1);
  311. color: rgba(255, 255, 255, 1);
  312. text-align: center;
  313. z-index: 9999;
  314. position: absolute;
  315. right: 12rpx;
  316. }
  317. }
  318. // 我的工单
  319. .my-work-order {
  320. .title {
  321. display: flex;
  322. align-items: center;
  323. justify-content: space-between;
  324. padding: 16rpx 32rpx;
  325. .name {
  326. display: flex;
  327. align-items: center;
  328. color: rgba(16, 16, 16, 1);
  329. font-size: 36rpx;
  330. font-weight: bold;
  331. .icon {
  332. width: 36rpx;
  333. height: 36rpx;
  334. border-radius: 4px;
  335. background-color: rgba(22, 119, 255, 1);
  336. display: flex;
  337. align-items: center;
  338. justify-content: center;
  339. margin-right: 12rpx;
  340. .img {
  341. width: 28rpx;
  342. height: 28rpx;
  343. }
  344. }
  345. }
  346. .more {
  347. color: #777777;
  348. font-size: 32rpx;
  349. }
  350. }
  351. // 分类
  352. .classify {
  353. display: flex;
  354. align-items: center;
  355. justify-content: space-between;
  356. padding: 0 32rpx;
  357. margin-top: 8rpx;
  358. .item {
  359. width: 160rpx;
  360. line-height: 72rpx;
  361. border-radius: 8px;
  362. background-color: rgba(255, 255, 255, 1);
  363. border: 1px solid rgba(22, 119, 255, 1);
  364. text-align: center;
  365. color: rgba(22, 119, 255, 1);
  366. font-weight: bold;
  367. overflow: hidden;
  368. }
  369. .item-checked {
  370. background: linear-gradient(180deg, rgba(78, 141, 246, 1) 0%, rgba(22, 119, 255, 1) 100%);
  371. color: #fff;
  372. position: relative;
  373. .checked-circle {
  374. width: 20rpx;
  375. height: 20rpx;
  376. background-color: rgba(255, 150, 0, 1);
  377. border-radius: 999px;
  378. position: absolute;
  379. bottom: -10rpx;
  380. left: 50%;
  381. transform: translateX(-50%);
  382. }
  383. }
  384. }
  385. // 工单详情
  386. .work-order {
  387. border-radius: 8px;
  388. background-color: rgba(255, 255, 255, 1);
  389. margin: 24rpx 32rpx;
  390. padding: 32rpx 24rpx 0;
  391. position: relative;
  392. // 紧急
  393. .urgency {
  394. width: 120rpx;
  395. line-height: 56rpx;
  396. border-radius: 0px 8px 0px 8px;
  397. color: rgba(255, 255, 255, 1);
  398. font-size: 32rpx;
  399. text-align: center;
  400. background: linear-gradient(180deg, rgba(255, 79, 63, 1) 0%, rgba(255, 124, 112, 1) 100%);
  401. position: absolute;
  402. top: 0;
  403. right: 0;
  404. }
  405. .order-item {
  406. display: flex;
  407. align-items: center;
  408. margin-bottom: 16rpx;
  409. .item-icon {
  410. .img {
  411. width: 40rpx;
  412. height: 40rpx;
  413. vertical-align: middle;
  414. }
  415. }
  416. .item-value {
  417. color: rgba(51, 51, 51, 1);
  418. font-size: 32rpx;
  419. margin-left: 16rpx;
  420. }
  421. .value-bold {
  422. font-weight: bold;
  423. }
  424. }
  425. }
  426. // 按钮
  427. .button {
  428. margin-top: 32rpx;
  429. border-top: 1px solid rgba(232, 232, 232, 1);
  430. padding: 20rpx 0;
  431. display: flex;
  432. justify-content: space-between;
  433. align-items: center;
  434. .state {
  435. color: rgba(255, 123, 0, 1);
  436. }
  437. .state2 {
  438. color: rgba(22, 119, 255, 1);
  439. }
  440. .state3 {
  441. color: rgba(0, 185, 98, 1);
  442. }
  443. .state4 {
  444. color: rgba(119, 119, 119, 1);
  445. }
  446. .btn {
  447. display: flex;
  448. .close {
  449. border: 1px solid rgba(187, 187, 187, 1);
  450. width: 144rpx;
  451. height: 64rpx;
  452. line-height: 64rpx;
  453. border-radius: 4px;
  454. background-color: rgba(255, 255, 255, 1);
  455. color: rgba(119, 119, 119, 1);
  456. margin-right: 24rpx;
  457. font-size: 28rpx
  458. }
  459. .reminder,
  460. .resolved {
  461. width: 144rpx;
  462. height: 64rpx;
  463. line-height: 64rpx;
  464. border-radius: 4px;
  465. color: rgba(255, 255, 255, 1);
  466. background-color: rgba(22, 119, 255, 1);
  467. font-size: 28rpx
  468. }
  469. .resolved {
  470. width: 176rpx;
  471. }
  472. .view {
  473. width: 176rpx;
  474. height: 64rpx;
  475. line-height: 64rpx;
  476. border-radius: 4px;
  477. background-color: rgba(255, 255, 255, 1);
  478. color: rgba(119, 119, 119, 1);
  479. font-size: 28rpx;
  480. border: 1px solid rgba(187, 187, 187, 1);
  481. }
  482. }
  483. }
  484. }
  485. //关闭原因
  486. .close-reason {
  487. padding: 32rpx;
  488. .title {
  489. color: rgba(16, 16, 16, 1);
  490. font-size: 36rpx;
  491. font-weight: bold;
  492. }
  493. .reason-content {
  494. margin-top: 60rpx;
  495. .reason-item {
  496. display: flex;
  497. align-items: center;
  498. justify-content: space-between;
  499. margin-bottom: 56rpx;
  500. .item-title {
  501. color: rgba(16, 16, 16, 1);
  502. font-size: 32rpx;
  503. }
  504. }
  505. }
  506. .button-box {
  507. display: flex;
  508. .think {
  509. width: 328rpx;
  510. line-height: 80rpx;
  511. font-size: 32rpx;
  512. border-radius: 4px;
  513. background-color: rgba(222, 225, 228, 1);
  514. color: rgba(51, 51, 51, 1);
  515. }
  516. .confirm {
  517. width: 328rpx;
  518. line-height: 80rpx;
  519. font-size: 32rpx;
  520. border-radius: 4px;
  521. background-color: rgba(255, 68, 68, 1);
  522. color: rgba(255, 255, 255, 1);
  523. }
  524. }
  525. }
  526. // 催单
  527. .reminder-content {
  528. padding: 32rpx;
  529. text-align: center;
  530. .title {
  531. color: rgba(16, 16, 16, 1);
  532. font-size: 36rpx;
  533. font-weight: bold;
  534. }
  535. .content {
  536. color: rgba(16, 16, 16, 1);
  537. font-size: 32rpx;
  538. margin-top: 40rpx;
  539. }
  540. .know {
  541. width: 100%;
  542. line-height: 80rpx;
  543. border-radius: 4px;
  544. background-color: rgba(22, 119, 255, 1);
  545. color: rgba(255, 255, 255, 1);
  546. font-size: 32rpx;
  547. margin-top: 84rpx;
  548. }
  549. }
  550. </style>