Commit 51b1a70b by zhangxw

参拍车辆管理tab数量修复

1 parent c2219ba8
...@@ -89,6 +89,13 @@ export class VehicleController{ ...@@ -89,6 +89,13 @@ export class VehicleController{
return axios.post('vehicle/vehicleStateCount', params); return axios.post('vehicle/vehicleStateCount', params);
} }
/**
* 参拍车辆管理tab统计数据
*/
static getVehicleAllStateCount(axios:AxiosStatic, params: any): Promise<AxiosResponse<any>> {
return axios.post('vehicle/vehicleAllStateCount', params);
}
/** /**
*/ */
static getVehicleCountByStateAndDateRange(axios:AxiosStatic, startDate: Dayjs | string, endDate: Dayjs | string): Promise<AxiosResponse<any>> { static getVehicleCountByStateAndDateRange(axios:AxiosStatic, startDate: Dayjs | string, endDate: Dayjs | string): Promise<AxiosResponse<any>> {
......
...@@ -114,12 +114,11 @@ export default class AuctionVehiclePage extends PaginationComponent<Vehicle> { ...@@ -114,12 +114,11 @@ export default class AuctionVehiclePage extends PaginationComponent<Vehicle> {
get tabs() { get tabs() {
let total = 0; let total = 0;
for (const vehicleState of this.vehicleStates) { for (const vehicleState of this.vehicleStates) {
total = total + (this.vehicleCount[vehicleState] ?? 0); total = total + (this.vehicleCount?.stateCountMap[vehicleState] ?? 0);
} }
const tabs = [{key: '', tab: `全部(${total})`}]; const tabs = [{key: '', tab: `全部(${total})`}];
this.vehicleStates.forEach(item => { this.vehicleStates.forEach(item => {
tabs.push({key: item, tab: this.$t('enum.vehicle.vehicleState.' + item) + `(${this.vehicleCount[item] ?? 0})`}); tabs.push({key: item, tab: this.$t('enum.vehicle.vehicleState.' + item) + `(${this.vehicleCount?.stateCountMap[item] ?? 0})`});
}); });
return tabs; return tabs;
} }
...@@ -139,8 +138,9 @@ export default class AuctionVehiclePage extends PaginationComponent<Vehicle> { ...@@ -139,8 +138,9 @@ export default class AuctionVehiclePage extends PaginationComponent<Vehicle> {
} }
loadVehicleCount() { loadVehicleCount() {
VehicleController.getVehicleCountByState(this.axios).then(res => { VehicleController.getVehicleAllStateCount(this.axios, this.pagination.requestParams).then(res => {
this.vehicleCount = res.data; console.log(res.data?.data)
this.vehicleCount = res.data.data;
}); });
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!