|
|
@@ -6,7 +6,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content"> |
|
|
|
<view class="list" v-for="(item,index) in state.list" @click="details(item.id)"> |
|
|
|
<view class="list" v-for="(item,index) in state.list" @click="state.reimburseStatus=='1'?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'"/> |
|
|
@@ -47,9 +47,7 @@ |
|
|
|
onPullDownRefresh |
|
|
|
} from "@dcloudio/uni-app"; |
|
|
|
import {requestNew} from "@/utils/network/request.js"; |
|
|
|
import { |
|
|
|
reimbursePage,reimburseUserPay |
|
|
|
} from "@/utils/network/api.js"; |
|
|
|
import {reimbursePage,reimburseUserPay} from "@/utils/network/api.js"; |
|
|
|
import {navTo} from '@/utils/utils'; |
|
|
|
const allPrice = ref(0) |
|
|
|
const state = reactive({ |
|
|
@@ -64,27 +62,21 @@ |
|
|
|
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) |
|
|
|
} |
|
|
|
console.log(e,state.list); |
|
|
|
for(var k=0;k<state.list.length;k++){ |
|
|
|
if (state.list[k]['orderId']==e.orderId) { |
|
|
|
state.list[k]['checked'] = !state.list[k]['checked'] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 过滤数据 |
|
|
|
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) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
state.list.forEach((val, index) => { |
|
|
|
if (val.checked) { |
|
|
|
arr.push(val.reimburseFee) |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log("arr",arr) |
|
|
|
// 计算价格 |
|
|
@@ -92,23 +84,22 @@ |
|
|
|
allPrice.value += item |
|
|
|
}) |
|
|
|
// 全选 |
|
|
|
if(state.suppleNoList.length==state.list.length){ |
|
|
|
if(arr.length==state.list.length){ |
|
|
|
state.checkedAll=true |
|
|
|
}else{ |
|
|
|
state.checkedAll=false |
|
|
|
} |
|
|
|
console.log(state.suppleNoList, "支付集合",allPrice.value); |
|
|
|
console.log(arr, "支付集合",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 |
|
|
|
allPrice.value+=state.list[i].reimburseFee |
|
|
|
} |
|
|
|
} else { |
|
|
|
state.suppleNoList = [] |
|
|
|
for (var i = 0; i < state.list.length; i++) { |
|
|
|
state.list[i].checked = false |
|
|
|
} |
|
|
@@ -130,23 +121,29 @@ |
|
|
|
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 |
|
|
|
console.log("state.list",state.list); |
|
|
|
}); |
|
|
|
} |
|
|
|
const pay=()=>{ |
|
|
|
console.log(allPrice.value, "支付金额"); |
|
|
|
// 选中得orderid |
|
|
|
let orderIds=[] |
|
|
|
for (var i = 0; i < state.list.length; i++) { |
|
|
|
if(state.list[i].checked){ |
|
|
|
orderIds.push(state.list[i].orderId) |
|
|
|
} |
|
|
|
} |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
orderIds:state.reimburseStatus,//补缴单状态 |
|
|
|
reimburseFee:state.pageNo, |
|
|
|
spbillCreateIp:state.pageSize |
|
|
|
orderIds:orderIds,//补缴申请单id |
|
|
|
reimburseFee:allPrice.value,//交易金额 |
|
|
|
}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |