项目文档资质材料
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
1a4bfe64f9
commit
a060c1745d
|
@ -1265,3 +1265,51 @@ export function getTrialFileTypeFile(data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 项目文档-获取资质材料列表
|
||||||
|
export function getTrialAttachments(data) {
|
||||||
|
return request({
|
||||||
|
url: `/Attachment/getTrialAttachments`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 项目文档-修改资质材料稽查状态
|
||||||
|
export function setAuthorizedViewC(data) {
|
||||||
|
return request({
|
||||||
|
url: `/Attachment/setAuthorizedView`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 项目文档-上传资质材料
|
||||||
|
export function saveTrialAttachments(data) {
|
||||||
|
return request({
|
||||||
|
url: `/Attachment/saveTrialAttachments`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 项目文档-资质材料(获取医生列表)
|
||||||
|
export function getTrialDoctorListC(data) {
|
||||||
|
return request({
|
||||||
|
url: `/Attachment/getTrialDoctorList`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 项目文档-修改资质材料
|
||||||
|
export function updateTrialAttachments(data) {
|
||||||
|
return request({
|
||||||
|
url: `/Attachment/updateTrialAttachments`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 项目文档-删除资质材料
|
||||||
|
export function deleteAttachment(data) {
|
||||||
|
return request({
|
||||||
|
url: `/Attachment/deleteAttachment`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -361,11 +361,11 @@ export default {
|
||||||
var file = await this.fileToBlob(param.file)
|
var file = await this.fileToBlob(param.file)
|
||||||
let typeArr = ['', 'Report', 'Doc', 'Record', 'Reviewer', 'Template']
|
let typeArr = ['', 'Report', 'Doc', 'Record', 'Reviewer', 'Template']
|
||||||
let types = typeArr[this.ArchiveTypeEnum]
|
let types = typeArr[this.ArchiveTypeEnum]
|
||||||
// let fileNameNoType = param.file.name
|
let fileNameNoType = param.file.name
|
||||||
// .substring(0, param.file.name.lastIndexOf('.'))
|
.substring(0, param.file.name.lastIndexOf('.'))
|
||||||
// .toLocaleLowerCase()
|
.toLocaleLowerCase()
|
||||||
const res = await this.OSSclient.put(
|
const res = await this.OSSclient.put(
|
||||||
`/${trialId}/Document/${types}/${this.$guid()}${extendName}`,
|
`/${trialId}/Document/${types}/${fileNameNoType}${extendName}`,
|
||||||
file
|
file
|
||||||
)
|
)
|
||||||
this.form[`${key}FileRecord`] = {
|
this.form[`${key}FileRecord`] = {
|
||||||
|
|
|
@ -249,11 +249,11 @@ export default {
|
||||||
var file = await this.fileToBlob(param.file)
|
var file = await this.fileToBlob(param.file)
|
||||||
let typeArr = ['', 'Report', 'Doc', 'Record', 'Reviewer', 'Template']
|
let typeArr = ['', 'Report', 'Doc', 'Record', 'Reviewer', 'Template']
|
||||||
let types = typeArr[this.ArchiveTypeEnum]
|
let types = typeArr[this.ArchiveTypeEnum]
|
||||||
// let fileNameNoType = param.file.name
|
let fileNameNoType = param.file.name
|
||||||
// .substring(0, param.file.name.lastIndexOf('.'))
|
.substring(0, param.file.name.lastIndexOf('.'))
|
||||||
// .toLocaleLowerCase()
|
.toLocaleLowerCase()
|
||||||
const res = await this.OSSclient.put(
|
const res = await this.OSSclient.put(
|
||||||
`/${trialId}/Document/${types}/${this.$guid()}${extendName}`,
|
`/${trialId}/Document/${types}/${fileNameNoType}${extendName}`,
|
||||||
file
|
file
|
||||||
)
|
)
|
||||||
this.form[`${key}FileRecord`] = {
|
this.form[`${key}FileRecord`] = {
|
||||||
|
|
|
@ -376,7 +376,7 @@
|
||||||
v-if="hasDownLoad && isManage && !viewStatus"
|
v-if="hasDownLoad && isManage && !viewStatus"
|
||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
:title="
|
:title="
|
||||||
$t('trials:trialDocument:trainRecord:button:downLoadFileFileFile')
|
$t('trials:trialDocument:trainRecord:button:downLoadFile')
|
||||||
"
|
"
|
||||||
circle
|
circle
|
||||||
:disabled="
|
:disabled="
|
||||||
|
|
|
@ -335,10 +335,10 @@ export default {
|
||||||
let fileType = file.name
|
let fileType = file.name
|
||||||
.substring(file.name.lastIndexOf('.'))
|
.substring(file.name.lastIndexOf('.'))
|
||||||
.toLocaleLowerCase()
|
.toLocaleLowerCase()
|
||||||
// let fileName = file.name
|
let fileName = file.name
|
||||||
// .substring(0, file.name.lastIndexOf('.'))
|
.substring(0, file.name.lastIndexOf('.'))
|
||||||
// .toLocaleLowerCase()
|
.toLocaleLowerCase()
|
||||||
let path = `${this.uploadPath}/${this.$guid()}${fileType}`
|
let path = `${this.uploadPath}/${fileName}${fileType}`
|
||||||
file.curPath = path
|
file.curPath = path
|
||||||
const fileData = await this.fileToBlob(file.file)
|
const fileData = await this.fileToBlob(file.file)
|
||||||
let res = await this.fileToOss(path, fileData, file)
|
let res = await this.fileToOss(path, fileData, file)
|
||||||
|
|
|
@ -0,0 +1,253 @@
|
||||||
|
<template>
|
||||||
|
<base-model :config="config">
|
||||||
|
<div slot="dialog-body">
|
||||||
|
<el-form
|
||||||
|
ref="certificateForm"
|
||||||
|
:model="form"
|
||||||
|
label-width="140px"
|
||||||
|
size="small"
|
||||||
|
:rules="rules"
|
||||||
|
>
|
||||||
|
<div class="base-dialog-body">
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:trialDocument:certificate:form:fileType')"
|
||||||
|
prop="Type"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
v-model="form.Type"
|
||||||
|
placeholder=""
|
||||||
|
clearable
|
||||||
|
:disabled="config.status === 'edit' && !!this.data.Type"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in $d.CertificateFileType"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:trialDocument:certificate:form:DoctorId')"
|
||||||
|
prop="DoctorId"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
v-model="form.DoctorId"
|
||||||
|
placeholder=""
|
||||||
|
clearable
|
||||||
|
:disabled="config.status === 'edit' && !!this.data.DoctorId"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in doctorList"
|
||||||
|
:key="item.Id"
|
||||||
|
:label="item.FullName"
|
||||||
|
:value="item.Id"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:trialDocument:certificate:form:pdfFileRecord')"
|
||||||
|
prop="Path"
|
||||||
|
>
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
action
|
||||||
|
:before-upload="(param) => beforeUpload(param, '.pdf')"
|
||||||
|
:http-request="handleUploadFile"
|
||||||
|
:on-remove="handleRemoveFile"
|
||||||
|
:limit="1"
|
||||||
|
accept=".pdf"
|
||||||
|
:file-list="PDFFile"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary" :disabled="!!form.Path"
|
||||||
|
>{{ $t('common:button:upload') }}
|
||||||
|
</el-button>
|
||||||
|
<span slot="tip" class="el-upload__tip">
|
||||||
|
{{ $t('trials:trialDocument:certificate:rule:mustPDF') }}
|
||||||
|
</span>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div slot="dialog-footer">
|
||||||
|
<el-button size="small" @click="canel">
|
||||||
|
{{ $t('trials:trialDocument:certificate:button:canel') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button size="small" type="primary" :loading="loading" @click="save">
|
||||||
|
{{ $t('trials:trialDocument:certificate:button:save') }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</base-model>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import baseModel from '@/components/BaseModel'
|
||||||
|
import { saveTrialAttachments, updateTrialAttachments } from '@/api/dictionary'
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
config: {
|
||||||
|
required: true,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
required: true,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ArchiveTypeEnum: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
doctorList: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
'base-model': baseModel,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
Type: null,
|
||||||
|
DoctorId: null,
|
||||||
|
FileName: null,
|
||||||
|
Path: null,
|
||||||
|
FullPath: null,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
Type: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('common:ruleMessage:select'),
|
||||||
|
trigger: ['blur', 'change'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
DoctorId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('common:ruleMessage:select'),
|
||||||
|
trigger: ['blur', 'change'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
Path: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (!this.form.Path) {
|
||||||
|
callback(
|
||||||
|
new Error(
|
||||||
|
this.$t('trials:trialDocument:certificate:msg:noFile')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// message: this.$t('common:ruleMessage:specify'),
|
||||||
|
trigger: ['blur', 'change'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
loading: false,
|
||||||
|
PDFFile: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.config.status === 'edit') {
|
||||||
|
Object.keys(this.form).forEach((key) => {
|
||||||
|
this.form[key] = this.data[key]
|
||||||
|
})
|
||||||
|
if (this.form.Path) {
|
||||||
|
this.PDFFile = []
|
||||||
|
this.PDFFile.push({
|
||||||
|
name: this.form.FileName,
|
||||||
|
url: this.form.Path,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async save() {
|
||||||
|
try {
|
||||||
|
let validate = await this.$refs.certificateForm.validate()
|
||||||
|
if (!validate) return false
|
||||||
|
this.loading = true
|
||||||
|
this.form.TrialId = this.$route.query.trialId
|
||||||
|
let res = null
|
||||||
|
if (this.config.status === 'edit') {
|
||||||
|
this.form.Id = this.data.Id
|
||||||
|
res = await updateTrialAttachments(this.form)
|
||||||
|
} else {
|
||||||
|
res = await saveTrialAttachments([this.form])
|
||||||
|
}
|
||||||
|
if (res.IsSuccess) {
|
||||||
|
this.$emit('close')
|
||||||
|
this.$emit('getList')
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
canel() {
|
||||||
|
this.$emit('close')
|
||||||
|
},
|
||||||
|
handleRemoveFile() {
|
||||||
|
this.form.Path = null
|
||||||
|
this.form.FileName = null
|
||||||
|
this.form.FullPath = null
|
||||||
|
this.PDFFile = []
|
||||||
|
},
|
||||||
|
beforeUpload(param, accept) {
|
||||||
|
if (this.PDFFile && this.PDFFile[0]) {
|
||||||
|
this.$alert(
|
||||||
|
this.$t('trials:trialDocument:certificate:msg:hasFile')
|
||||||
|
).catch()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let extendName = param.name
|
||||||
|
.substring(param.name.lastIndexOf('.'))
|
||||||
|
.toLocaleLowerCase()
|
||||||
|
if (accept !== extendName) {
|
||||||
|
this.$alert(
|
||||||
|
this.$t('trials:trialDocument:certificate:msg:typeErr')
|
||||||
|
).catch()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleUploadFile(param) {
|
||||||
|
let trialId = this.$route.query.trialId
|
||||||
|
let extendName = param.file.name
|
||||||
|
.substring(param.file.name.lastIndexOf('.'))
|
||||||
|
.toLocaleLowerCase()
|
||||||
|
if (!trialId)
|
||||||
|
return this.$alert(
|
||||||
|
this.$t('trials:trialDocument:certificate:msg:noTrialId')
|
||||||
|
).catch()
|
||||||
|
this.loading = true
|
||||||
|
var file = await this.fileToBlob(param.file)
|
||||||
|
let typeArr = ['', 'Report', 'Doc', 'Record', 'Reviewer', 'Template']
|
||||||
|
let types = typeArr[this.ArchiveTypeEnum]
|
||||||
|
let fileNameNoType = param.file.name
|
||||||
|
.substring(0, param.file.name.lastIndexOf('.'))
|
||||||
|
.toLocaleLowerCase()
|
||||||
|
const res = await this.OSSclient.put(
|
||||||
|
`/${trialId}/Document/${types}/${fileNameNoType}${extendName}`,
|
||||||
|
file
|
||||||
|
)
|
||||||
|
this.form.Path = this.$getObjectName(res.url)
|
||||||
|
this.form.FullPath = this.$getObjectName(res.url)
|
||||||
|
this.form.FileName = param.file.name
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -11,7 +11,7 @@
|
||||||
:label="$t('trials:trialDocument:certificate:search:fileType')"
|
:label="$t('trials:trialDocument:certificate:search:fileType')"
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchData.IsAuthorizedView"
|
v-model="searchData.Type"
|
||||||
style="width: 100px"
|
style="width: 100px"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
clearable
|
clearable
|
||||||
|
@ -40,16 +40,16 @@
|
||||||
:label="$t('trials:trialDocument:certificate:search:viewer')"
|
:label="$t('trials:trialDocument:certificate:search:viewer')"
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchData.IsAuthorizedView"
|
v-model="searchData.DoctorId"
|
||||||
style="width: 100px"
|
style="width: 100px"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in $d.CertificateFileType"
|
v-for="item in doctorList"
|
||||||
:key="item.id"
|
:key="item.Id"
|
||||||
:label="item.label"
|
:label="item.FullName"
|
||||||
:value="item.value"
|
:value="item.Id"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
@ -131,6 +131,7 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
:disabled="selectTable.length <= 0"
|
:disabled="selectTable.length <= 0"
|
||||||
v-if="hasDel && isManage && !viewStatus"
|
v-if="hasDel && isManage && !viewStatus"
|
||||||
|
@click.stop="handleDel"
|
||||||
>
|
>
|
||||||
{{ $t('trials:trialDocument:certificate:button:del') }}
|
{{ $t('trials:trialDocument:certificate:button:del') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -157,24 +158,34 @@
|
||||||
|
|
||||||
<!--文件类型-->
|
<!--文件类型-->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="FileName"
|
prop="type"
|
||||||
:label="$t('trials:trialDocument:certificate:table:fileType')"
|
:label="$t('trials:trialDocument:certificate:table:fileType')"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
sortable="custom"
|
sortable="custom"
|
||||||
/>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ $fd('CertificateFileType', scope.row.Type) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<!--文件名称-->
|
<!--文件名称-->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="HistoryFileRecord"
|
prop="FileName"
|
||||||
:label="$t('trials:trialDocument:certificate:table:FileName')"
|
:label="$t('trials:trialDocument:certificate:table:FileName')"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
|
sortable="custom"
|
||||||
/>
|
/>
|
||||||
<!--阅片人-->
|
<!--阅片人-->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="HistoryFileRecord"
|
prop="UserName"
|
||||||
:label="$t('trials:trialDocument:certificate:table:viewer')"
|
:label="$t('trials:trialDocument:certificate:table:viewer')"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
/>
|
sortable="custom"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.UserName }} ({{ scope.row.FullName }})</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="IsAuthorizedView"
|
prop="IsAuthorizedView"
|
||||||
:label="$t('trials:trialDocument:certificate:table:isAuthorizedView')"
|
:label="$t('trials:trialDocument:certificate:table:isAuthorizedView')"
|
||||||
|
@ -184,7 +195,7 @@
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
:disabled="!scope.row.TrianingDate"
|
:disabled="!scope.row.DoctorId"
|
||||||
v-if="isManage && !viewStatus && hasEdit"
|
v-if="isManage && !viewStatus && hasEdit"
|
||||||
v-model="scope.row.IsAuthorizedView"
|
v-model="scope.row.IsAuthorizedView"
|
||||||
@change="(val) => auth(false, scope.row, val)"
|
@change="(val) => auth(false, scope.row, val)"
|
||||||
|
@ -215,10 +226,7 @@
|
||||||
icon="el-icon-view"
|
icon="el-icon-view"
|
||||||
:title="$t('common:button:view')"
|
:title="$t('common:button:view')"
|
||||||
circle
|
circle
|
||||||
:disabled="
|
@click.stop="preview(scope.row)"
|
||||||
!scope.row.TrialFileRecord || !scope.row.TrialFileRecord.FilePath
|
|
||||||
"
|
|
||||||
@click.stop="preview(scope.row.TrialFileRecord)"
|
|
||||||
/>
|
/>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="hasEdit && isManage && !viewStatus"
|
v-if="hasEdit && isManage && !viewStatus"
|
||||||
|
@ -230,18 +238,16 @@
|
||||||
<el-button
|
<el-button
|
||||||
v-if="hasDownLoad && isManage && !viewStatus"
|
v-if="hasDownLoad && isManage && !viewStatus"
|
||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
:title="
|
:title="$t('trials:trialDocument:certificate:button:downLoadFile')"
|
||||||
$t('trials:trialDocument:certificate:button:downLoadFileFileFile')
|
|
||||||
"
|
|
||||||
circle
|
circle
|
||||||
@click.stop="downLoad(false, scope.row.TrialFileRecord, 'file')"
|
@click.stop="downLoad(scope.row, 'file')"
|
||||||
/>
|
/>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="hasDel && isManage && !viewStatus"
|
v-if="hasDel && isManage && !viewStatus"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
:title="$t('trials:trialDocument:certificate:button:delete')"
|
:title="$t('trials:trialDocument:certificate:button:delete')"
|
||||||
circle
|
circle
|
||||||
@click.stop="handleDel(scope.row)"
|
@click.stop="handleDel(scope.row, false)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -266,9 +272,9 @@
|
||||||
/>
|
/>
|
||||||
<certificate-form
|
<certificate-form
|
||||||
:ArchiveTypeEnum="ArchiveTypeEnum"
|
:ArchiveTypeEnum="ArchiveTypeEnum"
|
||||||
:rowData="rowData"
|
|
||||||
:config="update_config"
|
:config="update_config"
|
||||||
:data="selectData"
|
:data="selectData"
|
||||||
|
:doctorList="doctorList"
|
||||||
v-if="update_config.visible"
|
v-if="update_config.visible"
|
||||||
@close="updateClose"
|
@close="updateClose"
|
||||||
@getList="getList"
|
@getList="getList"
|
||||||
|
@ -277,12 +283,11 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
addOrUpdateTrialFileType,
|
getTrialAttachments,
|
||||||
getTrialTrianingRecordList,
|
setAuthorizedViewC,
|
||||||
deleteTrialTrianingRecord,
|
saveTrialAttachments,
|
||||||
authorizedTrialTrianingRecord,
|
getTrialDoctorListC,
|
||||||
addOrUpdateTrialTrianingRecord,
|
deleteAttachment,
|
||||||
batchAddTrialTrianingRecord,
|
|
||||||
} from '@/api/dictionary'
|
} from '@/api/dictionary'
|
||||||
import { downLoadFile } from '@/utils/stream.js'
|
import { downLoadFile } from '@/utils/stream.js'
|
||||||
import { deepClone } from '@/utils/index.js'
|
import { deepClone } from '@/utils/index.js'
|
||||||
|
@ -294,14 +299,12 @@ const searchDataDefault = () => {
|
||||||
return {
|
return {
|
||||||
IsAuthorizedView: null,
|
IsAuthorizedView: null,
|
||||||
FileName: null,
|
FileName: null,
|
||||||
TrianingDateStartTime: null,
|
DoctorId: null,
|
||||||
TrianingDateEndTime: null,
|
Type: null,
|
||||||
UpdateStartTime: null,
|
|
||||||
UpdateEndTime: null,
|
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 20,
|
PageSize: 20,
|
||||||
Asc: false,
|
Asc: false,
|
||||||
SortField: 'TrianingDate',
|
SortField: 'UserName',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
|
@ -329,8 +332,6 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
rowBtnStatus: 'edit', // edit 编辑 save 保存
|
|
||||||
rowBtnLoading: false,
|
|
||||||
searchData: searchDataDefault(),
|
searchData: searchDataDefault(),
|
||||||
loading: false,
|
loading: false,
|
||||||
list: [],
|
list: [],
|
||||||
|
@ -349,8 +350,6 @@ export default {
|
||||||
faccept: ['.pdf'],
|
faccept: ['.pdf'],
|
||||||
limitLength: 0,
|
limitLength: 0,
|
||||||
|
|
||||||
TrianingDate: [],
|
|
||||||
UpdateTime: [],
|
|
||||||
update_config: {
|
update_config: {
|
||||||
visible: false,
|
visible: false,
|
||||||
showClose: true,
|
showClose: true,
|
||||||
|
@ -361,6 +360,7 @@ export default {
|
||||||
upload: null,
|
upload: null,
|
||||||
},
|
},
|
||||||
DATA: {},
|
DATA: {},
|
||||||
|
doctorList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -373,21 +373,16 @@ export default {
|
||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
TrialId: this.$route.query.trialId,
|
TrialId: this.$route.query.trialId,
|
||||||
TrialFileTypeId: this.Id,
|
FileName: item.FileName,
|
||||||
IsAuthorizedView: false,
|
Path: item.FilePath,
|
||||||
TrialFileRecord: item,
|
FullPath: item.FilePath,
|
||||||
HistoryFileRecord: null,
|
type: '',
|
||||||
Note: null,
|
DoctorId: null,
|
||||||
TrianingCount: null,
|
|
||||||
TrianingDate: null,
|
|
||||||
TrianingState: null,
|
|
||||||
}
|
}
|
||||||
arr.push(obj)
|
arr.push(obj)
|
||||||
})
|
})
|
||||||
this.loading = true
|
this.loading = true
|
||||||
let res = await batchAddTrialTrianingRecord({
|
let res = await saveTrialAttachments(arr)
|
||||||
TrianingRecordList: arr,
|
|
||||||
})
|
|
||||||
this.loading = false
|
this.loading = false
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
@ -397,18 +392,6 @@ export default {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 上传单个文件
|
|
||||||
upload(row, key) {
|
|
||||||
this.selectData = deepClone(row)
|
|
||||||
this.update_config.title = `${this.$t(
|
|
||||||
'trials:trialDocument:certificate:form:title:upload'
|
|
||||||
)}
|
|
||||||
-
|
|
||||||
${this.isEN ? this.rowData.Name : this.rowData.NameCN}`
|
|
||||||
this.update_config.status = 'edit'
|
|
||||||
this.update_config.upload = key
|
|
||||||
this.update_config.visible = true
|
|
||||||
},
|
|
||||||
// 新增
|
// 新增
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.selectData = {}
|
this.selectData = {}
|
||||||
|
@ -433,41 +416,16 @@ export default {
|
||||||
this.update_config.upload = null
|
this.update_config.upload = null
|
||||||
this.update_config.visible = true
|
this.update_config.visible = true
|
||||||
},
|
},
|
||||||
// 删除文件
|
|
||||||
async delFile(row, key) {
|
|
||||||
try {
|
|
||||||
let confirm = await this.$confirm(
|
|
||||||
this.$t('trials:trialDocument:certificate:message:deleteFile'),
|
|
||||||
{
|
|
||||||
type: 'warning',
|
|
||||||
distinguishCancelAndClose: true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (confirm !== 'confirm') return false
|
|
||||||
let data = deepClone(row)
|
|
||||||
data[`${key}FileRecord`] = null
|
|
||||||
this.loading = true
|
|
||||||
let res = await addOrUpdateTrialTrianingRecord(data)
|
|
||||||
this.loading = false
|
|
||||||
if (res.IsSuccess) {
|
|
||||||
this.$message.success(this.$t('common:message:deletedSuccessfully'))
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
this.loading = false
|
|
||||||
console.log(err)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 下载
|
// 下载
|
||||||
async downLoad(isArray = true, row, type = 'zip') {
|
async downLoad(row, type = 'zip') {
|
||||||
try {
|
try {
|
||||||
if (type === 'file') {
|
if (type === 'file') {
|
||||||
return await downLoadFile(
|
return await downLoadFile(
|
||||||
this.OSSclientConfig.basePath + row.FilePath,
|
this.OSSclientConfig.basePath + row.Path,
|
||||||
row.FileName
|
row.FileName
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
let { files, name } = this.formatDownloadFile(isArray, row)
|
let { files, name } = this.formatDownloadFile()
|
||||||
let res = await downLoadFile(files, name, type)
|
let res = await downLoadFile(files, name, type)
|
||||||
// if (res && this.downloadId) {
|
// if (res && this.downloadId) {
|
||||||
// this.downloadImageSuccess()
|
// this.downloadImageSuccess()
|
||||||
|
@ -477,52 +435,28 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 格式化下载文件路径
|
// 格式化下载文件路径
|
||||||
formatDownloadFile(isArray = true, row) {
|
formatDownloadFile() {
|
||||||
let files = [],
|
let files = [],
|
||||||
name = `${this.TITLE}_${new Date().getTime()}.zip`,
|
name = `${this.TITLE}_${new Date().getTime()}.zip`
|
||||||
arr = ['Trial', 'History']
|
|
||||||
if (!isArray) {
|
this.selectTable.forEach((item) => {
|
||||||
name = `${row.Name}_${row.Version}_${new Date().getTime()}.zip`
|
let obj = {
|
||||||
arr.forEach((key) => {
|
name: `${item.UserName} (${item.LastName}_${
|
||||||
if (row[`${key}FileRecord`] && row[`${key}FileRecord`].FilePath) {
|
item.FirstName
|
||||||
let obj = {
|
})/${this.$fd(
|
||||||
name: `${row[`${key}FileRecord`].FileName.substring(
|
'CertificateFileType',
|
||||||
0,
|
item.Type
|
||||||
row[`${key}FileRecord`].FileName.lastIndexOf('.')
|
)}_${item.FileName.substring(
|
||||||
)}__${row.Version}${row[`${key}FileRecord`].FileName.substring(
|
0,
|
||||||
row[`${key}FileRecord`].FileName.lastIndexOf('.')
|
item.FileName.lastIndexOf('.')
|
||||||
).toLocaleLowerCase()}`,
|
)}__${new Date().getTime()}${item.FileName.substring(
|
||||||
url:
|
item.FileName.lastIndexOf('.')
|
||||||
this.OSSclientConfig.basePath +
|
).toLocaleLowerCase()}`,
|
||||||
row[`${key}FileRecord`].FilePath,
|
url: this.OSSclientConfig.basePath + item.Path,
|
||||||
}
|
}
|
||||||
files.push(obj)
|
files.push(obj)
|
||||||
}
|
})
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.selectTable.forEach((item) => {
|
|
||||||
arr.forEach((key) => {
|
|
||||||
if (item[`${key}FileRecord`] && item[`${key}FileRecord`].FilePath) {
|
|
||||||
let obj = {
|
|
||||||
name: `${item.TrianingDate}_${item[
|
|
||||||
`${key}FileRecord`
|
|
||||||
].FileName.substring(
|
|
||||||
0,
|
|
||||||
item[`${key}FileRecord`].FileName.lastIndexOf('.')
|
|
||||||
)}__${new Date().getTime()}${item[
|
|
||||||
`${key}FileRecord`
|
|
||||||
].FileName.substring(
|
|
||||||
item[`${key}FileRecord`].FileName.lastIndexOf('.')
|
|
||||||
).toLocaleLowerCase()}`,
|
|
||||||
url:
|
|
||||||
this.OSSclientConfig.basePath +
|
|
||||||
item[`${key}FileRecord`].FilePath,
|
|
||||||
}
|
|
||||||
files.push(obj)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return { files, name }
|
return { files, name }
|
||||||
},
|
},
|
||||||
// 授权
|
// 授权
|
||||||
|
@ -530,12 +464,10 @@ export default {
|
||||||
try {
|
try {
|
||||||
let data = {}
|
let data = {}
|
||||||
if (isArray) {
|
if (isArray) {
|
||||||
let flag = this.selectTable.some((item) => !item.TrianingDate)
|
let flag = this.selectTable.some((item) => !item.DoctorId)
|
||||||
if (flag)
|
if (flag)
|
||||||
return this.$message.warning(
|
return this.$message.warning(
|
||||||
this.$t(
|
this.$t('trials:trialDocument:certificate:message:hsaNoDoctorId')
|
||||||
'trials:trialDocument:certificate:message:hsaNoTrianingDate'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
data = {
|
data = {
|
||||||
Ids: this.selectTable.map((item) => item.Id),
|
Ids: this.selectTable.map((item) => item.Id),
|
||||||
|
@ -548,7 +480,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
let res = await authorizedTrialTrianingRecord(data)
|
let res = await setAuthorizedViewC(data)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
this.$t('trials:trialDocument:certificate:message:authSuccessfully')
|
this.$t('trials:trialDocument:certificate:message:authSuccessfully')
|
||||||
|
@ -565,7 +497,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 删除列表数据
|
// 删除列表数据
|
||||||
handleDel(row) {
|
handleDel(row, isArray = true) {
|
||||||
this.$confirm(
|
this.$confirm(
|
||||||
this.$t('trials:trialDocument:certificate:message:deleteMessage'),
|
this.$t('trials:trialDocument:certificate:message:deleteMessage'),
|
||||||
{
|
{
|
||||||
|
@ -575,7 +507,13 @@ export default {
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
deleteTrialTrianingRecord(row.Id)
|
let data = {}
|
||||||
|
if (isArray) {
|
||||||
|
data.Ids = this.selectTable.map((item) => item.Id)
|
||||||
|
} else {
|
||||||
|
data.Ids = [row.Id]
|
||||||
|
}
|
||||||
|
deleteAttachment(data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
|
@ -595,30 +533,30 @@ export default {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 获取医生列表
|
||||||
|
async getTrialDoctorList() {
|
||||||
|
try {
|
||||||
|
let data = {
|
||||||
|
TrialId: this.$route.query.trialId,
|
||||||
|
}
|
||||||
|
let res = await getTrialDoctorListC(data)
|
||||||
|
if (res.IsSuccess) {
|
||||||
|
this.doctorList = res.Result
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
},
|
||||||
async getList() {
|
async getList() {
|
||||||
try {
|
try {
|
||||||
if (!this.Id) return false
|
if (!this.Id) return false
|
||||||
this.searchData.TrialFileTypeId = this.Id
|
// this.searchData.TrialFileTypeId = this.Id
|
||||||
this.searchData.TrialId = this.$route.query.trialId
|
this.searchData.TrialId = this.$route.query.trialId
|
||||||
if (this.viewStatus) {
|
if (this.viewStatus) {
|
||||||
this.searchData.IsAuthorizedView = true
|
this.searchData.IsAuthorizedView = true
|
||||||
}
|
}
|
||||||
if (this.TrianingDate && this.TrianingDate.length >= 2) {
|
|
||||||
this.searchData.TrianingDateStartTime = this.TrianingDate[0]
|
|
||||||
this.searchData.TrianingDateEndTime = this.TrianingDate[1]
|
|
||||||
} else {
|
|
||||||
this.searchData.TrianingDateStartTime = null
|
|
||||||
this.searchData.TrianingDateEndTime = null
|
|
||||||
}
|
|
||||||
if (this.UpdateTime && this.UpdateTime.length >= 2) {
|
|
||||||
this.searchData.UpdateStartTime = this.UpdateTime[0]
|
|
||||||
this.searchData.UpdateEndTime = this.UpdateTime[1]
|
|
||||||
} else {
|
|
||||||
this.searchData.UpdateStartTime = null
|
|
||||||
this.searchData.UpdateEndTime = null
|
|
||||||
}
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
let res = await getTrialTrianingRecordList(this.searchData)
|
let res = await getTrialAttachments(this.searchData)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
this.list = res.Result.CurrentPageData
|
this.list = res.Result.CurrentPageData
|
||||||
|
@ -637,8 +575,6 @@ export default {
|
||||||
// 重置
|
// 重置
|
||||||
handleReset() {
|
handleReset() {
|
||||||
this.searchData = searchDataDefault()
|
this.searchData = searchDataDefault()
|
||||||
this.TrianingDate = []
|
|
||||||
this.UpdateTime = []
|
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
// 排序
|
// 排序
|
||||||
|
@ -655,27 +591,11 @@ export default {
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
this.selectTable = val
|
this.selectTable = val
|
||||||
},
|
},
|
||||||
// 保存菜单数据
|
|
||||||
async saveRowData() {
|
|
||||||
try {
|
|
||||||
this.rowBtnLoading = true
|
|
||||||
let res = await addOrUpdateTrialFileType(this.DATA)
|
|
||||||
this.rowBtnLoading = false
|
|
||||||
if (res.IsSuccess) {
|
|
||||||
this.rowBtnStatus = 'edit'
|
|
||||||
this.$emit('getMenu')
|
|
||||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err)
|
|
||||||
this.rowBtnLoading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 预览
|
// 预览
|
||||||
preview(row) {
|
preview(row) {
|
||||||
if (!row.FilePath) return false
|
if (!row.Path) return false
|
||||||
this.$preview({
|
this.$preview({
|
||||||
path: row.FilePath || row.fullPath,
|
path: row.FilePath || row.fullPath || row.Path,
|
||||||
type: 'pdf',
|
type: 'pdf',
|
||||||
title: row.FileName,
|
title: row.FileName,
|
||||||
})
|
})
|
||||||
|
@ -696,7 +616,6 @@ export default {
|
||||||
},
|
},
|
||||||
openFile(isFolder = false) {
|
openFile(isFolder = false) {
|
||||||
this.selectData = {}
|
this.selectData = {}
|
||||||
this.selectKey = null
|
|
||||||
this.faccept = ['.pdf']
|
this.faccept = ['.pdf']
|
||||||
this.limitLength = 0
|
this.limitLength = 0
|
||||||
this.config.title = this.$t(
|
this.config.title = this.$t(
|
||||||
|
@ -709,7 +628,6 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
Id: {
|
Id: {
|
||||||
handler() {
|
handler() {
|
||||||
this.rowBtnStatus = 'edit'
|
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
@ -725,6 +643,7 @@ export default {
|
||||||
let typeArr = ['', 'Report', 'Doc', 'Record', 'Reviewer', 'Template']
|
let typeArr = ['', 'Report', 'Doc', 'Record', 'Reviewer', 'Template']
|
||||||
let types = typeArr[this.ArchiveTypeEnum]
|
let types = typeArr[this.ArchiveTypeEnum]
|
||||||
this.uploadPath = `/${this.$route.query.trialId}/Document/${types}`
|
this.uploadPath = `/${this.$route.query.trialId}/Document/${types}`
|
||||||
|
this.getTrialDoctorList()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isEN() {
|
isEN() {
|
||||||
|
|
|
@ -74,13 +74,13 @@
|
||||||
:rowData="rowData"
|
:rowData="rowData"
|
||||||
/>
|
/>
|
||||||
<!--阅片人资质材料-->
|
<!--阅片人资质材料-->
|
||||||
<!-- <certificate
|
<certificate
|
||||||
v-if="[8].includes(SubIdentificationEnum)"
|
v-if="[8].includes(SubIdentificationEnum)"
|
||||||
:ArchiveTypeEnum="ArchiveTypeEnum"
|
:ArchiveTypeEnum="ArchiveTypeEnum"
|
||||||
:rowData="rowData"
|
:rowData="rowData"
|
||||||
:Id="Id"
|
:Id="Id"
|
||||||
:viewStatus="viewStatus"
|
:viewStatus="viewStatus"
|
||||||
/> -->
|
/>
|
||||||
<!--医学审核-->
|
<!--医学审核-->
|
||||||
<medical-feedback
|
<medical-feedback
|
||||||
v-if="[9].includes(SubIdentificationEnum)"
|
v-if="[9].includes(SubIdentificationEnum)"
|
||||||
|
|
Loading…
Reference in New Issue