中医药大学课题数据库系统
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.
 
 
 
 
 

1481 lines
66 KiB

<template>
<div class="flex-column">
<a-tabs type="card" @change="callback">
<a-tab-pane width="100" v-for="item in tabList" :key="item" :tab="typeof item === 'number' ? item + '天' : item" />
</a-tabs>
<a-form :form="form" v-if="typeof tabNums === 'number'">
<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>病史相关</h2>
<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-button type="primary" v-if="a.reportType === 1">123</a-button>
<a-input v-model="a.answer" :max-length="500" v-if="a.type === 1" @change="onChange($event, a.type, a.id, a.recordId)" />
<a-textarea
v-model="a.answer"
:max-length="500"
v-else-if="a.type === 2"
style="height: 100px; width: 100%"
@change="onChange($event, a.type, a.id, a.recordId)"
/>
<a-radio-group v-model="a.answer" v-else-if="a.type === 3" @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
:default-value="getList(a.optionVos)"
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-model="a.answer"
v-else-if="a.type === 5"
style="width: 100%"
@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-date-picker
show-time
placeholder="日期时间选择"
style="width: 100%"
v-else-if="a.type === 6"
:default-value="a.answer ? $moment(a.answer, dateFormat) : ''"
@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="
!contentList.find(item => {
return item.testQuestionsId === a.id;
})
"
>
<a-icon type="upload" /> 点击上传
</a-button>
</a-upload>
<a-radio-group
:default-value="getAnswer(a.answer)"
style="width: 100%"
v-else-if="a.type === 8"
@change="onChange($event, a.type, a.id, a.recordId)"
>
<!-- <a-radio-group @change="onChange($event, a.type, a.id, a.recordId)"> -->
<div>
<a-radio v-for="(f, g) in a.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</div>
<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) ||
(j.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === a.id;
}))
"
>
<a-form-item>
<a-input
:max-length="500"
v-model="j.otherInformation"
style="width: 100%"
@change="inputChange(a.id, $event, j.showValue)"
></a-input>
</a-form-item>
</div>
</div>
<!-- </a-radio-group> -->
</a-radio-group>
<a-checkbox-group
:default-value="getList(a.optionVos)"
v-else-if="a.type === 9"
style="width: 100%"
@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="j.afterOperation === 1">
<a-form-item>
<a-input
:max-length="500"
v-model="j.otherInformation"
style="width: 100%"
@change="inputChange1(a.id, $event, j.showValue, a.recordId, a.optionVos)"
></a-input>
</a-form-item>
</div>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="a.type === 10">
<a-select :default-value="getAnswer(a.answer)" style="width: 100%" @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) ||
(b.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === a.id;
}))
"
>
<a-form-item>
<a-input
:max-length="500"
v-model="b.otherInformation"
style="width: 100%"
@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
style="width: 100%"
:default-value="getList(a.optionVos)"
@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="b.afterOperation > 0">
<a-input
v-model="b.otherInformation"
style="width: 100%"
:max-length="500"
@change="inputChange1(a.id, $event, j.showValue, a.recordId, a.optionVos)"
/>
</div>
</div>
</a-col>
</a-row>
说明: <a-textarea style="width: 100%" @change="explainChange(a.id, $event)" />
</a-checkbox-group>
</div>
<!-- 当类型为12时,为单选+关联 -->
<div v-else-if="a.type === 12">
<a-radio-group v-model="a.answer" @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) ||
(j.afterOperation > 0 && j.showValue === a.answer)
"
>
<div v-for="(h, i) in j.questionVos" :key="i">
<a-form-item :label-col="formItemLayout1.labelCol" :wrapper-col="formItemLayout1.wrapperCol">
<a-input
v-if="j.afterOperation === 1"
style="width: 200px"
:max-length="500"
@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">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="h.question">
<a-input
v-model="h.answer"
:max-length="500"
style="width: 100%"
v-if="h.type === 1"
@change="onChange($event, h.type, h.id, h.recordId)"
/>
<a-textarea
v-model="h.answer"
v-else-if="h.type === 2"
style="height: 100px; width: 100%"
@change="onChange($event, h.type, h.id)"
/>
<a-radio-group v-model="h.answer" v-else-if="h.type === 3" @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
:default-value="getList(h.optionVos)"
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-model="h.answer"
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-date-picker
show-time
placeholder="日期时间选择"
style="width: 100%"
v-else-if="h.type === 6"
:default-value="h.answer ? $moment(h.answer, dateFormat) : ''"
@change="onChange($event, h.type, h.id, h.recordId)"
/>
<a-upload
v-else-if="h.type === 7"
:action="action"
:headers="headers"
:default-file-list="fileList"
list-type="picture"
@change="fileChange($event, h.id)"
name="files"
>
<a-button
v-show="
!contentList.find(item => {
return item.testQuestionsId === h.id;
})
"
>
<a-icon type="upload" /> 点击上传
</a-button>
</a-upload>
<a-radio-group
:default-value="getAnswer(h.answer)"
style="width: 100%"
v-else-if="h.type === 8"
@change="onChange($event, h.type, h.id, h.recordId)"
>
<!-- <a-radio-group @change="onChange($event, h.type, h.id)"> -->
<div>
<a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</div>
<!-- </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) ||
(m.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === h.id;
}))
"
>
<a-form-item>
<a-input
:max-length="500"
v-model="m.otherInformation"
style="width: 100%"
@change="inputChange(h.id, $event, m.showValue)"
></a-input>
</a-form-item>
</div>
</div>
</a-radio-group>
<a-checkbox-group
:default-value="getList(h.optionVos)"
v-else-if="h.type === 9"
style="width: 100%"
@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="m.afterOperation === 1">
<a-form-item>
<a-input
:max-length="500"
v-model="m.otherInformation"
style="width: 100%"
@change="inputChange1(h.id, $event, m.showValue, h.recordId, h.optionVos)"
></a-input>
</a-form-item>
</div>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="h.type === 10">
<a-select
:default-value="getAnswer(h.answer)"
style="width: 100%"
@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) ||
(b.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === h.id;
}))
"
>
<a-form-item>
<a-input
:max-length="500"
v-model="b.otherInformation"
style="width: 100%"
@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
style="width: 100%"
:default-value="getList(h.optionVos)"
@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="b.afterOperation > 0">
<a-input
:max-length="500"
v-model="b.otherInformation"
style="width: 100%"
@change="inputChange1(h.id, $event, b.showValue, h.recordId, h.optionVos)"
></a-input>
</div>
</div>
</a-col>
</a-row>
说明: <a-input :max-length="500" style="width: 100%" @change="explainChange(h.id, $event)" />
</a-checkbox-group>
</div>
<!-- 当类型为12时,为单选+关联 -->
<div v-else-if="h.type === 12">
<a-radio-group v-model="h.answer" @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
:max-length="500"
v-if="m.afterOperation === 1"
style="width: 200px"
@change="inputChange(h.id, $event, m.showValue)"
></a-input>
<a-textarea
:max-length="500"
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
style="width: 200px%"
v-model="h.answer"
@change="onChange($event, h.type, h.id, h.recordId)"
/>
<span style="margin-left: 10px">{{ h.units }}</span>
</div>
<div v-else-if="h.type === 14">图片识别</div>
</a-form-item>
</div>
</a-form-item>
</div>
</div>
</div>
</div>
<div v-else-if="a.type === 13">
<a-input-number v-model="a.answer" style="width: 200px" @change="onChange($event, a.type, a.id, a.recordId)" />
<span style="margin-left: 10px">{{ a.units }}</span>
</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">
<!-- 二级大标题 -->
<span class="hhh2"> {{ w.name }}:</span>
<a-upload
v-if="w.recordType"
name="files"
:multiple="true"
:action="action"
:headers="headers"
@change="handleChange($event, w.code, w.recordId)"
>
<!-- <a-upload :multiple="true" :action="action" :headers="headers" @change="handleChange"> -->
<a-button> <a-icon type="upload" />上传图片</a-button>
</a-upload>
</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
:id="e.id"
:max-length="500"
v-model="e.answer"
v-if="e.type === 1"
@change="onChange($event, e.type, e.id, e.recordId)"
/>
<a-textarea
:id="e.id"
:max-length="500"
v-model="e.answer"
v-else-if="e.type === 2"
style="height: 100px; width: 100%"
@change="onChange($event, e.type, e.id, e.recordId)"
/>
<a-radio-group v-model="e.answer" v-else-if="e.type === 3" @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
:default-value="getList(e.optionVos)"
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-model="e.answer"
v-else-if="e.type === 5"
style="width: 100%"
@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-date-picker
show-time
placeholder="日期时间选择"
v-else-if="e.type === 6"
style="width: 100%"
:default-value="e.answer ? $moment(e.answer, dateFormat) : ''"
@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="
!contentList.find(item => {
return item.testQuestionsId === e.id;
})
"
>
<a-icon type="upload" /> 点击上传
</a-button>
</a-upload>
<a-radio-group
:default-value="getAnswer(e.answer)"
v-else-if="e.type === 8"
style="width: 100%"
@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) ||
(j.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === e.id;
}))
"
>
<a-form-item>
<a-input
:max-length="500"
v-model="j.otherInformation"
style="width: 100%"
@change="inputChange(e.id, $event, j.showValue)"
></a-input>
</a-form-item>
</div>
</div>
</a-radio-group>
<a-checkbox-group
:default-value="getList(e.optionVos)"
v-else-if="e.type === 9"
style="width: 100%"
@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="j.afterOperation === 1">
<a-form-item>
<a-input
:max-length="500"
v-model="j.otherInformation"
style="width: 100%"
@change="inputChange1(e.id, $event, j.showValue, e.recordId, e.optionVos)"
></a-input>
</a-form-item>
</div>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="e.type === 10">
<a-select :default-value="getAnswer(e.answer)" style="width: 100%" @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) ||
(b.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === e.id;
}))
"
>
<a-form-item>
<a-input
:max-length="500"
v-model="b.otherInformation"
style="width: 100%"
@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 style="100%" :default-value="getList(e.optionVos)" @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="b.afterOperation > 0">
<a-input
:max-length="500"
v-model="b.otherInformation"
style="width: 100%"
@change="inputChange1(e.id, $event, b.showValue, e.recordId, e.optionVos)"
></a-input>
</div>
</div>
</a-col>
</a-row>
说明: <a-input :max-length="500" style="width: 100%" @change="explainChange(e.id, $event)" />
</a-checkbox-group>
</div>
<!-- 当类型为12时,为单选+关联 -->
<div v-else-if="e.type === 12">
<a-radio-group v-model="e.answer" @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) ||
(j.afterOperation > 0 && j.showValue === e.answer)
"
>
<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
:max-length="500"
v-if="j.afterOperation === 1"
style="width: 100%"
@change="inputChange(e.id, $event, j.showValue)"
></a-input>
<a-textarea
:max-length="500"
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
:max-length="500"
v-model="h.answer"
v-if="h.type === 1"
@change="onChange($event, h.type, h.id, h.h.recordId)"
/>
<a-textarea
v-model="h.answer"
v-else-if="h.type === 2"
style="height: 100%"
@change="onChange($event, h.type, h.id, h.recordId)"
/>
<a-radio-group
v-model="h.answer"
v-else-if="h.type === 3"
@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
:default-value="getList(h.optionVos)"
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-model="h.answer"
v-else-if="h.type === 5"
style="width: 100%"
@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-date-picker
show-time
placeholder="日期时间选择"
v-else-if="h.type === 6"
style="width: 100%"
:default-value="h.answer ? $moment(h.answer, dateFormat) : ''"
@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="
!contentList.find(item => {
return item.testQuestionsId === h.id;
})
"
>
<a-icon type="upload" /> 点击上传
</a-button>
</a-upload>
<a-radio-group
:default-value="getAnswer(h.answer)"
v-else-if="h.type === 8"
style="100%"
@change="onChange($event, h.type, h.id, h.recordId)"
>
<!-- <a-radio-group @change="onChange($event, h.type, h.id, h.recordId)"> -->
<div>
<a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
</a-radio>
</div>
<!-- </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) ||
(m.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === h.id;
}))
"
>
<a-form-item>
<a-input
:max-length="500"
v-model="m.otherInformation"
style="width: 100%"
@change="inputChange(h.id, $event, m.showValue)"
></a-input>
</a-form-item>
</div>
</div>
</a-radio-group>
<a-checkbox-group
:default-value="getList(h.optionVos)"
v-else-if="h.type === 9"
style="width: 100%"
@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="m.afterOperation === 1">
<a-form-item>
<a-input
:max-length="500"
v-model="m.otherInformation"
style="width: 100%"
@change="inputChange1(h.id, $event, m.showValue, h.recordId, h.optionVos)"
></a-input>
</a-form-item>
</div>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="h.type === 10">
<a-select
:default-value="getAnswer(h.answer)"
style="width: 100%"
@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) ||
(b.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === h.id;
}))
"
>
<a-form-item>
<a-input
:max-length="500"
v-model="b.otherInformation"
style="width: 100%"
@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
style="100%"
:default-value="getList(h.optionVos)"
@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="b.afterOperation > 0">
<a-input
:max-length="500"
v-model="b.otherInformation"
style="width: 100%"
@change="inputChange1(h.id, $event, b.showValue, h.recordId, h.optionVos)"
></a-input>
</div>
</div>
</a-col>
</a-row>
说明: <a-input :max-length="500" style="width: 100%" @change="explainChange(h.id, $event)" />
</a-checkbox-group>
</div>
<!-- 当类型为12时,为单选+关联 -->
<div v-else-if="h.type === 12">
<a-radio-group v-model="h.answer" @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
:max-length="500"
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
:max-length="500"
style="width: 200px"
v-model="h.answer"
@change="onChange($event, h.type, h.id, h.recordId)"
/>
<span style="margin-left: 10px">{{ h.units }}</span>
</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 style="width: 200px" v-model="e.answer" @change="onChange($event, e.type, e.id, e.recordId)" />
<span style="margin-left: 10px">{{ e.units }}</span>
</div>
<div v-else-if="e.type === 14">图片识别</div>
</a-form-item>
</div>
</div>
</a-collapse-panel>
<!-- </div> -->
</a-collapse>
</a-form>
<iframe v-else src="http://www.sxwikionline.com/ht-common/home/reportHistory?code=LSBGD" frameborder="0" height="100%"></iframe>
<!-- <a-date-picker
v-if="list.length > 0"
:default-value="$moment(dateChoose, dateFormat)"
:format="dateFormat"
class="white--text"
@change="changeDate"
/> -->
<div class="bot-right-tips">
当前选择患者的住院号为:<span style="color: green">{{ hospitalization }}</span>
</div>
<a-button
class="white--text px-10 bot-right-btn"
type="primary"
@click="showModal"
v-if="list.length > 0 && getCode"
style="margin-top: 40px"
>
提交
</a-button>
<a-modal title="提示" :visible="visible" :confirm-loading="confirmLoading" @ok="setData" @cancel="handleCancel">
<p>
是否提交住院号为: <span style="color: green">{{ hospitalization }}</span> 的患者的信息
</p>
</a-modal>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { queryAll, saveCaseMes, upload, basic } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 12 },
};
const formItemLayout1 = {
labelCol: { span: 0 },
wrapperCol: { span: 24 },
};
const tailItemLayout = { wrapperCol: { span: 18, offset: 4 } };
export default {
name: 'PatientInfo',
data() {
return {
formItemLayout,
formItemLayout1,
tailItemLayout,
form: this.$form.createForm(this, { name: 'page-add' }),
value: 1,
checked: true,
radioStyle: {
display: 'block',
height: '30px',
lineHeight: '30px',
},
activeKey: [0],
list: [],
tabList: [],
tabNums: 0,
contentList: [],
numList: [1, 2, 3, 4, 5],
action: upload, // 上传附件地址
fileList: [], // 附件列表
files: '', // 附件Id
dateFormat: 'YYYY-MM-DD HH:mm:ss',
dateChoose: new Date(),
subDateTime: '',
getCode: '',
visible: false,
confirmLoading: false,
recordTypeList: [],
};
},
computed: {
...mapState('home', ['patientId', 'hospitalization', 'hospitalId']),
// 上传附加请求头
headers() {
const token = sessionStorage.getItem('anyringToken');
return { Authorization: `Bearer ${token}` };
},
},
watch: {
tabNums(val) {
if (typeof val === 'number') {
this.getQuery();
}
},
recordTypeList() {
for (let i = 0; i < this.recordTypeList.length; i++) {
var dom = document.getElementById(`${this.recordTypeList[i].questionId}`);
dom.value = this.recordTypeList[i].content;
}
},
},
async created() {
console.log(this.patientId);
this.getCode = '';
this.tabNums = 0;
if (this.$route.query && this.$route.query.code) {
// vue从路径中获取参数 此处参数名为code
this.getCode = this.$route.query.code;
}
await this.getQuery();
},
methods: {
showModal() {
this.visible = true;
},
handleCancel(e) {
this.visible = false;
},
getList(obj) {
let arr = [];
for (let i = 0; i < obj.length; i++) {
if (obj[i].choose - 0 === 1) {
arr.push(obj[i].showValue);
}
}
return arr;
},
getAnswer(str) {
if (str) {
let strArr = str.split(':');
return strArr[0];
} else {
return '';
}
},
callback(key) {
this.contentList = [];
this.tabNums = key;
},
async getQuery() {
try {
const params = {
param: {
code: this.getCode ? this.getCode : '',
id: this.patientId ? this.patientId : '',
nums: this.tabNums,
},
};
const res = await queryAll(params);
const { code, data, msg } = res.data;
if (code === 200) {
// console.log(data);
this.list = data;
if (this.getCode) {
if (data[0].reportType === 0) {
this.tabList = [];
} else if (data[0].reportType === 1) {
this.tabList = [0, 14, 90];
} else {
this.tabList = [180, 365];
}
} else {
this.tabList = [0, 14, 90, 180, 365, '认知量表'];
}
} else {
console.log(msg);
}
} catch (error) {
console.log(error);
}
},
onChange(e, type, id, recordId) {
console.log(e);
// 监听所有得题目类型得填写情况(改变事件)
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);
} 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].contentsType) {
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, 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 的格式
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, 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[i].contentsType) {
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].contentsType === 1) {
this.contentList.splice(i, 1);
i -= 1;
}
}
if (e.target.value !== '') {
let obj = {
testQuestionsId: id,
contents: value + ':' + e.target.value,
patientRecordId: recordId ? recordId : '',
contentsType: 1,
};
this.contentList.push(obj);
}
},
// 多选其他输入框发生改变时
inputChange1(id, e, value, recordId, list) {
let listArr = this.getList(list);
console.log(listArr);
console.log(id);
let numkg = 0;
for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id) {
numkg = 1;
}
}
if (numkg === 0) {
for (let i = 0; i < listArr.length; i++) {
let obj11 = {
testQuestionsId: id,
contents: listArr[i],
patientRecordId: recordId ? recordId : '',
contentsType: 0,
};
this.contentList.push(obj11);
}
}
for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id && this.contentList[i].contentsType === 1) {
this.contentList.splice(i, 1);
i -= 1;
}
}
if (e.target.value !== '') {
let obj = {
testQuestionsId: id,
contents: value + ':' + e.target.value,
patientRecordId: recordId ? recordId : '',
contentsType: 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].contentsType === 2) {
this.contentList.splice(i, 1);
}
}
if (e.target.value !== '') {
let obj = {
testQuestionsId: id,
contents: e.target.value,
contentsType: 2,
patientRecordId: recordId ? recordId : '',
};
this.contentList.push(obj);
}
},
// 上传图片事件
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);
}
}
}
},
// 图像识别
async handleChange(info, title, recordId) {
if (info.file.status === 'done') {
console.log(info.file.response.data[0].visitUrl);
const params = {
param: {
hospitalId: this.hospitalId,
code: title,
url: info.file.response.data[0].visitUrl,
},
};
const res = await basic(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.changeType(data, recordId);
this.changeType(data, recordId);
console.log(this.contentList);
} else {
console.log(msg);
}
}
},
async changeType(data) {
await this.changeTypeList(data);
// // 获取到答案,重新赋值,并且推到contentList里边
for (let i = 0; i < data.length; i++) {
if (this.contentList.length > 0) {
for (let k = 0; k < this.contentList.length; k++) {
// 如果当前题目的答案已经更改过
if (data[i].questionId === this.contentList[k].testQuestionsId) {
this.contentList[k].contents = data[i].content;
break;
// 如果当前题目的答案为更改过
} else if (k === this.contentList.length - 1) {
let obj = {
testQuestionsId: data[i].questionId,
contents: data[i].content,
};
this.contentList.push(obj);
break;
}
}
} else {
let obj = {
testQuestionsId: data[i].questionId,
contents: data[i].content,
};
this.contentList.push(obj);
}
}
},
changeTypeList(data) {
this.recordTypeList = data;
},
// 改变提交时间
// changeDate(date) {
// this.subDateTime = this.$moment(date._d).format('YYYY-MM-DD HH:mm:ss');
// },
// 提交表单
async setData() {
try {
this.confirmLoading = true;
const params = {
param: {
list: this.contentList,
patientId: this.patientId,
// timeSlot: this.subDateTime ? this.subDateTime : this.$moment(this.dateChoose).format('YYYY-MM-DD HH:mm:ss'),
nums: this.tabNums,
},
};
const res = await saveCaseMes(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('提交成功');
this.visible = false;
} else {
this.$message.error('提交失败');
}
} catch (error) {
this.$message.error('error');
}
this.confirmLoading = false;
},
},
};
</script>
<style lang="stylus" scoped>
.hhh2 {
font-size: 20px;
font-weight: bold;
margin-left: 24px;
color: rgba(0, 0, 0, 0.75);
}
</style>