447 lines
16 KiB
Plaintext
447 lines
16 KiB
Plaintext
<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 v-if="readingTaskState<2" style="margin-left:auto">
|
||
<el-button type="primary" size="small" @click="getReportInfo">刷新</el-button>
|
||
<el-button type="primary" size="small" @click="handleSave(true)">保存</el-button>
|
||
<el-button 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.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 && !task.IsBaseLine && readingTaskState < 2 && scope.row.QuestionType=== 13">
|
||
<!-- 输入框 -->
|
||
<el-input
|
||
v-if="scope.row.Type==='input'"
|
||
v-model="scope.row.Answers[task.VisitTaskId]"
|
||
size="mini"
|
||
/>
|
||
|
||
<el-select
|
||
v-else-if="scope.row.Type==='select' && scope.row.DictionaryCode"
|
||
v-model="scope.row.Answers[task.VisitTaskId]"
|
||
size="mini"
|
||
@change="handleEvaluateResultChange"
|
||
>
|
||
<el-option
|
||
v-for="item of $d[ scope.row.DictionaryCode]"
|
||
:key="item.id"
|
||
:value="item.value"
|
||
:label="item.label"
|
||
/>
|
||
</el-select>
|
||
<span v-else>{{ scope.row.Answers && scope.row.Answers.hasOwnProperty(task.VisitTaskId)? scope.row.Answers[task.VisitTaskId]:'' }}</span>
|
||
</template>
|
||
<template v-else-if="tumorEvaluate && task.VisitTaskId === visitTaskId && readingTaskState < 2 && scope.row.QuestionType=== 14 && scope.row.Answers && currentEvaluateResult !== tumorEvaluate">
|
||
<!-- 输入框 -->
|
||
<el-input
|
||
v-if="scope.row.Type==='input'"
|
||
v-model="scope.row.Answers[task.VisitTaskId]"
|
||
size="mini"
|
||
@change="evaluateReasonChange"
|
||
/>
|
||
<p style="width: 180px;white-space: normal;word-break: break-all;word-wrap: break-word;">系统评估结果为:<span style="color:red">{{ $fd('OverallAssessment',tumorEvaluate) }}</span>,与当前调整的结果不一致,请填写调整原因</p>
|
||
</template>
|
||
|
||
<template v-else-if="scope.row.DictionaryCode">
|
||
{{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }}
|
||
</template>
|
||
|
||
<template v-else-if="scope.row.Answers && scope.row.Answers.hasOwnProperty(task.VisitTaskId)">
|
||
{{ isNaN(parseInt(scope.row.Answers[task.VisitTaskId]))?scope.row.Answers[task.VisitTaskId]:parseInt(scope.row.Answers[task.VisitTaskId])>0?`${scope.row.Answers[task.VisitTaskId]}mm`:'' }}
|
||
<!-- isNaN(parseInt(scope.row.Answers[task.VisitTaskId]))?'':`${scope.row.Answers[task.VisitTaskId]}mm` -->
|
||
<!-- {{ 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 Store from './Store'
|
||
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: '',
|
||
currentEvaluateResult: '',
|
||
answerArr: []
|
||
}
|
||
},
|
||
watch: {
|
||
taskQuestions() {
|
||
this.$nextTick(() => {
|
||
this.$refs.reportList.doLayout()
|
||
})
|
||
}
|
||
},
|
||
mounted() {
|
||
window.addEventListener('resize', this.handleResize)
|
||
Store.$on('getReportInfo', isRefresh => {
|
||
if (!isRefresh) return
|
||
this.getReportInfo()
|
||
})
|
||
this.getReportInfo()
|
||
},
|
||
beforeDestroy() {
|
||
Store.$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.TumorEvaluate ? parseInt(res.Result.TumorEvaluate) : null
|
||
var questions = []
|
||
this.answerArr = []
|
||
res.Result.TaskQuestions.forEach((item, index) => {
|
||
if (!([3, 4, 5, 6, 2].includes(item.QuestionMark))) {
|
||
const obj = item
|
||
obj.Answers = {}
|
||
|
||
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 === 13) {
|
||
this.currentEvaluateResult = obj.Answers[this.visitTaskId]
|
||
this.answerArr.push({ id: item.QuestionId, answer: obj.Answers[this.visitTaskId], questionType: 14 })
|
||
}
|
||
if (item.QuestionType === 14) {
|
||
this.answerArr.push({ id: item.QuestionId, answer: obj.Answers[this.visitTaskId], questionType: 14 })
|
||
}
|
||
if (item.Childrens && item.Childrens.length > 0) {
|
||
obj.Childrens = this.getQuestions(item.Childrens, obj.IsShowInDicom)
|
||
}
|
||
questions.push(obj)
|
||
}
|
||
})
|
||
this.taskQuestions = questions
|
||
this.visitTaskList = res.Result.VisitTaskList
|
||
this.loading = false
|
||
}).catch(() => { this.loading = false })
|
||
},
|
||
getQuestions(questions, isShowInDicom) {
|
||
const arr = []
|
||
if (questions.length !== 0) {
|
||
questions.forEach((item) => {
|
||
if (!([3, 4, 5, 6, 2].includes(item.QuestionMark))) {
|
||
const obj = item
|
||
obj.IsShowInDicom = isShowInDicom
|
||
obj.Answers = {}
|
||
if (item.RowIndex > 0) {
|
||
var idx = item.Childrens.findIndex(i => i.QuestionMark === 4)
|
||
if (idx > -1) {
|
||
if (item.Childrens[idx].Answer.length > 0) {
|
||
var k = item.Childrens[idx].Answer.findIndex(v => v.Answer !== '')
|
||
// var splitOrMergeType = isNaN(parseInt(item.SplitOrMergeType)) ? '' : parseInt(item.SplitOrMergeType)
|
||
if (item.SplitOrMergeLesionName && k > -1) {
|
||
obj.QuestionName = `${obj.QuestionName} -- ${item.Childrens[idx].Answer[k].Answer} (Split from ${item.SplitOrMergeLesionName})`
|
||
// obj.QuestionName = `${obj.QuestionName} `
|
||
} else if (!item.SplitOrMergeLesionName && k > -1) {
|
||
obj.QuestionName = `${obj.QuestionName} -- ${item.Childrens[idx].Answer[k].Answer}`
|
||
// 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 === 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.answerArr.push({ id: item.QuestionId, answer: obj.Answers[this.visitTaskId], questionType: 14 })
|
||
}
|
||
if (item.Childrens.length >= 1) {
|
||
obj.Childrens = this.getQuestions(item.Childrens, isShowInDicom)
|
||
}
|
||
arr.push(obj)
|
||
}
|
||
})
|
||
}
|
||
return arr
|
||
},
|
||
handleEvaluateResultChange(val) {
|
||
this.currentEvaluateResult = parseInt(val)
|
||
var idx = this.answerArr.findIndex(i => i.questionType === 13)
|
||
this.answerArr[idx].answer = val
|
||
},
|
||
evaluateReasonChange(val) {
|
||
var idx = this.answerArr.findIndex(i => i.questionType === 14)
|
||
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>
|