@@ -1666,6 +1666,7 @@ const downloadTemplate = async () => {
|
||||
ElMessage.error('模板下载失败');
|
||||
}
|
||||
};
|
||||
const isValidMobile = value => /^\d{11}$/.test(String(value || '').trim());
|
||||
const validateImportRows = () => {
|
||||
if (!rows.value.length) {
|
||||
ElMessage.warning('请上传至少一条运单明细');
|
||||
@@ -1677,6 +1678,11 @@ const validateImportRows = () => {
|
||||
ElMessage.warning(`第${index + 1}行${missingField.label}不能为空`);
|
||||
return false;
|
||||
}
|
||||
const driverPhone = String(row.driverPhone ?? '').trim();
|
||||
if (driverPhone && !isValidMobile(driverPhone)) {
|
||||
ElMessage.warning(`第${index + 1}行司机/船长手机号格式不正确,应为11位数字`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user