fix: patch validation bypass for mandatory inspection

This commit is contained in:
DXC
2026-03-17 13:26:17 +08:00
parent 7829cac59a
commit 11f5a1f51e
2 changed files with 12 additions and 4 deletions

View File

@ -1194,7 +1194,9 @@ const rules = computed(() => {
baseRules.inspection_report = [
{
validator: (rule: any, value: any, callback: any) => {
const hasFile = form.inspection_report && form.inspection_report.length > 0
// 过滤空字符串,只保留有效报告
const validFiles = (form.inspection_report || []).filter((r: string) => r && r.trim())
const hasFile = validFiles.length > 0
const hasLink = inspection_report_url.value && inspection_report_url.value.trim() !== ''
if (!hasFile && !hasLink) {
callback(new Error('该物料为强管控物料,必须提供检测报告文件或链接'))