invoiceTent.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template name="invoice">
  2. <view class="invoice-template">
  3. <!-- 发票信息 -->
  4. <view class="invoice-content">
  5. <view class="invoice-title">发票信息</view>
  6. <view class="invoice-empty">
  7. <text>{{ invoiceText }}</text>
  8. </view>
  9. <view class="invoice-text" v-if="orderInvoice.type > 0">
  10. <view class="table">
  11. <text class="label-name">发票抬头:</text>
  12. <text class="label-text">{{ orderInvoice.invoiceTitle ? orderInvoice.invoiceTitle : '无' }}</text>
  13. </view>
  14. <template v-if="orderInvoice.type === 2 || orderInvoice.headingType === 1">
  15. <view class="table">
  16. <text class="label-name">单位税号:</text>
  17. <text class="label-text">{{
  18. orderInvoice.corporationTaxNum ? orderInvoice.corporationTaxNum : '无'
  19. }}</text>
  20. </view>
  21. <view class="table">
  22. <text class="label-name">注册地址:</text>
  23. <text class="label-text">{{
  24. orderInvoice.registeredAddress ? orderInvoice.registeredAddress : '无'
  25. }}</text>
  26. </view>
  27. <view class="table">
  28. <text class="label-name">注册电话:</text>
  29. <text class="label-text">{{
  30. orderInvoice.registeredPhone ? orderInvoice.registeredPhone : '无'
  31. }}</text>
  32. </view>
  33. <view class="table">
  34. <text class="label-name">开户银行:</text>
  35. <text class="label-text">{{ orderInvoice.openBank ? orderInvoice.openBank : '无' }}</text>
  36. </view>
  37. <view class="table">
  38. <text class="label-name">银行账号:</text>
  39. <text class="label-text">{{ bankAccountNo ? bankAccountNo : '无' }}</text>
  40. </view>
  41. </template>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. name: 'invoice',
  49. props: {
  50. orderInvoice: {
  51. type: Object
  52. }
  53. },
  54. filters: {},
  55. data() {
  56. return {
  57. invoiceText: '不开发票',
  58. title: '发票信息',
  59. isOpen: false,
  60. bankAccountNo: ''
  61. }
  62. },
  63. created() {
  64. this.initData(this.orderInvoice)
  65. },
  66. computed: {},
  67. methods: {
  68. initData(data) {
  69. if (data) {
  70. this.bankAccountNo = this.$reg.bankRegex(data.bankAccountNo)
  71. this.invoiceText = this.setInvoiceText(data)
  72. }
  73. },
  74. // 设置发票文案
  75. setInvoiceText(data) {
  76. const map = {
  77. 0: '个人',
  78. 1: '单位'
  79. }
  80. switch (data.type) {
  81. case 0:
  82. return `不开发票`
  83. break
  84. case 1:
  85. return `普票-${map[data.headingType]}`
  86. break
  87. case 2:
  88. return `专票`
  89. break
  90. }
  91. },
  92. onMessage(pros) {},
  93. showInvoice() {
  94. this.isOpen = !this.isOpen
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss">
  100. .invoice-template {
  101. width: 100%;
  102. height: auto;
  103. background: #ffffff;
  104. float: left;
  105. margin-top: 24rpx;
  106. .invoice-content {
  107. width: 702rpx;
  108. padding: 20rpx 24rpx;
  109. }
  110. .invoice-title {
  111. font-size: $font-size-28;
  112. color: $text-color;
  113. text-align: left;
  114. line-height: 40rpx;
  115. font-weight: bold;
  116. margin-bottom: 30rpx;
  117. }
  118. .invoice-empty {
  119. font-size: $font-size-28;
  120. color: $text-color;
  121. text-align: left;
  122. line-height: 64rpx;
  123. .txt {
  124. font-size: $font-size-24;
  125. color: #999999;
  126. }
  127. }
  128. .invoice-text {
  129. width: 100%;
  130. height: auto;
  131. .table {
  132. height: auto;
  133. line-height: 64rpx;
  134. font-size: $font-size-26;
  135. color: $text-color;
  136. text-align: left;
  137. position: relative;
  138. .label-name {
  139. display: inline-block;
  140. line-height: 64rpx;
  141. color: #999999;
  142. }
  143. .label-text {
  144. color: #333333;
  145. }
  146. }
  147. }
  148. }
  149. </style>