裁判阅片及规则配置更改
parent
38ef9c9d58
commit
2b04301d1c
|
|
@ -488,3 +488,51 @@ export function setRandomTaskOrder(data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getJudgeForm(data) {
|
||||
return request({
|
||||
url: `/ReadingImageTask/getJudgeForm`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function setJudgeForm(data) {
|
||||
return request({
|
||||
url: `/ReadingImageTask/setJudgeForm`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getSingleVisitJudgeAnswer(data) {
|
||||
return request({
|
||||
url: `/ReadingImageTask/getSingleVisitJudgeAnswer`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function submitJudgeForm(data) {
|
||||
return request({
|
||||
url: `/Inspection/ReadingImageTask/SubmitJudgeForm`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getTrialQuestionVisitJudgeRule(data) {
|
||||
return request({
|
||||
url: `/ReadingQuestion/getTrialQuestionVisitJudgeRule`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function setTrialQuestionVisitJudgeRule(data) {
|
||||
return request({
|
||||
url: `/ReadingQuestion/setTrialQuestionVisitJudgeRule`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,14 @@ export function getTrialJudgyInfo(params) {
|
|||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export function setTrialJudgeRuleInfo(params) {
|
||||
return request({
|
||||
url: `/ReadingQuestion/setTrialJudgeRuleInfo`,
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// 获取检查部位列表
|
||||
export function getTrialBodyPartList(params) {
|
||||
return request({
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -30,12 +30,12 @@
|
|||
<div class="image-viewer__actions__inner">
|
||||
<i class="el-icon-zoom-out" @click="handleActions('zoomOut')" />
|
||||
<i class="el-icon-zoom-in" @click="handleActions('zoomIn')" />
|
||||
<i class="el-image-viewer__actions__divider" />
|
||||
<!-- <i class="el-image-viewer__actions__divider" /> -->
|
||||
<i class="el-icon-c-scale-to-original" @click="toggleMode" />
|
||||
<i class="el-image-viewer__actions__divider" />
|
||||
<!-- <i class="el-image-viewer__actions__divider" /> -->
|
||||
<i class="el-icon-refresh-left" @click="handleActions('anticlocelise')" />
|
||||
<i class="el-icon-refresh-right" @click="handleActions('clocelise')" />
|
||||
<i v-if="readingTaskState < 2" class="el-icon-bottom-right"
|
||||
<i v-if="readingTaskState < 2 && taskInfo.CriterionType !== 19 && taskInfo.CriterionType !== 20" class="el-icon-bottom-right"
|
||||
:style="{ cursor: isToolDisabled || readingTaskState >= 2 ? 'not-allowed' : 'pointer' }"
|
||||
@click="handleDrawArrow" />
|
||||
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
:style="{cursor:isToolDisabled || readingTaskState >=2 ?'not-allowed':'pointer'}"
|
||||
@click="handleDrawRectangle"
|
||||
/> -->
|
||||
<svg-icon v-if="readingTaskState < 2" icon-class="rectangle" class="svg-icon"
|
||||
<svg-icon v-if="readingTaskState < 2 && taskInfo.CriterionType !== 19 && taskInfo.CriterionType !== 20" icon-class="rectangle" class="svg-icon"
|
||||
:style="{ cursor: isToolDisabled || readingTaskState >= 2 ? 'not-allowed' : 'pointer' }"
|
||||
@click="handleDrawRectangle" />
|
||||
</div>
|
||||
|
|
@ -109,6 +109,7 @@ export default {
|
|||
}
|
||||
},
|
||||
data() {
|
||||
const taskInfo = JSON.parse(localStorage.getItem('taskInfo') || '{}')
|
||||
return {
|
||||
loading: false,
|
||||
index: this.initialIndex,
|
||||
|
|
@ -137,11 +138,13 @@ export default {
|
|||
currentDrawData: {},
|
||||
canvasData: [],
|
||||
imgZoom: 1,
|
||||
isDragging: false,
|
||||
isToolDisabled: false,
|
||||
lesionName: '',
|
||||
visitTaskId: '',
|
||||
isInit: false,
|
||||
imgSize: { height: '', width: '' } // 图片原始尺寸
|
||||
imgSize: { height: '', width: '' }, // 图片原始尺寸
|
||||
taskInfo
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -209,6 +212,10 @@ export default {
|
|||
}
|
||||
this.deviceSupportInstall()
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('message', this.receiveMsg)
|
||||
this.stopDragging()
|
||||
},
|
||||
methods: {
|
||||
getCanvasData() {
|
||||
return new Promise(async resolve => {
|
||||
|
|
@ -337,25 +344,55 @@ export default {
|
|||
// 初始化画布
|
||||
initCanvas(img) {
|
||||
this.loading = true
|
||||
this.canvasSize.height = img.height
|
||||
this.canvasSize.width = img.width
|
||||
|
||||
this.imgSize.height = img.height
|
||||
this.imgSize.width = img.width
|
||||
|
||||
const canvasDiv = document.getElementsByClassName('image-viewer__canvas')[0]
|
||||
const widthRatio = canvasDiv && canvasDiv.offsetWidth ? canvasDiv.offsetWidth / img.width : 1
|
||||
const heightRatio = canvasDiv && canvasDiv.offsetHeight ? canvasDiv.offsetHeight / img.height : 1
|
||||
this.imgZoom = Math.min(widthRatio, heightRatio, 1)
|
||||
this.canvasSize.height = Math.round(img.height * this.imgZoom)
|
||||
this.canvasSize.width = Math.round(img.width * this.imgZoom)
|
||||
this.canvasPosition = {
|
||||
x: canvasDiv.offsetWidth / 2 - img.width / 2,
|
||||
y: canvasDiv.offsetHeight / 2 - img.height / 2 - 25
|
||||
x: canvasDiv.offsetWidth / 2 - this.canvasSize.width / 2,
|
||||
y: canvasDiv.offsetHeight / 2 - this.canvasSize.height / 2 - 25
|
||||
} // 背景居中
|
||||
|
||||
this.$nextTick(async () => {
|
||||
ctx = document.getElementById('canvas').getContext('2d') // 获取上下文
|
||||
await ctx.drawImage(img, 0, 0, img.width, img.height) // 在canvas中绘制图片(图片、起始位置、绘图尺寸)
|
||||
await ctx.drawImage(img, 0, 0, this.canvasSize.width, this.canvasSize.height) // 在canvas中绘制图片(图片、起始位置、绘图尺寸)
|
||||
this.drawToArr()
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
scalePoint(point) {
|
||||
return {
|
||||
x: point.x * this.imgZoom,
|
||||
y: point.y * this.imgZoom
|
||||
}
|
||||
},
|
||||
startDragging(e) {
|
||||
const { offsetX, offsetY } = this.transform
|
||||
const startX = e.pageX
|
||||
const startY = e.pageY
|
||||
this.isDragging = true
|
||||
this._dragHandler = rafThrottle((ev) => {
|
||||
this.transform.offsetX = offsetX + ev.pageX - startX
|
||||
this.transform.offsetY = offsetY + ev.pageY - startY
|
||||
})
|
||||
this._dragEndHandler = () => {
|
||||
this.stopDragging()
|
||||
}
|
||||
on(document, 'mousemove', this._dragHandler)
|
||||
on(document, 'mouseup', this._dragEndHandler)
|
||||
},
|
||||
stopDragging() {
|
||||
off(document, 'mousemove', this._dragHandler)
|
||||
off(document, 'mouseup', this._dragEndHandler)
|
||||
this._dragHandler = null
|
||||
this._dragEndHandler = null
|
||||
this.isDragging = false
|
||||
},
|
||||
|
||||
// 清空画布
|
||||
clearCanvas() {
|
||||
|
|
@ -381,6 +418,11 @@ export default {
|
|||
if (e.button !== 0) {
|
||||
return
|
||||
}
|
||||
if (!this.model) {
|
||||
this.startDragging(e)
|
||||
e.preventDefault()
|
||||
return
|
||||
}
|
||||
this.isMouseDown = true // 打开鼠标状态
|
||||
// 获取画布中鼠标开始点击位置
|
||||
this.canvasMouseStart = {
|
||||
|
|
@ -391,6 +433,9 @@ export default {
|
|||
|
||||
// 鼠标移动事件
|
||||
async handleMouseMove(e) {
|
||||
if (!this.model || this.isDragging) {
|
||||
return
|
||||
}
|
||||
// 获取屏幕中鼠标位置(显示实时坐标)
|
||||
this.mousePosition = {
|
||||
x: e.pageX,
|
||||
|
|
@ -437,10 +482,12 @@ export default {
|
|||
var headlen = 10// 自定义箭头线的长度
|
||||
var theta = 45// 自定义箭头线与直线的夹角
|
||||
var arrowX, arrowY// 箭头线终点坐标
|
||||
var fromX = e.data.handles.start.x
|
||||
var fromY = e.data.handles.start.y
|
||||
var toX = e.data.handles.end.x
|
||||
var toY = e.data.handles.end.y
|
||||
var start = this.scalePoint(e.data.handles.start)
|
||||
var end = this.scalePoint(e.data.handles.end)
|
||||
var fromX = start.x
|
||||
var fromY = start.y
|
||||
var toX = end.x
|
||||
var toY = end.y
|
||||
// 计算各角度和对应的箭头终点坐标
|
||||
var angle = Math.atan2(fromY - toY, fromX - toX) * 180 / Math.PI
|
||||
var angle1 = (angle + theta) * Math.PI / 180
|
||||
|
|
@ -453,8 +500,8 @@ export default {
|
|||
// 画直线
|
||||
ctx.lineWidth = this.lineWidth
|
||||
ctx.beginPath()
|
||||
ctx.moveTo(fromX * this.imgZoom, fromY * this.imgZoom)
|
||||
ctx.lineTo(toX * this.imgZoom, toY * this.imgZoom)
|
||||
ctx.moveTo(fromX, fromY)
|
||||
ctx.lineTo(toX, toY)
|
||||
|
||||
arrowX = toX + topX
|
||||
arrowY = toY + topY
|
||||
|
|
@ -473,18 +520,16 @@ export default {
|
|||
ctx.lineWidth = this.lineWidth
|
||||
ctx.beginPath()
|
||||
ctx.strokeStyle = this.color
|
||||
const start = this.scalePoint(e.data.handles.start)
|
||||
const end = this.scalePoint(e.data.handles.end)
|
||||
// 绘制矩形边框
|
||||
ctx.strokeRect(
|
||||
// this.canvasMouseStart.x,
|
||||
// this.canvasMouseStart.y,
|
||||
// e.offsetX - this.canvasMouseStart.x,
|
||||
// e.offsetY - this.canvasMouseStart.y
|
||||
e.data.handles.start.x,
|
||||
e.data.handles.start.y,
|
||||
e.data.handles.end.x - e.data.handles.start.x,
|
||||
e.data.handles.end.y - e.data.handles.start.y
|
||||
start.x,
|
||||
start.y,
|
||||
end.x - start.x,
|
||||
end.y - start.y
|
||||
)
|
||||
this.drawText(ctx, { x: e.data.handles.start.x, y: e.data.handles.start.y }, { x: e.data.handles.end.x, y: e.data.handles.end.y }, e.data.remark, this.color)
|
||||
this.drawText(ctx, start, end, e.data.remark, this.color)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -495,6 +540,10 @@ export default {
|
|||
if (e.button !== 0) {
|
||||
return // 非左键松开
|
||||
}
|
||||
if (this.isDragging) {
|
||||
this.stopDragging()
|
||||
return
|
||||
}
|
||||
|
||||
// 左键松开
|
||||
if (this.model === 'ArrowAnnotate' || this.model === 'RectangleRoi') {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,60 @@
|
|||
<!-- eslint-disable -->
|
||||
<!-- eslint-disable vue/no-unused-vars -->
|
||||
<!-- eslint-disable vue/no-template-shadow -->
|
||||
/* eslint-disable */
|
||||
<template>
|
||||
<el-form v-loading="loading">
|
||||
<el-form v-loading="loading" :label-width="'100px'">
|
||||
<!-- 仲裁对象 -->
|
||||
<el-form-item :label="$t('trials:adRules:title:arbitrationRule')" :label-width="'180px'">
|
||||
<el-radio-group v-model="JudgyInfo.ArbitrationRule" :disabled="OtherInfo.IsSign">
|
||||
<el-form-item :label="$t('trials:adRules:title:arbitrationRule')">
|
||||
<el-radio-group v-model="JudgyInfo.ArbitrationRule" :disabled="isSign">
|
||||
<el-radio v-for="item of $d.ArbitrationRule" :key="item.id"
|
||||
:disabled="!JudgyInfo.IsReadingTaskViewInOrder || true" :label="item.value" @change="changeArbitrationRule">
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-collapse v-model="activeNames" style="border-top:none;">
|
||||
<!-- 仲裁模式JudgeModeEnum 整体结果择一判定;指标组合判定-->
|
||||
<el-form-item :label="$t('trials:adRules:title:judgeMode')">
|
||||
<el-radio-group v-model="JudgyInfo.JudgeModeEnum" :disabled="isSign">
|
||||
<el-radio
|
||||
v-for="item of $d.JudgeMode"
|
||||
:key="item.id"
|
||||
:disabled="JudgyInfo.ArbitrationRule !== 1"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- 裁判规则JudgeRuleEnum 访视一致规则;访视差异规则-->
|
||||
<el-form-item :label="$t('trials:adRules:title:judgeRule')">
|
||||
<el-radio-group v-model="JudgyInfo.JudgeRuleEnum" :disabled="isSign">
|
||||
<el-radio
|
||||
v-for="item of $d.JudgeRule"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="saveJugeRule"
|
||||
v-show="!isSign">
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<ArbitrationRulesByVisit
|
||||
v-if="judgeRuleEnum === 1"
|
||||
ref="visitRules"
|
||||
:trial-reading-criterion-id="trialReadingCriterionId"
|
||||
:isSign="isSign"
|
||||
/>
|
||||
<el-collapse v-else-if="judgeRuleEnum === 0" v-model="activeNames" style="border-top:none;">
|
||||
<el-collapse-item v-for="(item, index) of QuestionList" :key="item.ReadingQuestionTrialId"
|
||||
style="position: relative;padding:0 10px;" :name="item.ReadingQuestionTrialId">
|
||||
<div slot="title">
|
||||
|
|
@ -21,24 +63,28 @@
|
|||
<div style="position: relative">
|
||||
<el-button v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']"
|
||||
style="position: absolute; right: 0; top: 0; z-index: 10" size="mini" type="primary"
|
||||
:disabled="OtherInfo.IsSign" @click="apply(item.ReadingQuestionTrialId, index)">{{ $t('common:button:save')
|
||||
:disabled="isSign" @click="apply(item.ReadingQuestionTrialId, index)">{{ $t('common:button:save')
|
||||
}}</el-button>
|
||||
<el-button v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']"
|
||||
style="position: absolute; right: 60px; top: 0; z-index: 10" size="mini" type="primary"
|
||||
:disabled="OtherInfo.IsSign" @click="reset(item.ReadingQuestionTrialId, index)">{{ $t('common:button:reset')
|
||||
:disabled="isSign" @click="reset(item.ReadingQuestionTrialId, index)">{{ $t('common:button:reset')
|
||||
}}</el-button>
|
||||
<!-- 产生裁判阅片的条件 -->
|
||||
<el-form-item :label-width="'280px'" :label="$t('trials:adRules:title:judgeTypeEnum')" style="width: 95%">
|
||||
<el-radio-group v-model="QuestionList[index].JudgeType" @input="(val) => JudgeTypeChange(val, index)">
|
||||
<template v-for="item of $d.JudgeTypeEnum">
|
||||
<el-radio style="margin-bottom: 5px" :key="item.id" :disabled="OtherInfo.IsSign ||
|
||||
!hasPermi(['trials:trials-panel:setting:reading-unit:edit'])
|
||||
" :label="item.value" v-if="
|
||||
item.value < 4 ||
|
||||
(item.value > 3 &&
|
||||
(QuestionList[index].Type === 'number' ||
|
||||
QuestionList[index].Type === 'calculation'))
|
||||
">
|
||||
<el-radio
|
||||
style="margin-bottom: 5px"
|
||||
:key="item.id"
|
||||
:disabled="isSign || !hasPermi(['trials:trials-panel:setting:reading-unit:edit'])"
|
||||
:label="item.value"
|
||||
v-if="
|
||||
(['number', 'calculation'].includes(QuestionList[index].Type)
|
||||
? [1, 4, 5]
|
||||
: [1, 2, 3]
|
||||
).includes(item.value)
|
||||
"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</template>
|
||||
|
|
@ -48,7 +94,7 @@
|
|||
<div v-if="QuestionList[index].JudgeType === 3" style="text-align: right; margin: 10px 0">
|
||||
<!-- 添加规则 -->
|
||||
<el-button v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']" size="mini" type="primary"
|
||||
:disabled="OtherInfo.IsSign" @click="addGroup(index, null)">{{ $t('trials:adRules:button:addRule')
|
||||
:disabled="isSign" @click="addGroup(index, null)">{{ $t('trials:adRules:button:addRule')
|
||||
}}</el-button>
|
||||
</div>
|
||||
<el-table v-if="QuestionList[index].JudgeType === 3" v-loading="loading"
|
||||
|
|
@ -87,10 +133,10 @@
|
|||
<template slot-scope="scope">
|
||||
<!-- 编辑 -->
|
||||
<el-button icon="el-icon-edit" circle :title="$t('common:button:edit')" size="mini"
|
||||
:disabled="OtherInfo.IsSign" @click="addGroup(index, scope.$index)" />
|
||||
:disabled="isSign" @click="addGroup(index, scope.$index)" />
|
||||
<!-- 删除 -->
|
||||
<el-button icon="el-icon-delete" circle :title="$t('common:button:delete')" size="mini"
|
||||
:disabled="OtherInfo.IsSign" @click="tagClose(index, scope.$index)" />
|
||||
:disabled="isSign" @click="tagClose(index, scope.$index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -103,12 +149,12 @@
|
|||
">
|
||||
<el-checkbox-group v-if="QuestionList[index].QuestionGenre === 3" v-model="QuestionList[index].grouping">
|
||||
<template v-for="item of $d[QuestionList[index].DictionaryCode]">
|
||||
<el-checkbox v-if="item.value !== -1" :key="item.id" :disabled="OtherInfo.IsSign" :label="item.value">{{
|
||||
<el-checkbox v-if="item.value !== -1" :key="item.id" :disabled="isSign" :label="item.value">{{
|
||||
item.label }}</el-checkbox>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
<el-checkbox-group v-else v-model="QuestionList[index].grouping">
|
||||
<el-checkbox v-for="item of item.TypeValue.split('|')" :key="item" :disabled="OtherInfo.IsSign"
|
||||
<el-checkbox v-for="item of item.TypeValue.split('|')" :key="item" :disabled="isSign"
|
||||
:label="item">{{
|
||||
item }}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
|
|
@ -135,7 +181,7 @@
|
|||
.toString()
|
||||
.replaceAll(',', '|')
|
||||
}}</el-tag>
|
||||
<el-button size="mini" type="primary" :disabled="OtherInfo.IsSign" @click="addGroup2(index)">
|
||||
<el-button size="mini" type="primary" :disabled="isSign" @click="addGroup2(index)">
|
||||
<!-- 添加分组 -->
|
||||
{{ $t('trials:adRules:title:addGroup') }}
|
||||
</el-button>
|
||||
|
|
@ -181,7 +227,7 @@
|
|||
)
|
||||
" prop="JudgeDifferenceType">
|
||||
<el-select v-model="QuestionList[index].JudgeDifferenceType" placeholder="请选择"
|
||||
:disabled="OtherInfo.IsSign">
|
||||
:disabled="isSign">
|
||||
<el-option v-for="item of $d.JudgeDifferenceType" :key="item.id" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
|
|
@ -193,7 +239,7 @@
|
|||
" prop="JudgeDifferenceValue">
|
||||
<div style="display: flex">
|
||||
<el-input v-model="QuestionList[index].JudgeDifferenceValue" clearable
|
||||
:disabled="OtherInfo.IsSign"></el-input>
|
||||
:disabled="isSign"></el-input>
|
||||
<span style="margin-left: 10px" v-if="QuestionList[index].JudgeType !== 5 && QuestionList[index].Unit !== 0">
|
||||
{{ `${QuestionList[index].Unit === 4 ? QuestionList[index].CustomUnit : $fd('ValueUnit', QuestionList[index].Unit)}`}}
|
||||
</span>
|
||||
|
|
@ -203,8 +249,6 @@
|
|||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<!-- </el-tab-pane>-->
|
||||
<!-- </el-tabs>-->
|
||||
<!-- 选择答案 -->
|
||||
<el-dialog v-if="QuestionVisible" :title="$t('trials:adRules:title:selectAnswer')" :visible.sync="QuestionVisible"
|
||||
width="800px" :close-on-click-modal="false" custom-class="base-dialog-wrapper" append-to-body>
|
||||
|
|
@ -212,40 +256,50 @@
|
|||
<!-- 阅片人A -->
|
||||
<el-form-item label-width="110px" :label="$t('trials:adRules:title:answerGroupA')">
|
||||
<el-checkbox-group v-model="QuestionList[selectIndex].groupingA">
|
||||
<template v-for="item of QuestionList[selectIndex].TypeValue.split('|')">
|
||||
<el-checkbox v-if="QuestionList[selectIndex].QuestionGenre !== 3" :key="item" :label="item" :disabled="QuestionList[selectIndex].groupingB.length
|
||||
? ~QuestionList[selectIndex].groupingB.indexOf(item)
|
||||
: false
|
||||
">{{ item }}</el-checkbox>
|
||||
<template v-for="item of QuestionList[selectIndex].TypeValue.split('|') || []">
|
||||
<el-checkbox
|
||||
v-if="QuestionList[selectIndex].QuestionGenre !== 3"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:disabled="QuestionList[selectIndex]?.groupingB?.includes(item) ?? false"
|
||||
>
|
||||
{{ item }}
|
||||
</el-checkbox>
|
||||
</template>
|
||||
<template v-for="item of $d[QuestionList[selectIndex].DictionaryCode]">
|
||||
<el-checkbox v-if="
|
||||
QuestionList[selectIndex].QuestionGenre === 3 &&
|
||||
item.value !== -1
|
||||
" :key="item.id" :label="item.value" :disabled="QuestionList[selectIndex].groupingB.length
|
||||
? ~QuestionList[selectIndex].groupingB.indexOf(item.value)
|
||||
: false
|
||||
">{{ item.label }}</el-checkbox>
|
||||
<el-checkbox
|
||||
v-if="QuestionList[selectIndex].QuestionGenre === 3 && item.value !== -1"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
:disabled="QuestionList[selectIndex]?.groupingB?.includes(item.value) ?? false"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<!-- 阅片人B -->
|
||||
<el-form-item label-width="110px" :label="$t('trials:adRules:title:answerGroupB')">
|
||||
<el-checkbox-group v-model="QuestionList[selectIndex].groupingB">
|
||||
<template v-for="item of QuestionList[selectIndex].TypeValue.split('|')">
|
||||
<el-checkbox v-if="QuestionList[selectIndex].QuestionGenre !== 3" :key="item" :label="item" :disabled="QuestionList[selectIndex].groupingA.length
|
||||
? ~QuestionList[selectIndex].groupingA.indexOf(item)
|
||||
: false
|
||||
">{{ item }}</el-checkbox>
|
||||
<template v-for="item of QuestionList[selectIndex].TypeValue.split('|') || []">
|
||||
<el-checkbox
|
||||
v-if="QuestionList[selectIndex].QuestionGenre !== 3"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:disabled="QuestionList[selectIndex]?.groupingA?.includes(item) ?? false"
|
||||
>
|
||||
{{ item }}
|
||||
</el-checkbox>
|
||||
</template>
|
||||
<template v-for="item of $d[QuestionList[selectIndex].DictionaryCode]">
|
||||
<el-checkbox v-if="
|
||||
QuestionList[selectIndex].QuestionGenre === 3 &&
|
||||
item.value !== -1
|
||||
" :key="item.id" :label="item.value" :disabled="QuestionList[selectIndex].groupingA.length
|
||||
? ~QuestionList[selectIndex].groupingA.indexOf(item.value)
|
||||
: false
|
||||
">{{ item.label }}</el-checkbox>
|
||||
<el-checkbox
|
||||
v-if="QuestionList[selectIndex].QuestionGenre === 3 && item.value !== -1"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
:disabled="QuestionList[selectIndex]?.groupingA?.includes(item.value) ?? false"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
|
|
@ -255,8 +309,8 @@
|
|||
<el-button v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']" :disabled="btnLoading" size="small"
|
||||
type="primary" @click="
|
||||
QuestionVisible = false
|
||||
$set(QuestionList[selectIndex], 'groupingA', [])
|
||||
$set(QuestionList[selectIndex], 'groupingB', [])
|
||||
$set(QuestionList[selectIndex], 'groupingA', [])
|
||||
$set(QuestionList[selectIndex], 'groupingB', [])
|
||||
">
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
|
|
@ -269,13 +323,17 @@
|
|||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
/* eslint-disable */
|
||||
import {
|
||||
getTrialConfirmCriterionList,
|
||||
getTrialCriterionJudgeQuestionList,
|
||||
setTrialCriterionJudgeQuestionAnswerGroup,
|
||||
} from '@/api/trials/reading'
|
||||
import { setTrialJudgyInfo, getTrialJudgyInfo } from '@/api/trials/setting'
|
||||
import { setTrialJudgyInfo, getTrialJudgyInfo, setTrialJudgeRuleInfo } from '@/api/trials/setting'
|
||||
import ArbitrationRulesByVisit from './ArbitrationRulesByVisit'
|
||||
export default {
|
||||
components: {
|
||||
ArbitrationRulesByVisit,
|
||||
},
|
||||
props: {
|
||||
trialReadingCriterionId: {
|
||||
type: String,
|
||||
|
|
@ -294,9 +352,7 @@ export default {
|
|||
activeNames: null,
|
||||
indexA: null,
|
||||
type: null,
|
||||
OtherInfo: {
|
||||
IsSign: true,
|
||||
},
|
||||
isSign: true,
|
||||
JudgyInfo: {},
|
||||
JudgeDifferenceValueQRules: {
|
||||
JudgeDifferenceType: [
|
||||
|
|
@ -339,47 +395,25 @@ export default {
|
|||
},
|
||||
],
|
||||
},
|
||||
judgeRuleEnum: -1,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
TrialReadingCriterionId(v) {
|
||||
async trialReadingCriterionId(v) {
|
||||
if (v === null) return
|
||||
this.loading = true
|
||||
getTrialCriterionJudgeQuestionList({
|
||||
TrialId: this.$route.query.trialId,
|
||||
// ReadingQuestionCriterionTrialId: v,
|
||||
TrialReadingCriterionId: this.trialReadingCriterionId,
|
||||
})
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
this.QuestionList = res.Result
|
||||
this.OtherInfo = res.OtherInfo
|
||||
this.activeNames = this.QuestionList.map(
|
||||
(v) => v.ReadingQuestionTrialId
|
||||
)
|
||||
this.QuestionList.forEach((v) => {
|
||||
this.$set(v, 'grouping', [])
|
||||
this.$set(v, 'groupingA', [])
|
||||
this.$set(v, 'groupingB', [])
|
||||
this.$set(
|
||||
v,
|
||||
'AnswerGroupList',
|
||||
Object.assign([], v.AnswerCombination)
|
||||
)
|
||||
this.$set(v, 'AnswerGroup2List', Object.assign([], v.AnswerGroup))
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.btnLoading = false
|
||||
this.loading = false
|
||||
})
|
||||
await this.initData()
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.getTrialJudgyInfo()
|
||||
async mounted() {
|
||||
await this.initData()
|
||||
},
|
||||
methods: {
|
||||
async initData() {
|
||||
await this.getTrialJudgyInfo()
|
||||
if (this.judgeRuleEnum !== 1) {
|
||||
await this.getList()
|
||||
}
|
||||
},
|
||||
// 修改仲裁规则
|
||||
changeArbitrationRule(value) {
|
||||
if (value !== 1) {
|
||||
|
|
@ -387,6 +421,9 @@ export default {
|
|||
item.JudgeDifferenceValue = 0
|
||||
item.JudgeDifferenceType = 0
|
||||
})
|
||||
if (this.$refs.visitRules) {
|
||||
this.$refs.visitRules.changeArbitrationRule(value)
|
||||
}
|
||||
}
|
||||
},
|
||||
JudgeTypeChange(value, index) {
|
||||
|
|
@ -400,25 +437,25 @@ export default {
|
|||
})
|
||||
},
|
||||
saveAllSync() {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.judgeRuleEnum === 1 && this.$refs.visitRules) {
|
||||
return this.$refs.visitRules.saveAllSync()
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
var arr = []
|
||||
this.QuestionList.forEach((v, i) => {
|
||||
arr.push(this.applySync(v.ReadingQuestionTrialId, i))
|
||||
})
|
||||
Promise.all(arr)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
.then(() => {
|
||||
resolve(true)
|
||||
})
|
||||
.catch((res) => {
|
||||
console.log('进入catch')
|
||||
.catch(() => {
|
||||
resolve(false)
|
||||
})
|
||||
})
|
||||
},
|
||||
applySync(ReadingQuestionTrialId, index) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
console.log(this.QuestionList[index].JudgeType)
|
||||
if (this.QuestionList[index].JudgeType === 0) {
|
||||
reject(false)
|
||||
return
|
||||
|
|
@ -442,7 +479,7 @@ export default {
|
|||
this.QuestionList[index].JudgeType === 5
|
||||
) {
|
||||
try {
|
||||
let validate = await this.$refs[
|
||||
const validate = await this.$refs[
|
||||
'JudgeDifferenceValue' +
|
||||
this.QuestionList[index].JudgeType +
|
||||
index
|
||||
|
|
@ -493,19 +530,55 @@ export default {
|
|||
this.loading = false
|
||||
})
|
||||
},
|
||||
getTrialJudgyInfo() {
|
||||
this.loading = true
|
||||
getTrialJudgyInfo({
|
||||
TrialId: this.$route.query.trialId,
|
||||
TrialReadingCriterionId: this.trialReadingCriterionId,
|
||||
})
|
||||
.then((res) => {
|
||||
this.JudgyInfo = res.Result
|
||||
this.loading = false
|
||||
})
|
||||
.catch((v) => {
|
||||
this.loading = false
|
||||
async getTrialJudgyInfo() {
|
||||
try {
|
||||
this.loading = true
|
||||
const res = await getTrialJudgyInfo({
|
||||
TrialId: this.$route.query.trialId,
|
||||
TrialReadingCriterionId: this.trialReadingCriterionId,
|
||||
})
|
||||
this.JudgyInfo = res.Result
|
||||
this.judgeRuleEnum = this.JudgyInfo.JudgeRuleEnum
|
||||
this.isSign = res.Result.IsSigned
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async saveJugeRule(showMessage = true) {
|
||||
try {
|
||||
this.loading = true
|
||||
const prevJudgeRuleEnum = this.judgeRuleEnum
|
||||
const params = {
|
||||
trialReadingCriterionId: this.trialReadingCriterionId,
|
||||
judgeModeEnum: this.JudgyInfo.JudgeModeEnum,
|
||||
judgeRuleEnum: this.JudgyInfo.JudgeRuleEnum,
|
||||
}
|
||||
const res = await setTrialJudgeRuleInfo(params)
|
||||
if (res.IsSuccess) {
|
||||
if (showMessage) {
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
}
|
||||
this.judgeRuleEnum = this.JudgyInfo.JudgeRuleEnum
|
||||
if (prevJudgeRuleEnum !== this.judgeRuleEnum) {
|
||||
if (this.judgeRuleEnum === 1) {
|
||||
await this.$nextTick()
|
||||
if (this.$refs.visitRules) {
|
||||
await this.$refs.visitRules.initData()
|
||||
}
|
||||
} else {
|
||||
await this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
return false
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
tagClose2(index, indexA) {
|
||||
// '删除该规则组?'
|
||||
|
|
@ -593,7 +666,7 @@ export default {
|
|||
AnswerCombination: [],
|
||||
JudgeType: 0,
|
||||
JudgeDifferenceValue: 0,
|
||||
JudgeDifferenceType: 0,
|
||||
JudgeDifferenceType: 0
|
||||
})
|
||||
.then((res) => {
|
||||
this.$set(this.QuestionList[index], 'AnswerGroup2List', [])
|
||||
|
|
@ -635,7 +708,7 @@ export default {
|
|||
this.QuestionList[index].JudgeType === 5
|
||||
) {
|
||||
try {
|
||||
let validate = await this.$refs[
|
||||
const validate = await this.$refs[
|
||||
'JudgeDifferenceValue' + this.QuestionList[index].JudgeType + index
|
||||
][0].validate()
|
||||
if (!validate) return
|
||||
|
|
@ -655,7 +728,7 @@ export default {
|
|||
),
|
||||
JudgeDifferenceType: Number(
|
||||
this.QuestionList[index].JudgeDifferenceType
|
||||
),
|
||||
)
|
||||
})
|
||||
.then((res) => {
|
||||
this.$message.success(this.$t('trials:adRules:message:msg9')) // '应用成功'
|
||||
|
|
@ -672,17 +745,19 @@ export default {
|
|||
this.CriterionList[this.index].ReadingQuestionCriterionTrialId
|
||||
},
|
||||
getList() {
|
||||
if (this.judgeRuleEnum === 1 && this.$refs.visitRules) {
|
||||
return this.$refs.visitRules.getList()
|
||||
}
|
||||
this.loading = true
|
||||
getTrialCriterionJudgeQuestionList({
|
||||
return getTrialCriterionJudgeQuestionList({
|
||||
TrialId: this.$route.query.trialId,
|
||||
TrialReadingCriterionId: this.trialReadingCriterionId,
|
||||
})
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
this.QuestionList = res.Result
|
||||
this.OtherInfo = res.OtherInfo
|
||||
this.activeNames = this.QuestionList.map(
|
||||
(v) => v.ReadingQuestionTrialId
|
||||
(item) => item.ReadingQuestionTrialId
|
||||
)
|
||||
this.QuestionList.forEach((v) => {
|
||||
this.$set(v, 'grouping', [])
|
||||
|
|
|
|||
|
|
@ -0,0 +1,632 @@
|
|||
<template>
|
||||
<div v-loading="loading">
|
||||
<el-tabs v-model="activeVisitTab" class="visit-tabs" type="border-card">
|
||||
<el-tab-pane v-for="visit in visitPlanOptions" :key="visit.Id"
|
||||
:label="visit.VisitName" :name="visit.Id">
|
||||
<el-collapse v-if="questionListMap[visit.Id]" v-model="visitActiveNamesMap[visit.Id]" style="border-top:none;">
|
||||
<el-collapse-item v-for="(item, index) of questionListMap[visit.Id]"
|
||||
:key="item.ReadingQuestionTrialId"
|
||||
style="position: relative;padding:0 10px;" :name="item.ReadingQuestionTrialId">
|
||||
<div slot="title">
|
||||
{{ item.PageName }}Q{{ index + 1 }}:{{ item.QuestionName }}
|
||||
</div>
|
||||
<div style="position: relative">
|
||||
<el-button v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']"
|
||||
style="position: absolute; right: 0; top: 0; z-index: 10" size="mini" type="primary"
|
||||
:disabled="isSign"
|
||||
@click="visitApply(item.ReadingQuestionTrialId, index, visit.Id, visit.VisitNum)">{{ $t('common:button:save')
|
||||
}}</el-button>
|
||||
<el-button v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']"
|
||||
style="position: absolute; right: 60px; top: 0; z-index: 10" size="mini" type="primary"
|
||||
:disabled="isSign"
|
||||
@click="visitReset(item.ReadingQuestionTrialId, index, visit.Id, visit.VisitNum)">{{ $t('common:button:reset')
|
||||
}}</el-button>
|
||||
<el-form-item :label-width="'280px'" :label="$t('trials:adRules:title:judgeTypeEnum')" style="width: 95%">
|
||||
<el-radio-group
|
||||
v-model="questionListMap[visit.Id][index].JudgeType"
|
||||
@input="(val) => visitJudgeTypeChange(val, index, visit.Id)"
|
||||
>
|
||||
<template v-for="judgeTypeItem of $d.JudgeTypeEnum">
|
||||
<el-radio
|
||||
style="margin-bottom: 5px"
|
||||
:key="judgeTypeItem.id"
|
||||
:disabled="isSign || !hasPermi(['trials:trials-panel:setting:reading-unit:edit'])"
|
||||
:label="judgeTypeItem.value"
|
||||
v-if="
|
||||
(['number', 'calculation'].includes(questionListMap[visit.Id][index].Type)
|
||||
? [1, 4, 5, 6]
|
||||
: [1, 2, 3, 6]
|
||||
).includes(judgeTypeItem.value)
|
||||
"
|
||||
>
|
||||
{{ judgeTypeItem.label }}
|
||||
</el-radio>
|
||||
</template>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="questionListMap[visit.Id][index].JudgeType === 3" style="text-align: right; margin: 10px 0">
|
||||
<el-button v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']" size="mini" type="primary"
|
||||
:disabled="isSign"
|
||||
@click="visitAddGroup(index, null, visit.Id)">{{ $t('trials:adRules:button:addRule')
|
||||
}}</el-button>
|
||||
</div>
|
||||
<el-table v-if="questionListMap[visit.Id][index].JudgeType === 3" v-loading="loading"
|
||||
:data="questionListMap[visit.Id][index].AnswerGroupList" border stripe>
|
||||
<el-table-column prop="AnswerGroupA" :label="$t('trials:adRules:title:order')" width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="AnswerGroupA" :label="$t('trials:adRules:title:answerGroupA')" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{
|
||||
questionListMap[visit.Id][index].QuestionGenre === 3
|
||||
? scope.row.AnswerGroupA.map((v) =>
|
||||
$fd(questionListMap[visit.Id][index].DictionaryCode, parseInt(v))
|
||||
).toString()
|
||||
: scope.row.AnswerGroupA.toString()
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="AnswerGroupB" :label="$t('trials:adRules:title:answerGroupB')" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{
|
||||
questionListMap[visit.Id][index].QuestionGenre === 3
|
||||
? scope.row.AnswerGroupB.map((v) =>
|
||||
$fd(questionListMap[visit.Id][index].DictionaryCode, parseInt(v))
|
||||
).toString()
|
||||
: scope.row.AnswerGroupB.toString()
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="AnswerGroupB" :label="$t('common:action:action')" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-edit" circle :title="$t('common:button:edit')" size="mini"
|
||||
:disabled="isSign"
|
||||
@click="visitAddGroup(index, scope.$index, visit.Id)" />
|
||||
<el-button icon="el-icon-delete" circle :title="$t('common:button:delete')" size="mini"
|
||||
:disabled="isSign"
|
||||
@click="visitTagClose(index, scope.$index, visit.Id)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div v-if="questionListMap[visit.Id][index].JudgeType === 2">
|
||||
<div style="
|
||||
background: #f6f6f6;
|
||||
border-radius: 20px;
|
||||
padding: 15px 20px;
|
||||
margin-top: 10px;
|
||||
">
|
||||
<el-checkbox-group v-if="questionListMap[visit.Id][index].QuestionGenre === 3"
|
||||
v-model="questionListMap[visit.Id][index].grouping"
|
||||
>
|
||||
<template v-for="dictItem of $d[questionListMap[visit.Id][index].DictionaryCode]">
|
||||
<el-checkbox v-if="dictItem.value !== -1" :key="dictItem.id" :disabled="isSign"
|
||||
:label="dictItem.value">{{ dictItem.label }}</el-checkbox>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
<el-checkbox-group v-else v-model="questionListMap[visit.Id][index].grouping">
|
||||
<el-checkbox v-for="answerItem of item.TypeValue.split('|')" :key="answerItem"
|
||||
:disabled="isSign" :label="answerItem">{{ answerItem }}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<div style="margin-top: 20px">
|
||||
{{ $t('trials:adRules:title:selectAnswerGroup') }}
|
||||
<el-tag v-if="
|
||||
questionListMap[visit.Id][index].grouping.length > 0 &&
|
||||
questionListMap[visit.Id][index].QuestionGenre !== 3
|
||||
">{{
|
||||
questionListMap[visit.Id][index].grouping.toString().replaceAll(',', '|')
|
||||
}}</el-tag>
|
||||
<el-tag v-if="
|
||||
questionListMap[visit.Id][index].grouping.length > 0 &&
|
||||
questionListMap[visit.Id][index].QuestionGenre === 3
|
||||
">{{
|
||||
questionListMap[visit.Id][index].grouping
|
||||
.map(
|
||||
(v) =>
|
||||
$d[questionListMap[visit.Id][index].DictionaryCode].find(
|
||||
(v1) => v1.value === v
|
||||
).label
|
||||
)
|
||||
.toString()
|
||||
.replaceAll(',', '|')
|
||||
}}</el-tag>
|
||||
<el-button size="mini" type="primary" :disabled="isSign"
|
||||
@click="visitAddGroup2(index, visit.Id)">
|
||||
{{ $t('trials:adRules:title:addGroup') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="questionListMap[visit.Id][index].QuestionGenre !== 3" style="margin-top: 20px">
|
||||
{{ $t('trials:adRules:title:group') }}
|
||||
<el-tag v-for="(itemA, indexA) of questionListMap[visit.Id][index].AnswerGroup2List"
|
||||
:key="itemA" closable
|
||||
style="margin-right: 10px" @close="() => visitTagClose2(index, indexA, visit.Id)">{{ itemA }}</el-tag>
|
||||
</div>
|
||||
<div v-if="questionListMap[visit.Id][index].QuestionGenre === 3" style="margin-top: 20px">
|
||||
{{ $t('trials:adRules:title:group') }}
|
||||
<el-tag v-for="(itemA, indexA) of questionListMap[visit.Id][index].AnswerGroup2List"
|
||||
:key="itemA" closable
|
||||
style="margin-right: 10px" @close="() => visitTagClose2(index, indexA, visit.Id)">
|
||||
{{
|
||||
itemA
|
||||
.split('|')
|
||||
.map((v) =>
|
||||
$fd(questionListMap[visit.Id][index].DictionaryCode, parseInt(v))
|
||||
)
|
||||
.join('|')
|
||||
}}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="
|
||||
questionListMap[visit.Id][index].JudgeType === 4 ||
|
||||
questionListMap[visit.Id][index].JudgeType === 5
|
||||
">
|
||||
<el-form :inline="true" :model="questionListMap[visit.Id][index]" class="demo-form-inline"
|
||||
:ref="`JudgeDifferenceValue${questionListMap[visit.Id][index].JudgeType}_${visit.Id}_${index}`"
|
||||
:rules="JudgeDifferenceValueQRules">
|
||||
<el-form-item :label="$t(
|
||||
`trials:trials-panel:setting:reading-unit:JudgeDifferenceType`
|
||||
)
|
||||
" prop="JudgeDifferenceType">
|
||||
<el-select
|
||||
v-model="questionListMap[visit.Id][index].JudgeDifferenceType"
|
||||
:disabled="isSign">
|
||||
<el-option v-for="judgeDiffItem of $d.JudgeDifferenceType" :key="judgeDiffItem.id"
|
||||
:label="judgeDiffItem.label" :value="judgeDiffItem.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t(
|
||||
`trials:trials-panel:setting:reading-unit:JudgeDifferenceValue${questionListMap[visit.Id][index].JudgeType}`
|
||||
)
|
||||
" prop="JudgeDifferenceValue">
|
||||
<div style="display: flex">
|
||||
<el-input v-model="questionListMap[visit.Id][index].JudgeDifferenceValue" clearable
|
||||
:disabled="isSign"></el-input>
|
||||
<span style="margin-left: 10px"
|
||||
v-if="questionListMap[visit.Id][index].JudgeType !== 5 && questionListMap[visit.Id][index].Unit !== 0">
|
||||
{{ `${questionListMap[visit.Id][index].Unit === 4 ? questionListMap[visit.Id][index].CustomUnit : $fd('ValueUnit', questionListMap[visit.Id][index].Unit)}` }}
|
||||
</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-dialog v-if="questionVisible" :title="$t('trials:adRules:title:selectAnswer')" :visible.sync="questionVisible"
|
||||
width="800px" :close-on-click-modal="false" custom-class="base-dialog-wrapper" append-to-body>
|
||||
<div class="base-dialog-body">
|
||||
<el-form-item label-width="110px" :label="$t('trials:adRules:title:answerGroupA')">
|
||||
<el-checkbox-group v-model="questionList[selectIndex].groupingA">
|
||||
<template v-for="item of questionList[selectIndex].TypeValue.split('|') || []">
|
||||
<el-checkbox
|
||||
v-if="questionList[selectIndex].QuestionGenre !== 3"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:disabled="questionList[selectIndex]?.groupingB?.includes(item) ?? false"
|
||||
>
|
||||
{{ item }}
|
||||
</el-checkbox>
|
||||
</template>
|
||||
<template v-for="item of $d[questionList[selectIndex].DictionaryCode]">
|
||||
<el-checkbox
|
||||
v-if="questionList[selectIndex].QuestionGenre === 3 && item.value !== -1"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
:disabled="questionList[selectIndex]?.groupingB?.includes(item.value) ?? false"
|
||||
>{{ item.label }}</el-checkbox>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="110px" :label="$t('trials:adRules:title:answerGroupB')">
|
||||
<el-checkbox-group v-model="questionList[selectIndex].groupingB">
|
||||
<template v-for="item of questionList[selectIndex].TypeValue.split('|') || []">
|
||||
<el-checkbox
|
||||
v-if="questionList[selectIndex].QuestionGenre !== 3"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:disabled="questionList[selectIndex]?.groupingA?.includes(item) ?? false"
|
||||
>
|
||||
{{ item }}
|
||||
</el-checkbox>
|
||||
</template>
|
||||
<template v-for="item of $d[questionList[selectIndex].DictionaryCode]">
|
||||
<el-checkbox
|
||||
v-if="questionList[selectIndex].QuestionGenre === 3 && item.value !== -1"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
:disabled="questionList[selectIndex]?.groupingA?.includes(item.value) ?? false"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
|
||||
<el-button v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']" :disabled="btnLoading" size="small"
|
||||
type="primary" @click="
|
||||
questionVisible = false
|
||||
$set(questionList[selectIndex], 'groupingA', [])
|
||||
$set(questionList[selectIndex], 'groupingB', [])
|
||||
">
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['trials:trials-panel:setting:reading-unit:edit']" :disabled="btnLoading" size="small"
|
||||
type="primary" @click="save">
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/* eslint-disable */
|
||||
import {
|
||||
getTrialQuestionVisitJudgeRule,
|
||||
setTrialQuestionVisitJudgeRule,
|
||||
} from '@/api/trials/reading'
|
||||
import { getTrialVisitStageSelect } from '@/api/trials'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
trialReadingCriterionId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
isSign: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btnLoading: false,
|
||||
loading: false,
|
||||
activeVisitTab: '',
|
||||
visitActiveNamesMap: {},
|
||||
questionListMap: {},
|
||||
visitPlanOptions: [],
|
||||
questionVisible: false,
|
||||
selectIndex: 0,
|
||||
indexA: null,
|
||||
selectVisitKey: '',
|
||||
type: null,
|
||||
OtherInfo: {
|
||||
IsSign: true,
|
||||
},
|
||||
JudgeDifferenceValueQRules: {
|
||||
JudgeDifferenceType: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t(
|
||||
'trials:trials-list:setitng:JudgeDifferenceTypeRequired'
|
||||
),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
JudgeDifferenceValue: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t(
|
||||
'trials:trials-list:setitng:JudgeDifferenceValueRequired'
|
||||
),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /^[0-9]+(.[0-9]{2})?$/,
|
||||
message: this.$t('trials:trials-list:setitng:JudgeDifferenceValue'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value <= 0) {
|
||||
callback(
|
||||
new Error(
|
||||
this.$t(
|
||||
'trials:trials-list:setitng:JudgeDifferenceValueMin'
|
||||
)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
questionList() {
|
||||
return this.questionListMap[this.selectVisitKey]
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
async activeVisitTab(v) {
|
||||
if (!v) return
|
||||
if (this.questionListMap[v]) {
|
||||
return
|
||||
}
|
||||
await this.getList(v)
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
await this.initData()
|
||||
},
|
||||
methods: {
|
||||
async initData() {
|
||||
this.questionListMap = {}
|
||||
this.visitActiveNamesMap = {}
|
||||
this.activeVisitTab = ''
|
||||
await this.getVisitPlanOptions()
|
||||
},
|
||||
normalizeQuestionList(questionList = []) {
|
||||
return questionList.map((item) => ({
|
||||
...item,
|
||||
grouping: [],
|
||||
groupingA: [],
|
||||
groupingB: [],
|
||||
AnswerGroupList: Array.isArray(item.AnswerCombination)
|
||||
? item.AnswerCombination.map((group) => ({
|
||||
...group,
|
||||
AnswerGroupA: Array.isArray(group.AnswerGroupA)
|
||||
? [...group.AnswerGroupA]
|
||||
: group.AnswerGroupA,
|
||||
AnswerGroupB: Array.isArray(group.AnswerGroupB)
|
||||
? [...group.AnswerGroupB]
|
||||
: group.AnswerGroupB
|
||||
}))
|
||||
: [],
|
||||
AnswerGroup2List: Array.isArray(item.AnswerGroup)
|
||||
? [...item.AnswerGroup]
|
||||
: []
|
||||
}))
|
||||
},
|
||||
async getVisitPlanOptions() {
|
||||
try {
|
||||
const trialId = this.$route.query.trialId
|
||||
const res = await getTrialVisitStageSelect(trialId)
|
||||
if (res.IsSuccess) {
|
||||
this.visitPlanOptions = res.Result || []
|
||||
if (!this.activeVisitTab && this.visitPlanOptions.length > 0) {
|
||||
this.activeVisitTab = this.visitPlanOptions[0].Id
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
getVisitById(visitKey) {
|
||||
return this.visitPlanOptions.find((visit) => visit.Id === visitKey)
|
||||
},
|
||||
async getList(visitKey = this.activeVisitTab) {
|
||||
const visit = this.getVisitById(visitKey)
|
||||
if (!visit) return
|
||||
try {
|
||||
this.loading = true
|
||||
let params = {
|
||||
trialId: this.$route.query.trialId,
|
||||
trialReadingCriterionId: this.trialReadingCriterionId,
|
||||
visitNum: visit.VisitNum
|
||||
}
|
||||
const res = await getTrialQuestionVisitJudgeRule(params)
|
||||
const questionList = this.normalizeQuestionList(res.Result)
|
||||
this.$set(this.questionListMap, visitKey, questionList)
|
||||
this.$set(
|
||||
this.visitActiveNamesMap,
|
||||
visitKey,
|
||||
questionList.map((item) => item.ReadingQuestionTrialId)
|
||||
)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
changeArbitrationRule(value) {
|
||||
if (value !== 1) {
|
||||
Object.values(this.questionListMap).forEach((questionList) => {
|
||||
questionList.forEach((item) => {
|
||||
item.JudgeDifferenceValue = 0
|
||||
item.JudgeDifferenceType = 0
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
visitJudgeTypeChange(value, index, visitKey) {
|
||||
this.$nextTick(() => {
|
||||
if (value === 4 || value === 5) {
|
||||
const refName = `JudgeDifferenceValue${value}_${visitKey}_${index}`
|
||||
if (this.$refs[refName] && this.$refs[refName][0]) {
|
||||
this.$refs[refName][0].resetFields()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
saveAllSync() {
|
||||
return Promise.resolve(true)
|
||||
},
|
||||
save() {
|
||||
const questionList = this.questionList
|
||||
let index = this.selectIndex
|
||||
let indexA = this.indexA
|
||||
if (questionList[index].groupingA.length === 0) {
|
||||
this.$alert(this.$t('trials:adRules:message:msg2'))
|
||||
return
|
||||
}
|
||||
if (questionList[index].groupingB.length === 0) {
|
||||
this.$alert(this.$t('trials:adRules:message:msg3'))
|
||||
return
|
||||
}
|
||||
if (this.type === 'add') {
|
||||
questionList[index].AnswerGroupList.push({
|
||||
AnswerGroupA: questionList[index].groupingA,
|
||||
AnswerGroupB: questionList[index].groupingB
|
||||
})
|
||||
} else {
|
||||
this.$set(
|
||||
questionList[index].AnswerGroupList[indexA],
|
||||
'AnswerGroupA',
|
||||
questionList[index].groupingA
|
||||
)
|
||||
this.$set(
|
||||
questionList[index].AnswerGroupList[indexA],
|
||||
'AnswerGroupB',
|
||||
questionList[index].groupingB
|
||||
)
|
||||
}
|
||||
this.$set(questionList[index], 'groupingA', [])
|
||||
this.$set(questionList[index], 'groupingB', [])
|
||||
this.$message.success(this.$t('trials:adRules:message:msg4'))
|
||||
this.questionVisible = false
|
||||
},
|
||||
visitTagClose2(index, indexA, visitKey) {
|
||||
this.$confirm(this.$t('trials:adRules:message:msg1')).then(() => {
|
||||
this.questionListMap[visitKey][index].AnswerGroup2List.splice(indexA, 1)
|
||||
})
|
||||
},
|
||||
visitTagClose(index, indexA, visitKey) {
|
||||
this.$confirm(this.$t('trials:adRules:message:msg1')).then(() => {
|
||||
this.questionListMap[visitKey][index].AnswerGroupList.splice(indexA, 1)
|
||||
})
|
||||
},
|
||||
visitAddGroup2(index, visitKey) {
|
||||
const questionList = this.questionListMap[visitKey]
|
||||
if (questionList[index].grouping.length === 0) {
|
||||
this.$alert(this.$t('trials:adRules:message:msg5'))
|
||||
return
|
||||
}
|
||||
let grouping = questionList[index].grouping
|
||||
.toString()
|
||||
.replaceAll(',', '|')
|
||||
questionList[index].AnswerGroup2List.push(`|${grouping}|`)
|
||||
this.$set(questionList[index], 'grouping', [])
|
||||
},
|
||||
visitAddGroup(index, indexA, visitKey) {
|
||||
const questionList = this.questionListMap[visitKey]
|
||||
this.selectIndex = index
|
||||
this.selectVisitKey = visitKey
|
||||
this.type = 'add'
|
||||
if (indexA !== null) {
|
||||
this.indexA = indexA
|
||||
this.type = 'edit'
|
||||
this.$set(
|
||||
questionList[index],
|
||||
'groupingA',
|
||||
questionList[index].AnswerGroupList[indexA].AnswerGroupA
|
||||
)
|
||||
this.$set(
|
||||
questionList[index],
|
||||
'groupingB',
|
||||
questionList[index].AnswerGroupList[indexA].AnswerGroupB
|
||||
)
|
||||
}
|
||||
this.questionVisible = true
|
||||
},
|
||||
async visitReset(ReadingQuestionTrialId, index, visitKey, visitNum) {
|
||||
const questionList = this.questionListMap[visitKey]
|
||||
this.btnLoading = true
|
||||
this.loading = true
|
||||
try {
|
||||
await this.$confirm(this.$t('trials:adRules:message:msg6'))
|
||||
const params = {
|
||||
TrialReadingCriterionId: this.trialReadingCriterionId,
|
||||
VisitNum: visitNum,
|
||||
QuestionList: [
|
||||
{
|
||||
ReadingQuestionTrialId: ReadingQuestionTrialId,
|
||||
AnswerGroup: [],
|
||||
AnswerCombination: [],
|
||||
JudgeType: 0,
|
||||
JudgeDifferenceValue: 0,
|
||||
JudgeDifferenceType: 0
|
||||
}
|
||||
]
|
||||
}
|
||||
await setTrialQuestionVisitJudgeRule(params)
|
||||
this.$set(questionList[index], 'AnswerGroup2List', [])
|
||||
this.$set(questionList[index], 'AnswerGroupList', [])
|
||||
this.$set(questionList[index], 'JudgeType', 0)
|
||||
this.$set(questionList[index], 'JudgeDifferenceValue', 0)
|
||||
this.$set(questionList[index], 'JudgeDifferenceType', 0)
|
||||
|
||||
this.$message.success(this.$t('trials:adRules:message:msg7'))
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
this.btnLoading = false
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async visitApply(ReadingQuestionTrialId, index, visitKey, visitNum) {
|
||||
try {
|
||||
const questionList = this.questionListMap[visitKey]
|
||||
if (questionList[index].JudgeType === 0) {
|
||||
this.$alert(this.$t('trials:adRules:message:msg8'))
|
||||
return
|
||||
}
|
||||
if (
|
||||
questionList[index].JudgeType === 2 &&
|
||||
questionList[index].AnswerGroup2List.length === 0
|
||||
) {
|
||||
this.$alert(this.$t('trials:adRules:message:msg8'))
|
||||
return
|
||||
}
|
||||
if (
|
||||
questionList[index].JudgeType === 3 &&
|
||||
questionList[index].AnswerGroupList.length === 0
|
||||
) {
|
||||
this.$alert(this.$t('trials:adRules:message:msg8'))
|
||||
return
|
||||
}
|
||||
if (
|
||||
questionList[index].JudgeType === 4 ||
|
||||
questionList[index].JudgeType === 5
|
||||
) {
|
||||
const refName = `JudgeDifferenceValue${questionList[index].JudgeType}_${visitKey}_${index}`
|
||||
const validate = await this.$refs[refName][0].validate()
|
||||
if (!validate) return
|
||||
}
|
||||
this.btnLoading = true
|
||||
this.loading = true
|
||||
let params = {
|
||||
TrialReadingCriterionId: this.trialReadingCriterionId,
|
||||
VisitNum: visitNum,
|
||||
QuestionList: [
|
||||
{
|
||||
ReadingQuestionTrialId: ReadingQuestionTrialId,
|
||||
AnswerGroup: questionList[index].AnswerGroup2List,
|
||||
AnswerCombination: questionList[index].AnswerGroupList,
|
||||
JudgeType: questionList[index].JudgeType,
|
||||
JudgeDifferenceValue: questionList[index].JudgeDifferenceValue,
|
||||
JudgeDifferenceType: questionList[index].JudgeDifferenceType
|
||||
}
|
||||
]
|
||||
}
|
||||
let res = await setTrialQuestionVisitJudgeRule(params)
|
||||
if (res.IsSuccess) {
|
||||
this.$message.success(this.$t('trials:adRules:message:msg9'))
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
this.btnLoading = false
|
||||
this.loading = false
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.visit-tabs ::v-deep .el-tabs__content {
|
||||
min-height: 520px;
|
||||
padding-top: 20px !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -240,7 +240,6 @@ export default {
|
|||
if (ReadingTool === 3) {
|
||||
this.readingSegmentTools = getCustomizeStandardsSegmentDicomTools(readingSegmentTools)
|
||||
}
|
||||
console.log(this.readingSegmentTools, 'this.readingSegmentTools')
|
||||
},
|
||||
setIsClinicalReading(isClinicalReading) {
|
||||
this.isClinicalReading = isClinicalReading;
|
||||
|
|
@ -300,11 +299,15 @@ export default {
|
|||
this.$refs["arbitrationRules" + this.TrialReadingCriterionId]
|
||||
.length
|
||||
) {
|
||||
var arbitrationRules = await this.$refs[
|
||||
const arbitrationRulesRef = this.$refs[
|
||||
"arbitrationRules" + this.TrialReadingCriterionId
|
||||
][0].saveAllSync();
|
||||
][0];
|
||||
var judgeRuleSaved = await arbitrationRulesRef.saveJugeRule(false);
|
||||
var arbitrationRules = judgeRuleSaved
|
||||
? await arbitrationRulesRef.saveAllSync()
|
||||
: false;
|
||||
isCheckList.push({
|
||||
isCheck: arbitrationRules,
|
||||
isCheck: judgeRuleSaved && arbitrationRules,
|
||||
msg: this.$t("trials:readingUnit:adRules"), // '仲裁规则'
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue