123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430 |
- <template>
- <view class="contentAll">
- <view class="titleOne">
- <text @click="invoiceRecord">开票记录</text>
- <text class="line">|</text>
- <text @click="$util.navTo(`/subpackage/orders/invoiceApply/invoice-header-list?manage=1`,true)">管理抬头</text>
- </view>
- <view class="twoOne" v-if="state.type==1">
- <view class="item last">
- <text>开票状态:</text>
- <uni-data-select v-model="state.businessTypeValOne" :localdata="state.businessRangeOne"
- @change="changeBusinessOne"></uni-data-select>
- </view>
- <button size="mini" style="color: #ffffff;
- backgroundColor: rgb(118, 200, 77);
- borderColor: rgb(118, 200, 77);
- font-size: 26rpx;
- flex-shrink: 0;margin-left: 20rpx;" @click="searchOne()">查询</button>
- </view>
- <view class="two" v-if="state.type==2">
- <view class="input">
- ETC卡号:<input placeholder="请输入ETC卡号" v-model="state.etcCardNo" />
- </view>
- <view class="three">
- <view class="item last">
- <text>开票状态:</text>
- <uni-data-select v-model="state.businessTypeVal" :localdata="state.businessRange"
- @change="changeBusiness"></uni-data-select>
- </view>
- <button size="mini" style="color: #ffffff;
- backgroundColor: rgb(118, 200, 77);
- borderColor: rgb(118, 200, 77);
- font-size: 26rpx;
- flex-shrink: 0;margin-left: 20rpx;" @click="searchTwo">查询</button>
- </view>
-
- </view>
- <view>
- <view class="cardbox">
- <view class="card" v-for="(item,i) in state.data" :key="i">
- <view>
- <checkbox-group @change="checkboxChange">
- <checkbox :value="item.orderNo" :checked="state.checked" style="transform:scale(0.7)" />
- </checkbox-group>
- </view>
- <view class="content">
- <view class="title">订单号:{{item.orderNo}}</view>
- <view class="title">订单时间:{{item.orderTime}}</view>
- <view class="title">车牌号:{{item.vehiclePlate}}</view>
- <view class="title">订单金额:¥{{item.invoiceAmount}}</view>
- <view class="title">开票状态:{{item.status==1?'已开票':"可开票"}}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
- <view class="apply-wrap">
- <view>
- <checkbox-group @change="checkboxAll">
- <checkbox value="ALL" style="transform:scale(0.7)" :checked="state.checkedAll" />全选
- </checkbox-group>
-
- </view>
- <view class="apply" @click="apply">去申请</view>
- </view>
-
- </template>
-
- <script lang="ts" setup>
- import {
- navTo, msg
- } from "@/utils/utils";
- import { reactive, ref } from "vue";
- import { onLoad, onReachBottom, onShow } from "@dcloudio/uni-app";
- import { queryEtcOrderApi, getUserMsg, trafficFlowApi } from "@/utils/network/api.js";
- import { stringToJson } from "@/utils/network/encryption";
- import { request } from "@/utils/network/request.js";
- import {
- getItem
- } from "@/utils/storage";
- const state = reactive({
- type: 1, //1 ETC产品订单 2通行流水服务费订单
- userMobile: "",
- data: [],
- businessTypeValOne: 9,
- businessRangeOne: [{
- 'value': 9,
- 'text': '可开票'
- }, {
- 'value': 1,
- 'text': '已开票'
- }],
- businessTypeVal: 9,
- businessRange: [{
- 'value': 9,
- 'text': '可开票'
- }, {
- 'value': 1,
- 'text': '已开票'
- }, {
- 'value': 2,
- 'text': '已开纸质票'
- }],
- etcCardNo: "",
- pageSize: 10, //每页数据量
- pageNo: 1, // 当前页
- ordersArr: [],
- checked: false,
- checkedAll: false,
- flags: false,
- customerIdNum: ""
- })
- onLoad((option) => {
- state.type = option.type
- getUserinfo()
- })
- // onShow(() => {
- // if (state.type == 1) {
- // etcOrder(1)
- // }
- // })
- const value = ref('')
- const getUserinfo = () => {
- const options = {
- type: 2,
- data: {
- openId: getItem('openId'),
- },
- method: "POST",
- showLoading: true,
- };
- request(getUserMsg, options).then((res) => {
- const data = stringToJson(res.bizContent);
- console.log(data, "用户信息");
- state.userMobile = data.customerTel
- state.customerIdNum = data.customerIdNum
- if (state.type == 1) {
- etcOrder(1)
- }
- });
- }
- const etcOrder = (val) => {
- if (val == 1) {
- state.pageNo = 1
- }
- if (state.pageNo == 1 && state.data.length > 0) {
- state.data = []
- }
- const options = {
- type: 2,
- data: {
- userMobile: state.userMobile,
- page: state.pageNo,
- pageSize: state.pageSize,
- status: state.businessTypeValOne
- },
- method: "POST",
- showLoading: true,
- };
- request(queryEtcOrderApi, options).then((res) => {
- const data = stringToJson(res.bizContent);
- state.data = data.orders
- console.log(data, "查询ETC产品订单");
- });
- }
- const trafficFlow = (val) => {
- if (val == 1) {
- state.pageNo = 1
- }
- if (state.pageNo == 1 && state.data.length > 0) {
- state.data = []
- }
- const options = {
- type: 2,
- data: {
- etcCardNo: state.etcCardNo,
- userMobile: state.userMobile,
- pageNumber: state.pageNo,
- page: state.pageSize,
- status: state.businessTypeVal
- },
- method: "POST",
- showLoading: true,
- };
- request(trafficFlowApi, options).then((res) => {
- const data = stringToJson(res.bizContent);
- state.data = data.orders
- console.log(data, "通行");
- });
- }
- const changeBusiness = (e) => {
- state.businessTypeVal = e
- console.log(e)
- }
- const changeBusinessOne = (e) => {
- state.businessTypeValOne = e
- console.log(e)
- }
- const apply = () => {
- let newArr = []
- for (var i = 0; i < state.ordersArr.length; i++) {
- for (var k = 0; k < state.data.length; k++) {
- if (state.ordersArr[i] == state.data[k]['orderNo']) {
- newArr.push(state.data[k])
- }
- }
- }
- const params = encodeURIComponent(JSON.stringify(newArr))
- if (state.ordersArr.length >= 1) {
- navTo(`/subpackage/orders/invoiceApply/invoice-step1?type=${state.type}&&ordersArr=${params}&&userMobile=${state.userMobile}&&customerIdNum=${state.customerIdNum}`)
- } else {
- msg("请选择订单开票")
- }
- }
- const searchOne = () => {
- state.pageNo = 1
- etcOrder(2)
- }
- const searchTwo = () => {
- state.pageNo = 1
- trafficFlow(1)
- }
- const invoiceRecord = () => {
- navTo(`/subpackage/orders/invoiceApply/invoiceList?userMobile=${state.userMobile}`)
- }
- const checkboxChange = (e) => {
- state.ordersArr = e.detail.value
- if (state.ordersArr.length == state.data.length) {
- console.log("进来了")
- state.checkedAll = true
- } else {
- state.checkedAll = false
- }
- console.log("e", e.detail.value)
- }
- const checkboxAll = (e) => {
- if (e.detail.value.toString() == 'ALL') {
- for (var i = 0; i < state.data.length; i++) {
- state.ordersArr.push(state.data[i]['orderNo'])
- state.checkedAll = true
- state.checked = true
- }
- } else {
- state.ordersArr = []
- state.checked = false
- }
- console.log("全部", e.detail.value)
- }
- // 触底加载
- onReachBottom(() => {
- if (state.data.length < state.pageNo * 10) return state.flags = true
- console.log("触底了")
- state.pageNo++
- if (state.type == 1) {
- etcOrder(2)
- } else {
- trafficFlow(2)
- }
- })
- </script>
-
- <style scoped lang="scss">
- .contentAll {
- font-size: 32rpx;
- background: #eef7f7;
- width: 100%;
- min-height: 100vh;
- }
-
- .titleOne {
- display: flex;
- align-items: center;
- justify-content: space-evenly;
- background-color: white;
- padding: 20rpx;
- }
-
- .line {
- color: #ccc;
- }
-
- .cardbox {
- width: 95%;
- margin: 0 auto;
- margin-top: 20rpx;
-
- .card {
- background: #FFFFFF;
- box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
- border-radius: 20rpx;
- display: flex;
- align-items: center;
- padding: 30rpx;
- margin-bottom: 30rpx;
-
- .content {
- margin-left: 30rpx;
-
- .title {
- font-size: 30rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #333333;
- margin-bottom: 15rpx;
- }
-
- text {
- font-size: 26rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #666666;
- }
- }
-
- .icon-active {
- width: 43rpx;
- height: 43rpx;
- background: #00B38B;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- }
-
- .icon-no-active {
- width: 44rpx;
- height: 44rpx;
- background: #FFFFFF;
- border: 1px solid #00B38B;
- border-radius: 50%;
- }
-
- .edit {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
-
-
- image {
- width: 40rpx;
- height: 40rpx;
- }
-
- view {
- font-size: 26rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #999999;
- }
- }
- }
- }
-
- .apply {
- width: 150rpx;
- height: 70rpx;
- background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
- border-radius: 40rpx;
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 70rpx;
- text-align: center;
-
- }
-
- .apply-wrap {
- width: 100%;
- position: fixed;
- bottom: 0;
- left: 0;
- background-color: white;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- display: flex;
- align-items: center;
- height: 100rpx;
- padding: 0 20rpx;
- justify-content: space-between;
- box-sizing: border-box;
- }
-
- ::deep.last .uni-stat__select {
- width: 360rpx !important;
- }
-
- .item {
- display: flex;
- font-size: 30rpx;
- margin-top: 10rpx;
- align-items: center;
- }
-
- .twoOne {
- background-color: white;
- margin-top: 10rpx;
- padding: 20rpx;
- display: flex;
- align-items: center;
- }
-
- .three {
- display: flex;
- align-items: center;
- }
-
- .two {
- background-color: white;
- margin-top: 10rpx;
- padding: 20rpx;
-
- }
-
- .input {
- display: flex;
- align-items: center;
- padding-left: 10prx;
- }
-
- .input>input {
- width: 45%;
- margin-top: 10rpx;
- font-size: 30rpx;
- border: 1rpx solid #ccc;
- padding: 0 10rpx;
- height: 28rpx;
- line-height: 28rpx;
- }
- </style>
|