You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

invoice-header-list.vue 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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 { stringToJson } from "@/utils/network/encryption";
  47. import { request,requestNew } from "@/utils/network/request.js";
  48. import {
  49. getItem
  50. } from "@/utils/storage";
  51. // 表单数据
  52. const form = reactive({
  53. userMobile: "",
  54. data: [],
  55. manage: 1,//1订单管理过来的 2申请选择抬头过来的
  56. });
  57. const value = ref('-1')
  58. onLoad((option) => {
  59. form.manage = option.manage
  60. getUserinfo()
  61. })
  62. onShow(() => {
  63. if (form.userMobile) {
  64. queryList()
  65. }
  66. })
  67. const choose = (i, item) => {
  68. value.value = i
  69. console.log(item);
  70. uni.$emit('list', {
  71. item: item
  72. })
  73. uni.navigateBack({
  74. delta: 1
  75. })
  76. }
  77. const getUserinfo = () => {
  78. const options = {
  79. type: 2,
  80. data: { openId: getItem('openId') },
  81. method: "POST",
  82. showLoading: true,
  83. };
  84. request(getUserMsg, options).then((res) => {
  85. const data = stringToJson(res.bizContent);
  86. console.log(data, "用户信息");
  87. form.userMobile = data.customerTel
  88. queryList()
  89. });
  90. }
  91. const add = () => {
  92. navTo(`/subpackage/orders/invoiceApply/invoice-header-add?userMobile=${form.userMobile}`);
  93. }
  94. const queryList = () => {
  95. var data = {
  96. userMobile: form.userMobile,
  97. };
  98. const options = {
  99. type: 2,
  100. data: data,
  101. method: "POST",
  102. showLoading: true,
  103. };
  104. console.log("options", options)
  105. requestNew(billRaiseSelect, options).then((res) => {
  106. const data = res;
  107. form.data = data.titles
  108. console.log("data", data.titles)
  109. });
  110. }
  111. const toEdit = (item) => {
  112. const params = encodeURIComponent(JSON.stringify(item))
  113. navTo(`/subpackage/orders/invoiceApply/invoice-header-edit?params=${params}&&userMobile=${form.userMobile}`)
  114. }
  115. </script>
  116. <style scoped lang="scss">
  117. .contentAll {
  118. background-color: #EEF7F7;
  119. width: 100%;
  120. min-height: 100vh;
  121. overflow: hidden;
  122. padding-bottom: 70rpx;
  123. }
  124. .add {
  125. width: 100%;
  126. height: 80rpx;
  127. background-color: white;
  128. text-align: center;
  129. line-height: 80rpx;
  130. position: fixed;
  131. bottom: 0;
  132. left: 0;
  133. font-size: 32rpx;
  134. }
  135. .no {
  136. text-align: center;
  137. padding-top: 300rpx;
  138. }
  139. .cardbox {
  140. width: 95%;
  141. margin: 0 auto;
  142. margin-top: 20rpx;
  143. .card {
  144. background: #FFFFFF;
  145. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  146. border-radius: 20rpx;
  147. display: flex;
  148. align-items: center;
  149. justify-content: space-between;
  150. padding: 30rpx;
  151. margin-bottom: 30rpx;
  152. .content {
  153. .title {
  154. font-size: 30rpx;
  155. font-family: Noto Sans S Chinese;
  156. font-weight: 400;
  157. color: #333333;
  158. margin-bottom: 15rpx;
  159. }
  160. text {
  161. font-size: 26rpx;
  162. font-family: Noto Sans S Chinese;
  163. font-weight: 400;
  164. color: #666666;
  165. }
  166. }
  167. .icon-active {
  168. width: 43rpx;
  169. height: 43rpx;
  170. background: #00B38B;
  171. border-radius: 50%;
  172. display: flex;
  173. justify-content: center;
  174. align-items: center;
  175. }
  176. .icon-no-active {
  177. width: 44rpx;
  178. height: 44rpx;
  179. background: #FFFFFF;
  180. border: 1px solid #00B38B;
  181. border-radius: 50%;
  182. }
  183. .edit {
  184. display: flex;
  185. justify-content: center;
  186. align-items: center;
  187. flex-direction: column;
  188. image {
  189. width: 40rpx;
  190. height: 40rpx;
  191. }
  192. view {
  193. font-size: 26rpx;
  194. font-family: Noto Sans S Chinese;
  195. font-weight: 400;
  196. color: #999999;
  197. }
  198. }
  199. }
  200. }
  201. .default {
  202. border: 1rpx solid #00b38b;
  203. border-radius: 5rpx;
  204. padding: 2rpx 4rpx;
  205. color: #00b38b;
  206. margin-left: 10rpx;
  207. }
  208. </style>