123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <template>
- <view class="title">
- <view>
- <text :class="state.reimburseStatus=='0'?'status':'status1'" @click="getlist(0)">待补缴</text>
- <text :class="state.reimburseStatus=='1'?'status2':'status3'" @click="getlist(1)">已补缴</text>
- </view>
- </view>
- <view class="content">
- <view class="list" v-for="(item,index) in state.list" @click="details(item.id)">
- <checkbox-group @change="checkboxGroupChange(item)">
- <label class="uni-list-cell uni-list-cell-pd" style="display: flex;">
- <checkbox :checked="item.checked" style="transform:scale(0.8);top: -12rpx;position: relative;" v-if="state.reimburseStatus=='0'"/>
- <view class="right-box">
- <view class="right-box-top">
- <view>
- <image :src="`${$imgUrl}arrears.png`" mode=""></image>
- <text>{{item.vehiclePlate}}</text>
- </view>
- <text class="money">¥{{item.reimburseFee/100}}</text>
- </view>
- <view class="right-box-bot">
- <view class="name">补缴原因:</view>
- <view class="details">{{item.reason}}</view>
- </view>
- </view>
- </label>
- </checkbox-group>
- </view>
- </view>
- <view class="pay_wrap" v-if="state.reimburseStatus=='0'">
- <checkbox-group @change="checkboxChangeAll">
- <label class="uni-list-cell uni-list-cell-pd">
- <checkbox value="ALL" :checked="state.checkedAll" style="transform:scale(0.8)"/>合计 ¥{{allPrice/100}}
- </label>
- </checkbox-group>
- <view class="pay" @click="pay">支付</view>
- </view>
- </template>
-
- <script lang="ts" setup>
- import {
- ref,
- reactive
- } from "vue"
- import {
- onLoad,
- onPullDownRefresh
- } from "@dcloudio/uni-app";
- import {requestNew} from "@/utils/network/request.js";
- import {
- reimbursePage,reimburseUserPay
- } from "@/utils/network/api.js";
- import {navTo} from '@/utils/utils';
- const allPrice = ref(0)
- const state = reactive({
- reimburseStatus:"0",//0未补缴 1已补缴 2已关闭
- pageNo:1,
- pageSize:10,
- list:[],
- suppleNoList:[],//支付合集
- checkedAll:false
- })
- onLoad(() => {
- getlist(state.reimburseStatus)
- })
- const checkboxGroupChange = (e) => {
- console.log(e);
- if(state.suppleNoList.length==0){
- state.suppleNoList.push(e)
- }else{
- for(var k=0;k<state.suppleNoList.length;k++){
- if(e.orderId==state.suppleNoList[k]['orderId']){
- state.suppleNoList.splice(k,1)
- }
- }
- }
-
- // 过滤数据
- let arr = []
- allPrice.value = 0
- state.suppleNoList.forEach((item, i) => {
- state.list.forEach((val, index) => {
- console.log("state.suppleNoList",state.suppleNoList,state.list,item.orderId,val.orderId)
- if (item.orderId == val.orderId) {
- arr.push(val.reimburseFee)
- }
- })
- })
- console.log("arr",arr)
- // 计算价格
- arr.forEach(item => {
- allPrice.value += item
- })
- // 全选
- if(state.suppleNoList.length==state.list.length){
- state.checkedAll=true
- }else{
- state.checkedAll=false
- }
- console.log(state.suppleNoList, "支付集合",allPrice.value);
- }
- const checkboxChangeAll = (e) => {
- console.log(e);
- if (e.detail.value.toString() == 'ALL') {
- for (var i = 0; i < state.list.length; i++) {
- state.suppleNoList.push(state.list[i])
- state.checkedAll = true
- state.list[i].checked = true
- }
- } else {
- state.suppleNoList = []
- for (var i = 0; i < state.list.length; i++) {
- state.list[i].checked = false
- }
- allPrice.value=0
- }
- console.log(state.suppleNoList, "支付集合");
- }
- // 获取列表数据
- const getlist = (reimburseStatus) => {
- state.reimburseStatus=reimburseStatus
- const options = {
- type: 2,
- data: {
- reimburseStatus:reimburseStatus,//补缴单状态
- pageNo:state.pageNo,
- pageSize:state.pageSize
- },
- method: "POST",
- showLoading: true,
- };
- requestNew(reimbursePage, options).then((res) => {
- console.log("state.list",state.list);
- let data=res.result
- for(var i=0;i<data.length;i++){
- data[i]['vehiclePlate']=data[i]['vehicleId'].split("_")[0]
- data[i]['checked']=false
- }
- state.list =data
- });
- }
- const pay=()=>{
- console.log(allPrice.value, "支付金额");
- const options = {
- type: 2,
- data: {
- orderIds:state.reimburseStatus,//补缴单状态
- reimburseFee:state.pageNo,
- spbillCreateIp:state.pageSize
- },
- method: "POST",
- showLoading: true,
- };
- requestNew(reimburseUserPay, options).then((res) => {
- console.log("res",res);
-
- });
- }
- const details=(id)=>{
- navTo(`/subpackage/after-sale/arrears/arrears-details?id=${id}`)
- }
- </script>
-
- <style lang="scss">
- .title{
- width: 100%;
- height: 140rpx;
- background-color: white;
- position: fixed;
- left: 0;
- top: 0;
- display: flex;
- justify-content: center;
- line-height: 140rpx;
- .status{
- background: #CCB375;
- border-radius: 34rpx 0rpx 0rpx 34rpx;
- border: 1px solid #CCB375;
- color: white;
- width: 200rpx;
- height: 68rpx;
- font-size: 28rpx;
- line-height: 68rpx;
- display: inline-block;
- text-align: center;
- }
- .status1{
- border-radius: 34rpx 0rpx 0rpx 34rpx;
- border: 1px solid #CCB375;
- color: #CCB375;
- width: 200rpx;
- height: 68rpx;
- font-size: 28rpx;
- line-height: 68rpx;
- display: inline-block;
- text-align: center;
- }
- .status2{
- background:#CCB375;
- border-radius: 0rpx 34rpx 34rpx 0rpx;
- border: 1px solid #CCB375;
- font-size: 28rpx;
- color: white;
- width: 200rpx;
- height: 68rpx;
- font-size: 28rpx;
- line-height: 68rpx;
- display: inline-block;
- text-align: center;
- }
- .status3{
- border-radius: 0rpx 34rpx 34rpx 0rpx;
- border: 1px solid #CCB375;
- font-size: 28rpx;
- color: #CCB375;
- width: 200rpx;
- height: 68rpx;
- font-size: 28rpx;
- line-height: 68rpx;
- display: inline-block;
- text-align: center;
- }
- }
- .pay_wrap{
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 128rpx;
- background: #FFFFFF;
- border-radius: 30rpx 30rpx 0rpx 0rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 30rpx;
- box-sizing: border-box;
- .pay{
- width: 210rpx;
- height: 80rpx;
- background: linear-gradient(90deg, #01253B 0%, #004576 100%);
- border-radius: 40rpx;
- font-size: 32rpx;
- color: #FFFFFF;
- text-align: center;
- line-height: 80rpx;
- }
- }
- .content{
- width: 90%;
- margin: 0 auto;
- margin-top: 170rpx;
- .list{
- background: #FFFFFF;
- border-radius: 12rpx;
- border: 1px solid #FFFFFF;
- padding: 20rpx;
- box-sizing: border-box;
- margin-bottom: 30rpx;
- .right-box{
- margin-left: 10rpx;
- width: 100%;
- .right-box-top{
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-bottom: 2rpx solid #DCDCDC;
- padding-bottom: 18rpx;
- view{
- display: flex;
- align-items: center;
- image{
- width: 50rpx;
- height: 50rpx;
- margin-right: 10rpx;
- }
- }
-
- .money{
- color: #CE1717;
- }
- }
- .right-box-bot{
- font-size: 26rpx;
- color: #6C6C6C;
- display: flex;
- padding-top: 20rpx;
- .name{
- flex: 1;
- }
- .details{
- flex:3;
- }
- }
-
- }
- }
- }
- </style>
|