workOrderManagement.vue 13 KB

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