invoiceDetails.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view>
  3. <u-navbar title="发票详情" title-color="#101010" ></u-navbar>
  4. <view class="background">
  5. <view class="recharge-details">
  6. <view class="headline">
  7. 发票金额(元)
  8. </view>
  9. <view class="sum">
  10. {{detail.amount}}
  11. </view>
  12. <view :class="{
  13. state:!detail.image,
  14. state2:detail.image,
  15. }">
  16. {{detail.image?'已开票':'开票中'}}
  17. </view>
  18. <view class="details">
  19. <view class="item">
  20. <view class="item-title">
  21. 抬头类型
  22. </view>
  23. <view class="item-value">
  24. {{detail.headerType=='1'?'企业单位':''}}{{detail.headerType=='2'?'个人/非企业单位':''}}
  25. </view>
  26. </view>
  27. <view class="item" v-if="detail.headerType=='1'">
  28. <view class="item-title">
  29. 发票类型
  30. </view>
  31. <view class="item-value">
  32. {{detail.type=='1'?'增值税专票':''}}{{detail.type=='2'?'增值税普票':''}}
  33. </view>
  34. </view>
  35. <view class="item">
  36. <view class="item-title">
  37. 发票抬头
  38. </view>
  39. <view class="item-value">
  40. {{detail.title}}
  41. </view>
  42. </view>
  43. <view class="item" v-if="detail.companyTaxNo" >
  44. <view class="item-title">
  45. 公司税号
  46. </view>
  47. <view class="item-value">
  48. {{detail.companyTaxNo}}
  49. </view>
  50. </view>
  51. <view class="item" v-if="detail.companyTelephone">
  52. <view class="item-title">
  53. 手机号码
  54. </view>
  55. <view class="item-value">
  56. {{detail.companyTelephone}}
  57. </view>
  58. </view>
  59. <view class="item" v-if="detail.idCard">
  60. <view class="item-title">
  61. 身份证号
  62. </view>
  63. <view class="item-value">
  64. {{detail.idCard}}
  65. </view>
  66. </view>
  67. </view>
  68. <view class="details">
  69. <view class="item" v-if="false" >
  70. <view class="item-title">
  71. 申请单号
  72. </view>
  73. <view class="item-value">
  74. T20230816112557708460925
  75. </view>
  76. </view>
  77. <view class="item">
  78. <view class="item-title">
  79. 申请时间
  80. </view>
  81. <view class="item-value">
  82. {{detail.createTime}}
  83. </view>
  84. </view>
  85. <view class="item" v-if="false" >
  86. <view class="item-title">
  87. 开票时间
  88. </view>
  89. <view class="item-value">
  90. 2023-08-20 10:29:00
  91. </view>
  92. </view>
  93. <view v-if="extraInfo" >
  94. <view class="item-title" style=" text-align: start; color: #777777;">
  95. 开票明细
  96. </view>
  97. <table class="table1" v-for="(item,i) in extraInfo">
  98. <template >
  99. <tr :key="i" >
  100. <td colspan="2" class="tr2" >{{i}}</td>
  101. </tr>
  102. <tr v-for="(it,j) in item" :key="i+'_'+j" v-if="!(['yearMonth','tenantContractId','name','totalAmount'].indexOf(j)>=0)&&it!=0" >
  103. <td class="tr2" >{{j}}</td>
  104. <td>{{it}}</td>
  105. </tr>
  106. <tr v-for="(it,j) in item" :key="i+'_'+j" v-if="'totalAmount'==j" >
  107. <td class="tr2" >合计</td>
  108. <td>{{it}}</td>
  109. </tr>
  110. </template>
  111. </table>
  112. </view>
  113. </view>
  114. </view>
  115. <!-- 查看 -->
  116. <button class="check" @click="down(detail.image)" v-if="detail.image">查看电子发票</button>
  117. <!-- 返回 -->
  118. <button class="back" @click="goBack" >返回</button>
  119. </view>
  120. </view>
  121. </template>
  122. <script>
  123. import * as API from '@/apis/pagejs/invoiceApi.js'
  124. export default {
  125. data() {
  126. return {
  127. id:'',
  128. detail:{},
  129. extraInfo:null
  130. }
  131. },
  132. onLoad(op){
  133. this.id=op.id;
  134. this.getInvoiceDetail()
  135. },
  136. methods: {
  137. down(image){
  138. uni.showLoading({
  139. title: "加载中",
  140. mask: true,
  141. })
  142. window.location.href = image;
  143. setTimeout(()=>{
  144. uni.hideLoading()
  145. },2000)
  146. },
  147. goBack(){
  148. uni.navigateBack()
  149. },
  150. getInvoiceDetail(){
  151. uni.showLoading({
  152. mask:true,title:'加载中...'
  153. })
  154. API.invoiceDetail({
  155. id:this.id
  156. }).then((response) => {
  157. uni.hideLoading();
  158. this.detail=response.data.invoiceInfo
  159. if(this.detail.extraInfo){
  160. this.extraInfo=JSON.parse(this.detail.extraInfo)
  161. }
  162. }).catch(error => {
  163. uni.hideLoading();
  164. uni.showToast({
  165. icon: "none",
  166. title: error
  167. })
  168. })
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. .table1{
  175. margin: 16rpx 0;
  176. width: 100%;
  177. border-collapse: collapse;
  178. td{
  179. border: 1px solid #e7e7e7;
  180. text-align: end;
  181. padding: 16rpx 16rpx;
  182. }
  183. .td1{
  184. text-align: start;
  185. min-width: 20%;
  186. max-width: 30%;
  187. }
  188. .td3{
  189. white-space: pre;
  190. }
  191. tr{
  192. background-color:#f5f5f6
  193. }
  194. .tr1{
  195. text-align: end;
  196. font-weight: bold;
  197. }
  198. .tr2{
  199. text-align: start;
  200. }
  201. tr:nth-child(even) {
  202. background-color: #fff;
  203. }
  204. }
  205. .background{
  206. height: 400rpx;
  207. padding: 24rpx 32rpx;
  208. background: linear-gradient(180deg, rgba(203,234,255,1) 0%,rgba(203,234,255,0) 100%);
  209. .recharge-details{
  210. background-color: #fff;
  211. border-radius: 8px;
  212. padding: 40rpx 32rpx;
  213. text-align: center;
  214. .headline{
  215. color: rgb(16,16,16);
  216. font-size: 36rpx;
  217. }
  218. .sum{
  219. color: rgb(16,16,16);
  220. font-size: 48rpx;
  221. margin-top: 32rpx;
  222. }
  223. .state{
  224. color: rgba(255,123,0,1);
  225. margin-top: 8rpx;
  226. }
  227. .state2{
  228. color: rgba(0,185,98,1);
  229. font-size: 36rpx;
  230. }
  231. .details{
  232. margin-top: 40rpx;
  233. padding-top: 40rpx;
  234. border-top: 1px solid rgba(241,241,241,1);
  235. .item{
  236. display: flex;
  237. align-items: center;
  238. justify-content: space-between;
  239. margin-bottom:16rpx;
  240. .item-title{
  241. color: rgb(119,119,119);
  242. }
  243. .item-value{
  244. color: rgb(48,48,48);
  245. }
  246. }
  247. }
  248. }
  249. }
  250. // 返回
  251. .back{
  252. border: 1px solid rgba(205,205,205,1);
  253. line-height: 88rpx;
  254. border-radius: 8px;
  255. background-color: rgba(255,255,255,1);
  256. color: rgba(119,119,119,1);
  257. font-size: 32rpx;
  258. margin-top: 24rpx;
  259. }
  260. // 查看
  261. .check{
  262. line-height: 88rpx;
  263. border-radius: 8px;
  264. background-color: rgba(22,119,255,1);
  265. color: rgba(255,255,255,1);
  266. font-size: 32rpx;
  267. margin-top: 24rpx;
  268. }
  269. </style>