Browse Source

患者信息录入

master
aBin 4 years ago
parent
commit
3d331a469a
  1. 13
      package-lock.json
  2. 11
      src/config/api.js
  3. 11
      src/main.js
  4. 399
      src/views/PatientInfo/PatientInfo.vue

13
package-lock.json

@ -1,11 +1,10 @@
{ {
"name": "中医药大学课题数据库", "name": "chinese-medicine",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "中医药大学课题数据库",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"ant-design-vue": "^1.2.4", "ant-design-vue": "^1.2.4",
@ -21206,9 +21205,9 @@
} }
}, },
"dompurify": { "dompurify": {
"version": "2.2.6", "version": "2.2.3",
"resolved": "https://registry.npm.taobao.org/dompurify/download/dompurify-2.2.6.tgz", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.3.tgz",
"integrity": "sha1-VJRdxcC0XOWuIocFd36OWdey7cQ=" "integrity": "sha512-8Hv7Q0FuwD9rWoB6qI2eZsfKbGXfoUVuGHHrE15vgk4ReOKwOkSgbqb2OMFtc0d5besOEkoLkcyuV10zQ2X5gw=="
}, },
"domready": { "domready": {
"version": "1.0.8", "version": "1.0.8",
@ -28624,8 +28623,8 @@
}, },
"vue-dompurify-html": { "vue-dompurify-html": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npm.taobao.org/vue-dompurify-html/download/vue-dompurify-html-2.3.0.tgz", "resolved": "https://registry.npmjs.org/vue-dompurify-html/-/vue-dompurify-html-2.3.0.tgz",
"integrity": "sha1-sXXt2lc2LPewPShkRo+mROBaKtA=", "integrity": "sha512-Iz9wI4iiJF+rzC2x3r8quw/VXrkwgMsWXt9p0Le4wXtolBXwMDJOmK3QNMiNg36bzU2b0f3En/wjidoeRVNZ7A==",
"requires": { "requires": {
"dompurify": "^2.0.0" "dompurify": "^2.0.0"
} }

11
src/config/api.js

@ -1,8 +1,16 @@
/*
* @Author: wally
* @email: 18603454788@163.com
* @Date: 2021-01-29 11:16:27
* @LastEditors: wally
* @LastEditTime: 2021-02-18 14:23:31
*/
import axios from 'axios'; 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 patient = `${tcm}/patient`; // 患者相关接口 const patient = `${tcm}/patient`; // 患者相关接口
const imp = `${tcm}/import`; // 试题相关接口
// 保存患者病例信息 // 保存患者病例信息
export const saveCaseMes = params => axios.post(`${patient}/saveCaseMes`, params); export const saveCaseMes = params => axios.post(`${patient}/saveCaseMes`, params);
@ -18,3 +26,6 @@ export const selPatientMesList = params => axios.post(`${patient}/selPatientMesL
// 通过查询搜索条件 // 通过查询搜索条件
export const selSearchCriteriaList = params => axios.post(`${patient}/selSearchCriteriaList`, params); export const selSearchCriteriaList = params => axios.post(`${patient}/selSearchCriteriaList`, params);
// 试题相关接口:按code查看题目信息,code为空则查询全部
export const queryAll = params => axios.post(`${tcm}/question/queryAll`, params);

11
src/main.js

@ -1,3 +1,10 @@
/*
* @Author: wally
* @email: 18603454788@163.com
* @Date: 2021-01-29 11:16:27
* @LastEditors: wally
* @LastEditTime: 2021-02-04 17:47:01
*/
// @ts-ignore // @ts-ignore
import Vue from 'vue'; import Vue from 'vue';
import './plugins/axios'; import './plugins/axios';
@ -17,8 +24,8 @@ Vue.use(VueDOMPurifyHTML);
Vue.prototype.$echarts = echarts; Vue.prototype.$echarts = echarts;
// import './assets/icon/iconfont.css'; // import './assets/icon/iconfont.css';
// import VueDOMPurifyHTML from 'vue-dompurify-html'; // import VueDOMPurifyHTML from 'vue-dompurify-html';
// import moment from 'moment'; //导入文件 import moment from 'moment'; //导入文件
// Vue.prototype.$moment = moment; //赋值使用 Vue.prototype.$moment = moment; //赋值使用
Vue.config.productionTip = false; Vue.config.productionTip = false;
window.vm = new Vue({ window.vm = new Vue({

399
src/views/PatientInfo/PatientInfo.vue

@ -1,47 +1,226 @@
<template> <template>
<div class="flex-column"> <div class="flex-column">
<a-form :form="form" @submit="handleSubmit"> <a-form :form="form" @submit="handleSubmit">
<!-- 会议时间 --> <!-- 首先遍历整个data大数组 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <div v-for="(item, index) in list" :key="index">
<h2>凝血系列</h2> <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
</a-form-item> <!-- 一级大标题 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="XXXX"> <h2>{{ item.name }}</h2>
<a-input /> </a-form-item>
</a-form-item> <!-- 一级标题下的各种问题questionVos判断类型1-12展示不同需要填写的内容 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="XXXX"> <div v-for="a in item.questionVos" :key="a.name">
<a-textarea style="height: 100px" /> <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="a.question">
</a-form-item> <a-input v-if="a.type === 1" @change="onChange($event, a.type, a.id)" />
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="XXXX"> <a-textarea v-else-if="a.type === 2" style="height: 100px" @change="onChange($event, a.type, a.id)" />
<a-radio-group v-model="value" @change="onChange"> <a-radio-group v-else-if="a.type === 3" v-model="value" @change="onChange($event, a.type, a.id)">
<a-radio :style="radioStyle" :value="1"> 高血压 </a-radio> <a-radio :style="radioStyle" value="高血压"> 没有单选题 </a-radio>
<a-radio :style="radioStyle" :value="2"> 高血脂 </a-radio> <a-radio :style="radioStyle" value="高血脂"> 没有单选题 </a-radio>
<a-radio :style="radioStyle" :value="3"> 高血糖 </a-radio> <a-radio :style="radioStyle" value="高血糖"> 没有单选题 </a-radio>
<a-radio :style="radioStyle" :value="4"> </a-radio-group>
其它 <a-checkbox-group v-else-if="a.type === 4" @change="onChange($event, a.type, a.id)">
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" /> <a-row>
</a-radio> <a-col :span="8">
</a-radio-group> <a-checkbox value="A"> A </a-checkbox>
</a-form-item> </a-col>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <a-col :span="8">
<h2>血常规</h2> <a-checkbox value="B"> B </a-checkbox>
</a-form-item> </a-col>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="XXXX"> <a-col :span="8">
<a-input /> <a-checkbox value="C"> C </a-checkbox>
</a-form-item> </a-col>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="XXXX"> </a-row>
<a-textarea style="height: 100px" /> </a-checkbox-group>
</a-form-item> <a-select v-else-if="a.type === 5" default-value="lucy" style="width: 120px" loading @change="onChange($event, a.type, a.id)">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="XXXX"> <a-select-option value="1"> Lucy1 </a-select-option>
<a-radio-group v-model="value" @change="onChange"> <a-select-option value="2"> Lucy2 </a-select-option>
<a-radio :style="radioStyle" :value="1"> 高血压 </a-radio> <a-select-option value="3"> Lucy3 </a-select-option>
<a-radio :style="radioStyle" :value="2"> 高血脂 </a-radio> <a-select-option value="4"> Lucy4 </a-select-option>
<a-radio :style="radioStyle" :value="3"> 高血糖 </a-radio> </a-select>
<a-radio :style="radioStyle" :value="4"> <a-date-picker show-time placeholder="日期时间选择" v-else-if="a.type === 6" @change="onChange($event, a.type, a.id)" />
其它 <a-upload v-else-if="a.type === 7">
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" /> <img v-if="imageUrl" :src="imageUrl" alt="avatar" />
</a-radio> <div v-else>
</a-radio-group> <a-icon :type="loading ? 'loading' : 'plus'" />
</a-form-item> <div class="ant-upload-text">Upload</div>
</div>
</a-upload>
<a-radio-group v-else-if="a.type === 8" v-model="value" @change="onChange($event, a.type, a.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-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>
<a-col :span="100">
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="a.type === 10">
<a-select default-value="lucy" style="width: 120px" loading>
<a-select-option value="1"> 1 </a-select-option>
<a-select-option value="2"> 2 </a-select-option>
</a-select>
<a-input v-if="value === 2"></a-input>
</div>
<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>
<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>
</a-row>
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
说明 <a-input :style="{ width: 100, marginLeft: 10 }" />
</a-checkbox-group>
</div>
<!-- 当类型为12时为单选+关联 -->
<div v-else-if="a.type === 12">
<a-radio-group @change="onChange($event, a.type, a.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-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
</a-radio>
</a-radio-group>
</div>
<div v-else-if="a.type === 13">
<a-input-number @change="onChange($event, a.type, a.id)" />
</div>
<div v-else-if="a.type === 14">图片识别</div>
</a-form-item>
</div>
<!-- 一级标题下的各种二级标题subReportCodes -->
<div v-for="c in item.subReportCodes" :key="c.name">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<!-- 二级大标题 -->
<h3>{{ c.name }}</h3>
</a-form-item>
<!-- 二级标题下的各种类型 -->
<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-radio-group>
<a-checkbox-group v-else-if="e.type === 4" @change="onChange">
<a-row>
<a-col :span="8">
<a-checkbox value="A"> A </a-checkbox>
</a-col>
<a-col :span="8">
<a-checkbox value="B"> B </a-checkbox>
</a-col>
<a-col :span="8">
<a-checkbox value="C"> C </a-checkbox>
</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>
<a-date-picker v-else-if="e.type === 6" />
<a-upload v-else-if="e.type === 7">
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<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 :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-radio-group>
<a-checkbox-group v-else-if="e.type === 9" @change="onChange">
<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>
<a-col :span="100">
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
</a-col>
</a-row>
</a-checkbox-group>
<div v-else-if="e.type === 10">
<a-select default-value="lucy" style="width: 120px" loading>
<a-select-option value="1"> 1 </a-select-option>
<a-select-option value="2"> 2 </a-select-option>
</a-select>
<a-input v-if="value === 2"></a-input>
</div>
<div v-else-if="e.type === 11">
<a-checkbox-group @change="onChange">
<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>
</a-row>
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
说明 <a-input :style="{ width: 100, marginLeft: 10 }" />
</a-checkbox-group>
</div>
<!-- 当类型为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-input
v-if="contentList.find(item => (item.id - 0 === e.id - 0, item.content === '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 === 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-button class="white--text px-10" html-type="submit" type="primary">提交</a-button>
</a-form-item> </a-form-item>
@ -50,9 +229,10 @@
</template> </template>
<script> <script>
import { queryAll } from 'config/api';
const formItemLayout = { const formItemLayout = {
labelCol: { span: 4 }, labelCol: { span: 6 },
wrapperCol: { span: 18 }, wrapperCol: { span: 9 },
}; };
const tailItemLayout = { wrapperCol: { span: 18, offset: 4 } }; const tailItemLayout = { wrapperCol: { span: 18, offset: 4 } };
export default { export default {
@ -68,35 +248,118 @@ export default {
height: '30px', height: '30px',
lineHeight: '30px', lineHeight: '30px',
}, },
list: [],
contentList: [],
}; };
}, },
async created() {
try {
const params = {
param: {
code: '',
// id: 0,
// nums: 0,
},
};
const res = await queryAll(params);
const { code, data, msg } = res.data;
if (code === 200) {
// console.log(data);
this.list = data;
} else {
console.log(msg);
}
} catch (error) {
console.log(error);
}
},
methods: { methods: {
onChange(e) { onChange(e, type, id) {
console.log('radio checked', e.target.value); //
if (this.contentList.find(item => item.testQuestionsId === id)) {
if (type === 1) {
//
this.forFn(id, e.target.value);
} else if (type === 2) {
//
this.forFn(id, e.target.value);
} else if (type === 3) {
//
this.forFn(id, e.target.value);
} else if (type === 4) {
//
alert('多选,没有这类的题,先参考多选+其他类型的题,那个有');
} else if (type === 5) {
//
this.forFn(id, e);
} else if (type === 6) {
// 2020-01-01 00:00:00
// console.log(this.$moment(e._d).format('YYYY-MM-DD HH:mm:ss'));
this.forFn(id, this.$moment(e._d).format('YYYY-MM-DD HH:mm:ss'));
} else if (type === 7) {
alert('上传文件,先控下');
} else if (type === 8) {
// +
// console.log(e.target.value);
alert('暂时没有单选 + 其他类型的题,等导入题型之后再改');
} else if (type === 9) {
// +
} else if (type === 10) {
// +
}
} else {
if (type === 1) {
//
this.failFn(id, e.target.value);
} else if (type === 2) {
//
this.failFn(id, e.target.value);
} else if (type === 3) {
//
this.failFn(id, e.target.value);
} else if (type === 4) {
//
alert('多选,没有这类的题,先参考多选+其他类型的题,那个有');
} else if (type === 5) {
//
this.failFn(id, e);
} else if (type === 6) {
// 2020-01-01 00:00:00
// console.log(this.$moment(e._d).format('YYYY-MM-DD HH:mm:ss'));
this.failFn(id, this.$moment(e._d).format('YYYY-MM-DD HH:mm:ss'));
} else if (type === 7) {
alert('上传文件,先控下');
} else if (type === 8) {
// +
// console.log(e.target.value);
alert('暂时没有单选 + 其他类型的题,等导入题型之后再改');
} else if (type === 9) {
// +
} else if (type === 10) {
// +
}
}
}, },
// // for
handleSubmit(e) { forFn(id, value) {
e.preventDefault(); for (let i = 0; i < this.contentList.length; i++) {
this.form.validateFieldsAndScroll(async (err, values) => { if (this.contentList[i].id === id) {
if (!err) { this.contentList[i].contents = value;
try { break;
// const param = values;
// const params = { param };
// console.log('params: ', params);
// const res = await addPage(params);
// const { data, msg, code } = res.data;
// this.$emit('closeModal');
// if (code === 200) {
// this.$message.success('');
// } else {
// throw msg;
// }
} catch (error) {
// this.$message.error(error || '');
}
} }
}); }
},
//
failFn(id, value) {
let obj = {
testQuestionsId: id,
contents: value,
};
this.contentList.push(obj);
},
//
handleSubmit() {
console.log(this.contentList);
}, },
}, },
}; };

Loading…
Cancel
Save