selectTitleManagement.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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="selectInfo(item)" >
  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="selectInfo(item)" >
  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. selectInfo(item){
  66. this.carhelp.set('select_invoice_title',item)
  67. uni.navigateBack()
  68. },
  69. addInfo(url) {
  70. var url = url;
  71. uni.navigateTo({
  72. url: url,
  73. events: {
  74. refreshData: () => {
  75. this.getInvoiceList()
  76. }
  77. }
  78. })
  79. },
  80. getInvoiceList(){
  81. uni.showLoading({
  82. mask:true,title:'加载中...'
  83. })
  84. API.invoiceTypes().then((response) => {
  85. uni.hideLoading();
  86. //this.list=response.data.data;
  87. this.companyTypes=response.data.companyTypes;
  88. this.personTypes=response.data.personTypes;
  89. }).catch(error => {
  90. uni.hideLoading();
  91. uni.showToast({
  92. icon: "none",
  93. title: error
  94. })
  95. })
  96. },
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .enterprise,.nonbusiness{
  102. border-radius: 8px;
  103. margin: 24rpx 32rpx;
  104. background-color: #fff;
  105. overflow: hidden;
  106. .title{
  107. padding: 32rpx;
  108. background: linear-gradient(90deg, rgba(49,110,207,1) 2%,rgba(20,73,159,1) 100%);
  109. color: rgba(255,255,255,1);
  110. font-size: 40rpx;
  111. position: relative;
  112. font-weight: 600;
  113. .img{
  114. width: 96rpx;
  115. height: 96rpx;
  116. position: absolute;
  117. top: 16rpx;
  118. right: 16rpx;
  119. }
  120. }
  121. .infos{
  122. padding: 24rpx 32rpx;
  123. display: flex;
  124. align-items: center;
  125. justify-content: space-between;
  126. .name{
  127. color: rgba(51,51,51,1);
  128. font-size: 36rpx;
  129. display: flex;
  130. align-items: center;
  131. .default{
  132. width: 96rpx;
  133. height: 48rpx;
  134. line-height: 48rpx;
  135. border-radius: 4px;
  136. background-color: rgba(22,119,255,1);
  137. color: rgba(255,255,255,1);
  138. margin-left: 16rpx;
  139. font-size: 28rpx;
  140. text-align: center;
  141. }
  142. }
  143. .number{
  144. color: rgba(119,119,119,1);
  145. margin-top: 2rpx;
  146. }
  147. }
  148. }
  149. .nonbusiness{
  150. .title{
  151. background: linear-gradient(90deg, rgba(0,187,170,1) 2%,rgba(0,161,119,1) 100%);
  152. }
  153. }
  154. // 底部
  155. .bottom{
  156. padding: 24rpx 32rpx;
  157. background-color: rgba(255,255,255,1);
  158. position: fixed;
  159. bottom: 0;
  160. left: 0;
  161. right: 0;
  162. .add{
  163. line-height: 88rpx;
  164. border-radius: 50px;
  165. background: linear-gradient(-88.46deg, rgba(34,109,198,1) 2.59%,rgba(9,158,237,1) 97.02%);
  166. color: rgba(255,255,255,1);
  167. font-size: 36rpx;
  168. }
  169. }
  170. </style>