invoiceHistory.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="curpage">
  3. <view class="list" v-for="(item,index) in bill" @click="moveDetail(item)">
  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.stop="sendEmail(item.id)" v-if="item.status!==1&&item!==5">
  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. moveDetail(item){
  54. console.log(item)
  55. uni.navigateTo({
  56. url:"/pages/invoice/invoicedetail?obj="+JSON.stringify(item)
  57. })
  58. },
  59. loadLsit(){
  60. this.$showLoadding("加载中")
  61. uni.$u.http.post('/api/bill/list',{
  62. custom: {
  63. auth: true
  64. }
  65. }).then((res) => {
  66. uni.hideLoading()
  67. console.log(res)
  68. this.bill=res
  69. }).catch((err) => {
  70. uni.hideLoading()
  71. this.$toast(err.message)
  72. })
  73. },
  74. sendEmail(id){
  75. uni.$u.http.post('/api/bill/send', {id:id}, {
  76. custom: {
  77. auth: true
  78. }
  79. }).then((res) => {
  80. console.log(res)
  81. uni.showToast({
  82. icon: "success",
  83. title: "发送成功",
  84. })
  85. setTimeout(() => {
  86. this.loadLsit()
  87. }, 500)
  88. }).catch((err) => {
  89. this.$toast(err.message)
  90. })
  91. },
  92. checkboxChange(n) {
  93. console.log('change', n);
  94. },
  95. // 跳转抬头管理
  96. choose(){
  97. uni.navigateTo({
  98. url:"/pages/invoice/applyInvoice"
  99. })
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="less">
  105. page{
  106. background-color: #f4f4f4;
  107. font-size: 30rpx;
  108. }
  109. .list{
  110. margin: 30rpx;
  111. padding-bottom: 20rpx;
  112. background: #FFFFFF;
  113. box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.02);
  114. border-radius: 8rpx 32rpx 8rpx 32rpx;
  115. }
  116. .flex{
  117. display: flex;
  118. justify-content: space-between;
  119. padding: 30rpx;
  120. border-bottom: 1rpx solid #E3E3E3;
  121. }
  122. .content{
  123. margin: 30rpx;
  124. border-bottom: 1rpx solid #E3E3E3;
  125. }
  126. .btn{
  127. width: 198rpx;
  128. height: 64rpx;
  129. line-height: 64rpx;
  130. text-align: center;
  131. margin: 30rpx auto 20rpx;
  132. color: #1E9F6A;
  133. background: rgba(30, 159, 106, 0.1);
  134. border-radius: 32rpx;
  135. border: 1px solid #1E9F6A;
  136. }
  137. </style>