workOrderDetails.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <template>
  2. <view>
  3. <u-navbar title="工单详情" title-color="#101010"></u-navbar>
  4. <!-- 工单详情 -->
  5. <view class="main">
  6. <view class="title">
  7. <view class="number">
  8. 工单编号:{{detail.billNum}}
  9. </view>
  10. <view class="state" v-if="detail.status == 'dispatched'">
  11. 进行中
  12. </view>
  13. <view class="state state2" v-if="detail.status == 'created'">
  14. 待指派
  15. </view>
  16. <view class="state state3" v-if="detail.status == 'ended'">
  17. 已解决
  18. </view>
  19. <view class="state state4" v-if="detail.status == 'closed'">
  20. 已关闭
  21. </view>
  22. </view>
  23. <view class="content">
  24. <view class="content-item">
  25. <view class="item-title">
  26. 告警设备
  27. </view>
  28. <view class="item-value">
  29. {{detail.ownerOrgName}}-{{detail.deviceName}}
  30. </view>
  31. </view>
  32. <view class="content-item">
  33. <view class="item-title">
  34. 告警类型
  35. </view>
  36. <view class="item-value">
  37. {{detail.faultTypeName}}
  38. </view>
  39. </view>
  40. <view class="content-item">
  41. <view class="item-title">
  42. 地址
  43. </view>
  44. <view class="item-value">
  45. {{detail.deviceAddress}}
  46. <image class="img" src="@/assets/img/riFill-navigation-fill 1.svg" mode=""></image>
  47. </view>
  48. </view>
  49. <view class="content-item">
  50. <view class="item-title">
  51. 告警时间
  52. </view>
  53. <view class="item-value">
  54. {{detail.createTime}}
  55. </view>
  56. </view>
  57. <view class="content-picture" v-if="picList.length != 0">
  58. <view class="picture-title">
  59. 现场照片/视频
  60. </view>
  61. <view class="picture-box">
  62. <image v-for="item in picList" class="img" :src="item" mode=""></image>
  63. </view>
  64. </view>
  65. <view class="content-item" v-if="detail.repairAccepter != null">
  66. <view class="item-title">
  67. 运维专员
  68. </view>
  69. <view class="item-value">
  70. <view class="photo">
  71. <image class="photo-img" src="@/assets/img/默认头像.png" mode=""></image>
  72. </view>
  73. {{detail.repairAccepter}} {{detail.repairContacter}}
  74. <image class="img" src="@/assets/img/riFill-phone-fill.svg" mode=""></image>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <!-- 处理记录 -->
  80. <view class="record" v-if="false">
  81. <view class="title">
  82. <view class="icon">
  83. </view>
  84. <view class="text">
  85. 处理记录
  86. </view>
  87. </view>
  88. <!-- 时间轴 -->
  89. <view class="time-line">
  90. <u-time-line>
  91. <!-- 关闭原因 -->
  92. <u-time-line-item nodeTop="10">
  93. <template v-slot:node>
  94. <view class="u-node">
  95. </view>
  96. </template>
  97. <template v-slot:content>
  98. <view>
  99. <view class="u-order-title"> <text class="name">我 </text>关闭了工单</view>
  100. <view class="u-order-desc">关闭原因:错误告警</view>
  101. <view class="u-order-time">2019-05-08 12:12</view>
  102. </view>
  103. </template>
  104. </u-time-line-item>
  105. <!-- 关闭工单 -->
  106. <u-time-line-item nodeTop="10">
  107. <template v-slot:node>
  108. <view class="u-node">
  109. </view>
  110. </template>
  111. <template v-slot:content>
  112. <view>
  113. <view class="u-order-title">关闭工单</view>
  114. <view class="u-order-time">2019-05-08 12:12</view>
  115. </view>
  116. </template>
  117. </u-time-line-item>
  118. <!-- 完成工单 -->
  119. <u-time-line-item nodeTop="10">
  120. <template v-slot:content>
  121. <view>
  122. <view class="u-order-title"> <text class="name">郭群 </text>完成工单</view>
  123. <view class="u-order-desc">处理结果:冻雨天气导致私变线路问题,已解决。</view>
  124. <view class="u-order-picture">
  125. <image v-for="item in 4" class="img" src="@/assets/img/pImage@1x.png" mode="">
  126. </image>
  127. </view>
  128. <view class="u-order-time">2019-05-08 12:12</view>
  129. </view>
  130. </template>
  131. </u-time-line-item>
  132. <u-time-line-item nodeTop="10">
  133. <template v-slot:content>
  134. <view>
  135. <view class="u-order-title">平台指派 <text class="name">郭群 </text>处理工单</view>
  136. <view class="u-order-time">2019-05-08 12:12</view>
  137. </view>
  138. </template>
  139. </u-time-line-item>
  140. <u-time-line-item nodeTop="10">
  141. <template v-slot:content>
  142. <view>
  143. <view class="u-order-title">触发告警 温度过高</view>
  144. <view class="u-order-time">2019-05-08 12:12</view>
  145. </view>
  146. </template>
  147. </u-time-line-item>
  148. </u-time-line>
  149. </view>
  150. </view>
  151. <!-- 底部 -->
  152. <view class="bottom" v-if="detail.status == 'dispatched'">
  153. <button class="back" @click="back">返回</button>
  154. <button class="confirm" @click="resultShow=true">确认解决</button>
  155. </view>
  156. <!-- 填写处理结果 -->
  157. <u-popup v-model="resultShow" mode="bottom" border-radius="12">
  158. <view class="result-content">
  159. <view class="title">
  160. 填写处理结果
  161. </view>
  162. <view class="textarea">
  163. <textarea placeholder="请填写处理结果"></textarea>
  164. </view>
  165. <!-- 上传照片 -->
  166. <view class="upload">
  167. <view class="title">
  168. 上传现场照片
  169. </view>
  170. <view class="upload-picture">
  171. <u-upload max-count="4" width="144" height="144" :action="action" :file-list="fileList"></u-upload>
  172. </view>
  173. </view>
  174. <!-- 按钮 -->
  175. <view class="btn-box">
  176. <button class="cancel">取消</button>
  177. <button class="submit">提交</button>
  178. </view>
  179. </view>
  180. </u-popup>
  181. </view>
  182. </template>
  183. <script>
  184. import * as API from '@/apis/pagejs/index.js'
  185. import * as API_workOrder from '@/apis/pagejs/workOrder.js'
  186. export default {
  187. data() {
  188. return {
  189. picList: [],
  190. detail: {}, //工单详细
  191. resultShow: false,
  192. action: '',
  193. fileList: [],
  194. formData: {}
  195. }
  196. },
  197. onLoad(op) {
  198. this.action = process.car.BASE_URL + "uploadFile";
  199. this.formData = {
  200. subFolder: "workorder"
  201. }
  202. var token = this.carhelp.getToken();
  203. this.header = {
  204. 'Authorization': token,
  205. 'X-Requested-With': 'application/x-www-form-urlencoded'
  206. }
  207. if(op.id) {
  208. this.getWorkOrderDetail(op.id);
  209. }
  210. },
  211. methods: {
  212. getWorkOrderDetail(id) {
  213. uni.showLoading({
  214. title: "加载中",
  215. mask: true,
  216. })
  217. API_workOrder.workOrderDetail(id).then((res) => {
  218. uni.hideLoading();
  219. this.detail = res.data;
  220. this.picList = res.data.pic.split(',');
  221. console.log(this.picList)
  222. }).catch(error => {
  223. uni.showToast({
  224. title: error,
  225. icon: "none"
  226. })
  227. })
  228. },
  229. back() {
  230. uni.navigateBack()
  231. }
  232. }
  233. }
  234. </script>
  235. <style lang="scss" scoped>
  236. page {
  237. padding-bottom: 100px;
  238. }
  239. // 工单详情
  240. .main {
  241. background-color: #fff;
  242. .title {
  243. display: flex;
  244. justify-content: space-between;
  245. padding: 24rpx 32rpx;
  246. box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.1);
  247. .number {
  248. color: rgba(51, 51, 51, 1);
  249. }
  250. .state {
  251. border-radius: 4px;
  252. background-color: rgba(255, 255, 255, 1);
  253. color: rgba(22, 119, 255, 1);
  254. font-size: 24rpx;
  255. border: 1px solid rgba(22, 119, 255, 1);
  256. width: 96rpx;
  257. height: 48rpx;
  258. line-height: 48rpx;
  259. text-align: center;
  260. }
  261. .state2 {
  262. color: rgba(255,123,0,1);
  263. border: 1px solid rgba(255,123,0,1);
  264. // color: rgba(255, 68, 68, 1);
  265. // border: 1px solid rgba(255, 68, 68, 1);
  266. }
  267. .state3 {
  268. color: rgba(0, 185, 98, 1);
  269. border: 1px solid rgba(0, 185, 98, 1);
  270. }
  271. .state4 {
  272. border: 1px solid rgba(171, 171, 171, 1);
  273. color: rgba(119, 119, 119, 1);
  274. }
  275. }
  276. .content {
  277. .content-item {
  278. display: flex;
  279. align-items: center;
  280. justify-content: space-between;
  281. padding: 24rpx 0;
  282. margin: 0 32rpx;
  283. border-bottom: 1px solid rgba(242, 242, 242, 1);
  284. font-size: 32rpx;
  285. .item-title {
  286. color: rgba(51, 51, 51, 1);
  287. }
  288. .item-value {
  289. color: rgba(16, 16, 16, 1);
  290. display: flex;
  291. align-items: center;
  292. .photo-img {
  293. width: 40rpx;
  294. height: 40rpx;
  295. border-radius: 999px;
  296. vertical-align: middle;
  297. margin-right: 24rpx;
  298. }
  299. .img {
  300. width: 32rpx;
  301. height: 32rpx;
  302. transform: scaleX(-1);
  303. margin-left: 8rpx;
  304. }
  305. }
  306. }
  307. .content-picture {
  308. padding: 24rpx 32rpx;
  309. border-bottom: 1px solid rgba(242, 242, 242, 1);
  310. .picture-title {
  311. color: rgba(51, 51, 51, 1);
  312. font-size: 32rpx;
  313. }
  314. .picture-box {
  315. margin-top: 16rpx;
  316. display: flex;
  317. // justify-content: space-around;
  318. .img {
  319. width: 160rpx;
  320. height: 160rpx;
  321. border-radius: 4px;
  322. margin-right: 16rpx;
  323. }
  324. }
  325. }
  326. }
  327. }
  328. // 处理记录
  329. .record {
  330. padding: 32rpx;
  331. margin-top: 54rpx;
  332. background-color: #fff;
  333. .title {
  334. display: flex;
  335. align-items: center;
  336. line-height: 32rpx;
  337. .icon {
  338. background-color: rgba(22, 119, 255, 1);
  339. width: 4px;
  340. height: 16px;
  341. }
  342. .text {
  343. color: rgb(16, 16, 16);
  344. font-size: 36rpx;
  345. margin-left: 12rpx;
  346. font-weight: bold;
  347. }
  348. }
  349. // 时间轴
  350. .time-line {
  351. margin-top: 28rpx;
  352. .u-node {
  353. width: 18rpx;
  354. height: 18rpx;
  355. border-radius: 10px;
  356. background-color: rgba(22, 119, 255, 1);
  357. }
  358. ::v-deep.u-time-axis {
  359. padding-left: 4rpx;
  360. }
  361. // 照片
  362. .u-order-picture {
  363. .img {
  364. width: 120rpx;
  365. height: 120rpx;
  366. margin-right: 16rpx;
  367. }
  368. }
  369. .u-order-title {
  370. color: rgba(51, 51, 51, 1);
  371. font-size: 32rpx;
  372. .name {
  373. color: #1677FF;
  374. margin: 0 4rpx;
  375. font-weight: bold;
  376. }
  377. }
  378. .u-order-desc {
  379. color: rgba(51, 51, 51, 1);
  380. font-size: 28rpx;
  381. margin: 16rpx 0;
  382. }
  383. .u-order-time {
  384. color: rgba(119, 119, 119, 1);
  385. font-size: 24rpx;
  386. margin-top: 8rpx;
  387. }
  388. ::v-deep.u-dot {
  389. background: #cdcdcd !important;
  390. width: 18rpx;
  391. height: 18rpx;
  392. border-radius: 10px;
  393. }
  394. ::v-deep.u-time-axis-item::before {
  395. border-left: 1px solid #cdcdcd !important;
  396. }
  397. ::v-deep.u-time-axis-item {
  398. margin-bottom: 40rpx;
  399. }
  400. }
  401. }
  402. // 底部
  403. .bottom {
  404. display: flex;
  405. justify-content: space-between;
  406. position: fixed;
  407. bottom: 0;
  408. left: 0;
  409. right: 0;
  410. background-color: #fff;
  411. padding: 20rpx 32rpx;
  412. z-index: 999;
  413. .back {
  414. width: 328rpx;
  415. line-height: 80rpx;
  416. border-radius: 4px;
  417. background-color: rgba(222, 225, 228, 1);
  418. color: rgba(51, 51, 51, 1);
  419. font-size: 32rpx
  420. }
  421. .confirm {
  422. width: 328rpx;
  423. line-height: 80rpx;
  424. border-radius: 4px;
  425. background-color: rgba(22, 119, 255, 1);
  426. color: rgba(255, 255, 255, 1);
  427. font-size: 32rpx
  428. }
  429. }
  430. // 填写处理结果
  431. .result-content {
  432. padding: 32rpx;
  433. .textarea {
  434. margin-top: 32rpx;
  435. uni-textarea {
  436. width: 100%;
  437. height: 160rpx;
  438. background-color: rgba(241, 242, 245, 1);
  439. text-indent: 28rpx;
  440. padding: 8rpx 0;
  441. border-radius: 8px;
  442. }
  443. }
  444. // 上传照片
  445. .upload {
  446. margin-top: 24rpx;
  447. .title {
  448. color: rgba(16, 16, 16, 1);
  449. font-size: 32rpx;
  450. }
  451. .upload-picture {
  452. margin-top: 16rpx;
  453. }
  454. }
  455. // 按钮
  456. .btn-box {
  457. display: flex;
  458. justify-content: space-between;
  459. background-color: #fff;
  460. margin-top: 68rpx;
  461. .cancel {
  462. width: 328rpx;
  463. line-height: 80rpx;
  464. border-radius: 4px;
  465. background-color: rgba(222, 225, 228, 1);
  466. color: rgba(51, 51, 51, 1);
  467. font-size: 32rpx
  468. }
  469. .submit {
  470. width: 328rpx;
  471. line-height: 80rpx;
  472. border-radius: 4px;
  473. background-color: rgba(22, 119, 255, 1);
  474. color: rgba(255, 255, 255, 1);
  475. font-size: 32rpx
  476. }
  477. }
  478. }
  479. </style>