workOrderManagement.vue 13 KB

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