invoicedetails.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="pages">
  3. <view class="" :style="{height: navHeight+'px' }"></view>
  4. <view class="navbar-box">
  5. <u-navbar title="开票详情" :safeAreaInsetTop="true" @leftClick="leftClick" :titleStyle="{color:'#fff'}" leftIconColor="#fff" bgColor="#EF1818"></u-navbar>
  6. </view>
  7. <view class="page-wrap">
  8. <view class="block-wrap">
  9. <view class="title">开票详情</view>
  10. <!-- <view class="item u-flex">
  11. <view class="left">抬头类型 </view>
  12. <view class="right">{{抬头类型 }}</view>
  13. </view> -->
  14. <view class="item u-flex" v-for="(item,index) in detailsInfo[details.handlerType]" :key="index">
  15. <view class="left">{{item.name}}</view>
  16. <view class="con">
  17. <text v-if="item.key=='handlerType'">{{details[item.key]|filterHandlerType}}</text>
  18. <text :style="{color:details.status>2?'#EF0E0E':'#6CC079'}" class="status" v-else-if="item.key=='status'">{{details[item.key]|filterInvoiceState}}</text>
  19. <text v-else-if="item.key=='invoiceAmount'">¥ {{details[item.key]}}</text>
  20. <text v-else>{{details[item.key]}}</text>
  21. </view>
  22. </view>
  23. <view class="item u-flex" v-if="details.errReason">
  24. <view class="left">开票失败原因</view>
  25. <view class="con">
  26. {{details.errReason}}
  27. </view>
  28. </view>
  29. <view class="item u-flex" v-if="details.redErrReason">
  30. <view class="left">冲红失败原因</view>
  31. <view class="con">
  32. {{details.redErrReason}}
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="page-bottom" v-if="details.status===3">
  38. <view class="inner">
  39. <view class="btn active" v-if="cansubmit" @click="submitorder">重新开票</view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import { systemInfo } from "@/mixin.js";
  46. export default {
  47. mixins: [systemInfo], // 使用mixin
  48. data() {
  49. return {
  50. staticUrl:this.$commonConfig.staticUrl,
  51. orderId:'',
  52. details:{},
  53. detailsInfo:{//1:个人,2:企业
  54. 1:[
  55. {name:'抬头类型',key:'handlerType'},
  56. {name:'抬头名称',key:'name'},
  57. // {name:'税 号',key:'creditCode'},
  58. {name:'开票金额 ',key:'invoiceAmount'},
  59. {name:'电子邮箱 ',key:'email'},
  60. {name:'开具状态 ',key:'status'},
  61. ],
  62. 2:[
  63. {name:'抬头类型',key:'handlerType'},
  64. {name:'抬头名称',key:'name'},
  65. {name:'税号',key:'creditCode'},
  66. {name:'开票金额 ',key:'invoiceAmount'},
  67. {name:'电子邮箱 ',key:'email'},
  68. {name:'开具状态 ',key:'status'},
  69. // {name:'失败原因 ',key:'errReason'}
  70. ],
  71. },
  72. cansubmit:true,
  73. formData:{
  74. orderId:'',
  75. invoiceAmount:'',
  76. invoiceHandler:{
  77. handlerType:'',
  78. name:'',
  79. email:''
  80. }
  81. }
  82. }
  83. },
  84. onShow() {
  85. if(this.orderId){
  86. this.getInvoiceDetail();
  87. }
  88. },
  89. onLoad(page) {
  90. this.orderId = page.id;
  91. this.getSystemInfo();
  92. },
  93. methods: {
  94. leftClick(e){
  95. let pages = getCurrentPages();
  96. if(pages.length==1){
  97. uni.$u.route('/pages/index/index')
  98. }else{
  99. uni.navigateBack()
  100. };
  101. },
  102. getInvoiceDetail(){
  103. this.$u.api.getInvoiceDetail({orderId:this.orderId}).then(res=>{
  104. // console.log('res',res);
  105. this.details = res.data;
  106. }).catch(err=>{
  107. console.log('getInvoiceInfo',err);
  108. })
  109. },
  110. submitorder(){
  111. uni.redirectTo({
  112. url: `/center/invoice?id=${this.orderId}`
  113. })
  114. return
  115. // this.formData.orderId =this.details.orderId;
  116. // this.formData.invoiceAmount = this.details.invoiceAmount;
  117. // this.formData.invoiceHandler.handlerType = this.details.handlerType;
  118. // this.formData.invoiceHandler.name = this.details.name;
  119. // this.formData.invoiceHandler.email = this.details.email;
  120. // if(this.details.handlerType===2){//企业
  121. // this.formData.invoiceHandler.creditCode = this.details.creditCode;
  122. // }
  123. // this.$u.api.submitInvoice(this.formData).then(res=>{
  124. // uni.$u.toast(res.msg)
  125. // // uni.navigateBack()
  126. // setTimeout(()=>{
  127. // uni.redirectTo({
  128. // url: `/center/orderdetails?id=${this.orderId}`
  129. // })
  130. // },1500)
  131. // }).catch(err=>{
  132. // console.log('submitorder',err);
  133. // })
  134. }
  135. }
  136. }
  137. </script>
  138. <style>
  139. page{background-color: #F7F7F9;}
  140. </style>
  141. <style lang="scss" scoped>
  142. .block-wrap{
  143. background-color: #fff;
  144. border-radius: 16rpx;
  145. padding: 30rpx 32rpx 30rpx;
  146. margin-bottom: 24rpx;
  147. .title{
  148. font-size: 28rpx;
  149. font-weight: 500;
  150. color: #363636;
  151. margin-bottom: 28rpx;
  152. }
  153. .item{
  154. margin-bottom: 12rpx;
  155. font-size: 28rpx;
  156. font-weight: 400;
  157. color: #363636;
  158. line-height: 40rpx;
  159. .left{
  160. color: #999999;
  161. width: 184rpx;
  162. }
  163. }
  164. }
  165. .page-bottom{
  166. $height:98rpx;
  167. position: relative;
  168. z-index: 1001;
  169. height: $height;
  170. padding: 24rpx 20rpx;
  171. .inner{
  172. position: fixed;
  173. background-color: transparent;
  174. height: $height;
  175. left: 0;
  176. right: 0;
  177. bottom: 0;
  178. padding: 24rpx 20rpx;
  179. // box-shadow: 0rpx -4rpx 12rpx 0rpx rgba(215,215,215,0.5);
  180. .btn{
  181. font-size: 28rpx;
  182. height: 100%;
  183. line-height: $height;
  184. border-radius: 50rpx;
  185. padding: 0 50rpx;
  186. background-color: #eee;
  187. color: #333;
  188. text-align: center;
  189. &.active{
  190. background: linear-gradient(90deg, #FF7979 0%, #ED0000 100%);
  191. color: #fff;
  192. }
  193. }
  194. }
  195. }
  196. </style>