123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <template>
- <view class="box">
- <view class="from">
- <u-form :model="form" ref="uForm">
- <u-form-item>
- <view class="from_item">
- <text><text style="color: red;">*</text>请选择发票抬头:</text>
- <view style="display: flex;" @click="toheaderPage">
- <text>{{state.params.buyerName?state.params.buyerName:"请选择"}}</text>
- <u-icon name="arrow-right" style="margin-left: 10px;"></u-icon>
- </view>
- </view>
- </u-form-item>
- <u-form-item>
- <view class="from_item">
- <text><text style="color: red;">*</text>车辆所有人证件号后6位:</text>
- <view style="display: flex;">
- <u-input v-model="state.subIdentNo" class="input" maxlength="6" type="number" disabled />
- </view>
- </view>
- </u-form-item>
- </u-form>
- </view>
-
- <button class="submit" @click="submit">提交</button>
- </view>
-
- </template>
-
- <script setup lang="ts">
- import {
- reactive
- } from "vue";
- import { onLoad, onShow } from "@dcloudio/uni-app";
- import { navTo, msg } from "@/utils/utils"
- import { ETCProductInvoiceApi, flowServiceFee } from "@/utils/network/api.js";
- import { stringToJson } from "@/utils/network/encryption";
- import { request } from "@/utils/network/request.js";
- const state = reactive({
- type: '',
- params: "",
- orders: [],
- userMobile: "",
- subIdentNo: "",
- invoiceAmount: 0
- })
- onShow(() => {
- uni.$once('list', (query) => {
- console.log("111", query)
- state.params = query.item
- })
- })
- onLoad((option) => {
- let ordersArr = JSON.parse(decodeURIComponent(option.ordersArr))
- state.type = option.type
- state.userMobile = option.userMobile
- state.subIdentNo = option.customerIdNum.slice(-6)
- console.log("ordersArr", ordersArr)
- for (var i = 0; i < ordersArr.length; i++) {
- let obj = {}
- obj['orderNo'] = ordersArr[i]['orderNo']
- state.orders.push(obj)
- state.invoiceAmount += Number(ordersArr[i]['invoiceAmount'])
- }
- console.log("option", state.orders, state.invoiceAmount)
- })
- const toheaderPage = () => {
- console.log(1);
- navTo('/subpackage/orders/invoiceApply/invoice-header-list?manage=2')
- }
- const submit = () => {
- if (state.type == '1') {
- ETCProductInvoiceRequest()
- } else {
- flowServiceFeeRequest()
- }
- }
- const ETCProductInvoiceRequest = () => {
- console.log("state.params", state.params['id'])
- const options = {
- type: 2,
- data: {
- orders: state.orders, //订单号列表
- titleId: state.params['id'], //发票抬头编号
- subIdentNo: state.subIdentNo, //证件号后6位
- userMobile: state.userMobile, //手机号
- sellerId: "31dc9b8068604823b42b05522843560f", //售方信息编号
- },
- method: "POST",
- showLoading: true,
- };
- request(ETCProductInvoiceApi, options).then((res) => {
- const data = stringToJson(res.bizContent);
- msg("开票申请成功")
- setTimeout(() => {
- // uni.navigateBack({
- // delta: 3
- // })
- navTo(`/subpackage/orders/invoiceApply/invoiceList?userMobile=${state.userMobile}`)
- }, 1500)
- console.log(data, "通行");
- });
- }
- const flowServiceFeeRequest = () => {
- const options = {
- type: 2,
- data: {
- listNos: state.orders, //订单号列表
- titleId: state.params['id'], //发票抬头编号
- subIdentNo: state.subIdentNo, //证件号后6位
- invoiceAmount: state.invoiceAmount, //开票金额 分
- sellerId: "31dc9b8068604823b42b05522843560f", //售方信息编号
- },
- method: "POST",
- showLoading: true,
- };
- request(flowServiceFee, options).then((res) => {
- const data = stringToJson(res.bizContent);
- msg("开票申请成功")
- setTimeout(() => {
- navTo(`/subpackage/orders/invoiceApply/invoiceList?userMobile=${state.userMobile}`)
- }, 1500)
- console.log(data, "通行");
- });
- }
- </script>
-
-
- <style>
- page {
- width: 100%;
- height: 100%;
- }
- </style>
-
- <style lang="scss" scoped>
- .box {
- width: 100%;
- height: 100%;
- background-color: #FFF;
- border-top: 1rpx solid #DFDFDF;
- padding: 0 30rpx;
- box-sizing: border-box;
-
- .from {
- background-color: #fff;
- // margin-top: 20rpx;
-
- ::v-deep .u-form-item {
- padding: 0;
- line-height: normal;
-
- .u-form-item__message {
- margin-bottom: 12rpx
- }
- }
-
- .from_item {
- display: flex;
- flex-wrap: nowrap;
- justify-content: space-between;
- // padding: 0 30rpx;
- // border-bottom: #DCDCDC 1px solid;
- align-items: center;
- height: 80rpx;
-
- text {
- font-size: 30rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- }
-
- ::v-deep .input {
- text-align: right;
- flex: 1;
- background: transparent;
-
- input {
- text-align: right;
- }
- }
- }
-
- .from_item1 {
- display: flex;
- flex-wrap: nowrap;
- flex-direction: column;
- justify-content: space-between;
- padding: 30rpx;
- border-bottom: #DCDCDC 1px solid;
-
- input {
- text-align: right;
- }
-
- .textarea {
- background-color: #F1F1F1;
- width: 100%;
- border-radius: 20rpx;
- margin-top: 10rpx;
- text-indent: 1rem;
- height: 180rpx;
- padding: 20rpx;
- box-sizing: border-box;
- }
- }
- }
-
- .submit {
- width: 670rpx;
- height: 80rpx;
- background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 80rpx;
- position: fixed;
- left: 50%;
- transform: translate(-50%);
- bottom: 100rpx;
- }
- }
- </style>
|