This commit is contained in:
zlwu committed 2026-08-21 09:35:11 +08:00
1 parent b9ff9c9d67
commit 44749ae716
87 files changed
+35089 -21918

No files matched your search

@@ -248,13 +248,13 @@
} from '@/utils/pl-cert-slots'
import { matchRequiredCertName } from '@/utils/pl-personnel-cert'
import {
PL_CARRIER_VEHICLE_HEAD_REQUIRED_CERT_NAMES,
PL_CARRIER_VEHICLE_TRAILER_REQUIRED_CERT_NAMES,
PL_SELF_VEHICLE_HEAD_REQUIRED_CERT_NAMES,
PL_SELF_VEHICLE_TRAILER_REQUIRED_CERT_NAMES,
PL_VEHICLE_CERT_PART_HEAD,
PL_VEHICLE_CERT_PART_TRAILER,
normalizeVehicleCertPart
normalizeVehicleCertPart,
shouldRequireVehicleTrailerCerts,
shouldShowVehicleTrailerCertSlots
} from '@/utils/pl-vehicle-cert'
type CertRowWithKey = CertRowWithMeta & { _key: string }
@@ -308,7 +308,7 @@
)
const headPlateLabel = computed(() => props.licensePlate?.trim() || '—')
const hasTrailerPlateOption = computed(() => Boolean(props.trailerNo?.trim()))
const hasTrailerPlateOption = computed(() => shouldShowVehicleTrailerCertSlots(props.trailerNo))
const vehiclePlateOptions = computed(() => {
const options = [
@@ -339,15 +339,17 @@
return props.requiredCertNames
}
if (!props.enforceSelfVehicleRequired && !props.enforceCarrierVehicleRequired) return []
const part = normalizeVehicleCertPart(row.vehiclePart)
// 三方仅展示槽位,不按名称强制必填(依赖 _required=false)
if (props.enforceCarrierVehicleRequired) {
return part === PL_VEHICLE_CERT_PART_TRAILER
? PL_CARRIER_VEHICLE_TRAILER_REQUIRED_CERT_NAMES
: PL_CARRIER_VEHICLE_HEAD_REQUIRED_CERT_NAMES
return []
}
return part === PL_VEHICLE_CERT_PART_TRAILER
? PL_SELF_VEHICLE_TRAILER_REQUIRED_CERT_NAMES
: PL_SELF_VEHICLE_HEAD_REQUIRED_CERT_NAMES
const part = normalizeVehicleCertPart(row.vehiclePart)
if (part === PL_VEHICLE_CERT_PART_TRAILER) {
return shouldRequireVehicleTrailerCerts('self', props.trailerNo)
? PL_SELF_VEHICLE_TRAILER_REQUIRED_CERT_NAMES
: []
}
return PL_SELF_VEHICLE_HEAD_REQUIRED_CERT_NAMES
}
function isRowRequired(row: CertRowWithKey) {
@@ -57,8 +57,13 @@
<el-form-item label="主车号">
<el-input v-model="vehicleForm.licensePlate" maxlength="20" />
</el-form-item>
<el-form-item label="挂车号">
<el-input v-model="vehicleForm.trailerNo" maxlength="20" clearable />
<el-form-item label="挂车号" required>
<el-input
v-model="vehicleForm.trailerNo"
placeholder="必填;无挂车可填「货拉拉」"
maxlength="20"
clearable
/>
</el-form-item>
<el-form-item label="核载(吨)">
<el-input-number
@@ -310,6 +315,10 @@
ElMessage.warning('请填写主车车牌')
return
}
if (showVehicleFields.value && !vehicleForm.trailerNo.trim()) {
ElMessage.warning('请填写挂车号')
return
}
if (
props.mode === 'personnel-first' &&
!driverForm.personnelName.trim() &&
@@ -345,7 +354,7 @@
vehicle: needVehicle
? {
licensePlate: vehicleForm.licensePlate.trim(),
trailerNo: vehicleForm.trailerNo || undefined,
trailerNo: vehicleForm.trailerNo.trim(),
loadCapacity: vehicleForm.loadCapacity ?? undefined,
carrierId: carrierId.value || undefined,
carrierName: carrier?.carrierName
@@ -30,6 +30,7 @@ import {
PL_VEHICLE_CERT_PART_HEAD,
PL_VEHICLE_CERT_PART_TRAILER,
getVehiclePartRequiredCertBadges,
shouldShowVehicleTrailerCertSlots,
type PlVehicleCertCheckType
} from '@/utils/pl-vehicle-cert'
@@ -46,7 +47,7 @@ const props = withDefaults(
}
)
const hasTrailer = computed(() => Boolean(props.trailerNo?.trim()))
const hasTrailer = computed(() => shouldShowVehicleTrailerCertSlots(props.trailerNo))
const badgeGroups = computed(() => {
const groups = [
@@ -61,7 +61,8 @@ import {
PL_VEHICLE_CERT_PART_HEAD,
PL_VEHICLE_CERT_PART_TRAILER,
mergeVehicleCertsByPart,
splitVehicleCertsByPart
splitVehicleCertsByPart,
shouldShowVehicleTrailerCertSlots
} from '@/utils/pl-vehicle-cert'
type CertRowWithKey = CertRow & { _key?: string }
@@ -98,7 +99,7 @@ const unifiedCertFormRef = ref<CertFormListRef>()
const headCertFormRef = ref<CertFormListRef>()
const trailerCertFormRef = ref<CertFormListRef>()
const hasTrailer = computed(() => Boolean(props.trailerNo?.trim()))
const hasTrailer = computed(() => shouldShowVehicleTrailerCertSlots(props.trailerNo))
const headTabLabel = computed(() => props.licensePlate?.trim() || '主车')
const trailerTabLabel = computed(() => props.trailerNo?.trim() || '挂车')
@@ -48,6 +48,7 @@ import {
PL_VEHICLE_CERT_PART_TRAILER,
getVehiclePartCertMissingSuffix,
type PlVehicleCertCheckType,
shouldShowVehicleTrailerCertSlots,
splitVehicleCertsByPart
} from '@/utils/pl-vehicle-cert'
@@ -89,7 +90,7 @@ const trailerPartName = computed(
`${PL_VEHICLE_CERT_PART_TRAILER}-${props.vehicleId || props.trailerNo || props.licensePlate || 'vehicle'}`
)
const hasTrailer = computed(() => Boolean(props.trailerNo?.trim()))
const hasTrailer = computed(() => shouldShowVehicleTrailerCertSlots(props.trailerNo))
const headTabLabel = computed(() => props.licensePlate?.trim() || '主车')
const trailerTabLabel = computed(() => props.trailerNo?.trim() || '挂车')
@@ -30,7 +30,7 @@
<el-form-item label="挂车号" prop="trailerNo">
<el-input
v-model="formData.trailerNo"
placeholder="请输入挂车号"
placeholder="必填;无挂车可填「货拉拉」"
maxlength="20"
clearable
/>
@@ -167,7 +167,7 @@
:cert-name-options="certNameOptions"
layout="table"
:enforce-self-vehicle-required="props.vehicleType === 'self'"
:enforce-carrier-vehicle-required="false"
:enforce-carrier-vehicle-required="props.vehicleType === 'carrier'"
/>
</el-form>
@@ -271,7 +271,8 @@
const formRules = computed(() => {
const rules: Record<string, unknown[]> = {
licensePlate: [{ required: true, message: '请输入车牌号', trigger: 'blur' }]
licensePlate: [{ required: true, message: '请输入车牌号', trigger: 'blur' }],
trailerNo: [{ required: true, message: '请输入挂车号', trigger: 'blur' }]
}
if (props.vehicleType === 'self') {
rules.vehicleStatus = [{ required: true, message: '请选择车辆状态', trigger: 'change' }]
File diff suppressed because it is too large. Load diff
@@ -31,7 +31,7 @@
item.customTitle || formatMenuTitle(item.title)
}}</span>
<span
v-if="list.length > 1 && !item.fixedTab"
v-if="list.length > 1 && store.isTabClosable(item)"
class="worktab-close inline-flex flex-cc relative rounded-full tad-200"
@click.stop="closeWorktab('current', item.path)"
>