repairDetails.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  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_desc" v-if="item.content">{{ item.content }}</view>
  98. </template>
  99. </uv-steps-item>
  100. </uv-steps>
  101. <view class="gap"></view>
  102. <!-- 维修费用弹窗 -->
  103. <uni-popup :is-mask-click="false" ref="popup_fee">
  104. <view class="pop_fee">
  105. <view class="fee_title">
  106. 维修费用
  107. <text @click="$refs.popup_fee.close()">×</text>
  108. </view>
  109. <view class="fee_list">
  110. <view class="fee_item" v-for="ele in consumables" :key="ele.id">
  111. <view class="fee_box">
  112. 耗材:
  113. <text>{{ ele.consumeName }}</text>
  114. </view>
  115. <view class="fee_box">
  116. 耗材单价:
  117. <text>{{ ele.price }}元</text>
  118. </view>
  119. <view class="fee_box">
  120. 耗材数量:
  121. <text>{{ ele.number }}</text>
  122. </view>
  123. <view class="fee_box">
  124. 耗材费用:
  125. <text>{{ ele.totalPrice }}元</text>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </uni-popup>
  131. </view>
  132. </template>
  133. <script>
  134. const innerAudioContext = uni.createInnerAudioContext()
  135. export default {
  136. data() {
  137. return {
  138. // 报修详情信息
  139. detailInfo: {},
  140. // 步骤条样式
  141. customStyle: {
  142. marginBottom: '5px'
  143. },
  144. // 订单id
  145. recordId: '',
  146. // 维修费用耗材明细列表
  147. consumables: [],
  148. // 定时器标识
  149. timer: null
  150. }
  151. },
  152. onLoad(options) {
  153. this.recordId = options.id
  154. this.getData()
  155. },
  156. methods: {
  157. // 获取报修详情信息
  158. async getData() {
  159. const res = await this.$myRequest_repairs({
  160. url: '/repairRecord/details',
  161. data: {
  162. recordId: this.recordId
  163. }
  164. })
  165. // console.log(res)
  166. if (res.code === '200') {
  167. if (res.data.tracks.length) {
  168. res.data.tracks.forEach((ele) => {
  169. return (ele.status = false)
  170. })
  171. }
  172. this.detailInfo = res.data
  173. this.$set(this.detailInfo, 'status', false)
  174. }
  175. },
  176. // 查看维修费用回调
  177. checkFeeDetail(item) {
  178. this.$refs.popup_fee.open('center')
  179. this.consumables = item.consumables
  180. },
  181. // 点击电话号码回调
  182. handleCallPhone(phone) {
  183. uni.makePhoneCall({
  184. phoneNumber: phone
  185. })
  186. },
  187. // 点击图片回调
  188. handleLookImgs(img) {
  189. uni.previewImage({
  190. urls: img
  191. })
  192. },
  193. // 点击录音播放回调
  194. handlePlayRecording(item) {
  195. // 先重置播放状态
  196. if (this.detailInfo.id === item.id) {
  197. this.detailInfo.tracks.forEach((ele) => {
  198. ele.status = false
  199. })
  200. } else {
  201. this.detailInfo.status = false
  202. this.detailInfo.tracks.forEach((ele) => {
  203. if (ele.id !== item.id) {
  204. ele.status = false
  205. }
  206. })
  207. }
  208. // 赋值音频地址
  209. innerAudioContext.src = item.voice
  210. if (!item.status) {
  211. item.status = true
  212. innerAudioContext.play()
  213. //播放结束
  214. innerAudioContext.onEnded(() => {
  215. item.status = false
  216. })
  217. } else {
  218. item.status = false
  219. innerAudioContext.stop()
  220. }
  221. }
  222. }
  223. }
  224. </script>
  225. <style lang="scss" scoped>
  226. .container {
  227. padding: 0 30rpx;
  228. height: 100vh;
  229. overflow-y: auto;
  230. .title {
  231. height: 90rpx;
  232. line-height: 90rpx;
  233. font-size: 32rpx;
  234. font-weight: bold;
  235. }
  236. .top {
  237. margin-top: 20rpx;
  238. }
  239. .box {
  240. display: flex;
  241. height: 60rpx;
  242. font-size: 28rpx;
  243. .box_key {
  244. color: #808080;
  245. }
  246. .box_value {
  247. display: flex;
  248. img {
  249. margin-top: 5rpx;
  250. margin-left: 10rpx;
  251. width: 28rpx;
  252. height: 28rpx;
  253. }
  254. .recording {
  255. display: flex;
  256. align-items: center;
  257. width: 130rpx;
  258. height: 40rpx;
  259. color: #000;
  260. border-radius: 100rpx;
  261. border: 1rpx solid #cccccc;
  262. .voiceImg {
  263. margin: 0 12rpx;
  264. width: 30rpx;
  265. height: 30rpx;
  266. }
  267. }
  268. }
  269. .box_value2 {
  270. display: flex;
  271. img {
  272. margin-top: -2rpx;
  273. margin-left: 14rpx;
  274. width: 46rpx;
  275. height: 46rpx;
  276. }
  277. }
  278. .phone {
  279. color: #6fb6b8;
  280. }
  281. }
  282. .box_time {
  283. display: flex;
  284. height: 60rpx;
  285. .time_msg {
  286. font-size: 28rpx;
  287. color: #808080;
  288. text {
  289. color: #000000;
  290. }
  291. }
  292. .time_type {
  293. margin-left: 123rpx;
  294. margin-top: -5rpx;
  295. font-size: 32rpx;
  296. color: #ff5733;
  297. }
  298. .color_type {
  299. color: #1e7dfb;
  300. }
  301. .color_type2 {
  302. color: #6fb6b8;
  303. }
  304. .color_type3 {
  305. color: #cccccc;
  306. }
  307. }
  308. .box_img {
  309. display: flex;
  310. align-items: center;
  311. height: 120rpx;
  312. color: #808080;
  313. font-size: 28rpx;
  314. .img_key {
  315. }
  316. .img_value {
  317. width: 120rpx;
  318. height: 120rpx;
  319. border-radius: 14rpx;
  320. }
  321. }
  322. .steps_title {
  323. color: #969799;
  324. font-size: 28rpx;
  325. }
  326. .active {
  327. color: #6fb6b8;
  328. }
  329. .steps_desc {
  330. display: flex;
  331. align-items: center;
  332. line-height: 45rpx;
  333. font-size: 24rpx;
  334. img {
  335. margin: 10rpx 0;
  336. width: 80rpx;
  337. height: 80rpx;
  338. border-radius: 14rpx;
  339. }
  340. .desc_recording {
  341. display: flex;
  342. align-items: center;
  343. margin-left: 10rpx;
  344. width: 130rpx;
  345. height: 40rpx;
  346. color: #000;
  347. border-radius: 100rpx;
  348. border: 1rpx solid #cccccc;
  349. .voiceImg {
  350. margin: 0 12rpx;
  351. width: 30rpx;
  352. height: 30rpx;
  353. }
  354. }
  355. }
  356. .gap {
  357. height: 20rpx;
  358. }
  359. .pop_fee {
  360. padding-bottom: 50rpx;
  361. border-radius: 19rpx;
  362. background-color: #fff;
  363. .fee_title {
  364. display: flex;
  365. justify-content: space-between;
  366. align-items: center;
  367. box-sizing: border-box;
  368. padding: 0 31rpx 0 42rpx;
  369. width: 690rpx;
  370. height: 110rpx;
  371. font-size: 32rpx;
  372. font-weight: bold;
  373. border-radius: 19rpx 19rpx 0 0;
  374. border-bottom: 1rpx solid #e6e6e6;
  375. text {
  376. font-size: 45rpx;
  377. font-weight: 400;
  378. color: #808080;
  379. }
  380. }
  381. .fee_list {
  382. max-height: 50vh;
  383. overflow-y: auto;
  384. .fee_item {
  385. border-bottom: 1rpx solid #e6e6e6;
  386. .fee_box {
  387. display: flex;
  388. align-items: center;
  389. padding-left: 42rpx;
  390. height: 80rpx;
  391. font-size: 28rpx;
  392. color: #808080;
  393. text {
  394. color: #000000;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. </style>