筛选阅片人简历修改页面变更、概述变更为模板、简历采集邮件发送支持多邮箱
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-11-21 16:30:38 +08:00
parent 2aa98eb68b
commit 3783f3cea4
9 changed files with 569 additions and 117 deletions

View File

@ -304,9 +304,9 @@ export function addOrUpdateDoctorBasicInfoAndEmployment(param) {
}) })
} }
// 新增或编辑概述 // 新增或编辑概述
export function updateGneralSituation(param) { export function addOrUpdateGneralSituation(param) {
return request({ return request({
url: `/Doctor/updateGneralSituation`, url: `/Doctor/addOrUpdateGneralSituation`,
method: 'post', method: 'post',
data: param data: param
}) })
@ -342,4 +342,28 @@ export function getIsVacation(param) {
method: 'post', method: 'post',
data: param data: param
}) })
}
// 获取概述
export function getSummarizeInfo(param) {
return request({
url: `/Doctor/getSummarizeInfo`,
method: 'post',
data: param
})
}
// 删除概述
export function deleteSummarizeInfo(param) {
return request({
url: `/Doctor/deleteSummarizeInfo`,
method: 'post',
data: param
})
}
// pm通过邮箱新建或查询简历
export function useEmialGetDoctorInfo(param) {
return request({
url: `/TrialSiteSurvey/useEmialGetDoctorInfo`,
method: 'post',
data: param
})
} }

View File

@ -12,7 +12,7 @@
:width="config.width" :width="config.width"
:fullscreen="config.fullscreen" :fullscreen="config.fullscreen"
> >
<div class="base-modal-body"> <div class="base-modal-body" :style="config.bodyStyle">
<slot name="dialog-body" /> <slot name="dialog-body" />
</div> </div>
<div slot="footer" class="base-modal-footer"> <div slot="footer" class="base-modal-footer">
@ -37,6 +37,7 @@ export default {
width: '100px', width: '100px',
fullscreen: false, fullscreen: false,
top: '15vh', top: '15vh',
bodyStyle: '',
} }
}, },
}, },

View File

