自动计算相关
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 *.sln
.eslintignore .eslintignore
/.eslintignore /.eslintignore
*.svn

View File

@ -469,7 +469,7 @@ async function VueInit() {
var my_password = zzSessionStorage.getItem('my_password') var my_password = zzSessionStorage.getItem('my_password')
let my_userid = zzSessionStorage.getItem('userId') let my_userid = zzSessionStorage.getItem('userId')
let my_EMail = zzSessionStorage.getItem('my_EMail') || '' 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(() => { resetReadingRestTime().then(() => {
}) })
const closeLock = (_vm) => { const closeLock = (_vm) => {

View File

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

View File

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

View File

@ -4,63 +4,36 @@
<div slot="header" class="clearfix report-header"> <div slot="header" class="clearfix report-header">
<h3 style="margin:0;padding:0;">{{ $t('trials:readingReport:title:eicrf') }}</h3> <h3 style="margin:0;padding:0;">{{ $t('trials:readingReport:title:eicrf') }}</h3>
<div style="margin-left:auto"> <div style="margin-left:auto">
<el-switch <el-switch v-model="isShowDetail" :active-text="$t('trials:readingReport:title:expandDetails')"
v-model="isShowDetail" :inactive-text="$t('trials:readingReport:title:collapseDetails')" style="margin-right:5px"
:active-text="$t('trials:readingReport:title:expandDetails')" @change="handleShowDetail" />
:inactive-text="$t('trials:readingReport:title:collapseDetails')" <el-button v-if="readingTaskState < 2" type="primary" size="small" @click="skipTask">
style="margin-right:5px"
@change="handleShowDetail"
/>
<el-button
v-if="readingTaskState<2"
type="primary"
size="small"
@click="skipTask"
>
<!-- 跳过 --> <!-- 跳过 -->
{{ $t('trials:readingReport:button:skip') }} {{ $t('trials:readingReport:button:skip') }}
</el-button> </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="getReportInfo">{{
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleSave(true)">{{$t('common:button:save')}}</el-button> $t('trials:readingReport:button:refresh') }}</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="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> </div>
<div style="flex: 1"> <div style="flex: 1">
<el-table <el-table ref="reportList" v-adaptive="{ bottomOffset: 0 }" :data="taskQuestions"
ref="reportList" v-if="taskQuestions.length > 0" row-key="Id" border default-expand-all height="100"
v-adaptive="{bottomOffset:0}" :tree-props="{ children: 'Childrens', hasChildren: 'hasChildren' }" size="mini">
:data="taskQuestions" <el-table-column prop="" label="" show-overflow-tooltip width="350px">
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"> <template slot-scope="scope">
<span v-if="scope.row.QuestionName">{{ scope.row.BlindName ? scope.row.QuestionName : scope.row.QuestionName }}</span> <span v-if="scope.row.QuestionName">{{ scope.row.BlindName ? scope.row.QuestionName :
<span scope.row.QuestionName }}</span>
v-else <span v-else style="font-weight: bold;font-size: 16px;color: #f44336;">
style="font-weight: bold;font-size: 16px;color: #f44336;"
>
{{ scope.row.GroupName }} {{ scope.row.GroupName }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column v-for="task in visitTaskList" :key="task.VisitTaskId" prop="date" show-overflow-tooltip
v-for="task in visitTaskList" width="200px">
:key="task.VisitTaskId"
prop="date"
show-overflow-tooltip
width="200px"
>
<template slot="header"> <template slot="header">
<div v-if="task.IsCurrentTask"> <div v-if="task.IsCurrentTask">
{{ task.BlindName }} {{ task.BlindName }}
@ -72,181 +45,177 @@
<span class="el-icon-view"></span> <span class="el-icon-view"></span>
</el-button> </el-button>
</div> </div>
<!-- <div v-if="task.LatestScanDate">--> <!-- <div v-if="task.LatestScanDate">-->
<!-- {{ task.LatestScanDate.split(' ')[0] }}--> <!-- {{ task.LatestScanDate.split(' ')[0] }}-->
<!-- </div>--> <!-- </div>-->
<!-- {{ `(影像点击跳转)` }} --> <!-- {{ `(影像点击跳转)` }} -->
<!-- {{ $t('trials:readingReport:button:jump') }}--> <!-- {{ $t('trials:readingReport:button:jump') }}-->
</div> </div>
</template> </template>
<template slot-scope="scope"> <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> <template>
<!-- 输入框 --> <!-- 输入框 -->
<div> <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> </template>
<el-input <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]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini" size="mini" />
/> <span
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='input' || scope.row.Type==='textarea')"> 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]}} {{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span> </span>
<el-input <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-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]" v-model="questionForm[scope.row.QuestionId]" size="mini" />
size="mini" <span v-else-if="scope.row.Type === 'input' || scope.row.Type === 'textarea'">
/> {{ questionForm[scope.row.QuestionId] }}
<span v-else-if="scope.row.Type==='input' || scope.row.Type==='textarea'">
{{questionForm[scope.row.QuestionId]}}
</span> </span>
<el-select <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]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini" size="mini" clearable>
clearable
>
<template> <template>
<el-option <el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val.trim()"
v-for="val in scope.row.TypeValue.split('|')" :value="val.trim()" />
:key="val"
:label="val.trim()"
:value="val.trim()"
/>
</template> </template>
</el-select> </el-select>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='select' || scope.row.Type==='radio'"> <span
{{questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}} 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> </span>
<el-select <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-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]" v-model="questionForm[scope.row.QuestionId]" size="mini" clearable
size="mini" @focus="() => { questionId = scope.row.QuestionId }">
clearable
>
<template> <template>
<el-option <el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val.trim()"
v-for="val in scope.row.TypeValue.split('|')" :value="val.trim()" />
:key="val"
:label="val.trim()"
:value="val.trim()"
/>
</template> </template>
</el-select> </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]}} {{ questionForm[scope.row.QuestionId] }}
</span> </span>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='class'"> <span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'class'">
{{questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}} {{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span> </span>
<span v-else-if="scope.row.Type==='class'"> <span v-else-if="scope.row.Type === 'class'">
{{questionForm[scope.row.QuestionId]}} {{ questionForm[scope.row.QuestionId] }}
</span> </span>
<el-input <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]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
:disabled="scope.row.DataSource === 1" :disabled="scope.row.DataSource === 1" @blur="value = parseFloat(value).toFixed(digitPlaces)"
@blur="value=parseFloat(value).toFixed(digitPlaces)"
@input="limitInput($event, questionForm[scope.row.QuestionId][scope.row.xfIndex], scope.row.TableQuestionId)" @input="limitInput($event, questionForm[scope.row.QuestionId][scope.row.xfIndex], scope.row.TableQuestionId)"
size="mini" size="mini" @focus="() => { questionId = scope.row.QuestionId }">
@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-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> <template slot="append" v-else-if="scope.row.ValueType === 2">%</template>
</el-input> </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"> <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>
<template v-else-if="scope.row.ValueType === 2"> <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>
<template v-else> <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> </template>
</span> </span>
<el-input <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-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]" v-model="questionForm[scope.row.QuestionId]" :disabled="scope.row.DataSource === 1"
:disabled="scope.row.DataSource === 1" @blur="value = parseFloat(value).toFixed(digitPlaces)"
@blur="value=parseFloat(value).toFixed(digitPlaces)" @input="limitInput($event, questionForm, scope.row.QuestionId)" size="mini"
@input="limitInput($event, questionForm, scope.row.QuestionId)" @focus="() => { questionId = scope.row.QuestionId }">
size="mini" <template slot="append" v-if="scope.row.Unit !== 0">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
@focus="() => {questionId = scope.row.QuestionId}" scope.row.Unit) : scope.row.CustomUnit }}</template>
>
<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> <template slot="append" v-else-if="scope.row.ValueType === 2">%</template>
</el-input> </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"> <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>
<template v-else-if="scope.row.ValueType === 2"> <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>
<template v-else> <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> </template>
</span> </span>
</div> </div>
</template> </template>
</template> </template>
<template v-else-if="task.VisitTaskId === visitTaskId && scope.row.Type === 'upload'"> <template v-else-if="task.VisitTaskId === visitTaskId && scope.row.Type === 'upload'">
<customize-report-page-upload <customize-report-page-upload
v-if="scope.row.Type==='upload' && (scope.row.xfIndex || scope.row.xfIndex === 0)" v-if="scope.row.Type === 'upload' && (scope.row.xfIndex || scope.row.xfIndex === 0)"
:visitTaskId="visitTaskId" :visitTaskId="visitTaskId" :question="scope.row" :task="task" :readingTaskState="readingTaskState"
:question="scope.row" :initUrl="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
:task="task" @setImageUrl="(url) => { setImageUrl(scope.row.QuestionId, scope.row.xfIndex, scope.row.TableQuestionId, url, scope.row.RowId) }"></customize-report-page-upload>
:readingTaskState="readingTaskState" <customize-report-page-upload v-else-if="scope.row.Type === 'upload'" :visitTaskId="visitTaskId"
:initUrl="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]" :question="scope.row" :task="task" :readingTaskState="readingTaskState"
@setImageUrl="(url) => {setImageUrl(scope.row.QuestionId, scope.row.xfIndex, scope.row.TableQuestionId, url, scope.row.RowId)}" :initUrl="questionForm[scope.row.QuestionId]"
></customize-report-page-upload> @setImageUrl="(url) => { setImageUrl(scope.row.QuestionId, scope.row.xfIndex, scope.row.TableQuestionId, url) }"></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>
</template> </template>
<template v-else-if="scope.row.Type === 'upload'"> <template v-else-if="scope.row.Type === 'upload'">
<customize-report-page-upload <customize-report-page-upload
v-if="scope.row.Type==='upload' && (scope.row.xfIndex || scope.row.xfIndex === 0)" v-if="scope.row.Type === 'upload' && (scope.row.xfIndex || scope.row.xfIndex === 0)"
:visitTaskId="visitTaskId" :visitTaskId="visitTaskId" :question="scope.row" :task="task" :readingTaskState="readingTaskState"
:question="scope.row" :initUrl="scope.row.Answers[task.VisitTaskId]"></customize-report-page-upload>
:task="task" <customize-report-page-upload v-else-if="scope.row.Type === 'upload'" :visitTaskId="visitTaskId"
:readingTaskState="readingTaskState" :question="scope.row" :task="task" :readingTaskState="readingTaskState"
:initUrl="scope.row.Answers[task.VisitTaskId]" :initUrl="scope.row.Answers[task.VisitTaskId]"></customize-report-page-upload>
></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>
<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] }} {{ scope.row.Answers[task.VisitTaskId] === '-1' ? '未知' : scope.row.Answers[task.VisitTaskId] }}
</template> </template>
<template v-else-if="scope.row.DictionaryCode"> <template v-else-if="scope.row.DictionaryCode">
{{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }} {{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }}
</template> </template>
<template v-else-if="CriterionType === 10"> <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>
<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>
<template v-else-if="(scope.row.ValueType === 0 || scope.row.ValueType === 1) && scope.row.Unit"> <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>
<template v-else-if="scope.row.ValueType === 2"> <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>
<template v-else-if="scope.row.Answers && scope.row.Answers.hasOwnProperty(task.VisitTaskId)"> <template v-else-if="scope.row.Answers && scope.row.Answers.hasOwnProperty(task.VisitTaskId)">
{{ scope.row.Answers[task.VisitTaskId] }} {{ scope.row.Answers[task.VisitTaskId] }}
@ -258,16 +227,11 @@
</el-card> </el-card>
<!-- 签名框 --> <!-- 签名框 -->
<el-dialog <el-dialog v-if="signVisible" :visible.sync="signVisible" :close-on-click-modal="false" width="600px"
v-if="signVisible" custom-class="base-dialog-wrapper">
:visible.sync="signVisible"
:close-on-click-modal="false"
width="600px"
custom-class="base-dialog-wrapper"
>
<div slot="title"> <div slot="title">
<span style="font-size:18px;">{{ $t('common:dialogTitle:sign') }}</span> <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> </div>
<SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" /> <SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" />
</el-dialog> </el-dialog>
@ -380,7 +344,7 @@ export default {
list.forEach(v => { list.forEach(v => {
if (v.QuestionId === questionId) { if (v.QuestionId === questionId) {
return Object.assign({}, v.Answers) return Object.assign({}, v.Answers)
} else if (v.Childrens.length > 0){ } else if (v.Childrens.length > 0) {
return this.getTagterAnswers(v.Childrens, questionId) return this.getTagterAnswers(v.Childrens, questionId)
} }
}) })
@ -453,7 +417,7 @@ export default {
}, },
setChild(obj) { setChild(obj) {
obj.forEach((i, index) => { obj.forEach((i, index) => {
if (i.Type !== 'group' && i.Type !== 'summary' && i.Id && i.Type !== 'table' && i.Type !== 'basicTable') { if (i.Type !== 'group' && i.Type !== 'summary' && i.Id && i.Type !== 'table' && i.Type !== 'basicTable') {
this.$set(this.questionForm, i.QuestionId, i.Answers[this.visitTaskId]) this.$set(this.questionForm, i.QuestionId, i.Answers[this.visitTaskId])
} }
if (i.Type === 'table' || i.Type === 'basicTable') { if (i.Type === 'table' || i.Type === 'basicTable') {
@ -463,7 +427,7 @@ export default {
if (i.Type === 'number') { if (i.Type === 'number') {
this.$set(this.questionForm, i.QuestionId, i.Answers[this.visitTaskId] === '' ? parseFloat(0).toFixed(this.digitPlaces) : i.Answers[this.visitTaskId]) this.$set(this.questionForm, i.QuestionId, i.Answers[this.visitTaskId] === '' ? parseFloat(0).toFixed(this.digitPlaces) : i.Answers[this.visitTaskId])
} }
if (i.Childrens && i.Childrens.length > 0 && i.Type !== 'table' && i.Type !== 'basicTable') { if (i.Childrens && i.Childrens.length > 0 && i.Type !== 'table' && i.Type !== 'basicTable') {
this.setChild(i.Childrens) this.setChild(i.Childrens)
} }
}) })
@ -479,38 +443,58 @@ export default {
}) })
}, },
logic(rules, num = 0) { logic(rules, num = 0) {
let isNE = false
try { try {
if (rules.CalculateQuestionList.length === 0) { if (rules.CalculateQuestionList.length === 0) {
return false return false
} }
let dataArr = []
rules.CalculateQuestionList.forEach((o, i) => { rules.CalculateQuestionList.forEach((o, i) => {
if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) { if (i === 0) {
if (rules.CustomCalculateMark > 4) { if (rules.CustomCalculateMark > 4) {
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 5: case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = parseFloat(q[o.TableQuestionId])
num *= parseFloat(q[o.TableQuestionId]) } else {
num *= parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
} }
}) })
break; break;
case 6: case 6:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
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; break;
case 7: case 7:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = parseFloat(q[o.TableQuestionId])
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 num = this.questionForm[o.QuestionId].length === 0 ? 0 : num / this.questionForm[o.QuestionId].length
@ -518,42 +502,97 @@ export default {
case 8: case 8:
var arr = [] var arr = []
this.questionForm[o.QuestionId].forEach(q => { this.questionForm[o.QuestionId].forEach(q => {
arr.push(q[o.TableQuestionId]) 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) num = arr.length === 0 ? 0 : Math.max(...arr)
break; break;
case 9: case 9:
var arr = [] var arr = []
this.questionForm[o.QuestionId].forEach(q => { this.questionForm[o.QuestionId].forEach(q => {
arr.push(q[o.TableQuestionId]) 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) num = arr.length === 0 ? 0 : Math.min(...arr)
break; break;
} }
} else { } else {
num = parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId])
}
} }
} else { } else {
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 1: case 1:
num += parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break; break;
case 2: case 2:
num -= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break; break;
case 3: case 3:
num *= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break; break;
case 4: case 4:
num /= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
// num /= parseFloat(this.questionForm[o.TableQuestionId]) // num /= parseFloat(this.questionForm[o.TableQuestionId])
break; 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) { } catch (e) {
console.log(e) console.log(e)
} }
if (isNE) {
return 'NE'
}
if (rules.ValueType === 2) { if (rules.ValueType === 2) {
num = num * 100 num = num * 100
} }
@ -586,12 +625,12 @@ export default {
setScrollTop(a) { setScrollTop(a) {
setTimeout(() => { setTimeout(() => {
this.$nextTick(() => { 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
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) { getQuestions(questions, isNTFilterLength, lesionType, isLymphNodes) {
const arr = [] const arr = []
@ -769,16 +808,16 @@ export default {
type: 'warning', type: 'warning',
distinguishCancelAndClose: true distinguishCancelAndClose: true
}) })
.then(() => { .then(() => {
window.location.reload() window.location.reload()
}) })
.catch(action => { .catch(action => {
}) })
} }
} }
this.loading = false this.loading = false
} catch(e) { } catch (e) {
this.loading = false this.loading = false
if (this.$refs['signForm'] && this.$refs['signForm'].btnLoading) { if (this.$refs['signForm'] && this.$refs['signForm'].btnLoading) {
this.$refs['signForm'].btnLoading = false this.$refs['signForm'].btnLoading = false
@ -813,7 +852,7 @@ export default {
questionId: k, questionId: k,
answer: v[o], answer: v[o],
tableQuestionId: o, tableQuestionId: o,
rowId: v[o+'_RowId'] rowId: v[o + '_RowId']
}) })
} }
}) })
@ -867,27 +906,32 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.report-wrapper{ .report-wrapper {
height: 100%; height: 100%;
// background-color: #fff; // background-color: #fff;
background-color: #000; background-color: #000;
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 7px; width: 7px;
height: 7px; height: 7px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
border-radius: 10px; border-radius: 10px;
background: #d0d0d0; background: #d0d0d0;
} }
.report-header{
.report-header {
display: flex; display: flex;
} }
.el-card{
.el-card {
background-color: #000; background-color: #000;
color: #ffffff; color: #ffffff;
border:none; border: none;
} }
// ::v-deep .el-table__cell{ // ::v-deep .el-table__cell{
// background-color: #000; // background-color: #000;
// color: #ffffff; // color: #ffffff;
@ -901,51 +945,62 @@ export default {
// color: #ffffff; // color: #ffffff;
// } // }
::v-deep .el-table, .el-table__expanded-cell { ::v-deep .el-table,
.el-table__expanded-cell {
background-color: #000; background-color: #000;
color: #fff; 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; background-color: #000;
color: #fff; 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; 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; 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; border: none;
} }
::v-deep .el-card__header{
::v-deep .el-card__header {
border: none; border: none;
padding: 10px; 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; width: 30px;
height: 30px; height: 30px;
} }
::v-deep .el-upload--picture-card{
::v-deep .el-upload--picture-card {
width: 30px; width: 30px;
height: 30px; height: 30px;
line-height: 40px; 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; color: #428bca;
} }
.uploadWrapper{
.uploadWrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;

View File

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

View File

@ -4,56 +4,33 @@
<div slot="header" class="clearfix report-header"> <div slot="header" class="clearfix report-header">
<h3 style="margin:0;padding:0;">{{ $t('trials:readingReport:title:eicrf') }}</h3> <h3 style="margin:0;padding:0;">{{ $t('trials:readingReport:title:eicrf') }}</h3>
<div style="margin-left:auto"> <div style="margin-left:auto">
<el-button <el-button v-if="readingTaskState < 2" type="primary" size="small" @click="skipTask">
v-if="readingTaskState<2"
type="primary"
size="small"
@click="skipTask"
>
<!-- 跳过 --> <!-- 跳过 -->
{{ $t('trials:readingReport:button:skip') }} {{ $t('trials:readingReport:button:skip') }}
</el-button> </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="getReportInfo">{{
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleSave(true)">{{ $t('common:button:save') }}</el-button> $t('trials:readingReport:button:refresh') }}</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="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> </div>
<div style="flex: 1"> <div style="flex: 1">
<el-table <el-table v-if="taskQuestions.length > 0" ref="reportList" v-adaptive="{ bottomOffset: 0 }"
v-if="taskQuestions.length > 0" :data="taskQuestions" row-key="Id" border default-expand-all height="100"
ref="reportList" :tree-props="{ children: 'Childrens', hasChildren: 'hasChildren' }" size="mini">
v-adaptive="{bottomOffset:0}" <el-table-column prop="" label="" show-overflow-tooltip width="350px">
: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"> <template slot-scope="scope">
<span v-if="scope.row.QuestionName">{{ scope.row.BlindName ? scope.row.QuestionName : scope.row.QuestionName }}</span> <span v-if="scope.row.QuestionName">{{ scope.row.BlindName ? scope.row.QuestionName :
<span scope.row.QuestionName }}</span>
v-else <span v-else style="font-weight: bold;font-size: 16px;color: #f44336;">
style="font-weight: bold;font-size: 16px;color: #f44336;"
>
{{ scope.row.GroupName }} {{ scope.row.GroupName }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column v-for="task in visitTaskList" :key="task.VisitTaskId" prop="date" show-overflow-tooltip
v-for="task in visitTaskList" width="200px">
:key="task.VisitTaskId"
prop="date"
show-overflow-tooltip
width="200px"
>
<template slot="header"> <template slot="header">
<div v-if="task.IsCurrentTask"> <div v-if="task.IsCurrentTask">
{{ task.BlindName }} {{ task.BlindName }}
@ -68,110 +45,115 @@
</div> </div>
</template> </template>
<template slot-scope="scope"> <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> <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 <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]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini" size="mini" />
/> <span
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='input' || scope.row.Type==='textarea')"> 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] }} {{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span> </span>
<el-input <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-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]" v-model="questionForm[scope.row.QuestionId]" size="mini" />
size="mini" <span v-else-if="scope.row.Type === 'input' || scope.row.Type === 'textarea'">
/>
<span v-else-if="scope.row.Type==='input' || scope.row.Type==='textarea'">
{{ questionForm[scope.row.QuestionId] }} {{ questionForm[scope.row.QuestionId] }}
</span> </span>
<el-select <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]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini" size="mini" clearable>
clearable
>
<template> <template>
<el-option <el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
</template> </template>
</el-select> </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] }} {{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span> </span>
<el-select <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-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]" v-model="questionForm[scope.row.QuestionId]" size="mini" clearable
size="mini" @focus="() => { questionId = scope.row.QuestionId }">
clearable
>
<template> <template>
<el-option <el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
</template> </template>
</el-select> </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] }} {{ questionForm[scope.row.QuestionId] }}
</span> </span>
<el-input <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]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
:disabled="scope.row.DataSource === 1" :disabled="scope.row.DataSource === 1" size="mini"
size="mini"
@blur="limitBlur(questionForm[scope.row.QuestionId][scope.row.xfIndex], scope.row.TableQuestionId, scope.row.ValueType)" @blur="limitBlur(questionForm[scope.row.QuestionId][scope.row.xfIndex], scope.row.TableQuestionId, scope.row.ValueType)"
@focus="() => {questionId = scope.row.QuestionId}" @focus="() => { questionId = scope.row.QuestionId }">
> <template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit }}</template> scope.row.Unit) : scope.row.CustomUnit }}</template>
<template v-else-if="scope.row.ValueType === 2" slot="append">%</template> <template v-else-if="scope.row.ValueType === 2" slot="append">%</template>
</el-input> </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"> <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>
<template v-else-if="scope.row.ValueType === 2"> <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>
<template v-else> <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> </template>
</span> </span>
<el-input <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-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]" v-model="questionForm[scope.row.QuestionId]" :disabled="scope.row.DataSource === 1" size="mini"
:disabled="scope.row.DataSource === 1"
size="mini"
@blur="limitBlur(questionForm, scope.row.QuestionId, scope.row.ValueType)" @blur="limitBlur(questionForm, scope.row.QuestionId, scope.row.ValueType)"
@focus="() => {questionId = scope.row.QuestionId}" @focus="() => { questionId = scope.row.QuestionId }">
> <template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit }}</template> scope.row.Unit) : scope.row.CustomUnit }}</template>
<template v-else-if="scope.row.ValueType === 2" slot="append">%</template> <template v-else-if="scope.row.ValueType === 2" slot="append">%</template>
</el-input> </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"> <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>
<template v-else-if="scope.row.ValueType === 2"> <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>
<template v-else> <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> </template>
</span> </span>
</div> </div>
</template> </template>
<template v-else-if="scope.row.Type==='upload' && scope.row.Answers[task.VisitTaskId]"> <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;"> <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)"> <el-button v-if="scope.row.Answers[task.VisitTaskId]" type="text" @click="preview(url)">
{{ `${$t('trials:noneDicom:title:attachment')}${index + 1}` }} {{ `${$t('trials:noneDicom:title:attachment')}${index + 1}` }}
</el-button> </el-button>
@ -181,14 +163,22 @@
{{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }} {{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }}
</template> </template>
<template v-else-if="criterionType === 10"> <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>
<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"> <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>
<template v-else-if="scope.row.ValueType === 2"> <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>
<template v-else-if="scope.row.Answers && scope.row.Answers.hasOwnProperty(task.VisitTaskId)"> <template v-else-if="scope.row.Answers && scope.row.Answers.hasOwnProperty(task.VisitTaskId)">
{{ scope.row.Answers[task.VisitTaskId] }} {{ scope.row.Answers[task.VisitTaskId] }}
@ -200,38 +190,20 @@
</el-card> </el-card>
<!-- 签名框 --> <!-- 签名框 -->
<el-dialog <el-dialog v-if="signVisible" :visible.sync="signVisible" :close-on-click-modal="false" width="600px"
v-if="signVisible" custom-class="base-dialog-wrapper">
:visible.sync="signVisible"
:close-on-click-modal="false"
width="600px"
custom-class="base-dialog-wrapper"
>
<div slot="title"> <div slot="title">
<span style="font-size:18px;">{{ $t('common:dialogTitle:sign') }}</span> <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> </div>
<SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" /> <SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" />
</el-dialog> </el-dialog>
<!-- 预览文件 --> <!-- 预览文件 -->
<el-dialog <el-dialog v-if="previewVisible" :visible.sync="previewVisible" :title="$t('common:button:preview')"
v-if="previewVisible" :fullscreen="true" append-to-body custom-class="base-dialog-wrapper">
:visible.sync="previewVisible" <div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
:title="$t('common:button:preview')" <PreviewFile v-if="previewVisible" :file-path="currentPath" :file-type="currentType" />
: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> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -446,38 +418,59 @@ export default {
}) })
}, },
logic(rules, num = 0) { logic(rules, num = 0) {
let isNE = false
try { try {
if (rules.CalculateQuestionList.length === 0) { if (rules.CalculateQuestionList.length === 0) {
return false return false
} }
let dataArr = []
rules.CalculateQuestionList.forEach((o, i) => { rules.CalculateQuestionList.forEach((o, i) => {
if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) { if (i === 0) {
if (rules.CustomCalculateMark > 4) { if (rules.CustomCalculateMark > 4) {
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 5: case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = parseFloat(q[o.TableQuestionId])
num *= parseFloat(q[o.TableQuestionId]) } else {
num *= parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
} }
}) })
break break
case 6: case 6:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
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 break
case 7: case 7:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = parseFloat(q[o.TableQuestionId])
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 num = this.questionForm[o.QuestionId].length === 0 ? 0 : num / this.questionForm[o.QuestionId].length
@ -485,42 +478,103 @@ export default {
case 8: case 8:
const arr = [] const arr = []
this.questionForm[o.QuestionId].forEach(q => { this.questionForm[o.QuestionId].forEach(q => {
arr.push(q[o.TableQuestionId]) 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) num = arr.length === 0 ? 0 : Math.max(...arr)
break break
case 9: case 9:
const arr1 = [] const arr1 = []
this.questionForm[o.QuestionId].forEach(q => { 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) num = arr1.length === 0 ? 0 : Math.min(...arr1)
break break
} }
} else { } else {
num = parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId])
}
} }
} else { } else {
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 1: case 1:
num += parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break break
case 2: case 2:
num -= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break break
case 3: case 3:
num *= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break break
case 4: case 4:
num /= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
// num /= parseFloat(this.questionForm[o.TableQuestionId]) // num /= parseFloat(this.questionForm[o.TableQuestionId])
break 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) { } catch (e) {
console.log(e) console.log(e)
} }
if (isNE) {
return 'NE'
}
if (rules.ValueType === 2) { if (rules.ValueType === 2) {
num = num * 100 num = num * 100
} }
@ -655,7 +709,7 @@ export default {
window.location.reload() window.location.reload()
}) })
.catch(action => { .catch(action => {
// changeURLStatic('visitTaskId', this.visitTaskId) // changeURLStatic('visitTaskId', this.visitTaskId)
}) })
} }
} }
@ -760,94 +814,116 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.report-wrapper{ .report-wrapper {
height: 100%; height: 100%;
// background-color: #fff; // background-color: #fff;
background-color: #000; background-color: #000;
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 7px; width: 7px;
height: 7px; height: 7px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
border-radius: 10px; border-radius: 10px;
// background: #d0d0d0; // background: #d0d0d0;
} }
.report-header{
.report-header {
display: flex; display: flex;
} }
.el-card{
.el-card {
background-color: #000; background-color: #000;
color: #ffffff; color: #ffffff;
border:none;
}
::v-deep .el-table--border th.gutter:last-of-type{
border: none; 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 { ::v-deep .el-table--border th.gutter:last-of-type {
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; 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; border: none;
padding: 10px; 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; width: 30px;
height: 30px; height: 30px;
} }
::v-deep .el-upload--picture-card{
::v-deep .el-upload--picture-card {
width: 30px; width: 30px;
height: 30px; height: 30px;
line-height: 40px; line-height: 40px;
} }
::v-deep .el-dialog{
::v-deep .el-dialog {
background: #1e1e1e; background: #1e1e1e;
border: 1px solid #ddd; border: 1px solid #ddd;
color: #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; background-color: transparent;
color: #ddd; color: #ddd;
border: 1px solid #5e5e5e; border: 1px solid #5e5e5e;
} }
.el-input.is-disabled .el-input__inner{
.el-input.is-disabled .el-input__inner {
background-color: #646464a1; background-color: #646464a1;
} }
.el-form-item__label{
.el-form-item__label {
color: #dfdfdf 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; color: #428bca;
} }
.uploadWrapper{
.uploadWrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; 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 }) this.classArr.push({ triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType })
} }
if (v.Type === 'number') { 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) { if (v.Childrens.length > 0) {
this.setChild(v.Childrens) this.setChild(v.Childrens)
@ -181,7 +181,7 @@ export default {
i.TableQuestions.Questions.forEach(o => { i.TableQuestions.Questions.forEach(o => {
if (o.Type === 'number') { if (o.Type === 'number') {
i.TableQuestions.Answers.forEach((ite, index) => { 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 }) this.classArr.push({ triggerId: i.ClassifyQuestionId, classId: i.Id, classifyAlgorithms: i.ClassifyAlgorithms, classifyType: i.ClassifyType })
} }
if (i.Type === 'number') { 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) { if (i.Childrens && i.Childrens.length > 0) {
this.setChild(i.Childrens) this.setChild(i.Childrens)

View File

@ -4,56 +4,33 @@
<div slot="header" class="clearfix report-header"> <div slot="header" class="clearfix report-header">
<h3 style="margin:0;padding:0;">{{ $t('trials:readingReport:title:eicrf') }}</h3> <h3 style="margin:0;padding:0;">{{ $t('trials:readingReport:title:eicrf') }}</h3>
<div style="margin-left:auto"> <div style="margin-left:auto">
<el-button <el-button v-if="readingTaskState < 2" type="primary" size="small" @click="skipTask">
v-if="readingTaskState<2"
type="primary"
size="small"
@click="skipTask"
>
<!-- 跳过 --> <!-- 跳过 -->
{{ $t('trials:readingReport:button:skip') }} {{ $t('trials:readingReport:button:skip') }}
</el-button> </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="getReportInfo">{{
<el-button v-if="readingTaskState<2" type="primary" size="small" @click="handleSave(true)">{{ $t('common:button:save') }}</el-button> $t('trials:readingReport:button:refresh') }}</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="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> </div>
<div style="flex: 1"> <div style="flex: 1">
<el-table <el-table v-if="taskQuestions.length > 0" ref="reportList" v-adaptive="{ bottomOffset: 0 }"
v-if="taskQuestions.length > 0" :data="taskQuestions" row-key="Id" border default-expand-all height="100"
ref="reportList" :tree-props="{ children: 'Childrens', hasChildren: 'hasChildren' }" size="mini">
v-adaptive="{bottomOffset:0}" <el-table-column prop="" label="" show-overflow-tooltip width="350px">
: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"> <template slot-scope="scope">
<span v-if="scope.row.QuestionName">{{ scope.row.BlindName ? scope.row.QuestionName : scope.row.QuestionName }}</span> <span v-if="scope.row.QuestionName">{{ scope.row.BlindName ? scope.row.QuestionName :
<span scope.row.QuestionName }}</span>
v-else <span v-else style="font-weight: bold;font-size: 16px;color: #f44336;">
style="font-weight: bold;font-size: 16px;color: #f44336;"
>
{{ scope.row.GroupName }} {{ scope.row.GroupName }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column v-for="task in visitTaskList" :key="task.VisitTaskId" prop="date" show-overflow-tooltip
v-for="task in visitTaskList" width="200px">
:key="task.VisitTaskId"
prop="date"
show-overflow-tooltip
width="200px"
>
<template slot="header"> <template slot="header">
<div v-if="task.IsCurrentTask"> <div v-if="task.IsCurrentTask">
{{ task.BlindName }} {{ task.BlindName }}
@ -68,110 +45,115 @@
</div> </div>
</template> </template>
<template slot-scope="scope"> <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> <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 <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]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini" size="mini" />
/> <span
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type==='input' || scope.row.Type==='textarea')"> 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] }} {{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span> </span>
<el-input <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-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]" v-model="questionForm[scope.row.QuestionId]" size="mini" />
size="mini" <span v-else-if="scope.row.Type === 'input' || scope.row.Type === 'textarea'">
/>
<span v-else-if="scope.row.Type==='input' || scope.row.Type==='textarea'">
{{ questionForm[scope.row.QuestionId] }} {{ questionForm[scope.row.QuestionId] }}
</span> </span>
<el-select <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]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini" size="mini" clearable>
clearable
>
<template> <template>
<el-option <el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
</template> </template>
</el-select> </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] }} {{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }}
</span> </span>
<el-select <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-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]" v-model="questionForm[scope.row.QuestionId]" size="mini" clearable
size="mini" @focus="() => { questionId = scope.row.QuestionId }">
clearable
>
<template> <template>
<el-option <el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
</template> </template>
</el-select> </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] }} {{ questionForm[scope.row.QuestionId] }}
</span> </span>
<el-input <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]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
:disabled="scope.row.DataSource === 1" :disabled="scope.row.DataSource === 1" size="mini"
size="mini"
@blur="limitBlur(questionForm[scope.row.QuestionId][scope.row.xfIndex], scope.row.TableQuestionId, scope.row.ValueType)" @blur="limitBlur(questionForm[scope.row.QuestionId][scope.row.xfIndex], scope.row.TableQuestionId, scope.row.ValueType)"
@focus="() => {questionId = scope.row.QuestionId}" @focus="() => { questionId = scope.row.QuestionId }">
> <template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit }}</template> scope.row.Unit) : scope.row.CustomUnit }}</template>
<template v-else-if="scope.row.ValueType === 2" slot="append">%</template> <template v-else-if="scope.row.ValueType === 2" slot="append">%</template>
</el-input> </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"> <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>
<template v-else-if="scope.row.ValueType === 2"> <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>
<template v-else> <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> </template>
</span> </span>
<el-input <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-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]" v-model="questionForm[scope.row.QuestionId]" :disabled="scope.row.DataSource === 1" size="mini"
:disabled="scope.row.DataSource === 1"
size="mini"
@blur="limitBlur(questionForm, scope.row.QuestionId, scope.row.ValueType)" @blur="limitBlur(questionForm, scope.row.QuestionId, scope.row.ValueType)"
@focus="() => {questionId = scope.row.QuestionId}" @focus="() => { questionId = scope.row.QuestionId }">
> <template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit',
<template v-if="scope.row.Unit !== 0" slot="append">{{ scope.row.Unit !== 4 ? $fd('ValueUnit', scope.row.Unit) : scope.row.CustomUnit }}</template> scope.row.Unit) : scope.row.CustomUnit }}</template>
<template v-else-if="scope.row.ValueType === 2" slot="append">%</template> <template v-else-if="scope.row.ValueType === 2" slot="append">%</template>
</el-input> </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"> <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>
<template v-else-if="scope.row.ValueType === 2"> <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>
<template v-else> <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> </template>
</span> </span>
</div> </div>
</template> </template>
<template v-else-if="scope.row.Type==='upload' && scope.row.Answers[task.VisitTaskId]"> <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;"> <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)"> <el-button v-if="scope.row.Answers[task.VisitTaskId]" type="text" @click="preview(url)">
{{ `${$t('trials:noneDicom:title:attachment')}${index + 1}` }} {{ `${$t('trials:noneDicom:title:attachment')}${index + 1}` }}
</el-button> </el-button>
@ -181,14 +163,22 @@
{{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }} {{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }}
</template> </template>
<template v-else-if="criterionType === 10"> <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>
<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"> <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>
<template v-else-if="scope.row.ValueType === 2"> <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>
<template v-else-if="scope.row.Answers && scope.row.Answers.hasOwnProperty(task.VisitTaskId)"> <template v-else-if="scope.row.Answers && scope.row.Answers.hasOwnProperty(task.VisitTaskId)">
{{ scope.row.Answers[task.VisitTaskId] }} {{ scope.row.Answers[task.VisitTaskId] }}
@ -200,38 +190,20 @@
</el-card> </el-card>
<!-- 签名框 --> <!-- 签名框 -->
<el-dialog <el-dialog v-if="signVisible" :visible.sync="signVisible" :close-on-click-modal="false" width="600px"
v-if="signVisible" custom-class="base-dialog-wrapper">
:visible.sync="signVisible"
:close-on-click-modal="false"
width="600px"
custom-class="base-dialog-wrapper"
>
<div slot="title"> <div slot="title">
<span style="font-size:18px;">{{ $t('common:dialogTitle:sign') }}</span> <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> </div>
<SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" /> <SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" />
</el-dialog> </el-dialog>
<!-- 预览文件 --> <!-- 预览文件 -->
<el-dialog <el-dialog v-if="previewVisible" :visible.sync="previewVisible" :title="$t('common:button:preview')"
v-if="previewVisible" :fullscreen="true" append-to-body custom-class="base-dialog-wrapper">
:visible.sync="previewVisible" <div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
:title="$t('common:button:preview')" <PreviewFile v-if="previewVisible" :file-path="currentPath" :file-type="currentType" />
: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> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -396,7 +368,7 @@ export default {
if (v.Type === 'number') { if (v.Type === 'number') {
let val = null let val = null
if (v.ValueType === 0) { 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) { } else if (v.ValueType === 3) {
val = v.Answers[this.visitTaskId] val = v.Answers[this.visitTaskId]
} else { } else {
@ -422,7 +394,7 @@ export default {
if (i.Type === 'number') { if (i.Type === 'number') {
let val = null let val = null
if (i.ValueType === 0) { 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) { } else if (i.ValueType === 3) {
val = i.Answers[this.visitTaskId] val = i.Answers[this.visitTaskId]
} else { } else {
@ -446,38 +418,61 @@ export default {
}) })
}, },
logic(rules, num = 0) { logic(rules, num = 0) {
let isNE = false
try { try {
if (rules.CalculateQuestionList.length === 0) { if (rules.CalculateQuestionList.length === 0) {
return false return false
} }
let dataArr = []
rules.CalculateQuestionList.forEach((o, i) => { rules.CalculateQuestionList.forEach((o, i) => {
if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true
}
if (i === 0) { if (i === 0) {
if (rules.CustomCalculateMark > 4) { if (rules.CustomCalculateMark > 4) {
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 5: case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = parseFloat(q[o.TableQuestionId])
num *= parseFloat(q[o.TableQuestionId]) } else {
num *= parseFloat(q[o.TableQuestionId])
}
}
if (q[o.TableQuestionId] === 'NE') {
isNE = true
} }
}) })
break break
case 6: case 6:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
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 break
case 7: case 7:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = parseFloat(q[o.TableQuestionId])
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 num = this.questionForm[o.QuestionId].length === 0 ? 0 : num / this.questionForm[o.QuestionId].length
@ -485,42 +480,135 @@ export default {
case 8: case 8:
const arr = [] const arr = []
this.questionForm[o.QuestionId].forEach(q => { this.questionForm[o.QuestionId].forEach(q => {
arr.push(q[o.TableQuestionId]) 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) num = arr.length === 0 ? 0 : Math.max(...arr)
break break
case 9: case 9:
const arr1 = [] const arr1 = []
this.questionForm[o.QuestionId].forEach(q => { this.questionForm[o.QuestionId].forEach(q => {
arr1.push(q[o.TableQuestionId]) 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) num = arr1.length === 0 ? 0 : Math.min(...arr1)
break 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 { } else {
num = parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId])
}
} }
} else { } else {
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 1: case 1:
num += parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break break
case 2: case 2:
num -= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break break
case 3: case 3:
num *= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break break
case 4: case 4:
num /= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
// num /= parseFloat(this.questionForm[o.TableQuestionId]) // num /= parseFloat(this.questionForm[o.TableQuestionId])
break 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) { } catch (e) {
console.log(e) console.log(e)
} }
if (isNE) {
return 'NE'
}
if (rules.ValueType === 2) { if (rules.ValueType === 2) {
num = num * 100 num = num * 100
} }
@ -561,7 +649,7 @@ export default {
if (item.Type === 'number') { if (item.Type === 'number') {
let val = null let val = null
if (item.ValueType === 0) { if (item.ValueType === 0) {
val = parseInt(i.Answer) val = !isNaN(parseFloat(i.Answer)) ? parseInt(i.Answer) : i.Answer
} else if (item.ValueType === 3) { } else if (item.ValueType === 3) {
val = i.Answer val = i.Answer
} else { } else {
@ -657,7 +745,7 @@ export default {
window.location.reload() window.location.reload()
}) })
.catch(action => { .catch(action => {
// changeURLStatic('visitTaskId', this.visitTaskId) // changeURLStatic('visitTaskId', this.visitTaskId)
}) })
} }
} }
@ -759,94 +847,116 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.report-wrapper{ .report-wrapper {
height: 100%; height: 100%;
// background-color: #fff; // background-color: #fff;
background-color: #000; background-color: #000;
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 7px; width: 7px;
height: 7px; height: 7px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
border-radius: 10px; border-radius: 10px;
// background: #d0d0d0; // background: #d0d0d0;
} }
.report-header{
.report-header {
display: flex; display: flex;
} }
.el-card{
.el-card {
background-color: #000; background-color: #000;
color: #ffffff; color: #ffffff;
border:none;
}
::v-deep .el-table--border th.gutter:last-of-type{
border: none; 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 { ::v-deep .el-table--border th.gutter:last-of-type {
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; 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; border: none;
padding: 10px; 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; width: 30px;
height: 30px; height: 30px;
} }
::v-deep .el-upload--picture-card{
::v-deep .el-upload--picture-card {
width: 30px; width: 30px;
height: 30px; height: 30px;
line-height: 40px; line-height: 40px;
} }
::v-deep .el-dialog{
::v-deep .el-dialog {
background: #1e1e1e; background: #1e1e1e;
border: 1px solid #ddd; border: 1px solid #ddd;
color: #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; background-color: transparent;
color: #ddd; color: #ddd;
border: 1px solid #5e5e5e; border: 1px solid #5e5e5e;
} }
.el-input.is-disabled .el-input__inner{
.el-input.is-disabled .el-input__inner {
background-color: #646464a1; background-color: #646464a1;
} }
.el-form-item__label{
.el-form-item__label {
color: #dfdfdf 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; color: #428bca;
} }
.uploadWrapper{
.uploadWrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;

View File

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

View File

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