Commit 31cd569d by zhangxw

发拍涉及库存车辆管理开发

1 parent 12c631a2
......@@ -13,13 +13,15 @@
"@tinymce/tinymce-vue": "^6.3.0",
"@types/lodash-es": "^4.17.12",
"ant-design-vue": "~4.2.1",
"autumn-antv": "^0.0.24",
"autumn-vue": "^0.4.47",
"axios": "~1.7.6",
"image-conversion": "^2.1.1",
"china-area-data": "^5.0.1",
"clipboard": "^2.0.11",
"core-js": "^3.6.5",
"dayjs": "^1.10.7",
"echarts": "^5.2.2",
"image-conversion": "^2.1.1",
"ionicons": "^8.0.9",
"lib": "file:../lib",
"lodash-es": "^4.17.21",
......@@ -59,8 +61,8 @@
"vite": "^5.3.3",
"vite-svg-loader": "^5.1.0"
},
"volta":{
"node":"16.20.2"
"volta": {
"node": "16.20.2"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.9.5"
......
......@@ -29,7 +29,7 @@ export class VehicleController{
/**
*/
static exportCheckedVehicles(axios:AxiosStatic, vehicleIds: number[], config?:any): Promise<AxiosResponse<void>> {
return axios.post('vehicle/exportCheckedVehicles', vehicleIds, config);
return axios.post('vehicle/exportVehicleWithVr', vehicleIds, config);
}
/**
......@@ -185,6 +185,19 @@ export class VehicleController{
static PAGE_ENABLE_INSPECT_VEHICLE = 'vehicle/pageEnableInspectVehicle';
// 获取车辆来源选项
static getVehicleSourceOptions(axios:AxiosStatic): Promise<AxiosResponse<{vrOrgName: string, vrOrgId: string}[]>> {
return axios.get('vr/org/stores');
}
/**
* 获取发拍单保留价
* @param vehicleId
* @return Vehicle
*/
static getReservePrice(axios:AxiosStatic, vehicleId: number): Promise<AxiosResponse<Vehicle>> {
return axios.get(`vr/audit/reservePrice/${vehicleId}`);
}
// region 前端扩展代码区
// endregion
}
......@@ -174,7 +174,9 @@ export default {
"CONTRACT": "签署合同协议",
"ACCOUNT": "用户协议",
"PRIVACY": "隐私协议",
"ABOUT_US": "关于我们"
"ABOUT_US": "关于我们",
"FAPAI_ACCOUNT": "发拍端用户协议",
"FAPAI_PRIVACY": "发拍端隐私协议"
},
"agreementState": {
"DRAFT": "草稿",
......@@ -310,4 +312,4 @@ export default {
"AUTHMODE": "-"
}
}
}
\ No newline at end of file
}
......@@ -69,7 +69,7 @@
:allow-clear="field.allowHalf" :autofocus="field.autofocus"/>
</template>
<!-- select -->
<a-select v-else-if="field.type === 'select'" v-model:value="form[field.fieldName]" :mode="field.mode" class="form-item-control"
<a-select v-else-if="field.type === 'select'" v-model:value="form[field.fieldName]" :mode="field.mode" :maxTagCount="field.maxTagCount" class="form-item-control"
@change="field.change" :showSearch="field.showSearch" @search="field.search" :token-separators="field.tokenSeparators"
:placeholder="field.placeholder" :allowClear="field.allowClear" :options="field.optionItems" :disabled="field.disabled"/>
<!-- slot -->
......@@ -139,7 +139,7 @@
:allow-clear="field.allowHalf" :autofocus="field.autofocus"/>
</template>
<!-- select -->
<a-select v-else-if="field.type === 'select'" v-model:value="form[field.fieldName]" :mode="field.mode" class="form-item-control"
<a-select v-else-if="field.type === 'select'" v-model:value="form[field.fieldName]" :mode="field.mode" :maxTagCount="field.maxTagCount" class="form-item-control"
@change="field.change" :showSearch="field.showSearch" @search="field.search" :token-separators="field.tokenSeparators"
:placeholder="field.placeholder" :allowClear="field.allowClear" :options="field.optionItems" :disabled="field.disabled"/>
<!-- slot -->
......
......@@ -40,7 +40,8 @@ import {AppraiseController} from "@/api/AppraiseController";
import {message} from "ant-design-vue";
import {RuleObject} from "ant-design-vue/es/form/interface";
import {PriceRuleController} from "@/api/PriceRuleController";
import {ConfigController} from "@/api/ConfigController";
import { ConfigController } from "@/api/ConfigController";
import { VehicleController } from '@/api/VehicleController'
import {BusinessConfig} from "lib/src/entity/business/domain/BusinessConfig";
@Component({
......@@ -69,6 +70,13 @@ export default class AppraisePriceForm extends EnhanceFormComponent<AppraisePric
// message.warn('请配置有效的基础参考价规则');
// }
});
// 获取发拍单保留价
VehicleController.getReservePrice(this.axios, this.vehicle.vehicleId).then(response => {
let { code, data } = response?.data
if (code === '200' && (data ?? '') !== '') {
this.formState.reservePrice = data
}
})
}
get minStartingBidPrice(): number {
......
......@@ -4,26 +4,26 @@
<a-typography-text type="secondary">{{ title }}</a-typography-text>
</template>
<a-descriptions-item label="车源号" name="sourceNo">
{{ vehicle.baseInfo.sourceNo }}
{{ vehicle.baseInfo?.sourceNo }}
</a-descriptions-item>
<a-descriptions-item label="品牌/子品牌" name="carTypeName">
{{ vehicle.baseInfo.carBrand }} /{{ vehicle.baseInfo.carChildsBrandName }}
{{ vehicle.baseInfo?.carBrand }} /{{ vehicle.baseInfo?.carChildsBrandName }}
</a-descriptions-item>
<a-descriptions-item label="车型名称" name="carTypeName">
<a :href="`#/vehicle/view?vehicleId=${vehicle.vehicleId}`" target="_blank">{{ vehicle.baseInfo.carSeriesName }} {{ vehicle.baseInfo.carTypeName }}</a>
<a :href="`#/vehicle/view?vehicleId=${vehicle.vehicleId}`" target="_blank">{{ vehicle.baseInfo?.carSeriesName }} {{ vehicle.baseInfo?.carTypeName }}</a>
</a-descriptions-item>
<a-descriptions-item label="车架号" name="vin">
{{ vehicle.baseInfo.vin }}
{{ vehicle.baseInfo?.vin }}
</a-descriptions-item>
<a-descriptions-item label="车牌号" name="licensePlate">
{{ vehicle.baseInfo.licensePlate }}
{{ vehicle.baseInfo?.licensePlate }}
</a-descriptions-item>
<a-descriptions-item label="所属门店" name="venueName">
{{ vehicle.venue.venueName }}
{{ vehicle.venue?.venueName }}
</a-descriptions-item>
<a-descriptions-item label="车辆保管人" name="custodianName">
{{ vehicle.custodianInfo.custodianName }}
{{ vehicle.custodianInfo?.custodianName }}
</a-descriptions-item>
<a-descriptions-item label="车辆所在地址" name="handoverAddress">
{{ vehicle.custodianInfo?.handoverAddress }}
......
......@@ -84,7 +84,7 @@
<a-form-item label="变速箱类型" :name="['coreSpecs','bxslx']" :rules="[{ max: 32, message: '最多输入32个字符!' }]">
<a-select v-model:value="formState.coreSpecs.bxslx" show-search allowClear :maxlength="32"
placeholder="自动/手动/双离合等" mode="SECRET_COMBOBOX_MODE_DO_NOT_USE" :filter-option="false">
<a-select-option value="自动">汽油</a-select-option>
<a-select-option value="自动">自动</a-select-option>
<a-select-option value="手动">手动</a-select-option>
<a-select-option value="双离合">双离合</a-select-option>
<a-select-option value="手自一体">手自一体</a-select-option>
......@@ -415,6 +415,14 @@ export default class VehicleForm extends FormComponent<Vehicle> {
const vehicle = response.data;
const baseInfo = vehicle.baseInfo;
const ownership = vehicle.ownership;
const ownerInfo = vehicle.ownerInfo
const custodianInfo = vehicle.custodianInfo
const evaluationTransaction = vehicle.evaluationTransaction
const historyCondition = vehicle.historyCondition
if (!ownerInfo) vehicle.ownerInfo = new OwnerInfo()
if (!custodianInfo) vehicle.custodianInfo = new CustodianInfo()
if (!evaluationTransaction) vehicle.evaluationTransaction = new EvaluationTransaction()
if (!historyCondition) vehicle.historyCondition = new HistoryCondition()
this.getCarTypeList(baseInfo.carSeriesId + "");
baseInfo.brandIds = [];
if (baseInfo.carBrandId) {
......@@ -427,7 +435,12 @@ export default class VehicleForm extends FormComponent<Vehicle> {
}
}
ownership.carProvinceCity = [ownership.carProvinceId + "", ownership.carCityId + ""];
vehicle._carModelData = (vehicle.carModelData && JSON.parse(vehicle.carModelData)) || {};
if (Object.keys(vehicle._carModelData).length === 0) {
message.warn('查博士车型库未匹配到此VIN对应的详情信息,需人工全量核对并录入。');
}
this.formState = reactive<Vehicle>(vehicle);
console.log(this.formState)
});
break;
default:
......@@ -437,6 +450,62 @@ export default class VehicleForm extends FormComponent<Vehicle> {
}
// 替换查博士车辆信息字段
changeCarModelData() {
const carModelData = this.formState._carModelData;
if (!carModelData) return;
// 基本信息
this.formState.baseInfo.engineNumber = carModelData.engine?.fdjxh || this.formState.baseInfo.engineNumber;
this.formState.baseInfo.guidePrice = carModelData.base?.listPrice || this.formState.baseInfo.guidePrice;
// 核心参数
this.formState.coreSpecs.productionDate = carModelData.base?.marketDate
? `${carModelData.base.marketDate.slice(0, 4)}-01-01`
: this.formState.coreSpecs.productionDate;
this.formState.coreSpecs.displacement = carModelData.base?.displacement || this.formState.coreSpecs.displacement;
// 排放标准映射(国3/国4/国5/国6 -> 3/4/5/6)
const emissionStandardText = carModelData.base?.emissionStandard;
if (emissionStandardText) {
const emissionMap: Record<string, number> = {
'国3': 3, '国4': 4, '国5': 5, '国6': 6,
'国三': 3, '国四': 4, '国五': 5, '国六': 6,
'国Ⅲ': 3, '国Ⅳ': 4, '国Ⅴ': 5, '国Ⅵ': 6
};
const mappedValue = emissionMap[emissionStandardText];
if (mappedValue && [3, 4, 5, 6].includes(mappedValue)) {
this.formState.coreSpecs.emissionStandard = mappedValue;
}
}
// 发动机相关
this.setDropdownValue('jqxs', carModelData.engine?.jqxs, ['自然吸气', '涡轮增压']);
this.setDropdownValue('rlxs', carModelData.engine?.rlxs, ['汽油', '柴油', '纯电', '混动']);
// 车辆配置相关
this.setDropdownValue('bxslx', carModelData.base?.gearboxType, ['自动', '手动', '双离合', '手自一体']);
this.setDropdownValue('qdfs', carModelData.base?.drivenType, ['前驱', '后驱', '四驱']);
this.setDropdownValue('vehicleClass', carModelData.base?.vehicleClass, ['中型车', '紧凑型轿车', 'SUV']);
this.formState.coreSpecs.seat = carModelData.base?.seat || this.formState.coreSpecs.seat;
// 天窗映射(是/有 -> 3,其他 -> 1)
const sunroofText = carModelData.internal?.qjtc;
if (sunroofText) {
this.formState.coreSpecs.sunroof = ['是', '有'].includes(sunroofText) ? 3 : 1;
}
}
/**
* 设置下拉框值,如果新值不在选项列表中则保持原值不变
*/
private setDropdownValue(field: keyof CoreSpecs, newValue: string | undefined, validOptions: string[]) {
if (newValue && validOptions.includes(newValue)) {
(this.formState.coreSpecs as any)[field] = newValue;
}
}
convertTreeNode(brands: Brand[]): DefaultOptionType[] {
if (brands && brands.length > 0) {
return brands.map(brand => {
......@@ -476,6 +545,7 @@ export default class VehicleForm extends FormComponent<Vehicle> {
break;
case 'edit':
formValue.vehicleId = this.formState.vehicleId;
delete this.formState._carModelData
VehicleController.updateVehicle(this.axios, this.formState).then(response => {
message.success('修改成功');
this.handleBack(response.data);
......
......@@ -24,6 +24,13 @@
<template v-if="column.key === 'cover'">
<a-image v-if="record.cover" :src="record.cover.url" :width="60" :height="60" style="border-radius: 4px;object-fit: cover"></a-image>
</template>
<template v-if="column.key === 'vrAuditStatus'">
<a-tag v-if="record.vrAuditStatus" :color="vrAuditStatusOptions.find(item => item.value === record.vrAuditStatus)?.color" :style="{ color: vrAuditStatusOptions.find(item => item.value === record.vrAuditStatus)?.textColor }"
:bordered="false">
{{vrAuditStatusOptions.find(item => item.value === record.vrAuditStatus)?.label}}
</a-tag>
<div v-else>-</div>
</template>
<template v-if="column.key === 'action'">
<router-link v-sec="'vehicle_1'" :to="{ path:'/vehicle/view',query:{vehicleId: record.vehicleId}}">
<a-button type="link" size="small">查看档案</a-button>
......@@ -103,6 +110,14 @@ export default class VehiclePage extends PaginationComponent<Vehicle> {
selectIds: number[] = [];
selectedItems: Vehicle[] = [];
vrAuditStatusOptions = [
{label: "待拍卖", value: 2, color: '#E9F2FC', textColor: '#2A82E4'},
{label: "拍卖中", value: 3, color: '#E8F8F2', textColor: '#00A870'},
{label: "交易成功", value: 4, color: '#FFF3E5', textColor: '#FC8B0A'},
{label: "流拍", value: 5, color: '#F0F2F5', textColor: '#777C85'},
{label: "已下架", value: 6, color: '#FFF0F0', textColor: '#E32727'},
];
carSourceOptions = [];
/**
* 表格列配置
*/
......@@ -138,7 +153,9 @@ export default class VehiclePage extends PaginationComponent<Vehicle> {
{title: '过户时间', dataIndex: 'transferredTime', key: 'transferredTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true},
{title: '更新时间', dataIndex: 'updateTime', key: 'updateTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true},
{title: '车辆状态', dataIndex: 'vehicleState', key: 'vehicleState', width: 100, align: 'center', fixed: 'right', resizable: true, ellipsis: true, sorter: true},
{title: '操作', key: 'action', width: 170, align: 'center', fixed: 'right'},
{ title: '发拍状态', dataIndex: 'vrAuditStatus', key: 'vrAuditStatus', width: 100, align: 'center', fixed: 'right', resizable: true, ellipsis: true },
{ title: '车辆来源', dataIndex: 'vrOrgName', key: 'vrOrgName', width: 170, align: 'center', fixed: 'right', resizable: true, ellipsis: true },
{ title: '操作', key: 'action', width: 170, align: 'center', fixed: 'right' },
];
getPagination(): Pagination<Vehicle> {
......@@ -151,6 +168,14 @@ export default class VehiclePage extends PaginationComponent<Vehicle> {
created(): void {
this.init(this.axios, VehicleController.PAGE_VEHICLE);
// 获取车辆来源
VehicleController.getVehicleSourceOptions(this.axios).then(response => {
let { data } = response?.data
this.carSourceOptions = data?.map(item => {
return {label: item.vrOrgName, value: item.vrOrgId};
});
this.setFilterFieldOptionItems('vrOrgId', this.carSourceOptions);
});
this.buildQueryForm({
sourceNo: [null, {label: '车源号', field: 'baseInfo.sourceNo', operator: Operator.like}],
carTypeName: [null, {label: '车型名称', field: 'baseInfo.carTypeName', operator: Operator.like}],
......@@ -166,7 +191,9 @@ export default class VehiclePage extends PaginationComponent<Vehicle> {
address: [null, {label: '车辆所在地址', field: 'custodianInfo.handoverAddress', operator: Operator.like}],
custodianName: [null, {label: '车辆保管人', field: 'custodianInfo.custodianName', operator: Operator.like}],
vehicleState: [null, {label: '车辆状态', field: 'vehicleState', allowClear: true, type: 'select', operator: Operator.eq}],
vehicleState: [null, { label: '车辆状态', field: 'vehicleState', allowClear: true, type: 'select', operator: Operator.eq }],
vrAuditStatus: [[], { label: '发拍状态', field: 'vrAuditStatus', allowClear: true, type: 'select', optionItems: this.vrAuditStatusOptions, operator: Operator.eq, mode: 'tags', maxTagCount: 2 }],
vrOrgId: [null, { label: '车辆来源', field: 'vrOrgId', allowClear: true, type: 'select', operator: Operator.eq, optionItems: this.carSourceOptions, showSearch: true }],
});
if (this.$route.query.vehicleStateIndex) {
this.changeTab(this.$route.query.vehicleStateIndex);
......
......@@ -165,7 +165,9 @@ export default {
"CONTRACT": "签署合同协议",
"ACCOUNT": "用户协议",
"PRIVACY": "隐私协议",
"ABOUT_US": "关于我们"
"ABOUT_US": "关于我们",
"FAPAI_ACCOUNT": "发拍端用户协议",
"FAPAI_PRIVACY": "发拍端隐私协议"
},
"agreementState": {
"DRAFT": "草稿",
......@@ -281,4 +283,4 @@ export default {
"AUTHMODE": "-"
}
}
}
\ No newline at end of file
}
......@@ -455,6 +455,11 @@ export declare interface SelectFieldOptions extends FormFieldOptions {
optionItems?: OptionItem[];
/**
* tags 模式下的最大显示数量,超出时会显示为 +x 的形式,默认为不限制
*/
maxTagCount?: number;
/**
* 比较器
* 比较函数
* 或者 对比字段, 对比字段只能是基本类型
......
......@@ -49,8 +49,8 @@ export class Agreement extends AuditingEntity {
* PRIVACY 隐私协议
* ABOUT_US 关于我们
*/
export type Agreement_AgreementKey = 'AUCTION'|'TRANSACTION'|'VIOLATION'|'CONTRACT'|'ACCOUNT'|'PRIVACY'|'ABOUT_US';
export const AGREEMENT_AGREEMENT_KEYS = ['AUCTION','TRANSACTION','VIOLATION','CONTRACT','ACCOUNT','PRIVACY','ABOUT_US'];
export type Agreement_AgreementKey = 'AUCTION'|'TRANSACTION'|'VIOLATION'|'CONTRACT'|'ACCOUNT'|'PRIVACY'|'ABOUT_US'|'FAPAI_ACCOUNT'|'FAPAI_PRIVACY';
export const AGREEMENT_AGREEMENT_KEYS = ['AUCTION','TRANSACTION','VIOLATION','CONTRACT','ACCOUNT','PRIVACY','ABOUT_US', 'FAPAI_ACCOUNT', 'FAPAI_PRIVACY'];
/**
* DRAFT 草稿
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!