新建域名所有者后自动刷新确保下拉选项显示新建的所有者

This commit is contained in:
jingrow 2025-08-02 16:22:04 +08:00
parent 2a255abd2a
commit 3b7b620a52
2 changed files with 50 additions and 49 deletions

View File

@ -357,17 +357,31 @@ export default {
}
try {
const submitData = { ...this.formData };
submitData.c_co = this.selectedCountry;
submitData.cocode = this.selectedCountry === 'CN' ? '+86' : '';
const response = await this.$resources.createDomainOwner.submit(submitData);
if (response.status === 'Success') {
alert('域名所有者创建成功!');
this.$emit('submit', response.data);
//
const submitData = {
c_regtype: this.formData.c_regtype,
c_org_m: this.formData.c_org_m || '',
c_ln_m: this.formData.c_ln_m,
c_fn_m: this.formData.c_fn_m,
c_st_m: this.formData.c_st_m,
c_ct_m: this.formData.c_ct_m,
c_dt_m: this.formData.c_dt_m || '',
c_adr_m: this.formData.c_adr_m,
c_pc: this.formData.c_pc,
c_ph_type: '0',
c_ph: this.formData.c_ph,
c_em: this.formData.c_em,
c_idtype_gswl: this.formData.c_idtype_gswl,
c_idnum_gswl: this.formData.c_idnum_gswl,
c_co: this.selectedCountry,
cocode: this.selectedCountry === 'CN' ? '+86' : ''
};
// submit
this.$emit('submit', submitData);
//
this.closeDialog();
} else {
alert(`创建失败: ${response.message}`);
}
} catch (error) {
alert('创建失败,请检查网络连接或联系管理员');
}
@ -540,19 +554,6 @@ export default {
}
},
},
resources: {
createDomainOwner() {
return {
url: 'jcloud.api.domain_west.create_domain_owner_with_template',
onSuccess(response) {
return response;
},
onError(error) {
throw error;
}
};
}
}
};
</script>

View File

@ -960,9 +960,6 @@ export default {
return {
url: 'jcloud.api.domain_west.create_domain_owner',
validate(data) {
//
console.log('验证函数接收到的data:', data);
if (!data.c_regtype) {
throw new DashboardError('请选择所有者类型');
}
@ -979,7 +976,7 @@ export default {
throw new DashboardError('请输入邮编');
}
if (!data.c_ph) {
throw new DashboardError('请输入联系电话');
throw new DashboardError('请输入手机号码');
}
if (!data.c_em) {
throw new DashboardError('请输入电子邮箱');
@ -990,6 +987,17 @@ export default {
if (!data.c_idnum_gswl) {
throw new DashboardError('请输入证件号码');
}
//
if (data.c_idtype_gswl === 'SFZ') {
const idNum = data.c_idnum_gswl;
if (idNum.length !== 18) {
throw new DashboardError('身份证号码必须是18位');
}
if (!(idNum.slice(0, 17).match(/^\d+$/) && (idNum[17].match(/^\d$/) || idNum[17].toUpperCase() === 'X'))) {
throw new DashboardError('身份证号码格式不正确');
}
}
},
onSuccess(response) {
if (response.status === "Success") {
@ -1118,11 +1126,6 @@ export default {
},
handleOwnerSubmit(formData) {
this.isCreatingOwner = true;
//
console.log('接收到的formData:', formData);
// API
const apiData = {
act: 'auditsub',
c_regtype: formData.c_regtype,
@ -1130,34 +1133,31 @@ export default {
fullname: formData.c_ln_m + formData.c_fn_m,
c_ln_m: formData.c_ln_m,
c_fn_m: formData.c_fn_m,
c_co: 'CN', //
cocode: '+86', //
c_co: formData.c_co || 'CN',
cocode: formData.cocode || '+86',
c_st_m: formData.c_st_m,
c_ct_m: formData.c_ct_m,
c_dt_m: formData.c_dt_m || '',
c_adr_m: formData.c_adr_m,
c_pc: formData.c_pc,
c_ph_type: '0', //
c_ph: formData.c_ph_num, //
c_ph_code: '', //
c_ph_num: '', //
c_ph_fj: '', //
c_ph_type: formData.c_ph_type || '0',
c_ph: formData.c_ph,
c_ph_code: '',
c_ph_num: '',
c_ph_fj: '',
c_em: formData.c_em,
c_org: formData.c_org_m || '', //
c_ln: formData.c_ln_m, //
c_fn: formData.c_fn_m, //
c_st: formData.c_st_m, //
c_ct: formData.c_ct_m, //
c_adr: formData.c_adr_m, //
c_org: formData.c_org_m || '',
c_ln: formData.c_ln_m,
c_fn: formData.c_fn_m,
c_st: formData.c_st_m,
c_ct: formData.c_ct_m,
c_adr: formData.c_adr_m,
c_idtype_gswl: formData.c_idtype_gswl,
c_idnum_gswl: formData.c_idnum_gswl,
c_keyword: '',
c_domain: '0'
};
//
console.log('转换后的apiData:', apiData);
this.$resources.createDomainOwner.submit(apiData);
},
getTotalAmount() {