invoiceHistory.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="curpage">
  3. <view class="list" v-for="(item,index) in bill">
  4. <view class="flex">
  5. <view class="">
  6. {{item.name}}
  7. </view>
  8. <view class="" style="color: #1E9F6A;" v-if="item.status==1">
  9. 已申请
  10. </view>
  11. <view class="" style="color: #1E9F6A;" v-if="item.status==2">
  12. 已开票
  13. </view>
  14. <view class="" style="color: #1E9F6A;" v-if="item.status==3">
  15. 待发送
  16. </view>
  17. <view class="" style="color: #1E9F6A;" v-if="item.status==4">
  18. 已发送
  19. </view>
  20. <view class="" style="color: #1E9F6A;" v-if="item.status==5">
  21. 已拒绝
  22. </view>
  23. </view>
  24. <view class="content">
  25. <view class="">
  26. <text style="color: #666666 ;">电子发票 | 发票金额 :</text>
  27. ¥{{item.amount}}
  28. </view>
  29. <view class="" style="margin: 20rpx 0;">
  30. <text style="color: #666666 ;">申请时间:</text>
  31. {{item.created_at.slice(0,10)}}
  32. </view>
  33. </view>
  34. <view class="btn" @click="sendEmail(item.id)" v-if="item.status!==1">
  35. 发送至邮箱
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data(){
  43. return{
  44. bill:[],
  45. keyword:'',
  46. checkboxValue1:[],
  47. }
  48. },
  49. onLoad() {
  50. this.loadLsit()
  51. },
  52. methods:{
  53. loadLsit(){
  54. this.$showLoadding("加载中")
  55. uni.$u.http.post('/api/bill/list',{
  56. custom: {
  57. auth: true
  58. }
  59. }).then((res) => {
  60. uni.hideLoading()
  61. console.log(res)
  62. this.bill=res
  63. }).catch((err) => {
  64. uni.hideLoading()
  65. this.$toast(err.message)
  66. })
  67. },
  68. sendEmail(id){
  69. uni.$u.http.post('/api/bill/send', {id:id}, {
  70. custom: {
  71. auth: true
  72. }
  73. }).then((res) => {
  74. console.log(res)
  75. uni.showToast({
  76. icon: "success",
  77. title: "发送成功",
  78. })
  79. setTimeout(() => {
  80. this.loadLsit()
  81. }, 500)
  82. }).catch((err) => {
  83. this.$toast(err.message)
  84. })
  85. },
  86. checkboxChange(n) {
  87. console.log('change', n);
  88. },
  89. // 跳转抬头管理
  90. choose(){
  91. uni.navigateTo({
  92. url:"/pages/invoice/applyInvoice"
  93. })
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="less">
  99. page{
  100. background-color: #f4f4f4;
  101. font-size: 30rpx;
  102. }
  103. .list{
  104. margin: 30rpx;
  105. padding-bottom: 20rpx;
  106. background: #FFFFFF;
  107. box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.02);
  108. border-radius: 8rpx 32rpx 8rpx 32rpx;
  109. }
  110. .flex{
  111. display: flex;
  112. justify-content: space-between;
  113. padding: 30rpx;
  114. border-bottom: 1rpx solid #E3E3E3;
  115. }
  116. .content{
  117. margin: 30rpx;
  118. border-bottom: 1rpx solid #E3E3E3;
  119. }
  120. .btn{
  121. width: 198rpx;
  122. height: 64rpx;
  123. line-height: 64rpx;
  124. text-align: center;
  125. margin: 30rpx auto 20rpx;
  126. color: #1E9F6A;
  127. background: rgba(30, 159, 106, 0.1);
  128. border-radius: 32rpx;
  129. border: 1px solid #1E9F6A;
  130. }
  131. </style>