repair.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. // 评价页面
  2. <template>
  3. <div class="page">
  4. <div class="repairInfo">
  5. <div class="cell border">
  6. <span>维修单号</span>
  7. <span>{{ id }}</span>
  8. </div>
  9. <div class="cell border">
  10. <span>设备信息</span>
  11. <span>{{ detail.repairerVo?.cameraSnCode }}</span>
  12. </div>
  13. <div class="cell border remarkDiv">
  14. <span>检测结果</span>
  15. <div class="remark">{{ detail.repairerVo?.remark }}</div>
  16. </div>
  17. </div>
  18. <div class="page_top">
  19. <div class="title">费用明细</div>
  20. <div class="cost_list">
  21. <div class="item" v-for="item in detail.priceList" :key="item.name">
  22. <span>{{ item.name }}</span>
  23. <span>¥{{ item.discount ==0 ?item.price:item.priceDiscount }} x{{ item.count }}</span>
  24. </div>
  25. </div>
  26. <div class="cell" style="border: none">
  27. <span>合计</span>
  28. <span class="colortext">¥{{ detail.amount?.toFixed(2) || '0.00' }}</span>
  29. </div>
  30. </div>
  31. <div class="but">
  32. <span class="tips">确认维修后,将直接开始维修。维修费用待维修完成后支付</span>
  33. <p class="tips">取消维修,原机退回,需要收取检测费。</p>
  34. <van-button type="primary" color="#00B3EC" @click="hanldConfirm(0)" block>确认维修</van-button>
  35. <van-button type="primary" style="background: none;" color="#00B3EC" @click="hanldConfirm(1)" plain block>取消维修</van-button>
  36. </div>
  37. </div>
  38. </template>
  39. <script lang="ts" setup name="detailPage">
  40. import { ref, onMounted, unref } from 'vue';
  41. import { useRouter } from 'vue-router';
  42. import { showToast } from 'vant';
  43. import { repairDetails, confirmRepair } from '/@/api';
  44. const router = useRouter();
  45. const { id } = unref(router.currentRoute)?.params;
  46. const detail = ref({
  47. amount: 0,
  48. priceList: <any>[],
  49. repairerVo: <any>{},
  50. repairRegisterVo: <any>{},
  51. });
  52. onMounted(async () => {
  53. const { data } = await repairDetails(id);
  54. let detaile = data,
  55. amount = 0;
  56. detail.value.repairerVo = <any>detaile.repairerVo;
  57. detail.value.repairRegisterVo = <any>detaile.repairRegisterVo;
  58. detail.value.priceList = <any>detaile.priceList.map((ele) => {
  59. let price = ele.discount == 0 ? ele.price : ele.priceDiscount
  60. amount = amount + price * ele.count;
  61. return ele;
  62. });
  63. detail.value.amount = amount;
  64. });
  65. const hanldConfirm = async (confirm) => {
  66. const {code} = await confirmRepair({ repairId: id, confirm });
  67. if (code == 200 || !code) {
  68. showToast('操作成功');
  69. setTimeout(() => {
  70. router.go(-1);
  71. }, 500);
  72. }
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. .page {
  77. min-height: 100vh;
  78. background-color: #f5f5f5;
  79. .title {
  80. font-size: 14px;
  81. font-family: PingFang SC-Medium, PingFang SC;
  82. font-weight: 500;
  83. color: #000000;
  84. padding: 15px;
  85. }
  86. .colortext {
  87. color: #e34d59;
  88. }
  89. .cell {
  90. border-top: 1px solid #e7e7e7;
  91. &:first-child {
  92. border-top: none;
  93. }
  94. height: 48px;
  95. padding: 0 15px;
  96. display: flex;
  97. justify-content: space-between;
  98. align-items: center;
  99. font-size: 14px;
  100. font-family: PingFang SC-Regular, PingFang SC;
  101. font-weight: 400;
  102. color: #333333;
  103. }
  104. .remarkDiv{
  105. height: auto;
  106. padding: 15px;
  107. align-items: start;
  108. .remark{
  109. max-width: calc(100% - 65px);
  110. // overflow: hidden;
  111. // text-overflow: ellipsis;
  112. // width: 100%;
  113. // display: -webkit-box;
  114. // -webkit-box-orient: vertical;
  115. // -webkit-line-clamp: 3;
  116. // word-break: break-all;
  117. }
  118. }
  119. .page_top {
  120. background-color: #fff;
  121. border-radius: 4px 4px 4px 4px;
  122. .cost_list {
  123. margin: 0 15px;
  124. padding-top: 24px;
  125. border: {
  126. top: 1px solid #e7e7e7;
  127. bottom: 1px solid #e7e7e7;
  128. }
  129. .item {
  130. display: flex;
  131. justify-content: space-between;
  132. align-items: center;
  133. margin-bottom: 8px;
  134. span{
  135. max-width: 50%;
  136. overflow: hidden;
  137. white-space: nowrap;
  138. text-overflow: ellipsis;
  139. }
  140. }
  141. }
  142. }
  143. .repairInfo {
  144. background-color: #fff;
  145. margin-bottom: 12px;
  146. border-radius: 4px 4px 4px 4px;
  147. }
  148. .but {
  149. padding: 25px 15px;
  150. .tips {
  151. font-size: 12px;
  152. font-family: PingFang SC-Regular, PingFang SC;
  153. font-weight: 400;
  154. color: #999999;
  155. margin-bottom: 10px;
  156. }
  157. button {
  158. margin-top: 16px;
  159. }
  160. }
  161. }
  162. </style>