自动计算相关
continuous-integration/drone/push Build encountered an error Details

uat
wangxiaoshuang 2025-07-10 11:06:51 +08:00
parent f98a63542c
commit 62a92ea7c9
12 changed files with 1415 additions and 1251 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ tests/**/coverage/
*.sln
.eslintignore
/.eslintignore
*.svn

View File

@ -469,7 +469,7 @@ async function VueInit() {
var my_password = zzSessionStorage.getItem('my_password')
let my_userid = zzSessionStorage.getItem('userId')
let my_EMail = zzSessionStorage.getItem('my_EMail') || ''
if (md5(_vm.unlock.my_password) === my_password && (my_username === _vm.unlock.my_username || my_EMail.toUpperCase() === vm.unlock.my_username.toUpperCase())) {
if (md5(_vm.unlock.my_password) === my_password && (my_username === _vm.unlock.my_username || my_EMail.toUpperCase() === _vm.unlock.my_username.toUpperCase())) {
resetReadingRestTime().then(() => {
})
const closeLock = (_vm) => {

View File

@ -36,7 +36,7 @@
{{scope.row[item.Id] === '' ? '' : scope.row[item.Id] ? scope.row[item.Id].split('|').length : ''}}
</span>
<span v-else-if="item.Type === 'number'">
{{scope.row[item.Id] ? parseFloat(scope.row[item.Id]).toFixed(digitPlaces) : null}}
{{!isNaN(parseFloat(scope.row[item.Id])) ? parseFloat(scope.row[item.Id]).toFixed(digitPlaces) : scope.row[item.Id]}}
</span>
<span v-else>
{{scope.row[item.Id]}}
@ -446,6 +446,7 @@ export default {
// if (!v[this.question.Id] || !oldv[this.question.Id]) return
// } catch (e) {
// }
this.formItemNumberChange(this.question.Id, false)
try {
if (!v || !v[this.question.Id] || !oldv || !oldv[this.question.Id])
return
@ -455,7 +456,6 @@ export default {
if (this.question.Type === 'class') {
this.$emit("setFormItemData", { key: this.question.Id, val: v[this.question.Id], question: v })
}
this.formItemNumberChange(this.question.Id, false)
}
},
readingTaskState: {
@ -539,6 +539,7 @@ export default {
deleteTableCol(row, index) {
this.$confirm(this.$t('trials:uploadNonDicoms:message:msg1')).then(() => {
const loading = this.$loading({ fullscreen: true })
let RowId = this.questionForm[row.Id][index].RowId
var param = {
visitTaskId: this.visitTaskId,
questionId: row.Id,
@ -549,6 +550,11 @@ export default {
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:deletedSuccessfully'))
DicomEvent.$emit('reGetQuestionAnswer')
this.AnswersList = row.TableQuestions.Answers
var index = this.AnswersList.findIndex(v => v.RowId === RowId)
this.AnswersList.splice(index, 1)
this.$emit('setFormItemData', {key: this.question.Id, val: this.AnswersList, question: this.question})
this.formItemNumberChange(this.question.Id, true)
}
loading.close()
}).catch(() => {
@ -681,60 +687,91 @@ export default {
})
},
logic(rules, num = 0) {
let isNE = false
try {
if (rules.CalculateQuestionList.length === 0) {
return false
}
let dataArr = []
rules.CalculateQuestionList.forEach((o, i) => {
if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) {
if (rules.CustomCalculateMark > 4 && rules.CustomCalculateMark < 10) {
switch (rules.CustomCalculateMark) {
case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId])
} else {
num *= parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
break;
case 6:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId])
} else {
num += parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
break;
case 7:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId])
} else {
num += parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = this.questionForm[o.QuestionId].length === 0 ? 0 : num / this.questionForm[o.QuestionId].length
break;
case 8:
var arr = []
this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId])
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = arr.length === 0 ? 0 : Math.max(...arr)
break;
case 9:
var arr = []
this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId])
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = arr.length === 0 ? 0 : Math.min(...arr)
break;
}
} else {
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId])
}
if (!isNaN(num)) {
dataArr.push(num)
}
@ -742,20 +779,28 @@ export default {
} else {
switch (rules.CustomCalculateMark) {
case 1:
if (isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 2:
if (isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 3:
if (isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 4:
if (isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
if (parseFloat(this.questionForm[o.TableQuestionId]) === 0) {
num = 0
} else {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
}
break;
case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
@ -795,6 +840,9 @@ export default {
} catch (e) {
console.log(e)
}
if (isNE) {
return 'NE'
}
if (rules.ValueType === 2) {
num = num * 100
}
@ -875,26 +923,40 @@ export default {
var CalculateQuestions = JSON.parse(v.CalculateQuestions);
var num,
arr = [];
let isNE = false
CalculateQuestions.forEach((o, i) => {
if (this.QuestionsForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) {
num = parseFloat(this.QuestionsForm[o.TableQuestionId]);
arr = [num];
} else {
switch (v.CustomCalculateMark) {
case 1:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num += parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break;
case 2:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num -= parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break;
case 3:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num *= parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break;
case 4:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num /= parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break;
case 7:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
}
num =
arr.length === 0
? 0
@ -903,17 +965,26 @@ export default {
}, 0) / arr.length;
break;
case 8:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
}
num = arr.length === 0 ? 0 : Math.max(...arr);
break;
case 9:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
}
num = arr.length === 0 ? 0 : Math.min(...arr);
// console.log('min', this.questionForm[o.QuestionId], arr, num)
break;
}
}
});
if (isNE) {
num = 'NE'
} else {
num = num.toFixed(this.digitPlaces)
}
this.$set(this.QuestionsForm, v.Id, num.toString());
}
});

View File

@ -1,235 +1,136 @@
<template>
<div class="criterion-form-item">
<el-form-item
v-if="(question.ShowQuestion===1 && !!~question.ParentTriggerValueList.indexOf(questionForm[question.ParentId])) || question.ShowQuestion===0"
:label="`${question.QuestionName}`"
:prop="question.Id"
:rules="[
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && !!~question.RelevanceValueList.indexOf(questionForm[question.RelevanceId]))) && question.Type!=='group' && question.Type!=='summary',
message: $t('common:ruleMessage:select'), trigger: ['blur', 'change']},
v-if="(question.ShowQuestion === 1 && !!~question.ParentTriggerValueList.indexOf(questionForm[question.ParentId])) || question.ShowQuestion === 0"
:label="`${question.QuestionName}`" :prop="question.Id" :rules="[
{
validator: question.Type === 'number' && !question.TypeValue ? validatorNumberInput :(rule,value,callback )=>{callback()},
required: (question.IsRequired === 0 || (question.IsRequired === 1 && question.RelevanceId && !!~question.RelevanceValueList.indexOf(questionForm[question.RelevanceId]))) && question.Type !== 'group' && question.Type !== 'summary',
message: $t('common:ruleMessage:select'), trigger: ['blur', 'change']
},
{
validator: question.Type === 'number' && !question.TypeValue ? validatorNumberInput : (rule, value, callback) => { callback() },
trigger: ['blur', 'change']
}
]"
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
>
]" :class="[question.Type === 'group' ? 'mb' : question.Type === 'upload' ? 'uploadWrapper' : '']">
<!-- 输入框 -->
<el-input
v-if="question.Type==='input'"
v-model="questionForm[question.Id]"
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')"
/>
<el-input v-if="question.Type === 'input'" v-model="questionForm[question.Id]"
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')" />
<!-- 多行文本输入框 -->
<el-input
v-if="question.Type==='textarea'"
v-model="questionForm[question.Id]"
type="textarea"
<el-input v-if="question.Type === 'textarea'" v-model="questionForm[question.Id]" type="textarea"
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')"
:autosize="{ minRows: 2, maxRows: 4}"
/>
:autosize="{ minRows: 2, maxRows: 4 }" />
<!-- 下拉框 -->
<el-select
v-if="question.Type==='select'"
v-model="questionForm[question.Id]"
clearable
<el-select v-if="question.Type === 'select'" v-model="questionForm[question.Id]" clearable
:disabled="(question.TableQuestionType === 2 || question.QuestionGenre === 2) || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')"
@change="((val)=>{formItemChange(val, question)})"
>
@change="((val) => { formItemChange(val, question) })">
<template v-if="question.TableQuestionType === 1">
<el-option
v-for="item in organList"
:key="item.Id"
:label="item[question.DataTableColumn]"
:value="item[question.DataTableColumn]"
/>
<el-option v-for="item in organList" :key="item.Id" :label="item[question.DataTableColumn]"
:value="item[question.DataTableColumn]" />
</template>
<template v-else-if="question.TableQuestionType === 3 || question.QuestionGenre === 3">
<el-option
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:value="item.value"
:label="item.label"
/>
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="item.value"
:label="item.label" />
</template>
<template v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
<el-option
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:value="item.value"
:label="item.label"
/>
<template
v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="item.value"
:label="item.label" />
</template>
<template v-else>
<el-option
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val" :value="val" />
</template>
</el-select>
<!-- 单选 -->
<el-radio-group
v-if="question.Type==='radio'"
v-model="questionForm[question.Id]"
<el-radio-group v-if="question.Type === 'radio'" v-model="questionForm[question.Id]"
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')"
@change="((val)=>{formItemChange(val, question)})"
>
<el-radio
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
>
@change="((val) => { formItemChange(val, question) })">
<el-radio v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
{{ val }}
</el-radio>
</el-radio-group>
<!-- 复选框 -->
<el-checkbox-group
v-if="question.Type==='checkbox'"
<el-checkbox-group v-if="question.Type === 'checkbox'"
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')"
v-model="questionForm[question.Id]"
>
<el-checkbox
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
>
v-model="questionForm[question.Id]">
<el-checkbox v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
{{ val }}
</el-checkbox>
</el-checkbox-group>
<!-- 自动分类 -->
<el-input
v-if="question.Type === 'class' && question.ClassifyShowType === 1"
v-model="questionForm[question.Id]"
/>
<el-select
v-if="question.Type === 'class' && question.ClassifyShowType === 2"
v-model="questionForm[question.Id]"
:disabled="!question.ClassifyEditType"
@change="(val) => { formItemChange(val, question) }"
>
<el-option
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val.trim()"
:value="val.trim()"
/>
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 1"
v-model="questionForm[question.Id]" />
<el-select v-if="question.Type === 'class' && question.ClassifyShowType === 2" v-model="questionForm[question.Id]"
:disabled="!question.ClassifyEditType" @change="(val) => { formItemChange(val, question) }">
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
</el-select>
<el-radio-group
v-if="question.Type === 'class' && question.ClassifyShowType === 3"
v-model="questionForm[question.Id]"
:disabled="!question.ClassifyEditType"
@change="(val) => { formItemChange(val, question) }"
>
<el-radio
v-for="item of question.TypeValue.split('|')"
:key="item.trim()"
:label="item.trim()"
>
<el-radio-group v-if="question.Type === 'class' && question.ClassifyShowType === 3"
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType"
@change="(val) => { formItemChange(val, question) }">
<el-radio v-for="item of question.TypeValue.split('|')" :key="item.trim()" :label="item.trim()">
{{ item.trim() }}
</el-radio>
</el-radio-group>
<!-- 自动计算 -->
<!-- :precision="2" :step="0.1" :max="10" -->
<el-input
v-if="question.Type==='calculation'"
v-model="questionForm[question.Id]"
oninput="value=value.replace(/^\D*(\d*(?:.\d{0,2})?).*$/g, '$1')"
disabled
/>
<el-input v-if="question.Type === 'calculation'" v-model="questionForm[question.Id]"
oninput="value=value.replace(/^\D*(\d*(?:.\d{0,2})?).*$/g, '$1')" disabled />
<!-- 自增 -->
<el-input
v-if="question.Type==='increment'"
v-model="questionForm[question.Id]"
disabled
/>
<el-input v-if="question.Type === 'increment'" v-model="questionForm[question.Id]" disabled />
<!-- 数值 -->
<!-- :precision="2" :step="0.1" :max="10" -->
<el-input
type="text"
v-if="question.Type === 'number' && question.DataSource !== 1"
<el-select v-if="question.Type === 'number' && question.TypeValue" v-model="questionForm[question.Id]" clearable
@change="(val) => { formItemNumberChange(val, question) }"
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')">
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
</el-select>
<el-input type="text" v-else-if="question.Type === 'number' && question.DataSource !== 1"
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')"
@change="((val)=>{formItemNumberChange(val, question)})"
@input="numberInput(question.Id)"
@change="((val) => { formItemNumberChange(val, question) })" @input="numberInput(question.Id)"
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
v-model.trim="questionForm[question.Id]"
>
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
v-model.trim="questionForm[question.Id]">
<template slot="append" v-if="question.Unit !== 0">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
question.CustomUnit }}</template>
</el-input>
<el-input
type="text"
v-if="question.Type === 'number' && question.DataSource === 1"
:disabled="question.DataSource === 1"
@input="numberInput(question.Id, true )"
@blur="handleCalculationBlur(calculationValue)"
v-model.trim="calculationValue"
>
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
<el-input type="text" v-else-if="question.Type === 'number' && question.DataSource === 1"
:disabled="question.DataSource === 1" @input="numberInput(question.Id, true)"
@blur="handleCalculationBlur(calculationValue)" v-model.trim="calculationValue">
<template slot="append" v-if="question.Unit !== 0">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
question.CustomUnit }}</template>
</el-input>
<!-- 上传图像 -->
<el-upload
v-if="question.Type==='upload'"
action
:accept="question.FileType"
:limit="question.ImageCount === 0 ? 100 : question.ImageCount"
:on-preview="handlePictureCardPreview"
:before-upload="handleBeforeUpload"
:http-request="uploadScreenshot"
list-type="picture-card"
:on-remove="handleRemove"
:file-list="fileList"
:class="{disabled: question.ImageCount === 0 ? false : fileList.length >= question.ImageCount}"
>
<el-upload v-if="question.Type === 'upload'" action :accept="question.FileType"
:limit="question.ImageCount === 0 ? 100 : question.ImageCount" :on-preview="handlePictureCardPreview"
:before-upload="handleBeforeUpload" :http-request="uploadScreenshot" list-type="picture-card"
:on-remove="handleRemove" :file-list="fileList"
:class="{ disabled: question.ImageCount === 0 ? false : fileList.length >= question.ImageCount }">
<i slot="default" class="el-icon-plus" />
<div slot="file" slot-scope="{file}">
<viewer
:ref="file.url"
:images="[imageUrl]"
style="
<viewer :ref="file.url" :images="[imageUrl]" style="
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
"
>
<img
class="el-upload-list__item-thumbnail"
:src="OSSclientConfig.basePath + file.url"
crossOrigin="anonymous"
alt=""
style="max-width: 100%; max-height: 100%"
/>
">
<img class="el-upload-list__item-thumbnail" :src="OSSclientConfig.basePath + file.url"
crossOrigin="anonymous" alt="" style="max-width: 100%; max-height: 100%" />
<span class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
<i class="el-icon-zoom-in" />
</span>
<span
v-if="readingTaskState < 2"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<span v-if="readingTaskState < 2" class="el-upload-list__item-delete" @click="handleRemove(file)">
<i class="el-icon-delete" />
</span>
</span>
</viewer>
</div>
</el-upload>
<el-dialog
v-if="question.Type==='upload'"
append-to-body
:visible.sync="imgVisible"
width="600px"
>
<el-dialog v-if="question.Type === 'upload'" append-to-body :visible.sync="imgVisible" width="600px">
<el-image :src="imageUrl" width="100%">
<div slot="placeholder" class="image-slot">
{{$t('trials:readingUnit:qsList:message:loading')}}<span class="dot">...</span>
{{ $t('trials:readingUnit:qsList:message:loading') }}<span class="dot">...</span>
</div>
</el-image>
</el-dialog>
@ -347,10 +248,10 @@ export default {
// }
},
methods: {
numberInput(id,notId = false) {
if(notId ) {
numberInput(id, notId = false) {
if (notId) {
this.calculationValue = this.calculationValue.toUpperCase();
}else {
} else {
this.questionForm[id] = this.questionForm[id].toUpperCase();
}
},
@ -361,7 +262,7 @@ export default {
} else {
if (!reg.test(value)) {
callback(new Error(this.$t('trials:reading:ruleMessage:validatorNumberInput')));
}else{
} else {
callback();
}
}
@ -407,14 +308,14 @@ export default {
},
handleBlur(value, a, b) {
if (!value) return false
if(!isNaN(parseFloat(value))) {
if (!isNaN(parseFloat(value))) {
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
}
// this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
},
handleCalculationBlur(v) {
if (!v) return false
if(!isNaN(parseFloat(v))) {
if (!isNaN(parseFloat(v))) {
this.calculationValue = parseFloat(v).toFixed(this.digitPlaces)
}
},
@ -428,6 +329,7 @@ export default {
}
},
logic(rules, num = 0) {
let isNE = false
try {
if (rules.CalculateQuestionList.length === 0) {
return false
@ -436,53 +338,79 @@ export default {
var count = 0
var maxList = [], minList = []
rules.CalculateQuestionList.forEach((o, i) => {
if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (rules.CustomCalculateMark > 4 && rules.CustomCalculateMark < 10) {
if (i !== 0) {
switch (rules.CustomCalculateMark) {
case 7:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
count += parseFloat(this.questionForm[o.TableQuestionId])
}
if (i === rules.CalculateQuestionList.length - 1) {
num = count / rules.CalculateQuestionList.length
}
break;
case 8:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
maxList.push(this.questionForm[o.TableQuestionId])
}
if (i === rules.CalculateQuestionList.length - 1) {
num = Math.max(...maxList)
}
break;
case 9:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
minList.push(this.questionForm[o.TableQuestionId])
}
if (i === rules.CalculateQuestionList.length - 1) {
num = Math.min(...minList)
}
break;
}
} else {
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
maxList.push(this.questionForm[o.TableQuestionId])
minList.push(this.questionForm[o.TableQuestionId])
count = parseFloat(this.questionForm[o.TableQuestionId])
num = parseFloat(this.questionForm[o.TableQuestionId])
dataArr.push(num)
}
}
} else {
if (i !== 0) {
switch (rules.CustomCalculateMark) {
case 1:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 2:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 3:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 4:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
if (parseFloat(this.questionForm[o.TableQuestionId]) === 0) {
num = 0
} else {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
}
break;
case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
@ -513,6 +441,9 @@ export default {
} catch (e) {
console.log(e)
}
if (isNE) {
return 'NE'
}
if (rules.ValueType === 2) {
num = num * 100
}
@ -550,9 +481,9 @@ export default {
var file = await this.fileToBlob(param.file)
const res = await this.OSSclient.put(`/${trialId}/Read/${subjectId}/Visit/${param.file.name}`, file)
console.log(res)
this.fileList.push({ name: param.file.name, path: this.$getObjectName(res.url), url: this.$getObjectName(res.url)})
this.fileList.push({ name: param.file.name, path: this.$getObjectName(res.url), url: this.$getObjectName(res.url) })
this.urls.push(this.$getObjectName(res.url))
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
loading.close()
},
handleBeforeUpload(file) {
@ -579,11 +510,11 @@ export default {
},
//
handlePictureCardPreview(file) {
var suffix = file.url.substring(file.url.lastIndexOf(".")+1)
var suffix = file.url.substring(file.url.lastIndexOf(".") + 1)
suffix = suffix ? suffix.toLowerCase() : ''
if (suffix === 'doc' || suffix === 'docx' || suffix === 'pdf'){
window.open(this.OSSclientConfig.basePath + file.url,'_blank')
}else{
if (suffix === 'doc' || suffix === 'docx' || suffix === 'pdf') {
window.open(this.OSSclientConfig.basePath + file.url, '_blank')
} else {
this.imageUrl = this.OSSclientConfig.basePath + file.url
// this.imgVisible = true
this.$refs[file.url].$viewer.show()
@ -595,40 +526,46 @@ export default {
this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === file.url), 1)
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
}
}
}
</script>
<style lang="scss" scoped>
.my_dialog{
.criterion-form-item{
::v-deep .el-form-item__content{
.my_dialog {
.criterion-form-item {
::v-deep .el-form-item__content {
width: auto;
}
}
}
.criterion-form-item{
.el-form-item{
.criterion-form-item {
.el-form-item {
display: flex;
flex-direction: row;
align-items: flex-start;
}
::v-deep .el-form-item__content{
::v-deep .el-form-item__content {
width: 500px;
}
.el-input{
width:100%;
.el-input {
width: 100%;
}
.mb{
.mb {
margin-bottom: 0px;
}
.disabled{
.disabled {
::v-deep .el-upload--picture-card {
display: none;
}
}
.uploadWrapper{
.uploadWrapper {
display: flex;
flex-direction: column;
align-items: flex-start;

View File

@ -4,63 +4,36 @@
<div slot="header" class="clearfix report-header">
<h3 style="margin:0;padding:0;">{{ $t('trials:readingReport:title:eicrf') }}</h3>
<div style="margin-left:auto">
<el-switch
v-model="isShowDetail"
:active-text="$t('trials:readingReport:title:expandDetails')"
:inactive-text="$t('trials:readingReport:title:collapseDetails')"
style="margin-right:5px"
@change="handleShowDetail"
/>
<el-button
v-if="readingTaskState<2"
type="primary"
size="small"
@click="skipTask"
>
<el-switch v-model="isShowDetail" :active-text="$t('trials:readingReport:title:expandDetails')"
:inactive-text="$t('trials:readingReport:title:collapseDetails')" style="margin-right:5px"
@change="handleShowDetail" />
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="skipTask">
<!-- 跳过 -->
{{ $t('trials:readingReport:button:skip') }}
</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="getReportInfo">{{$t('trials:readingReport:button:refresh')}}</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleSave(true)">{{$t('common:button:save')}}</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleConfirm">{{$t('common:button:submit')}}</el-button>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="getReportInfo">{{
$t('trials:readingReport:button:refresh') }}</el-button>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="handleSave(true)">{{
$t('common:button:save') }}</el-button>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="handleConfirm">{{
$t('common:button:submit') }}</el-button>
</div>
</div>
<div style="flex: 1">
<el-table
ref="reportList"
v-adaptive="{bottomOffset:0}"
:data="taskQuestions"
v-if="taskQuestions.length > 0"
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"
>
<el-table ref="reportList" v-adaptive="{ bottomOffset: 0 }" :data="taskQuestions"
v-if="taskQuestions.length > 0" 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;"
>
<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"
show-overflow-tooltip
width="200px"
>
<el-table-column v-for="task in visitTaskList" :key="task.VisitTaskId" prop="date" show-overflow-tooltip
width="200px">
<template slot="header">
<div v-if="task.IsCurrentTask">
{{ task.BlindName }}
@ -72,122 +45,128 @@
<span class="el-icon-view"></span>
</el-button>
</div>
<!-- <div v-if="task.LatestScanDate">-->
<!-- {{ task.LatestScanDate.split(' ')[0] }}-->
<!-- </div>-->
<!-- <div v-if="task.LatestScanDate">-->
<!-- {{ task.LatestScanDate.split(' ')[0] }}-->
<!-- </div>-->
<!-- {{ `(影像点击跳转)` }} -->
<!-- {{ $t('trials:readingReport:button:jump') }}-->
</div>
</template>
<template slot-scope="scope">
<template v-if="readingTaskState<2 && task.VisitTaskId === visitTaskId && (scope.row.Type==='input' || scope.row.Type==='number' || scope.row.Type==='select' || scope.row.Type==='textarea' || scope.row.Type==='radio' || scope.row.Type === 'class')">
<template
v-if="readingTaskState < 2 && task.VisitTaskId === visitTaskId && (scope.row.Type === 'input' || scope.row.Type === 'number' || scope.row.Type === 'select' || scope.row.Type === 'textarea' || scope.row.Type === 'radio' || scope.row.Type === 'class')">
<template>
<!-- 输入框 -->
<div>
<template v-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)">
<template
v-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)">
</template>
<el-input
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='input' || scope.row.Type==='textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'input' || scope.row.Type === 'textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini"
/>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='input' || scope.row.Type==='textarea')">
{{questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}}
size="mini" />
<span
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'input' || scope.row.Type === 'textarea')">
{{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span>
<el-input
v-else-if="(scope.row.Type==='input' || scope.row.Type==='textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]"
size="mini"
/>
<span v-else-if="scope.row.Type==='input' || scope.row.Type==='textarea'">
{{questionForm[scope.row.QuestionId]}}
v-else-if="(scope.row.Type === 'input' || scope.row.Type === 'textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" size="mini" />
<span v-else-if="scope.row.Type === 'input' || scope.row.Type === 'textarea'">
{{ questionForm[scope.row.QuestionId] }}
</span>
<el-select
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='select' || scope.row.Type==='radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'select' || scope.row.Type === 'radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini"
clearable
>
size="mini" clearable>
<template>
<el-option
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val.trim()"
:value="val.trim()"
/>
<el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val.trim()"
:value="val.trim()" />
</template>
</el-select>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='select' || scope.row.Type==='radio'">
{{questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}}
<span
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'select' || scope.row.Type === 'radio'">
{{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span>
<el-select
v-else-if="(scope.row.Type==='select' || scope.row.Type==='radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]"
size="mini"
clearable
>
v-else-if="(scope.row.Type === 'select' || scope.row.Type === 'radio' || (scope.row.Type === 'number' && scope.row.TypeValue)) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" size="mini" clearable
@focus="() => { questionId = scope.row.QuestionId }">
<template>
<el-option
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val.trim()"
:value="val.trim()"
/>
<el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val.trim()"
:value="val.trim()" />
</template>
</el-select>
<span v-else-if="scope.row.Type==='select' || scope.row.Type==='radio'">
{{questionForm[scope.row.QuestionId]}}
<span v-else-if="scope.row.Type === 'select' || scope.row.Type === 'radio'">
{{ questionForm[scope.row.QuestionId] }}
</span>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='class'">
{{questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}}
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'class'">
{{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span>
<span v-else-if="scope.row.Type==='class'">
{{questionForm[scope.row.QuestionId]}}
<span v-else-if="scope.row.Type === 'class'">
{{ questionForm[scope.row.QuestionId] }}
</span>
<el-input
v-else-if="scope.row.DataSource !== 1 && questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='number' && (scope.row.xfIndex || scope.row.xfIndex === 0) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-else-if="scope.row.DataSource !== 1 && questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'number' && (scope.row.xfIndex || scope.row.xfIndex === 0) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
:disabled="scope.row.DataSource === 1"
@blur="value=parseFloat(value).toFixed(digitPlaces)"
:disabled="scope.row.DataSource === 1" @blur="value = parseFloat(value).toFixed(digitPlaces)"
@input="limitInput($event, questionForm[scope.row.QuestionId][scope.row.xfIndex], scope.row.TableQuestionId)"
size="mini"
@focus="() => {questionId = scope.row.QuestionId}"
>
<template slot="append" v-if="scope.row.Unit !== 0">{{scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}}</template>
size="mini" @focus="() => { questionId = scope.row.QuestionId }">
<template slot="append" v-if="scope.row.Unit !== 0">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
scope.row.Unit) : scope.row.CustomUnit }}</template>
<template slot="append" v-else-if="scope.row.ValueType === 2">%</template>
</el-input>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='number' && (scope.row.xfIndex || scope.row.xfIndex === 0)">
<span
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'number' && (scope.row.xfIndex || scope.row.xfIndex === 0)">
<template v-if="(scope.row.ValueType === 0 || scope.row.ValueType === 1) && scope.row.Unit">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))? questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]:`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]} ${scope.row.Unit !== 4 ? $fd('ValueUnit',scope.row.Unit) : scope.row.CustomUnit}` }}
{{
isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] :
`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}
${scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}` }}
</template>
<template v-else-if="scope.row.ValueType === 2">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId])) ? questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]:`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]} %` }}
{{
isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] :
`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}
%` }}
</template>
<template v-else>
{{ isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId])) ? questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]:`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}` }}
{{
isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] :
`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}`
}}
</template>
</span>
<el-input
v-else-if="scope.row.DataSource !== 1 && scope.row.Type==='number' && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]"
:disabled="scope.row.DataSource === 1"
@blur="value=parseFloat(value).toFixed(digitPlaces)"
@input="limitInput($event, questionForm, scope.row.QuestionId)"
size="mini"
@focus="() => {questionId = scope.row.QuestionId}"
>
<template slot="append" v-if="scope.row.Unit !== 0">{{scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}}</template>
v-else-if="scope.row.DataSource !== 1 && scope.row.Type === 'number' && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" :disabled="scope.row.DataSource === 1"
@blur="value = parseFloat(value).toFixed(digitPlaces)"
@input="limitInput($event, questionForm, scope.row.QuestionId)" size="mini"
@focus="() => { questionId = scope.row.QuestionId }">
<template slot="append" v-if="scope.row.Unit !== 0">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
scope.row.Unit) : scope.row.CustomUnit }}</template>
<template slot="append" v-else-if="scope.row.ValueType === 2">%</template>
</el-input>
<span v-else-if="scope.row.Type==='number'">
<span v-else-if="scope.row.Type === 'number'">
<template v-if="(scope.row.ValueType === 0 || scope.row.ValueType === 1) && scope.row.Unit">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId]))? questionForm[scope.row.QuestionId]:`${questionForm[scope.row.QuestionId]} ${scope.row.Unit !== 4 ? $fd('ValueUnit',scope.row.Unit) : scope.row.CustomUnit}` }}
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ?
questionForm[scope.row.QuestionId] : `${questionForm[scope.row.QuestionId]} ${scope.row.Unit !==
4
? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}` }}
</template>
<template v-else-if="scope.row.ValueType === 2">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ? questionForm[scope.row.QuestionId]:`${questionForm[scope.row.QuestionId]} %` }}
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ?
questionForm[scope.row.QuestionId] : `${questionForm[scope.row.QuestionId]} %` }}
</template>
<template v-else>
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ? questionForm[scope.row.QuestionId] : questionForm[scope.row.QuestionId]}}
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ? questionForm[scope.row.QuestionId] :
questionForm[scope.row.QuestionId] }}
</template>
</span>
</div>
@ -195,58 +174,48 @@
</template>
<template v-else-if="task.VisitTaskId === visitTaskId && scope.row.Type === 'upload'">
<customize-report-page-upload
v-if="scope.row.Type==='upload' && (scope.row.xfIndex || scope.row.xfIndex === 0)"
:visitTaskId="visitTaskId"
:question="scope.row"
:task="task"
:readingTaskState="readingTaskState"
v-if="scope.row.Type === 'upload' && (scope.row.xfIndex || scope.row.xfIndex === 0)"
:visitTaskId="visitTaskId" :question="scope.row" :task="task" :readingTaskState="readingTaskState"
:initUrl="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
@setImageUrl="(url) => {setImageUrl(scope.row.QuestionId, scope.row.xfIndex, scope.row.TableQuestionId, url, scope.row.RowId)}"
></customize-report-page-upload>
<customize-report-page-upload
v-else-if="scope.row.Type==='upload'"
:visitTaskId="visitTaskId"
:question="scope.row"
:task="task"
:readingTaskState="readingTaskState"
@setImageUrl="(url) => { setImageUrl(scope.row.QuestionId, scope.row.xfIndex, scope.row.TableQuestionId, url, scope.row.RowId) }"></customize-report-page-upload>
<customize-report-page-upload v-else-if="scope.row.Type === 'upload'" :visitTaskId="visitTaskId"
:question="scope.row" :task="task" :readingTaskState="readingTaskState"
:initUrl="questionForm[scope.row.QuestionId]"
@setImageUrl="(url) => {setImageUrl(scope.row.QuestionId, scope.row.xfIndex, scope.row.TableQuestionId, url)}"
></customize-report-page-upload>
@setImageUrl="(url) => { setImageUrl(scope.row.QuestionId, scope.row.xfIndex, scope.row.TableQuestionId, url) }"></customize-report-page-upload>
</template>
<template v-else-if="scope.row.Type === 'upload'">
<customize-report-page-upload
v-if="scope.row.Type==='upload' && (scope.row.xfIndex || scope.row.xfIndex === 0)"
:visitTaskId="visitTaskId"
:question="scope.row"
:task="task"
:readingTaskState="readingTaskState"
:initUrl="scope.row.Answers[task.VisitTaskId]"
></customize-report-page-upload>
<customize-report-page-upload
v-else-if="scope.row.Type==='upload'"
:visitTaskId="visitTaskId"
:question="scope.row"
:task="task"
:readingTaskState="readingTaskState"
:initUrl="scope.row.Answers[task.VisitTaskId]"
></customize-report-page-upload>
v-if="scope.row.Type === 'upload' && (scope.row.xfIndex || scope.row.xfIndex === 0)"
:visitTaskId="visitTaskId" :question="scope.row" :task="task" :readingTaskState="readingTaskState"
:initUrl="scope.row.Answers[task.VisitTaskId]"></customize-report-page-upload>
<customize-report-page-upload v-else-if="scope.row.Type === 'upload'" :visitTaskId="visitTaskId"
:question="scope.row" :task="task" :readingTaskState="readingTaskState"
:initUrl="scope.row.Answers[task.VisitTaskId]"></customize-report-page-upload>
</template>
<template v-else-if="scope.row.QuestionType=== 22">
<template v-else-if="scope.row.QuestionType === 22">
{{ scope.row.Answers[task.VisitTaskId] === '-1' ? '未知' : scope.row.Answers[task.VisitTaskId] }}
</template>
<template v-else-if="scope.row.DictionaryCode">
{{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }}
</template>
<template v-else-if="CriterionType === 10">
{{ isNaN(parseInt(scope.row.Answers[task.VisitTaskId]))?scope.row.Answers[task.VisitTaskId]:`${scope.row.Answers[task.VisitTaskId]}` }}
{{
isNaN(parseInt(scope.row.Answers[task.VisitTaskId])) ? scope.row.Answers[task.VisitTaskId] :
`${scope.row.Answers[task.VisitTaskId]}`
}}
</template>
<template v-else-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)">
<template
v-else-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)">
</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]} ${scope.row.Unit !== 4 ? $fd('ValueUnit',scope.row.Unit) : scope.row.CustomUnit}` }}
{{
isNaN(parseInt(scope.row.Answers[task.VisitTaskId])) ? scope.row.Answers[task.VisitTaskId] :
`${scope.row.Answers[task.VisitTaskId]}
${scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}` }}
</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]} %` }}
{{ 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] }}
@ -258,16 +227,11 @@
</el-card>
<!-- 签名框 -->
<el-dialog
v-if="signVisible"
:visible.sync="signVisible"
:close-on-click-modal="false"
width="600px"
custom-class="base-dialog-wrapper"
>
<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>
<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>
@ -380,7 +344,7 @@ export default {
list.forEach(v => {
if (v.QuestionId === questionId) {
return Object.assign({}, v.Answers)
} else if (v.Childrens.length > 0){
} else if (v.Childrens.length > 0) {
return this.getTagterAnswers(v.Childrens, questionId)
}
})
@ -479,81 +443,156 @@ export default {
})
},
logic(rules, num = 0) {
let isNE = false
try {
if (rules.CalculateQuestionList.length === 0) {
return false
}
let dataArr = []
rules.CalculateQuestionList.forEach((o, i) => {
if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) {
if (rules.CustomCalculateMark > 4) {
switch (rules.CustomCalculateMark) {
case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId])
} else {
num *= parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
break;
case 6:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
} else {
num += isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
break;
case 7:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId])
} else {
num += parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = this.questionForm[o.QuestionId].length === 0 ? 0 : num / this.questionForm[o.QuestionId].length
break;
case 8:
var arr = []
this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId])
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = arr.length === 0 ? 0 : Math.max(...arr)
break;
case 9:
var arr = []
this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId])
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = arr.length === 0 ? 0 : Math.min(...arr)
break;
}
} else {
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId])
}
}
} else {
switch (rules.CustomCalculateMark) {
case 1:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 2:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 3:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 4:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
// num /= parseFloat(this.questionForm[o.TableQuestionId])
break;
case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => {
return acc + (typeof curr === "number" ? curr : 0);
}, 0) / dataArr.length;
break;
case 11:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = Math.max(...dataArr);
break;
case 12:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = Math.min(...dataArr);
break;
case 13:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0
break;
case 14:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) ? 1 : 0;
break;
}
}
})
} catch (e) {
console.log(e)
}
if (isNE) {
return 'NE'
}
if (rules.ValueType === 2) {
num = num * 100
}
@ -586,12 +625,12 @@ export default {
setScrollTop(a) {
setTimeout(() => {
this.$nextTick(() => {
if(this.$refs.reportList){
if (this.$refs.reportList) {
this.$refs.reportList.bodyWrapper.scrollTop = this.$refs.reportList.bodyWrapper.scrollHeight
this.$refs.reportList.bodyWrapper.scrollTop = this.$refs.reportList.bodyWrapper.scrollHeight
}
})
},50)
}, 50)
},
getQuestions(questions, isNTFilterLength, lesionType, isLymphNodes) {
const arr = []
@ -778,7 +817,7 @@ export default {
}
}
this.loading = false
} catch(e) {
} catch (e) {
this.loading = false
if (this.$refs['signForm'] && this.$refs['signForm'].btnLoading) {
this.$refs['signForm'].btnLoading = false
@ -813,7 +852,7 @@ export default {
questionId: k,
answer: v[o],
tableQuestionId: o,
rowId: v[o+'_RowId']
rowId: v[o + '_RowId']
})
}
})
@ -867,27 +906,32 @@ export default {
}
</script>
<style lang="scss" scoped>
.report-wrapper{
.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{
.report-header {
display: flex;
}
.el-card{
.el-card {
background-color: #000;
color: #ffffff;
border:none;
border: none;
}
// ::v-deep .el-table__cell{
// background-color: #000;
// color: #ffffff;
@ -901,51 +945,62 @@ export default {
// color: #ffffff;
// }
::v-deep .el-table, .el-table__expanded-cell {
::v-deep .el-table,
.el-table__expanded-cell {
background-color: #000;
color: #fff;
border-color:#444444;
border-color: #444444;
}
::v-deep .el-table th, .el-table tr {
::v-deep .el-table th,
.el-table tr {
background-color: #000;
color: #fff;
border-color:#444444;
border-color: #444444;
}
::v-deep .el-table__body tr > td{
background-color:#000 !important;
::v-deep .el-table__body tr>td {
background-color: #000 !important;
color: #fff;
border-color:#444444;
border-color: #444444;
}
::v-deep .el-table__body tr:hover > td{
background-color:#858282 !important;
::v-deep .el-table__body tr:hover>td {
background-color: #858282 !important;
color: #fff;
border-color:#444444;
border-color: #444444;
}
::v-deep .el-table--border th.gutter:last-of-type{
::v-deep .el-table--border th.gutter:last-of-type {
border: none;
}
::v-deep .el-card__header{
::v-deep .el-card__header {
border: none;
padding: 10px;
}
::v-deep .el-upload-list--picture-card .el-upload-list__item{
::v-deep .el-upload-list--picture-card .el-upload-list__item {
width: 30px;
height: 30px;
}
::v-deep .el-upload--picture-card{
::v-deep .el-upload--picture-card {
width: 30px;
height: 30px;
line-height: 40px;
}
}
::v-deep .el-switch__label{
color:#fff;
::v-deep .el-switch__label {
color: #fff;
}
::v-deep .el-switch__label.is-active{
::v-deep .el-switch__label.is-active {
color: #428bca;
}
.uploadWrapper{
.uploadWrapper {
display: flex;
flex-direction: column;
align-items: flex-start;

View File

@ -35,6 +35,7 @@
:is-baseline="isBaseLineTask"
@resetFormItemData="resetFormItemData"
@setFormItemData="setFormItemData"
@getQuestions="getQuestions"
/>
</template>
@ -122,6 +123,7 @@ export default {
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
this.isBaseLineTask = this.taskInfo.IsBaseLine
this.criterionType = this.taskInfo.CriterionType
this.criterionId = this.taskInfo.TrialReadingCriterionId
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
this.getQuestionCalculateRelation()

View File

@ -4,56 +4,33 @@
<div slot="header" class="clearfix report-header">
<h3 style="margin:0;padding:0;">{{ $t('trials:readingReport:title:eicrf') }}</h3>
<div style="margin-left:auto">
<el-button
v-if="readingTaskState<2"
type="primary"
size="small"
@click="skipTask"
>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="skipTask">
<!-- 跳过 -->
{{ $t('trials:readingReport:button:skip') }}
</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="getReportInfo">{{ $t('trials:readingReport:button:refresh') }}</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleSave(true)">{{ $t('common:button:save') }}</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleConfirm">{{ $t('common:button:submit') }}</el-button>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="getReportInfo">{{
$t('trials:readingReport:button:refresh') }}</el-button>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="handleSave(true)">{{
$t('common:button:save') }}</el-button>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="handleConfirm">{{
$t('common:button:submit') }}</el-button>
</div>
</div>
<div style="flex: 1">
<el-table
v-if="taskQuestions.length > 0"
ref="reportList"
v-adaptive="{bottomOffset:0}"
: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"
>
<el-table v-if="taskQuestions.length > 0" ref="reportList" v-adaptive="{ bottomOffset: 0 }"
: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;"
>
<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"
show-overflow-tooltip
width="200px"
>
<el-table-column v-for="task in visitTaskList" :key="task.VisitTaskId" prop="date" show-overflow-tooltip
width="200px">
<template slot="header">
<div v-if="task.IsCurrentTask">
{{ task.BlindName }}
@ -68,110 +45,115 @@
</div>
</template>
<template slot-scope="scope">
<template v-if="readingTaskState<2 && task.VisitTaskId === visitTaskId && (scope.row.Type==='input' || scope.row.Type==='number' || scope.row.Type==='select' || scope.row.Type==='textarea' || scope.row.Type==='radio')">
<template
v-if="readingTaskState < 2 && task.VisitTaskId === visitTaskId && (scope.row.Type === 'input' || scope.row.Type === 'number' || scope.row.Type === 'select' || scope.row.Type === 'textarea' || scope.row.Type === 'radio')">
<!-- 输入框 -->
<div>
<template v-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" />
<template
v-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" />
<el-input
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='input' || scope.row.Type==='textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'input' || scope.row.Type === 'textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini"
/>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='input' || scope.row.Type==='textarea')">
size="mini" />
<span
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'input' || scope.row.Type === 'textarea')">
{{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span>
<el-input
v-else-if="(scope.row.Type==='input' || scope.row.Type==='textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]"
size="mini"
/>
<span v-else-if="scope.row.Type==='input' || scope.row.Type==='textarea'">
v-else-if="(scope.row.Type === 'input' || scope.row.Type === 'textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" size="mini" />
<span v-else-if="scope.row.Type === 'input' || scope.row.Type === 'textarea'">
{{ questionForm[scope.row.QuestionId] }}
</span>
<el-select
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='select' || scope.row.Type==='radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'select' || scope.row.Type === 'radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini"
clearable
>
size="mini" clearable>
<template>
<el-option
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
<el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
</template>
</el-select>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='select'">
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'select'">
{{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span>
<el-select
v-else-if="(scope.row.Type==='select' || scope.row.Type==='radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]"
size="mini"
clearable
>
v-else-if="(scope.row.Type === 'select' || scope.row.Type === 'radio' || (scope.row.Type === 'number' && scope.row.TypeValue)) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" size="mini" clearable
@focus="() => { questionId = scope.row.QuestionId }">
<template>
<el-option
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
<el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
</template>
</el-select>
<span v-else-if="scope.row.Type==='select' || scope.row.Type==='radio'">
<span v-else-if="scope.row.Type === 'select' || scope.row.Type === 'radio'">
{{ questionForm[scope.row.QuestionId] }}
</span>
<el-input
v-else-if="scope.row.DataSource !== 1 && questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='number' && (scope.row.xfIndex || scope.row.xfIndex === 0) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-else-if="scope.row.DataSource !== 1 && questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'number' && (scope.row.xfIndex || scope.row.xfIndex === 0) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
:disabled="scope.row.DataSource === 1"
size="mini"
:disabled="scope.row.DataSource === 1" size="mini"
@blur="limitBlur(questionForm[scope.row.QuestionId][scope.row.xfIndex], scope.row.TableQuestionId, scope.row.ValueType)"
@focus="() => {questionId = scope.row.QuestionId}"
>
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit }}</template>
@focus="() => { questionId = scope.row.QuestionId }">
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
scope.row.Unit) : scope.row.CustomUnit }}</template>
<template v-else-if="scope.row.ValueType === 2" slot="append">%</template>
</el-input>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='number' && (scope.row.xfIndex || scope.row.xfIndex === 0)">
<span
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'number' && (scope.row.xfIndex || scope.row.xfIndex === 0)">
<template v-if="(scope.row.ValueType === 0 || scope.row.ValueType === 1) && scope.row.Unit">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))? questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]:`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]} ${scope.row.Unit !== 4 ? $fd('ValueUnit',scope.row.Unit) : scope.row.CustomUnit}` }}
{{
isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] :
`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}
${scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}` }}
</template>
<template v-else-if="scope.row.ValueType === 2">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId])) ? questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]:`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]} %` }}
{{
isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] :
`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}
%` }}
</template>
<template v-else>
{{ isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId])) ? questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]:`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}` }}
{{
isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] :
`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}`
}}
</template>
</span>
<el-input
v-else-if="scope.row.DataSource !== 1 && scope.row.Type==='number' && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]"
:disabled="scope.row.DataSource === 1"
size="mini"
v-else-if="scope.row.DataSource !== 1 && scope.row.Type === 'number' && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" :disabled="scope.row.DataSource === 1" size="mini"
@blur="limitBlur(questionForm, scope.row.QuestionId, scope.row.ValueType)"
@focus="() => {questionId = scope.row.QuestionId}"
>
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit }}</template>
@focus="() => { questionId = scope.row.QuestionId }">
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
scope.row.Unit) : scope.row.CustomUnit }}</template>
<template v-else-if="scope.row.ValueType === 2" slot="append">%</template>
</el-input>
<span v-else-if="scope.row.Type==='number'">
<span v-else-if="scope.row.Type === 'number'">
<template v-if="(scope.row.ValueType === 0 || scope.row.ValueType === 1) && scope.row.Unit">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId]))? questionForm[scope.row.QuestionId]:`${questionForm[scope.row.QuestionId]} ${scope.row.Unit !== 4 ? $fd('ValueUnit',scope.row.Unit) : scope.row.CustomUnit}` }}
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ?
questionForm[scope.row.QuestionId] : `${questionForm[scope.row.QuestionId]} ${scope.row.Unit !== 4
?
$fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}` }}
</template>
<template v-else-if="scope.row.ValueType === 2">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ? questionForm[scope.row.QuestionId]:`${questionForm[scope.row.QuestionId]} %` }}
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ?
questionForm[scope.row.QuestionId] : `${questionForm[scope.row.QuestionId]} %` }}
</template>
<template v-else>
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ? questionForm[scope.row.QuestionId] : questionForm[scope.row.QuestionId] }}
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ? questionForm[scope.row.QuestionId] :
questionForm[scope.row.QuestionId] }}
</template>
</span>
</div>
</template>
<template v-else-if="scope.row.Type==='upload' && scope.row.Answers[task.VisitTaskId]">
<span v-for="(url,index) in scope.row.Answers[task.VisitTaskId].split('|')" :key="url" style="margin-left: 5px;">
<template v-else-if="scope.row.Type === 'upload' && scope.row.Answers[task.VisitTaskId]">
<span v-for="(url, index) in scope.row.Answers[task.VisitTaskId].split('|')" :key="url"
style="margin-left: 5px;">
<el-button v-if="scope.row.Answers[task.VisitTaskId]" type="text" @click="preview(url)">
{{ `${$t('trials:noneDicom:title:attachment')}${index + 1}` }}
</el-button>
@ -181,14 +163,22 @@
{{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }}
</template>
<template v-else-if="criterionType === 10">
{{ isNaN(parseInt(scope.row.Answers[task.VisitTaskId]))?scope.row.Answers[task.VisitTaskId]:`${scope.row.Answers[task.VisitTaskId]}` }}
{{
isNaN(parseInt(scope.row.Answers[task.VisitTaskId])) ? scope.row.Answers[task.VisitTaskId] :
`${scope.row.Answers[task.VisitTaskId]}`
}}
</template>
<template v-else-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" />
<template
v-else-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" />
<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]} ${scope.row.Unit !== 4 ? $fd('ValueUnit',scope.row.Unit) : scope.row.CustomUnit}` }}
{{
isNaN(parseInt(scope.row.Answers[task.VisitTaskId])) ? scope.row.Answers[task.VisitTaskId] :
`${scope.row.Answers[task.VisitTaskId]}
${scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}` }}
</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]} %` }}
{{ 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] }}
@ -200,38 +190,20 @@
</el-card>
<!-- 签名框 -->
<el-dialog
v-if="signVisible"
:visible.sync="signVisible"
:close-on-click-modal="false"
width="600px"
custom-class="base-dialog-wrapper"
>
<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>
<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>
<!-- 预览文件 -->
<el-dialog
v-if="previewVisible"
:visible.sync="previewVisible"
:title="$t('common:button:preview')"
:fullscreen="true"
append-to-body
custom-class="base-dialog-wrapper"
>
<div
class="base-modal-body"
style="border: 2px solid #ccc; padding: 10px"
>
<PreviewFile
v-if="previewVisible"
:file-path="currentPath"
:file-type="currentType"
/>
<el-dialog v-if="previewVisible" :visible.sync="previewVisible" :title="$t('common:button:preview')"
:fullscreen="true" append-to-body custom-class="base-dialog-wrapper">
<div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
<PreviewFile v-if="previewVisible" :file-path="currentPath" :file-type="currentType" />
</div>
</el-dialog>
</div>
@ -446,81 +418,163 @@ export default {
})
},
logic(rules, num = 0) {
let isNE = false
try {
if (rules.CalculateQuestionList.length === 0) {
return false
}
let dataArr = []
rules.CalculateQuestionList.forEach((o, i) => {
if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) {
if (rules.CustomCalculateMark > 4) {
switch (rules.CustomCalculateMark) {
case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId])
} else {
num *= parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
break
case 6:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
} else {
num += isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
break
case 7:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId])
} else {
num += parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = this.questionForm[o.QuestionId].length === 0 ? 0 : num / this.questionForm[o.QuestionId].length
break
case 8:
const arr = []
this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId])
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = arr.length === 0 ? 0 : Math.max(...arr)
break
case 9:
const arr1 = []
this.questionForm[o.QuestionId].forEach(q => {
arr1.push(q[o.TableQuestionId])
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId])
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = arr1.length === 0 ? 0 : Math.min(...arr1)
break
}
} else {
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId])
}
}
} else {
switch (rules.CustomCalculateMark) {
case 1:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break
case 2:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break
case 3:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break
case 4:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
// num /= parseFloat(this.questionForm[o.TableQuestionId])
break
case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => {
return acc + (typeof curr === "number" ? curr : 0);
}, 0) / dataArr.length;
break;
case 11:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = Math.max(...dataArr);
break;
case 12:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = Math.min(...dataArr);
break;
case 13:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0
break;
case 14:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) ? 1 : 0;
break;
}
}
})
} catch (e) {
console.log(e)
}
if (isNE) {
return 'NE'
}
if (rules.ValueType === 2) {
num = num * 100
}
@ -760,94 +814,116 @@ export default {
}
</script>
<style lang="scss" scoped>
.report-wrapper{
.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{
.report-header {
display: flex;
}
.el-card{
.el-card {
background-color: #000;
color: #ffffff;
border:none;
}
::v-deep .el-table--border th.gutter:last-of-type{
border: none;
}
::v-deep .el-table, .el-table__expanded-cell {
background-color: #000;
color: #fff;
border-color:#444444;
}
::v-deep .el-table th, .el-table tr {
background-color: #000;
color: #fff;
border-color:#444444;
}
::v-deep .el-table__body tr > td{
background-color:#000 !important;
color: #fff;
border-color:#444444;
}
::v-deep .el-table__body tr:hover > td{
background-color:#858282 !important;
color: #fff;
border-color:#444444;
}
::v-deep .el-table--border th.gutter:last-of-type{
::v-deep .el-table--border th.gutter:last-of-type {
border: none;
}
::v-deep .el-card__header{
::v-deep .el-table,
.el-table__expanded-cell {
background-color: #000;
color: #fff;
border-color: #444444;
}
::v-deep .el-table th,
.el-table tr {
background-color: #000;
color: #fff;
border-color: #444444;
}
::v-deep .el-table__body tr>td {
background-color: #000 !important;
color: #fff;
border-color: #444444;
}
::v-deep .el-table__body tr:hover>td {
background-color: #858282 !important;
color: #fff;
border-color: #444444;
}
::v-deep .el-table--border th.gutter:last-of-type {
border: none;
}
::v-deep .el-card__header {
border: none;
padding: 10px;
}
::v-deep .el-upload-list--picture-card .el-upload-list__item{
::v-deep .el-upload-list--picture-card .el-upload-list__item {
width: 30px;
height: 30px;
}
::v-deep .el-upload--picture-card{
::v-deep .el-upload--picture-card {
width: 30px;
height: 30px;
line-height: 40px;
}
::v-deep .el-dialog{
::v-deep .el-dialog {
background: #1e1e1e;
border: 1px solid #ddd;
color: #ddd;
.el-dialog__title{
color:#fff;
.el-dialog__title {
color: #fff;
}
.el-input .el-input__inner{
.el-input .el-input__inner {
background-color: transparent;
color: #ddd;
border: 1px solid #5e5e5e;
}
.el-input.is-disabled .el-input__inner{
.el-input.is-disabled .el-input__inner {
background-color: #646464a1;
}
.el-form-item__label{
.el-form-item__label {
color: #dfdfdf
}
}
}
::v-deep .el-switch__label{
color:#fff;
::v-deep .el-switch__label {
color: #fff;
}
::v-deep .el-switch__label.is-active{
::v-deep .el-switch__label.is-active {
color: #428bca;
}
.uploadWrapper{
.uploadWrapper {
display: flex;
flex-direction: column;
align-items: flex-start;

View File

@ -158,7 +158,7 @@ export default {
this.classArr.push({ triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType })
}
if (v.Type === 'number') {
this.$set(this.questionForm, v.Id, v.Answer === '' ? '' : parseFloat(v.Answer).toFixed(this.digitPlaces))
this.$set(this.questionForm, v.Id, isNaN(parseFloat(v.Answer)) ? v.Answer : parseFloat(v.Answer).toFixed(this.digitPlaces))
}
if (v.Childrens.length > 0) {
this.setChild(v.Childrens)
@ -181,7 +181,7 @@ export default {
i.TableQuestions.Questions.forEach(o => {
if (o.Type === 'number') {
i.TableQuestions.Answers.forEach((ite, index) => {
this.$set(i.TableQuestions.Answers[index], o.Id, i.TableQuestions.Answers[index][o.Id] ? parseFloat(i.TableQuestions.Answers[index][o.Id]).toFixed(this.digitPlaces) : null)
this.$set(i.TableQuestions.Answers[index], o.Id, !isNaN(parseFloat(i.TableQuestions.Answers[index][o.Id])) ? parseFloat(i.TableQuestions.Answers[index][o.Id]).toFixed(this.digitPlaces) : i.TableQuestions.Answers[index][o.Id])
})
}
})
@ -191,7 +191,7 @@ export default {
this.classArr.push({ triggerId: i.ClassifyQuestionId, classId: i.Id, classifyAlgorithms: i.ClassifyAlgorithms, classifyType: i.ClassifyType })
}
if (i.Type === 'number') {
this.$set(this.questionForm, i.Id, i.Answer === '' ? '' : parseFloat(i.Answer).toFixed(this.digitPlaces))
this.$set(this.questionForm, i.Id, isNaN(parseFloat(i.Answer)) ? i.Answer : parseFloat(i.Answer).toFixed(this.digitPlaces))
}
if (i.Childrens && i.Childrens.length > 0) {
this.setChild(i.Childrens)

View File

@ -4,56 +4,33 @@
<div slot="header" class="clearfix report-header">
<h3 style="margin:0;padding:0;">{{ $t('trials:readingReport:title:eicrf') }}</h3>
<div style="margin-left:auto">
<el-button
v-if="readingTaskState<2"
type="primary"
size="small"
@click="skipTask"
>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="skipTask">
<!-- 跳过 -->
{{ $t('trials:readingReport:button:skip') }}
</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="getReportInfo">{{ $t('trials:readingReport:button:refresh') }}</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleSave(true)">{{ $t('common:button:save') }}</el-button>
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleConfirm">{{ $t('common:button:submit') }}</el-button>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="getReportInfo">{{
$t('trials:readingReport:button:refresh') }}</el-button>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="handleSave(true)">{{
$t('common:button:save') }}</el-button>
<el-button v-if="readingTaskState < 2" type="primary" size="small" @click="handleConfirm">{{
$t('common:button:submit') }}</el-button>
</div>
</div>
<div style="flex: 1">
<el-table
v-if="taskQuestions.length > 0"
ref="reportList"
v-adaptive="{bottomOffset:0}"
: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"
>
<el-table v-if="taskQuestions.length > 0" ref="reportList" v-adaptive="{ bottomOffset: 0 }"
: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;"
>
<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"
show-overflow-tooltip
width="200px"
>
<el-table-column v-for="task in visitTaskList" :key="task.VisitTaskId" prop="date" show-overflow-tooltip
width="200px">
<template slot="header">
<div v-if="task.IsCurrentTask">
{{ task.BlindName }}
@ -68,110 +45,115 @@
</div>
</template>
<template slot-scope="scope">
<template v-if="readingTaskState<2 && task.VisitTaskId === visitTaskId && (scope.row.Type==='input' || scope.row.Type==='number' || scope.row.Type==='select' || scope.row.Type==='textarea' || scope.row.Type==='radio')">
<template
v-if="readingTaskState < 2 && task.VisitTaskId === visitTaskId && (scope.row.Type === 'input' || scope.row.Type === 'number' || scope.row.Type === 'select' || scope.row.Type === 'textarea' || scope.row.Type === 'radio')">
<!-- 输入框 -->
<div>
<template v-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" />
<template
v-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" />
<el-input
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='input' || scope.row.Type==='textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'input' || scope.row.Type === 'textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini"
/>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='input' || scope.row.Type==='textarea')">
size="mini" />
<span
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'input' || scope.row.Type === 'textarea')">
{{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span>
<el-input
v-else-if="(scope.row.Type==='input' || scope.row.Type==='textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]"
size="mini"
/>
<span v-else-if="scope.row.Type==='input' || scope.row.Type==='textarea'">
v-else-if="(scope.row.Type === 'input' || scope.row.Type === 'textarea') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" size="mini" />
<span v-else-if="scope.row.Type === 'input' || scope.row.Type === 'textarea'">
{{ questionForm[scope.row.QuestionId] }}
</span>
<el-select
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='select' || scope.row.Type==='radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'select' || scope.row.Type === 'radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini"
clearable
>
size="mini" clearable>
<template>
<el-option
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
<el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
</template>
</el-select>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='select'">
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'select'">
{{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span>
<el-select
v-else-if="(scope.row.Type==='select' || scope.row.Type==='radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]"
size="mini"
clearable
>
v-else-if="(scope.row.Type === 'select' || scope.row.Type === 'radio' || (scope.row.Type === 'number' && scope.row.TypeValue)) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" size="mini" clearable
@focus="() => { questionId = scope.row.QuestionId }">
<template>
<el-option
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
<el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
</template>
</el-select>
<span v-else-if="scope.row.Type==='select' || scope.row.Type==='radio'">
<span v-else-if="scope.row.Type === 'select' || scope.row.Type === 'radio'">
{{ questionForm[scope.row.QuestionId] }}
</span>
<el-input
v-else-if="scope.row.DataSource !== 1 && questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='number' && (scope.row.xfIndex || scope.row.xfIndex === 0) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-else-if="scope.row.DataSource !== 1 && questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'number' && (scope.row.xfIndex || scope.row.xfIndex === 0) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
:disabled="scope.row.DataSource === 1"
size="mini"
:disabled="scope.row.DataSource === 1" size="mini"
@blur="limitBlur(questionForm[scope.row.QuestionId][scope.row.xfIndex], scope.row.TableQuestionId, scope.row.ValueType)"
@focus="() => {questionId = scope.row.QuestionId}"
>
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit }}</template>
@focus="() => { questionId = scope.row.QuestionId }">
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
scope.row.Unit) : scope.row.CustomUnit }}</template>
<template v-else-if="scope.row.ValueType === 2" slot="append">%</template>
</el-input>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='number' && (scope.row.xfIndex || scope.row.xfIndex === 0)">
<span
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'number' && (scope.row.xfIndex || scope.row.xfIndex === 0)">
<template v-if="(scope.row.ValueType === 0 || scope.row.ValueType === 1) && scope.row.Unit">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))? questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]:`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]} ${scope.row.Unit !== 4 ? $fd('ValueUnit',scope.row.Unit) : scope.row.CustomUnit}` }}
{{
isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] :
`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}
${scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}` }}
</template>
<template v-else-if="scope.row.ValueType === 2">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId])) ? questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]:`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]} %` }}
{{
isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] :
`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}
%` }}
</template>
<template v-else>
{{ isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId])) ? questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]:`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}` }}
{{
isNaN(parseInt(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]))
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] :
`${questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}`
}}
</template>
</span>
<el-input
v-else-if="scope.row.DataSource !== 1 && scope.row.Type==='number' && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]"
:disabled="scope.row.DataSource === 1"
size="mini"
v-else-if="scope.row.DataSource !== 1 && scope.row.Type === 'number' && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" :disabled="scope.row.DataSource === 1" size="mini"
@blur="limitBlur(questionForm, scope.row.QuestionId, scope.row.ValueType)"
@focus="() => {questionId = scope.row.QuestionId}"
>
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit }}</template>
@focus="() => { questionId = scope.row.QuestionId }">
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
scope.row.Unit) : scope.row.CustomUnit }}</template>
<template v-else-if="scope.row.ValueType === 2" slot="append">%</template>
</el-input>
<span v-else-if="scope.row.Type==='number'">
<span v-else-if="scope.row.Type === 'number'">
<template v-if="(scope.row.ValueType === 0 || scope.row.ValueType === 1) && scope.row.Unit">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId]))? questionForm[scope.row.QuestionId]:`${questionForm[scope.row.QuestionId]} ${scope.row.Unit !== 4 ? $fd('ValueUnit',scope.row.Unit) : scope.row.CustomUnit}` }}
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ?
questionForm[scope.row.QuestionId] : `${questionForm[scope.row.QuestionId]} ${scope.row.Unit !== 4
?
$fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}` }}
</template>
<template v-else-if="scope.row.ValueType === 2">
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ? questionForm[scope.row.QuestionId]:`${questionForm[scope.row.QuestionId]} %` }}
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ?
questionForm[scope.row.QuestionId] : `${questionForm[scope.row.QuestionId]} %` }}
</template>
<template v-else>
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ? questionForm[scope.row.QuestionId] : questionForm[scope.row.QuestionId] }}
{{ isNaN(parseInt(questionForm[scope.row.QuestionId])) ? questionForm[scope.row.QuestionId] :
questionForm[scope.row.QuestionId] }}
</template>
</span>
</div>
</template>
<template v-else-if="scope.row.Type==='upload' && scope.row.Answers[task.VisitTaskId]">
<span v-for="(url,index) in scope.row.Answers[task.VisitTaskId].split('|')" :key="url" style="margin-left: 5px;">
<template v-else-if="scope.row.Type === 'upload' && scope.row.Answers[task.VisitTaskId]">
<span v-for="(url, index) in scope.row.Answers[task.VisitTaskId].split('|')" :key="url"
style="margin-left: 5px;">
<el-button v-if="scope.row.Answers[task.VisitTaskId]" type="text" @click="preview(url)">
{{ `${$t('trials:noneDicom:title:attachment')}${index + 1}` }}
</el-button>
@ -181,14 +163,22 @@
{{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }}
</template>
<template v-else-if="criterionType === 10">
{{ isNaN(parseInt(scope.row.Answers[task.VisitTaskId]))?scope.row.Answers[task.VisitTaskId]:`${scope.row.Answers[task.VisitTaskId]}` }}
{{
isNaN(parseInt(scope.row.Answers[task.VisitTaskId])) ? scope.row.Answers[task.VisitTaskId] :
`${scope.row.Answers[task.VisitTaskId]}`
}}
</template>
<template v-else-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" />
<template
v-else-if="!((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" />
<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]} ${scope.row.Unit !== 4 ? $fd('ValueUnit',scope.row.Unit) : scope.row.CustomUnit}` }}
{{
isNaN(parseInt(scope.row.Answers[task.VisitTaskId])) ? scope.row.Answers[task.VisitTaskId] :
`${scope.row.Answers[task.VisitTaskId]}
${scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit}` }}
</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]} %` }}
{{ 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] }}
@ -200,38 +190,20 @@
</el-card>
<!-- 签名框 -->
<el-dialog
v-if="signVisible"
:visible.sync="signVisible"
:close-on-click-modal="false"
width="600px"
custom-class="base-dialog-wrapper"
>
<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>
<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>
<!-- 预览文件 -->
<el-dialog
v-if="previewVisible"
:visible.sync="previewVisible"
:title="$t('common:button:preview')"
:fullscreen="true"
append-to-body
custom-class="base-dialog-wrapper"
>
<div
class="base-modal-body"
style="border: 2px solid #ccc; padding: 10px"
>
<PreviewFile
v-if="previewVisible"
:file-path="currentPath"
:file-type="currentType"
/>
<el-dialog v-if="previewVisible" :visible.sync="previewVisible" :title="$t('common:button:preview')"
:fullscreen="true" append-to-body custom-class="base-dialog-wrapper">
<div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
<PreviewFile v-if="previewVisible" :file-path="currentPath" :file-type="currentType" />
</div>
</el-dialog>
</div>
@ -396,7 +368,7 @@ export default {
if (v.Type === 'number') {
let val = null
if (v.ValueType === 0) {
val = parseInt(v.Answers[this.visitTaskId])
val = !isNaN(parseFloat(v.Answers[this.visitTaskId])) ? parseInt(v.Answers[this.visitTaskId]) : v.Answers[this.visitTaskId]
} else if (v.ValueType === 3) {
val = v.Answers[this.visitTaskId]
} else {
@ -422,7 +394,7 @@ export default {
if (i.Type === 'number') {
let val = null
if (i.ValueType === 0) {
val = parseInt(i.Answers[this.visitTaskId])
val = !isNaN(parseFloat(i.Answers[this.visitTaskId])) ? parseInt(i.Answers[this.visitTaskId]) : i.Answers[this.visitTaskId]
} else if (i.ValueType === 3) {
val = i.Answers[this.visitTaskId]
} else {
@ -446,81 +418,197 @@ export default {
})
},
logic(rules, num = 0) {
let isNE = false
try {
if (rules.CalculateQuestionList.length === 0) {
return false
}
let dataArr = []
rules.CalculateQuestionList.forEach((o, i) => {
if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) {
if (rules.CustomCalculateMark > 4) {
switch (rules.CustomCalculateMark) {
case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId])
} else {
num *= parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
break
case 6:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
} else {
num += isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
break
case 7:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId])
} else {
num += parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = this.questionForm[o.QuestionId].length === 0 ? 0 : num / this.questionForm[o.QuestionId].length
break
case 8:
const arr = []
this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId])
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = arr.length === 0 ? 0 : Math.max(...arr)
break
case 9:
const arr1 = []
this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr1.push(q[o.TableQuestionId])
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
})
num = arr1.length === 0 ? 0 : Math.min(...arr1)
break
case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => {
return acc + (typeof curr === "number" ? curr : 0);
}, 0) / dataArr.length;
break;
case 11:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length > 0 ? Math.max(...dataArr) : 0;
break;
case 12:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length > 0 ? Math.min(...dataArr) : 0;
break;
case 13:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0
break;
case 14:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) ? 1 : 0;
break;
}
} else {
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId])
}
}
} else {
switch (rules.CustomCalculateMark) {
case 1:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break
case 2:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break
case 3:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break
case 4:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
// num /= parseFloat(this.questionForm[o.TableQuestionId])
break
case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => {
return acc + (typeof curr === "number" ? curr : 0);
}, 0) / dataArr.length;
break;
case 11:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length > 0 ? Math.max(...dataArr) : 0;
break;
case 12:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length > 0 ? Math.min(...dataArr) : 0;
break;
case 13:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0
break;
case 14:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) ? 1 : 0;
break;
}
}
})
} catch (e) {
console.log(e)
}
if (isNE) {
return 'NE'
}
if (rules.ValueType === 2) {
num = num * 100
}
@ -561,7 +649,7 @@ export default {
if (item.Type === 'number') {
let val = null
if (item.ValueType === 0) {
val = parseInt(i.Answer)
val = !isNaN(parseFloat(i.Answer)) ? parseInt(i.Answer) : i.Answer
} else if (item.ValueType === 3) {
val = i.Answer
} else {
@ -759,94 +847,116 @@ export default {
}
</script>
<style lang="scss" scoped>
.report-wrapper{
.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{
.report-header {
display: flex;
}
.el-card{
.el-card {
background-color: #000;
color: #ffffff;
border:none;
}
::v-deep .el-table--border th.gutter:last-of-type{
border: none;
}
::v-deep .el-table, .el-table__expanded-cell {
background-color: #000;
color: #fff;
border-color:#444444;
}
::v-deep .el-table th, .el-table tr {
background-color: #000;
color: #fff;
border-color:#444444;
}
::v-deep .el-table__body tr > td{
background-color:#000 !important;
color: #fff;
border-color:#444444;
}
::v-deep .el-table__body tr:hover > td{
background-color:#858282 !important;
color: #fff;
border-color:#444444;
}
::v-deep .el-table--border th.gutter:last-of-type{
::v-deep .el-table--border th.gutter:last-of-type {
border: none;
}
::v-deep .el-card__header{
::v-deep .el-table,
.el-table__expanded-cell {
background-color: #000;
color: #fff;
border-color: #444444;
}
::v-deep .el-table th,
.el-table tr {
background-color: #000;
color: #fff;
border-color: #444444;
}
::v-deep .el-table__body tr>td {
background-color: #000 !important;
color: #fff;
border-color: #444444;
}
::v-deep .el-table__body tr:hover>td {
background-color: #858282 !important;
color: #fff;
border-color: #444444;
}
::v-deep .el-table--border th.gutter:last-of-type {
border: none;
}
::v-deep .el-card__header {
border: none;
padding: 10px;
}
::v-deep .el-upload-list--picture-card .el-upload-list__item{
::v-deep .el-upload-list--picture-card .el-upload-list__item {
width: 30px;
height: 30px;
}
::v-deep .el-upload--picture-card{
::v-deep .el-upload--picture-card {
width: 30px;
height: 30px;
line-height: 40px;
}
::v-deep .el-dialog{
::v-deep .el-dialog {
background: #1e1e1e;
border: 1px solid #ddd;
color: #ddd;
.el-dialog__title{
color:#fff;
.el-dialog__title {
color: #fff;
}
.el-input .el-input__inner{
.el-input .el-input__inner {
background-color: transparent;
color: #ddd;
border: 1px solid #5e5e5e;
}
.el-input.is-disabled .el-input__inner{
.el-input.is-disabled .el-input__inner {
background-color: #646464a1;
}
.el-form-item__label{
.el-form-item__label {
color: #dfdfdf
}
}
}
::v-deep .el-switch__label{
color:#fff;
::v-deep .el-switch__label {
color: #fff;
}
::v-deep .el-switch__label.is-active{
::v-deep .el-switch__label.is-active {
color: #428bca;
}
.uploadWrapper{
.uploadWrapper {
display: flex;
flex-direction: column;
align-items: flex-start;

View File

@ -6,16 +6,12 @@
>
{{ question.GroupName }}
</div> -->
<div
v-if="!!question.GroupName && question.Type === 'group'"
style="font-weight: bold; font-size: 16px; margin: 5px 0px"
>
<div v-if="!!question.GroupName && question.Type === 'group'"
style="font-weight: bold; font-size: 16px; margin: 5px 0px">
{{ language === "en" ? question.GroupEnName : question.GroupName }}
</div>
<div
v-if="question.Type === 'table' || question.Type === 'basicTable'"
style="font-weight: bold; font-size: 14px; margin: 5px 0px"
>
<div v-if="question.Type === 'table' || question.Type === 'basicTable'"
style="font-weight: bold; font-size: 14px; margin: 5px 0px">
<div style="display: flex; justify-content: space-between">
<span>{{ question.QuestionName }}</span>
<!-- 添加 -->
@ -24,28 +20,18 @@
</el-button>
</div>
<el-table :data="question.TableQuestions.Answers">
<el-table-column
v-for="item of question.TableQuestions.Questions"
:key="item.Id"
:prop="item.Id"
:label="item.QuestionName"
min-width="100"
show-overflow-tooltip
/>
<el-table-column v-for="item of question.TableQuestions.Questions" :key="item.Id" :prop="item.Id"
:label="item.QuestionName" min-width="100" show-overflow-tooltip />
</el-table>
</div>
<template v-else>
<el-form-item
v-if="
<el-form-item v-if="
(question.ShowQuestion === 1 &&
!!~question.ParentTriggerValueList.indexOf(
questionForm[question.ParentId]
)) ||
question.ShowQuestion === 0
"
:label="`${question.QuestionName}`"
:prop="question.Id"
:rules="[
" :label="`${question.QuestionName}`" :prop="question.Id" :rules="[
{
required:
(question.IsRequired === 0 ||
@ -59,131 +45,71 @@
message: this.$t('common:ruleMessage:specify'),
trigger: ['blur', 'change'],
},
]"
:class="[
]" :class="[
question.Type === 'group'
? 'mb'
: question.Type === 'upload'
? 'uploadWrapper'
: '',
]"
>
]">
<!-- 输入框 -->
<el-input
v-if="question.Type === 'input'"
v-model="questionForm[question.Id]"
:disabled="question.TableQuestionType === 2"
@change="(val) => { formItemChange(val, question) }"
/>
<el-input v-if="question.Type === 'input'" v-model="questionForm[question.Id]"
:disabled="question.TableQuestionType === 2" @change="(val) => { formItemChange(val, question) }" />
<!-- 多行文本输入框 -->
<el-input
v-if="question.Type === 'textarea'"
v-model="questionForm[question.Id]"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
@change="(val) => { formItemChange(val, question) }"
/>
<el-input v-if="question.Type === 'textarea'" v-model="questionForm[question.Id]" type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }" @change="(val) => { formItemChange(val, question) }" />
<!-- 下拉框 -->
<el-select
v-if="question.Type === 'select'"
v-model="questionForm[question.Id]"
clearable
:disabled="
(question.TableQuestionType === 2 ||
<el-select v-if="question.Type === 'select'" v-model="questionForm[question.Id]" clearable :disabled="(question.TableQuestionType === 2 ||
question.QuestionGenre === 2) &&
!!question.DictionaryCode
"
@change="(val) => { formItemChange(val, question) }"
>
" @change="(val) => { formItemChange(val, question) }">
<template v-if="question.TableQuestionType === 1">
<el-option
v-for="item in organList"
:key="item.Id"
:label="item[question.DataTableColumn]"
:value="item[question.DataTableColumn]"
/>
<el-option v-for="item in organList" :key="item.Id" :label="item[question.DataTableColumn]"
:value="item[question.DataTableColumn]" />
</template>
<template
v-else-if="
<template v-else-if="
question.TableQuestionType === 3 || question.QuestionGenre === 3
"
>
<el-option
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:value="item.value"
:label="item.label"
/>
">
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="item.value"
:label="item.label" />
</template>
<template
v-else-if="
<template v-else-if="
(question.TableQuestionType === 2 ||
question.QuestionGenre === 2) &&
question.DictionaryCode
"
>
<el-option
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:value="item.value"
:label="item.label"
/>
">
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="item.value"
:label="item.label" />
</template>
<template v-else>
<el-option
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val.trim()"
:value="val.trim()"
/>
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()"
:value="val.trim()" />
</template>
</el-select>
<!-- 单选 -->
<el-radio-group
v-if="question.Type === 'radio'"
v-model="questionForm[question.Id]"
@change="(val) => { formItemChange(val, question) }"
>
<el-radio-group v-if="question.Type === 'radio'" v-model="questionForm[question.Id]"
@change="(val) => { formItemChange(val, question) }">
<template v-if="question.DictionaryCode">
<el-radio
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:label="item.value"
>
<el-radio v-for="item of $d[question.DictionaryCode]" :key="item.id" :label="item.value">
{{ item.label }}
</el-radio>
</template>
<template v-if="question.TypeValue">
<el-radio
v-for="val in question.TypeValue.split('|')"
:key="val.trim()"
:label="val.trim()"
>
<el-radio v-for="val in question.TypeValue.split('|')" :key="val.trim()" :label="val.trim()">
{{ val.trim() }}
</el-radio>
</template>
</el-radio-group>
<!-- 复选框 -->
<el-checkbox-group
v-if="question.Type === 'checkbox'"
v-model="questionForm[question.Id]"
@change="(val) => { formItemChange(val, question) }"
>
<el-checkbox-group v-if="question.Type === 'checkbox'" v-model="questionForm[question.Id]"
@change="(val) => { formItemChange(val, question) }">
<template v-if="question.DictionaryCode">
<el-checkbox
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:label="item.value"
>
<el-checkbox v-for="item of $d[question.DictionaryCode]" :key="item.id" :label="item.value">
{{ item.label }}
</el-checkbox>
</template>
<template v-if="question.TypeValue">
<el-checkbox
v-for="val in question.TypeValue.split('|')"
:key="val.trim()"
:label="val.trim()"
>
<el-checkbox v-for="val in question.TypeValue.split('|')" :key="val.trim()" :label="val.trim()">
{{ val.trim() }}
</el-checkbox>
</template>
@ -191,129 +117,58 @@
<!-- 自动计算 -->
<!-- :precision="2" :step="0.1" :max="10" -->
<el-input
v-if="question.Type === 'calculation'"
v-model="questionForm[question.Id]"
disabled
/>
<el-input v-if="question.Type === 'calculation'" v-model="questionForm[question.Id]" disabled />
<!-- 自动分类 -->
<el-input
v-if="question.Type === 'class' && question.ClassifyShowType === 1"
v-model="questionForm[question.Id]"
:disabled="!question.ClassifyEditType"
/>
<el-select
v-if="question.Type === 'class' && question.ClassifyShowType === 2"
v-model="questionForm[question.Id]"
:disabled="!question.ClassifyEditType"
@change="(val) => { formItemChange(val, question) }"
>
<el-option
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val.trim()"
:value="val.trim()"
/>
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 1"
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType" />
<el-select v-if="question.Type === 'class' && question.ClassifyShowType === 2"
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType"
@change="(val) => { formItemChange(val, question) }">
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
</el-select>
<el-radio-group
v-if="question.Type === 'class' && question.ClassifyShowType === 3"
v-model="questionForm[question.Id]"
:disabled="!question.ClassifyEditType"
@change="(val) => { formItemChange(val, question) }"
>
<el-radio
v-for="item of question.TypeValue.split('|')"
:key="item.trim()"
:label="item.trim()"
>
<el-radio-group v-if="question.Type === 'class' && question.ClassifyShowType === 3"
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType"
@change="(val) => { formItemChange(val, question) }">
<el-radio v-for="item of question.TypeValue.split('|')" :key="item.trim()" :label="item.trim()">
{{ item.trim() }}
</el-radio>
</el-radio-group>
<el-input
v-if="question.Type === 'class' && question.ClassifyShowType === 4"
type="number"
:disabled="!question.ClassifyEditType"
v-model="questionForm[question.Id]"
/>
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 4" type="number"
:disabled="!question.ClassifyEditType" v-model="questionForm[question.Id]" />
<!-- 自增 -->
<el-input
v-if="question.Type === 'increment'"
v-model="questionForm[question.Id]"
disabled
/>
<el-input v-if="question.Type === 'increment'" v-model="questionForm[question.Id]" disabled />
<!-- 数值 -->
<!-- :precision="2" :step="0.1" :max="10" -->
<el-select
v-if="question.Type === 'number' && question.TypeValue"
v-model="questionForm[question.Id]"
clearable
@change="(val) => { formItemNumberChange(val, question) }"
>
<el-option
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val.trim()"
:value="val.trim()"
/>
<el-select v-if="question.Type === 'number' && question.TypeValue" v-model="questionForm[question.Id]" clearable
@change="(val) => { formItemNumberChange(val, question) }">
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
</el-select>
<el-input
v-else-if="question.Type === 'number' && question.DataSource !== 1"
v-model="questionForm[question.Id]"
type="number"
@change="(val) => { formItemNumberChange(val, question) }"
/>
<el-input
v-else-if="question.Type === 'number' && question.DataSource === 1"
v-model="questionForm[question.Id]"
type="number"
:disabled="question.DataSource === 1"
/>
<el-input v-else-if="question.Type === 'number' && question.DataSource !== 1"
v-model="questionForm[question.Id]" type="number"
@change="(val) => { formItemNumberChange(val, question) }" />
<el-input v-else-if="question.Type === 'number' && question.DataSource === 1"
v-model="questionForm[question.Id]" :disabled="question.DataSource === 1" />
<!-- 上传图像 -->
<el-upload
v-if="question.Type === 'upload'"
action
:accept="question.FileType"
:limit="question.ImageCount > 0 ? parseInt(question.ImageCount) : 100"
:on-preview="handlePictureCardPreview"
:before-upload="handleBeforeUpload"
:http-request="uploadScreenshot"
list-type="picture-card"
:on-remove="handleRemove"
:file-list="fileList"
:class="{ disabled: fileList.length >= question.ImageCount }"
>
<el-upload v-if="question.Type === 'upload'" action :accept="question.FileType"
:limit="question.ImageCount > 0 ? parseInt(question.ImageCount) : 100" :on-preview="handlePictureCardPreview"
:before-upload="handleBeforeUpload" :http-request="uploadScreenshot" list-type="picture-card"
:on-remove="handleRemove" :file-list="fileList" :class="{ disabled: fileList.length >= question.ImageCount }">
<i slot="default" class="el-icon-plus" />
<div slot="file" slot-scope="{ file }">
<img
class="el-upload-list__item-thumbnail"
:src="OSSclientConfig.basePath + file.url"
crossOrigin="Anonymous"
alt=""
/>
<img class="el-upload-list__item-thumbnail" :src="OSSclientConfig.basePath + file.url"
crossOrigin="Anonymous" alt="" />
<span class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
<i class="el-icon-zoom-in" />
</span>
<span
v-if="readingTaskState < 2"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<span v-if="readingTaskState < 2" class="el-upload-list__item-delete" @click="handleRemove(file)">
<i class="el-icon-delete" />
</span>
</span>
</div>
</el-upload>
<el-dialog
v-if="question.Type === 'upload'"
append-to-body
:visible.sync="imgVisible"
width="600px"
>
<el-dialog v-if="question.Type === 'upload'" append-to-body :visible.sync="imgVisible" width="600px">
<el-image :src="imageUrl" crossOrigin="Anonymous" width="100%">
<!-- 加载中 -->
<div slot="placeholder" class="image-slot">
@ -324,62 +179,28 @@
</el-dialog>
</el-form-item>
</template>
<template
v-if="
<template v-if="
question.Childrens &&
question.Childrens.length > 0 &&
(question.Type !== 'table' && question.Type !== 'basicTable') && Object.keys(questionForm).length > 0
"
>
<QuestionFormItem
v-for="item in question.Childrens"
:key="item.Id"
:questionForm="questionForm"
:question="item"
:reading-task-state="readingTaskState"
:is-system-criterion="isSystemCriterion"
:visit-task-id="visitTaskId"
:criterion-id="criterionId"
:calculation-list="calculationList"
@formItemNumberChange="formItemNumberChange"
@setFormItemData="setFormItemData"
@resetFormItemData="resetFormItemData"
/>
">
<QuestionFormItem v-for="item in question.Childrens" :key="item.Id" :questionForm="questionForm" :question="item"
:reading-task-state="readingTaskState" :is-system-criterion="isSystemCriterion" :visit-task-id="visitTaskId"
:criterion-id="criterionId" :calculation-list="calculationList" @formItemNumberChange="formItemNumberChange"
@setFormItemData="setFormItemData" @resetFormItemData="resetFormItemData" />
</template>
<el-dialog
v-if="addOrEdit.visible"
class="my_dialog"
:visible.sync="addOrEdit.visible"
:close-on-click-modal="false"
:title="addOrEdit.title"
width="400px"
append-to-body
>
<el-dialog v-if="addOrEdit.visible" class="my_dialog" :visible.sync="addOrEdit.visible"
:close-on-click-modal="false" :title="addOrEdit.title" width="400px" append-to-body>
<el-form ref="tableQsForm" v-loading="loading" size="small">
<QuestionTableFormItem
v-for="item in QuestionsList"
:key="item.Id"
:question="item"
:reading-task-state="readingTaskState"
:is-system-criterion="isSystemCriterion"
:question-form="QuestionsForm"
:visit-task-id="visitTaskId"
:criterion-id="criterionId"
@formItemTableNumberChange="formItemTableNumberChange"
@setFormItemData="setTblFormItemData"
@resetFormItemData="resetTblFormItemData"
/>
<div
class="base-dialog-footer"
style="text-align: right; margin-top: 10px"
>
<QuestionTableFormItem v-for="item in QuestionsList" :key="item.Id" :question="item"
:reading-task-state="readingTaskState" :is-system-criterion="isSystemCriterion" :question-form="QuestionsForm"
:visit-task-id="visitTaskId" :criterion-id="criterionId"
@formItemTableNumberChange="formItemTableNumberChange" @setFormItemData="setTblFormItemData"
@resetFormItemData="resetTblFormItemData" />
<div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
<el-form-item>
<!-- 取消 -->
<el-button
size="small"
type="primary"
@click="addOrEdit.visible = false"
>
<el-button size="small" type="primary" @click="addOrEdit.visible = false">
{{ $t("common:button:cancel") }}
</el-button>
<!-- 保存 -->
@ -542,40 +363,62 @@ export default {
this.addOrEdit.visible = false;
},
logic(rules, num = 0) {
let isNE = false
try {
if (rules.CalculateQuestionList.length === 0) {
return false;
}
let dataArr = []
rules.CalculateQuestionList.forEach((o, i) => {
if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) {
if (rules.CustomCalculateMark > 4 && rules.CustomCalculateMark < 10) {
switch (rules.CustomCalculateMark) {
case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId]);
} else {
num *= parseFloat(q[o.TableQuestionId]);
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
});
break;
case 6:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId]);
} else {
num += parseFloat(q[o.TableQuestionId]);
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
});
break;
case 7:
this.questionForm[o.QuestionId].forEach((q, qi) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
if (qi === 0) {
num = parseFloat(q[o.TableQuestionId]);
} else {
num += parseFloat(q[o.TableQuestionId]);
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
});
num =
this.questionForm[o.QuestionId].length === 0
@ -585,38 +428,62 @@ export default {
case 8:
var arr = [];
this.questionForm[o.QuestionId].forEach((q) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId]);
}
arr.push(q[o.TableQuestionId]);
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
});
num = arr.length === 0 ? 0 : Math.max(...arr);
break;
case 9:
var arr = [];
this.questionForm[o.QuestionId].forEach((q) => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId]);
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
}
});
num = arr.length === 0 ? 0 : Math.min(...arr);
console.log("min", this.questionForm[o.QuestionId], arr, num);
break;
}
} else {
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId]);
if (!isNaN(num)) {
dataArr.push(num)
}
}
}
} else {
switch (rules.CustomCalculateMark) {
case 1:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId]);
}
break;
case 2:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId]);
}
break;
case 3:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId]);
}
break;
case 4:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num /= parseFloat(this.questionForm[o.TableQuestionId]);
}
break;
case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
@ -657,7 +524,13 @@ export default {
} catch (e) {
console.log(e);
}
return num;
if (isNE) {
return 'NE'
}
if (rules.ValueType === 2) {
num = num * 100
}
return num.toFixed(this.digitPlaces)
},
formItemNumberChange(questionId, isTable) {
if (typeof isTable === 'object') {
@ -700,26 +573,49 @@ export default {
var CalculateQuestions = JSON.parse(v.CalculateQuestions);
var num,
arr = [];
let isNE = false
CalculateQuestions.forEach((o, i) => {
console.log(this.QuestionsForm[o.TableQuestionId], 'this.QuestionsForm[o.TableQuestionId]')
if (this.QuestionsForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) {
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num = parseFloat(this.QuestionsForm[o.TableQuestionId]);
arr = [num];
}
} else {
switch (v.CustomCalculateMark) {
case 1:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num += parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break;
case 2:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num -= parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break;
case 3:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num *= parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break;
case 4:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num /= parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break;
case 7:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
}
num =
arr.length === 0
? 0
@ -728,17 +624,28 @@ export default {
}, 0) / arr.length;
break;
case 8:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
}
num = arr.length === 0 ? 0 : Math.max(...arr);
break;
case 9:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
}
num = arr.length === 0 ? 0 : Math.min(...arr);
// console.log('min', this.questionForm[o.QuestionId], arr, num)
break;
}
}
});
if (isNE) {
num = 'NE'
} else {
num = num.toFixed(this.digitPlaces)
}
this.$set(this.QuestionsForm, v.Id, num.toString());
}
});
@ -749,13 +656,13 @@ export default {
this.addOrEdit.title =
row.QuestionName + this.$t("trials:readingUnit:qsList:title:tableQs"); // ''
this.QuestionsList = row.TableQuestions.Questions;
row.TableQuestions.Questions.map(v=>{
row.TableQuestions.Questions.map(v => {
if (v.Type === 'class') {
this.classArr.push({triggerId: v.ClassifyTableQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType})
this.classArr.push({ triggerId: v.ClassifyTableQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType })
}
})
// this.AnswersList = row.TableQuestions.Answers;
row.TableQuestions.Questions.map(i=>{
row.TableQuestions.Questions.map(i => {
this.$set(this.QuestionsForm, i.Id, null)
})
// this.QuestionsForm = {};
@ -815,7 +722,7 @@ export default {
},
setTblFormItemData(obj) {
this.$set(this.QuestionsForm, obj.key, obj.val)
this.classArr.map(i=>{
this.classArr.map(i => {
if (i.triggerId === obj.key) {
let answer = null
let list = JSON.parse(i.classifyAlgorithms)
@ -985,26 +892,32 @@ export default {
}
}
}
.criterion-form-item {
.el-form-item {
display: flex;
flex-direction: row;
align-items: flex-start;
}
::v-deep .el-form-item__content {
width: 500px;
}
.el-input {
width: 100%;
}
.mb {
margin-bottom: 0px;
}
.disabled {
::v-deep .el-upload--picture-card {
display: none;
}
}
.uploadWrapper {
display: flex;
flex-direction: column;

View File

@ -147,7 +147,7 @@
v-if="question.Type === 'number' && question.TypeValue"
v-model="questionForm[question.Id]"
clearable
@change="((val)=>{formItemChange(val, question)})"
@change="((val)=>{formItemNumberChange(val, question)})"
>
<el-option
v-for="val in question.TypeValue.split('|')"
@ -168,7 +168,6 @@
<el-input
v-else-if="question.Type === 'number' && question.DataSource === 1"
v-model="questionForm[question.Id]"
type="number"
:disabled="question.DataSource === 1"
>
<template v-if="question.Unit !== 0" slot="append">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}</template>

View File

@ -1175,7 +1175,7 @@ export default {
if (this.form.ClassifyTableQuestionId) {
this.classifyQuestionChange(this.form.ClassifyTableQuestionId)
}
if (!this.data.ShowOrder) {
if (!this.data.ShowOrder && this.data.ShowOrder !== 0) {
if (this.list.length > 0) {
var ShowOrderList = this.list.map(v => v.ShowOrder)
this.form.ShowOrder = Math.max(...ShowOrderList) + 1