index.vue 14 KB

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