repairDetails.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <template>
  2. <view class="container">
  3. <view class="title">工单信息</view>
  4. <view class="box">
  5. <view class="box_key">工单编号:</view>
  6. <view class="box_value">{{ detailInfo.recordNo }}</view>
  7. </view>
  8. <view class="box_time">
  9. <view class="time_msg">
  10. 报修时间:
  11. <text>{{ detailInfo.reportTime }}</text>
  12. </view>
  13. <view class="time_type" v-if="detailInfo.state === '待接单'">待接单</view>
  14. <view class="time_type color_type" v-if="detailInfo.state === '维修中'">维修中</view>
  15. <view class="time_type" v-if="detailInfo.state === '待确认'">待确认</view>
  16. <view class="time_type color_type2" v-if="detailInfo.state === '已完成'">已完成</view>
  17. <view class="time_type" v-if="detailInfo.state === '已取消'">已取消</view>
  18. <view class="time_type color_type3" v-if="detailInfo.state === '已关单'">已关单</view>
  19. <view class="time_type color_type" v-if="detailInfo.state === '转单审核'">转单审核</view>
  20. <view class="time_type color_type" v-if="detailInfo.state === '协作审核'">协作审核</view>
  21. </view>
  22. <view class="box">
  23. <view class="box_key">报修姓名:</view>
  24. <view class="box_value">{{ detailInfo.userName }}</view>
  25. </view>
  26. <view class="box">
  27. <view class="box_key">报修电话:</view>
  28. <view class="box_value phone" @click="handleCallPhone(detailInfo.userPhone)">
  29. {{ detailInfo.userPhone }}
  30. <img src="../../static/images/repairsImg/phone.png" />
  31. </view>
  32. </view>
  33. <view class="box">
  34. <view class="box_key">报修区域:</view>
  35. <view class="box_value">{{ detailInfo.areaName }}</view>
  36. </view>
  37. <view class="box">
  38. <view class="box_key">详细地址:</view>
  39. <view class="box_value">{{ detailInfo.address }}</view>
  40. </view>
  41. <view class="box">
  42. <view class="box_key">报修物品:</view>
  43. <view class="box_value">{{ detailInfo.articleName }}</view>
  44. </view>
  45. <view class="box" v-if="detailInfo.description">
  46. <view class="box_key">故障描述:</view>
  47. <view class="box_value">{{ detailInfo.description }}</view>
  48. </view>
  49. <view class="box" v-if="detailInfo.voice">
  50. <view class="box_key">报修录音:</view>
  51. <view class="box_value">
  52. <view class="recording" @click="handlePlayRecording(detailInfo)">
  53. <img class="voiceImg" :src="detailInfo.status ? '../../static/images/repairsImg/play_active.png' : '../../static/images/repairsImg/play.png'" />
  54. {{ detailInfo.voiceLength }}″
  55. </view>
  56. </view>
  57. </view>
  58. <view class="box_img">
  59. <view class="img_key">上传图片:</view>
  60. <img class="img_value" mode="aspectFill" :src="detailInfo.images[0]" @click="handleLookImgs(detailInfo.images)" />
  61. </view>
  62. <view class="box top" v-if="detailInfo.maintenancerName">
  63. <view class="box_key">维修师傅:</view>
  64. <view class="box_value">{{ detailInfo.maintenancerName }}</view>
  65. </view>
  66. <view class="box" v-if="detailInfo.maintenancerPhone">
  67. <view class="box_key">师傅电话:</view>
  68. <view class="box_value phone" @click="handleCallPhone(detailInfo.maintenancerPhone)">
  69. {{ detailInfo.maintenancerPhone }}
  70. <img src="../../static/images/repairsImg/phone.png" />
  71. </view>
  72. </view>
  73. <view class="box" v-if="detailInfo.price">
  74. <view class="box_key">维修费用:</view>
  75. <view class="box_value2 phone" @click="checkFeeDetail(detailInfo)">
  76. {{ detailInfo.price }}元
  77. <img src="../../static/images/repairsImg/eye.png" />
  78. </view>
  79. </view>
  80. <view class="title top" v-if="detailInfo.tracks">报修跟踪</view>
  81. <!-- 步骤条区域 -->
  82. <uv-steps activeColor="#6FB6B8" direction="column" v-if="detailInfo.tracks" :current="detailInfo.tracks.length">
  83. <uv-steps-item :customStyle="customStyle" v-for="item in detailInfo.tracks" :key="item.id">
  84. <template v-slot:title>
  85. <view class="steps_title" :class="{ active: true }">{{ item.state }}</view>
  86. </template>
  87. <template v-slot:desc>
  88. <view class="steps_desc">{{ item.createTime }}</view>
  89. <view class="steps_desc" v-if="item.userName">操作人:{{ item.userName }}({{ item.userZzstr }})</view>
  90. <view class="steps_desc" v-if="item.voice">
  91. 上传录音
  92. <view class="desc_recording" @click="handlePlayRecording(item)">
  93. <img class="voiceImg" :src="item.status ? '../../static/images/repairsImg/play_active.png' : '../../static/images/repairsImg/play.png'" />
  94. {{ item.voiceLength }}″
  95. </view>
  96. </view>
  97. <view class="steps_desc2" v-if="item.images">
  98. 上传图片:
  99. <view class="desc_imgList">
  100. <img mode="aspectFill" v-for="(ele, index) in item.images" :key="index" :src="ele" @click="handleLookImages(item.images, index)" />
  101. </view>
  102. </view>
  103. <view class="steps_desc" v-if="item.content">{{ item.content }}</view>
  104. </template>
  105. </uv-steps-item>
  106. </uv-steps>
  107. <view class="gap"></view>
  108. <!-- 维修费用弹窗 -->
  109. <uni-popup :is-mask-click="false" ref="popup_fee">
  110. <view class="pop_fee">
  111. <view class="fee_title">
  112. 维修费用
  113. <text @click="$refs.popup_fee.close()">×</text>
  114. </view>
  115. <view class="fee_list">
  116. <view class="fee_item" v-for="ele in consumables" :key="ele.id">
  117. <view class="fee_box">
  118. 耗材:
  119. <text>{{ ele.consumeName }}</text>
  120. </view>
  121. <view class="fee_box">
  122. 耗材单价:
  123. <text>{{ ele.price }}元</text>
  124. </view>
  125. <view class="fee_box">
  126. 耗材数量:
  127. <text>{{ ele.number }}</text>
  128. </view>
  129. <view class="fee_box">
  130. 耗材费用:
  131. <text>{{ ele.totalPrice }}元</text>
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. </uni-popup>
  137. </view>
  138. </template>
  139. <script>
  140. const innerAudioContext = uni.createInnerAudioContext()
  141. export default {
  142. data() {
  143. return {
  144. // 报修详情信息
  145. detailInfo: {},
  146. // 步骤条样式
  147. customStyle: {
  148. marginBottom: '5px'
  149. },
  150. // 订单id
  151. recordId: '',
  152. // 维修费用耗材明细列表
  153. consumables: [],
  154. // 定时器标识
  155. timer: null
  156. }
  157. },
  158. onLoad(options) {
  159. this.recordId = options.id
  160. this.getData()
  161. },
  162. methods: {
  163. // 获取报修详情信息
  164. async getData() {
  165. const res = await this.$myRequest_repairs({
  166. url: '/repairRecord/details',
  167. data: {
  168. recordId: this.recordId
  169. }
  170. })
  171. // console.log(res)
  172. if (res.code === '200') {
  173. if (res.data.tracks.length) {
  174. res.data.tracks.forEach((ele) => {
  175. return (ele.status = false)
  176. })
  177. }
  178. this.detailInfo = res.data
  179. this.$set(this.detailInfo, 'status', false)
  180. }
  181. },
  182. // 查看维修费用回调
  183. checkFeeDetail(item) {
  184. this.$refs.popup_fee.open('center')
  185. this.consumables = item.consumables
  186. },
  187. // 点击电话号码回调
  188. handleCallPhone(phone) {
  189. uni.makePhoneCall({
  190. phoneNumber: phone
  191. })
  192. },
  193. // 点击图片回调
  194. handleLookImgs(img) {
  195. uni.previewImage({
  196. urls: img
  197. })
  198. },
  199. // 点击报修跟踪图片回调
  200. handleLookImages(urls, current) {
  201. uni.previewImage({
  202. urls,
  203. current
  204. })
  205. },
  206. // 点击录音播放回调
  207. handlePlayRecording(item) {
  208. // 先重置播放状态
  209. if (this.detailInfo.id === item.id) {
  210. this.detailInfo.tracks.forEach((ele) => {
  211. ele.status = false
  212. })
  213. } else {
  214. this.detailInfo.status = false
  215. this.detailInfo.tracks.forEach((ele) => {
  216. if (ele.id !== item.id) {
  217. ele.status = false
  218. }
  219. })
  220. }
  221. // 赋值音频地址
  222. innerAudioContext.src = item.voice
  223. if (!item.status) {
  224. item.status = true
  225. innerAudioContext.play()
  226. //播放结束
  227. innerAudioContext.onEnded(() => {
  228. item.status = false
  229. })
  230. } else {
  231. item.status = false
  232. innerAudioContext.stop()
  233. }
  234. }
  235. }
  236. }
  237. </script>
  238. <style lang="scss" scoped>
  239. .container {
  240. padding: 0 30rpx;
  241. height: 100vh;
  242. overflow-y: auto;
  243. .title {
  244. height: 90rpx;
  245. line-height: 90rpx;
  246. font-size: 32rpx;
  247. font-weight: bold;
  248. }
  249. .top {
  250. margin-top: 20rpx;
  251. }
  252. .box {
  253. display: flex;
  254. line-height: 60rpx;
  255. font-size: 28rpx;
  256. .box_key {
  257. color: #808080;
  258. }
  259. .box_value {
  260. flex: 1;
  261. display: flex;
  262. align-items: center;
  263. img {
  264. margin-left: 10rpx;
  265. width: 28rpx;
  266. height: 28rpx;
  267. }
  268. .recording {
  269. display: flex;
  270. align-items: center;
  271. width: 130rpx;
  272. height: 40rpx;
  273. color: #000;
  274. border-radius: 100rpx;
  275. border: 1rpx solid #cccccc;
  276. .voiceImg {
  277. margin: 0 12rpx;
  278. width: 30rpx;
  279. height: 30rpx;
  280. }
  281. }
  282. }
  283. .box_value2 {
  284. display: flex;
  285. align-items: center;
  286. img {
  287. margin-top: -2rpx;
  288. margin-left: 14rpx;
  289. width: 46rpx;
  290. height: 46rpx;
  291. }
  292. }
  293. .phone {
  294. color: #6fb6b8;
  295. }
  296. }
  297. .box_time {
  298. display: flex;
  299. height: 60rpx;
  300. .time_msg {
  301. font-size: 28rpx;
  302. color: #808080;
  303. text {
  304. color: #000000;
  305. }
  306. }
  307. .time_type {
  308. margin-left: 123rpx;
  309. margin-top: -5rpx;
  310. font-size: 32rpx;
  311. color: #ff5733;
  312. }
  313. .color_type {
  314. color: #1e7dfb;
  315. }
  316. .color_type2 {
  317. color: #6fb6b8;
  318. }
  319. .color_type3 {
  320. color: #cccccc;
  321. }
  322. }
  323. .box_img {
  324. display: flex;
  325. align-items: center;
  326. height: 120rpx;
  327. color: #808080;
  328. font-size: 28rpx;
  329. .img_key {
  330. }
  331. .img_value {
  332. width: 120rpx;
  333. height: 120rpx;
  334. border-radius: 14rpx;
  335. }
  336. }
  337. .steps_title {
  338. color: #969799;
  339. font-size: 28rpx;
  340. }
  341. .active {
  342. color: #6fb6b8;
  343. }
  344. .steps_desc {
  345. display: flex;
  346. align-items: center;
  347. line-height: 45rpx;
  348. font-size: 24rpx;
  349. img {
  350. margin: 10rpx 0;
  351. width: 80rpx;
  352. height: 80rpx;
  353. border-radius: 14rpx;
  354. }
  355. .desc_recording {
  356. display: flex;
  357. align-items: center;
  358. margin-left: 10rpx;
  359. width: 130rpx;
  360. height: 40rpx;
  361. color: #000;
  362. border-radius: 100rpx;
  363. border: 1rpx solid #cccccc;
  364. .voiceImg {
  365. margin: 0 12rpx;
  366. width: 30rpx;
  367. height: 30rpx;
  368. }
  369. }
  370. }
  371. .steps_desc2 {
  372. display: flex;
  373. margin: 10rpx 0;
  374. line-height: 45rpx;
  375. font-size: 24rpx;
  376. .desc_imgList {
  377. display: flex;
  378. flex-wrap: wrap;
  379. img {
  380. margin-right: 10rpx;
  381. width: 120rpx;
  382. height: 120rpx;
  383. border-radius: 14rpx;
  384. }
  385. }
  386. }
  387. .gap {
  388. height: 20rpx;
  389. }
  390. .pop_fee {
  391. padding-bottom: 50rpx;
  392. border-radius: 19rpx;
  393. background-color: #fff;
  394. .fee_title {
  395. display: flex;
  396. justify-content: space-between;
  397. align-items: center;
  398. box-sizing: border-box;
  399. padding: 0 31rpx 0 42rpx;
  400. width: 690rpx;
  401. height: 110rpx;
  402. font-size: 32rpx;
  403. font-weight: bold;
  404. border-radius: 19rpx 19rpx 0 0;
  405. border-bottom: 1rpx solid #e6e6e6;
  406. text {
  407. font-size: 45rpx;
  408. font-weight: 400;
  409. color: #808080;
  410. }
  411. }
  412. .fee_list {
  413. max-height: 50vh;
  414. overflow-y: auto;
  415. .fee_item {
  416. border-bottom: 1rpx solid #e6e6e6;
  417. .fee_box {
  418. display: flex;
  419. align-items: center;
  420. padding-left: 42rpx;
  421. height: 80rpx;
  422. font-size: 28rpx;
  423. color: #808080;
  424. text {
  425. color: #000000;
  426. }
  427. }
  428. }
  429. }
  430. }
  431. }
  432. </style>