fix: patch validation bypass for mandatory inspection
This commit is contained in:
@ -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('该物料为强管控物料,必须提供检测报告文件或链接'))
|
||||
|
||||
Reference in New Issue
Block a user