项目文档同意入项记录上传方式修改
continuous-integration/drone/push Build is passing Details

uat
wangxiaoshuang 2025-03-17 14:34:24 +08:00
parent 5339e2df63
commit 0e0b5c2c4c
3 changed files with 145 additions and 28 deletions

View File

@ -1265,6 +1265,14 @@ export function getTrialFileTypeFile(data) {
data
})
}
// 项目文档-删除上传同意入项记录
export function deleteTrialTypeFile(params) {
return request({
url: `/TrialFileType/deleteTrialTypeFile`,
method: 'post',
params
})
}
// 项目文档-获取资质材料列表
export function getTrialAttachments(data) {
return request({

View File

@ -241,7 +241,7 @@ const searchDataDefault = () => {
PageIndex: 1,
PageSize: 20,
asc: false,
sortField: 'CreateTime',
sortField: '',
}
}
export default {

View File

@ -174,7 +174,7 @@
/>
</div>
</el-dialog>
<upload-files
<!-- <upload-files
:config="config"
:faccept="faccept"
:uploadPath="uploadPath"
@ -182,31 +182,49 @@
v-if="config.visible"
@close="close"
@uplaodFile="uplaodFile"
/>
/> -->
<base-model :config="upload_config">
<div slot="dialog-body">
<div class="file_title">
{{ $t('trials:trialDocument:entryRecord:title:uploadFile') }}
</div>
<div class="file">
<div class="file" v-if="file.FileName">
<div class="name">{{ file.FileName }}</div>
<i
v-if="hasDownLoad && (isManage || isInspect)"
class="el-icon-download"
:title="$t('common:button:download')"
@click.stop="downLoad(file)"
/>
<i
v-if="hasDel && isManage && !viewStatus"
class="el-icon-delete"
:title="$t('common:button:delete')"
@click.stop="handleRemoveFile"
/>
</div>
<div class="btnBox">
<el-button
<!-- <el-button
type="primary"
v-if="hasEdit && isManage && !viewStatus"
@click.stop="openFile(false)"
>
{{ $t('trials:trialDocument:entryRecord:button:uploadFile') }}
</el-button>
<el-button
v-if="hasDownLoad && (isManage || isInspect)"
icon="el-icon-download"
type="primary"
:disabled="!file || !file.FilePath"
@click.stop="downLoad(file)"
>{{ $t('trials:trialDocument:entryRecord:button:downLoadFile') }}
</el-button>
</el-button> -->
<el-upload
v-if="hasEdit && isManage && !viewStatus"
class="upload-demo"
action
:before-upload="(param) => beforeUpload(param, '.zip')"
:show-file-list="false"
:http-request="handleUploadFile"
:limit="1"
accept=".zip"
>
<el-button size="small" type="primary" :disabled="!!file.FileName">
{{ $t('trials:trialDocument:entryRecord:button:uploadFile') }}
</el-button>
</el-upload>
</div>
</div>
</base-model>
@ -214,13 +232,17 @@
</template>
<script>
import { getConfirmationReviewerList } from '@/api/trials'
import { uploadTrialFileTypeFile, getTrialFileTypeFile } from '@/api/dictionary'
import {
uploadTrialFileTypeFile,
getTrialFileTypeFile,
deleteTrialTypeFile,
} from '@/api/dictionary'
import Pagination from '@/components/Pagination'
import BoxContent from '@/components/BoxContent'
import preview from '@/views/reviewers/curriculumVitae/preview.vue'
import baseModel from '@/components/BaseModel'
import { mapGetters } from 'vuex'
import uploadFiles from '../../uploadFiles.vue'
// import uploadFiles from '../../uploadFiles.vue'
import { downLoadFile } from '@/utils/stream.js'
const searchDataDefault = () => {
return {
@ -237,7 +259,13 @@ const searchDataDefault = () => {
}
export default {
name: 'entryRecord',
components: { BoxContent, Pagination, preview, uploadFiles, baseModel },
components: {
BoxContent,
Pagination,
preview,
// uploadFiles,
baseModel,
},
props: {
ArchiveTypeEnum: {
type: Number,
@ -268,8 +296,7 @@ export default {
isAll: false,
preview_visible: false,
timeList: [],
upload_config: {
config: {
visible: false,
showClose: true,
width: '800px',
@ -277,8 +304,7 @@ export default {
appendToBody: false,
isFolder: false,
},
config: {
upload_config: {
visible: false,
showClose: true,
width: '800px',
@ -293,6 +319,80 @@ export default {
}
},
methods: {
handleRemoveFile() {
this.$confirm(
this.$t('trials:trialDocument:entryRecord:message:deleteMes'),
{
type: 'warning',
distinguishCancelAndClose: true,
}
)
.then(() => {
deleteTrialTypeFile({
TrialFileTypeId: this.file.TrialFileTypeId,
}).then((res) => {
if (res.IsSuccess) {
this.getFile()
this.$message({
message: this.$t('common:message:deletedSuccessfully'),
type: 'success',
})
}
})
})
.catch((action) => {})
},
async handleUploadFile(param) {
try {
console.log(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:entryRecord: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}/${this.$guid()}${extendName}`,
file
)
this.file = {
FileName: param.file.name,
FilePath: this.$getObjectName(res.url),
FileSize: param.file.size,
FileFormat: extendName,
}
this.loading = false
this.uplaodFile([this.file])
} catch (err) {
console.log(err)
}
},
beforeUpload(param, accept) {
if (this.file && !!this.file.FileName) {
this.$alert(
this.$t('trials:trialDocument:entryRecord:msg:hasFile')
).catch()
return
}
let extendName = param.name
.substring(param.name.lastIndexOf('.'))
.toLocaleLowerCase()
if (accept !== extendName) {
this.$alert(
this.$t('trials:trialDocument:entryRecord:msg:typeErr')
).catch()
return
}
},
openUpload() {
this.upload_config.title = `${this.$t(
'trials:trialDocument:entryRecord:title:uploadFile'
@ -506,14 +606,23 @@ export default {
width: 100%;
display: flex;
margin-bottom: 10px;
// .name {
// width: 70%;
// white-space: nowrap; /* <br> */
// text-overflow: ellipsis; /* (...) */
// overflow: hidden; /* */
// }
.name {
max-width: 90%;
white-space: nowrap; /* 文本不会换行,会在同一行内继续,直到遇到<br>标签为止 */
text-overflow: ellipsis; /* 当文本溢出包含它的容器时,显示省略号(...)来表示被截断的文本 */
overflow: hidden; /* 隐藏溢出容器的文本 */
}
i {
cursor: pointer;
margin: 3px;
color: #409eff;
}
.disable {
cursor: not-allowed;
color: #909399;
}
}
.btnBox{
.btnBox {
margin-top: 10px;
display: flex;
align-items: center;