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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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 { mergeInvoicing, batchInvoice } from "@/utils/network/api.js";
  34. import { stringToJson } from "@/utils/network/encryption";
  35. import { request, requestNew } 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.orders.push(ordersArr[i]['orderNo'])
  61. state.invoiceAmount += Number(ordersArr[i]['invoiceAmount'])
  62. }
  63. console.log("option", state.orders, state.invoiceAmount)
  64. })
  65. const toheaderPage = () => {
  66. console.log(1);
  67. navTo('/subpackage/orders/invoiceApply/invoice-header-list?manage=2')
  68. }
  69. const submit = () => {
  70. if (state.type == '1') {
  71. ETCProductInvoiceRequest()
  72. } else {
  73. flowServiceFeeRequest()
  74. }
  75. }
  76. const ETCProductInvoiceRequest = () => {
  77. console.log("state.params", state.params['id'])
  78. const options = {
  79. type: 2,
  80. data: {
  81. orders: state.orders, //订单号列表
  82. titleId: state.params['id'], //发票抬头编号
  83. subIdentNo: state.subIdentNo, //证件号后6位
  84. userMobile: state.userMobile, //手机号
  85. sellerId: "31dc9b8068604823b42b05522843560f", //售方信息编号
  86. },
  87. method: "POST",
  88. showLoading: true,
  89. };
  90. requestNew(mergeInvoicing, options).then((res) => {
  91. const data = res;
  92. msg("开票申请成功")
  93. setTimeout(() => {
  94. // uni.navigateBack({
  95. // delta: 3
  96. // })
  97. navTo(`/subpackage/orders/invoiceApply/invoiceList?userMobile=${state.userMobile}`)
  98. }, 1500)
  99. console.log(data, "通行");
  100. });
  101. }
  102. const flowServiceFeeRequest = () => {
  103. const options = {
  104. type: 2,
  105. data: {
  106. listNos: state.orders, //订单号列表
  107. titleId: state.params['id'], //发票抬头编号
  108. subIdentNo: state.subIdentNo, //证件号后6位
  109. invoiceAmount: state.invoiceAmount, //开票金额 分
  110. sellerId: "31dc9b8068604823b42b05522843560f", //售方信息编号
  111. },
  112. method: "POST",
  113. showLoading: true,
  114. };
  115. requestNew(batchInvoice, options).then((res) => {
  116. const data =res;
  117. msg("开票申请成功")
  118. setTimeout(() => {
  119. navTo(`/subpackage/orders/invoiceApply/invoiceList?userMobile=${state.userMobile}`)
  120. }, 1500)
  121. console.log(data, "通行");
  122. });
  123. }
  124. </script>
  125. <style>
  126. page {
  127. width: 100%;
  128. height: 100%;
  129. }
  130. </style>
  131. <style lang="scss" scoped>
  132. .box {
  133. width: 100%;
  134. height: 100%;
  135. background-color: #FFF;
  136. border-top: 1rpx solid #DFDFDF;
  137. padding: 0 30rpx;
  138. box-sizing: border-box;
  139. .from {
  140. background-color: #fff;
  141. // margin-top: 20rpx;
  142. ::v-deep .u-form-item {
  143. padding: 0;
  144. line-height: normal;
  145. .u-form-item__message {
  146. margin-bottom: 12rpx
  147. }
  148. }
  149. .from_item {
  150. display: flex;
  151. flex-wrap: nowrap;
  152. justify-content: space-between;
  153. // padding: 0 30rpx;
  154. // border-bottom: #DCDCDC 1px solid;
  155. align-items: center;
  156. height: 80rpx;
  157. text {
  158. font-size: 30rpx;
  159. font-family: Noto Sans S Chinese;
  160. font-weight: 400;
  161. }
  162. ::v-deep .input {
  163. text-align: right;
  164. flex: 1;
  165. background: transparent;
  166. input {
  167. text-align: right;
  168. }
  169. }
  170. }
  171. .from_item1 {
  172. display: flex;
  173. flex-wrap: nowrap;
  174. flex-direction: column;
  175. justify-content: space-between;
  176. padding: 30rpx;
  177. border-bottom: #DCDCDC 1px solid;
  178. input {
  179. text-align: right;
  180. }
  181. .textarea {
  182. background-color: #F1F1F1;
  183. width: 100%;
  184. border-radius: 20rpx;
  185. margin-top: 10rpx;
  186. text-indent: 1rem;
  187. height: 180rpx;
  188. padding: 20rpx;
  189. box-sizing: border-box;
  190. }
  191. }
  192. }
  193. .submit {
  194. width: 670rpx;
  195. height: 80rpx;
  196. background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
  197. border-radius: 40rpx;
  198. font-size: 32rpx;
  199. font-family: Noto Sans S Chinese;
  200. font-weight: 400;
  201. color: #FFFFFF;
  202. line-height: 80rpx;
  203. position: fixed;
  204. left: 50%;
  205. transform: translate(-50%);
  206. bottom: 100rpx;
  207. }
  208. }
  209. </style>