Billingresult.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <div class='Billing-result'>
  3. <div class="head-box">
  4. <div class="state">{{typeStatus(obj.status)}}</div>
  5. <div class="state-time">{{obj.kprq}}</div>
  6. </div>
  7. <div class="content-i">
  8. <div class="info-box">
  9. <div class="tit">增值税电子普通发票</div>
  10. <img src="@/static/img/invoice.png" class="invoice_ico" alt="">
  11. <div class="info-item flex_r flex_jb">
  12. <div class="label">发票抬头</div>
  13. <div class="input">{{obj.gmf_mc}}</div>
  14. </div>
  15. <div class="info-item flex_r flex_jb">
  16. <div class="label">税号</div>
  17. <div class="input">{{obj.gmf_nsrsbh}}</div>
  18. </div>
  19. <div class="info-item flex_r flex_jb">
  20. <div class="label">价税合计</div>
  21. <div class="input">{{obj.money}}</div>
  22. </div>
  23. <div class="info-item flex_r flex_jb">
  24. <div class="label">电子邮箱</div>
  25. <div class="input">{{obj.email}}</div>
  26. </div>
  27. <div class="info-item flex_r flex_jb">
  28. <div class="label">手机号码</div>
  29. <div class="input">{{obj.mobile}}</div>
  30. </div>
  31. </div>
  32. <div class="check-btn" v-if="obj.status == 1" @click="downloadFun">预览发票</div>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import { get, post } from '@/request/api.js';
  38. let app=getApp();
  39. var appEv = app.$vm.$options;
  40. export default {
  41. name: 'Billing-result',
  42. data () {
  43. return {
  44. id:undefined,
  45. obj:undefined
  46. }
  47. },
  48. onLoad (option) {
  49. this.id = option.id;
  50. this.getDetail()
  51. },
  52. onLaunch () {},
  53. onShow () {},
  54. onHide () {},
  55. methods: {
  56. getDetail(){
  57. let data = {
  58. fpqqlsh:this.id
  59. }
  60. post('invoice/getInfo',data).then(res => {
  61. this.obj = res.data
  62. })
  63. },
  64. downloadFun(){
  65. uni.downloadFile({
  66. url:this.obj.pdf_url,
  67. success: res => {
  68. console.log(res)
  69. if (res.statusCode === 200) {
  70. // 预览pdf文件
  71. uni.openDocument({
  72. filePath: res.tempFilePath,
  73. showMenu: true, // 右上角菜单,可以进行分享保存pdf
  74. success: function(file) {
  75. console.log("file-success", file)
  76. }
  77. })
  78. }
  79. }
  80. })
  81. }
  82. },
  83. computed: {
  84. typeStatus(){
  85. return (da) => {
  86. let str;
  87. if (da === 1) str = "已开票";
  88. if (da === 2) str = "开票失败";
  89. if (da === 4) str = "红冲发票";
  90. if (da === 5) str = "开票中";
  91. if (da === 6) str = "发票作废";
  92. return str;
  93. };
  94. }
  95. },
  96. watch: {}
  97. }
  98. </script>
  99. <style scoped lang='scss'>
  100. page {
  101. background-color: #F6F6F6;
  102. }
  103. .Billing-result{
  104. .head-box{
  105. height: 230rpx;
  106. background: linear-gradient(90deg, #0ee6a2 0%, #18bb88 100%);
  107. padding-top: 70rpx;
  108. position: relative;
  109. .state{
  110. text-align: center;
  111. // color: rgba($color: #000000, $alpha: 0.5);
  112. color: #fff;
  113. font-weight: bold;
  114. }
  115. .state-time{
  116. text-align: center;
  117. // color: rgba($color: #000000, $alpha: 0.5);
  118. color: #fff;
  119. margin-top: 10rpx;
  120. // font-weight: bold;
  121. }
  122. // &::before{
  123. // content: '';
  124. // width: calc(100% - 72rpx);
  125. // height: 40rpx;
  126. // background: #fff;
  127. // position: absolute;
  128. // left: 36rpx;
  129. // bottom: 0;
  130. // border-radius: 12rpx 12rpx 0 0;
  131. // }
  132. }
  133. .content-i{
  134. padding: 0 36rpx;
  135. position: relative;
  136. }
  137. .info-box{
  138. padding: 60rpx 36rpx 40rpx;
  139. background: #fff;
  140. border-radius: 12rpx;
  141. box-shadow: 0 6rpx 16rpx 0 rgba(0,0,0,0.2);
  142. width: calc(100% - 72rpx);
  143. position: absolute;
  144. top: -40rpx;
  145. left: 36rpx;
  146. .tit{
  147. color: #f00;
  148. font-size: 30rpx;
  149. text-align: center;
  150. margin-bottom: 60rpx;
  151. }
  152. .invoice_ico{
  153. width: 186rpx;
  154. height: 110rpx;
  155. position: absolute;
  156. top: 14px;
  157. left: calc(50% - 93rpx);
  158. }
  159. .info-item{
  160. margin-bottom: 26rpx;
  161. font-size: 30rpx;
  162. &:last-child{
  163. margin-bottom: 0;
  164. }
  165. .label{
  166. width: 140rpx;
  167. color: #333;
  168. text-align: justify;
  169. text-align-last: justify;
  170. }
  171. .input{
  172. width: calc(100% - 140rpx);
  173. text-align: right;
  174. color: #666;
  175. }
  176. }
  177. }
  178. .check-btn{
  179. position: absolute;
  180. top: 700rpx;
  181. left: 36rpx;
  182. width: calc(100% - 72rpx);
  183. height: 80rpx;
  184. line-height: 80rpx;
  185. border-radius: 40rpx;
  186. text-align: center;
  187. background: #18bb88;
  188. color: #fff;
  189. }
  190. }
  191. </style>