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-step1.vue 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="box">
  3. <view class="from">
  4. <u-form :model="form" ref="uForm">
  5. <u-form-item>
  6. <view class="from_item">
  7. <text><text style="color: red;">*</text>请选择发票抬头:</text>
  8. <view style="display: flex;" @click="toheaderPage">
  9. <text>{{state.params.buyerName?state.params.buyerName:"请选择"}}</text>
  10. <u-icon name="arrow-right" style="margin-left: 10px;"></u-icon>
  11. </view>
  12. </view>
  13. </u-form-item>
  14. <u-form-item>
  15. <view class="from_item">
  16. <text><text style="color: red;">*</text>车辆所有人证件号后6位:</text>
  17. <view style="display: flex;">
  18. <u-input v-model="state.subIdentNo" class="input" maxlength="6" type="number" disabled />
  19. </view>
  20. </view>
  21. </u-form-item>
  22. </u-form>
  23. </view>
  24. <button class="submit" @click="submit">提交</button>
  25. </view>
  26. </template>
  27. <script setup lang="ts">
  28. import {
  29. reactive
  30. } from "vue";
  31. import { onLoad, onShow } from "@dcloudio/uni-app";
  32. import { navTo, msg } from "@/utils/utils"
  33. import { ETCProductInvoiceApi, flowServiceFee } from "@/utils/network/api.js";
  34. import { stringToJson } from "@/utils/network/encryption";
  35. import { request } from "@/utils/network/request.js";
  36. const state = reactive({
  37. type: '',
  38. params: "",
  39. orders: [],
  40. userMobile: "",
  41. subIdentNo: "",
  42. invoiceAmount: 0
  43. })
  44. onShow(() => {
  45. uni.$once('list', (query) => {
  46. console.log("111", query)
  47. state.params = query.item
  48. })
  49. })
  50. onLoad((option) => {
  51. let ordersArr = JSON.parse(decodeURIComponent(option.ordersArr))
  52. state.type = option.type
  53. state.userMobile = option.userMobile
  54. state.subIdentNo = option.customerIdNum.slice(-6)
  55. console.log("ordersArr", ordersArr)
  56. for (var i = 0; i < ordersArr.length; i++) {
  57. let obj = {}
  58. obj['orderNo'] = ordersArr[i]['orderNo']
  59. state.orders.push(obj)
  60. state.invoiceAmount += Number(ordersArr[i]['invoiceAmount'])
  61. }
  62. console.log("option", state.orders, state.invoiceAmount)
  63. })
  64. const toheaderPage = () => {
  65. console.log(1);
  66. navTo('/subpackage/orders/invoiceApply/invoice-header-list?manage=2')
  67. }
  68. const submit = () => {
  69. if (state.type == '1') {
  70. ETCProductInvoiceRequest()
  71. } else {
  72. flowServiceFeeRequest()
  73. }
  74. }
  75. const ETCProductInvoiceRequest = () => {
  76. console.log("state.params", state.params['id'])
  77. const options = {
  78. type: 2,
  79. data: {
  80. orders: state.orders, //订单号列表
  81. titleId: state.params['id'], //发票抬头编号
  82. subIdentNo: state.subIdentNo, //证件号后6位
  83. userMobile: state.userMobile, //手机号
  84. sellerId: "31dc9b8068604823b42b05522843560f", //售方信息编号
  85. },
  86. method: "POST",
  87. showLoading: true,
  88. };
  89. request(ETCProductInvoiceApi, options).then((res) => {
  90. const data = stringToJson(res.bizContent);
  91. msg("开票申请成功")
  92. setTimeout(() => {
  93. // uni.navigateBack({
  94. // delta: 3
  95. // })
  96. navTo(`/subpackage/orders/invoiceApply/invoiceList?userMobile=${state.userMobile}`)
  97. }, 1500)
  98. console.log(data, "通行");
  99. });
  100. }
  101. const flowServiceFeeRequest = () => {
  102. const options = {
  103. type: 2,
  104. data: {
  105. listNos: state.orders, //订单号列表
  106. titleId: state.params['id'], //发票抬头编号
  107. subIdentNo: state.subIdentNo, //证件号后6位
  108. invoiceAmount: state.invoiceAmount, //开票金额 分
  109. sellerId: "31dc9b8068604823b42b05522843560f", //售方信息编号
  110. },
  111. method: "POST",
  112. showLoading: true,
  113. };
  114. request(flowServiceFee, options).then((res) => {
  115. const data = stringToJson(res.bizContent);
  116. msg("开票申请成功")
  117. setTimeout(() => {
  118. navTo(`/subpackage/orders/invoiceApply/invoiceList?userMobile=${state.userMobile}`)
  119. }, 1500)
  120. console.log(data, "通行");
  121. });
  122. }
  123. </script>
  124. <style>
  125. page {
  126. width: 100%;
  127. height: 100%;
  128. }
  129. </style>
  130. <style lang="scss" scoped>
  131. .box {
  132. width: 100%;
  133. height: 100%;
  134. background-color: #FFF;
  135. border-top: 1rpx solid #DFDFDF;
  136. padding: 0 30rpx;
  137. box-sizing: border-box;
  138. .from {
  139. background-color: #fff;
  140. // margin-top: 20rpx;
  141. ::v-deep .u-form-item {
  142. padding: 0;
  143. line-height: normal;
  144. .u-form-item__message {
  145. margin-bottom: 12rpx
  146. }
  147. }
  148. .from_item {
  149. display: flex;
  150. flex-wrap: nowrap;
  151. justify-content: space-between;
  152. // padding: 0 30rpx;
  153. // border-bottom: #DCDCDC 1px solid;
  154. align-items: center;
  155. height: 80rpx;
  156. text {
  157. font-size: 30rpx;
  158. font-family: Noto Sans S Chinese;
  159. font-weight: 400;
  160. }
  161. ::v-deep .input {
  162. text-align: right;
  163. flex: 1;
  164. background: transparent;
  165. input {
  166. text-align: right;
  167. }
  168. }
  169. }
  170. .from_item1 {
  171. display: flex;
  172. flex-wrap: nowrap;
  173. flex-direction: column;
  174. justify-content: space-between;
  175. padding: 30rpx;
  176. border-bottom: #DCDCDC 1px solid;
  177. input {
  178. text-align: right;
  179. }
  180. .textarea {
  181. background-color: #F1F1F1;
  182. width: 100%;
  183. border-radius: 20rpx;
  184. margin-top: 10rpx;
  185. text-indent: 1rem;
  186. height: 180rpx;
  187. padding: 20rpx;
  188. box-sizing: border-box;
  189. }
  190. }
  191. }
  192. .submit {
  193. width: 670rpx;
  194. height: 80rpx;
  195. background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
  196. border-radius: 40rpx;
  197. font-size: 32rpx;
  198. font-family: Noto Sans S Chinese;
  199. font-weight: 400;
  200. color: #FFFFFF;
  201. line-height: 80rpx;
  202. position: fixed;
  203. left: 50%;
  204. transform: translate(-50%);
  205. bottom: 100rpx;
  206. }
  207. }
  208. </style>