优化中心调研
parent
e4453bced6
commit
62b85d9d45
|
@ -4,7 +4,7 @@ src/utils/*
|
||||||
public
|
public
|
||||||
dist
|
dist
|
||||||
|
|
||||||
src/*
|
# src/*
|
||||||
src/views/dictionary/checkConfig/*
|
src/views/dictionary/checkConfig/*
|
||||||
src/views/trials/trials-panel/trial-summary/*
|
src/views/trials/trials-panel/trial-summary/*
|
||||||
src/main.js
|
src/main.js
|
||||||
|
|
|
@ -14,3 +14,4 @@ tests/**/coverage/
|
||||||
*.ntvs*
|
*.ntvs*
|
||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
|
.eslintignore
|
||||||
|
|
|
@ -3,19 +3,11 @@
|
||||||
<div class="base-dialog-body">
|
<div class="base-dialog-body">
|
||||||
<!-- 姓 -->
|
<!-- 姓 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:lastName')" prop="LastName">
|
<el-form-item :label="$t('trials:staffResearch:form:lastName')" prop="LastName">
|
||||||
<el-input
|
<el-input v-model="form.LastName" disabled style="width: 200px" />
|
||||||
v-model="form.LastName"
|
|
||||||
disabled
|
|
||||||
style="width:200px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 名 -->
|
<!-- 名 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:firstName')" prop="FirstName">
|
<el-form-item :label="$t('trials:staffResearch:form:firstName')" prop="FirstName">
|
||||||
<el-input
|
<el-input v-model="form.FirstName" disabled style="width: 200px" />
|
||||||
v-model="form.FirstName"
|
|
||||||
disabled
|
|
||||||
style="width:200px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 角色 -->
|
<!-- 角色 -->
|
||||||
<!-- <el-form-item :label="$t('trials:staffResearch:form:role')" prop="TrialRoleCode">
|
<!-- <el-form-item :label="$t('trials:staffResearch:form:role')" prop="TrialRoleCode">
|
||||||
|
@ -34,27 +26,15 @@
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<!-- 电话号码 -->
|
<!-- 电话号码 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:phone')" prop="Phone">
|
<el-form-item :label="$t('trials:staffResearch:form:phone')" prop="Phone">
|
||||||
<el-input
|
<el-input v-model="form.Phone" disabled style="width: 200px" />
|
||||||
v-model="form.Phone"
|
|
||||||
disabled
|
|
||||||
style="width:200px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 邮箱 -->
|
<!-- 邮箱 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:email')" prop="Email">
|
<el-form-item :label="$t('trials:staffResearch:form:email')" prop="Email">
|
||||||
<el-input
|
<el-input v-model="form.Email" disabled style="width: 200px" />
|
||||||
v-model="form.Email"
|
|
||||||
disabled
|
|
||||||
style="width:200px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 单位 -->
|
<!-- 单位 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:organization')" prop="OrganizationName">
|
<el-form-item :label="$t('trials:staffResearch:form:organization')" prop="OrganizationName">
|
||||||
<el-input
|
<el-input v-model="form.OrganizationName" disabled style="width: 200px" />
|
||||||
v-model="form.OrganizationName"
|
|
||||||
disabled
|
|
||||||
style="width:200px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 是否生成账号 -->
|
<!-- 是否生成账号 -->
|
||||||
<!-- <el-form-item
|
<!-- <el-form-item
|
||||||
|
@ -69,51 +49,35 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<!-- 用户类型 -->
|
<!-- 用户类型 -->
|
||||||
<el-form-item
|
<el-form-item v-if="form.IsGenerateAccount" :label="$t('trials:staffResearch:form:userType')" prop="UserTypeId">
|
||||||
v-if="form.IsGenerateAccount"
|
<el-select v-model="form.UserTypeId" style="width: 200px" disabled>
|
||||||
:label="$t('trials:staffResearch:form:userType')"
|
<el-option v-for="item of userTypeOptions" :key="item.Id" :label="item.UserTypeShortName" :value="item.Id">
|
||||||
prop="UserTypeId"
|
|
||||||
>
|
|
||||||
<el-select
|
|
||||||
v-model="form.UserTypeId"
|
|
||||||
style="width:200px;"
|
|
||||||
disabled
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item of userTypeOptions"
|
|
||||||
:key="item.Id"
|
|
||||||
:label="item.UserTypeShortName"
|
|
||||||
:value="item.Id"
|
|
||||||
>
|
|
||||||
<span>{{ item.UserType }}</span>
|
<span>{{ item.UserType }}</span>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 更新状态 -->
|
<!-- 更新状态 -->
|
||||||
<el-form-item
|
<el-form-item :label="$t('trials:staffResearch:form:updateState')">
|
||||||
:label="$t('trials:staffResearch:form:updateState')"
|
<el-radio-group v-model="form.IsHistoryUserDeleted" style="width: 200px">
|
||||||
>
|
<el-radio v-for="item of $d.IsUserExitTrial" :key="`IsHistoryUserDeleted${item.value}`" :label="item.value">{{
|
||||||
<el-radio-group
|
item.label }}</el-radio>
|
||||||
v-model="form.IsHistoryUserDeleted"
|
|
||||||
style="width:200px;"
|
|
||||||
>
|
|
||||||
<el-radio v-for="item of $d.IsUserExitTrial" :key="`IsHistoryUserDeleted${item.value}`" :label="item.value">{{ item.label }}</el-radio>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="errorMsg" label="">
|
<el-form-item v-if="errorMsg" label="">
|
||||||
<span v-if="errorMsg" style="font-size: 12px;color: #f66;">{{ errorMsg }}</span>
|
<span v-if="errorMsg" style="font-size: 12px; color: #f66">{{
|
||||||
|
errorMsg
|
||||||
|
}}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
<div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<!-- 取消 -->
|
<!-- 取消 -->
|
||||||
<el-button size="small" type="primary" :disabled="btnLoading" @click="handleCancel">
|
<el-button size="small" type="primary" :disabled="btnLoading" @click="handleCancel">
|
||||||
{{ $t('common:button:cancel') }}
|
{{ $t("common:button:cancel") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- 保存 -->
|
<!-- 保存 -->
|
||||||
<el-button size="small" type="primary" :loading="btnLoading" @click="handleSave">
|
<el-button size="small" type="primary" :loading="btnLoading" @click="handleSave">
|
||||||
{{ $t('common:button:save') }}
|
{{ $t("common:button:save") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
@ -142,7 +106,8 @@ export default {
|
||||||
if (value === '') {
|
if (value === '') {
|
||||||
callback(new Error(this.$t('trials:researchForm:formRule:specify')))
|
callback(new Error(this.$t('trials:researchForm:formRule:specify')))
|
||||||
} else {
|
} else {
|
||||||
var reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
var reg =
|
||||||
|
/^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
||||||
if (this.form.Email && reg.test(this.form.Email)) {
|
if (this.form.Email && reg.test(this.form.Email)) {
|
||||||
this.sendDisabled = false
|
this.sendDisabled = false
|
||||||
callback()
|
callback()
|
||||||
|
@ -164,29 +129,64 @@ export default {
|
||||||
OrganizationName: '',
|
OrganizationName: '',
|
||||||
IsGenerateAccount: false,
|
IsGenerateAccount: false,
|
||||||
IsHistoryUserDeleted: ''
|
IsHistoryUserDeleted: ''
|
||||||
|
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
LastName: [
|
LastName: [
|
||||||
{ required: true, message: this.$t('trials:researchForm:formRule:specify'), trigger: 'blur' },
|
{
|
||||||
{ min: 0, max: 50, message: this.$t('trials:researchForm:formRule:maxLength'), trigger: 'blur' }
|
required: true,
|
||||||
|
message: this.$t('trials:researchForm:formRule:specify'),
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
min: 0,
|
||||||
|
max: 50,
|
||||||
|
message: this.$t('trials:researchForm:formRule:maxLength'),
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
FirstName: [
|
FirstName: [
|
||||||
{ required: true, message: this.$t('trials:researchForm:formRule:specify'), trigger: 'blur' },
|
{
|
||||||
{ min: 0, max: 50, message: this.$t('trials:researchForm:formRule:maxLength'), trigger: 'blur' }
|
required: true,
|
||||||
|
message: this.$t('trials:researchForm:formRule:specify'),
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
min: 0,
|
||||||
|
max: 50,
|
||||||
|
message: this.$t('trials:researchForm:formRule:maxLength'),
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
TrialRoleCode: [
|
TrialRoleCode: [
|
||||||
{ required: true, message: this.$t('trials:researchForm:formRule:select'), trigger: ['blur', 'change'] }
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('trials:researchForm:formRule:select'),
|
||||||
|
trigger: ['blur', 'change']
|
||||||
|
}
|
||||||
|
],
|
||||||
|
UserTypeId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('trials:researchForm:formRule:select'),
|
||||||
|
trigger: ['blur']
|
||||||
|
}
|
||||||
],
|
],
|
||||||
UserTypeId: [{ required: true, message: this.$t('trials:researchForm:formRule:select'), trigger: ['blur'] }],
|
|
||||||
Phone: [
|
Phone: [
|
||||||
{ max: 50, message: this.$t('common:ruleMessage:maxLength') + ' 50', trigger: 'blur' }
|
{
|
||||||
|
max: 50,
|
||||||
|
message: this.$t('common:ruleMessage:maxLength') + ' 50',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
Email: [
|
Email: [
|
||||||
{ required: true, validator: validateEmail, trigger: ['blur'] }
|
{ required: true, validator: validateEmail, trigger: ['blur'] }
|
||||||
],
|
],
|
||||||
IsHistoryUserDeleted: [
|
IsHistoryUserDeleted: [
|
||||||
{ required: true, message: this.$t('trials:researchForm:formRule:select'), trigger: ['blur', 'change'] }
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('trials:researchForm:formRule:select'),
|
||||||
|
trigger: ['blur', 'change']
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
btnLoading: false,
|
btnLoading: false,
|
||||||
|
@ -202,7 +202,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
async initForm() {
|
async initForm() {
|
||||||
await this.getUserType()
|
await this.getUserType()
|
||||||
Object.keys(this.data).forEach(key => {
|
Object.keys(this.data).forEach((key) => {
|
||||||
this.form[key] = this.data[key]
|
this.form[key] = this.data[key]
|
||||||
})
|
})
|
||||||
if (zzSessionStorage.getItem('userTypeEnumInt')) {
|
if (zzSessionStorage.getItem('userTypeEnumInt')) {
|
||||||
|
@ -211,37 +211,44 @@ export default {
|
||||||
},
|
},
|
||||||
// 保存参与者信息
|
// 保存参与者信息
|
||||||
handleSave() {
|
handleSave() {
|
||||||
this.$refs['participantForm'].validate(valid => {
|
this.$refs['participantForm'].validate((valid) => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
this.btnLoading = true
|
this.btnLoading = true
|
||||||
if (!this.form.TrialSiteSurveyId) {
|
if (!this.form.TrialSiteSurveyId) {
|
||||||
this.form.TrialSiteSurveyId = getQueryString('trialSiteSurveyId')
|
this.form.TrialSiteSurveyId = getQueryString('trialSiteSurveyId')
|
||||||
}
|
}
|
||||||
const trialId = getQueryString('trialId')
|
const trialId = getQueryString('trialId')
|
||||||
addOrUpdateTrialSiteUserSurvey(trialId, this.form).then(res => {
|
addOrUpdateTrialSiteUserSurvey(trialId, this.form)
|
||||||
this.btnLoading = false
|
.then((res) => {
|
||||||
if (res.IsSuccess) {
|
this.btnLoading = false
|
||||||
// 保存成功
|
if (res.IsSuccess) {
|
||||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
// 保存成功
|
||||||
|
this.$message.success(
|
||||||
|
this.$t('common:message:savedSuccessfully')
|
||||||
|
)
|
||||||
|
|
||||||
this.$emit('close', { id: res.Result, errorMessage: '' })
|
this.$emit('close', { id: res.Result, errorMessage: '' })
|
||||||
}
|
}
|
||||||
}).catch((res) => {
|
})
|
||||||
if (res.Result && res.Result.Id && res.ErrorMessage) {
|
.catch((res) => {
|
||||||
this.$emit('close', { id: res.Result.Id, errorMessage: res.ErrorMessage })
|
if (res.Result && res.Result.Id && res.ErrorMessage) {
|
||||||
// this.$confirm(res.ErrorMessage, '', {
|
this.$emit('close', {
|
||||||
// type: 'warning'
|
id: res.Result.Id,
|
||||||
// }).then(() => {
|
errorMessage: res.ErrorMessage
|
||||||
// this.$set(this.form, 'LastName', res.Result.LastName)
|
})
|
||||||
// this.$set(this.form, 'FirstName', res.Result.FirstName)
|
// this.$confirm(res.ErrorMessage, '', {
|
||||||
// this.$set(this.form, 'Phone', res.Result.Phone)
|
// type: 'warning'
|
||||||
// this.handleSave()
|
// }).then(() => {
|
||||||
// }).catch(() => {
|
// this.$set(this.form, 'LastName', res.Result.LastName)
|
||||||
|
// this.$set(this.form, 'FirstName', res.Result.FirstName)
|
||||||
|
// this.$set(this.form, 'Phone', res.Result.Phone)
|
||||||
|
// this.handleSave()
|
||||||
|
// }).catch(() => {
|
||||||
|
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
this.btnLoading = false
|
this.btnLoading = false
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 取消保存
|
// 取消保存
|
||||||
|
@ -250,12 +257,16 @@ export default {
|
||||||
},
|
},
|
||||||
// 获取系统用户类型
|
// 获取系统用户类型
|
||||||
getUserType() {
|
getUserType() {
|
||||||
return new Promise(resolve => {
|
return new Promise((resolve) => {
|
||||||
getUserTypeList(3).then(res => {
|
getUserTypeList(3).then((res) => {
|
||||||
this.userTypeOptions = res.Result
|
this.userTypeOptions = res.Result
|
||||||
|
var crcObj = res.Result.find((i) => i.UserTypeEnum === 2)
|
||||||
|
this.crcId = crcObj ? crcObj.Id : ''
|
||||||
|
var craObj = res.Result.find((i) => i.UserTypeEnum === 9)
|
||||||
|
this.craId = craObj ? craObj.Id : ''
|
||||||
})
|
})
|
||||||
resolve()
|
resolve()
|
||||||
}).catch(() => { resolve() })
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,27 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="participantForm" :model="form" :rules="rules" label-width="200px" :inline="true" v-loading="loading">
|
<el-form ref="participantForm" v-loading="loading" :model="form" :rules="rules" label-width="200px" :inline="true">
|
||||||
<div class="base-dialog-body">
|
<div class="base-dialog-body">
|
||||||
<!-- 姓 -->
|
<!-- 姓 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:lastName')" prop="LastName">
|
<el-form-item :label="$t('trials:staffResearch:form:lastName')" prop="LastName">
|
||||||
<el-input
|
<el-input v-model="form.LastName" :disabled="!(state === 0 && userTypeEnumInt === 0)" style="width: 200px" />
|
||||||
v-model="form.LastName"
|
|
||||||
:disabled="!(state === 0 && userTypeEnumInt === 0)"
|
|
||||||
style="width:200px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 名 -->
|
<!-- 名 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:firstName')" prop="FirstName">
|
<el-form-item :label="$t('trials:staffResearch:form:firstName')" prop="FirstName">
|
||||||
<el-input
|
<el-input v-model="form.FirstName" :disabled="!(state === 0 && userTypeEnumInt === 0)" style="width: 200px" />
|
||||||
v-model="form.FirstName"
|
|
||||||
:disabled="!(state === 0 && userTypeEnumInt === 0)"
|
|
||||||
style="width:200px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 角色 -->
|
<!-- 角色 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:role')" prop="TrialRoleCode">
|
<el-form-item :label="$t('trials:staffResearch:form:role')" prop="TrialRoleCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.TrialRoleCode"
|
v-model="form.TrialRoleCode"
|
||||||
style="width:200px;"
|
style="width: 200px"
|
||||||
:disabled="!(state === 0 && userTypeEnumInt === 0)"
|
:disabled="!(state === 0 && userTypeEnumInt === 0)"
|
||||||
@change="handleTrialRoleChange"
|
@change="handleTrialRoleChange"
|
||||||
>
|
>
|
||||||
|
@ -35,26 +27,18 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 电话号码 -->
|
<!-- 电话号码 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:phone')" prop="Phone">
|
<el-form-item :label="$t('trials:staffResearch:form:phone')" prop="Phone">
|
||||||
<el-input
|
<el-input v-model="form.Phone" :disabled="!(state === 0 && userTypeEnumInt === 0)" style="width: 200px" />
|
||||||
v-model="form.Phone"
|
|
||||||
:disabled="!(state === 0 && userTypeEnumInt === 0)"
|
|
||||||
style="width:200px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 邮箱 -->
|
<!-- 邮箱 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:email')" prop="Email">
|
<el-form-item :label="$t('trials:staffResearch:form:email')" prop="Email">
|
||||||
<el-input
|
<el-input v-model="form.Email" :disabled="!(state === 0 && userTypeEnumInt === 0)" style="width: 200px" />
|
||||||
v-model="form.Email"
|
|
||||||
:disabled="!(state === 0 && userTypeEnumInt === 0)"
|
|
||||||
style="width:200px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 单位 -->
|
<!-- 单位 -->
|
||||||
<el-form-item :label="$t('trials:staffResearch:form:organization')" prop="OrganizationName">
|
<el-form-item :label="$t('trials:staffResearch:form:organization')" prop="OrganizationName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.OrganizationName"
|
v-model="form.OrganizationName"
|
||||||
:disabled="!(state === 0 && userTypeEnumInt === 0)"
|
:disabled="!(state === 0 && userTypeEnumInt === 0)"
|
||||||
style="width:200px;"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-row>
|
<!-- <el-row>
|
||||||
|
@ -93,19 +77,20 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>-->
|
</el-row>-->
|
||||||
<el-form-item v-if="errorMsg" label="">
|
<el-form-item v-if="errorMsg" label="">
|
||||||
<span v-if="errorMsg" style="font-size: 12px;color: #f66;">{{ errorMsg }}</span>
|
<span v-if="errorMsg" style="font-size: 12px; color: #f66">{{
|
||||||
|
errorMsg
|
||||||
|
}}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
<div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<!-- 取消 -->
|
<!-- 取消 -->
|
||||||
<el-button size="small" type="primary" :disabled="btnLoading" @click="handleCancel">
|
<el-button size="small" type="primary" :disabled="btnLoading" @click="handleCancel">
|
||||||
{{ $t('common:button:cancel') }}
|
{{ $t("common:button:cancel") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- 保存 -->
|
<!-- 保存 -->
|
||||||
<el-button size="small" type="primary" :loading="btnLoading" @click="handleSave">
|
<el-button size="small" type="primary" :loading="btnLoading" @click="handleSave">
|
||||||
{{ $t('common:button:save') }}
|
{{ $t("common:button:save") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
@ -152,7 +137,8 @@ export default {
|
||||||
if (value === '') {
|
if (value === '') {
|
||||||
callback(new Error(this.$t('trials:researchForm:formRule:specify')))
|
callback(new Error(this.$t('trials:researchForm:formRule:specify')))
|
||||||
} else {
|
} else {
|
||||||
var reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
var reg =
|
||||||
|
/^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
||||||
if (this.form.Email && reg.test(this.form.Email)) {
|
if (this.form.Email && reg.test(this.form.Email)) {
|
||||||
this.sendDisabled = false
|
this.sendDisabled = false
|
||||||
callback()
|
callback()
|
||||||
|
@ -175,23 +161,54 @@ export default {
|
||||||
// IsCorrect: false,
|
// IsCorrect: false,
|
||||||
IsGenerateAccount: false,
|
IsGenerateAccount: false,
|
||||||
IsDisable: false
|
IsDisable: false
|
||||||
|
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
LastName: [
|
LastName: [
|
||||||
{ required: true, message: this.$t('trials:researchForm:formRule:specify'), trigger: 'blur' },
|
{
|
||||||
{ min: 0, max: 50, message: this.$t('trials:researchForm:formRule:maxLength'), trigger: 'blur' }
|
required: true,
|
||||||
|
message: this.$t('trials:researchForm:formRule:specify'),
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
min: 0,
|
||||||
|
max: 50,
|
||||||
|
message: this.$t('trials:researchForm:formRule:maxLength'),
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
FirstName: [
|
FirstName: [
|
||||||
{ required: true, message: this.$t('trials:researchForm:formRule:specify'), trigger: 'blur' },
|
{
|
||||||
{ min: 0, max: 50, message: this.$t('trials:researchForm:formRule:maxLength'), trigger: 'blur' }
|
required: true,
|
||||||
|
message: this.$t('trials:researchForm:formRule:specify'),
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
min: 0,
|
||||||
|
max: 50,
|
||||||
|
message: this.$t('trials:researchForm:formRule:maxLength'),
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
TrialRoleCode: [
|
TrialRoleCode: [
|
||||||
{ required: true, message: this.$t('trials:researchForm:formRule:select'), trigger: ['blur', 'change'] }
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('trials:researchForm:formRule:select'),
|
||||||
|
trigger: ['blur', 'change']
|
||||||
|
}
|
||||||
|
],
|
||||||
|
UserTypeId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('trials:researchForm:formRule:select'),
|
||||||
|
trigger: ['blur']
|
||||||
|
}
|
||||||
],
|
],
|
||||||
UserTypeId: [{ required: true, message: this.$t('trials:researchForm:formRule:select'), trigger: ['blur'] }],
|
|
||||||
Phone: [
|
Phone: [
|
||||||
{ max: 50, message: this.$t('common:ruleMessage:maxLength') + ' 50', trigger: 'blur' }
|
{
|
||||||
|
max: 50,
|
||||||
|
message: this.$t('common:ruleMessage:maxLength') + ' 50',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
Email: [
|
Email: [
|
||||||
{ required: true, validator: validateEmail, trigger: ['blur'] }
|
{ required: true, validator: validateEmail, trigger: ['blur'] }
|
||||||
|
@ -204,7 +221,7 @@ export default {
|
||||||
errorMsg: '',
|
errorMsg: '',
|
||||||
crcId: '',
|
crcId: '',
|
||||||
craId: '',
|
craId: '',
|
||||||
loading:false
|
loading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -214,7 +231,7 @@ export default {
|
||||||
async initForm() {
|
async initForm() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
await this.getUserType()
|
await this.getUserType()
|
||||||
Object.keys(this.data).forEach(key => {
|
Object.keys(this.data).forEach((key) => {
|
||||||
this.form[key] = this.data[key]
|
this.form[key] = this.data[key]
|
||||||
})
|
})
|
||||||
if (zzSessionStorage.getItem('userTypeEnumInt')) {
|
if (zzSessionStorage.getItem('userTypeEnumInt')) {
|
||||||
|
@ -224,37 +241,44 @@ export default {
|
||||||
},
|
},
|
||||||
// 保存参与者信息
|
// 保存参与者信息
|
||||||
handleSave() {
|
handleSave() {
|
||||||
this.$refs['participantForm'].validate(valid => {
|
this.$refs['participantForm'].validate((valid) => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
this.btnLoading = true
|
this.btnLoading = true
|
||||||
if (!this.form.TrialSiteSurveyId) {
|
if (!this.form.TrialSiteSurveyId) {
|
||||||
this.form.TrialSiteSurveyId = getQueryString('trialSiteSurveyId')
|
this.form.TrialSiteSurveyId = getQueryString('trialSiteSurveyId')
|
||||||
}
|
}
|
||||||
const trialId = getQueryString('trialId')
|
const trialId = getQueryString('trialId')
|
||||||
addOrUpdateTrialSiteUserSurvey(trialId, this.form).then(res => {
|
addOrUpdateTrialSiteUserSurvey(trialId, this.form)
|
||||||
this.btnLoading = false
|
.then((res) => {
|
||||||
if (res.IsSuccess) {
|
this.btnLoading = false
|
||||||
// 保存成功
|
if (res.IsSuccess) {
|
||||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
// 保存成功
|
||||||
|
this.$message.success(
|
||||||
|
this.$t('common:message:savedSuccessfully')
|
||||||
|
)
|
||||||
|
|
||||||
this.$emit('close', { id: res.Result, errorMessage: '' })
|
this.$emit('close', { id: res.Result, errorMessage: '' })
|
||||||
}
|
}
|
||||||
}).catch((res) => {
|
})
|
||||||
if (res.Result && res.Result.Id && res.ErrorMessage) {
|
.catch((res) => {
|
||||||
this.$emit('close', { id: res.Result.Id, errorMessage: res.ErrorMessage })
|
if (res.Result && res.Result.Id && res.ErrorMessage) {
|
||||||
// this.$confirm(res.ErrorMessage, '', {
|
this.$emit('close', {
|
||||||
// type: 'warning'
|
id: res.Result.Id,
|
||||||
// }).then(() => {
|
errorMessage: res.ErrorMessage
|
||||||
// this.$set(this.form, 'LastName', res.Result.LastName)
|
})
|
||||||
// this.$set(this.form, 'FirstName', res.Result.FirstName)
|
// this.$confirm(res.ErrorMessage, '', {
|
||||||
// this.$set(this.form, 'Phone', res.Result.Phone)
|
// type: 'warning'
|
||||||
// this.handleSave()
|
// }).then(() => {
|
||||||
// }).catch(() => {
|
// this.$set(this.form, 'LastName', res.Result.LastName)
|
||||||
|
// this.$set(this.form, 'FirstName', res.Result.FirstName)
|
||||||
|
// this.$set(this.form, 'Phone', res.Result.Phone)
|
||||||
|
// this.handleSave()
|
||||||
|
// }).catch(() => {
|
||||||
|
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
this.btnLoading = false
|
this.btnLoading = false
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleTrialRoleChange(v) {
|
handleTrialRoleChange(v) {
|
||||||
|
@ -278,16 +302,16 @@ export default {
|
||||||
},
|
},
|
||||||
// 获取系统用户类型
|
// 获取系统用户类型
|
||||||
getUserType() {
|
getUserType() {
|
||||||
return new Promise(resolve => {
|
return new Promise((resolve) => {
|
||||||
getUserTypeList(3).then(res => {
|
getUserTypeList(3).then((res) => {
|
||||||
this.userTypeOptions = res.Result
|
this.userTypeOptions = res.Result
|
||||||
var crcObj = res.Result.find(i => i.UserTypeEnum === 2)
|
var crcObj = res.Result.find((i) => i.UserTypeEnum === 2)
|
||||||
this.crcId = crcObj ? crcObj.Id : ''
|
this.crcId = crcObj ? crcObj.Id : ''
|
||||||
var craObj = res.Result.find(i => i.UserTypeEnum === 9)
|
var craObj = res.Result.find((i) => i.UserTypeEnum === 9)
|
||||||
this.craId = craObj ? craObj.Id : ''
|
this.craId = craObj ? craObj.Id : ''
|
||||||
})
|
})
|
||||||
resolve()
|
resolve()
|
||||||
}).catch(() => { resolve() })
|
})
|
||||||
},
|
},
|
||||||
handleIsCorrectChange(val) {
|
handleIsCorrectChange(val) {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
|
|
Loading…
Reference in New Issue