Browse Source

解决冲突

master
lucky 4 years ago
parent
commit
5589dd01f8
  1. 31
      src/components/BiologicalSampleSearch/SampleTable.vue
  2. 33
      src/components/BiologicalSampleSearch/Search.vue
  3. 28
      src/components/Echarts/Categorymap.vue
  4. 23
      src/components/Echarts/Cisualmap.vue
  5. 9
      src/config/api.js
  6. 39
      src/views/BiologicalSampleSearch/BiologicalSampleSearch.vue
  7. 90
      src/views/BiologicalSamples/BiologicalSamples.vue

31
src/components/BiologicalSampleSearch/SampleTable.vue

@ -1,19 +1,22 @@
<template> <template>
<div> <div>
<!-- search --> <!-- search -->
<div style="width:100%" v-if="lists && lists.list && lists.list.length > 0"> <div style="width: 100%" v-if="lists && lists.list && lists.list.length > 0">
<a-table <a-table
:columns="columns" :columns="columns"
:data-source="lists.list" :data-source="lists.list"
:loading="loading" :loading="loading"
:pagination="pagination" :pagination="pagination"
:row-key="record => record.id" :row-key="record => record.hospitalization"
@change="handleTableChange" @change="handleTableChange"
bordered bordered
class="white pa-3" class="white pa-3"
> >
<template slot="id" slot-scope="text, record, index"> <template slot="sampleType" slot-scope="text, record">
<span>{{ index + 1 }}</span> <span v-if="record.sampleType === 0">抗血凝10ml</span>
<span v-else-if="record.sampleType === 1">促凝血5ml</span>
<span v-else-if="record.sampleType === 2">晨尿10ml</span>
<span v-else-if="record.sampleType === 3">24小时尿10ml</span>
</template> </template>
</a-table> </a-table>
</div> </div>
@ -25,18 +28,11 @@
import { mapMutations, mapState } from 'vuex'; import { mapMutations, mapState } from 'vuex';
const columns = [ const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
scopedSlots: { customRender: 'id' },
},
{ {
title: '医院', title: '医院',
align: 'center', align: 'center',
dataIndex: 'hospital', dataIndex: 'name',
key: 'hospital', key: 'name',
}, },
{ {
title: '住院号', title: '住院号',
@ -47,14 +43,15 @@ const columns = [
{ {
title: '类型', title: '类型',
align: 'center', align: 'center',
dataIndex: 'type', dataIndex: 'sampleType',
key: 'type', key: 'sampleType',
scopedSlots: { customRender: 'sampleType' },
}, },
{ {
title: '采集时间', title: '采集时间',
align: 'center', align: 'center',
dataIndex: 'acquisitionTime', dataIndex: 'collectTime',
key: 'acquisitionTime', key: 'collectTime',
}, },
]; ];

33
src/components/BiologicalSampleSearch/Search.vue

@ -2,19 +2,10 @@
<!-- search --> <!-- search -->
<div> <div>
<div class="d-flex flex-row flex-nowrap"> <div class="d-flex flex-row flex-nowrap">
<a-form <a-form :form="form" @submit="handleSubmit" class="d-flex flex-nowrap align-center" layout="inline">
:form="form"
@submit="handleSubmit"
class="d-flex flex-nowrap align-center"
layout="inline"
>
<a-form-item> <a-form-item>
<a-select placeholder="请选择医院" style="min-width: 150px" v-decorator="['hospital']"> <a-select placeholder="请选择医院" style="min-width: 150px" v-decorator="['hospital']">
<a-select-option <a-select-option :key="item.id" :value="item.id" v-for="item in hospitals">{{ item.title }}</a-select-option>
:key="item.id"
:value="item.id"
v-for="item in hospitals"
>{{ item.title }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
@ -26,11 +17,7 @@
<a-input placeholder="患者住院号" style="width: 14em" v-decorator="['inpatientNumber']" /> <a-input placeholder="患者住院号" style="width: 14em" v-decorator="['inpatientNumber']" />
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-select <a-select placeholder="请选择采集时间" style="min-width: 150px" v-decorator="['acquisitionTime']">
placeholder="请选择采集时间"
style="min-width: 150px"
v-decorator="['acquisitionTime']"
>
<a-select-option :key="t.id" :value="t.id" v-for="t in acquisitionTime">{{ t.title }}</a-select-option> <a-select-option :key="t.id" :value="t.id" v-for="t in acquisitionTime">{{ t.title }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
@ -67,33 +54,33 @@ export default {
], ],
types: [ types: [
{ {
id: 1, id: 0,
title: '抗血凝10ml', title: '抗血凝10ml',
}, },
{ {
id: 2, id: 1,
title: '促凝血5ml', title: '促凝血5ml',
}, },
{ {
id: 3, id: 2,
title: '晨尿10ml', title: '晨尿10ml',
}, },
{ {
id: 4, id: 3,
title: '24小时尿10ml', title: '24小时尿10ml',
}, },
], ],
acquisitionTime: [ acquisitionTime: [
{ {
id: 1, id: 0,
title: '0天', title: '0天',
}, },
{ {
id: 2, id: 14,
title: '14天', title: '14天',
}, },
{ {
id: 3, id: 90,
title: '90天', title: '90天',
}, },
], ],

28
src/components/Echarts/Categorymap.vue

@ -3,7 +3,7 @@
* @email: 18603454788@163.com * @email: 18603454788@163.com
* @Date: 2021-01-29 14:45:02 * @Date: 2021-01-29 14:45:02
* @LastEditors: wally * @LastEditors: wally
* @LastEditTime: 2021-01-29 18:20:26 * @LastEditTime: 2021-02-19 15:50:23
--> -->
<template> <template>
<!-- <div>数据统计组件</div> --> <!-- <div>数据统计组件</div> -->
@ -12,6 +12,7 @@
</div> </div>
</template> </template>
<script> <script>
import { countAnalysis } from 'config/api';
export default { export default {
name: 'Categorymap', name: 'Categorymap',
data() { data() {
@ -20,6 +21,7 @@ export default {
width: '', width: '',
height: '', height: '',
timer: null, timer: null,
list: [],
}; };
}, },
mounted() { mounted() {
@ -192,6 +194,30 @@ export default {
}; };
myChart.setOption(option); myChart.setOption(option);
}, },
async getData() {
try {
const params = {
param: {
conditionList: [],
conditionListDate: [],
hospitalId: '',
hospitalization: '',
inpatientId: '',
inputStatus: '',
testQuestionsId: '',
},
};
const res = await countAnalysis(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.list = data;
} else {
console.log(msg);
}
} catch (error) {
this.$message.error('获取数据失败');
}
},
}, },
}; };
</script> </script>

