f
This commit is contained in:
@@ -121,7 +121,7 @@
|
|||||||
<!-- 暂时隐藏:办公场地图片上传 -->
|
<!-- 暂时隐藏:办公场地图片上传 -->
|
||||||
<el-row :gutter="16" class="mb-4">
|
<el-row :gutter="16" class="mb-4">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="办公场地照片">
|
<el-form-item label="办公场地照片" prop="officePlaceImageURLs">
|
||||||
<div class="text-xs mb-1 text-blue-500">
|
<div class="text-xs mb-1 text-blue-500">
|
||||||
请在非 IE 浏览器下上传大小不超过 1M 的图片,最多 10 张,需体现门楣 LOGO、办公设备与工作人员。
|
请在非 IE 浏览器下上传大小不超过 1M 的图片,最多 10 张,需体现门楣 LOGO、办公设备与工作人员。
|
||||||
</div>
|
</div>
|
||||||
@@ -303,7 +303,7 @@
|
|||||||
<el-row :gutter="16" class="mb-4">
|
<el-row :gutter="16" class="mb-4">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
|
|
||||||
<el-form-item label="应用场景附件">
|
<el-form-item label="应用场景附件" prop="scenarioAttachmentURLs">
|
||||||
<div class="text-xs mb-1 text-blue-500">
|
<div class="text-xs mb-1 text-blue-500">
|
||||||
请在非 IE 浏览器下上传大小不超过 1M 的图片,最多 10 张后台应用截图。
|
请在非 IE 浏览器下上传大小不超过 1M 的图片,最多 10 张后台应用截图。
|
||||||
</div>
|
</div>
|
||||||
@@ -493,6 +493,24 @@ const validatePhone = (rule, value, callback) => {
|
|||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 数组字段必填验证(至少上传/选择一项)
|
||||||
|
const validateRequiredArray = (message) => (rule, value, callback) => {
|
||||||
|
if (!Array.isArray(value) || value.length === 0) {
|
||||||
|
callback(new Error(message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 授权代表身份证要求:正反面都必须上传
|
||||||
|
const validateAuthorizedRepIDImages = (rule, value, callback) => {
|
||||||
|
if (!Array.isArray(value) || value.length < 2) {
|
||||||
|
callback(new Error('请上传授权代表身份证正反面图片'))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
const enterpriseRules = {
|
const enterpriseRules = {
|
||||||
companyName: [
|
companyName: [
|
||||||
@@ -527,11 +545,17 @@ const enterpriseRules = {
|
|||||||
businessLicenseImageURL: [
|
businessLicenseImageURL: [
|
||||||
{ required: true, message: '请上传营业执照图片', trigger: 'change' }
|
{ required: true, message: '请上传营业执照图片', trigger: 'change' }
|
||||||
],
|
],
|
||||||
|
officePlaceImageURLs: [
|
||||||
|
{ validator: validateRequiredArray('请上传办公场地照片'), trigger: 'change' }
|
||||||
|
],
|
||||||
// 暂时隐藏的表单项,校验已关闭,恢复显示时请还原
|
// 暂时隐藏的表单项,校验已关闭,恢复显示时请还原
|
||||||
apiUsage: [
|
apiUsage: [
|
||||||
{ required: true, message: '请填写接口用途', trigger: 'blur' },
|
{ required: true, message: '请填写接口用途', trigger: 'blur' },
|
||||||
{ min: 5, max: 500, message: '接口用途长度应在5-500个字符之间', trigger: 'blur' }
|
{ min: 5, max: 500, message: '接口用途长度应在5-500个字符之间', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
|
scenarioAttachmentURLs: [
|
||||||
|
{ validator: validateRequiredArray('请上传应用场景附件'), trigger: 'change' }
|
||||||
|
],
|
||||||
authorizedRepName: [
|
authorizedRepName: [
|
||||||
{ required: true, message: '请输入授权代表姓名', trigger: 'blur' },
|
{ required: true, message: '请输入授权代表姓名', trigger: 'blur' },
|
||||||
{ min: 2, max: 20, message: '授权代表姓名长度应在2-20个字符之间', trigger: 'blur' }
|
{ min: 2, max: 20, message: '授权代表姓名长度应在2-20个字符之间', trigger: 'blur' }
|
||||||
@@ -545,7 +569,7 @@ const enterpriseRules = {
|
|||||||
{ validator: validatePhone, trigger: 'blur' }
|
{ validator: validatePhone, trigger: 'blur' }
|
||||||
],
|
],
|
||||||
authorizedRepIDImageURLs: [
|
authorizedRepIDImageURLs: [
|
||||||
{ required: true, message: '请上传授权代表身份证正反面图片', trigger: 'change' }
|
{ validator: validateAuthorizedRepIDImages, trigger: 'change' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -798,6 +822,7 @@ const updateAuthorizedRepIDImageURLs = () => {
|
|||||||
if (frontUrl) urls.push(frontUrl)
|
if (frontUrl) urls.push(frontUrl)
|
||||||
if (backUrl) urls.push(backUrl)
|
if (backUrl) urls.push(backUrl)
|
||||||
form.value.authorizedRepIDImageURLs = urls
|
form.value.authorizedRepIDImageURLs = urls
|
||||||
|
enterpriseFormRef.value?.validateField('authorizedRepIDImageURLs')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 办公场地图片变更:选择即上传
|
// 办公场地图片变更:选择即上传
|
||||||
@@ -807,11 +832,13 @@ const handleOfficePlaceChange = async (file, fileList) => {
|
|||||||
await uploadFileOnceSelected(file)
|
await uploadFileOnceSelected(file)
|
||||||
}
|
}
|
||||||
form.value.officePlaceImageURLs = extractUrls(fileList)
|
form.value.officePlaceImageURLs = extractUrls(fileList)
|
||||||
|
enterpriseFormRef.value?.validateField('officePlaceImageURLs')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleOfficePlaceRemove = (file, fileList) => {
|
const handleOfficePlaceRemove = (file, fileList) => {
|
||||||
officePlaceFileList.value = fileList
|
officePlaceFileList.value = fileList
|
||||||
form.value.officePlaceImageURLs = extractUrls(fileList)
|
form.value.officePlaceImageURLs = extractUrls(fileList)
|
||||||
|
enterpriseFormRef.value?.validateField('officePlaceImageURLs')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 应用场景附件图片变更:选择即上传
|
// 应用场景附件图片变更:选择即上传
|
||||||
@@ -821,11 +848,13 @@ const handleScenarioChange = async (file, fileList) => {
|
|||||||
await uploadFileOnceSelected(file)
|
await uploadFileOnceSelected(file)
|
||||||
}
|
}
|
||||||
form.value.scenarioAttachmentURLs = extractUrls(fileList)
|
form.value.scenarioAttachmentURLs = extractUrls(fileList)
|
||||||
|
enterpriseFormRef.value?.validateField('scenarioAttachmentURLs')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleScenarioRemove = (file, fileList) => {
|
const handleScenarioRemove = (file, fileList) => {
|
||||||
scenarioFileList.value = fileList
|
scenarioFileList.value = fileList
|
||||||
form.value.scenarioAttachmentURLs = extractUrls(fileList)
|
form.value.scenarioAttachmentURLs = extractUrls(fileList)
|
||||||
|
enterpriseFormRef.value?.validateField('scenarioAttachmentURLs')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交表单
|
// 提交表单
|
||||||
|
|||||||
Reference in New Issue
Block a user