index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. // 评价页面
  2. <template>
  3. <div class="page">
  4. <div class="stepList item_content" :key="stepShow+'123'">
  5. <div class="item_content_top">
  6. <div class="stepList_title">维修单号 {{id}}</div>
  7. <!-- <van-button class="top_but" type="primary" size="small">去支付</van-button> -->
  8. <van-button v-if="detailData.repairerVo?.status == 3" size="small" @click="goRoute(`/repair/${id}`)" color="#00B3EC" type="primary" >待确认</van-button>
  9. <van-button v-if="detailData.repairerVo?.status == 9" size="small" @click="goRoute(`/payment/${id}`)" color="#00B3EC" type="primary" >支付</van-button>
  10. <van-button v-if="detailData.repairerVo?.status == 13" size="small" @click="goRoute(`/evaluate/${id}`)" color="#00B3EC" type="primary" >评价</van-button>
  11. <van-button v-if="detailData.repairerVo?.status == 10" size="small" @click="goRoute(`/invoice/${id}`)" color="#00B3EC" type="primary" >申请开票</van-button>
  12. </div>
  13. <transition-group name="van-fade">
  14. <!-- <div v-show="stepShow">Slide Right</div> -->
  15. <div class="border stepItem" v-for="(item, index) in processList" :key="index" v-show="stepShow ? true : index < 1">
  16. <div class="step">
  17. <div class="step_title">{{item.remark}}</div>
  18. <div v-if="item.customerAddress">{{item.customerAddress.sendType == 0?' 前台送修':`快递寄送 ${item.customerAddress?.sendTrackingNum}`}}</div>
  19. <div v-if="item.customerAddress">{{item.customerAddress.getType == 0?' 前台取回':`快递寄回 ${item.customerAddress?.getTrackingNum}`}}</div>
  20. <div v-if="item.customerAddress">前台取回 </div>
  21. <div v-if="item.repairRegisterVo?.checkResult">检测结果: {{item.repairRegisterVo?.checkResult}}</div>
  22. <div v-if="item.repairRegisterVo?.partNamesStr">所需备件: {{item.repairRegisterVo?.partNamesStr}}</div>
  23. <div v-if="item.repairRegisterVo?.orderFaultMsg">机器外观: {{item.orderReceiving?.orderFaultMsg}}</div>
  24. <div class="imgList">
  25. <img :src="imgItem" v-for="imgItem in item.imagesInfo" :key="imgItem + index" alt="" />
  26. </div>
  27. <div class="step_time">{{dayjs(item.createTime).format('MM-DD hh:mm')}}</div>
  28. <div class="doct" :class="index == 0 ? 'oneSpot' : 'Spot'"></div>
  29. </div>
  30. </div>
  31. </transition-group>
  32. <van-divider v-if="processList?.length >1">
  33. <div @click="handleShow">
  34. <van-icon :name="!stepShow ? 'arrow-down' : 'arrow-up'" />
  35. {{ !stepShow ? '展开' : '收起' }}
  36. </div>
  37. </van-divider>
  38. </div>
  39. <div class="page_top item_content" v-if="detailData.customer">
  40. <div class="title">客户信息</div>
  41. <div class="content">
  42. <div class="cost_list" style="border-bottom: none">
  43. <div class="item">
  44. <span>公司名称</span>
  45. <span>{{detailData.customer?.companyName}}</span>
  46. </div>
  47. <div class="item">
  48. <span>联系人</span>
  49. <span>{{detailData.customer?.customerName}}</span>
  50. </div>
  51. <div class="item">
  52. <span>联系电话</span>
  53. <span>{{detailData.customer?.phone}}</span>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="page_top item_content" v-if="detailData.orderReceivingVo">
  59. <div class="title">故障信息</div>
  60. <div class="content">
  61. <div class="text">{{cameraType[detailData.repairerVo?.cameraType]}} {{detailData.repairerVo?.cameraSnCode}}</div>
  62. <div class="text" v-html="detailData.repairerVo?.faultMsg"></div>
  63. <div class="imgList" v-if="detailData.repairerVo">
  64. <img :src="imgItem" v-for="imgItem in detailData.repairerVo.faultImg" :key="imgItem" alt="" />
  65. </div>
  66. </div>
  67. </div>
  68. <div class="page_custinfo item_content" v-if="detailData.priceList.length">
  69. <div class="title">费用明细</div>
  70. <div class="content">
  71. <div class="cost_list">
  72. <div class="item" v-for="item in detailData.priceList" :key="item.name">
  73. <span>{{ item.name }}</span>
  74. <span>¥{{ item.price }} x{{ item.count }}</span>
  75. </div>
  76. </div>
  77. <div class="cell" style="border: none">
  78. <span>维修费用</span>
  79. <span>¥{{ priceCount(detailData?.priceList || []) }}</span>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="page_top item_content" v-if="detailData.customerAddress">
  84. <div class="title">运输信息</div>
  85. <div class="content">
  86. <div class="cost_list">
  87. <div class="item">
  88. <span>送修方式</span>
  89. <span>{{detailData.customerAddress.sendType == 0 ?'前台送修':'快递寄送'}}</span>
  90. </div>
  91. <div class="item" v-if="detailData.customerAddress.sendType != 0">
  92. <span>快递单号</span>
  93. <span>{{detailData.customerAddress.sendTrackingNum}}</span>
  94. </div>
  95. <div class="item">
  96. <span>取回方式</span>
  97. <span>{{detailData.customerAddress.getType == 0 ?'前台取回':'快递寄回'}}</span>
  98. </div>
  99. <div class="item" v-if="detailData.customerAddress.getType != 0">
  100. <span>快递单号</span>
  101. <span>{{detailData.customerAddress.getTrackingNum}}</span>
  102. </div>
  103. <div class="item" v-if="detailData.customerAddress.getType != 0">
  104. <span>收件人</span>
  105. <span>{{detailData.customerAddress.getAddrName}}</span>
  106. </div>
  107. <div class="item" v-if="detailData.customerAddress.getType != 0">
  108. <span>收件人电话</span>
  109. <span>{{detailData.customerAddress.getAddrPhone}}</span>
  110. </div>
  111. <div class="item" v-if="detailData.customerAddress.getType != 0">
  112. <span>收件地址</span>
  113. <span>{{detailData.customerAddress.getAddress}}</span>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="page_top item_content" v-if="detailData.RepairComment">
  119. <div class="title">评价信息</div>
  120. <div class="content">
  121. <div class="cost_list" style="border-bottom: none">
  122. <div class="item">
  123. <span>内容</span>
  124. <span>{{detailData.RepairComment?.comment}}</span>
  125. </div>
  126. <div class="item">
  127. <span>评分</span>
  128. <span>{{detailData.RepairComment?.starRank}}分</span>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </template>
  135. <script lang="ts" setup name="detailPage">
  136. import { useRouter } from 'vue-router';
  137. import { ref, onMounted, unref, onActivated } from 'vue';
  138. import { repairProcess, repairDetails } from '/@/api';
  139. import dayjs from 'dayjs'
  140. const { currentRoute } = useRouter();
  141. const router = useRouter();
  142. const { id } = unref(currentRoute)?.params
  143. const stepShow = ref<boolean>(false);
  144. const cameraType = {
  145. 0:'四维看看',
  146. 1:'四维看见',
  147. 2:'四维深时',
  148. }
  149. let detailData = ref({
  150. customer:<any>{},
  151. customerAddress:<any>{},
  152. repairerVo:<any>{},
  153. RepairTestVo:<any>{},
  154. repairRegisterVo:<any>{},
  155. orderReceivingVo:<any>{},
  156. repairPay:<any>{},
  157. RepairComment:<any>{},
  158. priceList:<any>[],
  159. });
  160. let processList = ref<any>([])
  161. onMounted(() => {
  162. console.log('onMounted',id)
  163. getDetaile();
  164. });
  165. onActivated(()=>{
  166. console.log('onActivated')
  167. getDetaile();
  168. })
  169. function priceCount(list){
  170. let price = 0
  171. list.map(ele => {
  172. price = (ele.price * ele.count) + price
  173. })
  174. return price.toFixed(2)
  175. }
  176. const getDetaile = async () => {
  177. const { response } = await repairDetails(id);
  178. let detaile = unref(response)?.data;
  179. detailData.value = detaile
  180. const resProcess = await repairProcess(id);
  181. console.log('resProcess',resProcess)
  182. let process = unref(resProcess?.response)?.data;
  183. processList.value = process
  184. console.log('getDetaile',detaile,process)
  185. };
  186. const handleShow = () => {
  187. stepShow.value = !stepShow.value;
  188. };
  189. const goRoute = (path) => {
  190. console.log('goRoute',path)
  191. if (!path) return;
  192. router.push(path);
  193. };
  194. </script>
  195. <style lang="scss" >
  196. .page {
  197. min-height: 100vh;
  198. background-color: #f5f5f5;
  199. overflow: hidden;
  200. .item_content {
  201. background-color: #fff;
  202. border-radius: 4px 4px 4px 4px;
  203. margin: 12px;
  204. .title {
  205. font-size: 14px;
  206. font-family: PingFang SC-Medium, PingFang SC;
  207. font-weight: 600;
  208. color: #000000;
  209. padding: 15px 0;
  210. margin: 0 15px;
  211. border-bottom: 1px solid #e7e7e7;
  212. }
  213. .content {
  214. padding: 24px 15px;
  215. }
  216. .item {
  217. display: flex;
  218. justify-content: space-between;
  219. align-items: center;
  220. line-height: 30px;
  221. font-size: 14px;
  222. // margin-bottom: 8px;
  223. }
  224. .imgList {
  225. margin-top: 8px;
  226. img {
  227. height: 64px;
  228. width: 64px;
  229. padding: 0 8px 0 0;
  230. }
  231. }
  232. }
  233. .stepList {
  234. padding: 24px 16px;
  235. .item_content_top{
  236. padding-bottom: 15px;
  237. margin-bottom: 24px;
  238. border-bottom: 1px solid #f5f5f5;
  239. display: flex;
  240. justify-content: space-between;
  241. align-items: center;
  242. }
  243. &_title {
  244. font-size: 14px;
  245. font-family: PingFang SC-Medium, PingFang SC;
  246. font-weight: 500;
  247. color: #000000;
  248. }
  249. .stepItem {
  250. transition: all 3s 2s linear;
  251. }
  252. .step {
  253. &:last-child {
  254. // border: none;
  255. }
  256. padding: 0 15px;
  257. border-left: 1px solid #f5f5f5;
  258. &_title {
  259. font-size: 14px;
  260. line-height: 22px;
  261. }
  262. &_time {
  263. font-size: 10px;
  264. font-family: PingFang SC-Regular, PingFang SC;
  265. font-weight: 400;
  266. color: #999999;
  267. line-height: 14px;
  268. padding-bottom: 24px;
  269. }
  270. font-size: 12px;
  271. font-family: PingFang SC-Regular, PingFang SC;
  272. font-weight: 400;
  273. color: #333333;
  274. line-height: 30px;
  275. position: relative;
  276. .doct {
  277. display: inline-block;
  278. position: absolute;
  279. left: 0;
  280. top: 0;
  281. width: 8px;
  282. height: 8px;
  283. border-radius: 50%;
  284. transform: translat(-50%, -50%);
  285. }
  286. .oneSpot {
  287. border: 4px solid #00b3ec;
  288. left: -8px;
  289. top: 4px;
  290. background: #fff;
  291. }
  292. .Spot {
  293. background: #cccccc;
  294. left: -4px;
  295. top: 8px;
  296. }
  297. }
  298. }
  299. .colortext {
  300. color: #e34d59;
  301. }
  302. .cell {
  303. border-top: 1px solid #e7e7e7;
  304. &:first-child {
  305. border-top: none;
  306. }
  307. // height: 48px;
  308. margin-top: 12px;
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. font-size: 14px;
  313. font-family: PingFang SC-Regular, PingFang SC;
  314. font-weight: 400;
  315. color: #333333;
  316. line-height: 22px;
  317. }
  318. .page_custinfo {
  319. .cost_list {
  320. padding-bottom: 8px;
  321. // margin: 0 15px;
  322. // padding-top: 24px;
  323. border: {
  324. // top: 1px solid #e7e7e7;
  325. bottom: 1px solid #e7e7e7;
  326. }
  327. }
  328. }
  329. .page_top {
  330. .cost_list {
  331. border: {
  332. // bottom: 1px solid #e7e7e7;
  333. }
  334. }
  335. .text {
  336. line-height: 30px;
  337. }
  338. }
  339. .repairInfo {
  340. background-color: #fff;
  341. margin-bottom: 12px;
  342. border-radius: 4px 4px 4px 4px;
  343. }
  344. .but {
  345. padding: 25px 15px;
  346. .tips {
  347. font-size: 12px;
  348. font-family: PingFang SC-Regular, PingFang SC;
  349. font-weight: 400;
  350. color: #999999;
  351. margin-bottom: 10px;
  352. }
  353. button {
  354. margin-top: 16px;
  355. }
  356. }
  357. }
  358. </style>