index.vue 12 KB

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