@ -2,84 +2,230 @@
<div class="form-container"> <div class="form-container">
<el-card class="box-card"> <el-card class="box-card">
<div style="width: 80%"> <div style="width: 80%">
<div class="top">
<span>{{ $t('system:reviewer:tab:Summarize') }}</span>
<el-button
size="small"
type="primary"
v-if="$route.query.ReviewStatus !== '1'"
@click="handleAdd()"
>
{{ $t('common:button:add') }}
</el-button>
</div>
<el-table
ref="educationTbl"
:data="list"
border
class="table"
:loading="loading"
size="small"
>
<el-table-column type="index" width="30" />
<el-table-column
prop="Indication"
:label="$t('system:reviewer:label:Indication')"
min-width="55"
show-overflow-tooltip
/>
<el-table-column
prop="Summarize"
:label="$t('system:reviewer:label:SummarizeZH')"
min-width="55"
show-overflow-tooltip
/>
<el-table-column
prop="SummarizeEn"
:label="$t('system:reviewer:label:SummarizeEN')"
min-width="70"
show-overflow-tooltip
/>
<el-table-column
prop="IsMain"
:label="$t('system:reviewer:label:IsMain')"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ $fd('YesOrNo', scope.row.IsMain) }}
</template>
</el-table-column>
<el-table-column
:label="$t('system:EducationTraining:table:Operation')"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
:disabled="$route.query.ReviewStatus === '1'"
@click="handleAdd(scope.row)"
>
{{ $t('common:button:edit') }}
</el-button>
<el-button
type="text"
size="small"
:disabled="$route.query.ReviewStatus === '1'"
@click="handleDelete(scope.row)"
>
{{ $t('common:button:delete') }}
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<base-model :config="model_cfg">
<template slot="dialog-body">
<el-form <el-form
ref="summarizeFrom" ref="summarizeFrom"
v-loading="loading" v-loading="loading"
:rules="rules" :rules="rules"
:model="form" :model="form"
class="demo-ruleForm" class="demo-ruleForm"
label-width="150px" label-width="100px"
> >
<el-row> <el-form-item
<el-col :span="14"> :label="$t('system:reviewer:label:Indication')"
<el-form-item prop="Indication"
:label="$t('system:reviewer:label:Summarize')" >
prop="Summarize" <el-input
> v-model="form.Indication"
<el-input :placeholder="
:disabled="$route.query.ReviewStatus === '1'" $t('curriculumVitae:summarize:form:placeholder:Indication')
v-model="form.Summarize" "
type="textarea"
:rows="10"
:placeholder="
$t('curriculumVitae:summarize:form:placeholder:summarize')
"
size="small"
:maxlength="4000"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<el-form-item prop="SummarizeEn">
<el-input
:disabled="$route.query.ReviewStatus === '1'"
v-model="form.SummarizeEn"
type="textarea"
:rows="10"
:placeholder="
$t('curriculumVitae:summarize:form:placeholder:summarizeEN')
"
size="small"
:maxlength="4000"
/>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button
type="primary"
:disabled="$route.query.ReviewStatus === '1'"
size="small" size="small"
:loading="loading" :maxlength="400"
@click="handleSave" />
</el-form-item>
<el-form-item prop="IndicationEn">
<el-input
v-model="form.IndicationEn"
:placeholder="
$t('curriculumVitae:summarize:form:placeholder:IndicationEn')
"
size="small"
:maxlength="400"
/>
</el-form-item>
<el-form-item
:label="$t('system:reviewer:label:Summarize')"
prop="Summarize"
>
<el-input
v-model="form.Summarize"
type="textarea"
:rows="10"
:placeholder="
$t('curriculumVitae:summarize:form:placeholder:summarize')
"
size="small"
:maxlength="4000"
/>
</el-form-item>
<el-form-item prop="SummarizeEn">
<el-input
v-model="form.SummarizeEn"
type="textarea"
:rows="10"
:placeholder="
$t('curriculumVitae:summarize:form:placeholder:summarizeEN')
"
size="small"
:maxlength="4000"
/>
</el-form-item>
<el-form-item
prop="IsMain"
:label="$t('system:reviewer:label:IsMain')"
>
<el-switch
v-model="form.IsMain"
:disabled="list.length <= 0 || ISMAIN"
> >
{{ $t('common:button:save') }} </el-switch>
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </template>
</el-card> <template slot="dialog-footer">
<el-button size="small" type="primary" @click="handleCancle">
{{ $t('common:button:cancel') }}
</el-button>
<el-button
size="small"
type="primary"
@click="handleSave"
:loading="loading"
>
{{ $t('common:button:save') }}
</el-button>
</template>
</base-model>
</div> </div>
</template> </template>
<script> <script>
import { getDetail, updateGneralSituation } from '@/api/reviewers' import {
addOrUpdateGneralSituation,
getSummarizeInfo,
deleteSummarizeInfo,
} from '@/api/reviewers'
import BaseModel from '@/components/BaseModel'
const defaultForm = () => {
return {
Id: null,
DoctorId: null,
Summarize: null,
SummarizeEn: null,
IsMain: false,
Indication: null,
IndicationEn: null,
}
}
export default { export default {
props: { props: {
reviewerId: { reviewerId: {
type: String, type: String,
}, },
}, },
components: { BaseModel },
data() { data() {
return { return {
list: [],
loading: false, loading: false,
form: { ISMAIN: false,
Summarize: null, model_cfg: {
SummarizeEn: null, visible: false,
showClose: true,
width: '800px',
title: this.$t('system:reviewer:form:SummarizeTitle'),
appendToBody: false,
top: '8vh',
}, },
form: defaultForm(),
rules: { rules: {
Indication: [
{
required: true,
message: 'Please enter Indication',
trigger: 'blur',
},
{
max: 400,
message: this.$t('form:rules:maxLength:400'),
trigger: 'blur',
},
],
IndicationEn: [
{
required: true,
message: 'Please enter Indication',
trigger: 'blur',
},
{
max: 400,
message: this.$t('form:rules:maxLength:400'),
trigger: 'blur',
},
],
Summarize: [ Summarize: [
{ {
max: 4000, max: 4000,
@ -105,15 +251,20 @@ export default {
try { try {
let validate = await this.$refs.summarizeFrom.validate() let validate = await this.$refs.summarizeFrom.validate()
if (!validate) return false if (!validate) return false
this.form.Id = this.$route.query.Id || this.reviewerId this.form.DoctorId = this.$route.query.Id || this.reviewerId
this.loading = true this.loading = true
if (this.$route.query.trialId) { if (this.$route.query.trialId) {
this.form.TrialId = this.$route.query.trialId this.form.TrialId = this.$route.query.trialId
} }
let res = await updateGneralSituation(this.form) if (this.list.length <= 0) {
this.form.IsMain = true
}
let res = await addOrUpdateGneralSituation(this.form)
this.loading = false this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(this.$t('common:message:savedSuccessfully'))
this.model_cfg.visible = false
this.getDetail()
} }
} catch (err) { } catch (err) {
this.loading = false this.loading = false
@ -126,18 +277,64 @@ export default {
let id = this.$route.query.Id || this.reviewerId let id = this.$route.query.Id || this.reviewerId
if (!id) return false if (!id) return false
this.loading = true this.loading = true
let res = await getDetail(id, this.$route.query.trialId) let res = await getSummarizeInfo({
DoctorId: id,
})
this.loading = false this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
Object.keys(this.form).forEach((key) => { this.list = res.Result.SummarizeList
this.form[key] = res.Result.SummarizeInfo[key]
})
} }
} catch (err) { } catch (err) {
this.loading = false this.loading = false
console.log(err) console.log(err)
} }
}, },
handleCancle() {
this.model_cfg.visible = false
},
handleAdd(row) {
this.form = defaultForm()
this.ISMAIN = false
if (row) {
Object.keys(this.form).forEach((key) => {
this.form[key] = row[key]
})
this.form.Id = row.Id
if (this.form.IsMain) {
this.ISMAIN = true
}
}
if (this.list.length <= 0) {
this.form.IsMain = true
}
this.model_cfg.visible = true
},
async handleDelete(row) {
try {
if (row.IsMain) {
return this.$message.warning(
this.$t('system:reviewer:message:deletedSuccessfully')
)
}
let confirm = await this.$confirm(
this.$t('system:reviewer:confirm:delete')
)
if (!confirm) return false
let data = {
Id: row.Id,
}
this.loading = true
let res = await deleteSummarizeInfo(data)
this.loading = false
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:deletedSuccessfully'))
this.getDetail()
}
} catch (err) {
console.log(err)
this.loading = false
}
},
}, },
} }
</script> </script>
@ -150,4 +347,11 @@ export default {
width: 220px !important; width: 220px !important;
} }
} }
.top {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin-bottom: 10px;
}
</style> </style>

