diff --git a/src/api/reviewers.js b/src/api/reviewers.js index 9e6ed318..d840a2ca 100644 --- a/src/api/reviewers.js +++ b/src/api/reviewers.js @@ -334,4 +334,12 @@ export function doctorSendEmail(param) { method: 'post', data: param }) +} +// 获取医生是否休假 +export function getIsVacation(param) { + return request({ + url: `/Vacation/getIsVacation`, + method: 'post', + data: param + }) } \ No newline at end of file diff --git a/src/views/reviewers/components/Agreements.vue b/src/views/reviewers/components/Agreements.vue index 34501ae9..9a206336 100644 --- a/src/views/reviewers/components/Agreements.vue +++ b/src/views/reviewers/components/Agreements.vue @@ -257,6 +257,7 @@ :on-remove="handleRemoveFile2" :show-file-list="true" :limit="1" + accept=".pdf" :file-list="fileList" > {{ $t('common:button:upload') }} + {{ $t('system:tip:file:pdf') }} @@ -368,6 +370,7 @@ export default { ], }, fileList: [], + accept: '.pdf', } }, watch: { @@ -414,41 +417,66 @@ export default { this.form.FilePath = null this.fileList = [] }, - beforeUpload() { + beforeUpload(row) { if (this.fileList.length > 0) { this.$alert('最多只能传一个附件') return } + if (!this.checkFileSuffix(row.name)) { + this.$message.warning(`Must be in .pdf format`) + return false + } }, handlePreview3(row) { + return this.$preview({ + path: row.FilePath, + type: 'pdf', + title: row.FileName, + }) if (row.FilePath) { window.open(this.OSSclientConfig.basePath + row.FilePath, '_blank') } }, handlePreview2(row, r2) { + return this.$preview({ + path: row.fullPath, + type: 'pdf', + title: row.FileName, + }) 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.doctorId}/${fileName}`, - file + checkFileSuffix(fileName) { + var index = fileName.lastIndexOf('.') + var suffix = fileName.substring(index + 1, fileName.length) + return ( + this.accept.toLocaleLowerCase().search(suffix.toLocaleLowerCase()) === 1 ) - 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, + }, + async handleUploadFile(param) { + try { + 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.doctorId}/${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 + } catch (err) { + console.log(err) } - this.btnLoading = false }, handleCancle() { this.model_cfg.visible = false @@ -499,6 +527,12 @@ export default { }) }, handlePreview(row) { + console.log(row) + return this.$preview({ + path: row.FullPath, + type: 'pdf', + title: row.FileName, + }) if (row.FullPath) { window.open(this.OSSclientConfig.basePath + row.FullPath, '_blank') } diff --git a/src/views/reviewers/components/EducationTraining.vue b/src/views/reviewers/components/EducationTraining.vue index c88adcfb..4b69dd96 100644 --- a/src/views/reviewers/components/EducationTraining.vue +++ b/src/views/reviewers/components/EducationTraining.vue @@ -59,7 +59,7 @@ >