workDetail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. <template>
  2. <!--工单详情-->
  3. <!--工单详情-->
  4. <view class="workDetail">
  5. <view class="con">
  6. <image src="http://resource.weilaibike.com/yunwei/detail.png" @click="goHome" class="bike"></image>
  7. <view class="work">
  8. <view style="font-size:28rpx; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width:80%;">{{detail.reason}}</view>
  9. <view style="font-size:40rpx;margin-top:15rpx;">
  10. <text> {{detail.bike_no}}</text>
  11. <text style="margin-left:10rpx;"> (级别:{{detail.times}}级)</text>
  12. </view>
  13. </view>
  14. <view class="info flex">
  15. <view>
  16. <view>创建人</view>
  17. <view class="msg">{{detail.created_man}}</view>
  18. </view>
  19. <view>
  20. <view>处理人</view>
  21. <view class="msg">{{detail.received_name ? detail.received_name:'暂无'}}</view>
  22. </view>
  23. <view>
  24. <view>关闭人</view>
  25. <view class="msg">{{detail.work_over_name ?detail.work_over_name : '暂无'}}</view>
  26. </view>
  27. </view>
  28. <view class="position flex">
  29. <image src="http://resource.weilaibike.com/yunwei/pos.png"></image>
  30. <view style="color:#000;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;width:80%;">发生位置:{{detail.location}}</view>
  31. </view>
  32. </view>
  33. <view class="loading">工单进程</view>
  34. <view class="step">
  35. <view class="flexCC" style="margin-top:20rpx;">
  36. <image src="http://resource.weilaibike.com/yunwei/circle1.png" class="circle"></image>
  37. <image src="http://resource.weilaibike.com/yunwei/ellipsis.png" class="line"></image>
  38. <image src="http://resource.weilaibike.com/yunwei/circle1.png" class="circle"></image>
  39. <image src="http://resource.weilaibike.com/yunwei/ellipsis.png" class="line"></image>
  40. <image src="http://resource.weilaibike.com/yunwei/circle1.png" class="circle"></image>
  41. <image src="http://resource.weilaibike.com/yunwei/ellipsis.png" class="line"></image>
  42. <image src="http://resource.weilaibike.com/yunwei/circle1.png" class="circle"></image>
  43. </view>
  44. <view class="list" style="width:100%;">
  45. <view class="stepCon flexB" v-if="four">
  46. <view>
  47. <view>已完成</view>
  48. <view style="color:#FF6300;">{{detail.work_over_name}}</view>
  49. </view>
  50. <view>{{detail.work_over_time}}</view>
  51. </view>
  52. <view class="stepCon flexB" v-if="three">
  53. <view>
  54. <view>已处理</view>
  55. <view style="color:#FF6300;">{{detail.work_over_name}}</view>
  56. </view>
  57. <view>{{detail.work_over_time}}</view>
  58. </view>
  59. <view class="stepCon flexB" v-if="two">
  60. <view>
  61. <view>处理中</view>
  62. <view style="color:#FF6300;">{{detail.received_name}}</view>
  63. </view>
  64. <view>{{detail.received_at}}</view>
  65. </view>
  66. <view class="stepCon flexB" v-if="one">
  67. <view>
  68. <view>待接单</view>
  69. <view style="color:#FF6300;">{{detail.created_man}}</view>
  70. </view>
  71. <view>{{detail.created_at}}</view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="operate">
  76. <view class="flexC" @click="alarm">查看警报</view>
  77. <image src="http://resource.weilaibike.com/yunwei/btn.png" @click="openICon"></image>
  78. </view>
  79. <!-- 查看警报 -->
  80. <view class="cover" v-if="alarmShow" @click="closeAlarm"></view>
  81. <view class="alarmCon " v-if="alarmShow">
  82. <view class="alarmTitle flexC">
  83. <text>{{detail.bike_no}}报警列表</text>
  84. </view>
  85. <view class="alarmTab flexC">
  86. <view @click="alarmChoose" v-bind:data-state="0">限制报警类型</view>
  87. <view @click="alarmChoose" v-bind:data-state="1">不限制报警类型</view>
  88. </view>
  89. <scroll-view scroll-y="true" class="scroll">
  90. <view class="scrollCon">
  91. <view class="alList" v-for="(item,index2) in alarmList" :key='index2'>
  92. <view>{{item.type_name}}</view>
  93. <view class="source flexB">
  94. <text>来源:{{item.source}}</text>
  95. <text>时间:{{item.created_at}}</text>
  96. </view>
  97. </view>
  98. <view class="no" v-if="alarmList.length == 0">
  99. <image src="http://resource.weilaibike.com/none.png"></image>
  100. <view>暂无相关数据~</view>
  101. </view>
  102. </view>
  103. </scroll-view>
  104. <view>
  105. </view>
  106. </view>
  107. <!-- 显示操作步骤 -->
  108. <view class="cover" v-if="iconShow" @click="closeIcon"></view>
  109. <view class="icon" v-if="iconShow" :style="screenHeight=='xSeries' ? 'bottom:27%' : 'bottom:12%'">
  110. <view class="button" @click="closeIcon">
  111. <image src="http://resource.weilaibike.com/common/button.png" :style="screenHeight=='xSeries' ? 'bottom:16%' : 'bottom:-2%'"></image>
  112. </view>
  113. <view @click="finish" v-if="detail.planned==2">
  114. <text>已处理好,正常关闭</text>
  115. <image src="http://resource.weilaibike.com/common/finish.png"></image>
  116. </view>
  117. <view @click="reported" v-if="detail.planned==2">
  118. <text>可以上线,但有情况需要上报组长处理</text>
  119. <image src="http://resource.weilaibike.com/common/online.png"></image>
  120. </view>
  121. <view @click="reported" v-if="detail.planned==2">
  122. <text>有故障,报告组长并下线车辆</text>
  123. <image src="http://resource.weilaibike.com/common/outline.png"></image>
  124. </view>
  125. <view @click="getWork" v-if="detail.planned==1">
  126. <text>领取工单</text>
  127. <image src="http://resource.weilaibike.com/common/get.png"></image>
  128. </view>
  129. </view>
  130. <!-- 上报组长弹框 -->
  131. <view class="cover" v-if="commitShow" @click="closeIcon"></view>
  132. <view class="commit" v-if="commitShow">
  133. <view v-if="inpShow">
  134. <view class="title">生成组长工单</view>
  135. <input placeholder="请输入报告组长内容" bindinput="input"></input>
  136. </view>
  137. <view v-else>
  138. <view class="title">完成并关闭工单</view>
  139. <view class="detail">已处理好,正常</view>
  140. </view>
  141. <view style="text-align:right;">
  142. <text @click="cancel">取消</text>
  143. <text style="margin:0 50rpx 0 80rpx;" @click="submit">确定</text>
  144. </view>
  145. </view>
  146. </view>
  147. </template>
  148. <script>
  149. var app = getApp()
  150. export default {
  151. data() {
  152. return {
  153. planned: 2,
  154. iconShow: false, //是否显示图标弹窗
  155. commitShow: false, //上报组长
  156. inpShow: true, //显示输入框还是显示完成
  157. detail: [],
  158. one: false,
  159. two: false,
  160. three: false,
  161. four: false,
  162. id: '',
  163. value: '',
  164. screenHeight: '', //屏幕可视高度
  165. alarmShow: false, //是否显示警报弹窗【true 显示 false 不显示】
  166. topNum: 0, //返回顶部
  167. alarmState: 0, // 【0 限制警报类型 1 不限制报警类型】
  168. page: 1, //当前页面
  169. skipDetail: false,
  170. alarmList: ""
  171. }
  172. },
  173. onLoad(options) {
  174. this.id = options.id
  175. this.status();
  176. },
  177. methods: {
  178. status: function() {
  179. uni.showLoading({
  180. title: '加载中...',
  181. })
  182. app.request('work_order/workOrderDetail?work_order_id=' + this.id, '', 'GET').then(res => {
  183. console.log(res);
  184. uni.hideLoading();
  185. if (res.statusCode == 200) {
  186. this.detail = res.data,
  187. this.skipDetail = true
  188. if (res.data.planned == 4) {
  189. this.one = true,
  190. this.two = true,
  191. this.three = true,
  192. this.four = true
  193. } else if (res.data.planned == 3) {
  194. this.one = true,
  195. this.two = true,
  196. this.three = true
  197. } else if (res.data.planned == 2) {
  198. this.one = true,
  199. this.two = true
  200. } else if (res.data.planned == 1) {
  201. this.one = true
  202. }
  203. }
  204. })
  205. },
  206. alarm: function() {
  207. this.alarmShow = true
  208. this.getAlarm();
  209. },
  210. getAlarm: function() {
  211. uni.showLoading({
  212. title: '加载中...',
  213. })
  214. app.request('work_order/getWarningByWorkOrderId?id=' + this.id + '&is_limit_type=' + this.alarmState, '',
  215. 'GET').then(res => {
  216. uni.hideLoading();
  217. if (res.statusCode == 200) {
  218. this.alarmList = res.data
  219. }
  220. console.log(res)
  221. })
  222. },
  223. closeAlarm: function() {
  224. this.alarmShow = false
  225. },
  226. alarmChoose: function(e) {
  227. let state = e.currentTarget.dataset.state;
  228. this.alarmState = state,
  229. this.alarmList = []
  230. this.getAlarm();
  231. // sthis.goTop();
  232. },
  233. goHome: function() {
  234. if (this.skipDetail) {
  235. uni.reLaunch({
  236. url: '/pages/logs/logs?bike_no=' + this.detail.bike_no,
  237. })
  238. } else {
  239. uni.showToast({
  240. title: '页面加载完后再试',
  241. icon: 'none'
  242. })
  243. }
  244. },
  245. //打开图标弹窗
  246. openICon: function() {
  247. if (this.detail.planned == 4) {
  248. uni.showToast({
  249. title: '已完成',
  250. icon: 'none'
  251. })
  252. } else {
  253. this.iconShow = true
  254. }
  255. },
  256. //关闭图标弹窗
  257. closeIcon: function() {
  258. this.iconShow = false,
  259. this.commitShow = false,
  260. this.inpShow = false
  261. },
  262. //领取工单
  263. getWork: function() {
  264. uni.showLoading({
  265. title: '接单中..',
  266. })
  267. app.request('work_order/receive?work_order_id=' + this.id, '', 'GET').then(res => {
  268. uni.hideLoading();
  269. this.status()
  270. uni.showToast({
  271. title: '接单成功',
  272. icon: 'none'
  273. })
  274. this.iconShow = false
  275. })
  276. },
  277. //上报组长
  278. reported: function() {
  279. this.commitShow = true,
  280. this.iconShow = false,
  281. this.inpShow = true
  282. },
  283. //完成
  284. finish: function() {
  285. this.iconShow = false,
  286. this.commitShow = true,
  287. this.inpShow = false
  288. },
  289. //取消按钮
  290. cancel: function() {
  291. this.commitShow = false
  292. },
  293. //确定按钮
  294. submit: function() {
  295. uni.showLoading({
  296. title: '加载中...',
  297. })
  298. let condition = this.inpShow
  299. if (condition == true) {
  300. //调上报组长接口
  301. var data = {
  302. work_order_id: this.id,
  303. remark: this.value
  304. }
  305. app.request('work_order/upgrade', data, 'POST').then(res => {
  306. uni.hideLoading();
  307. console.log(res);
  308. if (res.statusCode == 200) {
  309. uni.showToast({
  310. title: '上报成功',
  311. icon: 'none'
  312. })
  313. this.inpShow = false,
  314. this.iconShow = false,
  315. this.commitShow = false
  316. this.status()
  317. }
  318. })
  319. } else {
  320. app.request('work_order/over?work_order_id=' + this.id, '', 'GET').then(res => {
  321. if (res.statusCode == 200) {
  322. uni.showToast({
  323. title: '处理完成',
  324. icon: 'none'
  325. })
  326. this.inpShow = false,
  327. this.iconShow = false,
  328. this.commitShow = false
  329. this.status()
  330. }
  331. })
  332. }
  333. },
  334. }
  335. }
  336. </script>
  337. <style>
  338. @import url("/static/css/base.css");
  339. /* pages/workDetail/workDetail.wxss */
  340. .workDetail .con {
  341. height: 380rpx;
  342. width: 95%;
  343. margin: 30rpx auto 0;
  344. background: url('http://resource.weilaibike.com/yunwei/workbg2.png') no-repeat;
  345. background-size: cover;
  346. position: relative;
  347. }
  348. /* .con>view {
  349. height: 50%;
  350. } */
  351. .con view {
  352. font-size: 26rpx;
  353. color: #fff;
  354. /* margin-top: 15rpx; */
  355. padding-left: 20rpx;
  356. }
  357. .con .bike {
  358. position: absolute;
  359. top: 0;
  360. right: 21rpx;
  361. width: 160rpx;
  362. height: 50rpx;
  363. }
  364. .con .reason {
  365. font-size: 32rpx;
  366. padding: 40rpx 0 10rpx 20rpx;
  367. }
  368. .con .work {
  369. display: flex;
  370. flex-direction: column;
  371. justify-content: center;
  372. padding-left: 68rpx;
  373. height: 50%;
  374. }
  375. .con .iconfont {
  376. font-size: 100rpx;
  377. color: #fff;
  378. position: absolute;
  379. bottom: 37rpx;
  380. right: 65rpx;
  381. }
  382. .info {
  383. height: 25%;
  384. }
  385. .info>view {
  386. width: 27.33%;
  387. text-align: center;
  388. }
  389. .info view {
  390. color: #212121;
  391. font-size: 24rpx;
  392. }
  393. .info .msg {
  394. font-weight: bold;
  395. margin-top: 15rpx;
  396. }
  397. .position {
  398. height: 25%;
  399. }
  400. .position image {
  401. width: 24rpx;
  402. height: 28rpx;
  403. margin-left: 15rpx;
  404. }
  405. .position view {
  406. font-size: 22rpx;
  407. }
  408. .loading {
  409. width: 90%;
  410. margin: 0 auto;
  411. font-size: 34rpx;
  412. font-weight: bold;
  413. padding: 35rpx 0 24rpx 0;
  414. }
  415. .step {
  416. width: 90%;
  417. margin: 0 auto;
  418. display: flex;
  419. justify-content: flex-start;
  420. }
  421. .step .circle {
  422. height: 28rpx;
  423. width: 28rpx;
  424. margin-bottom: 13rpx;
  425. }
  426. .step .line {
  427. height: 125rpx;
  428. width: 6rpx;
  429. }
  430. .stepCon {
  431. width: 95%;
  432. height: 114rpx;
  433. margin: 20rpx 0 0 20rpx;
  434. box-shadow: 0 0 6rpx 0 rgba(216, 216, 216, 1);
  435. border-radius: 10rpx;
  436. padding: 5rpx 40rpx;
  437. box-sizing: border-box;
  438. }
  439. .stepCon view {
  440. font-size: 24rpx;
  441. color: #4d4d4d;
  442. padding: 8rpx 0;
  443. }
  444. .icon {
  445. position: absolute;
  446. right: 12%;
  447. z-index: 9999;
  448. text-align: right;
  449. }
  450. .operate image {
  451. height: 148rpx;
  452. width: 148rpx;
  453. }
  454. .operate {
  455. width: 95%;
  456. margin: 0 auto;
  457. display: flex;
  458. justify-content: space-between;
  459. }
  460. .operate view {
  461. font-size: 28rpx;
  462. width: 200rpx;
  463. height: 88rpx;
  464. background: linear-gradient(to right, rgba(253, 142, 111, 1) 0%, rgba(249, 129, 12, 1) 100%);
  465. box-shadow: 0 12rpx 26rpx 0 rgba(255, 189, 165, 1);
  466. color: #fff;
  467. border-radius: 10rpx;
  468. margin-top: 20rpx;
  469. }
  470. .icon view {
  471. margin-bottom: 30rpx;
  472. }
  473. .icon image {
  474. height: 60rpx;
  475. width: 60rpx;
  476. vertical-align: middle;
  477. margin-left: 20rpx;
  478. }
  479. .icon view text {
  480. font-size: 26rpx;
  481. padding: 10rpx 40rpx;
  482. border-radius: 10rpx;
  483. background: rgba(0, 0, 0, 0.5);
  484. color: #fff;
  485. }
  486. .button image {
  487. width: 200rpx;
  488. height: 200rpx;
  489. position: fixed;
  490. right: 10rpx;
  491. }
  492. .commit {
  493. position: absolute;
  494. top: 50%;
  495. left: 50%;
  496. transform: translate(-50%, -50%);
  497. background: #fff;
  498. width: 640rpx;
  499. height: 296rpx;
  500. z-index: 9999;
  501. border-radius: 8rpx;
  502. padding: 20rpx;
  503. box-sizing: border-box;
  504. }
  505. .commit input {
  506. font-size: 28rpx;
  507. border-bottom: 1px solid #000;
  508. margin: 40rpx 0;
  509. padding-bottom: 15rpx;
  510. }
  511. .commit .placeholder {
  512. font-size: 24rpx;
  513. color: #ADADAD;
  514. }
  515. .commit .title {
  516. font-size: 34rpx;
  517. color: #282828;
  518. font-weight: 600;
  519. }
  520. .commit .detail {
  521. margin: 40rpx 0;
  522. font-size: 26rpx;
  523. }
  524. .commit text {
  525. font-size: 26rpx;
  526. color: #F9831F;
  527. }
  528. /* 警报弹窗 */
  529. .alarmCon {
  530. background: #fff;
  531. position: fixed;
  532. bottom: 0%;
  533. left: 0%;
  534. z-index: 9999;
  535. width: 100%;
  536. border-top-left-radius: 25rpx;
  537. border-top-right-radius: 25rpx;
  538. }
  539. .alarmTitle {
  540. width: 100%;
  541. padding-top: 20rpx;
  542. }
  543. .alarmTab {
  544. width: 90%;
  545. margin: 20rpx auto 0rpx;
  546. background: #fff;
  547. padding: 15rpx;
  548. }
  549. .alarmTitle text {
  550. font-size: 32rpx;
  551. font-weight: 600;
  552. }
  553. .alarmTab view {
  554. font-size: 28rpx;
  555. padding: 15rpx 30rpx;
  556. color: #F9831F;
  557. border: 1px solid #F9831F;
  558. }
  559. .alarmTab view:first-child {
  560. border-top-left-radius: 15rpx;
  561. border-bottom-left-radius: 15rpx;
  562. }
  563. .alarmTab view:last-child {
  564. border-top-right-radius: 15rpx;
  565. border-bottom-right-radius: 15rpx;
  566. }
  567. .alarmTab .cur {
  568. background: #F9831F;
  569. color: #fff;
  570. }
  571. .alarmCon .alList:first-child {
  572. margin-top: 20rpx;
  573. }
  574. .alList {
  575. width: 90%;
  576. margin: 0rpx auto 20rpx;
  577. box-shadow: 0 0 13rpx 0 rgba(216, 216, 216, 1);
  578. border-radius: 10rpx;
  579. padding: 15rpx 20rpx;
  580. }
  581. .alList .source {
  582. font-size: 26rpx;
  583. margin-top: 15rpx;
  584. color: #555;
  585. }
  586. .no {
  587. width: 100%;
  588. margin: 0 auto;
  589. text-align: center;
  590. margin-top: 121rpx;
  591. }
  592. .no image {
  593. width: 200rpx;
  594. height: 200rpx;
  595. margin-bottom: 20rpx;
  596. }
  597. .scroll {
  598. height: 840rpx;
  599. display: flex;
  600. flex-direction: column;
  601. align-items: center;
  602. }
  603. .scrollCon {
  604. padding: 0rpx 0 20rpx 0;
  605. }
  606. </style>