|
|
|
@ -139,7 +139,8 @@ const formData = ref({ |
|
|
|
|
remark: '', |
|
|
|
|
status: CommonStatusEnum.ENABLE, |
|
|
|
|
roleIds: [], |
|
|
|
|
hireDate: '' |
|
|
|
|
hireDate: '', |
|
|
|
|
isNewUserConfirm: false |
|
|
|
|
}) |
|
|
|
|
const formRules = ref<any>({ |
|
|
|
|
username: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }], |
|
|
|
@ -192,8 +193,15 @@ const submitForm = async () => { |
|
|
|
|
try { |
|
|
|
|
const data = formData.value as unknown as UserApi.UserVO |
|
|
|
|
if (formType.value === 'create') { |
|
|
|
|
await UserApi.createUser(data) |
|
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
|
const resp = await UserApi.createUser(data) |
|
|
|
|
debugger |
|
|
|
|
if (resp.code == 18888) { |
|
|
|
|
await message.confirm(resp.msg) |
|
|
|
|
formData.value.isNewUserConfirm = true |
|
|
|
|
submitForm() |
|
|
|
|
} else { |
|
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
await UserApi.updateUser(data) |
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
@ -220,7 +228,8 @@ const resetForm = () => { |
|
|
|
|
remark: '', |
|
|
|
|
status: CommonStatusEnum.ENABLE, |
|
|
|
|
roleIds: [], |
|
|
|
|
hireDate: formatDate(new Date(), 'YYYY-MM-DD') |
|
|
|
|
hireDate: formatDate(new Date(), 'YYYY-MM-DD'), |
|
|
|
|
isNewUserConfirm: undefined |
|
|
|
|
} |
|
|
|
|
formRef.value?.resetFields() |
|
|
|
|
} |
|
|
|
|