irc_web/.svn/pristine/ee/ee1272785c844da53440ed9791f...

252 lines
6.9 KiB
Plaintext

<template>
<div class="report-wrapper">
<QuestionsPreview
:visitTaskId="visitTaskId"
:criterionId="TrialReadingCriterionId">
</QuestionsPreview>
<!-- 签名框 -->
<el-dialog
v-if="signVisible"
:visible.sync="signVisible"
:close-on-click-modal="false"
width="600px"
custom-class="base-dialog-wrapper"
>
<div slot="title">
<span style="font-size:18px;">{{ $t('common:dialogTitle:sign') }}</span>
<span style="font-size:12px;margin-left:5px">{{ `(${$t('common:label:sign')}${ currentUser })` }}</span>
</div>
<SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" />
</el-dialog>
</div>
</template>
<script>
import { getReadingReportEvaluation, changeDicomReadingQuestionAnswer, submitDicomVisitTask, verifyVisitTaskQuestions } from '@/api/trials'
import DicomEvent from './DicomEvent'
import const_ from '@/const/sign-code'
import SignForm from '@/views/trials/components/newSignForm'
import QuestionsPreview from './QuestionsPreview'
import { getToken } from '@/utils/auth'
import store from '@/store'
export default {
name: 'ReportPage',
components: { SignForm, QuestionsPreview },
props: {
visitTaskId: {
type: String,
required: true
}
},
data() {
return {
currentUser: zzSessionStorage.getItem('userName'),
signVisible: false,
signCode: null,
visitTaskList: [],
taskQuestions: [],
loading: false,
answers: [],
readingTaskState: 2,
tumorEvaluate: null,
currentEvaluateResult: null,
isExistDisease: null,
currentExistDisease: null,
currentTaskReason: '',
answerArr: [],
questions: [],
isShowDetail: false,
CriterionType: 0,
TrialReadingCriterionId: null
}
},
watch: {
},
mounted() {
this.CriterionType = parseInt(localStorage.getItem('CriterionType'))
this.TrialReadingCriterionId = this.$router.currentRoute.query.TrialReadingCriterionId
window.addEventListener('resize', this.handleResize)
DicomEvent.$on('getReportInfo', isRefresh => {
if (!isRefresh) return
})
},
beforeDestroy() {
DicomEvent.$off('getReportInfo')
},
methods: {
async handleConfirm() {
await this.handleSave(false)
const { ImageAssessmentReportConfirmation } = const_.processSignature
this.signCode = ImageAssessmentReportConfirmation
this.signVisible = true
},
handleResize() {
this.$nextTick(() => {
this.$refs.reportList.doLayout()
})
},
// 关闭签名框
closeSignDialog(isSign, signInfo) {
if (isSign) {
this.signConfirm(signInfo)
} else {
this.signVisible = false
}
},
// 签名并确认
signConfirm(signInfo) {
this.loading = true
var params = {
data: {
visitTaskId: this.visitTaskId
},
signInfo: signInfo
}
submitDicomVisitTask(params).then(res => {
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:savedSuccessfully'))
this.signVisible = false
// 设置当前任务阅片状态为已读
this.readingTaskState = 2
store.dispatch('reading/setVisitTaskReadingTaskState', { visitTaskId: this.visitTaskId, readingTaskState: 2 })
DicomEvent.$emit('setReadingState', 2)
window.opener.postMessage('refreshTaskList', window.location)
this.$confirm('当前阅片任务已完成,是否进入下一个阅片任务?', {
type: 'warning',
distinguishCancelAndClose: true
})
.then(() => {
console.log('我准备进来啦')
DicomEvent.$emit('getNextTask')
})
.catch(action => {
console.log(1111)
})
}
this.loading = false
}).catch(() => {
this.loading = false
if (this.$refs['signForm'] && this.$refs['signForm'].btnLoading) {
this.$refs['signForm'].btnLoading = false
}
})
},
handleSave(isPrompt) {
return new Promise((resolve, reject) => {
var evaluateResult = ''
var evaluateAjustReason = ''
this.answers = []
var isExistEvaluateResult = false
this.answerArr.map(item => {
if (item.questionType === 13) {
evaluateResult = item.answer
isExistEvaluateResult = true
}
if (item.questionType === 14) {
evaluateAjustReason = item.answer
}
this.answers.push({ id: item.id, answer: item.answer })
})
if (isExistEvaluateResult && evaluateResult === null) {
this.$confirm('请将疗效评估信息填写完整', {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
reject()
return
}
if (isExistEvaluateResult && (evaluateResult !== this.tumorEvaluate) && !evaluateAjustReason) {
this.$confirm('请填写整体评估调整原因', {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
reject()
return
}
this.loading = true
var params = {
visitTaskId: this.visitTaskId,
answers: this.answers
}
changeDicomReadingQuestionAnswer(params).then(res => {
if (isPrompt) {
this.$message.success(this.$t('common:message:savedSuccessfully'))
}
this.loading = false
resolve()
}).catch(() => {
this.loading = false
reject()
})
})
}
}
}
</script>
<style lang="scss" scoped>
.report-wrapper{
height: 100%;
// background-color: #fff;
background-color: #000;
::-webkit-scrollbar {
width: 7px;
height: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #d0d0d0;
}
.report-header{
display: flex;
}
.el-card{
background-color: #000;
color: #ffffff;
border:none;
}
// >>>.el-table__cell{
// background-color: #000;
// color: #ffffff;
// }
// >>>.el-table{
// background-color: #000;
// color: #ffffff;
// }
// >>>.el-table__cell{
// background-color: #000;
// color: #ffffff;
// }
>>>.el-table, .el-table__expanded-cell {
background-color: #000;
color: #fff;
border-color:#444444;
}
>>>.el-table th, .el-table tr {
background-color: #000;
color: #fff;
border-color:#444444;
}
>>>.el-table__body tr > td{
background-color:#000 !important;
color: #fff;
border-color:#444444;
}
>>>.el-table__body tr:hover > td{
background-color:#858282 !important;
color: #fff;
border-color:#444444;
}
>>>.el-table--border th.gutter:last-of-type{
border: none;
}
>>>.el-card__header{
border: none;
padding: 10px;
}
}
</style>