中医药大学课题数据库系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

74 lines
1.9 KiB

<template>
<!-- search -->
<div>
<div class="d-flex flex-row flex-nowrap">
<a-form
:form="form"
@submit="handleSubmit"
class="d-flex flex-nowrap align-center"
layout="inline"
>
<a-form-item>
<a-input placeholder="住院号" style="width: 14em" v-decorator="['inpatientNumber']" />
</a-form-item>
<a-form-item>
<a-select placeholder="请选择对照组" style="min-width: 150px" v-decorator="['groupValue']">
<a-select-option
:key="item.id"
:value="item.id"
v-for="item in controlGroups"
>{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<a-button class="mr-4" html-type="submit" icon="search" type="primary">搜索</a-button>
</a-form>
<div class="flex-1"></div>
<a-button @click="showModal" html-type="submit" icon="plus" type="primary">新增</a-button>
</div>
<patient-add :visible="visible" @closeModal="closeModal" @searchMes="searchMes" />
</div>
</template>
<script>
import { mapState } from 'vuex';
import PatientAdd from 'components/PatientInfo/PatientAdd.vue';
export default {
name: 'Search',
components: { PatientAdd },
data() {
return {
form: this.$form.createForm(this, { name: 'search' }),
visible: false,
};
},
computed: mapState('home', ['controlGroups']),
methods: {
showModal() {
this.visible = true;
},
closeModal() {
this.visible = false;
},
// 提交
handleSubmit(e) {
e.preventDefault();
this.form.validateFields(async (err, values) => {
if (!err) {
console.log('values: ', values);
this.$emit('searchPatientMes', values);
}
});
},
// 加入成功后再次查询
searchMes() {
this.$emit('searchPatientMes');
},
},
};
</script>