irc_web/.svn/pristine/e7/e7dc2a8d9f116f1b8fb200f10cf...

516 lines
19 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div class="report-wrapper">
<el-card v-loading="loading" shadow="never">
<div slot="header" class="clearfix report-header">
<h3 style="margin:0;padding:0;">电子影像病例报告表eICRF</h3>
<div style="margin-left:auto">
<el-switch
v-model="isShowDetail"
active-text="展开详情"
inactive-text="折叠详情"
style="margin-right:5px"
@change="handleShowDetail"
/>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="getReportInfo">刷新</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleSave(true)">保存</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleConfirm">确认</el-button>
</div>
</div>
<div style="padding:5px">
<el-table
ref="reportList"
v-adaptive="{bottomOffset:60}"
:data="taskQuestions"
row-key="Id"
border
default-expand-all
height="100"
:tree-props="{children: 'Childrens', hasChildren: 'hasChildren'}"
size="mini"
>
<el-table-column
prop=""
label=""
show-overflow-tooltip
width="350px"
>
<template slot-scope="scope">
<span v-if="scope.row.QuestionName">{{ scope.row.BlindName ? scope.row.QuestionName : scope.row.QuestionName }}</span>
<span
v-else
style="font-weight: bold;font-size: 16px;color: #f44336;"
>
{{ scope.row.GroupName }}
</span>
</template>
</el-table-column>
<el-table-column
v-for="task in visitTaskList"
:key="task.VisitTaskId"
prop="date"
:label="task.BlindName"
show-overflow-tooltip
width="200px"
>
<template slot-scope="scope">
<template v-if="task.VisitTaskId === visitTaskId && readingTaskState < 2 && [13,14,15].includes(scope.row.QuestionType)">
<!-- 是否存在疾病(基线时可修改) -->
<template v-if="task.IsBaseLine && scope.row.QuestionType=== 15">
<el-select
v-if="scope.row.Type==='select' && scope.row.DictionaryCode"
v-model="currentExistDisease"
size="mini"
@change="handleExistDiseaseChange"
>
<el-option
v-for="item of $d[ scope.row.DictionaryCode]"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</template>
<!-- 整体肿瘤评估(非基线可修改) -->
<template v-else-if="!task.IsBaseLine && scope.row.QuestionType=== 13">
<el-select
v-if="scope.row.Type==='select' && scope.row.DictionaryCode"
v-model="currentEvaluateResult"
size="mini"
@change="handleEvaluateResultChange"
>
<el-option
v-for="item of $d[ scope.row.DictionaryCode]"
v-show="!(item.value===7 && task.IsBaseLine)"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</template>
<!-- 访视点备注(是否存在疾病与系统不一致或者整体肿瘤评估与系统不一致时,必填) -->
<template v-else-if="tumorEvaluate && task.VisitTaskId === visitTaskId && scope.row.QuestionType=== 14 && (currentEvaluateResult !== tumorEvaluate || currentExistDisease !== isExistDisease)">
<template v-if="tumorEvaluate && (currentEvaluateResult !== tumorEvaluate || currentExistDisease !== isExistDisease)">
<!-- 输入框 -->
<el-input
v-if="scope.row.Type==='input'"
v-model="currentTaskReason"
size="mini"
@change="evaluateReasonChange"
/>
<el-input
v-else-if="scope.row.Type==='textarea'"
v-model="currentTaskReason"
:autosize="{ minRows: 2, maxRows: 4}"
size="mini"
maxlength="500"
@change="evaluateReasonChange"
/>
<p v-if="currentEvaluateResult !== tumorEvaluate" style="width: 180px;white-space: normal;word-break: break-all;word-wrap: break-word;">系统评估结果为:<span style="color:red">{{ $fd('OverallAssessment',tumorEvaluate) }}</span>,与当前调整的结果不一致,请填写调整原因</p>
<p v-else-if="currentExistDisease !== isExistDisease" style="width: 180px;white-space: normal;word-break: break-all;word-wrap: break-word;">系统评估结果为:<span style="color:red">{{ $fd('ExistDisease',isExistDisease) }}</span>,与当前调整的结果不一致,请填写调整原因</p>
</template>
<template v-else>
<span>{{ currentTaskReason }}</span>
</template>
</template>
</template>
<template v-else-if="scope.row.DictionaryCode">
{{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }}
</template>
<template v-else-if="(scope.row.ValueType === 0 || scope.row.ValueType === 1) && scope.row.Unit">
{{ isNaN(parseInt(scope.row.Answers[task.VisitTaskId]))?scope.row.Answers[task.VisitTaskId]:`${scope.row.Answers[task.VisitTaskId]}${$fd('ValueUnit',scope.row.Unit)}` }}
</template>
<template v-else-if="scope.row.ValueType === 2">
{{ isNaN(parseInt(scope.row.Answers[task.VisitTaskId]))?scope.row.Answers[task.VisitTaskId]:`${scope.row.Answers[task.VisitTaskId]}%` }}
</template>
<template v-else-if="scope.row.Answers && scope.row.Answers.hasOwnProperty(task.VisitTaskId)">
{{ scope.row.Answers[task.VisitTaskId] }}
</template>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<!-- 签名框 -->
<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 { getToken } from '@/utils/auth'
export default {
name: 'ReportPage',
components: { SignForm },
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
}
},
watch: {
taskQuestions() {
this.$nextTick(() => {
this.$refs.reportList.doLayout()
})
}
},
mounted() {
window.addEventListener('resize', this.handleResize)
DicomEvent.$on('getReportInfo', isRefresh => {
if (!isRefresh) return
this.getReportInfo()
})
this.getReportInfo()
},
beforeDestroy() {
DicomEvent.$off('getReportInfo')
},
methods: {
getReportInfo() {
this.loading = true
var params = {
visitTaskId: this.visitTaskId,
trialId: this.$router.currentRoute.query.trialId
}
getReadingReportEvaluation(params).then(res => {
this.readingTaskState = res.Result.ReadingTaskState
this.tumorEvaluate = res.Result.CalculateResult.TumorEvaluate ? parseInt(res.Result.CalculateResult.TumorEvaluate) : null
this.isExistDisease = res.Result.CalculateResult.IsExistDisease ? parseInt(res.Result.CalculateResult.IsExistDisease) : null
this.answerArr = []
this.questions = res.Result.TaskQuestions.concat()
var taskQuestions = this.getQuestions(res.Result.TaskQuestions, !this.isShowDetail, null)
this.taskQuestions = []
taskQuestions.forEach(item => {
this.$set(this.taskQuestions, this.taskQuestions.length, item)
})
this.visitTaskList = res.Result.VisitTaskList
this.loading = false
}).catch(() => { this.loading = false })
},
getQuestions(questions, isNTFilterLength, lesionType) {
const arr = []
if (questions.length !== 0) {
questions.forEach((item) => {
// 过滤病灶标识 病灶名称 部位 器官 位置 是否淋巴结
// 非靶病灶和新病灶 过滤长径和短径信息
lesionType = item.LesionType
var filterArr = []
if ((item.LesionType === 1 || item.LesionType === 2) && isNTFilterLength) {
filterArr = [0, 1, 3, 4, 5, 6, 2, 8]
} else {
filterArr = [3, 4, 5, 6, 2, 8]
}
if (!(filterArr.includes(item.QuestionMark))) {
const obj = item
obj.Answers = {}
if (item.RowIndex > 0) {
var idx = item.Childrens.findIndex(i => i.QuestionMark === 8)
var idxLoc = item.Childrens.findIndex(i => i.QuestionMark === 6)
if (idx > -1) {
if (item.Childrens[idx].Answer.length > 0) {
var k = item.Childrens[idx].Answer.findIndex(v => v.Answer !== '')
var part = ''
if (obj.IsCanEditPosition) {
part = `${item.Childrens[idx].Answer[k].Answer}--${item.Childrens[idxLoc].Answer[k].Answer}`
} else {
part = `${item.Childrens[idx].Answer[k].Answer}`
}
if (item.SplitOrMergeLesionName && k > -1) {
obj.QuestionName = `${obj.QuestionName} --${part} (Split from ${item.SplitOrMergeLesionName})`
// obj.QuestionName = `${obj.QuestionName} `
} else if (!item.SplitOrMergeLesionName && k > -1) {
obj.QuestionName = `${obj.QuestionName} --${part}`
// obj.QuestionName = `${obj.QuestionName} `
} else {
obj.QuestionName = `${obj.QuestionName} `
}
}
}
}
item.Answer.forEach(i => {
if (item.DictionaryCode) {
obj.Answers[i.VisitTaskId] = i.Answer ? parseInt(i.Answer) : null
} else {
obj.Answers[i.VisitTaskId] = i.Answer
}
})
if (item.QuestionType === 15) {
this.currentExistDisease = obj.Answers[this.visitTaskId]
this.answerArr.push({ id: item.QuestionId, answer: obj.Answers[this.visitTaskId], questionType: 12 })
}
if (item.QuestionType === 13) {
this.currentEvaluateResult = obj.Answers[this.visitTaskId]
this.answerArr.push({ id: item.QuestionId, answer: obj.Answers[this.visitTaskId], questionType: 13 })
}
if (item.QuestionType === 14) {
this.currentTaskReason = obj.Answers[this.visitTaskId]
this.answerArr.push({ id: item.QuestionId, answer: obj.Answers[this.visitTaskId], questionType: 14 })
}
if (item.Childrens.length >= 1) {
obj.Childrens = this.getQuestions(item.Childrens, isNTFilterLength, lesionType)
}
arr.push(obj)
}
})
}
return arr
},
handleShowDetail(val) {
this.getReportInfo()
// this.taskQuestions = this.getQuestions(res.Result.TaskQuestions, !this.isShowDetail, null)
},
handleExistDiseaseChange(val) {
// this.currentExistDisease = parseInt(val)
if (val === this.isExistDisease && this.tumorEvaluate === this.currentEvaluateResult) {
this.currentTaskReason = ''
this.evaluateReasonChange('')
}
var idx = this.answerArr.findIndex(i => i.questionType === 15)
if (idx > -1) {
this.answerArr[idx].answer = val
}
},
handleEvaluateResultChange(val) {
// this.currentEvaluateResult = parseInt(val)
if (val === this.tumorEvaluate && this.isExistDisease === this.currentExistDisease) {
this.currentTaskReason = ''
this.evaluateReasonChange('')
}
var idx = this.answerArr.findIndex(i => i.questionType === 13)
if (idx > -1) {
this.answerArr[idx].answer = val
}
},
evaluateReasonChange(val) {
var idx = this.answerArr.findIndex(i => i.questionType === 14)
if (idx > -1) {
this.answerArr[idx].answer = val
}
},
async handleConfirm() {
await this.handleSave(false)
await this.verifyVisitTaskQuestions()
const { ImageAssessmentReportConfirmation } = const_.processSignature
this.signCode = ImageAssessmentReportConfirmation
this.signVisible = true
},
verifyVisitTaskQuestions() {
return new Promise((resolve, reject) => {
this.loading = true
verifyVisitTaskQuestions({ visitTaskId: this.visitTaskId }).then(res => {
this.loading = false
resolve()
}).catch(() => {
this.loading = false
reject()
})
})
},
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.$refs['signForm'].btnLoading = false
this.signVisible = false
// window.location.reload()
// window.opener.postMessage('refreshTaskList', window.location)
window.opener.postMessage('refreshTaskList', window.location)
var token = getToken()
var subjectCode = this.$router.currentRoute.query.subjectCode
var subjectId = this.$router.currentRoute.query.subjectId
var trialId = this.$router.currentRoute.query.trialId
this.$router.push({
path: `/readingPage?subjectCode=${subjectCode}&subjectId=${subjectId}&trialId=${trialId}&TokenKey=${token}`
})
}
this.loading = false
}).catch(() => {
this.loading = false
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>