新建域名所有者测试成功
This commit is contained in:
parent
d497034501
commit
7840ad48c1
@ -40,6 +40,7 @@
|
|||||||
type="radio"
|
type="radio"
|
||||||
v-model="formData.c_regtype"
|
v-model="formData.c_regtype"
|
||||||
value="I"
|
value="I"
|
||||||
|
@change="onRegTypeChange"
|
||||||
class="mr-2"
|
class="mr-2"
|
||||||
>
|
>
|
||||||
<span class="text-sm">个人</span>
|
<span class="text-sm">个人</span>
|
||||||
@ -49,6 +50,7 @@
|
|||||||
type="radio"
|
type="radio"
|
||||||
v-model="formData.c_regtype"
|
v-model="formData.c_regtype"
|
||||||
value="E"
|
value="E"
|
||||||
|
@change="onRegTypeChange"
|
||||||
class="mr-2"
|
class="mr-2"
|
||||||
>
|
>
|
||||||
<span class="text-sm">企业/组织</span>
|
<span class="text-sm">企业/组织</span>
|
||||||
@ -313,7 +315,7 @@ export default {
|
|||||||
c_ph_type: '0', // 电话类型:0-手机(固定值)
|
c_ph_type: '0', // 电话类型:0-手机(固定值)
|
||||||
c_ph: '', // 手机号码
|
c_ph: '', // 手机号码
|
||||||
c_em: '', // 邮箱
|
c_em: '', // 邮箱
|
||||||
c_idtype_gswl: '', // 证件类型
|
c_idtype_gswl: 'SFZ', // 证件类型,个人默认身份证
|
||||||
c_idnum_gswl: '' // 证件号码
|
c_idnum_gswl: '' // 证件号码
|
||||||
},
|
},
|
||||||
selectedCountry: 'CN',
|
selectedCountry: 'CN',
|
||||||
@ -339,32 +341,18 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 准备提交数据
|
|
||||||
const submitData = { ...this.formData };
|
const submitData = { ...this.formData };
|
||||||
|
|
||||||
// 添加国家信息
|
|
||||||
submitData.c_co = this.selectedCountry;
|
submitData.c_co = this.selectedCountry;
|
||||||
submitData.cocode = this.selectedCountry === 'CN' ? '+86' : '';
|
submitData.cocode = this.selectedCountry === 'CN' ? '+86' : '';
|
||||||
|
const response = await this.$resources.createDomainOwner.submit(submitData);
|
||||||
console.log('准备提交的数据:', submitData);
|
if (response.status === 'Success') {
|
||||||
|
|
||||||
// 调用API创建域名所有者(包含模板创建)
|
|
||||||
console.log('开始调用API...');
|
|
||||||
const response = await this.$resources.createDomainOwner.submit(submitData);
|
|
||||||
|
|
||||||
console.log('API调用结果:', response);
|
|
||||||
|
|
||||||
if (response.success) {
|
|
||||||
console.log('域名所有者创建成功:', response);
|
|
||||||
alert('域名所有者创建成功!');
|
alert('域名所有者创建成功!');
|
||||||
this.$emit('submit', response.data);
|
this.$emit('submit', response.data);
|
||||||
this.closeDialog();
|
this.closeDialog();
|
||||||
} else {
|
} else {
|
||||||
console.error('创建失败:', response);
|
|
||||||
alert(`创建失败: ${response.message}`);
|
alert(`创建失败: ${response.message}`);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('创建域名所有者失败:', error);
|
|
||||||
alert('创建失败,请检查网络连接或联系管理员');
|
alert('创建失败,请检查网络连接或联系管理员');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -434,7 +422,7 @@ export default {
|
|||||||
c_ph_type: '0',
|
c_ph_type: '0',
|
||||||
c_ph: '',
|
c_ph: '',
|
||||||
c_em: '',
|
c_em: '',
|
||||||
c_idtype_gswl: '',
|
c_idtype_gswl: 'SFZ', // 个人默认证件类型
|
||||||
c_idnum_gswl: ''
|
c_idnum_gswl: ''
|
||||||
};
|
};
|
||||||
this.selectedCountry = 'CN';
|
this.selectedCountry = 'CN';
|
||||||
@ -472,6 +460,17 @@ export default {
|
|||||||
this.formData.c_idnum_gswl = '';
|
this.formData.c_idnum_gswl = '';
|
||||||
this.idNumberError = '';
|
this.idNumberError = '';
|
||||||
},
|
},
|
||||||
|
onRegTypeChange() {
|
||||||
|
// 根据所有者类型设置默认证件类型
|
||||||
|
if (this.formData.c_regtype === 'I') {
|
||||||
|
this.formData.c_idtype_gswl = 'SFZ'; // 个人默认身份证
|
||||||
|
} else {
|
||||||
|
this.formData.c_idtype_gswl = 'YYZZ'; // 企业默认营业执照
|
||||||
|
}
|
||||||
|
// 清空证件号码和错误信息
|
||||||
|
this.formData.c_idnum_gswl = '';
|
||||||
|
this.idNumberError = '';
|
||||||
|
},
|
||||||
getCurrentCities() {
|
getCurrentCities() {
|
||||||
if (!this.selectedProvince) return [];
|
if (!this.selectedProvince) return [];
|
||||||
return getCitiesByProvince(this.selectedProvince);
|
return getCitiesByProvince(this.selectedProvince);
|
||||||
@ -513,7 +512,7 @@ export default {
|
|||||||
if (this.formData.c_idtype_gswl === 'SFZ') {
|
if (this.formData.c_idtype_gswl === 'SFZ') {
|
||||||
const idNum = this.formData.c_idnum_gswl;
|
const idNum = this.formData.c_idnum_gswl;
|
||||||
if (idNum.length !== 18) {
|
if (idNum.length !== 18) {
|
||||||
this.idNumberError = '身份证号码必须是18位';
|
this.idNumberError = `身份证号码必须是18位,当前为${idNum.length}位`;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1190,13 +1190,15 @@ def create_domain_template(**data):
|
|||||||
'fullname': data.get('c_ln_m', '') + data.get('c_fn_m', '') # 完整姓名
|
'fullname': data.get('c_ln_m', '') + data.get('c_fn_m', '') # 完整姓名
|
||||||
}
|
}
|
||||||
|
|
||||||
# 添加企业相关字段
|
# 个人类型时不传入c_org_m参数
|
||||||
if data['c_regtype'] == 'E':
|
if data['c_regtype'] == 'E' and data.get('c_org_m'):
|
||||||
if not data.get('c_org_m'):
|
|
||||||
return {"status": "error", "message": "企业类型必须填写单位名称"}
|
|
||||||
template_data['c_org_m'] = data['c_org_m']
|
template_data['c_org_m'] = data['c_org_m']
|
||||||
template_data['c_org'] = data.get('c_org', '') # 英文单位名称
|
template_data['c_org'] = data.get('c_org', '') # 英文单位名称
|
||||||
|
|
||||||
|
# 验证企业类型必须填写单位名称
|
||||||
|
if data['c_regtype'] == 'E' and not data.get('c_org_m'):
|
||||||
|
return {"status": "error", "message": "企业类型必须填写单位名称"}
|
||||||
|
|
||||||
# 添加区县信息
|
# 添加区县信息
|
||||||
if data.get('c_dt_m'):
|
if data.get('c_dt_m'):
|
||||||
template_data['c_dt_m'] = data['c_dt_m']
|
template_data['c_dt_m'] = data['c_dt_m']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user