diff --git a/src/views/trials/trials-panel/setting/personnel-manage/components/staffExternalAdd.vue b/src/views/trials/trials-panel/setting/personnel-manage/components/staffExternalAdd.vue index edfaa7a..7b80990 100644 --- a/src/views/trials/trials-panel/setting/personnel-manage/components/staffExternalAdd.vue +++ b/src/views/trials/trials-panel/setting/personnel-manage/components/staffExternalAdd.vue @@ -60,6 +60,7 @@ const formDataDefault = () => { LastName: null, FirstName: null, UserTypeId: "", + UserRoleList: [], Phone: null, Email: null, IsSendEmail: false, @@ -128,6 +129,7 @@ export default { Email: null, IsSendEmail: false, Sex: "9", + UserRoleList: [], IsZhiZhun: "", HospitalGroupldList: [], OrganizationName: "", @@ -200,7 +202,14 @@ export default { }, "form.UserTypeId": { handler() { + this.form.UserRoleList = [] if (this.form.UserTypeId) { + let data = this.userTypeOptions.find((d) => d.Id === this.form.UserTypeId) + this.form.UserRoleList.push({ + UserTypeEnum: data.UserTypeEnum, + UserTypeId: data.Id, + IsUserRoleDisabled: false, + }) let name = this.getUserType(this.form.UserTypeId); if (["PM", "PI", "SR", "OA"].includes(name)) { this.form.IsZhiZhun = true; @@ -210,6 +219,7 @@ export default { } this.form.IsZhiZhun = false; this.form.OrganizationName = null; + }, deep: true, immediate: true, @@ -261,6 +271,7 @@ export default { this.form.UserTypeEnum = selectedUserType[0].UserTypeEnum; } this.form.TrialId = this.$route.query.trialId + console.log(this.form, 'this.form') addUser(this.form, true) .then((res) => { this.btnLoading = false;