View File

@ -431,8 +431,9 @@ export default {
showClose: true, showClose: true,
width: '800px', width: '800px',
title: this.$t('curriculumVitae:info:form:title'), title: this.$t('curriculumVitae:info:form:title'),
appendToBody: false, appendToBody: true,
top: '8vh', top: '8vh',
bodyStyle: `min-height: 100px; max-height: 650px;overflow-y: auto;padding: 10px;border: 1px solid #e0e0e0;`,
}, },
form: defaultForm(), form: defaultForm(),
rules: { rules: {

View File

@ -11,8 +11,11 @@
{{ $t('common:button:edit') }} {{ $t('common:button:edit') }}
</el-button> </el-button>
</div> </div>
<div class="message" v-if="DATA.SummarizeEn || DATA.Summarize"> <div
{{ isEN ? DATA.SummarizeEn : DATA.Summarize }} class="message"
v-if="mainSummarize.SummarizeEn || mainSummarize.Summarize"
>
{{ isEN ? mainSummarize.SummarizeEn : mainSummarize.Summarize }}
</div> </div>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div> <div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<base-model :config="model_cfg"> <base-model :config="model_cfg">
@ -25,6 +28,46 @@
label-width="80px" label-width="80px"
size="small" size="small"
> >
<template v-if="isPM && IndicationList.length > 0">
<el-form-item
:label="$t('curriculumVitae:summarize:form:Indication')"
prop="Indication"
v-if="!isEN"
>
<el-select
v-model="form.Indication"
placeholder=""
@change="handleChange"
>
<el-option
v-for="item in IndicationList"
:key="item.Id"
:label="item.Indication"
:value="item.Indication"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
:label="$t('curriculumVitae:summarize:form:Indication')"
prop="IndicationEn"
v-else
>
<el-select
v-model="form.IndicationEn"
placeholder=""
@change="handleChange"
>
<el-option
v-for="item in IndicationList"
:key="item.Id"
:label="item.IndicationEn"
:value="item.IndicationEn"
>
</el-option>
</el-select>
</el-form-item>
</template>
<el-form-item <el-form-item
:label="$t('curriculumVitae:summarize:form:summarize')" :label="$t('curriculumVitae:summarize:form:summarize')"
prop="Summarize" prop="Summarize"
@ -77,11 +120,17 @@
</template> </template>
<script> <script>
import BaseModel from '@/components/BaseModel' import BaseModel from '@/components/BaseModel'
import { updateGneralSituation } from '@/api/reviewers' import { addOrUpdateGneralSituation } from '@/api/reviewers'
const defaultForm = () => { const defaultForm = () => {
return { return {
SummarizeEn: '', Id: null,
Summarize: '', DoctorId: null,
Summarize: null,
SummarizeEn: null,
IsMain: false,
Indication: null,
IndicationEn: null,
TrialId: null,
} }
} }
export default { export default {
@ -107,6 +156,16 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isPM: {
type: Boolean,
default: false,
},
IndicationList: {
type: Array,
default: () => {
return []
},
},
}, },
data() { data() {
return { return {
@ -137,13 +196,24 @@ export default {
loading: false, loading: false,
} }
}, },
computed: {
mainSummarize() {
if (Array.isArray(this.DATA.SummarizeList) && this.trialId) {
return this.DATA.SummarizeList[0] || {}
}
if (Array.isArray(this.DATA.SummarizeList)) {
return this.DATA.SummarizeList.find((item) => item.IsMain) || {}
}
return {}
},
},
methods: { methods: {
openEdit() { async openEdit() {
this.form = defaultForm() this.form = defaultForm()
Object.keys(this.form).forEach((key) => { Object.keys(this.form).forEach((key) => {
if (this.DATA[key]) { // if (!this.isPM) {
this.form[key] = this.DATA[key] this.form[key] = this.mainSummarize[key]
} // }
}) })
this.model_cfg.visible = true this.model_cfg.visible = true
}, },
@ -156,13 +226,13 @@ export default {
let validate = await this.$refs.summarizeFrom.validate() let validate = await this.$refs.summarizeFrom.validate()
if (!validate) return false if (!validate) return false
if (this.reviewerId) { if (this.reviewerId) {
this.form.Id = this.reviewerId this.form.DoctorId = this.reviewerId
} }
if (this.trialId) { if (this.trialId) {
this.form.trialId = this.trialId this.form.TrialId = this.trialId
} }
this.loading = true this.loading = true
let res = await updateGneralSituation(this.form) let res = await addOrUpdateGneralSituation(this.form)
this.loading = false this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.$emit('getInfo') this.$emit('getInfo')
@ -173,6 +243,16 @@ export default {
console.log(err) console.log(err)
} }
}, },
handleChange(value) {
let data = this.IndicationList.find(
(item) => item.Indication === value || item.IndicationEn === value
)
Object.keys(this.form).forEach((key) => {
if (key !== 'Id') {
this.form[key] = data[key]
}
})
},
}, },
} }
</script> </script>

