myInvoice.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="invoice">
  3. <z-paging ref="paging" v-model="invoiceList" @query="queryList">
  4. <!-- 导航栏 -->
  5. <u-navbar
  6. title-color="#fff"
  7. :custom-back="customBack"
  8. :border-bottom="false"
  9. back-icon-color="#CCE8FF"
  10. :background="{ background: '#008CFF' }"
  11. title="我的发票"
  12. class="invoice-navbar"
  13. slot="top"
  14. >
  15. <view slot="right" class="invoice-navbar-right" @click="addInvoice">开发票</view>
  16. </u-navbar>
  17. <!-- 列表 -->
  18. <view class="invoice-list">
  19. <view class="invoice-list-item" v-for="(item, index) in invoiceList" :key="index">
  20. <view class="invoice-list-item-left">
  21. <view class="invoice-list-item-left-item" v-for="(child, childIndex) in invoiceObjectList" :key="childIndex">
  22. <view class="left">{{ child.label }}</view>
  23. <view class="right">
  24. <template v-if="child.type === 'money'">¥{{ item[child.key] }}</template>
  25. <template v-else>
  26. {{ item[child.key] }}
  27. </template>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="invoice-list-item-right"></view>
  32. </view>
  33. </view>
  34. </z-paging>
  35. <u-select v-model="chooseRecords.show" :list="chooseRecords.list" @confirm="chooseRecordsConfirm" />
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. invoiceList: [
  43. { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
  44. { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
  45. { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
  46. { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' }
  47. ],
  48. invoiceObjectList: [
  49. { label: '主题:', key: 'title' },
  50. { label: '金额:', key: 'price', type: 'money' },
  51. { label: '申请开票时间:', key: 'applyTime' }
  52. ],
  53. chooseRecords: {
  54. show: false,
  55. list: [
  56. {
  57. value: 'parkingRecords',
  58. label: '停车记录'
  59. },
  60. {
  61. value: 'monthlyRecords',
  62. label: '包月记录'
  63. }
  64. ]
  65. }
  66. };
  67. },
  68. methods: {
  69. /**
  70. * @description: 指定返回上一页
  71. * @return {*}
  72. */
  73. customBack() {
  74. this.$u.route({
  75. type: 'switchTab',
  76. url: 'pages/center/index'
  77. });
  78. },
  79. /**
  80. * @description: 开发票
  81. * @return {*}
  82. */
  83. addInvoice() {
  84. this.chooseRecords.show = true;
  85. },
  86. /**
  87. * @description: 开发票选择确认
  88. * @param {*} val
  89. * @return {*}
  90. */
  91. chooseRecordsConfirm(list) {
  92. this.$u.route({
  93. url: '/pages/invoiceModule/availableOrder/availableOrder',
  94. params: {
  95. type: list[0].value
  96. }
  97. });
  98. },
  99. /**
  100. * @description: 分页触发
  101. * @param {*} pageNo
  102. * @param {*} pageSize
  103. * @return {*}
  104. */
  105. queryList(pageNo, pageSize) {
  106. this.$refs.paging.complete([
  107. { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
  108. { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
  109. { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
  110. { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' }
  111. ]);
  112. }
  113. }
  114. };
  115. </script>
  116. <style lang="scss" scoped>
  117. @import './myInvoice.scss';
  118. </style>