irc_web/.svn/pristine/bc/bcfe405a9e2da91ad2adfe93dfb...

241 lines
7.1 KiB
Plaintext

<template>
<div class="study-info">
<div class="functions" style="text-align:right">
<!-- 删除 -->
<el-button
v-if="(data.SubmitState*1 < 2 || (data.SubmitState === 2 && data.IsQCConfirmedReupload))"
v-hasPermi="['trials:trials-panel:visit:crc-upload:upload']"
:disabled="deleteArr.length === 0"
type="primary"
size="small"
icon="el-icon-delete"
@click="handleBatchDelete"
>
{{ $t('trials:uploadedDicoms:action:delete') }}
</el-button>
<!-- 预览 -->
<el-button
type="primary"
size="small"
:disabled="studyList.length === 0"
icon="el-icon-view"
@click="handlePreviewAllFiles"
>
{{ $t('trials:uploadedDicoms:action:preview') }}
</el-button>
</div>
<el-table
v-loading="studyLoading"
:data="studyList"
style="width: 100%"
height="300"
:row-class-name="tableRowClassName"
@selection-change="handleSelectionChange"
>
<el-table-column
v-if="!(data.SubmitState*1 === 2) || data.IsQCConfirmedReupload"
type="selection"
width="55"
/>
<!-- 检查编号 -->
<el-table-column
prop="StudyCode"
:label="$t('trials:uploadedDicoms:table:studyId')"
min-width="80"
show-overflow-tooltip
/>
<!-- 检查类型 -->
<el-table-column
prop="Modalities"
:label="$t('trials:uploadedDicoms:table:modality')"
min-width="80"
show-overflow-tooltip
/>
<!-- 检查部位 -->
<el-table-column
prop="BodyPartExamined"
:label="$t('trials:uploadedDicoms:table:bodyPart')"
min-width="100"
show-overflow-tooltip
/>
<!-- 序列数量 -->
<el-table-column
prop="SeriesCount"
:label="$t('trials:uploadedDicoms:table:seriesCount')"
min-width="100"
show-overflow-tooltip
/>
<!-- 图像数量 -->
<el-table-column
prop="InstanceCount"
:label="$t('trials:uploadedDicoms:table:instanceCount')"
min-width="100"
show-overflow-tooltip
/>
<!-- 检查日期 -->
<el-table-column
prop="StudyTime"
:label="$t('trials:uploadedDicoms:table:studyDate')"
min-width="120"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ moment(scope.row.StudyTime).format('YYYY-MM-DD') }}
</template>
</el-table-column>
<!-- 上传时间 -->
<el-table-column
prop="UploadedTime"
:label="$t('trials:uploadedDicoms:table:uploadedTime')"
min-width="80"
show-overflow-tooltip
/>
<el-table-column label="Action" min-width="100" fixed="right">
<template slot-scope="scope">
<!-- 预览 -->
<el-button
icon="el-icon-view"
:disabled="scope.row.SeriesCount === 0 || scope.row.IsDeleted"
:title="$t('trials:uploadedDicoms:action:preview')"
circle
@click="handleViewStudy(scope.row)"
/>
<!-- 删除 -->
<el-button
v-if=" (data.SubmitState*1 < 2 || (data.SubmitState === 2 && data.IsQCConfirmedReupload))"
v-hasPermi="['trials:trials-panel:visit:crc-upload:upload']"
icon="el-icon-delete"
:title="$t('trials:uploadedDicoms:action:delete')"
circle
@click="handleDeleteStudy(scope.row)"
/>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { getSubjectVisitUploadedStudyList, deleteStudyList } from '@/api/trials'
import moment from 'moment'
import { getToken } from '@/utils/auth'
export default {
name: 'StudyInfo',
props: {
data: {
type: Object,
default() {
return {}
}
}
},
data() {
return {
deleteArr: [],
studyLoading: false,
studyList: [],
trialId: this.$route.query.trialId,
moment
}
},
mounted() {
this.getStudyInfo()
},
methods: {
getStudyInfo() {
this.studyLoading = true
getSubjectVisitUploadedStudyList(this.data.Id).then(res => {
this.studyList = res.Result
this.studyLoading = false
}).catch(() => { this.studyLoading = false })
},
// 批量删除
handleBatchDelete() {
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), {
type: 'warning',
distinguishCancelAndClose: true
})
.then(() => {
this.studyLoading = true
deleteStudyList(this.trialId, this.data.Id, this.deleteArr)
.then(res => {
if (res.IsSuccess) {
this.getStudyInfo()
this.$emit('getList')
this.$message.success(this.$t('trials:uploadedDicoms:message:deleteSuccessfully'))
}
}).catch(() => {
this.studyLoading = true
})
}).catch(() => {})
},
// 预览所有影像
handlePreviewAllFiles() {
var tokenKey = getToken()
const routeData = this.$router.resolve({
path: `/showvisitdicoms?trialId=${this.data.TrialId}&visitInfo=${this.data.VisitName}(${this.data.VisitNum})&subjectVisitId=${this.data.Id}&TokenKey=${tokenKey}`
})
window.open(routeData.href, '_blank')
},
// 预览影像
handleViewStudy(row) {
var token = getToken()
const routeData = this.$router.resolve({
path: `/showdicom?studyId=${row.StudyId}&TokenKey=${token}&type=Study`
})
window.open(routeData.href, '_blank')
},
// 删除某个检查
handleDeleteStudy(row) {
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), {
type: 'warning',
distinguishCancelAndClose: true
})
.then(() => {
this.studyLoading = true
deleteStudyList(this.trialId, this.data.Id, [row.StudyId])
.then(res => {
if (res.IsSuccess) {
this.getStudyInfo()
this.$emit('getList')
this.$message.success(this.$t('trials:uploadedDicoms:message:deleteSuccessfully'))
}
}).catch(() => {
this.studyLoading = true
})
}).catch(() => {})
},
// 获取勾选项
handleSelectionChange(val) {
this.deleteArr = []
val.forEach(item => {
this.deleteArr.push(item.StudyId)
})
},
// 设置已删除行勾选状态
hasDeleted(row) {
if (row.IsDeleted) {
return false
} else {
return true
}
},
// 设置已删除序列行样式
tableRowClassName({ row, rowIndex }) {
if (row.IsDeleted) {
return 'delete-row'
} else {
return ''
}
}
}
}
</script>
<style lang="scss">
.study-info{
.delete-row{
text-decoration-line: line-through;
color: #c0c4cc;
}
}
</style>