中医药大学课题数据库系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1151 lines
57 KiB

<template>
<div class="flex-column">
<div>
<div class="d-flex flex-row flex-wrap">
<a-form :form="form1" class="d-flex flex-wrap align-center" layout="inline">
<a-form-item>
<a-select placeholder="请选择医院" style="min-width: 150px" v-decorator="['hospital']" @change="chooseHos($event, 1)">
<a-select-option :key="item.id" :value="item.id" v-for="item in hospitals">{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item>
<a-input placeholder="患者住院号" style="width: 14em" v-model="setObj.hospitalization" />
</a-form-item>
<a-form-item>
<a-select placeholder="请选择录入状态" style="min-width: 150px" @change="chooseHos($event, 3)">
<a-select-option :key="item.id" :value="item.id" v-for="item in statusList">{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
</a-form>
<div class="flex-1"></div>
</div>
</div>
<a-form :form="form">
<a-collapse v-model="activeKey">
<!-- 首先遍历整个data大数组 -->
<!-- <div v-for="(item, index) in list" :key="index"> -->
<a-collapse-panel v-for="(item, index) in list" :key="index.toString()" :header="item.name">
<!-- <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
一级大标题
<h2>{{ item.name }}:</h2>
</a-form-item> -->
<!-- 一级标题下的各种问题(questionVos),判断类型1-12,展示不同需要填写的内容 -->
<div v-for="a in item.questionVos" :key="a.name">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="a.question">
<a-input v-if="a.type === 1" @change="onChange($event, a.type, a.id, a.recordId)" />
<a-textarea v-else-if="a.type === 2" style="height: 100px" @change="onChange($event, a.type, a.id, a.recordId)" />
<a-radio-group v-else-if="a.type === 3" v-model="value" @change="onChange($event, a.type, a.id, a.recordId)">
<a-radio v-for="(b, c) in a.optionVos" :key="c" :style="radioStyle" :value="b.showValue"> {{ b.showValue }} </a-radio>
</a-radio-group>
<a-checkbox-group v-else-if="a.type === 4" @change="onChange($event, a.type, a.id, a.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
<a-select v-else-if="a.type === 5" style="width: 120px" @change="onChange($event, a.type, a.id, a.recordId)">
<a-select-option v-for="(b, c) in a.optionVos" :key="c" :value="b.showValue"> {{ b.showValue }} </a-select-option>
</a-select>
<a-range-picker show-time v-else-if="a.type === 6" @change="onChange($event, a.type, a.id, a.recordId)" />
<a-upload
v-else-if="a.type === 7"
:action="action"
:default-file-list="fileList"
:headers="headers"
list-type="picture"
@change="fileChange($event, a.id)"
name="files"
>
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload>
<a-radio-group v-else-if="a.type === 8" v-model="value" @change="onChange($event, a.type, a.id, a.recordId)">
<a-radio-group @change="onChange($event, a.type, a.id, a.recordId)">
<a-radio v-for="(f, g) in a.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</a-radio-group>
<div v-for="(j, k) in a.optionVos" :key="k">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === a.id && item.contents === `${j.showValue}`;
}) && j.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(a.id, $event, j.showValue)"></a-input>
</a-form-item>
</div>
</div>
</a-radio-group>
<a-checkbox-group v-else-if="a.type === 9" @change="onChange($event, a.type, a.id, a.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
<a-col :span="100">
<div v-for="(j, k) in a.optionVos" :key="k">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === a.id && item.contents === `${j.showValue}`;
}) && j.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(a.id, $event, j.showValue)"></a-input>
</a-form-item>
</div>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="a.type === 10">
<a-select style="width: 120px" @change="onChange($event, a.type, a.id, a.recordId)">
<a-select-option v-for="(b, c) in a.optionVos" :key="c" :value="b.showValue"> {{ b.showValue }} </a-select-option>
</a-select>
<div v-for="(b, c) in a.optionVos" :key="c">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === a.id && item.contents === `${b.showValue}`;
}) && b.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(a.id, $event, b.showValue)"></a-input>
</a-form-item>
</div>
</div>
</div>
<div v-else-if="a.type === 11">
<a-checkbox-group @change="onChange($event, a.type, a.id, a.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
<a-col :span="100">
<div v-for="(b, c) in a.optionVos" :key="c">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === a.id && item.contents.find(content => content === `${b.showValue}`);
}) && b.afterOperation > 0
"
>
<a-input style="width: 200px" @change="inputChange(a.id, $event, b.showValue)"></a-input>
</div>
</div>
</a-col>
</a-row>
说明: <a-input style="width: 200px" @change="explainChange(a.id, $event)" />
</a-checkbox-group>
</div>
<!-- 当类型为12时,为单选+关联 -->
<div v-else-if="a.type === 12">
<a-radio-group @change="onChange($event, a.type, a.id, a.recordId)">
<a-radio v-for="(f, g) in a.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</a-radio-group>
<div v-for="(j, k) in a.optionVos" :key="k">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === a.id && item.contents === `${j.showValue}`;
}) && j.afterOperation > 0
"
>
<div v-for="(h, i) in j.questionVos" :key="i">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="h.question">
<a-input
v-if="j.afterOperation === 1"
style="width: 200px"
@change="inputChange(a.id, $event, j.showValue)"
></a-input>
<a-textarea v-else-if="j.afterOperation === 2" @change="inputChange(a.id, $event, j.showValue)"></a-textarea>
<div v-else-if="j.afterOperation === 3">
<div v-for="ohter in j.questionVos" :key="ohter.id">
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
:label="ohter.question"
>
<a-input v-if="ohter.type === 1" @change="onChange($event, ohter.type, ohter.id, ohter.recordId)" />
<a-textarea
v-else-if="ohter.type === 2"
style="height: 100px"
@change="onChange($event, ohter.type, ohter.id)"
/>
<a-radio-group
v-else-if="ohter.type === 3"
v-model="value"
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)"
>
<a-radio v-for="(b, c) in ohter.optionVos" :key="c" :style="radioStyle" :value="b.showValue">
{{ b.showValue }}
</a-radio>
</a-radio-group>
<a-checkbox-group
v-else-if="ohter.type === 4"
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)"
>
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in ohter.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
<a-select
v-else-if="ohter.type === 5"
style="width: 120px"
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)"
>
<a-select-option v-for="(b, c) in ohter.optionVos" :key="c" :value="b.showValue">
{{ b.showValue }}
</a-select-option>
</a-select>
<a-range-picker
show-time
v-else-if="ohter.type === 6"
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)"
/>
<a-upload
v-else-if="ohter.type === 7"
:action="action"
:headers="headers"
:default-file-list="fileList"
list-type="picture"
@change="fileChange($event, ohter.id)"
name="files"
>
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload>
<a-radio-group
v-else-if="ohter.type === 8"
v-model="value"
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)"
>
<a-radio-group @change="onChange($event, ohter.type, ohter.id)">
<a-radio v-for="(f, g) in ohter.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</a-radio-group>
<div v-for="(m, n) in ohter.optionVos" :key="n">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === ohter.id && item.contents === `${m.showValue}`;
}) && m.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(ohter.id, $event, m.showValue)"></a-input>
</a-form-item>
</div>
</div>
</a-radio-group>
<a-checkbox-group
v-else-if="ohter.type === 9"
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)"
>
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in ohter.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
<a-col :span="100">
<div v-for="(m, n) in ohter.optionVos" :key="n">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === ohter.id && item.contents === `${m.showValue}`;
}) && m.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(ohter.id, $event, m.showValue)"></a-input>
</a-form-item>
</div>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="ohter.type === 10">
<a-select style="width: 120px" @change="onChange($event, ohter.type, ohter.id, ohter.recordId)">
<a-select-option v-for="(b, c) in ohter.optionVos" :key="c" :value="b.showValue">
{{ b.showValue }}
</a-select-option>
</a-select>
<div v-for="(b, c) in ohter.optionVos" :key="c">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === ohter.id && item.contents === `${b.showValue}`;
}) && b.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(ohter.id, $event, b.showValue)"></a-input>
</a-form-item>
</div>
</div>
</div>
<div v-else-if="ohter.type === 11">
<a-checkbox-group @change="onChange($event, ohter.type, ohter.id, ohter.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in ohter.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
<a-col :span="100">
<div v-for="(b, c) in ohter.optionVos" :key="c">
<div
v-if="
contentList.find(item => {
return (
item.testQuestionsId === ohter.id &&
item.contents.find(content => content === `${b.showValue}`)
);
}) && b.afterOperation > 0
"
>
<a-input style="width: 200px" @change="inputChange(ohter.id, $event, b.showValue)"></a-input>
</div>
</div>
</a-col>
</a-row>
说明: <a-input style="width: 200px" @change="explainChange(ohter.id, $event)" />
</a-checkbox-group>
</div>
<!-- 当类型为12时,为单选+关联 -->
<div v-else-if="ohter.type === 12">
<a-radio-group @change="onChange($event, ohter.type, ohter.id, ohter.recordId)">
<a-radio v-for="(f, g) in ohter.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</a-radio-group>
<div v-for="(m, n) in ohter.optionVos" :key="n">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === ohter.id && item.contents === `${m.showValue}`;
}) && m.afterOperation > 0
"
>
<div v-for="(p, q) in m.questionVos" :key="q">
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
:label="p.question"
>
<a-input
v-if="m.afterOperation === 1"
style="width: 200px"
@change="inputChange(ohter.id, $event, m.showValue)"
></a-input>
<a-textarea
v-else-if="m.afterOperation === 2"
@change="inputChange(ohter.id, $event, m.showValue)"
></a-textarea>
<div v-else-if="m.afterOperation === 3">qwe</div>
</a-form-item>
</div>
</div>
</div>
</div>
<div v-else-if="ohter.type === 13">
<a-input-number @change="onChange($event, ohter.type, ohter.id, ohter.recordId)" />
</div>
<div v-else-if="ohter.type === 14">图片识别</div>
</a-form-item>
</div>
</div>
</a-form-item>
</div>
</div>
</div>
</div>
<div v-else-if="a.type === 13">
<a-input-number @change="onChange($event, a.type, a.id, a.recordId)" />
</div>
<div v-else-if="a.type === 14">图片识别</div>
</a-form-item>
</div>
<!-- 一级标题下的各种二级标题(subReportCodes) -->
<div v-for="w in item.subReportCodes" :key="w.name">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<!-- 二级大标题 -->
<h3>{{ w.name }}:</h3>
</a-form-item>
<!-- 二级标题下的各种类型 -->
<div v-for="e in w.questionVos" :key="e.name">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="e.question">
<a-input v-if="e.type === 1" @change="onChange($event, e.type, e.id, e.recordId)" />
<a-textarea v-else-if="e.type === 2" style="height: 100px" @change="onChange($event, e.type, e.id, e.recordId)" />
<a-radio-group v-else-if="e.type === 3" v-model="value" @change="onChange($event, e.type, e.id, e.recordId)">
<a-radio v-for="(b, c) in e.optionVos" :key="c" :style="radioStyle" :value="b.showValue"> {{ b.showValue }} </a-radio>
</a-radio-group>
<a-checkbox-group v-else-if="e.type === 4" @change="onChange($event, e.type, e.id, e.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in e.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
<a-select v-else-if="e.type === 5" style="width: 120px" @change="onChange($event, e.type, e.id, e.recordId)">
<a-select-option v-for="(b, c) in e.optionVos" :key="c" :value="b.showValue"> {{ b.showValue }} </a-select-option>
</a-select>
<a-range-picker show-time v-else-if="e.type === 6" @change="onChange($event, e.type, e.id, e.recordId)" />
<a-upload
v-else-if="e.type === 7"
:action="action"
:default-file-list="fileList"
list-type="picture"
:headers="headers"
@change="fileChange($event, e.id, e.recordId)"
name="files"
>
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload>
<a-radio-group v-else-if="e.type === 8" v-model="value" @change="onChange($event, e.type, e.id, e.recordId)">
<a-radio-group @change="onChange($event, e.type, e.id)">
<a-radio v-for="(f, g) in e.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</a-radio-group>
<div v-for="(j, k) in e.optionVos" :key="k">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === e.id && item.contents === `${j.showValue}`;
}) && j.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(e.id, $event, j.showValue)"></a-input>
</a-form-item>
</div>
</div>
</a-radio-group>
<a-checkbox-group v-else-if="e.type === 9" @change="onChange($event, e.type, e.id, e.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in e.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
<a-col :span="100">
<div v-for="(j, k) in e.optionVos" :key="k">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === e.id && item.contents === `${j.showValue}`;
}) && j.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(e.id, $event, j.showValue)"></a-input>
</a-form-item>
</div>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="e.type === 10">
<a-select style="width: 120px" @change="onChange($event, e.type, e.id, e.recordId)">
<a-select-option v-for="(b, c) in e.optionVos" :key="c" :value="b.showValue"> {{ b.showValue }} </a-select-option>
</a-select>
<div v-for="(b, c) in e.optionVos" :key="c">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === e.id && item.contents === `${b.showValue}`;
}) && b.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(e.id, $event, b.showValue)"></a-input>
</a-form-item>
</div>
</div>
</div>
<div v-else-if="e.type === 11">
<a-checkbox-group @change="onChange($event, e.type, e.id, e.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in e.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
<a-col :span="100">
<div v-for="(b, c) in e.optionVos" :key="c">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === e.id && item.contents.find(content => content === `${b.showValue}`);
}) && b.afterOperation > 0
"
>
<a-input style="width: 200px" @change="inputChange(e.id, $event, b.showValue)"></a-input>
</div>
</div>
</a-col>
</a-row>
说明: <a-input style="width: 200px" @change="explainChange(e.id, $event)" />
</a-checkbox-group>
</div>
<!-- 当类型为12时,为单选+关联 -->
<div v-else-if="e.type === 12">
<a-radio-group @change="onChange($event, e.type, e.id, e.recordId)">
<a-radio v-for="(f, g) in e.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</a-radio-group>
<div v-for="(j, k) in e.optionVos" :key="k">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === e.id && item.contents === `${j.showValue}`;
}) && j.afterOperation > 0
"
>
<div v-for="(h, i) in j.questionVos" :key="i">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="h.question">
<a-input
v-if="j.afterOperation === 1"
style="width: 200px"
@change="inputChange(e.id, $event, j.showValue)"
></a-input>
<a-textarea v-else-if="j.afterOperation === 2" @change="inputChange(e.id, $event, j.showValue)"></a-textarea>
<div v-else-if="j.afterOperation === 3">
<a-form-item>
<a-input v-if="h.type === 1" @change="onChange($event, h.type, h.id, h.h.recordId)" />
<a-textarea
v-else-if="h.type === 2"
style="height: 100px"
@change="onChange($event, h.type, h.id, h.recordId)"
/>
<a-radio-group v-else-if="h.type === 3" v-model="value" @change="onChange($event, h.type, h.id, h.recordId)">
<a-radio v-for="(b, c) in h.optionVos" :key="c" :style="radioStyle" :value="b.showValue">
{{ b.showValue }}
</a-radio>
</a-radio-group>
<a-checkbox-group v-else-if="h.type === 4" @change="onChange($event, h.type, h.id, h.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
<a-select v-else-if="h.type === 5" style="width: 120px" @change="onChange($event, h.type, h.id, h.recordId)">
<a-select-option v-for="(b, c) in h.optionVos" :key="c" :value="b.showValue">
{{ b.showValue }}
</a-select-option>
</a-select>
<a-range-picker show-time v-else-if="h.type === 6" @change="onChange($event, h.type, h.id, h.recordId)" />
<a-upload
v-else-if="h.type === 7"
:action="action"
:default-file-list="fileList"
list-type="picture"
:headers="headers"
@change="fileChange($event, h.id)"
name="files"
>
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload>
<a-radio-group v-else-if="h.type === 8" v-model="value" @change="onChange($event, h.type, h.id, h.recordId)">
<a-radio-group @change="onChange($event, h.type, h.id, h.recordId)">
<a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</a-radio-group>
<div v-for="(m, n) in h.optionVos" :key="n">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === h.id && item.contents === `${m.showValue}`;
}) && m.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(h.id, $event, m.showValue)"></a-input>
</a-form-item>
</div>
</div>
</a-radio-group>
<a-checkbox-group v-else-if="h.type === 9" @change="onChange($event, h.type, h.id, h.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
<a-col :span="100">
<div v-for="(m, n) in h.optionVos" :key="n">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === h.id && item.contents === `${m.showValue}`;
}) && m.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(h.id, $event, m.showValue)"></a-input>
</a-form-item>
</div>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="h.type === 10">
<a-select style="width: 120px" @change="onChange($event, h.type, h.id, h.recordId)">
<a-select-option v-for="(b, c) in h.optionVos" :key="c" :value="b.showValue">
{{ b.showValue }}
</a-select-option>
</a-select>
<div v-for="(b, c) in h.optionVos" :key="c">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === h.id && item.contents === `${b.showValue}`;
}) && b.afterOperation === 1
"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input style="width: 200px" @change="inputChange(h.id, $event, b.showValue)"></a-input>
</a-form-item>
</div>
</div>
</div>
<div v-else-if="h.type === 11">
<a-checkbox-group @change="onChange($event, h.type, h.id, h.recordId)">
<a-row>
<a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
<a-col :span="100">
<div v-for="(b, c) in h.optionVos" :key="c">
<div
v-if="
contentList.find(item => {
return (
item.testQuestionsId === h.id && item.contents.find(content => content === `${b.showValue}`)
);
}) && b.afterOperation > 0
"
>
<a-input style="width: 200px" @change="inputChange(h.id, $event, b.showValue)"></a-input>
</div>
</div>
</a-col>
</a-row>
说明: <a-input style="width: 200px" @change="explainChange(h.id, $event)" />
</a-checkbox-group>
</div>
<!-- 当类型为12时,为单选+关联 -->
<div v-else-if="h.type === 12">
<a-radio-group @change="onChange($event, h.type, h.id, h.recordId)">
<a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</a-radio-group>
<div v-for="(m, n) in h.optionVos" :key="n">
<div
v-if="
contentList.find(item => {
return item.testQuestionsId === h.id && item.contents === `${m.showValue}`;
}) && m.afterOperation > 0
"
>
<div v-for="(p, q) in m.questionVos" :key="q">
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
:label="p.question"
>
<a-input
v-if="m.afterOperation === 1"
style="width: 200px"
@change="inputChange(h.id, $event, m.showValue)"
></a-input>
<a-textarea
v-else-if="m.afterOperation === 2"
@change="inputChange(h.id, $event, m.showValue)"
></a-textarea>
<div v-else-if="m.afterOperation === 3">qwe</div>
</a-form-item>
</div>
</div>
</div>
</div>
<div v-else-if="h.type === 13">
<a-input-number @change="onChange($event, h.type, h.id, h.recordId)" />
</div>
<div v-else-if="h.type === 14">图片识别</div>
</a-form-item>
</div>
</a-form-item>
</div>
</div>
</div>
</div>
<div v-else-if="e.type === 13">
<a-input-number @change="onChange($event, e.type, e.id, e.recordId)" />
</div>
<div v-else-if="e.type === 14">图片识别</div>
</a-form-item>
</div>
</div>
</a-collapse-panel>
<!-- </div> -->
</a-collapse>
</a-form>
<div style="padding: 4px 0 40px 0">
<a-cascader
style="width: 200px"
:field-names="{ label: 'name', value: 'id', children: 'optionVos' }"
:options="options"
:display-render="displayRender"
expand-trigger="hover"
placeholder="请选择类型"
@change="changeQues"
/>
<a-select mode="multiple" size="default" placeholder="请选择对照组" style="width: 450px; margin-left: 40px" @change="handleChange">
<a-select-option v-for="i in controlGroups" :key="i.id">
{{ i.name }}
</a-select-option>
</a-select>
</div>
<a-button class="white--text px-10" type="primary" @click="setData()" v-if="list.length > 0">提交</a-button>
<a-card style="width: 100%; height: 600px; margin-top: 10px" title="病例分析统计">
<analysis :lists="lists" />
</a-card>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
import { getHList, selSearchCriteriaList, queryAll, countAnalysis, upload, queryQuestion } from 'config/api';
import Analysis from 'components/Echarts/Analysis';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 9 },
};
const tailItemLayout = { wrapperCol: { span: 18, offset: 4 } };
export default {
name: 'CaseAnalysis',
components: { Analysis },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'page-add' }),
form1: this.$form.createForm(this, { name: 'search' }),
hospitals: [],
value: 1,
radioStyle: {
display: 'block',
height: '30px',
lineHeight: '30px',
},
list: [],
contentList: [],
conditionListDate: [],
numList: [1, 2, 3, 4, 5],
setObj: {
hospitalId: '', // 选择的医院Id
hospitalization: '', // 输入的住院号
inpatientId: '', // 选择的对照组Id
inputStatus: '', // 选择的录入状态
},
action: upload, // 上传附件地址
fileList: [], // 附件列表
files: '', // 附件Id
dateFormat: 'YYYY-MM-DD',
dateChoose: new Date(),
subDateTime: '',
statusList: [
{
id: 0,
name: '新建',
},
{
id: 1,
name: '数据搜集中',
},
{
id: 2,
name: '数据搜集完成',
},
{
id: 3,
name: '数据搜集超时',
},
{
id: 4,
name: '废弃',
},
],
lists: {},
activeKey: ['0'], // 折叠面板
options: [], // 分析属性内的问题数组
testQuestionsId: '', // 分析属性内的问题Id
inpatientList: [], // 分析属性内的对照组Id数组
};
},
computed: {
...mapState('home', ['patientId', 'controlGroups']),
// 上传附加请求头
headers() {
const token = sessionStorage.getItem('anyringToken');
return { Authorization: `Bearer ${token}` };
},
},
created() {
this.getQues();
this.getControlGroups();
this.handleSearchCriteriaList();
this.getHos();
this.setData();
},
methods: {
...mapActions('home', ['getControlGroups']),
// 选择医院
chooseHos(e, type) {
if (type === 1) {
this.setObj.hospitalId = parseInt(e);
} else if (type === 2) {
this.setObj.inpatientId = parseInt(e);
} else if (type === 3) {
this.setObj.inputStatus = parseInt(e);
}
},
// 获取所有医院
async getHos() {
try {
const res = await getHList();
const { code, msg, data } = res.data;
if (code === 200) {
this.hospitals = data;
} else {
this.$message.error('查询医院列表失败');
}
} catch (error) {
this.$message.error('查询医院列表失败');
}
},
async handleSearchCriteriaList() {
try {
const params = {};
const res = await selSearchCriteriaList(params);
const { code, msg, data } = res.data;
if (code === 200) {
// console.log('data: ', data);
this.list = data;
} else {
this.$message.error(msg || '查询失败');
throw msg;
}
} catch (error) {
throw new Error(`CaseSearch.vue method selSearchCriteriaList: ${error}`);
}
},
onChange(e, type, id, recordId) {
// 监听所有得题目类型得填写情况(改变事件)
if (this.contentList.find(item => item.testQuestionsId === id)) {
if (type === 1) {
// 单行文本框
this.forFn(id, e.target.value, recordId);
} else if (type === 2) {
// 多行文本框
this.forFn(id, e.target.value, recordId);
} else if (type === 3) {
// 单选
this.forFn(id, e.target.value, recordId);
} else if (type === 4) {
// 多选
// 删除上次答题的所有答案
this.ergodicList(id);
// 遍历本次答案,添加到数组中
for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId);
}
} else if (type === 5) {
// 下拉框
this.forFn(id, e, recordId);
} else if (type === 6) {
// 日期时间选择器,给后台返回的值是 2020-01-01 00:00:00 的格式
// this.forFn(id, this.$moment(e._d).format('YYYY-MM-DD HH:mm:ss'), recordId);
const { conditionListDate } = this;
for (let i = 0; i < conditionListDate.length; i++) {
if (conditionListDate[i].testQuestionsId === id) {
conditionListDate[i].startTime = this.$moment(e[0]._d).format('YYYY-MM-DD');
conditionListDate[i].endTime = this.$moment(e[1]._d).format('YYYY-MM-DD');
break;
}
}
this.conditionListDate = [...conditionListDate];
console.log(this.conditionListDate);
} else if (type === 7) {
alert('上传文件,先空下');
} else if (type === 8) {
// 单选 + 其他
// 删除上次答题的所有答案
this.ergodicList(id);
this.failFn(id, e.target.value, recordId);
} else if (type === 9) {
// 多选 + 其他
// 如果type === 9 : 删除所有选项,重新添加,文本框继续存在,可以存给后台
for (let i = 0; i < this.contentList.length; i++) {
if (id === this.contentList[i].testQuestionsId && !this.contentList[i].type) {
this.contentList.splice(i, 1);
i -= 1;
}
}
// 遍历本次答案,添加到数组中
for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId);
}
} else if (type === 10) {
// 下拉 + 其他
// 删除所有本题的答案(包括 选项 和 文本框)
this.ergodicList(id);
// 添加本次答题的选项
this.failFn(id, e, recordId);
} else if (type === 11) {
// 多选 + 其他 + 说明
// 如果type === 11 : 删除所有选项,重新添加,文本框继续存在,可以存给后台
for (let i = 0; i < this.contentList.length; i++) {
if (id === this.contentList[i].testQuestionsId && !this.contentList[i].type) {
this.contentList.splice(i, 1);
i -= 1;
}
}
// 遍历本次答案,添加到数组中
for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId);
}
} else if (type === 12) {
// 单选 + 关联其他内容
// console.log(e.target.value, type, id);
this.forFn(id, e.target.value, recordId);
} else if (type === 13) {
// 数字类型
this.forFn(id, e.target.value, recordId);
} else if (type === 14) {
// 图片识别 暂时不做
}
} else {
if (type === 1) {
// 单行文本框
this.failFn(id, e.target.value, recordId);
} else if (type === 2) {
// 多行文本框
this.failFn(id, e.target.value, recordId);
} else if (type === 3) {
// 单选
this.failFn(id, e.target.value, recordId);
} else if (type === 4) {
// 多选
this.failFn(id, e, recordId);
} else if (type === 5) {
// 下拉框
this.failFn(id, e, recordId);
} else if (type === 6) {
// 日期时间选择器,给后台返回的值是 2020-01-01 00:00:00 的格式
const { conditionListDate } = this;
let obj = {
testQuestionsId: id,
startTime: this.$moment(e[0]._d).format('YYYY-MM-DD'),
endTime: this.$moment(e[1]._d).format('YYYY-MM-DD'),
};
conditionListDate.push(obj);
this.conditionListDate = [...conditionListDate];
console.log(this.conditionListDate);
// this.failFn(id, this.$moment(e._d).format('YYYY-MM-DD HH:mm:ss'), recordId);
} else if (type === 7) {
alert('上传文件,先空下');
} else if (type === 8) {
// 单选 + 其他
this.failFn(id, e.target.value, recordId);
} else if (type === 9) {
// 多选 + 其他
for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId);
}
} else if (type === 10) {
// 下拉 + 其他
this.failFn(id, e, recordId);
} else if (type === 11) {
// 多选 + 其他 + 说明
for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId);
}
} else if (type === 12) {
// 单选 + 关联其他内容
this.failFn(id, e.target.value, recordId);
} else if (type === 13) {
// 数字类型
this.failFn(id, e.target.value, recordId);
} else if (type === 14) {
// 图片识别 暂时不做
}
}
},
// for循环封装函数
forFn(id, value, recordId) {
const { contentList } = this;
console.log(value);
for (let i = 0; i < contentList.length; i++) {
if (contentList[i].testQuestionsId === id) {
contentList[i].contents = value;
break;
}
}
this.contentList = [...contentList];
console.log(this.contentList);
},
// 第一次填写题目答案得时候(在已经填写好的题目答案数组中没有找到当前所填得题)
failFn(id, value, recordId) {
// console.log(id, value);
const { contentList } = this;
let obj = {
testQuestionsId: id,
patientRecordId: recordId ? recordId : '',
contents: value,
};
contentList.push(obj);
this.contentList = [...contentList];
console.log(this.contentList);
},
// 遍历数组,删除本题已经答过的所有答案
ergodicList(id) {
for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id) {
this.contentList.splice(i, 1);
i -= 1;
}
}
},
// 其他输入框发生改变时
inputChange(id, e, value, recordId) {
for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id && this.contentList[i].type === 1) {
this.contentList.splice(i, 1);
i -= 1;
}
}
if (e.target.value !== '') {
let obj = {
testQuestionsId: id,
contents: value + ':' + e.target.value,
patientRecordId: recordId ? recordId : '',
type: 1,
};
this.contentList.push(obj);
}
console.log(this.contentList);
},
// 说明输入框发生改变时
explainChange(id, e, recordId) {
for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id && this.contentList[i].type === 2) {
this.contentList.splice(i, 1);
}
}
if (e.target.value !== '') {
let obj = {
testQuestionsId: id,
contents: e.target.value,
type: 2,
patientRecordId: recordId ? recordId : '',
};
this.contentList.push(obj);
}
console.log(this.contentList);
},
// 上传图片事件
fileChange(info, id, recordId) {
console.log(info);
if (info.file.status === 'done') {
this.fileList = info.fileList;
for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id) {
this.contentList.splice(i, 1);
}
}
if (info.fileList.length > 0) {
let obj = {
testQuestionsId: id,
patientRecordId: recordId ? recordId : '',
contents: info.fileList[0].response.data[0].visitUrl,
};
this.contentList.push(obj);
}
console.log(this.contentList);
console.log(this.fileList);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id) {
this.contentList.splice(i, 1);
}
}
}
},
// 查询所有试题及ID,用于分析
async getQues() {
try {
const params = {};
const res = await queryQuestion(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.options = data;
} else {
this.$message.error('查询失败');
}
} catch (error) {
this.$message.error(error);
}
},
// 改变属性分析内的问题属性
changeQues(value) {
this.testQuestionsId = parseInt(value);
},
displayRender({ labels }) {
return labels[labels.length - 1];
},
handleChange(value) {
console.log(`Selected: ${value}`);
this.inpatientList = [];
for (let i = 0; i < value.length; i++) {
this.inpatientList.push(parseInt(value[i]));
}
},
// 搜索数据
async setData() {
try {
const params = {
param: {
conditionList: this.contentList,
conditionListDate: this.conditionListDate,
hospitalId: this.setObj.hospitalId, // 医院id
hospitalization: this.setObj.hospitalization, // 住院号
inpatientId: this.inpatientList, // 对照组id
inputStatus: this.setObj.inputStatus, // 录入状态
testQuestionsId: this.testQuestionsId,
},
};
const res = await countAnalysis(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
// console.log(this.lists);
} else {
this.$message.error('搜索失败');
}
} catch (error) {
this.$message.error('error');
}
},
},
};
</script>
<style lang="stylus" scoped></style>