|
|
@ -4,50 +4,30 @@ |
|
|
|
<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="[ |
|
|
|
'inpatientNumber', |
|
|
|
{ |
|
|
|
rules: [ |
|
|
|
{ required: true, message: '住院号不能为空' }, |
|
|
|
{ whitespace: true, message: '住院号不能为空' }, |
|
|
|
{ max: 140, massage: '住院号最多140个字符' }, |
|
|
|
], |
|
|
|
}, |
|
|
|
]" |
|
|
|
'inpatientNumber', |
|
|
|
{ |
|
|
|
rules: [ |
|
|
|
{ required: true, message: '住院号不能为空' }, |
|
|
|
{ whitespace: true, message: '住院号不能为空' }, |
|
|
|
{ max: 140, massage: '住院号最多140个字符' }, |
|
|
|
], |
|
|
|
}, |
|
|
|
]" |
|
|
|
/> |
|
|
|
</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 || '添加失败'); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|