Commit 0523fdb8 by zhangxw

审核记录修改

1 parent 061e3730
<template>
<a-timeline class="mt-10">
<a-timeline-item v-for="item in approveHistories" :color="auditStateColor(item.auditState)" :key="item.historyId">
<a-timeline-item v-for="item in approveHistories" :color="auditStateColor(item.approveResult)" :key="item.historyId">
<div class="title-container">
<div class="title-type">
<span class="label">操作类型:</span>
{{ $t('enum.auditState.' + item.auditState) }}
</div>
<div class="title-type">
<span class="label">市场参考价:</span>
¥{{ item.referencePrice }}元
</div>
<div class="title-type">
<span class="label">起拍价:</span>
¥{{ item.startingBidPrice }}元
</div>
<div class="title-type">
<span class="label">保留价:</span>
¥{{ item.reservePrice }}元
</div>
<div class="title-type">
<span class="label">佣金金额:</span>
¥{{ item.fixedCommission ?? '-' }}元
</div>
<div class="title-type">
<span class="label">成本价:</span>
¥{{ appraiseObj.vehicle?.evaluationTransaction?.purchasePrice }}元
</div>
<div class="title-type">
<span class="label">预计经销差:</span>
¥{{ expectedProfitMethod(item.reservePrice, appraiseObj.fixedCommission, appraiseObj.vehicle?.evaluationTransaction?.purchasePrice) }}元
{{ $t('enum.auditState.' + item.approveResult) }}
</div>
<div class="title-remark" v-if="item.remark" :title="item.remark">
<span class="label">备注:</span>{{ item.remark }}
......@@ -45,30 +21,6 @@
<span class="label">操作类型:</span>
提交审核
</div>
<div class="title-type">
<span class="label">市场参考价:</span>
¥{{ appraiseObj.referencePrice }}元
</div>
<div class="title-type">
<span class="label">起拍价:</span>
¥{{ appraiseObj.startingBidPrice }}元
</div>
<div class="title-type">
<span class="label">保留价:</span>
¥{{ appraiseObj.reservePrice }}元
</div>
<div class="title-type">
<span class="label">佣金金额:</span>
¥{{ appraiseObj.fixedCommission }}元
</div>
<div class="title-type">
<span class="label">成本价:</span>
¥{{ appraiseObj.vehicle?.evaluationTransaction?.purchasePrice }}元
</div>
<div class="title-type">
<span class="label">预计经销差:</span>
¥{{ expectedProfitMethod(appraiseObj.reservePrice, appraiseObj.fixedCommission, appraiseObj.vehicle?.evaluationTransaction?.purchasePrice) }}元
</div>
<div class="title-remark" v-if="remark" :title="remark">
<span class="label">备注:</span>{{ remark }}
</div>
......@@ -108,29 +60,13 @@ export default class ApproveHistoryTimeline extends Vue {
remark: string;
approveHistories: ApproveHistory[] = [];
@Prop({type: Object, required: false})
appraiseObj: appraiseObj = {};
created(): void {
ApproveController.getAppraisePricesByVehicleIdExcludingUnaudited(this.axios, this.appraiseObj?.vehicle?.vehicleId).then(res => {
console.log(res.data, '2222')
ApproveController.getApproveHistoriesByApproveId(this.axios, this.approveType, this.approveId).then(res => {
this.approveHistories = res.data;
});
}
expectedProfitMethod(reservePrice, commission, purchasePrice) {
// 预计经销差=保留价+佣金-成本价
if (!reservePrice || !purchasePrice) {
return '-';
}
// 佣金字段可能是0或空,需要特殊处理
const commissionPrice = commission || 0;
// 使用 Math.round() 避免精度丢失,保留2位小数
const margin = Math.round((reservePrice + commissionPrice - purchasePrice) * 100) / 100;
return margin.toFixed(2);
}
auditStateColor(auditState: AuditState): string {
switch (auditState) {
case "AUDITED":
......@@ -153,7 +89,6 @@ export default class ApproveHistoryTimeline extends Vue {
.title-container {
display: flex;
flex-wrap: wrap;
width: 100%;
align-items: center;
}
......@@ -161,10 +96,10 @@ export default class ApproveHistoryTimeline extends Vue {
.title-type {
display: flex;
align-items: center;
margin-right: 20px;
}
.title-remark {
margin-left: 20px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
......
<template>
<a-timeline class="mt-10">
<a-timeline-item v-for="item in approveHistories" :color="auditStateColor(item.auditState)" :key="item.historyId">
<div class="title-container">
<div class="title-type">
<span class="label">操作类型:</span>
{{ $t('enum.auditState.' + item.auditState) }}
</div>
<div class="title-type">
<span class="label">市场参考价:</span>
¥{{ item.referencePrice }}元
</div>
<div class="title-type">
<span class="label">起拍价:</span>
¥{{ item.startingBidPrice }}元
</div>
<div class="title-type">
<span class="label">保留价:</span>
¥{{ item.reservePrice }}元
</div>
<div class="title-type">
<span class="label">佣金金额:</span>
¥{{ item.fixedCommission ?? '-' }}元
</div>
<div class="title-type">
<span class="label">成本价:</span>
¥{{ appraiseObj.vehicle?.evaluationTransaction?.purchasePrice }}元
</div>
<div class="title-type">
<span class="label">预计经销差:</span>
¥{{ expectedProfitMethod(item.reservePrice, appraiseObj.fixedCommission, appraiseObj.vehicle?.evaluationTransaction?.purchasePrice) }}元
</div>
<div class="title-remark" v-if="item.remark" :title="item.remark">
<span class="label">备注:</span>{{ item.remark }}
</div>
</div>
<p class="time-label">
<a-tooltip :title="item.user.userName" class="mr-16"> {{ item.user.realName }}</a-tooltip>
<span> {{ item.createTime }}</span>
</p>
</a-timeline-item>
<a-timeline-item v-if="createTime">
<div class="title-container">
<div class="title-type">
<span class="label">操作类型:</span>
提交审核
</div>
<div class="title-type">
<span class="label">市场参考价:</span>
¥{{ appraiseObj.referencePrice }}元
</div>
<div class="title-type">
<span class="label">起拍价:</span>
¥{{ appraiseObj.startingBidPrice }}元
</div>
<div class="title-type">
<span class="label">保留价:</span>
¥{{ appraiseObj.reservePrice }}元
</div>
<div class="title-type">
<span class="label">佣金金额:</span>
¥{{ appraiseObj.fixedCommission }}元
</div>
<div class="title-type">
<span class="label">成本价:</span>
¥{{ appraiseObj.vehicle?.evaluationTransaction?.purchasePrice }}元
</div>
<div class="title-type">
<span class="label">预计经销差:</span>
¥{{ expectedProfitMethod(appraiseObj.reservePrice, appraiseObj.fixedCommission, appraiseObj.vehicle?.evaluationTransaction?.purchasePrice) }}元
</div>
<div class="title-remark" v-if="remark" :title="remark">
<span class="label">备注:</span>{{ remark }}
</div>
</div>
<p class="time-label">
<user-real-name :user-name="starter"></user-real-name>
<span class="ml-8"> {{ createTime }}</span>
</p>
</a-timeline-item>
</a-timeline>
</template>
<script lang="ts">
import {Component, Prop, Vue} from 'vue-facing-decorator';
import {ApproveHistory, ApproveHistory_ApproveType} from "lib/src/entity/track/entity/ApproveHistory";
import {ApproveController} from "@/api/ApproveController";
import {AuditState} from "lib/src/entity/enum_types";
import UserRealName from "@/components/UserRealName.vue";
@Component({
components: {UserRealName}
})
export default class ApproveHistoryTimeline extends Vue {
@Prop({type: String, required: true})
approveType: ApproveHistory_ApproveType;
@Prop({type: Number, required: true})
approveId: number;
@Prop({type: String, required: false})
createTime: Date | string;
@Prop({type: String, required: false})
starter: string;
@Prop({type: String, required: false})
remark: string;
approveHistories: ApproveHistory[] = [];
@Prop({type: Object, required: false})
appraiseObj: appraiseObj = {};
created(): void {
ApproveController.getAppraisePricesByVehicleIdExcludingUnaudited(this.axios, this.appraiseObj?.vehicle?.vehicleId).then(res => {
this.approveHistories = res.data;
});
}
expectedProfitMethod(reservePrice, commission, purchasePrice) {
// 预计经销差=保留价+佣金-成本价
if (!reservePrice || !purchasePrice) {
return '-';
}
// 佣金字段可能是0或空,需要特殊处理
const commissionPrice = commission || 0;
// 使用 Math.round() 避免精度丢失,保留2位小数
const margin = Math.round((reservePrice + commissionPrice - purchasePrice) * 100) / 100;
return margin.toFixed(2);
}
auditStateColor(auditState: AuditState): string {
switch (auditState) {
case "AUDITED":
return 'green';
case "REJECTED":
return 'red';
case 'UNAUDITED':
return 'blue';
}
return 'gray';
}
}
</script>
<style scoped lang="less">
.label {
color: #777C85FF;
}
.title-container {
display: flex;
flex-wrap: wrap;
width: 100%;
align-items: center;
}
.title-type {
display: flex;
align-items: center;
margin-right: 20px;
}
.title-remark {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
flex: 1;
}
.time-label {
font-size: 12px;
color: #777C85FF;
}
</style>
......@@ -30,8 +30,8 @@
</a-descriptions-item>
</a-descriptions>
<a-divider>审批记录</a-divider>
<approve-history-timeline approve-type="APPRAISE_PRICE" :approve-id="appraisePrice.appraiseId" :appraise-obj="appraisePrice" :create-time="appraisePrice.createTime"
:starter="appraisePrice.createBy" :remark="appraisePrice.appraisalRemark"></approve-history-timeline>
<approve-history-timeline-with-price approve-type="APPRAISE_PRICE" :approve-id="appraisePrice.appraiseId" :appraise-obj="appraisePrice" :create-time="appraisePrice.createTime"
:starter="appraisePrice.createBy" :remark="appraisePrice.appraisalRemark"></approve-history-timeline-with-price>
<a-form v-if="formState" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol" ref="formRef">
<a-form-item label="审核结果" name="approveResult">
......@@ -54,14 +54,14 @@ import {reactive} from "vue";
import {AppraiseController} from "@/api/AppraiseController";
import {message} from "ant-design-vue";
import {ApproveHistory} from "lib/src/entity/track/entity/ApproveHistory";
import ApproveHistoryTimeline from "@/views/common/ApproveHistoryTimeline.vue";
import ApproveHistoryTimelineWithPrice from "@/views/common/ApproveHistoryTimelineWithPrice.vue";
import VehicleBaseInfo from "@/views/vehicle/inventory/VehicleBaseInfo.vue";
import TitleTipIcon from "@/components/icons/TitleTipIcon.vue";
import {BusinessConfig} from "lib/src/entity/business/domain/BusinessConfig";
import {ConfigController} from "@/api/ConfigController";
@Component({
components: {TitleTipIcon, VehicleBaseInfo, ApproveHistoryTimeline}
components: {TitleTipIcon, VehicleBaseInfo, ApproveHistoryTimelineWithPrice}
})
export default class AppraisePriceAuditForm extends EnhanceFormComponent<ApproveHistory> {
......
......@@ -52,7 +52,7 @@ import {AppraisePrice} from "lib/src/entity/auction/entity/AppraisePrice";
import AppraisePriceAuditForm from "@/views/vehicle/appraise/AppraisePriceAuditForm.vue";
import {AUDIT_STATES} from "lib/src/entity/enum_types";
import AuditStateTag from "@/views/common/AuditStateTag.vue";
import ApproveHistoryTimeline from "@/views/common/ApproveHistoryTimeline.vue";
import ApproveHistoryTimelineWithPrice from "@/views/common/ApproveHistoryTimelineWithPrice.vue";
import {Security} from "@/store";
import {VenueController} from "@/api/VenueController";
......@@ -163,7 +163,7 @@ export default class AppraiseVehiclePage extends PaginationComponent<AppraisePri
viewApproveHistory(appraisePrice: AppraisePrice): void {
const modal = ModalService.confirm({
title: '审批记录', component: ApproveHistoryTimeline, closable: true, appContext: this.$.appContext,
title: '审批记录', component: ApproveHistoryTimelineWithPrice, closable: true, appContext: this.$.appContext,
props: {
approveType: 'APPRAISE_PRICE',
approveId: appraisePrice.appraiseId,
......
<template>
<a-card class="tabs-card" :bordered="false" :tab-list="tabs" :active-tab-key="currentTab" @tabChange="key => changeTab(key )">
<!--查询栏-->
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="pageReload" @onReset="pageReset" :simpleFieldNum="4"/>
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="handlePageReload" @onReset="handleReset" :simpleFieldNum="4"/>
<!--查询栏end-->
<!--拍卖车辆列表start-->
<div class="table-operations">
......@@ -114,15 +114,32 @@ export default class AuctionVehiclePage extends PaginationComponent<Vehicle> {
get tabs() {
let total = 0;
for (const vehicleState of this.vehicleStates) {
total = total + (this.vehicleCount?.stateCountMap[vehicleState] ?? 0);
total += this.vehicleCount?.stateCountMap?.[vehicleState] ?? 0;
}
const tabs = [{key: '', tab: `全部(${total})`}];
const tabs = [{ key: '', tab: `全部(${total})` }];
this.vehicleStates.forEach(item => {
tabs.push({key: item, tab: this.$t('enum.vehicle.vehicleState.' + item) + `(${this.vehicleCount?.stateCountMap[item] ?? 0})`});
const count = this.vehicleCount?.stateCountMap?.[item] ?? 0;
tabs.push({
key: item,
tab: this.$t('enum.vehicle.vehicleState.' + item) + `(${count})`
});
});
return tabs;
}
//查询
handlePageReload() {
this.pageReload();
this.loadVehicleCount()
}
//重置查询条件
handleReset() {
this.pageReset();
this.loadVehicleCount()
}
changeTab(key: Vehicle_VehicleState | ""): void {
this.currentTab = key;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!