diff --git a/src/api/transportCapacity/transport-vehicle.js b/src/api/transportCapacity/transport-vehicle.js index f2bfb67..0eed04c 100644 --- a/src/api/transportCapacity/transport-vehicle.js +++ b/src/api/transportCapacity/transport-vehicle.js @@ -51,14 +51,6 @@ export const changeStatus = (id, status) => { }); }; -export const auditCertification = (id, certificationStatus, rejectReason) => { - return request({ - url: '/blade-transport/transport-vehicle/audit-certification', - method: 'post', - params: { id, certificationStatus, rejectReason }, - }); -}; - export const getExpiryStat = params => { return request({ url: '/blade-transport/transport-vehicle/expiry-stat', diff --git a/src/option/transportCapacity/transport-vehicle.js b/src/option/transportCapacity/transport-vehicle.js index df05326..ffe1bae 100644 --- a/src/option/transportCapacity/transport-vehicle.js +++ b/src/option/transportCapacity/transport-vehicle.js @@ -95,6 +95,8 @@ export const option = { align: 'center', }, { + // 这里是「最新一次提交的状态」缓存,不等于该车当前是否已认证: + // 已认证由生效快照指针决定,曾审核通过即永久保持,重新提交不会让它退回审核中 label: '认证状态', prop: 'certificationStatus', slot: true, @@ -104,9 +106,10 @@ export const option = { type: 'select', dicData: [ { label: '全部', value: '' }, - { label: '认证中', value: 0 }, - { label: '已认证', value: 1 }, + { label: '审核中', value: 0 }, + { label: '已通过', value: 1 }, { label: '已驳回', value: 2 }, + { label: '已作废', value: 3 }, ], minWidth: 110, align: 'center', diff --git a/src/views/transportCapacity/driver.vue b/src/views/transportCapacity/driver.vue index 1066ad6..dad42da 100644 --- a/src/views/transportCapacity/driver.vue +++ b/src/views/transportCapacity/driver.vue @@ -649,6 +649,7 @@ import { getDictionary } from '@/api/system/dictbiz'; import { getLazyTree } from '@/api/base/region'; import { exportBlob } from '@/api/common'; import { getToken, isAdministrator } from '@/utils/auth'; +import { certStatusTag } from '@/utils/cert-audit'; import { getUploadHeaders } from '@/utils/upload'; import { downloadXls } from '@/utils/util'; import ImageUploadField from '@/components/image-upload-field/main.vue'; @@ -1233,13 +1234,9 @@ export default { this.driverForm.drivingVehicle = row.plateNo || ''; this.vehicleSelectorVisible = false; }, + // 车辆认证状态展示的是「最新一次提交的状态」缓存,与审核页使用同一套状态词表 getVehicleCertificationStatus(row) { - const statusMap = { - 0: { label: '认证中', type: 'warning' }, - 1: { label: '已认证', type: 'success' }, - 2: { label: '已驳回', type: 'danger' }, - }; - return statusMap[row.certificationStatus] || { label: '-', type: 'info' }; + return certStatusTag(row.certificationStatus); }, setImage(prop, url) { this.driverForm[prop] = url; diff --git a/src/views/transportCapacity/vehicle.vue b/src/views/transportCapacity/vehicle.vue index 1bfa225..087594a 100644 --- a/src/views/transportCapacity/vehicle.vue +++ b/src/views/transportCapacity/vehicle.vue @@ -105,9 +105,6 @@ 修改 综合台账 - - 审核 - - - - - - - - {{ auditValue('plateNo') }} - - - - - {{ auditValue('vehicleType') }} - - - - -
-
- 长 - - {{ auditValueWithUnit('outerLength', 'mm') }} - -
-
- 宽 - - {{ auditValueWithUnit('outerWidth', 'mm') }} - -
-
- 高 - - {{ auditValueWithUnit('outerHeight', 'mm') }} - -
-
-
-
-
- - - - - {{ auditValueWithUnit('approvedLoadKg', 'KG') }} - - - - - - - {{ auditValueWithUnit('tractionMassKg', 'KG') }} - - - - - - {{ auditValue('businessRelation') }} - - - - - {{ auditValue('energyType') }} - - - - - - - - {{ auditValue('compulsoryScrapDate') }} - - - - - - {{ auditValue('customsRecordNo') }} - - - - - - {{ auditValue('organizationName') }} - - - - - - {{ auditValue('useDepartment') }} - - - -
- - - - - - - {{ auditValue('drivingLicenseEndDate') }} - - - - - - - {{ auditValue('roadTransportCertNo') }} - - - - - - - {{ auditValue('roadTransportCertEndDate') }} - - - - - - - {{ auditValue('annualReviewEndDate') }} - - - - - - - - {{ auditValue('registrationNo') }} - - - - - {{ auditValue('registrationDate') }} - - - - - {{ auditValue('drivingLicenseNo') }} - - - - - - {{ auditValue('drivingLicenseStartDate') }} - - - - - - - - - {{ auditValue('roadTransportCertStartDate') }} - - - - - - - - {{ auditValue('remark') }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
- { - this.certificationAuditForm = { ...(res.data.data || {}) }; - this.certificationRejectReason = ''; - this.showRejectReason = false; - this.certificationAuditBox = true; - }); - }, - auditValue(prop) { - // 长期有效字段:勾选后显示「长期有效」,避免与未填写的「-」混淆 - const longTermMap = { - drivingLicenseEndDate: 'drivingLicenseLongTerm', - roadTransportCertEndDate: 'roadTransportCertLongTerm', - annualReviewEndDate: 'annualReviewLongTerm', - compulsoryScrapDate: 'compulsoryScrapLongTerm', - }; - const longTermProp = longTermMap[prop]; - if (longTermProp && this.certificationAuditForm[longTermProp] === 1) { - return '长期有效'; - } - const value = this.certificationAuditForm[prop]; - return value === undefined || value === null || value === '' ? '-' : value; - }, - auditValueWithUnit(prop, unit) { - const value = this.auditValue(prop); - return value === '-' ? value : `${value}${unit}`; - }, - handleCertificationApprove() { - auditCertification(this.certificationAuditForm.id, 1).then(() => { - this.$message.success('认证已通过'); - this.certificationAuditBox = false; - this.onLoad(this.page); - }); - }, - handleCertificationReject() { - if (!this.showRejectReason) { this.showRejectReason = true; return; } - if (!this.certificationRejectReason.trim()) { this.$message.warning('请输入认证驳回原因'); return; } - auditCertification(this.certificationAuditForm.id, 2, this.certificationRejectReason).then(() => { - this.$message.success('认证已驳回'); - this.certificationAuditBox = false; - this.onLoad(this.page); - }); - }, resetVehicle() { this.vehicleForm = emptyForm(); this.vehicleCertificateUploads = {}; @@ -1648,26 +1333,11 @@ export default { } return ''; }, + // 认证状态展示的是「最新一次提交的状态」缓存,不代表该车当前是否已认证 + // (是否已认证由生效快照指针决定,即曾审核通过即永久保持)。 + // 证书是否临近到期另有列表顶部的到期标签与日期列标色展示,不在这里推断。 getCertificationStatus(row) { - if (row.certificationStatus === 0) return { label: '认证中', type: 'warning' }; - if (row.certificationStatus === 1) return { label: '已认证', type: 'success' }; - if (row.certificationStatus === 2) return { label: '已驳回', type: 'danger' }; - const today = this.$dayjs().startOf('day'); - const certificateDates = [ - [row.drivingLicenseEndDate, row.drivingLicenseLongTerm], - [row.roadTransportCertEndDate, row.roadTransportCertLongTerm], - ]; - if (certificateDates.some(([date, longTerm]) => longTerm !== 1 && !date)) { - return { label: '未认证', type: 'info' }; - } - if ( - certificateDates.some( - ([date, longTerm]) => longTerm !== 1 && this.$dayjs(date).isBefore(today, 'day') - ) - ) { - return { label: '已过期', type: 'danger' }; - } - return { label: '已认证', type: 'success' }; + return certStatusTag(row.certificationStatus); }, }, }; @@ -1695,9 +1365,7 @@ export default { } } -// 车辆认证审核弹窗:与编辑弹窗一致,灰底 + section-card 白卡分组 -.certification-audit, -.certification-audit__reason, +// 编辑弹窗:灰底 + section-card 白卡分组 .vehicle-form { :deep(.el-form-item__label) { height: auto; @@ -1723,60 +1391,10 @@ export default { line-height: 18px; margin-right: 4px; } -} -.certification-audit { - :deep(.el-form-item__label) { - flex: 0 0 calc(4em + 12px) !important; - width: calc(4em + 12px) !important; - max-width: calc(4em + 12px); - } -} - -.certification-audit__reason { :deep(.el-form-item__label) { flex: 0 0 calc(4em + 24px) !important; width: calc(4em + 24px) !important; - max-width: calc(4em + 24px); - } -} - -.vehicle-form { - :deep(.el-form-item__label) { - flex: 0 0 calc(4em + 24px) !important; - width: calc(4em + 24px) !important; - } -} - -.certification-audit { - &__value { - display: block; - color: #303133; - word-break: break-all; - } - - // 外廓尺寸长/宽/高组合,排版复用编辑弹窗的 dimension-group - .dimension-group { - display: grid; - grid-template-columns: repeat(3, minmax(0, 1fr)); - gap: 8px; - align-items: center; - } - - .dimension-group__item { - display: flex; - align-items: center; - gap: 8px; - min-width: 0; - } - - .dimension-group__label { - flex-shrink: 0; - color: #303133; - } - - &__reason { - margin-top: 12px; } }