Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web
continuous-integration/drone/push Build is passing Details

uat_us
DESKTOP-6C3NK6N\WXS 2024-09-06 17:18:01 +08:00
commit 605bf04e43
3 changed files with 312 additions and 80 deletions

View File

@ -19,14 +19,13 @@
</div>
</div>
<el-form-item
<!-- <el-form-item
:label="$t('trials:reading:title:lesionType')"
prop="LesionType"
:rules="[
{ required:true,message: $t('common:ruleMessage:select'), trigger: ['blur']},
]"
>
<!-- 下拉框 -->
<el-select
v-model="questionForm.LesionType"
filterable
@ -42,7 +41,7 @@
/>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item
v-for="qs in questions"
v-show="qs.ShowQuestion!==2"
@ -541,9 +540,9 @@ export default {
},
async handleClose() {
if (!this.questionForm.RowId) {
// ''
// ''
const confirm = await this.$confirm(
this.$t('trials:reading:warnning:msg49'),
this.$t('trials:reading:warnning:msg60'),
{
type: 'warning',
distinguishCancelAndClose: true

View File

@ -19,14 +19,13 @@
</div>
</div>
<el-form-item
<!-- <el-form-item
:label="$t('trials:reading:title:lesionType')"
prop="LesionType"
:rules="[
{ required:true,message: $t('common:ruleMessage:select'), trigger: ['blur']},
]"
>
<!-- 下拉框 -->
<el-select
v-model="questionForm.LesionType"
filterable
@ -42,7 +41,7 @@
/>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item
v-for="qs in questions"
v-show="qs.ShowQuestion!==2"
@ -56,14 +55,34 @@
>
<!-- 输入框 -->
<template v-if="qs.Type==='input' || qs.Type==='number'">
<template v-if="qs.Type==='input'">
<el-input
v-if="qs.Type==='input' || qs.Type==='number'"
v-model="questionForm[qs.Id]"
:disabled="!isCurrentTask || readingTaskState>=2 "
@change="((val)=>{formItemChange(val, qs)})"
/>
</template>
<!-- 数值类型 -->
<template v-if="qs.Type==='number'">
<el-input
v-model="questionForm[qs.Id]"
:disabled="!isCurrentTask || readingTaskState>=2 "
@change="((val)=>{formItemChange(val, qs)})"
@blur="limitBlur(qs.Id, qs.ValueType)"
>
<template v-if="(qs.QuestionMark===0 || qs.QuestionMark===1) && qs.Unit" slot="append">
<!-- <template v-if="qs.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(qs.Unit)) }}
</template> -->
</el-input>
</template>
<!-- 自动计算 -->
<template v-if="qs.Type==='calculation'">
<el-input
v-model="questionForm[qs.Id]"
disabled
@change="((val)=>{formItemChange(val, qs)})"
>
<template v-if="qs.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(qs.Unit)) }}
</template>
</el-input>
@ -213,11 +232,14 @@ export default {
isCurrentTaskAdd: 'False',
lesionMark: '',
deleteInfo: null,
pictureBaseStr: ''
pictureBaseStr: '',
digitPlaces: 2
}
},
mounted() {
this.trialId = this.$route.query.trialId
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
this.initForm()
DicomEvent.$on('handleImageQualityAbnormal', () => {
@ -358,9 +380,39 @@ export default {
} else {
this.$set(this.questionForm, 'saveTypeEnum', 0)
}
if (question.QuestionMark === 1001 || question.QuestionMark === 1002) {
this.questionForm[this.getQuestionId(1003)] = this.calculate([1001, 1002], '-')
}
this.$emit('resetQuestions', { saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
},
calculate(qsMarkArr, type) {
var num = 0
qsMarkArr.map((qsmark, i) => {
if (i === 0) {
const v = this.questionForm[this.getQuestionId(qsmark)]
num = isNaN(parseFloat(v)) ? 0 : parseFloat(v)
} else {
const v = this.questionForm[this.getQuestionId(qsmark)]
switch (type) {
case '-':
num -= isNaN(parseFloat(v)) ? 0 : parseFloat(v)
break
}
}
})
return parseFloat(num).toFixed(this.digitPlaces)
},
limitBlur(qId, valueType) {
const value = isNaN(parseFloat(this.questionForm[qId])) ? null : parseFloat(this.questionForm[qId])
if (value === null) return
if (valueType === 0) {
this.$set(this.questionForm, qId, parseInt(value))
} else if (valueType === 3) {
this.$set(this.questionForm, qId, parseFloat(value))
} else {
this.$set(this.questionForm, qId, parseFloat(value).toFixed(this.digitPlaces))
}
},
returnFloat(num) {
if (num) return
var value = Math.round(parseFloat(num) * 100) / 100
@ -444,6 +496,8 @@ export default {
this.$set(this.questionForm, 'RowId', res.Result.RowId)
this.$emit('resetQuestions', { saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
this.$emit('close')
DicomEvent.$emit('refreshQuestions')
DicomEvent.$emit('getReportInfo', true)
}
loading.close()
@ -487,9 +541,9 @@ export default {
},
async handleClose() {
if (!this.questionForm.RowId) {
// ''
// ''
const confirm = await this.$confirm(
this.$t('trials:reading:warnning:msg49'),
this.$t('trials:reading:warnning:msg60'),
{
type: 'warning',
distinguishCancelAndClose: true
@ -508,6 +562,7 @@ export default {
.measurement-form{
/deep/ .el-form-item__label{
color: #c3c3c3;
text-align: left;
}
/deep/ .el-input .el-input__inner{
background-color: transparent;

View File

@ -17,10 +17,17 @@
</div>
</div>
<!-- 非测量问题 -->
<!-- 影像质量问题 -->
<div class="lesions">
<Questions ref="ecrf" :question-form-change-state="questionFormChangeState" :question-form-change-num="questionFormChangeNum" />
<Questions
ref="ecrf"
:question-form-change-state="true"
:question-form-change-num="0"
:is-qulity-issues="false"
:group-classify="1"
/>
</div>
<!-- 测量问题 -->
<template v-if="questions.length > 0 && CriterionType !== 10">
<div v-for="(qs,index) in questions" :key="index" v-loading="loading" class="lesions lesions_wrapper">
@ -28,6 +35,13 @@
{{ language==='en'?qs.GroupEnName:qs.GroupName }}
</h4>
<div class="lesion_list">
<el-form
v-if="questions.length > 0"
:ref="`questions${index}`"
size="small"
:model="questionForm"
>
<div class="base-dialog-body">
<div v-for="item in qs.Childrens" :key="item.Id">
<div v-if="item.Type === 'table'" class="flex-row" style="margin:3px 0;">
<div class="title">{{ item.QuestionName }}</div>
@ -39,6 +53,7 @@
v-if="item.Type === 'table' && item.TableQuestions"
v-model="activeName"
accordion
style="margin-bottom: 10px;"
@change="handleCollapseChange"
>
<el-collapse-item
@ -51,13 +66,13 @@
{{ getLesionName(item.OrderMark,q.RowIndex) }}
<!-- 未保存 -->
<!-- <el-tooltip v-if="readingTaskState<2 && parseInt(item.TableQuestions.Answers[i].saveTypeEnum) === 0" class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
<el-tooltip v-if="readingTaskState<2 && parseInt(item.TableQuestions.Answers[i].saveTypeEnum) === 0" class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
<i class="el-icon-warning" style="color:red" />
</el-tooltip> -->
</el-tooltip>
<!-- 信息不完整 -->
<!-- <el-tooltip v-if="readingTaskState<2 && parseInt(item.TableQuestions.Answers[i].saveTypeEnum) ===1" class="item" effect="dark" :content="$t('trials:reading:button:incompleteInfor')" placement="bottom">
<el-tooltip v-if="readingTaskState<2 && parseInt(item.TableQuestions.Answers[i].saveTypeEnum) ===1" class="item" effect="dark" :content="$t('trials:reading:button:incompleteInfor')" placement="bottom">
<i class="el-icon-warning" style="color:#ff9800" />
</el-tooltip> -->
</el-tooltip>
</div>
</template>
@ -83,14 +98,79 @@
</el-collapse-item>
</el-collapse>
<template v-else>
<!-- 数值 -->
<el-form-item
v-if="item.ShowQuestion!==2"
:key="item.Id"
:label="`${item.QuestionName}`"
:prop="item.Id"
:rules="[
{ required: (item.IsRequired === 0 || (item.IsRequired ===1 && item.RelevanceId && (item.RelevanceValue.includes(questionForm[item.RelevanceId])))) && item.Type!=='group' && item.Type!=='summary',
message:['radio', 'select', 'checkbox'].includes(item.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur','change']},
]"
>
<!-- 数值类型 -->
<template v-if="item.Type==='number'">
<el-input
v-model="questionForm[item.Id]"
:disabled="!isCurrentTask || readingTaskState>=2 "
@change="((val)=>{formItemChange(val, item)})"
@blur="limitBlur(item.Id, item.ValueType)"
>
<template v-if="item.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(item.Unit)) }}
</template>
</el-input>
</template>
</el-form-item>
</template>
</div>
<div
v-if="isCurrentTask && readingTaskState<2"
class="base-dialog-footer"
style="text-align:right;margin-top:10px;"
>
<!-- 保存 -->
<el-button
type="primary"
size="mini"
:disabled="!formChanged"
@click="handleSave(index)"
>
{{ $t('common:button:save') }}
</el-button>
</div>
</div>
</el-form>
</div>
</div>
</template>
<!-- 计算值 -->
<Questions
ref="ecrf2"
:question-form-change-state="true"
:question-form-change-num="0"
:is-qulity-issues="false"
:group-classify="4"
style="margin-top:20px"
/>
<!-- 评估结果 -->
<Questions
ref="ecrf3"
:question-form-change-state="true"
:question-form-change-num="0"
:is-qulity-issues="false"
:group-classify="5"
/>
</div>
</div>
</template>
<script>
import { saveTaskQuestion } from '@/api/trials'
import { resetReadingTask } from '@/api/reading'
import DicomEvent from './../DicomEvent'
import store from '@/store'
@ -145,7 +225,10 @@ export default {
tableQuestions: [],
isFirstRender: false,
CriterionType: null,
subjectCode: ''
subjectCode: '',
questionForm: {},
formChanged: false,
digitPlaces: 2
}
},
computed: {
@ -158,7 +241,6 @@ export default {
if (val) {
this.initList()
}
console.log('lastCanvasTaskId', val)
}
},
currentReadingTaskState: {
@ -173,6 +255,8 @@ export default {
mounted() {
// this.subjectCode = this.$router.currentRoute.query.subjectCode
this.subjectCode = localStorage.getItem('subjectCode')
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
window.addEventListener('message', this.receiveMsg)
this.CriterionType = parseInt(localStorage.getItem('CriterionType'))
DicomEvent.$on('setCollapseActive', measureData => {
@ -186,6 +270,9 @@ export default {
DicomEvent.$on('getAllUnSaveLesions', (callback) => {
callback([])
})
DicomEvent.$on('refreshQuestions', _ => {
this.refreshQuestions()
})
window.addEventListener('resize', this.setHeight)
},
@ -193,6 +280,7 @@ export default {
DicomEvent.$off('setCollapseActive')
DicomEvent.$off('changeLesionType')
DicomEvent.$off('getUnSaveTarget')
DicomEvent.$off('refreshQuestions')
},
methods: {
async initList() {
@ -223,8 +311,11 @@ export default {
loading.close()
}
this.questions = this.visitTaskList[i].ReadingQuestions
this.setQuestionForm(this.questions)
this.$nextTick(() => {
this.$refs['ecrf'].getQuestions(this.visitTaskId)
this.$refs['ecrf2'].getQuestions(this.visitTaskId)
this.$refs['ecrf3'].getQuestions(this.visitTaskId)
this.getTableQuestions()
this.tableQuestions.forEach(item => {
item.TableQuestions.Answers.forEach(i => {
@ -235,6 +326,18 @@ export default {
})
}
},
setQuestionForm(questions) {
const type = ['number', 'radio', 'select', 'input', 'textarea', 'calculation']
questions.forEach(item => {
if (type.includes(item.Type)) {
const answer = item.Type === 'number' || item.Type === 'calculation' ? isNaN(parseFloat(item.Answer)) ? null : parseFloat(item.Answer) : item.Answer
this.$set(this.questionForm, item.Id, answer)
}
if (item.Childrens.length > 0) {
this.setQuestionForm(item.Childrens)
}
})
},
async resetQuestions(obj) {
this.setQuestions(this.questions, obj)
await store.dispatch('reading/setReadingQuestionAndAnswer', { questions: this.questions, visitTaskId: this.visitTaskId })
@ -245,12 +348,6 @@ export default {
questions.forEach(item => {
if (item.Type === 'table' && item.Id === obj.questionId) {
var idx = item.TableQuestions.Answers.findIndex(i => i.RowIndex === obj.rowIndex)
item.TableQuestions.Answers[idx].isLymphLesion = obj.isLymphLesion
item.TableQuestions.Answers[idx].loctation = obj.lesionOrgan
item.TableQuestions.Answers[idx].lesionPart = obj.lesionPart
item.TableQuestions.Answers[idx].lesionLength = obj.lesionLength
item.TableQuestions.Answers[idx].lesionShort = obj.lesionShort
item.TableQuestions.Answers[idx].lesionState = obj.lesionState
item.TableQuestions.Answers[idx].saveTypeEnum = obj.saveTypeEnum
for (const i in obj.anwsers) {
@ -267,7 +364,8 @@ export default {
if (item.Type === 'table' && item.TableQuestions && item.TableQuestions.Answers.length > 0) {
item.TableQuestions.Answers.forEach(answerObj => {
if (answerObj.RowId) {
this.$set(answerObj, 'saveTypeEnum', 2)
var diffVal = this.getQuestionAnswer(item.TableQuestions.Questions, 1003, answerObj)
this.$set(answerObj, 'saveTypeEnum', isNaN(parseFloat(diffVal)) ? 1 : 2)
} else {
this.$set(answerObj, 'saveTypeEnum', 0)
}
@ -319,6 +417,7 @@ export default {
if (idx > -1) {
if (this.visitTaskList[idx].ReadingQuestions.length > 0) {
this.questions = this.visitTaskList[idx].ReadingQuestions
this.setQuestionForm(this.questions)
}
this.readingTaskState = this.visitTaskList[idx].ReadingTaskState
this.isBaseLineTask = this.visitTaskList[idx].IsBaseLineTask
@ -482,6 +581,44 @@ export default {
//
setMeasuredData(measureData) {
},
formItemChange() {
this.formChanged = true
},
limitBlur(qId, valueType) {
const value = this.questionForm[qId]
if (valueType === 0) {
this.$set(this.questionForm, qId, parseInt(value))
} else if (valueType === 3) {
this.$set(this.questionForm, qId, parseFloat(value))
} else {
this.$set(this.questionForm, qId, parseFloat(value).toFixed(this.digitPlaces))
}
},
async handleSave(index) {
const refName = `questions${index}`
const valid = await this.$refs[refName][0].validate()
if (!valid) return
const loading = this.$loading({ fullscreen: true })
var answers = []
for (const k in this.questionForm) {
answers.push({ id: k, answer: this.questionForm[k] })
}
var params = {
visitTaskId: this.visitTaskId,
answers: answers
}
try {
await saveTaskQuestion(8, params)
this.$message.success(this.$t('common:message:savedSuccessfully'))
loading.close()
DicomEvent.$emit('getReportInfo', true)
this.refreshQuestions()
this.formChanged = false
} catch (e) {
console.log(e)
loading.close()
}
},
async close(questionsObj) {
if (questionsObj) {
@ -493,6 +630,8 @@ export default {
},
getECRFQuestions(obj) {
this.$refs['ecrf'].getQuestions(obj.visitTaskId)
this.$refs['ecrf2'].getQuestions(obj.visitTaskId)
this.$refs['ecrf3'].getQuestions(obj.visitTaskId)
},
async resetMeasuredData() {
const confirm = await this.$confirm(
@ -517,6 +656,8 @@ export default {
const triald = this.$router.currentRoute.query.trialId
await store.dispatch('reading/refreshDicomReadingQuestionAnswer', { trialId: triald, visitTaskId: this.visitTaskId })
this.$refs['ecrf'].getQuestions(this.visitTaskId, true)
this.$refs['ecrf2'].getQuestions(this.visitTaskId, true)
this.$refs['ecrf3'].getQuestions(this.visitTaskId, true)
DicomEvent.$emit('getReportInfo', true)
}
loading.close()
@ -525,6 +666,13 @@ export default {
console.log(e)
}
},
async refreshQuestions() {
const triald = this.$router.currentRoute.query.trialId
await store.dispatch('reading/refreshDicomReadingQuestionAnswer', { trialId: triald, visitTaskId: this.visitTaskId })
this.$refs['ecrf'].getQuestions(this.visitTaskId, true)
this.$refs['ecrf2'].getQuestions(this.visitTaskId, true)
this.$refs['ecrf3'].getQuestions(this.visitTaskId, true)
},
receiveMsg(event) {
}
@ -584,6 +732,36 @@ export default {
}
.lesion_list{
position: relative;
/deep/ .el-form-item__label{
color: #c3c3c3;
text-align: left;
}
/deep/ .el-input .el-input__inner{
background-color: transparent;
color: #ddd;
border: 1px solid #5e5e5e;
}
/deep/ .el-form-item{
display: flex;
flex-direction: row;
justify-content: flex-start;
}
/deep/ .el-form-item__content{
flex: 1;
}
/deep/ .el-input.is-disabled .el-input__inner{
background-color: #646464a1;
}
/deep/ .el-select.is-disabled .el-input__inner{
background-color: #646464a1;
}
/deep/ .el-button--mini, .el-button--mini.is-round {
padding: 7px 10px;
}
.el-form-item__content
.el-select{
width: 100%;
}
}
.el-collapse{
border-bottom:none;