View File

@ -83,6 +83,8 @@
:reviewerId.sync="reviewerId" :reviewerId.sync="reviewerId"
:trialId="trialId" :trialId="trialId"
:isEN="isEN" :isEN="isEN"
:isPM="isPM"
:IndicationList="IndicationList"
@getInfo="getDetail" @getInfo="getDetail"
/> />
</div> </div>
@ -174,9 +176,14 @@
/> />
</div> </div>
</div> </div>
<el-dialog :visible.sync="visible" fullscreen> <el-dialog :visible.sync="visible" fullscreen append-to-body>
<div style="height: 100%; overflow: auto"> <div style="height: 100%; overflow: auto">
<preview :isEN="isEN" :reviewerId.sync="reviewerId" v-if="visible" /> <preview
:isEN="isEN"
:reviewerId.sync="reviewerId"
:trialId="trialId"
v-if="visible"
/>
</div> </div>
</el-dialog> </el-dialog>
<holiday <holiday
@ -208,7 +215,7 @@ import pay from './components/info/pay.vue'
import holiday from './components/info/holiday.vue' import holiday from './components/info/holiday.vue'
import setting from './components/info/setting.vue' import setting from './components/info/setting.vue'
import preview from './preview.vue' import preview from './preview.vue'
import { getDetail } from '@/api/reviewers' import { getDetail, getSummarizeInfo } from '@/api/reviewers'
import { mapMutations } from 'vuex' import { mapMutations } from 'vuex'
export default { export default {
components: { components: {
@ -258,6 +265,8 @@ export default {
holidayVisible: false, holidayVisible: false,
settingVisible: false, settingVisible: false,
IndicationList: [],
} }
}, },
computed: { computed: {
@ -274,7 +283,7 @@ export default {
this.$route.query.lang || zzSessionStorage.getItem('lang') this.$route.query.lang || zzSessionStorage.getItem('lang')
this.trialId = this.trialId =
this.$route.query.trialId || zzSessionStorage.getItem('trialId') this.$route.query.trialId || zzSessionStorage.getItem('trialId')
await this.setLanguage(this.$route.query.lang) await this.setLanguage(this.$i18n.locale)
if (sessionStorage.getItem('reviewerId')) { if (sessionStorage.getItem('reviewerId')) {
this.reviewerId = sessionStorage.getItem('reviewerId') this.reviewerId = sessionStorage.getItem('reviewerId')
this.getDetail() this.getDetail()
@ -296,6 +305,21 @@ export default {
}, },
methods: { methods: {
...mapMutations({ setLanguage: 'lang/setLanguage' }), ...mapMutations({ setLanguage: 'lang/setLanguage' }),
//
async getIndicationList() {
try {
let id = this.reviewerId
if (!id) return false
let res = await getSummarizeInfo({
DoctorId: id,
})
if (res.IsSuccess) {
this.IndicationList = res.Result.SummarizeList
}
} catch (err) {
console.log(err)
}
},
// //
async getDetail() { async getDetail() {
try { try {
@ -306,6 +330,9 @@ export default {
this.loading = false this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.reviewerData = res.Result this.reviewerData = res.Result
if (this.isPM) {
this.getIndicationList()
}
} }
} catch (err) { } catch (err) {
this.loading = false this.loading = false
@ -374,7 +401,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
width: 300px; width: 300px;
height: 100vh; height: 100%;
background-color: #eee; background-color: #eee;
border-right: 1px solid #eee; border-right: 1px solid #eee;
::v-deep .el-menu { ::v-deep .el-menu {

View File

@ -82,18 +82,11 @@
</div> </div>
<div <div
class="message break-word" class="message break-word"
v-if=" v-if="mainSummarize.SummarizeEn || mainSummarize.Summarize"
reviewerData.SummarizeInfo.SummarizeEn ||
reviewerData.SummarizeInfo.Summarize
"
> >
<div class="title">{{ $t('curriculumVitae:summarize:title') }}</div> <div class="title">{{ $t('curriculumVitae:summarize:title') }}</div>
<span class=""> <span class="">
{{ {{ isEN ? mainSummarize.SummarizeEn : mainSummarize.Summarize }}
isEN
? reviewerData.SummarizeInfo.SummarizeEn
: reviewerData.SummarizeInfo.Summarize
}}
</span> </span>
</div> </div>
<div class="message" v-if="isAll"> <div class="message" v-if="isAll">
@ -468,7 +461,9 @@
class="message break-word" class="message break-word"
style="white-space: pre-wrap" style="white-space: pre-wrap"
v-if="reviewerData.ResearchPublicationView.Publications" v-if="reviewerData.ResearchPublicationView.Publications"
>{{ reviewerData.ResearchPublicationView.Publications }}</div> >
{{ reviewerData.ResearchPublicationView.Publications }}
</div>
</div> </div>
<div <div
class="message break-word" class="message break-word"
@ -767,6 +762,22 @@ export default {
} }
}, },
computed: { computed: {
mainSummarize() {
if (
Array.isArray(this.reviewerData.SummarizeInfo.SummarizeList) &&
this.trialId
) {
return this.reviewerData.SummarizeInfo.SummarizeList[0] || {}
}
if (Array.isArray(this.reviewerData.SummarizeInfo.SummarizeList)) {
return (
this.reviewerData.SummarizeInfo.SummarizeList.find(
(item) => item.IsMain
) || {}
)
}
return {}
},
hasFile() { hasFile() {
return ( return (
(this.sowList && this.sowList.length > 0) || (this.sowList && this.sowList.length > 0) ||

View File

@ -525,13 +525,19 @@ export default {
}, },
// //
async sendEmail() { async sendEmail() {
var pattern = let emailList = this.email.split('|')
/^([A-Za-z0-9_\-\.\u4e00-\u9fa5])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/ let isError = false
if (!pattern.test(this.email)) emailList.forEach((item) => {
return this.$message.warning(this.$t('rules:email')) var pattern =
/^([A-Za-z0-9_\-\.\u4e00-\u9fa5])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/
if (!pattern.test(item)) {
isError = true
}
})
if (isError) return this.$message.warning(this.$t('rules:email'))
this.emailLoading = true this.emailLoading = true
let res = await doctorSendEmail({ let res = await doctorSendEmail({
Email: this.email, Email: emailList,
Url: `ReviewersResearch?lang=${this.$store.getters.language}`, Url: `ReviewersResearch?lang=${this.$store.getters.language}`,
}) })
this.emailLoading = false this.emailLoading = false

View File

@ -386,18 +386,61 @@
</base-model> </base-model>
<!--新增或修改简历--> <!--新增或修改简历-->
<el-dialog <el-dialog
title="" :title="$t('curriculumVitae:content:title')"
:visible.sync="visible" :visible.sync="visible"
fullscreen fullscreen
v-if="visible" v-if="visible"
appendToBody
:before-close="beforeClose" :before-close="beforeClose"
> >
<reviewerAdd :isSystem="false" v-if="resumeType === 'add'" /> <curriculumVitae :reviewerId="reviewerId" />
<reviewerEdit </el-dialog>
:isSystem="false" <!--新增阅片人输入邮箱--->
:reviewerId="reviewerId" <el-dialog
v-if="resumeType === 'edit'" :title="$t('curriculumVitae:content:title')"
/> :visible.sync="emailVisible"
v-if="emailVisible"
appendToBody
width="400px"
>
<el-form
v-if="emailVisible"
ref="emailForm"
:model="emailForm"
:rules="emailRule"
class="demo-form-inline"
label-width="80px"
>
<el-form-item
:label="$t('trials:trials-panel:attachments:enrollment:form:email')"
prop="EmailOrPhone"
>
<el-input
v-model="emailForm.EmailOrPhone"
clearable
:maxlength="400"
></el-input>
<el-input
style="display: none"
v-model="emailForm.EmailOrPhone"
clearable
:maxlength="400"
></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="handleCancle">
{{ $t('common:button:cancel') }}
</el-button>
<el-button
size="small"
type="primary"
@click="handleSave"
:loading="emailLoading"
>
{{ $t('common:button:save') }}
</el-button>
</span>
</el-dialog> </el-dialog>
</BaseContainer> </BaseContainer>
</template> </template>
@ -408,9 +451,8 @@ import store from '@/store'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getSelectionReviewerList, selectReviewers } from '@/api/trials' import { getSelectionReviewerList, selectReviewers } from '@/api/trials'
import BaseModel from '@/components/BaseModel' import BaseModel from '@/components/BaseModel'
import reviewerAdd from '@/views/reviewers/new' import curriculumVitae from '@/views/reviewers/curriculumVitae'
import reviewerEdit from '@/views/reviewers/edit' import { doctorSendEmail, useEmialGetDoctorInfo } from '@/api/reviewers'
import { doctorSendEmail } from '@/api/reviewers'
const getListQueryDefault = () => { const getListQueryDefault = () => {
return { return {
TrialId: '', TrialId: '',
@ -435,8 +477,7 @@ export default {
BaseContainer, BaseContainer,
Pagination, Pagination,
BaseModel, BaseModel,
reviewerAdd, curriculumVitae,
reviewerEdit,
}, },
dicts: ['ReadingType', 'Subspeciality', 'Position', 'Rank'], dicts: ['ReadingType', 'Subspeciality', 'Position', 'Rank'],
data() { data() {
@ -456,10 +497,33 @@ export default {
}, },
shareLink: null, shareLink: null,
email: null, email: null,
emailLoading: false,
visible: false, visible: false,
resumeType: 'add',
reviewerId: null, reviewerId: null,
emailVisible: false,
emailLoading: false,
emailForm: {
EmailOrPhone: null,
},
emailRule: {
EmailOrPhone: [
{
required: true,
message: this.$t('passwordReset:formRule:email'),
trigger: 'blur',
},
{
type: 'email',
message: this.$t('rules:email'),
trigger: 'blur,change',
},
{
max: 400,
message: this.$t('form:rules:maxLength:400'),
trigger: 'blur',
},
],
},
} }
}, },
computed: { computed: {
@ -469,6 +533,31 @@ export default {
this.initPage() this.initPage()
}, },
methods: { methods: {
handleCancle() {
Object.keys(this.emailForm).forEach((key) => {
this.emailForm[key] = null
})
this.emailVisible = false
},
async handleSave() {
try {
let validate = await this.$refs.emailForm.validate()
if (!validate) return false
this.emailLoading = true
this.emailForm.trialId = this.$route.query.trialId
let res = await useEmialGetDoctorInfo(this.emailForm)
this.emailLoading = false
if (res.IsSuccess) {
this.handleCancle()
sessionStorage.setItem('reviewerId', res.Result.DoctorId)
zzSessionStorage.setItem('trialId', this.$route.query.trialId)
this.visible = true
}
} catch (err) {
this.emailLoading = false
console.log(err)
}
},
copyCode() { copyCode() {
this.$copyText( this.$copyText(
`${this.$t('reviewers-list:button:copyCode')}: ${this.shareLink}` `${this.$t('reviewers-list:button:copyCode')}: ${this.shareLink}`
@ -494,13 +583,19 @@ export default {
}, },
// //
async sendEmail() { async sendEmail() {
var pattern = let emailList = this.email.split('|')
/^([A-Za-z0-9_\-\.\u4e00-\u9fa5])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/ let isError = false
if (!pattern.test(this.email)) emailList.forEach((item) => {
return this.$message.warning(this.$t('rules:email')) var pattern =
/^([A-Za-z0-9_\-\.\u4e00-\u9fa5])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/
if (!pattern.test(item)) {
isError = true
}
})
if (isError) return this.$message.warning(this.$t('rules:email'))
this.emailLoading = true this.emailLoading = true
let res = await doctorSendEmail({ let res = await doctorSendEmail({
Email: this.email, Email: emailList,
Url: `ReviewersResearch?lang=${this.$store.getters.language}&trialId=${this.$route.query.trialId}`, Url: `ReviewersResearch?lang=${this.$store.getters.language}&trialId=${this.$route.query.trialId}`,
}) })
this.emailLoading = false this.emailLoading = false
@ -513,10 +608,13 @@ export default {
}, },
// //
openViewer(type, row) { openViewer(type, row) {
this.resumeType = type if (type === 'add') {
if (row) { return (this.emailVisible = true)
this.reviewerId = row.Id
} }
if (row) {
sessionStorage.setItem('reviewerId', row.Id)
}
zzSessionStorage.setItem('trialId', this.$route.query.trialId)
this.visible = true this.visible = true
}, },
go(path) { go(path) {