Browse Source

生物添加相关接口

master
aBin 4 years ago
parent
commit
b1f5054e5c
  1. 9
      src/components/BiologicalSampleSearch/SampleTable.vue
  2. 72
      src/views/BiologicalSamples/BiologicalSamples.vue

9
src/components/BiologicalSampleSearch/SampleTable.vue

@ -7,7 +7,7 @@
:data-source="lists.list"
:loading="loading"
:pagination="pagination"
:row-key="record => record.id"
:row-key="record => record.hospitalization"
@change="handleTableChange"
bordered
class="white pa-3"
@ -28,13 +28,6 @@
import { mapMutations, mapState } from 'vuex';
const columns = [
{
title: '患者Id',
align: 'center',
dataIndex: 'patientInformationId',
key: 'patientInformationId',
scopedSlots: { customRender: 'patientInformationId' },
},
{
title: '医院',
align: 'center',

72
src/views/BiologicalSamples/BiologicalSamples.vue

@ -4,11 +4,7 @@
<a-card :bordered="false" title="生物样本">
<a-form :form="form" @submit="handleSubmit">
<!-- 住院号 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="住院号"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="住院号">
<a-input
placeholder="住院号"
v-decorator="[
@ -24,30 +20,14 @@
/>
</a-form-item>
<!-- 样本类型 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="样本类型"
>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="样本类型">
<a-select placeholder="请选择样本类型" style="min-width: 150px" v-decorator="['sampleType']">
<a-select-option
:key="item.id"
:value="item.id"
v-for="item in types"
>{{ item.title }}</a-select-option>
<a-select-option :key="item.id" :value="item.id" v-for="item in types">{{ item.title }}</a-select-option>
</a-select>
</a-form-item>
<!-- 样本类型 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="样本类型"
>
<a-select
placeholder="请选择采集时间"
style="min-width: 150px"
v-decorator="['acquisitionTime']"
>
<a-form-item :label-col="formItemLayout.labelCol" :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>
</a-form-item>
@ -62,6 +42,7 @@
</template>
<script>
import { addBiologicalSamples } from 'config/api';
const formItemLayout = {
labelCol: { span: 4 },
wrapperCol: { span: 18 },
@ -77,33 +58,33 @@ export default {
inpatientNumber: '', //
types: [
{
id: 1,
id: 0,
title: '抗血凝10ml',
},
{
id: 2,
id: 1,
title: '促凝血5ml',
},
{
id: 3,
id: 2,
title: '晨尿10ml',
},
{
id: 4,
id: 3,
title: '24小时尿10ml',
},
],
acquisitionTime: [
{
id: 1,
id: 0,
title: '0天',
},
{
id: 2,
id: 14,
title: '14天',
},
{
id: 3,
id: 90,
title: '90天',
},
],
@ -117,19 +98,22 @@ export default {
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
// 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;
// }
const param = {
sampleType: values.sampleType,
hospitalization: values.inpatientNumber,
collectTime: values.acquisitionTime,
};
const params = { param };
const res = await addBiologicalSamples(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 || '');
this.$message.error(error || '添加失败');
}
}
});

Loading…
Cancel
Save