diff --git a/dashboard/src2/components/JsiteDomainOverview.vue b/dashboard/src2/components/JsiteDomainOverview.vue index 7b58202..786b174 100644 --- a/dashboard/src2/components/JsiteDomainOverview.vue +++ b/dashboard/src2/components/JsiteDomainOverview.vue @@ -42,9 +42,6 @@ @click="showUploadRealName" class="inline-flex items-center px-3 py-1.5 text-sm font-medium text-white bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 rounded-lg transition-all duration-200 shadow-sm hover:shadow-md" > - - - 上传实名资料 diff --git a/dashboard/src2/components/JsiteDomainUploadRealNameDialog.vue b/dashboard/src2/components/JsiteDomainUploadRealNameDialog.vue index ef4ec1d..2a78132 100644 --- a/dashboard/src2/components/JsiteDomainUploadRealNameDialog.vue +++ b/dashboard/src2/components/JsiteDomainUploadRealNameDialog.vue @@ -25,7 +25,7 @@
- (个人) 旷蓓娟 + {{ ownerType ? `(${ownerType === 'I' ? '个人' : '企业'})` : '' }} {{ domainDoc?.owner_name || '未知' }}
@@ -37,15 +37,13 @@ v-model="formData.idType" class="px-3 py-1.5 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white text-sm" > - - - - - - - - - + 重置 @@ -159,15 +157,17 @@ export default { }, props: { domain: String, - domainDoc: Object + domainDoc: Object, + onSuccess: Function }, emits: ['success', 'close'], data() { return { show: true, loading: false, + ownerType: null, // 初始为空,等待从所有者信息获取 formData: { - idType: 'SFZ', + idType: '', idNumber: '' }, uploadedFiles: [] @@ -175,7 +175,32 @@ export default { }, computed: { isValid() { - return this.formData.idNumber.trim() && this.uploadedFiles.length > 0; + return this.formData.idNumber.trim() && this.formData.idType && this.uploadedFiles.length > 0; + }, + idTypeOptions() { + if (!this.ownerType) { + // 如果还没有获取到所有者类型,返回空数组 + return []; + } + + if (this.ownerType === 'I') { + // 个人证件类型 + return [ + { value: 'SFZ', label: '身份证' }, + { value: 'HZ', label: '护照' }, + { value: 'GAJMTX', label: '港澳居民来往内地通行证' }, + { value: 'TWJMTX', label: '台湾居民来往大陆通行证' }, + { value: 'WJLSFZ', label: '外国人永久居留身份证' }, + { value: 'GAJZZ', label: '港澳台居民居住证' } + ]; + } else { + // 企业证件类型 + return [ + { value: 'ORG', label: '组织机构代码证' }, + { value: 'YYZZ', label: '工商营业执照' }, + { value: 'TYDM', label: '统一社会信用代码证书' } + ]; + } } }, resources: { @@ -281,9 +306,12 @@ export default { // Jingrow 响应格式:{message: {...}} if (response && response.message && response.message.status === "success") { - // 直接关闭弹窗,不显示 toast - this.$emit('success'); - this.$emit('close'); + // 调用父组件的成功回调 + if (this.onSuccess) { + this.onSuccess(); + } + // 关闭弹窗 + this.show = false; } else { const errorMessage = response?.message?.message || response?.message || '上传失败,请重试'; console.error('上传失败:', errorMessage); @@ -323,6 +351,11 @@ export default { return false; } + if (!this.formData.idType) { + alert('请选择证件类型'); + return false; + } + if (this.uploadedFiles.length === 0) { alert('请上传证件材料'); return false; @@ -339,6 +372,9 @@ export default { if (response && response.status === 'Success' && response.data) { const owner = response.data; + // 优先从所有者信息获取类型 + this.ownerType = owner.c_regtype; + // 填充身份证号码 if (owner.c_idnum_gswl) { this.formData.idNumber = owner.c_idnum_gswl; @@ -346,6 +382,9 @@ export default { // 填充证件类型 if (owner.c_idtype_gswl) { this.formData.idType = owner.c_idtype_gswl; + } else if (this.ownerType) { + // 根据所有者类型设置默认证件类型 + this.formData.idType = this.ownerType === 'I' ? 'SFZ' : 'ORG'; } } }