This commit is contained in:
@@ -928,6 +928,7 @@ export default {
|
||||
let res = await preArchiveStudy({
|
||||
subjectVisitId: this.subjectVisitId,
|
||||
isDicom: false,
|
||||
FileCount: this.selectArr.length,
|
||||
})
|
||||
if (res.IsSuccess) {
|
||||
this.studyMonitorId = res.Result
|
||||
@@ -952,6 +953,7 @@ export default {
|
||||
}/${this.$guid()}${file.name
|
||||
.substring(file.name.lastIndexOf('.'))
|
||||
.toLocaleLowerCase()}`
|
||||
file.curPath = path
|
||||
const fileData = await this.fileToBlob(file.file)
|
||||
let res = await this.fileToOss(path, fileData, file)
|
||||
if (res) {
|
||||
@@ -964,7 +966,8 @@ export default {
|
||||
})
|
||||
let flag = arr.every((item) => item.status === 2)
|
||||
if (flag) {
|
||||
return this.submitFile(this.successFileList)
|
||||
let RecordPath = await this.uploadRecord(arr)
|
||||
return this.submitFile(this.successFileList, RecordPath)
|
||||
}
|
||||
} else {
|
||||
file.status = 3
|
||||
@@ -973,12 +976,14 @@ export default {
|
||||
if (flag) {
|
||||
let failFileList = arr.filter((item) => item.status === 3)
|
||||
if (failFileList && failFileList.length > 0) {
|
||||
let RecordPath = await this.uploadRecord(arr)
|
||||
this.$refs.filesTable.clearSelection()
|
||||
failFileList.forEach((row) => {
|
||||
row.uploadFileSize = 0
|
||||
this.$refs.filesTable.toggleRowSelection(row)
|
||||
})
|
||||
this.isFail = true
|
||||
this.submitFile(this.successFileList, RecordPath, true)
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -1016,7 +1021,7 @@ export default {
|
||||
}
|
||||
},
|
||||
// 非Dicom文件上传归档
|
||||
submitFile(uploadedFileList) {
|
||||
submitFile(uploadedFileList, RecordPath, isReLoad = false) {
|
||||
if (!this.uploadVisible) return
|
||||
this.btnLoading = true
|
||||
var params = {
|
||||
@@ -1026,9 +1031,15 @@ export default {
|
||||
studyMonitorId: this.studyMonitorId,
|
||||
uploadedFileList: uploadedFileList,
|
||||
}
|
||||
if (RecordPath) {
|
||||
params.RecordPath = RecordPath.path
|
||||
params.FailedFileCount = RecordPath.Record.Failed.length
|
||||
}
|
||||
uploadNoneDicomFile(params)
|
||||
.then((res) => {
|
||||
this.resetFileDiaolg()
|
||||
if (!isReLoad) {
|
||||
this.resetFileDiaolg()
|
||||
}
|
||||
this.getNoneDicomList()
|
||||
// 刷新父组件列表
|
||||
this.$emit('getList')
|
||||
@@ -1040,6 +1051,49 @@ export default {
|
||||
this.btnLoading = false
|
||||
})
|
||||
},
|
||||
// 上传提交记录
|
||||
uploadRecord(arr) {
|
||||
return new Promise(async (resolve) => {
|
||||
try {
|
||||
let Record = {
|
||||
Failed: [],
|
||||
Existed: [],
|
||||
Uploaded: [],
|
||||
FileCount: arr.length,
|
||||
}
|
||||
arr.forEach((item) => {
|
||||
let file = this.fileList.find((data) => data.id === item.id)
|
||||
if (file.status === 2) {
|
||||
Record.Uploaded.push(file.curPath)
|
||||
}
|
||||
if (file.status === 3) {
|
||||
Record.Failed.push(file.curPath)
|
||||
}
|
||||
})
|
||||
let text = JSON.stringify(Record)
|
||||
let logJsonBlob = this.generateTxtFile(text)
|
||||
let logJsonObjectName = `/${this.trialId}/Image/${this.data.SubjectId}/${this.data.Id}/${this.studyMonitorId}.txt`
|
||||
let logRes
|
||||
try {
|
||||
logRes = await this.OSSclient.put(logJsonObjectName, logJsonBlob)
|
||||
if (logRes && logRes.url) {
|
||||
resolve({ path: this.$getObjectName(logRes.url), Record })
|
||||
} else {
|
||||
resolve(false)
|
||||
}
|
||||
} catch (e) {
|
||||
resolve(false)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
resolve(false)
|
||||
}
|
||||
})
|
||||
},
|
||||
generateTxtFile(text) {
|
||||
let blob = new Blob(['\ufeff', text], { type: 'text/plain' })
|
||||
return blob
|
||||
},
|
||||
resetFileDiaolg() {
|
||||
this.btnLoading = false
|
||||
this.uploadVisible = false
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,6 +49,13 @@
|
||||
>
|
||||
{{ $store.state.trials.uploadTip }}
|
||||
</div> -->
|
||||
<el-tooltip
|
||||
:content="$t('trials:download:tip:message')"
|
||||
placement="top-end"
|
||||
effect="light"
|
||||
>
|
||||
<i class="el-icon-warning-outline" style="font-size: 18px"></i>
|
||||
</el-tooltip>
|
||||
<!-- 下载所有影像 -->
|
||||
<el-button
|
||||
v-if="
|
||||
@@ -317,6 +324,13 @@
|
||||
>
|
||||
{{ $store.state.trials.uploadTip }}
|
||||
</div> -->
|
||||
<el-tooltip
|
||||
:content="$t('trials:download:tip:message')"
|
||||
placement="top-end"
|
||||
effect="light"
|
||||
>
|
||||
<i class="el-icon-warning-outline" style="font-size: 18px"></i>
|
||||
</el-tooltip>
|
||||
<!-- 下载所有影像 -->
|
||||
<el-button
|
||||
v-if="
|
||||
@@ -1667,7 +1681,9 @@ export default {
|
||||
if (item.actionContent) {
|
||||
// 行动事项
|
||||
actions.push(`${item.actionContent}`)
|
||||
str = `${str}${this.$t('trials:audit:form:actionMatters')}:<br><div style='margin-left:20px'>${item.actionContent}</div>`
|
||||
str = `${str}${this.$t(
|
||||
'trials:audit:form:actionMatters'
|
||||
)}:<br><div style='margin-left:20px'>${item.actionContent}</div>`
|
||||
}
|
||||
contents.push(str)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user