recordOfInvoice.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view >
  3. <ujp-navbar title="申请开票记录">
  4. </ujp-navbar>
  5. <u-tabs inactive-color="#888888" active-color="#101010" :list="list" :is-scroll="true"
  6. :current="current" @change="change"></u-tabs>
  7. <view style="text-align: center;margin-top: 100px" v-if="list[current].list.length == 0" >
  8. <img src="@/assets/img/blankpage.png">
  9. <view>查询为空</view>
  10. </view>
  11. <!-- 待开票 -->
  12. <view :class="{
  13. 'not-invoiced':current==0,
  14. 'invoiced':current==1,
  15. }">
  16. <view class="invoiced-item" v-for="(item,index) in list[current].list"
  17. @tap="view(item.id)"
  18. :key="index" >
  19. <view class="content" >
  20. <view class='title'
  21. :class="{
  22. success:item.status==2,
  23. error:item.status==1
  24. }"
  25. >
  26. 用户充电订单发票 <text class="to-invoice">{{item.statusText}}</text>
  27. </view>
  28. <p><text class="text-1">发票金额</text> <text class="text-2">{{item.amount.toFixed(2)}}元</text></p>
  29. <p><text class="text-1">发票抬头</text><text class="text-2">{{item.title}}</text></p>
  30. <p><text class="text-1">申请时间</text> <text class="text-2">{{item.createTime}}</text></p>
  31. </view>
  32. </view>
  33. <p class="tips" v-show="current==1" > 仅展示最近12个月的发票信息</p>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import * as API from '@/apis/finance.js'
  39. export default {
  40. data() {
  41. return {
  42. list: [{
  43. value:1,
  44. name: '待开票',
  45. pageIndex: 1,
  46. recordsTotal: 0,
  47. list:[],
  48. }, {
  49. value:2,
  50. name: '已开票',
  51. pageIndex: 1,
  52. recordsTotal: 0,
  53. list:[],
  54. }],
  55. current: 0,
  56. }
  57. },
  58. onReachBottom() {
  59. var list=this.list[this.current].list;
  60. var recordsTotal=this.list[this.current].recordsTotal;
  61. if (list.length < recordsTotal) {
  62. this.myLoadmore();
  63. }
  64. },
  65. onShow(){
  66. this.allck=false;
  67. this.getlist(true);
  68. },
  69. methods: {
  70. view(id){
  71. uni.navigateTo({
  72. url:'/pagesFinance/recordOfInvoice/applicationDetails?id='+id
  73. })
  74. },
  75. getlist(bl) {
  76. uni.showLoading({
  77. title: "加载中",
  78. mask: true,
  79. })
  80. var current=this.current;
  81. var pageIndex=this.list[current].pageIndex;
  82. var list=this.list[current].list;
  83. if (bl) {
  84. list = [];
  85. pageIndex = 1;
  86. }
  87. API.merchantInvoiceList({
  88. pageIndex: pageIndex,
  89. status:this.list[current].value,
  90. }).then((res) => {
  91. uni.hideLoading();
  92. var datalist=[]
  93. datalist=res.data.data;
  94. this.list[current].list = [
  95. ...list,
  96. ...datalist
  97. ];
  98. this.list[current].recordsTotal = res.data.recordsTotal;
  99. }).catch(error => {
  100. uni.showToast({
  101. title: error,
  102. icon: "none"
  103. })
  104. })
  105. },
  106. myLoadmore() {
  107. var pageIndex=this.list[this.current].pageIndex;
  108. pageIndex += 1;
  109. this.getlist()
  110. },
  111. change(index) {
  112. this.current = index;
  113. var list =this.list[this.current].list
  114. if(list.length==0){
  115. this.getlist(true);
  116. }
  117. },
  118. },
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. page{
  123. background-color: #F2F4F4;
  124. }
  125. /deep/.u-scroll-box{
  126. width: 65.8% !important;
  127. margin: 0 auto;
  128. display: flex;
  129. }
  130. /deep/.u-tab-bar{
  131. width: 18% !important;
  132. left: -5% !important;
  133. background-color: #00B962 !important; }
  134. // 未开票
  135. .flex{
  136. display: flex;
  137. }
  138. .not-invoiced-item,.invoiced-item{
  139. width: 91.4%;
  140. border-radius: 12px;
  141. background-color: rgba(255, 255, 255, 100);
  142. border: 1px solid rgba(235, 235, 235, 100);
  143. padding: 16px 0;
  144. padding-left: 18px;
  145. margin:12px auto;
  146. }
  147. .content{
  148. width: 100%;
  149. margin-left: 4px;
  150. .title{
  151. line-height: 18px;
  152. color: rgba(16, 16, 16, 100);
  153. font-size: 16px;
  154. margin-bottom: 12px;
  155. padding-right: 12px;
  156. display: flex;
  157. justify-content: space-between;
  158. .price,.invoice,.have-invoiced{
  159. height: 18px;
  160. color: rgba(255, 61, 0, 100);
  161. font-size: 18px;
  162. }
  163. }
  164. .error{
  165. color: #FF6100;
  166. }
  167. .success{
  168. color: #00b962;
  169. }
  170. p{
  171. color: rgba(102, 102, 102, 100);
  172. line-height: 26px;
  173. }
  174. .text-1{
  175. display: inline-block;
  176. width: 25vw;
  177. }
  178. .text-2{
  179. display: inline-block;
  180. margin-left:4px;
  181. width:54.6vw;
  182. }
  183. .order-box{
  184. display: flex;
  185. .order{
  186. width: 17vw;
  187. }
  188. .order-num{
  189. flex: 1;
  190. margin-left:4px;
  191. overflow: hidden;
  192. white-space: nowrap;
  193. text-overflow: ellipsis;
  194. }
  195. }
  196. }
  197. .radio{
  198. margin: auto 0;
  199. /deep/.uni-radio-input{
  200. width: 20px !important;
  201. height: 20px !important;
  202. }
  203. }
  204. .to-invoice{
  205. //color:#FF6100!important;
  206. font-size: 18px
  207. }
  208. .have-invoiced{
  209. //color: #00B962!important;
  210. font-size: 18px
  211. }
  212. .tips{
  213. color: rgba(153, 153, 153, 100);
  214. text-align: center;
  215. }
  216. </style>