InvoiceTitleManagement.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view>
  3. <u-navbar title="发票抬头管理" title-color="#101010" ></u-navbar>
  4. <!-- 企业单位 -->
  5. <view class="enterprise" v-show="companyTypes.length" >
  6. <view class="title">
  7. 企业单位
  8. <image class="img" src="@/assets/img/riFill-building-fill.svg" mode=""></image>
  9. </view>
  10. <view class="infos" v-for="(item,i) in companyTypes" :key="i" @click="addInfo('/pages/invoiceManagement/addInvoiceTitle?id='+item.id)" >
  11. <view>
  12. <view class="name">
  13. {{item.title}}<view class="default" v-if="item.defaultHeader" >默认</view>
  14. </view>
  15. <view class="number">
  16. {{item.companyTaxNo}}
  17. </view>
  18. <view class="number">
  19. {{item.type=='1'?'增值税专票':'增值税普票'}}
  20. </view>
  21. </view>
  22. <view>
  23. <u-icon name="edit-pen-fill" ></u-icon>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 非企业 -->
  28. <view class="nonbusiness" v-show="personTypes.length" >
  29. <view class="title">
  30. 个人/非企业单位
  31. <image class="img" src="@/assets/img/riFill-user-2-fill.svg" mode=""></image>
  32. </view>
  33. <view class="infos" v-for="(item,i) in personTypes" :key="i" @click="addInfo('/pages/invoiceManagement/addInvoiceTitle?id='+item.id)" >
  34. <view>
  35. <view class="name">
  36. {{item.title}} <view class="default" v-if="item.defaultHeader" >默认</view>
  37. </view>
  38. </view>
  39. <view>
  40. <u-icon name="edit-pen-fill" ></u-icon>
  41. </view>
  42. </view>
  43. </view>
  44. <u-divider :isnone="companyTypes.length==0&&personTypes.length==0" nonetext="没有找到相关内容"
  45. border-color="#CFD2D5">已经到底了</u-divider>
  46. <!-- 底部 -->
  47. <view class="bottom">
  48. <button class="add" @click="addInfo('/pages/invoiceManagement/addInvoiceTitle')" >新增发票抬头</button>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import * as API from '@/apis/pagejs/invoiceApi.js'
  54. export default {
  55. data() {
  56. return {
  57. companyTypes:[],
  58. personTypes:[],
  59. }
  60. },
  61. onLoad() {
  62. this.getInvoiceList()
  63. },
  64. methods: {
  65. addInfo(url) {
  66. var url = url;
  67. uni.navigateTo({
  68. url: url,
  69. events: {
  70. refreshData: () => {
  71. this.getInvoiceList()
  72. }
  73. }
  74. })
  75. },
  76. getInvoiceList(){
  77. uni.showLoading({
  78. mask:true,title:'加载中...'
  79. })
  80. API.invoiceTypes().then((response) => {
  81. uni.hideLoading();
  82. //this.list=response.data.data;
  83. this.companyTypes=response.data.companyTypes;
  84. this.personTypes=response.data.personTypes;
  85. }).catch(error => {
  86. uni.hideLoading();
  87. uni.showToast({
  88. icon: "none",
  89. title: error
  90. })
  91. })
  92. },
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .enterprise,.nonbusiness{
  98. border-radius: 8px;
  99. margin: 24rpx 32rpx;
  100. background-color: #fff;
  101. overflow: hidden;
  102. .title{
  103. padding: 32rpx;
  104. background: linear-gradient(90deg, rgba(49,110,207,1) 2%,rgba(20,73,159,1) 100%);
  105. color: rgba(255,255,255,1);
  106. font-size: 40rpx;
  107. position: relative;
  108. font-weight: 600;
  109. .img{
  110. width: 96rpx;
  111. height: 96rpx;
  112. position: absolute;
  113. top: 16rpx;
  114. right: 16rpx;
  115. }
  116. }
  117. .infos{
  118. padding: 24rpx 32rpx;
  119. display: flex;
  120. align-items: center;
  121. justify-content: space-between;
  122. .name{
  123. color: rgba(51,51,51,1);
  124. font-size: 36rpx;
  125. display: flex;
  126. align-items: center;
  127. .default{
  128. width: 96rpx;
  129. height: 48rpx;
  130. line-height: 48rpx;
  131. border-radius: 4px;
  132. background-color: rgba(22,119,255,1);
  133. color: rgba(255,255,255,1);
  134. margin-left: 16rpx;
  135. font-size: 28rpx;
  136. text-align: center;
  137. }
  138. }
  139. .number{
  140. color: rgba(119,119,119,1);
  141. margin-top: 2rpx;
  142. }
  143. }
  144. }
  145. .nonbusiness{
  146. .title{
  147. background: linear-gradient(90deg, rgba(0,187,170,1) 2%,rgba(0,161,119,1) 100%);
  148. }
  149. }
  150. // 底部
  151. .bottom{
  152. padding: 24rpx 32rpx;
  153. background-color: rgba(255,255,255,1);
  154. position: fixed;
  155. bottom: 0;
  156. left: 0;
  157. right: 0;
  158. .add{
  159. line-height: 88rpx;
  160. border-radius: 50px;
  161. background: linear-gradient(-88.46deg, rgba(34,109,198,1) 2.59%,rgba(9,158,237,1) 97.02%);
  162. color: rgba(255,255,255,1);
  163. font-size: 36rpx;
  164. }
  165. }
  166. </style>