Browse Source

生物添加相关接口

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

9
src/components/BiologicalSampleSearch/SampleTable.vue

@ -7,7 +7,7 @@
: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"
@ -28,13 +28,6 @@
import { mapMutations, mapState } from 'vuex'; import { mapMutations, mapState } from 'vuex';
const columns = [ const columns = [
{
title: '患者Id',
align: 'center',
dataIndex: 'patientInformationId',
key: 'patientInformationId',
scopedSlots: { customRender: 'patientInformationId' },
},
{ {
title: '医院', title: '医院',
align: 'center', align: 'center',

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