repairDetails.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  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. line-height: 60rpx;
  242. font-size: 28rpx;
  243. .box_key {
  244. color: #808080;
  245. }
  246. .box_value {
  247. flex: 1;
  248. display: flex;
  249. align-items: center;
  250. img {
  251. margin-left: 10rpx;
  252. width: 28rpx;
  253. height: 28rpx;
  254. }
  255. .recording {
  256. display: flex;
  257. align-items: center;
  258. width: 130rpx;
  259. height: 40rpx;
  260. color: #000;
  261. border-radius: 100rpx;
  262. border: 1rpx solid #cccccc;
  263. .voiceImg {
  264. margin: 0 12rpx;
  265. width: 30rpx;
  266. height: 30rpx;
  267. }
  268. }
  269. }
  270. .box_value2 {
  271. display: flex;
  272. img {
  273. margin-top: -2rpx;
  274. margin-left: 14rpx;
  275. width: 46rpx;
  276. height: 46rpx;
  277. }
  278. }
  279. .phone {
  280. color: #6fb6b8;
  281. }
  282. }
  283. .box_time {
  284. display: flex;
  285. height: 60rpx;
  286. .time_msg {
  287. font-size: 28rpx;
  288. color: #808080;
  289. text {
  290. color: #000000;
  291. }
  292. }
  293. .time_type {
  294. margin-left: 123rpx;
  295. margin-top: -5rpx;
  296. font-size: 32rpx;
  297. color: #ff5733;
  298. }
  299. .color_type {
  300. color: #1e7dfb;
  301. }
  302. .color_type2 {
  303. color: #6fb6b8;
  304. }
  305. .color_type3 {
  306. color: #cccccc;
  307. }
  308. }
  309. .box_img {
  310. display: flex;
  311. align-items: center;
  312. height: 120rpx;
  313. color: #808080;
  314. font-size: 28rpx;
  315. .img_key {
  316. }
  317. .img_value {
  318. width: 120rpx;
  319. height: 120rpx;
  320. border-radius: 14rpx;
  321. }
  322. }
  323. .steps_title {
  324. color: #969799;
  325. font-size: 28rpx;
  326. }
  327. .active {
  328. color: #6fb6b8;
  329. }
  330. .steps_desc {
  331. display: flex;
  332. align-items: center;
  333. line-height: 45rpx;
  334. font-size: 24rpx;
  335. img {
  336. margin: 10rpx 0;
  337. width: 80rpx;
  338. height: 80rpx;
  339. border-radius: 14rpx;
  340. }
  341. .desc_recording {
  342. display: flex;
  343. align-items: center;
  344. margin-left: 10rpx;
  345. width: 130rpx;
  346. height: 40rpx;
  347. color: #000;
  348. border-radius: 100rpx;
  349. border: 1rpx solid #cccccc;
  350. .voiceImg {
  351. margin: 0 12rpx;
  352. width: 30rpx;
  353. height: 30rpx;
  354. }
  355. }
  356. }
  357. .gap {
  358. height: 20rpx;
  359. }
  360. .pop_fee {
  361. padding-bottom: 50rpx;
  362. border-radius: 19rpx;
  363. background-color: #fff;
  364. .fee_title {
  365. display: flex;
  366. justify-content: space-between;
  367. align-items: center;
  368. box-sizing: border-box;
  369. padding: 0 31rpx 0 42rpx;
  370. width: 690rpx;
  371. height: 110rpx;
  372. font-size: 32rpx;
  373. font-weight: bold;
  374. border-radius: 19rpx 19rpx 0 0;
  375. border-bottom: 1rpx solid #e6e6e6;
  376. text {
  377. font-size: 45rpx;
  378. font-weight: 400;
  379. color: #808080;
  380. }
  381. }
  382. .fee_list {
  383. max-height: 50vh;
  384. overflow-y: auto;
  385. .fee_item {
  386. border-bottom: 1rpx solid #e6e6e6;
  387. .fee_box {
  388. display: flex;
  389. align-items: center;
  390. padding-left: 42rpx;
  391. height: 80rpx;
  392. font-size: 28rpx;
  393. color: #808080;
  394. text {
  395. color: #000000;
  396. }
  397. }
  398. }
  399. }
  400. }
  401. }
  402. </style>