Browse Source

试题相关

master
aBin 5 years ago
parent
commit
3714124bbc
  1. 16
      src/App.vue
  2. 18
      src/components/PatientInfo/PatientTable.vue
  3. 4
      src/config/api.js
  4. 556
      src/views/PatientInfo/PatientInfo.vue

16
src/App.vue

@ -1,7 +1,7 @@
<template> <template>
<a-config-provider :locale="zh_CN"> <a-config-provider :locale="zh_CN">
<div class="d-flex flex-row flex-nowrap" id="app"> <div class="d-flex flex-row flex-nowrap" id="app">
<!-- <btn-con /> --> <btn-con />
<router-view class="flex-1 bg pa-3"></router-view> <router-view class="flex-1 bg pa-3"></router-view>
</div> </div>
</a-config-provider> </a-config-provider>
@ -10,12 +10,12 @@
<script> <script>
import { mapState, mapActions, mapMutations } from 'vuex'; import { mapState, mapActions, mapMutations } from 'vuex';
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN'; import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
// import BtnCon from 'components/BtnCom/BtnCon.vue'; import BtnCon from 'components/BtnCom/BtnCon.vue';
import { getHId } from 'config/api'; import { getHId } from 'config/api';
export default { export default {
name: 'App', name: 'App',
// components: { BtnCon }, components: { BtnCon },
data() { data() {
return { zh_CN }; return { zh_CN };
}, },
@ -32,11 +32,11 @@ export default {
} }
}, },
}, },
created() { async created() {
// const userId = '1218763410024566784'; const userId = '1218763410024566784';
// const params = { userId }; const params = { userId };
// await this.getUserId(params); await this.getUserId(params);
// await this.getToken(); await this.getToken();
if (localStorage.getItem('patientId')) { if (localStorage.getItem('patientId')) {
this.setPatientId(localStorage.getItem('patientId')); this.setPatientId(localStorage.getItem('patientId'));
} }

18
src/components/PatientInfo/PatientTable.vue

@ -43,7 +43,7 @@
<script> <script>
import { mapMutations, mapState } from 'vuex'; import { mapMutations, mapState } from 'vuex';
import { generatePatientReport } from 'config/api';
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
@ -108,12 +108,26 @@ export default {
...mapMutations('home', ['setPatientId']), ...mapMutations('home', ['setPatientId']),
// //
chooseItem(id) { async chooseItem(id) {
try {
this.setPatientId(id); this.setPatientId(id);
localStorage.setItem('patientId', id); localStorage.setItem('patientId', id);
const params = { param: { patientId: id } };
const res = await generatePatientReport(params);
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data);
localStorage.setItem('reportId', data.id);
if (localStorage.getItem('reportId')) {
this.$message.success('生成报告单成功');
}
}
if (localStorage.getItem('patientId')) { if (localStorage.getItem('patientId')) {
this.$message.success('选择成功'); this.$message.success('选择成功');
} }
} catch (error) {
console.log(error);
}
}, },
handleTableChange(pagination) { handleTableChange(pagination) {

4
src/config/api.js

@ -9,6 +9,7 @@ import axios from 'axios';
let { proxyUrl, msgUrl } = require('@/config/setting'); let { proxyUrl, msgUrl } = require('@/config/setting');
const tcm = `${proxyUrl}/tcm`; const tcm = `${proxyUrl}/tcm`;
const question = `${proxyUrl}/question`;
const patient = `${tcm}/patient`; // 患者相关接口 const patient = `${tcm}/patient`; // 患者相关接口
const imp = `${tcm}/import`; // 试题相关接口 const imp = `${tcm}/import`; // 试题相关接口
const inpatient = `${tcm}/inpatient`; // 对照组接口 const inpatient = `${tcm}/inpatient`; // 对照组接口
@ -86,3 +87,6 @@ export const patientProgress = params => axios.post(`${statistics}/selPatientPro
// 临近任务统计 // 临近任务统计
export const adjacentTasks = params => axios.post(`${statistics}/adjacentTasks`, params); export const adjacentTasks = params => axios.post(`${statistics}/adjacentTasks`, params);
// 生成报告单
export const generatePatientReport = params => axios.post(`${question}/generatePatientReport`, params);

556
src/views/PatientInfo/PatientInfo.vue

@ -8,6 +8,7 @@
<div v-for="(item, index) in list" :key="index"> <div v-for="(item, index) in list" :key="index">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<!-- 一级大标题 --> <!-- 一级大标题 -->
<!-- <h2>病史相关</h2> -->
<h2>{{ item.name }}</h2> <h2>{{ item.name }}</h2>
</a-form-item> </a-form-item>
<!-- 一级标题下的各种问题questionVos判断类型1-12展示不同需要填写的内容 --> <!-- 一级标题下的各种问题questionVos判断类型1-12展示不同需要填写的内容 -->
@ -23,7 +24,11 @@
<a-radio-group v-model="a.answer" v-else-if="a.type === 3" @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 v-for="(b, c) in a.optionVos" :key="c" :style="radioStyle" :value="b.showValue"> {{ b.showValue }} </a-radio>
</a-radio-group> </a-radio-group>
<a-checkbox-group v-else-if="a.type === 4" @change="onChange($event, a.type, a.id, a.recordId)"> <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-row>
<a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
@ -51,44 +56,55 @@
> >
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button> <a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload> </a-upload>
<a-radio-group v-model="a.answer" v-else-if="a.type === 8" @change="onChange($event, a.type, a.id, a.recordId)"> <a-radio-group
:default-value="getAnswer(a.answer)"
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)"> --> <!-- <a-radio-group @change="onChange($event, a.type, a.id, a.recordId)"> -->
<div> <div>
<a-radio v-for="(f, g) in a.optionVos" :key="g" :style="radioStyle" :value="f.showValue"> <a-radio v-for="(f, g) in a.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }} {{ f.showValue }}
</a-radio> </a-radio>
</div> </div>
<!-- </a-radio-group> -->
<div v-for="(j, k) in a.optionVos" :key="k"> <div v-for="(j, k) in a.optionVos" :key="k">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === a.id && item.contents === `${j.showValue}`; return item.testQuestionsId === a.id && item.contents === `${j.showValue}`;
}) && j.afterOperation === 1 }) &&
j.afterOperation === 1) ||
(j.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === a.id;
}))
" "
> >
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <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-input v-model="j.otherInformation" style="width: 200px" @change="inputChange(a.id, $event, j.showValue)"></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
<!-- </a-radio-group> -->
</a-radio-group> </a-radio-group>
<a-checkbox-group v-else-if="a.type === 9" @change="onChange($event, a.type, a.id, a.recordId)"> <a-checkbox-group
:default-value="getList(a.optionVos)"
v-else-if="a.type === 9"
@change="onChange($event, a.type, a.id, a.recordId)"
>
<a-row> <a-row>
<a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
<a-col :span="100"> <a-col :span="100">
<div v-for="(j, k) in a.optionVos" :key="k"> <div v-for="(j, k) in a.optionVos" :key="k">
<div <div v-if="j.afterOperation === 1">
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-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-input
v-model="j.otherInformation"
style="width: 200px"
@change="inputChange1(a.id, $event, j.showValue, a.recordId, a.optionVos)"
></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
@ -96,49 +112,52 @@
</a-row> </a-row>
</a-checkbox-group> </a-checkbox-group>
<div v-else-if="a.type === 10"> <div v-else-if="a.type === 10">
<a-select style="width: 120px" @change="onChange($event, a.type, a.id, a.recordId)"> <a-select :default-value="getAnswer(a.answer)" 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-option v-for="(b, c) in a.optionVos" :key="c" :value="b.showValue"> {{ b.showValue }} </a-select-option>
</a-select> </a-select>
<div v-for="(b, c) in a.optionVos" :key="c"> <div v-for="(b, c) in a.optionVos" :key="c">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === a.id && item.contents === `${b.showValue}`; return item.testQuestionsId === a.id && item.contents === `${b.showValue}`;
}) && b.afterOperation === 1 }) &&
b.afterOperation === 1) ||
(b.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === a.id;
}))
" "
> >
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <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-input v-model="b.otherInformation" style="width: 200px" @change="inputChange(a.id, $event, b.showValue)"></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="a.type === 11"> <div v-else-if="a.type === 11">
<a-checkbox-group @change="onChange($event, a.type, a.id, a.recordId)"> <a-checkbox-group :default-value="getList(a.optionVos)" @change="onChange($event, a.type, a.id, a.recordId)">
<a-row> <a-row>
<a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
<a-col :span="100"> <a-col :span="100">
<div v-for="(b, c) in a.optionVos" :key="c"> <div v-for="(b, c) in a.optionVos" :key="c">
<div <div v-if="b.afterOperation > 0">
v-if=" <a-input
contentList.find(item => { v-model="b.otherInformation"
return item.testQuestionsId === a.id && item.contents.find(content => content === `${b.showValue}`); style="width: 200px"
}) && b.afterOperation > 0 @change="inputChange1(a.id, $event, j.showValue, a.recordId, a.optionVos)"
" />
>
<a-input style="width: 200px" @change="inputChange(a.id, $event, b.showValue)"></a-input>
</div> </div>
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
说明 <a-input style="width: 200px" @change="explainChange(a.id, $event)" /> 说明 <a-textarea style="width: 200px" @change="explainChange(a.id, $event)" />
</a-checkbox-group> </a-checkbox-group>
</div> </div>
<!-- 当类型为12时为单选+关联 --> <!-- 当类型为12时为单选+关联 -->
<div v-else-if="a.type === 12"> <div v-else-if="a.type === 12">
<a-radio-group @change="onChange($event, a.type, a.id, a.recordId)"> <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"> <a-radio v-for="(f, g) in a.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }} {{ f.showValue }}
</a-radio> </a-radio>
@ -146,13 +165,15 @@
<div v-for="(j, k) in a.optionVos" :key="k"> <div v-for="(j, k) in a.optionVos" :key="k">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === a.id && item.contents === `${j.showValue}`; return item.testQuestionsId === a.id && item.contents === `${j.showValue}`;
}) && j.afterOperation > 0 }) &&
j.afterOperation > 0) ||
(j.afterOperation > 0 && j.showValue === a.answer)
" "
> >
<div v-for="(h, i) in j.questionVos" :key="i"> <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-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input <a-input
v-if="j.afterOperation === 1" v-if="j.afterOperation === 1"
style="width: 200px" style="width: 200px"
@ -160,156 +181,183 @@
></a-input> ></a-input>
<a-textarea v-else-if="j.afterOperation === 2" @change="inputChange(a.id, $event, j.showValue)"></a-textarea> <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-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="h.question">
<a-form-item <a-input v-model="h.answer" v-if="h.type === 1" @change="onChange($event, h.type, h.id, h.recordId)" />
: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 <a-textarea
v-else-if="ohter.type === 2" v-model="h.answer"
v-else-if="h.type === 2"
style="height: 100px" style="height: 100px"
@change="onChange($event, ohter.type, ohter.id)" @change="onChange($event, h.type, h.id)"
/> />
<a-radio-group v-else-if="ohter.type === 3" @change="onChange($event, ohter.type, ohter.id, ohter.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 ohter.optionVos" :key="c" :style="radioStyle" :value="b.showValue"> <a-radio v-for="(b, c) in h.optionVos" :key="c" :style="radioStyle" :value="b.showValue">
{{ b.showValue }} {{ b.showValue }}
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
<a-checkbox-group v-else-if="ohter.type === 4" @change="onChange($event, ohter.type, ohter.id, ohter.recordId)"> <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-row>
<a-col :span="24" v-for="(ques, indexNum) in ohter.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
</a-row> </a-row>
</a-checkbox-group> </a-checkbox-group>
<a-select <a-select
v-else-if="ohter.type === 5" v-model="h.answer"
v-else-if="h.type === 5"
style="width: 120px" style="width: 120px"
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)" @change="onChange($event, h.type, h.id, h.recordId)"
> >
<a-select-option v-for="(b, c) in ohter.optionVos" :key="c" :value="b.showValue"> <a-select-option v-for="(b, c) in h.optionVos" :key="c" :value="b.showValue">
{{ b.showValue }} {{ b.showValue }}
</a-select-option> </a-select-option>
</a-select> </a-select>
<a-date-picker <a-date-picker
show-time show-time
placeholder="日期时间选择" placeholder="日期时间选择"
v-else-if="ohter.type === 6" v-else-if="h.type === 6"
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)" :default-value="h.answer ? $moment(h.answer, dateFormat) : ''"
@change="onChange($event, h.type, h.id, h.recordId)"
/> />
<a-upload <a-upload
v-else-if="ohter.type === 7" v-else-if="h.type === 7"
:action="action" :action="action"
:headers="headers" :headers="headers"
:default-file-list="fileList" :default-file-list="fileList"
list-type="picture" list-type="picture"
@change="fileChange($event, ohter.id)" @change="fileChange($event, h.id)"
name="files" name="files"
> >
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button> <a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload> </a-upload>
<a-radio-group v-else-if="ohter.type === 8" @change="onChange($event, ohter.type, ohter.id, ohter.recordId)"> <a-radio-group
<a-radio-group @change="onChange($event, ohter.type, ohter.id)"> :default-value="getAnswer(h.answer)"
<a-radio v-for="(f, g) in ohter.optionVos" :key="g" :style="radioStyle" :value="f.showValue"> 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 }} {{ f.showValue }}
</a-radio> </a-radio>
</a-radio-group> </div>
<div v-for="(m, n) in ohter.optionVos" :key="n"> <!-- </a-radio-group> -->
<div v-for="(m, n) in h.optionVos" :key="n">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === ohter.id && item.contents === `${m.showValue}`; return item.testQuestionsId === h.id && item.contents === `${m.showValue}`;
}) && m.afterOperation === 1 }) &&
m.afterOperation === 1) ||
(m.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === h.id;
}))
" "
> >
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <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-input
v-model="m.otherInformation"
style="width: 200px"
@change="inputChange(h.id, $event, m.showValue)"
></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
</a-radio-group> </a-radio-group>
<a-checkbox-group v-else-if="ohter.type === 9" @change="onChange($event, ohter.type, ohter.id, ohter.recordId)"> <a-checkbox-group
:default-value="getList(h.optionVos)"
v-else-if="h.type === 9"
@change="onChange($event, h.type, h.id, h.recordId)"
>
<a-row> <a-row>
<a-col :span="24" v-for="(ques, indexNum) in ohter.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
<a-col :span="100"> <a-col :span="100">
<div v-for="(m, n) in ohter.optionVos" :key="n"> <div v-for="(m, n) in h.optionVos" :key="n">
<div <div v-if="m.afterOperation === 1">
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-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-input
v-model="m.otherInformation"
style="width: 200px"
@change="inputChange1(h.id, $event, m.showValue, h.recordId, h.optionVos)"
></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
</a-checkbox-group> </a-checkbox-group>
<div v-else-if="ohter.type === 10"> <div v-else-if="h.type === 10">
<a-select style="width: 120px" @change="onChange($event, ohter.type, ohter.id, ohter.recordId)"> <a-select
<a-select-option v-for="(b, c) in ohter.optionVos" :key="c" :value="b.showValue"> :default-value="getAnswer(h.answer)"
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 }} {{ b.showValue }}
</a-select-option> </a-select-option>
</a-select> </a-select>
<div v-for="(b, c) in ohter.optionVos" :key="c"> <div v-for="(b, c) in h.optionVos" :key="c">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === ohter.id && item.contents === `${b.showValue}`; return item.testQuestionsId === h.id && item.contents === `${b.showValue}`;
}) && b.afterOperation === 1 }) &&
b.afterOperation === 1) ||
(b.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === h.id;
}))
" "
> >
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <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-input
v-model="b.otherInformation"
style="width: 200px"
@change="inputChange(h.id, $event, b.showValue)"
></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="ohter.type === 11"> <div v-else-if="h.type === 11">
<a-checkbox-group @change="onChange($event, ohter.type, ohter.id, ohter.recordId)"> <a-checkbox-group :default-value="getList(h.optionVos)" @change="onChange($event, h.type, h.id, h.recordId)">
<a-row> <a-row>
<a-col :span="24" v-for="(ques, indexNum) in ohter.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
<a-col :span="100"> <a-col :span="100">
<div v-for="(b, c) in ohter.optionVos" :key="c"> <div v-for="(b, c) in h.optionVos" :key="c">
<div <div v-if="b.afterOperation > 0">
v-if=" <a-input
contentList.find(item => { v-model="b.otherInformation"
return ( style="width: 200px"
item.testQuestionsId === ohter.id && @change="inputChange1(h.id, $event, b.showValue, h.recordId, h.optionVos)"
item.contents.find(content => content === `${b.showValue}`) ></a-input>
);
}) && b.afterOperation > 0
"
>
<a-input style="width: 200px" @change="inputChange(ohter.id, $event, b.showValue)"></a-input>
</div> </div>
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
说明 <a-input style="width: 200px" @change="explainChange(ohter.id, $event)" /> 说明 <a-input style="width: 200px" @change="explainChange(h.id, $event)" />
</a-checkbox-group> </a-checkbox-group>
</div> </div>
<!-- 当类型为12时为单选+关联 --> <!-- 当类型为12时为单选+关联 -->
<div v-else-if="ohter.type === 12"> <div v-else-if="h.type === 12">
<a-radio-group @change="onChange($event, ohter.type, ohter.id, ohter.recordId)"> <a-radio-group v-model="h.answer" @change="onChange($event, h.type, h.id, h.recordId)">
<a-radio v-for="(f, g) in ohter.optionVos" :key="g" :style="radioStyle" :value="f.showValue"> <a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }} {{ f.showValue }}
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
<div v-for="(m, n) in ohter.optionVos" :key="n"> <div v-for="(m, n) in h.optionVos" :key="n">
<div <div
v-if=" v-if="
contentList.find(item => { contentList.find(item => {
return item.testQuestionsId === ohter.id && item.contents === `${m.showValue}`; return item.testQuestionsId === h.id && item.contents === `${m.showValue}`;
}) && m.afterOperation > 0 }) && m.afterOperation > 0
" "
> >
@ -322,11 +370,11 @@
<a-input <a-input
v-if="m.afterOperation === 1" v-if="m.afterOperation === 1"
style="width: 200px" style="width: 200px"
@change="inputChange(ohter.id, $event, m.showValue)" @change="inputChange(h.id, $event, m.showValue)"
></a-input> ></a-input>
<a-textarea <a-textarea
v-else-if="m.afterOperation === 2" v-else-if="m.afterOperation === 2"
@change="inputChange(ohter.id, $event, m.showValue)" @change="inputChange(h.id, $event, m.showValue)"
></a-textarea> ></a-textarea>
<div v-else-if="m.afterOperation === 3">qwe</div> <div v-else-if="m.afterOperation === 3">qwe</div>
</a-form-item> </a-form-item>
@ -334,13 +382,12 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="ohter.type === 13"> <div v-else-if="h.type === 13">
<a-input-number @change="onChange($event, ohter.type, ohter.id, ohter.recordId)" /> <a-input-number v-model="h.answer" @change="onChange($event, h.type, h.id, h.recordId)" />
</div> </div>
<div v-else-if="ohter.type === 14">图片识别</div> <div v-else-if="h.type === 14">图片识别</div>
</a-form-item> </a-form-item>
</div> </div>
</div>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
@ -356,30 +403,45 @@
<div v-for="w in item.subReportCodes" :key="w.name"> <div v-for="w in item.subReportCodes" :key="w.name">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<!-- 二级大标题 --> <!-- 二级大标题 -->
<h3>{{ w.name }}</h3> <span class="hhh2"> {{ w.name }}</span>
</a-form-item> </a-form-item>
<!-- 二级标题下的各种类型 --> <!-- 二级标题下的各种类型 -->
<div v-for="e in w.questionVos" :key="e.name"> <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-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-input v-model="e.answer" 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-textarea
<a-radio-group v-else-if="e.type === 3" @change="onChange($event, e.type, e.id, e.recordId)"> v-model="e.answer"
v-else-if="e.type === 2"
style="height: 100px"
@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 v-for="(b, c) in e.optionVos" :key="c" :style="radioStyle" :value="b.showValue"> {{ b.showValue }} </a-radio>
</a-radio-group> </a-radio-group>
<a-checkbox-group v-else-if="e.type === 4" @change="onChange($event, e.type, e.id, e.recordId)"> <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-row>
<a-col :span="24" v-for="(ques, indexNum) in e.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in e.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
</a-row> </a-row>
</a-checkbox-group> </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
v-model="e.answer"
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-option v-for="(b, c) in e.optionVos" :key="c" :value="b.showValue"> {{ b.showValue }} </a-select-option>
</a-select> </a-select>
<a-date-picker <a-date-picker
show-time show-time
placeholder="日期时间选择" placeholder="日期时间选择"
v-else-if="e.type === 6" v-else-if="e.type === 6"
:default-value="e.answer ? $moment(e.answer, dateFormat) : ''"
@change="onChange($event, e.type, e.id, e.recordId)" @change="onChange($event, e.type, e.id, e.recordId)"
/> />
<a-upload <a-upload
@ -393,7 +455,11 @@
> >
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button> <a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload> </a-upload>
<a-radio-group v-else-if="e.type === 8" @change="onChange($event, e.type, e.id, e.recordId)"> <a-radio-group
:default-value="getAnswer(e.answer)"
v-else-if="e.type === 8"
@change="onChange($event, e.type, e.id, e.recordId)"
>
<a-radio-group @change="onChange($event, e.type, e.id)"> <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"> <a-radio v-for="(f, g) in e.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }} {{ f.showValue }}
@ -402,33 +468,40 @@
<div v-for="(j, k) in e.optionVos" :key="k"> <div v-for="(j, k) in e.optionVos" :key="k">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === e.id && item.contents === `${j.showValue}`; return item.testQuestionsId === e.id && item.contents === `${j.showValue}`;
}) && j.afterOperation === 1 }) &&
j.afterOperation === 1) ||
(j.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === e.id;
}))
" "
> >
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <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-input v-model="j.otherInformation" style="width: 200px" @change="inputChange(e.id, $event, j.showValue)"></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
</a-radio-group> </a-radio-group>
<a-checkbox-group v-else-if="e.type === 9" @change="onChange($event, e.type, e.id, e.recordId)"> <a-checkbox-group
:default-value="getList(e.optionVos)"
v-else-if="e.type === 9"
@change="onChange($event, e.type, e.id, e.recordId)"
>
<a-row> <a-row>
<a-col :span="24" v-for="(ques, indexNum) in e.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in e.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
<a-col :span="100"> <a-col :span="100">
<div v-for="(j, k) in e.optionVos" :key="k"> <div v-for="(j, k) in e.optionVos" :key="k">
<div <div v-if="j.afterOperation === 1">
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-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-input
v-model="j.otherInformation"
style="width: 200px"
@change="inputChange1(e.id, $event, j.showValue, e.recordId, e.optionVos)"
></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
@ -436,39 +509,42 @@
</a-row> </a-row>
</a-checkbox-group> </a-checkbox-group>
<div v-else-if="e.type === 10"> <div v-else-if="e.type === 10">
<a-select style="width: 120px" @change="onChange($event, e.type, e.id, e.recordId)"> <a-select :default-value="getAnswer(e.answer)" 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-option v-for="(b, c) in e.optionVos" :key="c" :value="b.showValue"> {{ b.showValue }} </a-select-option>
</a-select> </a-select>
<div v-for="(b, c) in e.optionVos" :key="c"> <div v-for="(b, c) in e.optionVos" :key="c">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === e.id && item.contents === `${b.showValue}`; return item.testQuestionsId === e.id && item.contents === `${b.showValue}`;
}) && b.afterOperation === 1 }) &&
b.afterOperation === 1) ||
(b.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === e.id;
}))
" "
> >
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <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-input v-model="b.otherInformation" style="width: 200px" @change="inputChange(e.id, $event, b.showValue)"></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="e.type === 11"> <div v-else-if="e.type === 11">
<a-checkbox-group @change="onChange($event, e.type, e.id, e.recordId)"> <a-checkbox-group :default-value="getList(e.optionVos)" @change="onChange($event, e.type, e.id, e.recordId)">
<a-row> <a-row>
<a-col :span="24" v-for="(ques, indexNum) in e.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in e.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
<a-col :span="100"> <a-col :span="100">
<div v-for="(b, c) in e.optionVos" :key="c"> <div v-for="(b, c) in e.optionVos" :key="c">
<div <div v-if="b.afterOperation > 0">
v-if=" <a-input
contentList.find(item => { v-model="b.otherInformation"
return item.testQuestionsId === e.id && item.contents.find(content => content === `${b.showValue}`); style="width: 200px"
}) && b.afterOperation > 0 @change="inputChange1(e.id, $event, b.showValue, e.recordId, e.optionVos)"
" ></a-input>
>
<a-input style="width: 200px" @change="inputChange(e.id, $event, b.showValue)"></a-input>
</div> </div>
</div> </div>
</a-col> </a-col>
@ -478,7 +554,7 @@
</div> </div>
<!-- 当类型为12时为单选+关联 --> <!-- 当类型为12时为单选+关联 -->
<div v-else-if="e.type === 12"> <div v-else-if="e.type === 12">
<a-radio-group @change="onChange($event, e.type, e.id, e.recordId)"> <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"> <a-radio v-for="(f, g) in e.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }} {{ f.showValue }}
</a-radio> </a-radio>
@ -486,9 +562,11 @@
<div v-for="(j, k) in e.optionVos" :key="k"> <div v-for="(j, k) in e.optionVos" :key="k">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === e.id && item.contents === `${j.showValue}`; return item.testQuestionsId === e.id && item.contents === `${j.showValue}`;
}) && j.afterOperation > 0 }) &&
j.afterOperation > 0) ||
(j.afterOperation > 0 && j.showValue === e.answer)
" "
> >
<div v-for="(h, i) in j.questionVos" :key="i"> <div v-for="(h, i) in j.questionVos" :key="i">
@ -501,25 +579,35 @@
<a-textarea v-else-if="j.afterOperation === 2" @change="inputChange(e.id, $event, j.showValue)"></a-textarea> <a-textarea v-else-if="j.afterOperation === 2" @change="inputChange(e.id, $event, j.showValue)"></a-textarea>
<div v-else-if="j.afterOperation === 3"> <div v-else-if="j.afterOperation === 3">
<a-form-item> <a-form-item>
<a-input v-if="h.type === 1" @change="onChange($event, h.type, h.id, h.h.recordId)" /> <a-input v-model="h.answer" v-if="h.type === 1" @change="onChange($event, h.type, h.id, h.h.recordId)" />
<a-textarea <a-textarea
v-model="h.answer"
v-else-if="h.type === 2" v-else-if="h.type === 2"
style="height: 100px" style="height: 100px"
@change="onChange($event, h.type, h.id, h.recordId)" @change="onChange($event, h.type, h.id, h.recordId)"
/> />
<a-radio-group v-else-if="h.type === 3" @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"> <a-radio v-for="(b, c) in h.optionVos" :key="c" :style="radioStyle" :value="b.showValue">
{{ b.showValue }} {{ b.showValue }}
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
<a-checkbox-group v-else-if="h.type === 4" @change="onChange($event, h.type, h.id, h.recordId)"> <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-row>
<a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
</a-row> </a-row>
</a-checkbox-group> </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
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"> <a-select-option v-for="(b, c) in h.optionVos" :key="c" :value="b.showValue">
{{ b.showValue }} {{ b.showValue }}
</a-select-option> </a-select-option>
@ -528,6 +616,7 @@
show-time show-time
placeholder="日期时间选择" placeholder="日期时间选择"
v-else-if="h.type === 6" v-else-if="h.type === 6"
:default-value="h.answer ? $moment(h.answer, dateFormat) : ''"
@change="onChange($event, h.type, h.id, h.recordId)" @change="onChange($event, h.type, h.id, h.recordId)"
/> />
<a-upload <a-upload
@ -541,42 +630,59 @@
> >
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button> <a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload> </a-upload>
<a-radio-group v-else-if="h.type === 8" @change="onChange($event, h.type, h.id, h.recordId)"> <a-radio-group
<a-radio-group @change="onChange($event, h.type, h.id, h.recordId)"> :default-value="getAnswer(h.answer)"
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, h.recordId)"> -->
<div>
<a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue"> <a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }} {{ f.showValue }}
</a-radio> </a-radio>
</a-radio-group> </div>
<!-- </a-radio-group> -->
<div v-for="(m, n) in h.optionVos" :key="n"> <div v-for="(m, n) in h.optionVos" :key="n">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === h.id && item.contents === `${m.showValue}`; return item.testQuestionsId === h.id && item.contents === `${m.showValue}`;
}) && m.afterOperation === 1 }) &&
m.afterOperation === 1) ||
(m.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === h.id;
}))
" "
> >
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <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-input
v-model="m.otherInformation"
style="width: 200px"
@change="inputChange(h.id, $event, m.showValue)"
></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
</a-radio-group> </a-radio-group>
<a-checkbox-group v-else-if="h.type === 9" @change="onChange($event, h.type, h.id, h.recordId)"> <a-checkbox-group
:default-value="getList(h.optionVos)"
v-else-if="h.type === 9"
@change="onChange($event, h.type, h.id, h.recordId)"
>
<a-row> <a-row>
<a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
<a-col :span="100"> <a-col :span="100">
<div v-for="(m, n) in h.optionVos" :key="n"> <div v-for="(m, n) in h.optionVos" :key="n">
<div <div v-if="m.afterOperation === 1">
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-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-input
v-model="m.otherInformation"
style="width: 200px"
@change="inputChange1(h.id, $event, m.showValue, h.recordId, h.optionVos)"
></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
@ -584,7 +690,11 @@
</a-row> </a-row>
</a-checkbox-group> </a-checkbox-group>
<div v-else-if="h.type === 10"> <div v-else-if="h.type === 10">
<a-select style="width: 120px" @change="onChange($event, h.type, h.id, h.recordId)"> <a-select
:default-value="getAnswer(h.answer)"
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"> <a-select-option v-for="(b, c) in h.optionVos" :key="c" :value="b.showValue">
{{ b.showValue }} {{ b.showValue }}
</a-select-option> </a-select-option>
@ -592,35 +702,40 @@
<div v-for="(b, c) in h.optionVos" :key="c"> <div v-for="(b, c) in h.optionVos" :key="c">
<div <div
v-if=" v-if="
contentList.find(item => { (contentList.find(item => {
return item.testQuestionsId === h.id && item.contents === `${b.showValue}`; return item.testQuestionsId === h.id && item.contents === `${b.showValue}`;
}) && b.afterOperation === 1 }) &&
b.afterOperation === 1) ||
(b.afterOperation === 1 &&
!contentList.find(item => {
return item.testQuestionsId === h.id;
}))
" "
> >
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <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-input
v-model="b.otherInformation"
style="width: 200px"
@change="inputChange(h.id, $event, b.showValue)"
></a-input>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="h.type === 11"> <div v-else-if="h.type === 11">
<a-checkbox-group @change="onChange($event, h.type, h.id, h.recordId)"> <a-checkbox-group :default-value="getList(h.optionVos)" @change="onChange($event, h.type, h.id, h.recordId)">
<a-row> <a-row>
<a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum"> <a-col :span="24" v-for="(ques, indexNum) in h.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> <a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col> </a-col>
<a-col :span="100"> <a-col :span="100">
<div v-for="(b, c) in h.optionVos" :key="c"> <div v-for="(b, c) in h.optionVos" :key="c">
<div <div v-if="b.afterOperation > 0">
v-if=" <a-input
contentList.find(item => { v-model="b.otherInformation"
return ( style="width: 200px"
item.testQuestionsId === h.id && item.contents.find(content => content === `${b.showValue}`) @change="inputChange1(h.id, $event, b.showValue, h.recordId, h.optionVos)"
); ></a-input>
}) && b.afterOperation > 0
"
>
<a-input style="width: 200px" @change="inputChange(h.id, $event, b.showValue)"></a-input>
</div> </div>
</div> </div>
</a-col> </a-col>
@ -630,7 +745,7 @@
</div> </div>
<!-- 当类型为12时为单选+关联 --> <!-- 当类型为12时为单选+关联 -->
<div v-else-if="h.type === 12"> <div v-else-if="h.type === 12">
<a-radio-group @change="onChange($event, h.type, h.id, h.recordId)"> <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"> <a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }} {{ f.showValue }}
</a-radio> </a-radio>
@ -665,7 +780,7 @@
</div> </div>
</div> </div>
<div v-else-if="h.type === 13"> <div v-else-if="h.type === 13">
<a-input-number @change="onChange($event, h.type, h.id, h.recordId)" /> <a-input-number v-model="h.answer" @change="onChange($event, h.type, h.id, h.recordId)" />
</div> </div>
<div v-else-if="h.type === 14">图片识别</div> <div v-else-if="h.type === 14">图片识别</div>
</a-form-item> </a-form-item>
@ -676,7 +791,7 @@
</div> </div>
</div> </div>
<div v-else-if="e.type === 13"> <div v-else-if="e.type === 13">
<a-input-number @change="onChange($event, e.type, e.id, e.recordId)" /> <a-input-number v-model="e.answer" @change="onChange($event, e.type, e.id, e.recordId)" />
</div> </div>
<div v-else-if="e.type === 14">图片识别</div> <div v-else-if="e.type === 14">图片识别</div>
</a-form-item> </a-form-item>
@ -691,7 +806,9 @@
class="white--text" class="white--text"
@change="changeDate" @change="changeDate"
/> />
<a-button class="white--text px-10" type="primary" @click="setData()" v-if="list.length > 0" style="margin-top: 40px">提交</a-button> <a-button class="white--text px-10" type="primary" @click="setData()" v-if="list.length > 0 && getCode" style="margin-top: 40px">
提交
</a-button>
</div> </div>
</template> </template>
@ -700,7 +817,7 @@ import { mapState } from 'vuex';
import { queryAll, saveCaseMes, upload } from 'config/api'; import { queryAll, saveCaseMes, upload } from 'config/api';
const formItemLayout = { const formItemLayout = {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 9 }, wrapperCol: { span: 12 },
}; };
const tailItemLayout = { wrapperCol: { span: 18, offset: 4 } }; const tailItemLayout = { wrapperCol: { span: 18, offset: 4 } };
export default { export default {
@ -711,6 +828,7 @@ export default {
tailItemLayout, tailItemLayout,
form: this.$form.createForm(this, { name: 'page-add' }), form: this.$form.createForm(this, { name: 'page-add' }),
value: 1, value: 1,
checked: true,
radioStyle: { radioStyle: {
display: 'block', display: 'block',
height: '30px', height: '30px',
@ -754,8 +872,26 @@ export default {
this.getQuery(); this.getQuery();
}, },
methods: { methods: {
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(':');
console.log(strArr[0]);
return strArr[0];
} else {
return '';
}
},
callback(key) { callback(key) {
console.log(key); this.contentList = [];
this.tabNums = key; this.tabNums = key;
}, },
async getQuery() { async getQuery() {
@ -780,8 +916,6 @@ export default {
} else { } else {
this.tabList = [180, 360]; this.tabList = [180, 360];
} }
} else {
this.tabList = [0, 14, 90];
} }
} else { } else {
console.log(msg); console.log(msg);
@ -827,7 +961,7 @@ export default {
// + // +
// type === 9 : // type === 9 :
for (let i = 0; i < this.contentList.length; i++) { for (let i = 0; i < this.contentList.length; i++) {
if (id === this.contentList[i].testQuestionsId && !this.contentList[i].type) { if (id === this.contentList[i].testQuestionsId && !this.contentList[i].contentsType) {
this.contentList.splice(i, 1); this.contentList.splice(i, 1);
i -= 1; i -= 1;
} }
@ -942,7 +1076,7 @@ export default {
// //
ergodicList(id) { ergodicList(id) {
for (let i = 0; i < this.contentList.length; i++) { for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id) { if (this.contentList[i].testQuestionsId === id && !this.contentList[i].contentsType) {
this.contentList.splice(i, 1); this.contentList.splice(i, 1);
i -= 1; i -= 1;
} }
@ -966,6 +1100,45 @@ export default {
this.contentList.push(obj); 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) { explainChange(id, e, recordId) {
for (let i = 0; i < this.contentList.length; i++) { for (let i = 0; i < this.contentList.length; i++) {
@ -1042,4 +1215,11 @@ export default {
}; };
</script> </script>
<style lang="stylus" scoped></style> <style lang="stylus" scoped>
.hhh2 {
font-size: 20px;
font-weight: bold;
margin-left: 24px;
color: rgba(0, 0, 0, 0.75);
}
</style>

Loading…
Cancel
Save