Commit f2768df5 by zhangxw

车辆库存/检测工单/拍卖订单列表tab数量修改

1 parent f83974d3
...@@ -78,8 +78,8 @@ export class AuctionOrderController{ ...@@ -78,8 +78,8 @@ export class AuctionOrderController{
/** /**
*/ */
static getOrderCountByOrderState(axios:AxiosStatic): Promise<AxiosResponse<any>> { static getOrderCountByOrderState(axios:AxiosStatic, params: any): Promise<AxiosResponse<any>> {
return axios.get('auctionOrder/getOrderCountByOrderState'); return axios.post('auctionOrder/orderStateCount', params);
} }
/** /**
......
...@@ -65,7 +65,7 @@ export class DetectionController { ...@@ -65,7 +65,7 @@ export class DetectionController {
} }
static inspectOrderCountByStatus(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectOrderCountByStatus(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.get('inspect/wo/countByStatus' + (params.inspectorId ? '?inspectorId=' + params.inspectorId : ''), params); return axios.post('inspect/wo/statusCount', params);
} }
static inspectOrderUpdate(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectOrderUpdate(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
...@@ -104,7 +104,7 @@ export class DetectionController { ...@@ -104,7 +104,7 @@ export class DetectionController {
return axios.post('inspectionTemplate/default', params); return axios.post('inspectionTemplate/default', params);
} }
static getCarTypeList(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static getCarTypeList(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.get('ropApi/getCarTypeList?csId=' + params.csId, params); return axios.get('ropApi/getCarTypeList?csId=' + params.csId, params);
} }
......
...@@ -86,7 +86,7 @@ export class VehicleController{ ...@@ -86,7 +86,7 @@ export class VehicleController{
/** /**
*/ */
static getVehicleCountByState(axios:AxiosStatic, params: any): Promise<AxiosResponse<any>> { static getVehicleCountByState(axios:AxiosStatic, params: any): Promise<AxiosResponse<any>> {
return axios.get('vehicle/getVehicleCountByState', params); return axios.post('vehicle/vehicleStateCount', params);
} }
/** /**
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<a-button type="link" disabled v-if="record.orderState==='TRANSFERRING'&&!record.auditState" size="small">未提交过户资料</a-button> <a-button type="link" disabled v-if="record.orderState==='TRANSFERRING'&&!record.auditState" size="small">未提交过户资料</a-button>
<a-button type="link" v-if="record.orderState==='COMPLETED'" size="small" @click="viewTransferring(record)">过户资料</a-button> <a-button type="link" v-if="record.orderState==='COMPLETED'" size="small" @click="viewTransferring(record)">过户资料</a-button>
<router-link :to="{path:'/account/view',query:{accountId:record.account.accountId}}"> <router-link :to="{path:'/account/view',query:{accountId:record.account?.accountId}}">
<a-button type="link" size="small">联系买家</a-button> <a-button type="link" size="small">联系买家</a-button>
</router-link> </router-link>
...@@ -132,7 +132,15 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder> ...@@ -132,7 +132,15 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder>
selectedAuctionOrder: AuctionOrder | null = null; selectedAuctionOrder: AuctionOrder | null = null;
orderStateCount: any = {}; orderStateCount: any = {
total: 0,
contractUnsignedCount: 0,
unpaidCount: 0,
waitPickupCount: 0,
transferringCount: 0,
completedCount: 0,
canceledCount: 0
};
@Security.Getter hasPrivilege; @Security.Getter hasPrivilege;
...@@ -164,18 +172,14 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder> ...@@ -164,18 +172,14 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder>
} }
reloadTabsCount(): void { reloadTabsCount(): void {
AuctionOrderController.getOrderCountByOrderState(this.axios).then(res => { AuctionOrderController.getOrderCountByOrderState(this.axios, this.pagination.requestParams).then(res => {
this.orderStateCount = res.data; this.orderStateCount = res.data?.data || {};
}); });
} }
get orderStateTabs() { get orderStateTabs() {
let total = 0;
for (const key in this.orderStateCount) {
total = total + this.vc(key);
}
const tabs = []; const tabs = [];
if (this.hasPrivilege('auction_order_1')) tabs.push({key: "", tab: `全部(${total})`}); if (this.hasPrivilege('auction_order_1')) tabs.push({key: "", tab: `全部(${this.orderStateCount?.total})`});
AUCTION_ORDER_ORDER_STATES.forEach(item => { AUCTION_ORDER_ORDER_STATES.forEach(item => {
if (item === 'CONTRACT_UNSIGNED') tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.vc(item)})`}); if (item === 'CONTRACT_UNSIGNED') tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.vc(item)})`});
if (item === 'UNPAID' && this.hasPrivilege('auction_order_3')) tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.vc(item)})`}); if (item === 'UNPAID' && this.hasPrivilege('auction_order_3')) tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.vc(item)})`});
......
...@@ -149,6 +149,7 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> { ...@@ -149,6 +149,7 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> {
exporting = false; exporting = false;
ccountByStatusData = { ccountByStatusData = {
total: 0,
dispatchedCount: 0, dispatchedCount: 0,
inProgressCount: 0, inProgressCount: 0,
completedCount: 0, completedCount: 0,
...@@ -197,7 +198,6 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> { ...@@ -197,7 +198,6 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> {
* 初始化配置 * 初始化配置
*/ */
created(): void { created(): void {
this.getinspectOrderCountByStatus();
this.init(this.axios, DetectionController.PAGE_INSPECTOR_ORDER); this.init(this.axios, DetectionController.PAGE_INSPECTOR_ORDER);
this.buildQueryForm({ this.buildQueryForm({
keyword: [null, { label: '关键字', field: 'keyword', placeholder: '搜索工单单号、车源号、VIN码、车牌', operator: Operator.like }], keyword: [null, { label: '关键字', field: 'keyword', placeholder: '搜索工单单号、车源号、VIN码、车牌', operator: Operator.like }],
...@@ -218,15 +218,14 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> { ...@@ -218,15 +218,14 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> {
} }
getinspectOrderCountByStatus() { getinspectOrderCountByStatus() {
DetectionController.inspectOrderCountByStatus(this.axios, {}).then(res => { DetectionController.inspectOrderCountByStatus(this.axios, this.pagination.requestParams).then(res => {
this.ccountByStatusData = res.data.data || {}; this.ccountByStatusData = res.data.data || {};
}); });
} }
get tabs() { get tabs() {
const totalCount = (this.ccountByStatusData.dispatchedCount || 0) + (this.ccountByStatusData.inProgressCount || 0) + (this.ccountByStatusData.completedCount || 0) + (this.ccountByStatusData.canceledCount || 0);
let tabs = [ let tabs = [
{ key: "", tab: `全部 (${totalCount || 0})` }, { key: "", tab: `全部 (${this.ccountByStatusData.total || 0}))` },
{ key: "DISPATCHED", tab: `待检测 (${this.ccountByStatusData.dispatchedCount || 0})` }, { key: "DISPATCHED", tab: `待检测 (${this.ccountByStatusData.dispatchedCount || 0})` },
{ key: "IN_PROGRESS", tab: `检测中 (${this.ccountByStatusData.inProgressCount || 0})` }, { key: "IN_PROGRESS", tab: `检测中 (${this.ccountByStatusData.inProgressCount || 0})` },
{ key: "COMPLETED", tab: `已完成 (${this.ccountByStatusData.completedCount || 0})` }, { key: "COMPLETED", tab: `已完成 (${this.ccountByStatusData.completedCount || 0})` },
......
...@@ -102,7 +102,12 @@ export default class VehiclePage extends PaginationComponent<Vehicle> { ...@@ -102,7 +102,12 @@ export default class VehiclePage extends PaginationComponent<Vehicle> {
vehicleStateIndex = "1"; vehicleStateIndex = "1";
vehicleCount: any = {}; vehicleCount: any = {
total: 0,
inventoryCount: 0,
auctioningCount: 0,
completedCount: 0
};
exporting = false; exporting = false;
...@@ -231,31 +236,17 @@ export default class VehiclePage extends PaginationComponent<Vehicle> { ...@@ -231,31 +236,17 @@ export default class VehiclePage extends PaginationComponent<Vehicle> {
if (this.hasPrivilege('vehicle_19')) { if (this.hasPrivilege('vehicle_19')) {
vehicleStateRadios.push('已出库'); vehicleStateRadios.push('已出库');
} }
let total = 0;
for (const key in this.vehicleCount) {
total = total + this.vc(key);
}
const count = [ const count = [
total, this.vehicleCount?.total,
this.vc('INVENTORY') + this.vc('VENUE'), this.vehicleCount?.inventoryCount,
this.vc('TO_BE_PRICED') + this.vc('PRICED') + this.vc('PENDING_AUCTION') + this.vc('WAIT_AUCTION') + this.vc('PREVIEW') + this.vc('AUCTIONING') + this.vc('CONTRACT_UNSIGNED') + this.vc('UNPAID') + this.vc('WAIT_PICKUP'), this.vehicleCount?.auctioningCount,
this.vc('TRANSFERRING') + this.vc('COMPLETED'), this.vehicleCount?.completedCount
this.vc('CANCELED'),
]; ];
return vehicleStateRadios.map((value, index) => { return vehicleStateRadios.map((value, index) => {
return {key: index + "", tab: value + '(' + count[index] + ')'}; return {key: index + "", tab: value + '(' + count[index] + ')'};
}); });
} }
vc(state: string): number {
const num = this.vehicleCount[state];
if (num) {
return num;
} else {
return 0;
}
}
changeTab(key: string): void { changeTab(key: string): void {
this.vehicleStateIndex = key; this.vehicleStateIndex = key;
const index = Number(key); const index = Number(key);
...@@ -314,8 +305,8 @@ export default class VehiclePage extends PaginationComponent<Vehicle> { ...@@ -314,8 +305,8 @@ export default class VehiclePage extends PaginationComponent<Vehicle> {
} }
loadVehicleCount() { loadVehicleCount() {
VehicleController.getVehicleCountByState(this.axios).then(res => { VehicleController.getVehicleCountByState(this.axios, this.pagination.requestParams).then(res => {
this.vehicleCount = res.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!