Browse Source

患者信息录入

master
aBin 4 years ago
parent
commit
b9405ce241
  1. 38
      src/components/Echarts/Treemap.vue
  2. 12
      src/config/api.js
  3. 196
      src/views/PatientInfo/PatientInfo.vue

38
src/components/Echarts/Treemap.vue

@ -1,3 +1,10 @@
<!--
* @Author: wally
* @email: 18603454788@163.com
* @Date: 2021-01-29 14:27:20
* @LastEditors: wally
* @LastEditTime: 2021-02-18 16:30:34
-->
<template>
<!-- <div>数据统计组件</div> -->
<div style="width: 100%; height: 300px" class="chart-box">
@ -5,6 +12,7 @@
</div>
</template>
<script>
import { complete } from 'config/api';
export default {
name: 'Treemap',
data() {
@ -12,6 +20,7 @@ export default {
// msg: 'Welcome to Your Vue.js App',
width: '',
height: '',
valueList: [],
timer: null,
};
},
@ -40,6 +49,7 @@ export default {
methods: {
async drawLine() {
// domecharts
await this.getData();
let myChart = this.$echarts.init(document.getElementById('Treemap'));
//
var option = {
@ -47,10 +57,10 @@ export default {
radar: [
{
indicator: [
{ text: '完成', max: 100 },
{ text: '已完成', max: 100 },
{ text: '进行中', max: 100 },
{ text: '废弃', max: 100 },
{ text: '完成', max: 10 },
{ text: '废弃', max: 10 },
{ text: '进行中', max: 10 },
{ text: '未完成', max: 10 },
],
center: ['50%', '50%'],
radius: 120,
@ -65,7 +75,7 @@ export default {
itemStyle: { color: 'rgb(84,112,198)' },
data: [
{
value: [80, 80, 60, 40],
value: this.valueList,
name: '病例统计',
},
],
@ -74,6 +84,24 @@ export default {
};
myChart.setOption(option);
},
async getData() {
const params = {
param: {
hospitalId: '',
userId: '',
},
};
const res = await complete(params);
const { code, data, msg } = res.data;
if (code === 200) {
// console.log(data);
for (let key in data) {
this.valueList.push(data[key]);
}
} else {
console.log(msg);
}
},
},
};
</script>

12
src/config/api.js

@ -3,7 +3,7 @@
* @email: 18603454788@163.com
* @Date: 2021-01-29 11:16:27
* @LastEditors: wally
* @LastEditTime: 2021-02-18 14:38:07
* @LastEditTime: 2021-02-18 16:20:23
*/
import axios from 'axios';
let { proxyUrl, msgUrl } = require('@/config/setting');
@ -12,6 +12,7 @@ const tcm = `${proxyUrl}/tcm`;
const patient = `${tcm}/patient`; // 患者相关接口
const imp = `${tcm}/import`; // 试题相关接口
const inpatient = `${tcm}/inpatient`; // 对照组接口
const statistics = `${tcm}/statistics`; // 数据统计相关接口
// 保存患者病例信息
export const saveCaseMes = params => axios.post(`${patient}/saveCaseMes`, params);
@ -32,3 +33,12 @@ export const selSearchCriteriaList = params => axios.post(`${patient}/selSearchC
export const queryAll = params => axios.post(`${tcm}/question/queryAll`, params);
// 查询所有对照组的信息
export const getQuery = params => axios.post(`${inpatient}/query`, params);
// 查询统计病例数据
export const complete = params => axios.post(`${statistics}/complete`, params);
// 查询病例分析
export const countAnalysis = params => axios.post(`${statistics}/countAnalysis`, params);
// 查询每日病例统计
export const countCase = params => axios.post(`${statistics}/countCase`, params);

196
src/views/PatientInfo/PatientInfo.vue

@ -1,6 +1,6 @@
<template>
<div class="flex-column">
<a-form :form="form" @submit="handleSubmit">
<a-form :form="form">
<!-- 首先遍历整个data大数组 -->
<div v-for="(item, index) in list" :key="index">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
@ -55,17 +55,23 @@
</a-radio-group>
<a-checkbox-group v-else-if="a.type === 9" @change="onChange($event, a.type, a.id)">
<a-row>
<a-col :span="12">
<a-checkbox value="A"> A </a-checkbox>
</a-col>
<a-col :span="12">
<a-checkbox value="B"> B </a-checkbox>
</a-col>
<a-col :span="12">
<a-checkbox value="C"> 其他 </a-checkbox>
<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">
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
<a-input
v-if="
contentList.find(item => {
return (
item.testQuestionsId === a.id &&
item.contents.find(a => {
return a === '其他';
})
);
})
"
:style="{ width: 100, marginLeft: 10 }"
/>
</a-col>
</a-row>
</a-checkbox-group>
@ -79,17 +85,25 @@
<div v-else-if="a.type === 11">
<a-checkbox-group @change="onChange($event, a.type, a.id)">
<a-row>
<a-col :span="12">
<a-checkbox value="A"> A </a-checkbox>
<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="12">
<a-checkbox value="B"> B </a-checkbox>
</a-col>
<a-col :span="12">
<a-checkbox value="C"> 其他 </a-checkbox>
<a-col :span="100">
<a-input
v-if="
contentList.find(item => {
return (
item.testQuestionsId === a.id &&
item.contents.find(a => {
return a === '其他';
})
);
})
"
:style="{ width: 100, marginLeft: 10 }"
/>
</a-col>
</a-row>
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
说明 <a-input :style="{ width: 100, marginLeft: 10 }" />
</a-checkbox-group>
</div>
@ -120,14 +134,14 @@
<!-- 二级标题下的各种类型 -->
<div v-for="e in c.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" />
<a-textarea v-else-if="e.type === 2" style="height: 100px" />
<a-radio-group v-else-if="e.type === 3" v-model="value" @change="onChange">
<a-radio :style="radioStyle" value="高血压"> 高血压 </a-radio>
<a-radio :style="radioStyle" value="高血脂"> 高血脂 </a-radio>
<a-radio :style="radioStyle" value="高血糖"> 高血糖 </a-radio>
<a-input v-if="e.type === 1" @change="onChange($event, e.type, e.id)" />
<a-textarea v-else-if="e.type === 2" style="height: 100px" @change="onChange($event, e.type, e.id)" />
<a-radio-group v-else-if="e.type === 3" v-model="value" @change="onChange($event, e.type, e.id)">
<a-radio :style="radioStyle" value="高血压"> 没有单选题 </a-radio>
<a-radio :style="radioStyle" value="高血脂"> 没有单选题 </a-radio>
<a-radio :style="radioStyle" value="高血糖"> 没有单选题 </a-radio>
</a-radio-group>
<a-checkbox-group v-else-if="e.type === 4" @change="onChange">
<a-checkbox-group v-else-if="e.type === 4" @change="onChange($event, e.type, e.id)">
<a-row>
<a-col :span="8">
<a-checkbox value="A"> A </a-checkbox>
@ -140,10 +154,13 @@
</a-col>
</a-row>
</a-checkbox-group>
<a-select v-else-if="e.type === 5" default-value="lucy" style="width: 120px" loading>
<a-select-option value="lucy"> Lucy </a-select-option>
<a-select v-else-if="e.type === 5" default-value="lucy" style="width: 120px" loading @change="onChange($event, e.type, e.id)">
<a-select-option value="1"> Lucy1 </a-select-option>
<a-select-option value="2"> Lucy2 </a-select-option>
<a-select-option value="3"> Lucy3 </a-select-option>
<a-select-option value="4"> Lucy4 </a-select-option>
</a-select>
<a-date-picker v-else-if="e.type === 6" />
<a-date-picker show-time placeholder="日期时间选择" v-else-if="e.type === 6" @change="onChange($event, e.type, e.id)" />
<a-upload v-else-if="e.type === 7">
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
@ -151,28 +168,35 @@
<div class="ant-upload-text">Upload</div>
</div>
</a-upload>
<a-radio-group v-else-if="e.type === 8" v-model="value" @change="onChange">
<a-radio-group v-else-if="e.type === 8" v-model="value" @change="onChange($event, e.type, e.id)">
<a-radio :style="radioStyle" value="高血压"> 高血压 </a-radio>
<a-radio :style="radioStyle" value="高血脂"> 高血脂 </a-radio>
<a-radio :style="radioStyle" value="高血糖"> 高血糖 </a-radio>
<!-- <a-radio :style="radioStyle" :value="4">
其它
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
</a-radio> -->
其它
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
</a-radio> -->
</a-radio-group>
<a-checkbox-group v-else-if="e.type === 9" @change="onChange">
<a-checkbox-group v-else-if="e.type === 9" @change="onChange($event, e.type, e.id)">
<a-row>
<a-col :span="12">
<a-checkbox value="A"> A </a-checkbox>
</a-col>
<a-col :span="12">
<a-checkbox value="B"> B </a-checkbox>
</a-col>
<a-col :span="12">
<a-checkbox value="C"> 其他 </a-checkbox>
<a-col :span="12" v-for="(ques, indexNum) in e.optionVos" :key="indexNum">
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox>
</a-col>
{{ e.id }}
<a-col :span="100">
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
<a-input
v-if="
contentList.find(item => {
return (
item.testQuestionsId === e.id &&
item.contents.find(a => {
return a === '其他';
})
);
})
"
:style="{ width: 100, marginLeft: 10 }"
/>
</a-col>
</a-row>
</a-checkbox-group>
@ -184,7 +208,7 @@
<a-input v-if="value === 2"></a-input>
</div>
<div v-else-if="e.type === 11">
<a-checkbox-group @change="onChange">
<a-checkbox-group @change="onChange($event, e.type, e.id)">
<a-row>
<a-col :span="12">
<a-checkbox value="A"> A </a-checkbox>
@ -203,33 +227,33 @@
<!-- 当类型为12时为单选+关联 -->
<div v-else-if="e.type === 12">
<a-radio-group @change="onChange($event, e.type, e.id)">
<a-radio :style="radioStyle" value="1"> 高血压 </a-radio>
<a-radio :style="radioStyle" value="2"> 高血脂 </a-radio>
<a-radio :style="radioStyle" value="3"> 高血糖 </a-radio>
<a-radio :style="radioStyle" value="4">
<a-radio :style="radioStyle" :value="1"> 高血压 </a-radio>
<a-radio :style="radioStyle" :value="2"> 高血脂 </a-radio>
<a-radio :style="radioStyle" :value="3"> 高血糖 </a-radio>
<a-radio :style="radioStyle" :value="4">
其它
<a-input
v-if="contentList.find(item => (item.id - 0 === e.id - 0, item.content === '4'))"
:style="{ width: 100, marginLeft: 10 }"
/>
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
</a-radio>
</a-radio-group>
</div>
<div v-else-if="e.type === 13">数字输入框</div>
<div v-else-if="e.type === 13">
<a-input-number @change="onChange($event, e.type, e.id)" />
</div>
<div v-else-if="e.type === 14">图片识别</div>
</a-form-item>
</div>
</div>
</div>
<a-form-item class="d-flex flex-row-reverse">
<!-- <a-form-item class="d-flex flex-row-reverse">
<a-button class="white--text px-10" html-type="submit" type="primary">提交</a-button>
</a-form-item>
</a-form-item> -->
</a-form>
<a-button class="white--text px-10" type="primary" @click="setData()">提交</a-button>
</div>
</template>
<script>
import { queryAll } from 'config/api';
import { queryAll, saveCaseMes } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 9 },
@ -250,6 +274,7 @@ export default {
},
list: [],
contentList: [],
numList: [1, 2, 3, 4, 5],
};
},
async created() {
@ -274,6 +299,12 @@ export default {
}
},
methods: {
changeNum() {
const { numList } = this;
numList[0] = 5;
this.numList = [...numList];
console.log(this.numList[0]);
},
onChange(e, type, id) {
//
if (this.contentList.find(item => item.testQuestionsId === id)) {
@ -289,6 +320,7 @@ export default {
} else if (type === 4) {
//
alert('多选,没有这类的题,先参考多选+其他类型的题,那个有');
// this.forFn(id, e);
} else if (type === 5) {
//
this.forFn(id, e);
@ -300,12 +332,22 @@ export default {
alert('上传文件,先控下');
} else if (type === 8) {
// +
// console.log(e.target.value);
alert('暂时没有单选 + 其他类型的题,等导入题型之后再改');
console.log(e.target.value);
// alert(' + ');
} else if (type === 9) {
this.forFn(id, e);
// +
} else if (type === 10) {
// +
} else if (type === 11) {
// + +
this.forFn(id, e);
} else if (type === 12) {
// +
} else if (type === 13) {
//
} else if (type === 14) {
//
}
} else {
if (type === 1) {
@ -331,35 +373,61 @@ export default {
alert('上传文件,先控下');
} else if (type === 8) {
// +
// console.log(e.target.value);
alert('暂时没有单选 + 其他类型的题,等导入题型之后再改');
console.log(e.target.value);
// alert(' + ');
} else if (type === 9) {
this.failFn(id, e);
// +
} else if (type === 10) {
// +
} else if (type === 11) {
this.failFn(id, e);
}
}
},
// for
forFn(id, value) {
for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].id === id) {
this.contentList[i].contents = value;
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) {
// console.log(id, value);
let obj = {
testQuestionsId: id,
contents: value,
};
this.contentList.push(obj);
console.log(this.contentList);
},
//
handleSubmit() {
console.log(this.contentList);
async setData() {
try {
const params = {
param: {
list: this.contentList,
patientId: 1,
timeSlot: 123,
},
};
const res = await saveCaseMes(params);
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data);
} else {
console.log(msg);
}
} catch (error) {
this.$message.error('error');
}
},
},
};

Loading…
Cancel
Save