项目文档同意入项记录上传方式修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
5339e2df63
commit
0e0b5c2c4c
|
@ -1265,6 +1265,14 @@ export function getTrialFileTypeFile(data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 项目文档-删除上传同意入项记录
|
||||||
|
export function deleteTrialTypeFile(params) {
|
||||||
|
return request({
|
||||||
|
url: `/TrialFileType/deleteTrialTypeFile`,
|
||||||
|
method: 'post',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
// 项目文档-获取资质材料列表
|
// 项目文档-获取资质材料列表
|
||||||
export function getTrialAttachments(data) {
|
export function getTrialAttachments(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -241,7 +241,7 @@ const searchDataDefault = () => {
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 20,
|
PageSize: 20,
|
||||||
asc: false,
|
asc: false,
|
||||||
sortField: 'CreateTime',
|
sortField: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -174,7 +174,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<upload-files
|
<!-- <upload-files
|
||||||
:config="config"
|
:config="config"
|
||||||
:faccept="faccept"
|
:faccept="faccept"
|
||||||
:uploadPath="uploadPath"
|
:uploadPath="uploadPath"
|
||||||
|
@ -182,31 +182,49 @@
|
||||||
v-if="config.visible"
|
v-if="config.visible"
|
||||||
@close="close"
|
@close="close"
|
||||||
@uplaodFile="uplaodFile"
|
@uplaodFile="uplaodFile"
|
||||||
/>
|
/> -->
|
||||||
<base-model :config="upload_config">
|
<base-model :config="upload_config">
|
||||||
<div slot="dialog-body">
|
<div slot="dialog-body">
|
||||||
<div class="file_title">
|
<div class="file_title">
|
||||||
{{ $t('trials:trialDocument:entryRecord:title:uploadFile') }}
|
{{ $t('trials:trialDocument:entryRecord:title:uploadFile') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="file">
|
<div class="file" v-if="file.FileName">
|
||||||
<div class="name">{{ file.FileName }}</div>
|
<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>
|
||||||
<div class="btnBox">
|
<div class="btnBox">
|
||||||
<el-button
|
<!-- <el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="hasEdit && isManage && !viewStatus"
|
v-if="hasEdit && isManage && !viewStatus"
|
||||||
@click.stop="openFile(false)"
|
@click.stop="openFile(false)"
|
||||||
>
|
>
|
||||||
{{ $t('trials:trialDocument:entryRecord:button:uploadFile') }}
|
{{ $t('trials:trialDocument:entryRecord:button:uploadFile') }}
|
||||||
</el-button>
|
</el-button> -->
|
||||||
<el-button
|
<el-upload
|
||||||
v-if="hasDownLoad && (isManage || isInspect)"
|
v-if="hasEdit && isManage && !viewStatus"
|
||||||
icon="el-icon-download"
|
class="upload-demo"
|
||||||
type="primary"
|
action
|
||||||
:disabled="!file || !file.FilePath"
|
:before-upload="(param) => beforeUpload(param, '.zip')"
|
||||||
@click.stop="downLoad(file)"
|
:show-file-list="false"
|
||||||
>{{ $t('trials:trialDocument:entryRecord:button:downLoadFile') }}
|
:http-request="handleUploadFile"
|
||||||
</el-button>
|
: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>
|
||||||
</div>
|
</div>
|
||||||
</base-model>
|
</base-model>
|
||||||
|
@ -214,13 +232,17 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getConfirmationReviewerList } from '@/api/trials'
|
import { getConfirmationReviewerList } from '@/api/trials'
|
||||||
import { uploadTrialFileTypeFile, getTrialFileTypeFile } from '@/api/dictionary'
|
import {
|
||||||
|
uploadTrialFileTypeFile,
|
||||||
|
getTrialFileTypeFile,
|
||||||
|
deleteTrialTypeFile,
|
||||||
|
} from '@/api/dictionary'
|
||||||
import Pagination from '@/components/Pagination'
|
import Pagination from '@/components/Pagination'
|
||||||
import BoxContent from '@/components/BoxContent'
|
import BoxContent from '@/components/BoxContent'
|
||||||
import preview from '@/views/reviewers/curriculumVitae/preview.vue'
|
import preview from '@/views/reviewers/curriculumVitae/preview.vue'
|
||||||
import baseModel from '@/components/BaseModel'
|
import baseModel from '@/components/BaseModel'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import uploadFiles from '../../uploadFiles.vue'
|
// import uploadFiles from '../../uploadFiles.vue'
|
||||||
import { downLoadFile } from '@/utils/stream.js'
|
import { downLoadFile } from '@/utils/stream.js'
|
||||||
const searchDataDefault = () => {
|
const searchDataDefault = () => {
|
||||||
return {
|
return {
|
||||||
|
@ -237,7 +259,13 @@ const searchDataDefault = () => {
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'entryRecord',
|
name: 'entryRecord',
|
||||||
components: { BoxContent, Pagination, preview, uploadFiles, baseModel },
|
components: {
|
||||||
|
BoxContent,
|
||||||
|
Pagination,
|
||||||
|
preview,
|
||||||
|
// uploadFiles,
|
||||||
|
baseModel,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
ArchiveTypeEnum: {
|
ArchiveTypeEnum: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -268,8 +296,7 @@ export default {
|
||||||
isAll: false,
|
isAll: false,
|
||||||
preview_visible: false,
|
preview_visible: false,
|
||||||
timeList: [],
|
timeList: [],
|
||||||
|
config: {
|
||||||
upload_config: {
|
|
||||||
visible: false,
|
visible: false,
|
||||||
showClose: true,
|
showClose: true,
|
||||||
width: '800px',
|
width: '800px',
|
||||||
|
@ -277,8 +304,7 @@ export default {
|
||||||
appendToBody: false,
|
appendToBody: false,
|
||||||
isFolder: false,
|
isFolder: false,
|
||||||
},
|
},
|
||||||
|
upload_config: {
|
||||||
config: {
|
|
||||||
visible: false,
|
visible: false,
|
||||||
showClose: true,
|
showClose: true,
|
||||||
width: '800px',
|
width: '800px',
|
||||||
|
@ -293,6 +319,80 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
openUpload() {
|
||||||
this.upload_config.title = `${this.$t(
|
this.upload_config.title = `${this.$t(
|
||||||
'trials:trialDocument:entryRecord:title:uploadFile'
|
'trials:trialDocument:entryRecord:title:uploadFile'
|
||||||
|
@ -506,14 +606,23 @@ export default {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
// .name {
|
.name {
|
||||||
// width: 70%;
|
max-width: 90%;
|
||||||
// white-space: nowrap; /* 文本不会换行,会在同一行内继续,直到遇到<br>标签为止 */
|
white-space: nowrap; /* 文本不会换行,会在同一行内继续,直到遇到<br>标签为止 */
|
||||||
// text-overflow: ellipsis; /* 当文本溢出包含它的容器时,显示省略号(...)来表示被截断的文本 */
|
text-overflow: ellipsis; /* 当文本溢出包含它的容器时,显示省略号(...)来表示被截断的文本 */
|
||||||
// overflow: hidden; /* 隐藏溢出容器的文本 */
|
overflow: hidden; /* 隐藏溢出容器的文本 */
|
||||||
// }
|
}
|
||||||
|
i {
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 3px;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
.disable {
|
||||||
|
cursor: not-allowed;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.btnBox{
|
.btnBox {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
Loading…
Reference in New Issue