repairDetails.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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_img">
  50. <view class="img_key">上传图片:</view>
  51. <img class="img_value" mode="aspectFill" :src="detailInfo.images[0]" @click="handleLookImgs(detailInfo.images)" />
  52. </view>
  53. <view class="box top" v-if="detailInfo.maintenancerName">
  54. <view class="box_key">维修师傅:</view>
  55. <view class="box_value">{{ detailInfo.maintenancerName }}</view>
  56. </view>
  57. <view class="box" v-if="detailInfo.maintenancerPhone">
  58. <view class="box_key">师傅电话:</view>
  59. <view class="box_value phone" @click="handleCallPhone(detailInfo.maintenancerPhone)">
  60. {{ detailInfo.maintenancerPhone }}
  61. <img src="../../static/images/repairsImg/phone.png" />
  62. </view>
  63. </view>
  64. <view class="box" v-if="detailInfo.price">
  65. <view class="box_key">维修费用:</view>
  66. <view class="box_value2 phone" @click="checkFeeDetail(detailInfo)">
  67. {{ detailInfo.price }}元
  68. <img src="../../static/images/repairsImg/eye.png" />
  69. </view>
  70. </view>
  71. <view class="title top" v-if="detailInfo.tracks">报修跟踪</view>
  72. <!-- 步骤条区域 -->
  73. <!-- activeIcon="checkmark-circle-fill" -->
  74. <uv-steps activeColor="#6FB6B8" direction="column" v-if="detailInfo.tracks" :current="detailInfo.tracks.length">
  75. <uv-steps-item :customStyle="customStyle" v-for="item in detailInfo.tracks" :key="item.id">
  76. <template v-slot:title>
  77. <view class="steps_title" :class="{ active: true }">{{ item.state }}</view>
  78. </template>
  79. <template v-slot:desc>
  80. <!-- <view class="steps_desc" v-for="(element, index) in item.desc" :key="index">{{ element }}</view> -->
  81. <view class="steps_desc">{{ item.createTime }}</view>
  82. <view class="steps_desc" v-if="item.content">{{ item.content }}</view>
  83. </template>
  84. </uv-steps-item>
  85. </uv-steps>
  86. <view class="gap"></view>
  87. <!-- 维修费用弹窗 -->
  88. <uni-popup :is-mask-click="false" ref="popup_fee">
  89. <view class="pop_fee">
  90. <view class="fee_title">
  91. 维修费用
  92. <text @click="$refs.popup_fee.close()">×</text>
  93. </view>
  94. <view class="fee_list">
  95. <view class="fee_item" v-for="ele in consumables" :key="ele.id">
  96. <view class="fee_box">
  97. 耗材:
  98. <text>{{ ele.consumeName }}</text>
  99. </view>
  100. <view class="fee_box">
  101. 耗材单价:
  102. <text>{{ ele.price }}元</text>
  103. </view>
  104. <view class="fee_box">
  105. 耗材数量:
  106. <text>{{ ele.number }}</text>
  107. </view>
  108. <view class="fee_box">
  109. 耗材费用:
  110. <text>{{ ele.totalPrice }}元</text>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </uni-popup>
  116. </view>
  117. </template>
  118. <script>
  119. export default {
  120. data() {
  121. return {
  122. // 报修详情信息
  123. detailInfo: {},
  124. // 步骤条样式
  125. customStyle: {
  126. marginBottom: '5px'
  127. },
  128. // 步骤条数据
  129. stepsList: [
  130. {
  131. id: 1,
  132. title: '提交订单',
  133. type: true,
  134. desc: ['2023-07-05 08:25:25']
  135. },
  136. {
  137. id: 2,
  138. title: '已接单',
  139. type: true,
  140. desc: ['2023-07-05 08:25:25']
  141. },
  142. {
  143. id: 3,
  144. title: '待确认',
  145. type: true,
  146. desc: ['2023-07-05 08:25:25', '张发财转后勤:太贵了', '系统管理员改价:耗材为螺丝刀,价格50元', '系统管理员改价:耗材为螺丝刀,价格50元']
  147. },
  148. {
  149. id: 4,
  150. title: '待确认',
  151. type: false,
  152. desc: ['2023-07-05 08:25:25']
  153. },
  154. {
  155. id: 5,
  156. title: '已完成',
  157. type: false,
  158. desc: ['2023-07-05 08:25:25']
  159. }
  160. ],
  161. // 订单id
  162. recordId: '',
  163. // 维修费用耗材明细列表
  164. consumables: []
  165. }
  166. },
  167. onLoad(options) {
  168. this.recordId = options.id
  169. this.getData()
  170. },
  171. methods: {
  172. // 获取报修详情信息
  173. async getData() {
  174. const res = await this.$myRequest_repairs({
  175. url: '/repairRecord/details',
  176. data: {
  177. recordId: this.recordId
  178. }
  179. })
  180. // console.log(res)
  181. if (res.code === '200') {
  182. this.detailInfo = res.data
  183. }
  184. },
  185. // 查看维修费用回调
  186. checkFeeDetail(item) {
  187. this.$refs.popup_fee.open('center')
  188. this.consumables = item.consumables
  189. },
  190. // 点击电话号码回调
  191. handleCallPhone(phone) {
  192. uni.makePhoneCall({
  193. phoneNumber: phone
  194. })
  195. },
  196. // 点击图片回调
  197. handleLookImgs(img) {
  198. uni.previewImage({
  199. urls: img
  200. })
  201. }
  202. }
  203. }
  204. </script>
  205. <style lang="scss" scoped>
  206. .container {
  207. padding: 0 30rpx;
  208. height: 100vh;
  209. overflow-y: auto;
  210. .title {
  211. height: 90rpx;
  212. line-height: 90rpx;
  213. font-size: 32rpx;
  214. font-weight: bold;
  215. }
  216. .top {
  217. margin-top: 20rpx;
  218. }
  219. .box {
  220. display: flex;
  221. height: 60rpx;
  222. font-size: 28rpx;
  223. .box_key {
  224. color: #808080;
  225. }
  226. .box_value {
  227. display: flex;
  228. img {
  229. margin-top: 5rpx;
  230. margin-left: 10rpx;
  231. width: 28rpx;
  232. height: 28rpx;
  233. }
  234. }
  235. .box_value2 {
  236. display: flex;
  237. img {
  238. margin-top: -2rpx;
  239. margin-left: 14rpx;
  240. width: 46rpx;
  241. height: 46rpx;
  242. }
  243. }
  244. .phone {
  245. color: #6fb6b8;
  246. }
  247. }
  248. .box_time {
  249. display: flex;
  250. height: 60rpx;
  251. .time_msg {
  252. font-size: 28rpx;
  253. color: #808080;
  254. text {
  255. color: #000000;
  256. }
  257. }
  258. .time_type {
  259. margin-left: 123rpx;
  260. margin-top: -5rpx;
  261. font-size: 32rpx;
  262. color: #ff5733;
  263. }
  264. .color_type {
  265. color: #1e7dfb;
  266. }
  267. .color_type2 {
  268. color: #6fb6b8;
  269. }
  270. .color_type3 {
  271. color: #cccccc;
  272. }
  273. }
  274. .box_img {
  275. display: flex;
  276. align-items: center;
  277. height: 120rpx;
  278. color: #808080;
  279. font-size: 28rpx;
  280. .img_key {
  281. }
  282. .img_value {
  283. width: 120rpx;
  284. height: 120rpx;
  285. border-radius: 14rpx;
  286. }
  287. }
  288. .steps_title {
  289. color: #969799;
  290. font-size: 28rpx;
  291. }
  292. .active {
  293. color: #6fb6b8;
  294. }
  295. .steps_desc {
  296. line-height: 45rpx;
  297. font-size: 24rpx;
  298. }
  299. .gap {
  300. height: 20rpx;
  301. }
  302. .pop_fee {
  303. padding-bottom: 50rpx;
  304. border-radius: 19rpx;
  305. background-color: #fff;
  306. .fee_title {
  307. display: flex;
  308. justify-content: space-between;
  309. align-items: center;
  310. box-sizing: border-box;
  311. padding: 0 31rpx 0 42rpx;
  312. width: 690rpx;
  313. height: 110rpx;
  314. font-size: 32rpx;
  315. font-weight: bold;
  316. border-radius: 19rpx 19rpx 0 0;
  317. border-bottom: 1rpx solid #e6e6e6;
  318. text {
  319. font-size: 45rpx;
  320. font-weight: 400;
  321. color: #808080;
  322. }
  323. }
  324. .fee_list {
  325. max-height: 50vh;
  326. overflow-y: auto;
  327. .fee_item {
  328. border-bottom: 1rpx solid #e6e6e6;
  329. .fee_box {
  330. display: flex;
  331. align-items: center;
  332. padding-left: 42rpx;
  333. height: 80rpx;
  334. font-size: 28rpx;
  335. color: #808080;
  336. text {
  337. color: #000000;
  338. }
  339. }
  340. }
  341. }
  342. }
  343. }
  344. </style>