简历部分接口对接
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-10-23 10:12:55 +08:00
parent 28be57dfee
commit b124178355
1 changed files with 541 additions and 85 deletions

View File

@ -6,33 +6,51 @@
<el-button <el-button
type="text" type="text"
class="editBtn" class="editBtn"
:disabled="!reviewerId"
@click.stop="openEdit('', 'clinicalTrials')" @click.stop="openEdit('', 'clinicalTrials')"
> >
{{ $t('common:button:add') }} {{ $t('common:button:add') }}
</el-button> </el-button>
</div> </div>
<el-table <el-table
:data="tableData" :data="DATA.ClinicalTrialExperienceList"
style="width: 100%" style="width: 100%"
:header-cell-style="{ background: '#eee', color: '#606266' }" :header-cell-style="{ background: '#eee', color: '#606266' }"
> >
<el-table-column <el-table-column
prop="date" prop="Phase"
:label="$t('curriculumVitae:clinicalTrials:table:byStages')" :label="$t('curriculumVitae:clinicalTrials:table:byStages')"
> >
<template slot-scope="scope">
{{ scope.row.OtherStages ? scope.row.OtherStages : scope.row.Phase }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="date" prop="EvaluationCriteriaList"
:label="$t('curriculumVitae:clinicalTrials:table:criterion')" :label="$t('curriculumVitae:clinicalTrials:table:criterion')"
> >
<template slot-scope="scope">
{{
scope.row.EvaluationCriteriaList.length > 0
? scope.row.EvaluationCriteriaList.join(', ')
: ''
}}
<span v-if="scope.row.OtherCriterion">
{{
scope.row.EvaluationCriteriaList.length > 0
? `, ${scope.row.OtherCriterion}`
: scope.row.OtherCriterion
}}
</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="date" prop="EvaluationContent"
:label="$t('curriculumVitae:clinicalTrials:table:indication')" :label="$t('curriculumVitae:clinicalTrials:table:indication')"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="date" prop="VisitReadingCount"
:label="$t('curriculumVitae:clinicalTrials:table:viewingVolumeNum')" :label="$t('curriculumVitae:clinicalTrials:table:viewingVolumeNum')"
> >
</el-table-column> </el-table-column>
@ -40,17 +58,28 @@
prop="date" prop="date"
:label="$t('curriculumVitae:clinicalTrials:table:year')" :label="$t('curriculumVitae:clinicalTrials:table:year')"
> >
<template slot-scope="scope">
<span v-if="scope.row.StartTime"
>{{ scope.row.StartTime.split('-')[0] }}-{{
scope.row.EndTime ? scope.row.EndTime.split('-')[0] : ''
}}</span
>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="date" :label="$t('common:action:action')"> <el-table-column prop="date" :label="$t('common:action:action')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
class="editBtn" class="editBtn"
@click.stop="openEdit(scope, 'clinicalTrials')" @click.stop="openEdit(scope.row, 'clinicalTrials')"
> >
{{ $t('common:button:edit') }} {{ $t('common:button:edit') }}
</el-button> </el-button>
<el-button type="text" class="editBtn" @click.stop="openEdit"> <el-button
type="text"
class="editBtn"
@click.stop="handleDel(scope.row, 'clinicalTrials')"
>
{{ $t('common:button:delete') }} {{ $t('common:button:delete') }}
</el-button> </el-button>
</template> </template>
@ -66,17 +95,20 @@
:header-cell-style="{ background: '#eee', color: '#606266' }" :header-cell-style="{ background: '#eee', color: '#606266' }"
> >
<el-table-column <el-table-column
prop="has" prop="GCP"
:label="$t('curriculumVitae:clinicalTrials:table:hasCertificate')" :label="$t('curriculumVitae:clinicalTrials:table:hasCertificate')"
> >
<template slot-scope="scope">
<span>{{ $fd('hasOrNo', scope.row.GCP) }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="time" prop="GCPTime"
:label="$t('curriculumVitae:clinicalTrials:table:certificateTime')" :label="$t('curriculumVitae:clinicalTrials:table:certificateTime')"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="adress" prop="GCPAgencies"
:label="$t('curriculumVitae:clinicalTrials:table:certificateHospital')" :label="$t('curriculumVitae:clinicalTrials:table:certificateHospital')"
> >
</el-table-column> </el-table-column>
@ -85,7 +117,8 @@
<el-button <el-button
type="text" type="text"
class="editBtn" class="editBtn"
@click.stop="openEdit(scope, 'certificate')" :disabled="!reviewerId"
@click.stop="openEdit(scope.row, 'certificate')"
> >
{{ $t('common:button:edit') }} {{ $t('common:button:edit') }}
</el-button> </el-button>
@ -103,12 +136,21 @@
{{ $t('common:button:edit') }} {{ $t('common:button:edit') }}
</el-button> </el-button>
</div> </div>
<template v-if="true"> <template
<div class="message">三的卡上不能打卡上班打卡</div> v-if="DATA.OtherClinicalExperience || DATA.OtherClinicalExperienceCN"
>
<div class="message">
{{
isEN ? DATA.OtherClinicalExperience : DATA.OtherClinicalExperienceCN
}}
</div>
</template> </template>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div> <div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<!--临床试验--> <!--临床试验-->
<base-model :config="model_cfg_clinicalTrials"> <base-model
:config="model_cfg_clinicalTrials"
v-if="model_cfg_clinicalTrials.visible"
>
<template slot="dialog-body"> <template slot="dialog-body">
<el-form <el-form
ref="clinicalTrialsFrom" ref="clinicalTrialsFrom"
@ -120,53 +162,87 @@
> >
<el-form-item <el-form-item
:label="$t('curriculumVitae:clinicalTrials:form:byStages')" :label="$t('curriculumVitae:clinicalTrials:form:byStages')"
prop="InternationalizationType" prop="PhaseId"
> >
<el-select v-model="form.Sex" clearable placeholder=""> <el-select v-model="form.PhaseId" clearable placeholder="">
<el-option <el-option
v-for="item in $d.sex" v-for="item of dictionaryList.Trial_Phase"
:key="item.id" :key="item.Id"
:label="item.label" :label="item.Value"
:value="item.value" :value="item.Id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="OtherStages" v-if="Trial_Phase_isOther">
<el-input
v-model="form.OtherStages"
clearable
:placeholder="
$t('curriculumVitae:clinicalTrials:placeholder:byStagesOther')
"
></el-input>
</el-form-item>
<el-form-item <el-form-item
:label="$t('curriculumVitae:clinicalTrials:form:criterion')" :label="$t('curriculumVitae:clinicalTrials:form:criterion')"
prop="InternationalizationType" prop="EvaluationCriteriaIdList"
> >
<el-select v-model="form.Sex" clearable placeholder=""> <el-select
v-model="form.EvaluationCriteriaIdList"
clearable
multiple
placeholder=""
>
<el-option <el-option
v-for="item in $d.sex" v-for="item in ReadingStandard"
:key="item.id" :key="item.Id"
:label="item.label" :label="item.Value"
:value="item.value" :value="item.Id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="OtherCriterion" v-if="ReadingStandard_isOther">
:label="$t('curriculumVitae:clinicalTrials:form:startTime')" <el-input
prop="InternationalizationType" v-model="form.OtherCriterion"
> clearable
<el-input clearable></el-input> :placeholder="
$t('curriculumVitae:clinicalTrials:placeholder:criterionOther')
"
></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('curriculumVitae:clinicalTrials:form:endTime')" :label="$t('curriculumVitae:clinicalTrials:form:time')"
prop="InternationalizationType" prop="BeginDate"
> >
<el-input clearable></el-input> <el-date-picker
</el-form-item> clearable
v-model="daterange"
type="daterange"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
:range-separator="$t('curriculumVitae:daterange:rangeSeparator')"
:start-placeholder="$t('curriculumVitae:daterange:startTime')"
:end-placeholder="$t('curriculumVitae:daterange:endTime')"
@change="changeTimeList"
>
</el-date-picker
></el-form-item>
<el-form-item <el-form-item
:label="$t('curriculumVitae:clinicalTrials:form:viewingVolumeNum')" :label="$t('curriculumVitae:clinicalTrials:form:viewingVolumeNum')"
prop="InternationalizationType" prop="VisitReadingCount"
> >
<el-input clearable></el-input> <el-input
oninput="value=value.replace(/[^\d]/g,'')"
v-model="form.VisitReadingCount"
controls-position="right"
:min="0"
clearable
></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('curriculumVitae:clinicalTrials:form:indication')" :label="$t('curriculumVitae:clinicalTrials:form:indication')"
prop="InternationalizationType" prop="EvaluationContent"
> >
<el-input clearable></el-input> <el-input v-model="form.EvaluationContent" clearable></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
@ -181,6 +257,7 @@
<el-button <el-button
size="small" size="small"
type="primary" type="primary"
:loading="loading"
@click="handleSave('clinicalTrials')" @click="handleSave('clinicalTrials')"
> >
{{ $t('common:button:save') }} {{ $t('common:button:save') }}
@ -200,25 +277,29 @@
> >
<el-form-item <el-form-item
:label="$t('curriculumVitae:clinicalTrials:form:hasCertificate')" :label="$t('curriculumVitae:clinicalTrials:form:hasCertificate')"
prop="InternationalizationType" prop="GCP"
> >
<el-radio-group v-model="certificateForm.radio"> <el-radio-group v-model="certificateForm.GCP" @input="handleInput">
<el-radio <el-radio
v-for="item in hasOrNo" v-for="item in $d.hasOrNo"
:key="item.id" :key="item.id"
:label="item.value" :label="item.value"
>{{ item.label }}</el-radio
> >
{{ item.label }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('curriculumVitae:clinicalTrials:form:CertificateTime')" :label="$t('curriculumVitae:clinicalTrials:form:CertificateTime')"
prop="InternationalizationType" prop="GCPTime"
v-if="certificateForm.GCP"
> >
<el-date-picker <el-date-picker
v-model="certificateForm.time" v-model="certificateForm.GCPTime"
type="date" type="date"
placeholder="" placeholder=""
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -226,37 +307,42 @@
:label=" :label="
$t('curriculumVitae:clinicalTrials:form:certificateHospital') $t('curriculumVitae:clinicalTrials:form:certificateHospital')
" "
prop="InternationalizationType" prop="GCPAgencies"
v-if="certificateForm.GCP"
> >
<el-input clearable></el-input> <el-input
v-model="certificateForm.GCPAgencies"
clearable
></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('curriculumVitae:clinicalTrials:form:attachments')" :label="$t('curriculumVitae:clinicalTrials:form:attachments')"
prop="InternationalizationType" prop="GCPId"
v-if="certificateForm.GCP"
> >
<div class="upload-container"> <div class="upload-container">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
action action
accept=".xls,.xlsx,.doc,.docx" :http-request="uploadFile"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:http-request="handleUploadFile"
:on-preview="handlePreview"
:on-remove="handleRemoveFile"
:show-file-list="true"
:file-list="fileList" :file-list="fileList"
:before-remove="beforeRemove"
:on-remove="handleRemoveFile"
:on-preview="handlePreview"
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
accept=".pdf"
> >
<el-button size="small" type="primary" :loading="btnLoading"> <el-button size="small" type="primary" :loading="btnDisabled">
{{ $t('common:button:upload') }} {{ $t('system:GcpCertificate:upload:Upload') }}
</el-button> </el-button>
<span <span
slot="tip" slot="tip"
style="margin-left: 10px" style="margin-left: 10px"
class="el-upload__tip" class="el-upload__tip"
> >
(must be in xlsx/xls/doc/docx format) {{ $t('system:tip:file:pdf') }}
</span> </span>
</el-upload> </el-upload>
</div> </div>
@ -274,6 +360,8 @@
<el-button <el-button
size="small" size="small"
type="primary" type="primary"
:loading="loading"
:disabled="!!certificateForm.GCP && !certificateForm.GCPId"
@click="handleSave('certificate')" @click="handleSave('certificate')"
> >
{{ $t('common:button:save') }} {{ $t('common:button:save') }}
@ -284,18 +372,19 @@
<base-model :config="model_cfg_other"> <base-model :config="model_cfg_other">
<template slot="dialog-body"> <template slot="dialog-body">
<el-form <el-form
ref="certificateFrom" ref="otherAboutFrom"
v-loading="loading" v-loading="loading"
:model="otherForm" :model="otherForm"
:rules="otherRules" :rules="otherRules"
label-width="80px" label-width="100px"
size="small" size="small"
> >
<el-form-item <el-form-item
:label="$t('curriculumVitae:clinicalTrials:form:other')" :label="$t('curriculumVitae:clinicalTrials:form:other')"
prop="InternationalizationType" prop="OtherClinicalExperienceCN"
> >
<el-input <el-input
v-model="otherForm.OtherClinicalExperienceCN"
clearable clearable
type="textarea" type="textarea"
:rows="2" :rows="2"
@ -304,7 +393,10 @@
$t('curriculumVitae:clinicalTrials:placeholder:other') $t('curriculumVitae:clinicalTrials:placeholder:other')
" "
></el-input> ></el-input>
</el-form-item>
<el-form-item prop="OtherClinicalExperience">
<el-input <el-input
v-model="otherForm.OtherClinicalExperience"
clearable clearable
type="textarea" type="textarea"
:rows="2" :rows="2"
@ -319,7 +411,12 @@
<el-button size="small" type="primary" @click="handleCancle('other')"> <el-button size="small" type="primary" @click="handleCancle('other')">
{{ $t('common:button:cancel') }} {{ $t('common:button:cancel') }}
</el-button> </el-button>
<el-button size="small" type="primary" @click="handleSave('other')"> <el-button
size="small"
type="primary"
:loading="loading"
@click="handleSave('other')"
>
{{ $t('common:button:save') }} {{ $t('common:button:save') }}
</el-button> </el-button>
</template> </template>
@ -328,6 +425,45 @@
</template> </template>
<script> <script>
import BaseModel from '@/components/BaseModel' import BaseModel from '@/components/BaseModel'
import { getBasicDataSelects } from '@/api/dictionary/dictionary'
import {
getTrialExperience,
addOrUpdateTrialExperience,
deleteTrialExperience,
updateOtherExperience,
updateGcpExperience,
} from '@/api/reviewers'
import {
deleteAttachment,
saveAttachments,
getAttachmentByType,
} from '@/api/attachment'
const defaultForm = () => {
return {
PhaseId: '',
EvaluationCriteriaIdList: [],
EvaluationContent: '',
VisitReadingCount: 0,
StartTime: null,
EndTime: null,
OtherStages: '',
OtherCriterion: '',
}
}
const defaultCertificateForm = () => {
return {
GCP: 0,
GCPTime: '',
GCPId: '',
GCPAgencies: '',
}
}
const defaultOtherForm = () => {
return {
OtherClinicalExperience: '',
OtherClinicalExperienceCN: '',
}
}
export default { export default {
name: 'clinicalTrials', name: 'clinicalTrials',
components: { BaseModel }, components: { BaseModel },
@ -337,7 +473,7 @@ export default {
required: true, required: true,
default: () => { default: () => {
return { return {
ClinicalTrialExperienceList: [],
} }
}, },
}, },
@ -360,22 +496,55 @@ export default {
title: this.$t('curriculumVitae:clinicalTrials:form:title'), title: this.$t('curriculumVitae:clinicalTrials:form:title'),
appendToBody: true, appendToBody: true,
}, },
form: {}, form: defaultForm(),
rules: {}, rules: {
PhaseId: [
{
required: true,
message: 'Please select',
trigger: ['blur', 'change'],
},
],
EvaluationCriteriaIdList: [
{
required: true,
message: 'Please select',
trigger: ['blur', 'change'],
},
],
VisitReadingCount: [
{ required: true, message: 'Please specify', trigger: 'blur' },
],
EvaluationContent: [
{ required: true, message: 'Please specify', trigger: 'blur' },
{ max: 300, message: 'The maximum length is 300' },
],
StartTime: [
{ required: true, message: 'Please specify', trigger: 'blur' },
],
},
loading: false, loading: false,
daterange: [], daterange: [],
GCPData: [ certificateForm: defaultCertificateForm(),
{ certificateRules: {
has: false, GCP: [
time: '2023.06', {
adress: 'xxxx医院', required: true,
}, message: 'Please select',
], trigger: ['blur', 'change'],
certificateForm: {}, },
certificateRules: {}, ],
GCPId: [
{
required: true,
message: 'Please upload File',
trigger: ['blur', 'change'],
},
],
},
fileList: [], fileList: [],
btnLoading: false, btnDisabled: false,
model_cfg_certificate: { model_cfg_certificate: {
visible: false, visible: false,
showClose: true, showClose: true,
@ -384,7 +553,7 @@ export default {
appendToBody: true, appendToBody: true,
}, },
otherForm: {}, otherForm: defaultOtherForm(),
otherRules: {}, otherRules: {},
model_cfg_other: { model_cfg_other: {
visible: false, visible: false,
@ -393,31 +562,318 @@ export default {
title: this.$t('curriculumVitae:clinicalTrials:form:otherTitle'), title: this.$t('curriculumVitae:clinicalTrials:form:otherTitle'),
appendToBody: true, appendToBody: true,
}, },
dictionaryList: {},
otherId: 'ef84e9cb-f1a6-49d7-b6da-34be2c12abd5',
} }
}, },
watch: {
Trial_Phase_isOther() {
if (!this.Trial_Phase_isOther) {
this.form.OtherStages = null
}
},
ReadingStandard_isOther() {
if (!this.ReadingStandard_isOther) {
this.form.OtherCriterion = null
}
},
},
computed: {
GCPData() {
if (!this.DATA) return []
return [
{
ExpiryDateStr: this.DATA.ExpiryDateStr,
FileName: this.DATA.FileName,
GCP: this.DATA.GCP,
GCPAgencies: this.DATA.GCPAgencies,
GCPFullPath: this.DATA.GCPFullPath,
GCPId: this.DATA.GCPId,
GCPTime: this.DATA.GCPTime,
Path: this.DATA.Path,
Type: this.DATA.Type,
},
]
},
Trial_Phase_isOther() {
if (!this.form.PhaseId) return false
let value = this.dictionaryList.Trial_Phase.find(
(item) => item.Id === this.form.PhaseId
).Value
return value === '其它' || value === 'Other'
},
ReadingStandard_isOther() {
if (
!this.form.EvaluationCriteriaIdList ||
this.form.EvaluationCriteriaIdList.length <= 0
)
return false
return this.form.EvaluationCriteriaIdList.includes(this.otherId)
},
ReadingStandard() {
if (!this.dictionaryList.ReadingStandard) return []
return [
...this.dictionaryList.ReadingStandard,
{
Id: this.otherId,
Value: 'Other',
},
]
},
},
mounted() {
this.getDicData()
},
methods: { methods: {
openEdit(row, key) { openEdit(row, key) {
this.form = defaultForm()
this.certificateForm = defaultCertificateForm()
this.otherForm = defaultOtherForm()
this.daterange = []
if (key === 'clinicalTrials' && row) {
Object.keys(this.form).forEach((key) => {
if (row[key]) {
this.form[key] = row[key]
}
})
if (this.form.StartTime && this.form.EndTime) {
this.daterange = [this.form.StartTime, this.form.EndTime]
}
if (
this.form.OtherCriterion &&
!this.form.EvaluationCriteriaIdList.includes(this.otherId)
) {
this.form.EvaluationCriteriaIdList.push(this.otherId)
}
this.form.Id = row.Id
}
if (key === 'certificate' && row) {
Object.keys(this.certificateForm).forEach((key) => {
if (row[key]) {
this.certificateForm[key] = row[key]
}
this.initFileList()
})
}
if (key === 'other') {
Object.keys(this.otherForm).forEach((key) => {
if (this.DATA[key]) {
this.otherForm[key] = this.DATA[key]
}
})
}
this[`model_cfg_${key}`].visible = true this[`model_cfg_${key}`].visible = true
}, },
handleCancle(key) { handleCancle(key) {
this.form = defaultForm()
this.certificateForm = defaultCertificateForm()
this.otherForm = defaultOtherForm()
this.daterange = []
this[`model_cfg_${key}`].visible = false this[`model_cfg_${key}`].visible = false
}, },
handleSave(key) { async handleSave(key) {
this[`model_cfg_${key}`].visible = false try {
if (key === 'clinicalTrials') {
let validate = this.$refs.clinicalTrialsFrom.validate()
if (!validate) return false
this.form.DoctorId = this.reviewerId
this.loading = true
let res = await addOrUpdateTrialExperience(this.form)
this.loading = false
if (res.IsSuccess) {
this.$emit('getInfo')
this[`model_cfg_${key}`].visible = false
}
}
if (key === 'certificate') {
let validate = this.$refs.certificateFrom.validate()
if (!validate) return false
this.certificateForm.Id = this.reviewerId
this.loading = true
let res = await updateGcpExperience(this.certificateForm)
this.loading = false
if (res.IsSuccess) {
this.$emit('getInfo')
this[`model_cfg_${key}`].visible = false
}
}
if (key === 'other') {
let validate = this.$refs.otherAboutFrom.validate()
if (!validate) return false
this.otherForm.DoctorId = this.reviewerId
this.loading = true
let res = await updateOtherExperience(this.otherForm)
this.loading = false
if (res.IsSuccess) {
this.$emit('getInfo')
this[`model_cfg_${key}`].visible = false
}
}
} catch (err) {
this.loading = false
console.log(err)
}
}, },
beforeUpload(file) {}, async handleDel(row, key) {
async handleUploadFile(param) {}, try {
handleRemoveFile() { let confirm = await this.$confirm(
this.fileList = [] this.$t('trials:trials-list:table:isDeleted')
this.form.Path = '' )
this.form.NameCN = '' if (!confirm) return false
this.form.Name = '' this.loading = true
let res = await deleteTrialExperience(row.Id)
this.loading = false
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:deletedSuccessfully'))
this.$emit('getInfo')
}
} catch (err) {
this.loading = false
console.log(err)
}
},
async uploadFile(param) {
var fileName = param.file.name
this.btnDisabled = true
const file = await this.fileToBlob(param.file)
const res = await this.OSSclient.put(
`/SystemData/reviewer/GCP/${this.reviewerId}/${fileName}`,
file
)
this.fileList.push({
name: fileName,
path: this.$getObjectName(res.url),
fullPath: this.$getObjectName(res.url),
url: this.$getObjectName(res.url),
type: 'GCP',
})
this.saveFile()
},
saveFile() {
const { name, path, fullPath, type } = this.fileList[0]
const param = [
{
DoctorId: this.reviewerId,
Type: type,
Path: path,
FullPath: fullPath,
FileName: name,
},
]
saveAttachments(param)
.then((res) => {
this.btnDisabled = false
if (res.IsSuccess) {
this.fileList[0].id = res.Result[0].Id
this.certificateForm.GCPId = res.Result[0].Id
this.$message.success(this.$t('common:message:savedSuccessfully'))
}
})
.catch(() => {
this.btnDisabled = false
})
},
beforeUpload(file, fileList) {
const isValidFile = this.fileValid(file.name, ['pdf'])
if (isValidFile) {
this.fileList = []
} else {
this.$alert(this.$t('trials:attachment:message:pdf'))
return false
}
},
fileValid(fileName, typeArr) {
var extendName = fileName
.substring(fileName.lastIndexOf('.') + 1)
.toLocaleLowerCase()
if (typeArr.indexOf(extendName) > -1) {
return true
} else {
return false
}
},
beforeRemove(file, fileList) {
if (file && file.status === 'success') {
return this.$confirm(
this.$t('trials:staffResearch:message:confirmDel')
).then(() => {
this.certificateForm.GCPId = ''
})
}
},
handleRemoveFile(file, fileList) {
if (file && file.status === 'success') {
if (file.id) {
deleteAttachment(file.id, file.path).then((res) => {
if (res.IsSuccess) {
this.fileList = []
this.certificateForm.GCPId = ''
this.$emit('getInfo')
this.$message({
message: this.$t('common:message:deletedSuccessfully'),
type: 'success',
})
}
})
} else {
this.fileList = []
this.GCPID = ''
}
}
},
handlePreview(file) {
if (file.fullPath) {
window.open(this.OSSclientConfig.basePath + file.fullPath, '_blank')
}
}, },
handlePreview(file) {},
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.$message.warning(`Upload is currently limited to 1 file`) this.$message.warning(`Upload is currently limited to 1 file`)
}, },
checkFileSuffix(fileName) {}, initFileList() {
if (!this.reviewerId) return
getAttachmentByType(this.reviewerId, 'GCP').then((res) => {
if (res.IsSuccess) {
if (res.Result.length > 0) {
this.fileList = this.formatterFileList(res.Result)
} else {
this.fileList = []
}
}
})
},
formatterFileList(list) {
var arr = []
list.forEach((item) => {
var data = {
name: item.FileName,
path: item.Path,
fullPath: item.FullPath,
id: item.Id,
type: item.Type,
}
arr.push(data)
})
return arr
},
getDicData() {
getBasicDataSelects(['Trial_Phase', 'ReadingStandard']).then((res) => {
this.dictionaryList = { ...res.Result }
})
},
changeTimeList() {
if (this.daterange && this.daterange.length === 2) {
this.form.StartTime = this.daterange[0]
this.form.EndTime = this.daterange[1]
} else {
this.form.StartTime = null
this.form.EndTime = null
}
},
handleInput() {
if (this.certificateForm.GCP === 0) {
this.certificateForm = defaultCertificateForm()
}
},
}, },
} }
</script> </script>