23
src/components/Echarts/Cisualmap.vue

@ -6,6 +6,7 @@
</div> </div>
</template> </template>
<script> <script>
import { countCase } from 'config/api';
export default { export default {
name: 'Cisualmap', name: 'Cisualmap',
data() { data() {
@ -14,6 +15,7 @@ export default {
width: '', width: '',
height: '', height: '',
timer: null, timer: null,
list: [],
}; };
}, },
mounted() { mounted() {
@ -86,6 +88,27 @@ export default {
myChart1.setOption(option1); myChart1.setOption(option1);
myChart2.setOption(option2); myChart2.setOption(option2);
}, },
async getData() {
try {
const params = {
param: {
endDate: '',
hospitalId: '',
startDate: '',
userId: '',
},
};
const res = await countCase(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.list = data;
} else {
console.log(msg);
}
} catch (error) {
this.$message.error('获取数据失败');
}
},
}, },
}; };
</script> </script>

9
src/config/api.js

@ -3,7 +3,7 @@
* @email: 18603454788@163.com * @email: 18603454788@163.com
* @Date: 2021-01-29 11:16:27 * @Date: 2021-01-29 11:16:27
* @LastEditors: wally * @LastEditors: wally
* @LastEditTime: 2021-02-18 16:20:23 * @LastEditTime: 2021-02-19 18:01:03
*/ */
import axios from 'axios'; import axios from 'axios';
let { proxyUrl, msgUrl } = require('@/config/setting'); let { proxyUrl, msgUrl } = require('@/config/setting');
@ -14,6 +14,7 @@ const imp = `${tcm}/import`; // 试题相关接口
const inpatient = `${tcm}/inpatient`; // 对照组接口 const inpatient = `${tcm}/inpatient`; // 对照组接口
const statistics = `${tcm}/statistics`; // 数据统计相关接口 const statistics = `${tcm}/statistics`; // 数据统计相关接口
const conferenceRecords = `${tcm}/conferenceRecords`; // 会议纪要相关接口 const conferenceRecords = `${tcm}/conferenceRecords`; // 会议纪要相关接口
const biologicalSamples = `${tcm}/biologicalSamples`; // 生物样本相关接口
// 保存患者病例信息 // 保存患者病例信息
export const saveCaseMes = params => axios.post(`${patient}/saveCaseMes`, params); export const saveCaseMes = params => axios.post(`${patient}/saveCaseMes`, params);
@ -52,3 +53,9 @@ export const getConRec = params => axios.post(`${conferenceRecords}/get`, params
// 分享会议记录 // 分享会议记录
export const shareConRec = params => axios.post(`${conferenceRecords}/share`, params); export const shareConRec = params => axios.post(`${conferenceRecords}/share`, params);
// 添加生物样本
export const addBiologicalSamples = params => axios.post(`${biologicalSamples}/addBiologicalSamples`, params);
// 搜索生物样本
export const selBiologicalSamples = params => axios.post(`${biologicalSamples}/selBiologicalSamples`, params);

39
src/views/BiologicalSampleSearch/BiologicalSampleSearch.vue

@ -1,3 +1,10 @@
<!--
* @Author: wally
* @email: 18603454788@163.com
* @Date: 2021-02-19 16:04:48
* @LastEditors: wally
* @LastEditTime: 2021-02-19 17:59:27
-->
<template> <template>
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<search @searchPatientMes="searchPatientMes" /> <search @searchPatientMes="searchPatientMes" />
@ -8,7 +15,7 @@
<script> <script>
import Search from 'components/BiologicalSampleSearch/Search.vue'; import Search from 'components/BiologicalSampleSearch/Search.vue';
import SampleTable from 'components/BiologicalSampleSearch/SampleTable.vue'; import SampleTable from 'components/BiologicalSampleSearch/SampleTable.vue';
import { selPatientMes } from 'config/api'; import { selBiologicalSamples } from 'config/api';
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
export default { export default {
@ -17,8 +24,11 @@ export default {
data() { data() {
return { return {
lists: { pageNum: 1, pageSize: 10, total: 1, list: [] }, lists: { pageNum: 1, pageSize: 10, total: 1, list: [] },
hospitalization: '', collectTime: '', //
inpatientId: '', hospitalId: '', // id
hospitalization: '', //
pageNum: 1, //
sampleType: '', //
}; };
}, },
@ -32,24 +42,31 @@ export default {
searchPatientMes(value) { searchPatientMes(value) {
if (value) { if (value) {
this.hospitalId = value.hospital;
this.collectTime = value.acquisitionTime;
this.hospitalization = value.inpatientNumber; this.hospitalization = value.inpatientNumber;
this.inpatientId = value.groupValue; this.sampleType = value.sampleType;
} }
this.handleSelPatientMes(); this.handleSelPatientMes();
}, },
async handleSelPatientMes(pageNum = 1) { async handleSelPatientMes(current) {
try { try {
const { hospitalization, inpatientId } = this; if (current) {
this.pageNum = current;
}
const { collectTime, hospitalId, hospitalization, pageNum, sampleType } = this;
const params = { const params = {
param: { param: {
hospitalization, collectTime: collectTime, //
inpatientId, hospitalId: hospitalId, // id
pageNum, hospitalization: hospitalization, //
pageSize: 10, pageNum: pageNum, //
pageSize: 10, //
sampleType: sampleType, //
}, },
}; };
const res = await selPatientMes(params); const res = await selBiologicalSamples(params);
const { code, msg, data } = res.data; const { code, msg, data } = res.data;
if (code === 200) { if (code === 200) {
this.lists = data; this.lists = data;

90
src/views/BiologicalSamples/BiologicalSamples.vue

@ -4,50 +4,30 @@
<a-card :bordered="false" title="生物样本"> <a-card :bordered="false" title="生物样本">
<a-form :form="form" @submit="handleSubmit"> <a-form :form="form" @submit="handleSubmit">
<!-- 住院号 --> <!-- 住院号 -->
<a-form-item <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="住院号">
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="住院号"
>
<a-input <a-input
placeholder="住院号" placeholder="住院号"
v-decorator="[ v-decorator="[
'inpatientNumber', 'inpatientNumber',
{ {
rules: [ rules: [
{ required: true, message: '住院号不能为空' }, { required: true, message: '住院号不能为空' },
{ whitespace: true, message: '住院号不能为空' }, { whitespace: true, message: '住院号不能为空' },
{ max: 140, massage: '住院号最多140个字符' }, { max: 140, massage: '住院号最多140个字符' },
], ],
}, },
]" ]"
/> />
</a-form-item> </a-form-item>
<!-- 样本类型 --> <!-- 样本类型 -->
<a-form-item <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="样本类型">
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="样本类型"
>
<a-select placeholder="请选择样本类型" style="min-width: 150px" v-decorator="['sampleType']"> <a-select placeholder="请选择样本类型" style="min-width: 150px" v-decorator="['sampleType']">
<a-select-option <a-select-option :key="item.id" :value="item.id" v-for="item in types">{{ item.title }}</a-select-option>
:key="item.id"
:value="item.id"
v-for="item in types"
>{{ item.title }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<!-- 样本类型 --> <!-- 样本类型 -->
<a-form-item <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="采集时间">
:label-col="formItemLayout.labelCol" <a-select placeholder="请选择采集时间" style="min-width: 150px" v-decorator="['acquisitionTime']">
:wrapper-col="formItemLayout.wrapperCol"
label="样本类型"
>
<a-select
placeholder="请选择采集时间"
style="min-width: 150px"
v-decorator="['acquisitionTime']"
>
<a-select-option :key="t.id" :value="t.id" v-for="t in acquisitionTime">{{ t.title }}</a-select-option> <a-select-option :key="t.id" :value="t.id" v-for="t in acquisitionTime">{{ t.title }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
@ -62,6 +42,7 @@
</template> </template>
<script> <script>
import { addBiologicalSamples } from 'config/api';
const formItemLayout = { const formItemLayout = {
labelCol: { span: 4 }, labelCol: { span: 4 },
wrapperCol: { span: 18 }, wrapperCol: { span: 18 },
@ -77,33 +58,33 @@ export default {
inpatientNumber: '', // inpatientNumber: '', //
types: [ types: [
{ {
id: 1, id: 0,
title: '抗血凝10ml', title: '抗血凝10ml',
}, },
{ {
id: 2, id: 1,
title: '促凝血5ml', title: '促凝血5ml',
}, },
{ {
id: 3, id: 2,
title: '晨尿10ml', title: '晨尿10ml',
}, },
{ {
id: 4, id: 3,
title: '24小时尿10ml', title: '24小时尿10ml',
}, },
], ],
acquisitionTime: [ acquisitionTime: [
{ {
id: 1, id: 0,
title: '0天', title: '0天',
}, },
{ {
id: 2, id: 14,
title: '14天', title: '14天',
}, },
{ {
id: 3, id: 90,
title: '90天', title: '90天',
}, },
], ],
@ -117,19 +98,22 @@ export default {
this.form.validateFieldsAndScroll(async (err, values) => { this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) { if (!err) {
try { try {
// const param = values; const param = {
// const params = { param }; sampleType: values.sampleType,
// console.log('params: ', params); hospitalization: values.inpatientNumber,
// const res = await addPage(params); collectTime: values.acquisitionTime,
// const { data, msg, code } = res.data; };
// this.$emit('closeModal'); const params = { param };
// if (code === 200) { const res = await addBiologicalSamples(params);
// this.$message.success(''); const { data, msg, code } = res.data;
// } else { this.$emit('closeModal');
// throw msg; if (code === 200) {
// } this.$message.success('添加成功');
} else {
throw msg;
}
} catch (error) { } catch (error) {
// this.$message.error(error || ''); this.$message.error(error || '添加失败');
} }
} }
}); });

Loading…
Cancel
Save