選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

invoice-header-list.vue 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="contentAll">
  3. <view class="cardbox" v-if="form.data.length>0">
  4. <view class="card" v-for="(item,i) in form.data" :key="i">
  5. <view v-if="form.manage==2">
  6. <view class="icon-active" v-if="i==value" @click="choose(i,item)">
  7. <u-icon name="checkbox-mark" color="#fff" size="28"></u-icon>
  8. </view>
  9. <view class="icon-no-active" v-else @click="choose(i,item)">
  10. </view>
  11. </view>
  12. <view class="content">
  13. <view class="title">抬头类型:{{item.titleType==1?'单位':'个人'}}<text v-if="item.titleType==1"
  14. class="default">默认</text>
  15. </view>
  16. <view class="title">抬头名称:{{item.buyerName}}</view>
  17. <view class="title">纳税人识别号:{{item.buyerTaxNo}}</view>
  18. <view class="title" v-if="item.companyAddress">单位地址:{{item.companyAddress}}</view>
  19. <view class="title" v-if="item.companyTel">公司电话号码:{{item.companyTel}}</view>
  20. <view class="title" v-if="item.bankName">开户银行:{{item.bankName}}</view>
  21. <view class="title" v-if="item.bankAccount">银行账户:{{item.bankAccount}}</view>
  22. </view>
  23. <view class="edit" @click="toEdit(item)">
  24. <image :src="`${$imgUrl}applyCard/edit.png`" mode=""></image>
  25. <view>
  26. 编辑
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view v-else class="no">暂无发票抬头</view>
  32. <view class="add" @click="add">添加新抬头</view>
  33. </view>
  34. </template>
  35. <script lang="ts" setup>
  36. import {
  37. reactive, ref
  38. } from "vue";
  39. import {
  40. onLoad, onShow
  41. } from "@dcloudio/uni-app";
  42. import {
  43. navTo,
  44. } from "@/utils/utils";
  45. import { billRaiseSelect, getUserMsg } from "@/utils/network/api.js";
  46. import { requestNew } from "@/utils/network/request.js";
  47. import {
  48. getItem
  49. } from "@/utils/storage";
  50. // 表单数据
  51. const form = reactive({
  52. userMobile: "",
  53. data: [],
  54. manage: 1,//1订单管理过来的 2申请选择抬头过来的
  55. });
  56. const value = ref('-1')
  57. onLoad((option) => {
  58. form.manage = option.manage
  59. getUserinfo()
  60. })
  61. onShow(() => {
  62. if (form.userMobile) {
  63. queryList()
  64. }
  65. })
  66. const choose = (i, item) => {
  67. value.value = i
  68. console.log(item);
  69. uni.$emit('list', {
  70. item: item
  71. })
  72. uni.navigateBack({
  73. delta: 1
  74. })
  75. }
  76. const getUserinfo = () => {
  77. const options = {
  78. type: 2,
  79. data: { openId: getItem('openId') },
  80. method: "POST",
  81. showLoading: true,
  82. };
  83. requestNew(getUserMsg, options).then((res) => {
  84. const data = res;
  85. console.log(data, "用户信息");
  86. form.userMobile = data.customerTel
  87. queryList()
  88. });
  89. }
  90. const add = () => {
  91. navTo(`/subpackage/orders/invoiceApply/invoice-header-add?userMobile=${form.userMobile}`);
  92. }
  93. const queryList = () => {
  94. var data = {
  95. userMobile: form.userMobile,
  96. };
  97. const options = {
  98. type: 2,
  99. data: data,
  100. method: "POST",
  101. showLoading: true,
  102. };
  103. console.log("options", options)
  104. requestNew(billRaiseSelect, options).then((res) => {
  105. console.log("data", res)
  106. const data = res;
  107. form.data = data.titles
  108. });
  109. }
  110. const toEdit = (item) => {
  111. const params = encodeURIComponent(JSON.stringify(item))
  112. navTo(`/subpackage/orders/invoiceApply/invoice-header-edit?params=${params}&&userMobile=${form.userMobile}`)
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. .contentAll {
  117. background-color: #EEF7F7;
  118. width: 100%;
  119. min-height: 100vh;
  120. overflow: hidden;
  121. padding-bottom: 70rpx;
  122. }
  123. .add {
  124. width: 100%;
  125. height: 80rpx;
  126. background-color: white;
  127. text-align: center;
  128. line-height: 80rpx;
  129. position: fixed;
  130. bottom: 0;
  131. left: 0;
  132. font-size: 32rpx;
  133. }
  134. .no {
  135. text-align: center;
  136. padding-top: 300rpx;
  137. }
  138. .cardbox {
  139. width: 95%;
  140. margin: 0 auto;
  141. margin-top: 20rpx;
  142. .card {
  143. background: #FFFFFF;
  144. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  145. border-radius: 20rpx;
  146. display: flex;
  147. align-items: center;
  148. justify-content: space-between;
  149. padding: 30rpx;
  150. margin-bottom: 30rpx;
  151. .content {
  152. .title {
  153. font-size: 30rpx;
  154. font-family: Noto Sans S Chinese;
  155. font-weight: 400;
  156. color: #333333;
  157. margin-bottom: 15rpx;
  158. }
  159. text {
  160. font-size: 26rpx;
  161. font-family: Noto Sans S Chinese;
  162. font-weight: 400;
  163. color: #666666;
  164. }
  165. }
  166. .icon-active {
  167. width: 43rpx;
  168. height: 43rpx;
  169. background: #00B38B;
  170. border-radius: 50%;
  171. display: flex;
  172. justify-content: center;
  173. align-items: center;
  174. }
  175. .icon-no-active {
  176. width: 44rpx;
  177. height: 44rpx;
  178. background: #FFFFFF;
  179. border: 1px solid #00B38B;
  180. border-radius: 50%;
  181. }
  182. .edit {
  183. display: flex;
  184. justify-content: center;
  185. align-items: center;
  186. flex-direction: column;
  187. image {
  188. width: 40rpx;
  189. height: 40rpx;
  190. }
  191. view {
  192. font-size: 26rpx;
  193. font-family: Noto Sans S Chinese;
  194. font-weight: 400;
  195. color: #999999;
  196. }
  197. }
  198. }
  199. }
  200. .default {
  201. border: 1rpx solid #00b38b;
  202. border-radius: 5rpx;
  203. padding: 2rpx 4rpx;
  204. color: #00b38b;
  205. margin-left: 10rpx;
  206. }
  207. </style>