invoiceDetail.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view>
  3. <view v-show="step==1">
  4. <ujp-navbar title="开票充电订单" :custom-back="customback2">
  5. </ujp-navbar>
  6. <view class="invoiced" >
  7. <view class="invoiced-item" v-for="(item,index) in list" :key="index" >
  8. <view class="content oldTextjp2"
  9. oldstyle="font-size: 14px;">
  10. <view class="title">
  11. {{item.stationName}}
  12. <text class="price2">{{item.actualFee?item.actualFee.toFixed(2):'0.00'}}元</text>
  13. </view>
  14. <p><text class="text-1">充电电量</text> <text class="text-2">{{item.electricQuantity/10000}}度</text></p>
  15. <p><text class="text-1">开始时间</text> <text class="text-2">{{item.startTime?item.startTime:item.endTime}}</text></p>
  16. <p><text class="text-1">结束时间</text> <text class="text-2">{{item.endTime}}</text></p>
  17. <p><text class="text-1">车牌号</text> <text class="text-2">{{item.carNumber}}</text></p>
  18. </view>
  19. </view>
  20. <p class="tips"> 已经到底了</p>
  21. </view>
  22. </view>
  23. <view v-show="step==0">
  24. <ujp-navbar title="发票详情"></ujp-navbar>
  25. <view class="price">
  26. <view class="num">
  27. {{invoiceInfo.amount.toFixed(2)}}元
  28. </view>
  29. <view class="text" >
  30. 发票金额
  31. </view>
  32. </view>
  33. <u-cell-group>
  34. <u-cell-item title="开票状态" :arrow="false">
  35. <text
  36. :class="{
  37. success:invoiceInfo.status==2,
  38. error:invoiceInfo.status==1
  39. }"
  40. >{{invoiceInfo.statusText}}</text>
  41. </u-cell-item>
  42. <u-cell-item title="所属站点" :arrow="false" :value="invoiceInfo.stationName"></u-cell-item>
  43. <u-cell-item title="充电度数" :arrow="false" :value="invoiceInfo.totalElectricQuantity/10000+'度'"></u-cell-item>
  44. <u-cell-item title="充电笔数" :arrow="false" :value="invoiceInfo.recordNum+'笔'"></u-cell-item>
  45. <u-cell-item title="发票类型":arrow="false" :value="invoiceInfo.headerType=='1'?'企业单位':'个人/非企业单位'"></u-cell-item>
  46. <u-cell-item title="发票抬头" :arrow="false" :value="invoiceInfo.title"></u-cell-item>
  47. <u-cell-item title="发票税号" :arrow="false" :value="invoiceInfo.companyTaxNo?invoiceInfo.companyTaxNo:'--'"></u-cell-item>
  48. <u-cell-item title="开票时间" :arrow="false" :value="invoiceInfo.invoicingTime"></u-cell-item>
  49. </u-cell-group>
  50. <u-cell-item style="background-color: #fff;" title="开票充电订单" :arrow="false">
  51. <text
  52. @click="viewList()"
  53. :class="{
  54. success:true,
  55. }"
  56. >查看</text>
  57. </u-cell-item>
  58. <u-cell-item style="background-color: #fff;" title="发票预览":arrow="false">
  59. <text
  60. @click="view()"
  61. :class="{
  62. success:invoiceInfo.status==2,
  63. color959595:invoiceInfo.status==1
  64. }"
  65. >查看</text>
  66. </u-cell-item>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import * as API from '@/apis/invoiceApi.js'
  72. export default {
  73. data() {
  74. return {
  75. id: '',
  76. invoiceInfo:{},
  77. step:0,
  78. list:[]
  79. }
  80. },
  81. onLoad(op) {
  82. if(op.id) {
  83. this.id = op.id;
  84. this.invoiceDetail();
  85. }
  86. },
  87. methods: {
  88. customback2(){
  89. this.step=0;
  90. },
  91. viewList(){
  92. this.step=1;
  93. },
  94. view(){
  95. if(this.invoiceInfo.status==2){
  96. uni.navigateTo({
  97. url:"/pages/MyInvoice/invoicePreview?id="+this.invoiceInfo.id
  98. })
  99. }else{
  100. uni.showToast({
  101. title:'开票中,请等待开票'
  102. })
  103. }
  104. },
  105. invoiceDetail() {
  106. uni.showLoading({
  107. title: "加载中",
  108. mask: true,
  109. })
  110. API.invoiceDetail({
  111. invoiceId:this.id
  112. }).then((res) => {
  113. uni.hideLoading();
  114. this.invoiceInfo=res.data.invoiceInfo;
  115. this.list=res.data.invoiceRecordList;
  116. }).catch(error => {
  117. uni.showToast({
  118. title: error,
  119. icon: "none"
  120. })
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss">
  127. .not-invoiced-item,.invoiced-item{
  128. width: 91.4%;
  129. border-radius: 12px;
  130. background-color: rgba(255, 255, 255, 100);
  131. border: 1px solid rgba(235, 235, 235, 100);
  132. padding: 16px 0;
  133. padding-left: 18px;
  134. margin:12px auto;
  135. }
  136. .price{
  137. background-color: #fff;
  138. padding: 24px 0;
  139. text-align: center;
  140. .num{
  141. line-height: 36px;
  142. color: rgba(16, 16, 16, 100);
  143. font-size: 36px;
  144. }
  145. .text{
  146. color: rgba(102, 102, 102, 100);
  147. font-size: 16px;
  148. margin-top: 4px;
  149. }
  150. }
  151. ::v-deep.u-cell-box{
  152. margin: 12px 0;
  153. }
  154. ::v-deep.u-cell__value,::v-deep.u-cell_title{
  155. font-size: 18px
  156. }
  157. ::v-deep.u-cell_title{
  158. color: #666666;
  159. }
  160. ::v-deep.u-cell__value{
  161. color: #101010;
  162. }
  163. .color959595{
  164. color: #959595;
  165. }
  166. .error{
  167. color: #FF6100;
  168. }
  169. .success{
  170. color: #00b962;
  171. }
  172. .tips{
  173. color: rgba(153, 153, 153, 100);
  174. text-align: center;
  175. }
  176. .price2 {
  177. color: rgba(16, 16, 16, 100);
  178. }
  179. .price2.invoice,.have-invoiced{
  180. height: 18px;
  181. color: rgba(255, 61, 0, 100);
  182. font-size: 18px;
  183. }
  184. .content{
  185. width: 100%;
  186. margin-left: 4px;
  187. .title{
  188. line-height: 18px;
  189. color: rgba(16, 16, 16, 100);
  190. font-size: 16px;
  191. margin-bottom: 12px;
  192. padding-right: 12px;
  193. display: flex;
  194. justify-content: space-between;
  195. .price,.invoice,.have-invoiced{
  196. height: 18px;
  197. color: rgba(255, 61, 0, 100);
  198. font-size: 18px;
  199. }
  200. }
  201. p{
  202. color: rgba(102, 102, 102, 100);
  203. line-height: 26px;
  204. }
  205. .text-1{
  206. display: inline-block;
  207. width: 22vw;
  208. color: #666666;
  209. }
  210. .text-2{
  211. display: inline-block;
  212. margin-left:4px;
  213. width:50vw;
  214. color: #101010;
  215. }
  216. }
  217. </style>