invoice_detail.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="invoice-detail">
  3. <!-- Header Start -->
  4. <view class="header white text-center flex-col row-center">
  5. <view class="flex row-center lg bold">
  6. <image v-if="!invoiceInfo.status" src="../../static/invoice_wait.png" mode=""></image>
  7. <image v-else src="../../static/invoice_success.png" mode=""></image>
  8. {{ invoiceInfo.status_text || '' }}
  9. </view>
  10. <view class="sm m-t-10" v-if="!invoiceInfo.status">正在开具发票中,请耐心等候…</view>
  11. <view class="sm m-t-10" v-else>已开发票金额:{{ invoiceInfo.invoice_amount }}</view>
  12. </view>
  13. <!-- Header End -->
  14. <!-- Main Start -->
  15. <view class="main">
  16. <view class="card bg-white">
  17. <view class="lg bold p-l-30 p-b-18">发票信息</view>
  18. <view class="form-item">
  19. <view class="label">发票金额</view>
  20. <view class="content">{{ invoiceInfo.invoice_amount || '' }}</view>
  21. </view>
  22. <view class="form-item">
  23. <view class="label">发票类型</view>
  24. <view class="content">{{ invoiceInfo.type == 0 ? '普通' : '专用' }}</view>
  25. </view>
  26. <view class="form-item">
  27. <view class="label">抬头类型</view>
  28. <view class="content">{{ invoiceInfo.type == 0 ? '个人' : '企业' }}</view>
  29. </view>
  30. <view class="form-item">
  31. <view class="label">抬头名称</view>
  32. <view class="content">{{ invoiceInfo.name || '' }}</view>
  33. </view>
  34. <view class="form-item" v-if="invoiceInfo.duty_number">
  35. <view class="label">税号</view>
  36. <view class="content">{{ invoiceInfo.duty_number || '' }}</view>
  37. </view>
  38. <view class="form-item">
  39. <view class="label">邮箱</view>
  40. <view class="content">{{ invoiceInfo.email || '' }}</view>
  41. </view>
  42. <view class="form-item" v-if="invoiceInfo.address">
  43. <view class="label">企业地址</view>
  44. <view class="content">{{ invoiceInfo.address || '' }}</view>
  45. </view>
  46. <view class="form-item" v-if="invoiceInfo.mobile">
  47. <view class="label">企业电话</view>
  48. <view class="content">{{ invoiceInfo.mobile || '' }}</view>
  49. </view>
  50. <view class="form-item" v-if="invoiceInfo.bank">
  51. <view class="label">开户银行</view>
  52. <view class="content">{{ invoiceInfo.bank || '' }}</view>
  53. </view>
  54. <view class="form-item" v-if="invoiceInfo.bank_account">
  55. <view class="label">银行账号</view>
  56. <view class="content">{{ invoiceInfo.bank_account || '' }}</view>
  57. </view>
  58. <view class="form-item">
  59. <view class="label">申请时间</view>
  60. <view class="content">{{ invoiceInfo.create_time || '' }}</view>
  61. </view>
  62. </view>
  63. <view class="card bg-white m-t-20">
  64. <view class="m-l-20">
  65. <shop-title :shop="shopInfo" :is-link="false"></shop-title>
  66. </view>
  67. <order-goods :list="goodsInfo"></order-goods>
  68. <view class="form-item">
  69. <view class="label">订单状态</view>
  70. <view class="content">{{ order_status_text }}</view>
  71. </view>
  72. <view class="form-item">
  73. <view class="label">订单编号</view>
  74. <view class="content">{{ order_sn }}</view>
  75. </view>
  76. <view class="form-item">
  77. <view class="label">下单时间</view>
  78. <view class="content">{{ create_time }}</view>
  79. </view>
  80. </view>
  81. </view>
  82. <!-- Main End -->
  83. <!-- Footer Start -->
  84. <view class="footer" v-if="!invoiceInfo.status">
  85. <view class="btn br60">
  86. <button class="btn br60" size="lg" @click="toEditInvoice">编辑发票</button>
  87. </view>
  88. </view>
  89. <!-- Footer End -->
  90. </view>
  91. </template>
  92. <script>
  93. import { apiOrderInvoiceDetail } from "@/api/shop.js"
  94. import { invoiceType } from "@/utils/type.js"
  95. export default {
  96. data() {
  97. return {
  98. invoiceInfo: {},// 发票信息
  99. goodsInfo: {}, // 商品信息
  100. shopInfo: {}, // 店铺信息
  101. orderId: '', // 订单ID
  102. create_time: '',
  103. order_status_text: '',
  104. order_sn: ''
  105. }
  106. },
  107. methods: {
  108. // 获取订单发票详情
  109. initInvoiceInfoFunc() {
  110. apiOrderInvoiceDetail({ id: this.orderId }).then(res => {
  111. this.invoiceInfo = res.data.invoice;
  112. this.goodsInfo = res.data.order_goods;
  113. this.shopInfo = res.data.shop;
  114. this.create_time = res.data.create_time;
  115. this.order_status_text = res.data.order_status_text;
  116. this.order_sn = res.data.order_sn;
  117. })
  118. },
  119. // 去编辑发票
  120. toEditInvoice() {
  121. this.$Router.push({
  122. path: '/bundle/pages/invoice/invoice',
  123. query: {
  124. invoice_id: this.invoiceInfo.id,
  125. shop_id: this.shopInfo.id,
  126. type: invoiceType['ORDERDETAILEdit']
  127. }
  128. })
  129. }
  130. },
  131. onLoad() {
  132. const query = this.$Route.query;
  133. this.orderId = query.id || ''
  134. },
  135. onShow() {
  136. this.initInvoiceInfoFunc();
  137. }
  138. }
  139. </script>
  140. <style lang="scss">
  141. .invoice-detail {
  142. padding-bottom: 120rpx;
  143. background: linear-gradient(to bottom, $-color-primary 230rpx, transparent 0);
  144. .header {
  145. height: 140rpx;
  146. image {
  147. width: 44rpx;
  148. height: 44rpx;
  149. }
  150. }
  151. .main {
  152. .card {
  153. padding: 24rpx 0 30rpx 0;
  154. border-radius: 14rpx;
  155. }
  156. .form-item {
  157. display: flex;
  158. padding: 12rpx 30rpx;
  159. color: $-color-normal;
  160. font-size: 28rpx;
  161. .label {
  162. width: 120rpx;
  163. text-align: right;
  164. margin-right: 40rpx;
  165. }
  166. .content {
  167. flex: 1;
  168. }
  169. }
  170. }
  171. .footer {
  172. left: 0;
  173. bottom: 20rpx;
  174. width: 100%;
  175. padding: 24rpx;
  176. position: fixed;
  177. .btn {
  178. height: 88rpx;
  179. color: $-color-white;
  180. background-color: $-color-primary;
  181. }
  182. }
  183. }
  184. </style>