Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web into main
continuous-integration/drone/push Build is passing Details

uat_us
caiyiling 2024-10-23 16:53:28 +08:00
commit f1f27f405b
7 changed files with 865 additions and 198 deletions

View File

@ -15,7 +15,6 @@ service.interceptors.request.use(
config.headers['Content-Type'] = 'application/json;charset=UTF-8'
var language = zzSessionStorage.getItem('lang')
config.headers['Accept-Language'] = language === 'en'?'en-US,en;q=0.5':'zh-CN,zh;q=0.9'
console.log(config.headers)
if (store.getters.token) {
config.headers.Authorization = `Bearer ${store.getters.token}`
}

View File

@ -374,6 +374,7 @@ export default {
reviewerId() {
if (this.reviewerId) {
this.doctorId = this.reviewerId
this.initSowList()
}
},
},
@ -476,6 +477,7 @@ export default {
FilePath: null,
DoctorId: null,
CriterionType: null,
IsEnable: false,
}
this.handleRemoveFile2()
this.form.FileType = fileType

View File

@ -241,10 +241,11 @@ export default {
reviewerId() {
if (this.reviewerId) {
this.doctorId = this.reviewerId
this.getResumeList()
}
},
},
created() {
mounted() {
if (!this.doctorId) return
this.getResumeList()
},

View File

@ -5,115 +5,371 @@
<div class="file_title">
{{ $t('curriculumVitae:agreement:fileTitle') }}
</div>
<template v-if="true">
<div class="file" v-for="item in [1, 2]" :key="item">
<div class="name">简历1</div>
<template v-if="sowList && sowList.length > 0">
<div class="file" v-for="item in sowList" :key="item.Id">
<div class="name" :title="item.FileName">{{ item.FileName }}</div>
<i
class="el-icon-view"
:title="$t('common:button:preview')"
@click.stop="preview"
@click.stop="handlePreview3(item)"
/>
<i
class="el-icon-edit"
:title="$t('common:button:edit')"
v-if="item.IsIRUpload"
@click="
handleEditCol(item, 0, $t('trials:enrolledReviews:message:SOW'))
"
/>
<i
class="el-icon-delete"
v-if="item.IsIRUpload"
:title="$t('common:button:delete')"
@click="handleRemoveFile3(item)"
/>
<i class="el-icon-delete" :title="$t('common:button:delete')" />
</div>
</template>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<div class="btnBox">
<div style="position: relative">
<div class="btnBox" style="margin-top: 10px">
<el-button
type="primary"
size="small"
:disabled="loading"
:loading="loading"
@click.stop="addCol(0, $t('trials:enrolledReviews:message:SOW'))"
>
{{ $t('curriculumVitae:agreement:btn:upload') }}
</el-button>
<input
type="file"
name="file"
multiple
ref="upload"
:title="$t('curriculumVitae:agreement:btn:upload')"
style="
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
"
:accept="faccept.join(',')"
@change="($event) => beginScanFiles($event)"
/>
<el-button
type="text"
@click.stop="handleDownload('Reviewer_SOW_Template')"
>
{{ $t('common:button:downloadTpl') }}
</el-button>
</div>
<el-button type="text">{{ $t('common:button:downloadTpl') }}</el-button>
</div>
<template v-if="true">
<template v-if="CounselorFiles">
<div class="file_title">
{{ $t('curriculumVitae:agreement:Counselor') }}
</div>
<div class="file" v-for="item in [1, 2]" :key="item">
<div class="name">简历1</div>
<div class="file" v-for="item in CounselorFiles" :key="item.Id">
<div class="name" :title="item.FileName">{{ item.FileName }}</div>
<i
class="el-icon-view"
:title="$t('common:button:preview')"
@click.stop="preview"
@click.stop="preview(item)"
/>
</div>
</template>
<template v-if="true">
<template v-if="ackSowList && ackSowList.length > 0">
<div class="file_title">
{{ $t('curriculumVitae:agreement:confirmation') }}
</div>
<div class="file" v-for="item in [1, 2]" :key="item">
<div class="name">简历1</div>
<div class="file" v-for="item in ackSowList" :key="item.Id">
<div class="name" :title="item.FileName">{{ item.FileName }}</div>
<i
class="el-icon-view"
:title="$t('common:button:preview')"
@click.stop="preview"
@click.stop="handlePreview3(item)"
/>
</div>
</template>
</div>
<BaseModel :config="model_cfg">
<template slot="dialog-body">
<el-form
ref="DictionaryTypeConfigForm"
:model="form"
:rules="rules"
label-width="120px"
size="small"
>
<el-form-item
:label="$t('system:Agreements:label:Criterion Type')"
prop="CriterionType"
>
<el-select v-model="form.CriterionType">
<el-option
v-for="item of $d.CriterionType"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<el-form-item
:label="$t('system:Agreements:label:File')"
prop="FilePath"
>
<el-upload
class="upload-demo"
action
:before-upload="beforeUpload"
:http-request="handleUploadFile"
:on-preview="handlePreview2"
:on-remove="handleRemoveFile2"
:show-file-list="true"
:limit="1"
:file-list="fileList"
>
<el-button
size="small"
type="primary"
:disabled="fileList.length > 0"
>{{ $t('common:button:upload') }}</el-button
>
</el-upload>
</el-form-item>
<el-form-item :label="$t('system:Agreements:label:Remark')">
<el-input
v-model="form.Remark"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
></el-input>
</el-form-item>
<el-form-item :label="$t('system:Agreements:label:Is Enable')">
<el-switch
v-model="form.IsEnable"
:active-value="true"
:inactive-value="false"
/>
</el-form-item>
</el-form>
</template>
<template slot="dialog-footer">
<el-button
:disabled="btnLoading"
size="small"
type="primary"
@click="handleCancle"
>
{{ $t('common:button:cancel') }}
</el-button>
<el-button
size="small"
type="primary"
:loading="btnLoading"
@click="handleSave"
>
{{ $t('common:button:save') }}
</el-button>
</template>
</BaseModel>
</div>
</template>
<script>
import { DownloadCommonDoc } from '@/api/dictionary'
import {
addDoctorCriterionFile,
deleteDoctorCriterionFile,
getDoctorCriterionFile,
} from '@/api/reviewers'
import BaseModel from '@/components/BaseModel'
export default {
name: 'agreement',
data() {
return {
faccept: ['.pdf'],
loading: false,
}
components: {
BaseModel,
},
methods: {
preview() {
this.$preview({
path: '',
type: '',
title: '',
})
props: {
DATA: {
type: Array,
default: () => {
return []
},
beginScanFiles(e) {
let files = e.target.files
},
reviewerId: {
type: String,
default: '',
},
isEN: {
type: Boolean,
default: false,
},
},
data() {
return {
faccept: ['.pdf'],
loading: false,
agreementList: [],
sowList: [],
ackSowList: [],
loading: false,
isOpen: false,
btnLoading: false,
model_cfg: {
visible: false,
showClose: true,
width: '600px',
title: '',
appendToBody: true,
},
form: {
Remark: null,
FileType: null,
FileName: null,
FilePath: null,
DoctorId: null,
CriterionType: null,
IsEnable: false,
},
rules: {
CriterionType: [
{
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: ['blur'],
},
],
FilePath: [
{
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: ['blur'],
},
],
},
fileList: [],
}
},
watch: {
reviewerId() {
if (this.reviewerId) {
this.initSowList()
}
},
},
computed: {
CounselorFiles() {
if (!this.DATA || this.DATA.length <= 0) return false
return this.DATA.filter(
(item) => item.Type && item.Type.indexOf('Consultant Agreement') >= 0
)
},
},
methods: {
preview() {
preview(row) {
this.$preview({
path: '',
type: '',
title: '',
path: row.FullPath,
type: 'pdf',
title: row.FileName,
})
},
beginScanFiles(e) {
let files = e.target.files
handleDownload(code) {
this.loading = true
DownloadCommonDoc(code)
.then((data) => {
this.loading = false
})
.catch(() => {
this.loading = false
})
},
handleEditCol(row, fileType, title) {
this.model_cfg.visible = true
this.form = Object.assign({}, row)
this.fileList[0] = { name: row.FileName, path: row.FilePath }
this.form.FileType = fileType
this.model_cfg.title = title
},
handleRemoveFile3(row) {
this.$confirm(
this.$t('dictionary:attachment:export:confirm:delete')
).then(() => {
deleteDoctorCriterionFile({
Id: row.Id,
}).then(() => {
this.initSowList()
this.$message.success(this.$t('common:message:deletedSuccessfully'))
})
})
},
handleRemoveFile2() {
this.form.FileName = null
this.form.FilePath = null
this.fileList = []
},
beforeUpload() {
if (this.fileList.length > 0) {
// this.$alert('')
this.$alert(this.$t('upload:rule:maxFile1'))
return
}
},
handlePreview3(row) {
if (row.FilePath) {
window.open(this.OSSclientConfig.basePath + row.FilePath, '_blank')
}
},
handlePreview2(row, r2) {
if (row.fullPath) {
window.open(this.OSSclientConfig.basePath + row.fullPath, '_blank')
}
},
async handleUploadFile(param) {
this.btnLoading = true
var fileName = param.file.name
let file = await this.fileToBlob(param.file)
let res = await this.OSSclient.put(
`/SystemData/reviewer/${
this.form.FileType === 0 ? '既往阅片情况声明' : '入项资格确认书'
}/${this.reviewerId}/${fileName}`,
file
)
this.form.FileName = param.file.name
this.form.FilePath = this.$getObjectName(res.url)
this.fileList[0] = {
name: this.$getObjectName(res.url),
path: this.$getObjectName(res.url),
fullPath: this.$getObjectName(res.url),
url: res.url,
}
this.btnLoading = false
},
handleCancle() {
this.model_cfg.visible = false
},
handleSave() {
this.$refs['DictionaryTypeConfigForm'].validate((valid) => {
if (!valid) return
this.form.DoctorId = this.reviewerId
this.form.CriterionName = this.$fd(
'CriterionType',
this.form.CriterionType
)
this.form.IsIRUpload = true
addDoctorCriterionFile(this.form).then((res) => {
this.$message.success('添加成功')
this.initSowList()
this.handleCancle()
})
})
},
addCol(fileType, title) {
this.model_cfg.visible = true
this.form = {
Remark: null,
FileType: null,
FileName: null,
FilePath: null,
DoctorId: null,
CriterionType: null,
IsEnable: false,
}
this.handleRemoveFile2()
this.form.FileType = fileType
this.model_cfg.title = title
},
initSowList() {
if (!this.reviewerId) return
getDoctorCriterionFile({
fileType: 0,
DoctorId: this.reviewerId,
}).then((res) => {
this.sowList = res.Result
})
getDoctorCriterionFile({
fileType: 1,
DoctorId: this.reviewerId,
}).then((res) => {
this.ackSowList = res.Result
})
},
},
}

View File

@ -6,117 +6,293 @@
<div class="file_title">
{{ $t('curriculumVitae:certificate:fileTitle:diploma') }}
</div>
<div class="file" v-if="true">
<div class="name">简历1</div>
<div class="file" v-if="diplomaFile">
<div class="name" :title="diplomaFile.FileName">
{{ diplomaFile.FileName }}
</div>
<i
class="el-icon-view"
:title="$t('common:button:preview')"
@click.stop="preview"
@click.stop="preview(diplomaFile)"
/>
<i
class="el-icon-delete"
:title="$t('common:button:delete')"
@click.stop="handleRemoveFile(diplomaFile)"
/>
<i class="el-icon-delete" :title="$t('common:button:delete')" />
</div>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<!--医师资格证-->
<div class="file_title" v-if="true">
<div class="file_title">
{{ $t('curriculumVitae:certificate:fileTitle:certificate') }}
</div>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<div class="file">
<div class="name">简历1</div>
<div class="file" v-if="certificateFile">
<div class="name" :title="certificateFile.FileName">
{{ certificateFile.FileName }}
</div>
<i
class="el-icon-view"
:title="$t('common:button:preview')"
@click.stop="preview"
@click.stop="preview(certificateFile)"
/>
<i
class="el-icon-delete"
:title="$t('common:button:delete')"
@click.stop="handleRemoveFile(certificateFile)"
/>
<i class="el-icon-delete" :title="$t('common:button:delete')" />
</div>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<!--医师执业证-->
<div class="file_title" v-if="true">
<div class="file_title">
{{ $t('curriculumVitae:certificate:fileTitle:license') }}
</div>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<div class="file">
<div class="name">简历1</div>
<div class="file" v-if="licenseFile">
<div class="name" :title="licenseFile.FileName">
{{ licenseFile.FileName }}
</div>
<i
class="el-icon-view"
:title="$t('common:button:preview')"
@click.stop="preview"
@click.stop="preview(licenseFile)"
/>
<i
class="el-icon-delete"
:title="$t('common:button:delete')"
@click.stop="handleRemoveFile(licenseFile)"
/>
<i class="el-icon-delete" :title="$t('common:button:delete')" />
</div>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<!--大型医用设备上岗证-->
<div class="file_title">
{{ $t('curriculumVitae:certificate:fileTitle:workPermit') }}
</div>
<template v-if="true">
<template v-if="workPermitFiles && workPermitFiles.length > 0">
<div class="file_title">
{{ $t('curriculumVitae:certificate:fileTitle:CT') }}
</div>
<div v-for="item in [1, 2]" :key="item">
<div v-for="item in workPermitFiles" :key="item.Id">
<div class="file">
<div class="name">简历1</div>
<div class="name" :title="item.FileName">{{ item.FileName }}</div>
<i
class="el-icon-view"
:title="$t('common:button:preview')"
@click.stop="preview"
@click.stop="preview(item)"
/>
<i
class="el-icon-delete"
:title="$t('common:button:delete')"
@click.stop="handleRemoveFile(item)"
/>
<i class="el-icon-delete" :title="$t('common:button:delete')" />
</div>
</div>
</template>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<div class="btnBox">
<div style="position: relative">
<div class="btnBox" style="margin-top: 10px">
<el-button
type="primary"
size="small"
:disabled="loading"
:loading="loading"
@click.stop="openBox"
>
{{ $t('curriculumVitae:certificate:btn:upload') }}
</el-button>
<input
type="file"
name="file"
multiple
ref="upload"
:title="$t('curriculumVitae:certificate:btn:upload')"
style="
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
"
:accept="faccept.join(',')"
@change="($event) => beginScanFiles($event)"
</div>
</div>
<base-model :config="model_cfg">
<template slot="dialog-body">
<div class="box">
<div class="clearfix">
<p style="line-height: 30px; font-size: 13px">
{{ $t('system:Credentials:title:Default Certificate') }}
</p>
<el-card class="e-card">
<p class="title">
{{
$t(
'system:Credentials:title:Diploma of the highest medical degree'
)
}}
</p>
<upload-file
:doctor-id="reviewerId"
type="Diploma of the highest medical degree"
@getFileList="$emit('getInfo')"
/>
</el-card>
<el-card class="e-card">
<p class="title">
{{
$t(
'system:Credentials:title:Medical Qualification Certificate'
)
}}
</p>
<upload-file
:doctor-id="reviewerId"
type="Medical Qualification Certificate"
@getFileList="$emit('getInfo')"
/>
</el-card>
<el-card class="e-card">
<p class="title">
{{ $t('system:Credentials:title:Practice License') }}
</p>
<upload-file
:doctor-id="reviewerId"
type="Practice License"
@getFileList="$emit('getInfo')"
/>
</el-card>
</div>
<div class="clearfix">
<p style="line-height: 30px; font-size: 13px">
{{ $t('system:Credentials:title:Modality Certificate') }}
</p>
<el-card class="e-card">
<p class="title">CT</p>
<upload-file
:doctor-id="reviewerId"
type="Modality Certificate(CT)"
@getFileList="$emit('getInfo')"
/>
</el-card>
<el-card class="e-card">
<p class="title">MRI</p>
<upload-file
:doctor-id="reviewerId"
type="Modality Certificate(MRI)"
@getFileList="$emit('getInfo')"
/>
</el-card>
<el-card class="e-card">
<p class="title">NM</p>
<upload-file
:doctor-id="reviewerId"
type="Modality Certificate(NM)"
@getFileList="$emit('getInfo')"
/>
</el-card>
<el-card class="e-card">
<p class="title">US</p>
<upload-file
:doctor-id="reviewerId"
type="Modality Certificate(US)"
@getFileList="$emit('getInfo')"
/>
</el-card>
</div>
</div>
</div>
</template>
<template slot="dialog-footer">
<el-button size="small" type="primary" @click="handleCancle">
{{ $t('common:button:confirm') }}
</el-button>
</template>
</base-model>
</div>
</template>
<script>
import PreviewFile from '@/components/PreviewFile/index'
import BaseModel from '@/components/BaseModel'
import UploadFile from '@/components/UploadFile'
import { deleteAttachment } from '@/api/attachment'
export default {
name: 'certificate',
components: {
PreviewFile,
BaseModel,
UploadFile,
},
props: {
DATA: {
type: Array,
default: () => {
return []
},
},
reviewerId: {
type: String,
default: '',
},
isEN: {
type: Boolean,
default: false,
},
},
data() {
return {
faccept: ['.pdf'],
loading: false,
model_cfg: {
visible: false,
showClose: true,
width: '800px',
title: this.$t('curriculumVitae:certificate:form:title'),
appendToBody: true,
},
}
},
computed: {
//
diplomaFile() {
if (!this.DATA || this.DATA.length <= 0) return false
return this.DATA.find(
(item) => item.Type === 'Diploma of the highest medical degree'
)
},
//
certificateFile() {
if (!this.DATA || this.DATA.length <= 0) return false
return this.DATA.find(
(item) => item.Type === 'Medical Qualification Certificate'
)
},
//
licenseFile() {
if (!this.DATA || this.DATA.length <= 0) return false
return this.DATA.find((item) => item.Type === 'Practice License')
},
//
workPermitFiles() {
if (!this.DATA || this.DATA.length <= 0) return false
return this.DATA.filter(
(item) => item.Type && item.Type.indexOf('Modality Certificate') >= 0
)
},
},
methods: {
preview() {
openBox() {
this.model_cfg.visible = true
},
handleCancle() {},
handleRemoveFile(row) {
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), {
type: 'warning',
distinguishCancelAndClose: true,
})
.then(() => {
deleteAttachment(row.Id, row.Path).then((res) => {
if (res.IsSuccess) {
this.$emit('getInfo')
this.$message({
message: this.$t('common:message:deletedSuccessfully'),
type: 'success',
})
}
})
})
.catch((action) => {})
},
preview(row) {
this.$preview({
path: '',
type: '',
title: '',
path: row.FullPath,
type: 'pdf',
title: row.FileName,
})
},
beginScanFiles(e) {
@ -126,4 +302,20 @@ export default {
}
</script>
<style lang="scss" scoped>
// ::v-deep .el-dialog__body {
// padding-top: 0;
// }
.box {
display: flex;
justify-content: space-between;
.clearfix {
width: 48%;
.e-card {
margin-bottom: 10px;
&:last-child {
margin-bottom: 0;
}
}
}
}
</style>

View File

@ -5,14 +5,23 @@
<div class="file_title">
{{ $t('curriculumVitae:curriculum:fileTitle:CN') }}
</div>
<template v-if="true">
<div class="file" v-for="item in [1, 2]" :key="item">
<div class="name">简历1</div>
<i class="el-icon-download" :title="$t('common:button:download')" />
<i class="el-icon-delete" :title="$t('common:button:delete')" />
<template v-if="resumeListCN.length > 0">
<div class="file" v-for="item in resumeListCN" :key="item.Id">
<div class="name" :title="item.FileName">{{ item.FileName }}</div>
<i
class="el-icon-circle-check"
class="el-icon-download"
:title="$t('common:button:download')"
@click.stop="handlePreview(item)"
/>
<i
class="el-icon-delete"
:title="$t('common:button:delete')"
@click.stop="handleRemoveFile(item)"
/>
<i
:class="{ 'el-icon-circle-check': true, disable: item.IsOfficial }"
:title="$t('common:button:default')"
@click.stop="handleSetOfiical(item)"
/>
</div>
</template>
@ -20,95 +29,289 @@
<div class="file_title">
{{ $t('curriculumVitae:curriculum:fileTitle:EN') }}
</div>
<template v-if="true">
<div class="file" v-for="item in [1, 2]" :key="item">
<div class="name">Resume</div>
<i class="el-icon-download" :title="$t('common:button:download')" />
<i class="el-icon-delete" :title="$t('common:button:delete')" />
<template v-if="resumeListEN.length > 0">
<div class="file" v-for="item in resumeListEN" :key="item">
<div class="name" :title="item.FileName">{{ item.FileName }}</div>
<i
class="el-icon-circle-check"
:title="$t('common:button:default')"
class="el-icon-download"
:title="$t('common:button:download')"
@click.stop="handlePreview(item)"
/>
<i
class="el-icon-delete"
:title="$t('common:button:delete')"
@click.stop="handleRemoveFile(item)"
/>
</div>
</template>
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<div class="btnBox">
<div style="position: relative">
<el-button
type="primary"
size="small"
:disabled="loading"
:loading="loading"
<div class="btnBox" style="margin-top: 20px">
<div class="uploadFile-container" style="margin-right: 10px">
<el-upload
class="upload-demo"
:data="{ language: 1 }"
action
:show-file-list="false"
:http-request="handleUploadFile"
:file-list="resumeList"
accept=".doc,.docx"
>
<el-button size="small" type="primary">
{{ $t('curriculumVitae:curriculum:btn:uploadCN') }}
</el-button>
<input
type="file"
name="file"
multiple
ref="uploadCN"
:title="$t('curriculumVitae:curriculum:btn:uploadCN')"
style="
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
"
:accept="faccept.join(',')"
@change="($event) => beginScanFiles($event)"
/>
</el-upload>
</div>
<el-button type="text">{{ $t('common:button:downloadTpl') }}</el-button>
<!-- <el-button
type="text"
@click.stop="handleDownload('Reviewer_resume_Template')"
>
{{ $t('common:button:downloadTpl') }}
</el-button> -->
</div>
<div class="btnBox">
<div style="position: relative">
<el-button
type="primary"
size="small"
:disabled="loading"
:loading="loading"
<div class="uploadFile-container" style="margin-right: 10px">
<el-upload
class="upload-demo"
:data="{ language: 2 }"
action
:show-file-list="false"
:http-request="handleUploadFile"
:file-list="resumeList"
accept=".doc,.docx"
>
<el-button size="small" type="primary">
{{ $t('curriculumVitae:curriculum:btn:uploadEN') }}
</el-button>
<input
type="file"
name="file"
multiple
ref="uploadEN"
:title="$t('curriculumVitae:curriculum:btn:uploadEN')"
style="
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
"
:accept="faccept.join(',')"
@change="($event) => beginScanFiles($event)"
/>
</el-upload>
</div>
<el-button type="text">{{ $t('common:button:downloadTpl') }}</el-button>
<!-- <el-button
type="text"
@click.stop="handleDownload('Reviewer_resume_Template')"
>
{{ $t('common:button:downloadTpl') }}
</el-button> -->
</div>
</div>
</div>
</template>
<script>
import {
getAttachmentByType,
saveAttachments,
deleteAttachment,
setOfficial,
setLanguageForResume,
} from '@/api/attachment'
import { DownloadCommonDoc } from '@/api/dictionary'
export default {
name: 'curriculum',
props: {
reviewerId: {
type: String,
default: '',
},
isEN: {
type: Boolean,
default: false,
},
},
data() {
return {
faccept: ['.pdf'],
loading: false,
resumeList: [],
resumeListEN: [],
resumeListCN: [],
language: 0,
dialogVisible: false,
currentRow: {},
repeat: false,
isDisabled: false,
}
},
watch: {
reviewerId() {
if (this.reviewerId) {
this.getResumeList()
}
},
},
methods: {
beginScanFiles(e) {
let files = e.target.files
handleDownload(code) {
this.loading = true
DownloadCommonDoc(code)
.then((data) => {
this.loading = false
})
.catch(() => {
this.loading = false
})
},
getResumeList() {
this.loading = true
getAttachmentByType(this.reviewerId, 'Resume')
.then((res) => {
if (res.IsSuccess) {
if (res.Result.length > 0) {
this.resumeList = res.Result
this.filterByLanguage()
}
}
this.loading = false
})
.catch(() => {
this.loading = false
})
},
handleUploadFile(param) {
this.repeat = false
// const fileName = param.file.name.substring(0, param.file.name.lastIndexOf('.'))
// const extension = param.file.name.substring(param.file.name.lastIndexOf('.'))
//
if (this.checkFileSuffix(param.file.name) > -1) {
//
const isRepeat = this.resumeList.some(
(item) => item.FileName === param.file.name
)
if (isRepeat) {
this.$confirm('Override the existing resume?', {
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
})
.then(() => {
//
this.repeat = true
this.uploadFile(param.file, param.data.language)
})
.catch((action) => {})
} else {
this.uploadFile(param.file, param.data.language)
}
} else {
this.$alert(`Must be in ${this.accept} format`)
}
},
async uploadFile(file, language) {
this.isDisabled = true
var fileName = file.name
var files = this.resumeList
file = await this.fileToBlob(file)
let res = await this.OSSclient.put(
`/SystemData/reviewer/Resume/${this.reviewerId}/${fileName}`,
file
)
if (this.repeat) {
const index = files.findIndex((item, index) => {
return item.FileName === fileName
})
files[index].Path = this.$getObjectName(res.url)
files[index].FullPath = this.$getObjectName(res.url)
files[index].ReUpload = true
files[index].Language = language
} else {
const fileData = {
DoctorId: this.reviewerId,
Type: 'Resume',
Path: this.$getObjectName(res.url),
FullPath: this.$getObjectName(res.url),
FileName: fileName,
Language: language,
}
files.push(fileData)
}
this.saveUploadFiles(files)
},
saveUploadFiles(files) {
saveAttachments(files)
.then((res) => {
this.resumeList = res.Result
this.filterByLanguage()
this.isDisabled = false
this.$message.success('Uploaded successfully')
})
.catch(() => {
this.isDisabled = false
})
},
filterByLanguage() {
this.resumeListEN = []
this.resumeListCN = []
this.resumeList.map((resume) => {
if (resume.Language === 2) {
this.resumeListEN.push(resume)
} else if (resume.Language === 1) {
this.resumeListCN.push(resume)
}
})
},
checkFileSuffix(fileName) {
const accept = '.doc, .docx'
var index = fileName.lastIndexOf('.')
var suffix = fileName
.substring(index + 1, fileName.length)
.toLocaleLowerCase()
return accept.search(suffix)
},
handlePreview(row) {
if (row.FullPath) {
window.open(this.OSSclientConfig.basePath + row.FullPath, '_blank')
}
},
handleRemoveFile(row) {
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), {
type: 'warning',
distinguishCancelAndClose: true,
})
.then(() => {
deleteAttachment(row.Id, row.Path).then((res) => {
if (res.IsSuccess) {
this.resumeList.splice(
this.resumeList.findIndex((item) => item.Id === row.Id),
1
)
this.filterByLanguage()
this.$message({
message: this.$t('common:message:deletedSuccessfully'),
type: 'success',
})
}
})
})
.catch((action) => {})
},
handleSetOfiical(row) {
if (row.IsOfficial) return false
setOfficial(this.reviewerId, row.Id, row.Language).then((res) => {
if (res.IsSuccess) {
this.getResumeList()
this.$message({
message: 'Saved successfully!',
type: 'success',
})
}
})
},
handleLanguageClick(row) {
this.dialogVisible = true
this.language = row.Language
this.currentRow = row
},
setResumeLanguage() {
setLanguageForResume(
this.reviewerId,
this.currentRow.Id,
this.language
).then((res) => {
if (res.IsSuccess) {
this.dialogVisible = false
this.getResumeList()
this.$message({
message: 'Saved successfully!',
type: 'success',
})
}
})
},
},
}

View File

@ -148,11 +148,21 @@
</div>
<div class="rightFile">
<!--简历附件-->
<curriculum />
<curriculum :isEN="isEN" :reviewerId.sync="reviewerId" />
<!--资历证书-->
<certificate />
<certificate
:DATA="reviewerData.AttachmentList"
:isEN="isEN"
:reviewerId.sync="reviewerId"
@getInfo="getDetail"
/>
<!--协议-->
<agreement />
<agreement
:DATA="reviewerData.AttachmentList"
:isEN="isEN"
:reviewerId.sync="reviewerId"
@getInfo="getDetail"
/>
</div>
</div>
<el-dialog :visible.sync="visible" fullscreen>
@ -227,15 +237,15 @@ export default {
async created() {
this.$i18n.locale = this.$route.query.lang
await this.setLanguage(this.$route.query.lang)
},
mounted() {
//
window.addEventListener('scroll', this.onScroll)
if (sessionStorage.getItem('reviewerId')) {
this.reviewerId = sessionStorage.getItem('reviewerId')
this.getDetail()
}
},
mounted() {
//
window.addEventListener('scroll', this.onScroll)
},
destroy() {
// vue
window.removeEventListener('scroll', this.onScroll)
@ -396,6 +406,10 @@ export default {
margin: 3px;
color: #409eff;
}
.disable {
cursor: not-allowed;
color: #909399;
}
}
}
</style>