4 changed files with 250 additions and 3 deletions
@ -0,0 +1,137 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<!-- search --> |
||||
|
<div style="width:100%" v-if="lists && lists.list && lists.list.length > 0"> |
||||
|
<a-table |
||||
|
:columns="columns" |
||||
|
:data-source="lists.list" |
||||
|
:loading="loading" |
||||
|
:pagination="pagination" |
||||
|
:row-key="record => record.id" |
||||
|
@change="handleTableChange" |
||||
|
bordered |
||||
|
class="white pa-3" |
||||
|
> |
||||
|
<template slot="id" slot-scope="text, record, index"> |
||||
|
<span>{{ index + 1 }}</span> |
||||
|
</template> |
||||
|
|
||||
|
<template slot="inputStatus" slot-scope="text, record"> |
||||
|
<span> |
||||
|
{{ record.inputStatus === 0 ? '新建' |
||||
|
: record.inputStatus === 1 ? '数据搜集中' |
||||
|
: record.inputStatus === 2 ? '数据搜集完成' |
||||
|
: record.inputStatus === 3 ? '数据搜集超时' |
||||
|
: '废弃' }} |
||||
|
</span> |
||||
|
</template> |
||||
|
|
||||
|
<template slot="edit" slot-scope="text, record"> |
||||
|
<a-button @click="chooseItem(record.id)" class="ml-4" size="small" type="primary">选择</a-button> |
||||
|
</template> |
||||
|
</a-table> |
||||
|
</div> |
||||
|
<a-empty v-else /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
const columns = [ |
||||
|
{ |
||||
|
title: '序号', |
||||
|
align: 'center', |
||||
|
dataIndex: 'id', |
||||
|
key: 'id', |
||||
|
scopedSlots: { customRender: 'id' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '住院号', |
||||
|
align: 'center', |
||||
|
dataIndex: 'hospitalization', |
||||
|
key: 'hospitalization', |
||||
|
}, |
||||
|
{ |
||||
|
title: '对照组', |
||||
|
align: 'center', |
||||
|
dataIndex: 'inpatientId', |
||||
|
key: 'inpatientId', |
||||
|
}, |
||||
|
{ |
||||
|
title: '状态', |
||||
|
align: 'center', |
||||
|
dataIndex: 'inputStatus', |
||||
|
key: 'inputStatus', |
||||
|
scopedSlots: { customRender: 'inputStatus' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '编辑', |
||||
|
align: 'center', |
||||
|
dataIndex: 'edit', |
||||
|
key: 'edit', |
||||
|
width: 200, |
||||
|
scopedSlots: { customRender: 'edit' }, |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
export default { |
||||
|
name: 'PatientTable', |
||||
|
|
||||
|
props: { lists: { type: Object, default: null } }, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
columns, |
||||
|
loading: false, |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
computed: { |
||||
|
pagination() { |
||||
|
const { pageNum, pageSize, total } = this.lists; |
||||
|
return { |
||||
|
current: pageNum, |
||||
|
pageSize, |
||||
|
total: +total, |
||||
|
}; |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 选择病患 |
||||
|
chooseItem() { |
||||
|
console.log(); |
||||
|
}, |
||||
|
|
||||
|
handleTableChange(pagination) { |
||||
|
const { current } = pagination; |
||||
|
this.$emit('handleSelPatientMes', current); |
||||
|
}, |
||||
|
|
||||
|
// 查询患者基本信息 |
||||
|
// async handleSelPatientMes(pageNum = 1) { |
||||
|
// try { |
||||
|
// const params = { |
||||
|
// param: { |
||||
|
// hospitalization: '', |
||||
|
// id: 0, |
||||
|
// inpatientId: '', |
||||
|
// inputStatus: 0, |
||||
|
// pageNum, |
||||
|
// pageSize: 10, |
||||
|
// }, |
||||
|
// }; |
||||
|
// const res = await selPatientMes(params); |
||||
|
// const { code, msg, data } = res.data; |
||||
|
// if (code === 200) { |
||||
|
// this.lists = data; |
||||
|
// } else { |
||||
|
// this.$message.error(msg || '查询失败'); |
||||
|
// throw msg; |
||||
|
// } |
||||
|
// } catch (error) { |
||||
|
// throw new Error(`CaseSearch.vue method selSearchCriteriaList: ${error}`); |
||||
|
// } |
||||
|
// }, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
@ -0,0 +1,59 @@ |
|||||
|
<template> |
||||
|
<!-- search --> |
||||
|
<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 |
||||
|
@change="handleGroupChange" |
||||
|
class="flex-1" |
||||
|
v-decorator="['groupValue',{ initialValue: groupValue }]" |
||||
|
> |
||||
|
<a-select-option :key="item.id" :value="item.value" v-for="item in groups">{{ item.name }}</a-select-option> |
||||
|
</a-select> |
||||
|
</a-form-item> |
||||
|
<a-button class="mr-4" html-type="submit" icon="search" type="primary">搜索</a-button> |
||||
|
<div class="flex-1"></div> |
||||
|
<a-button html-type="submit" icon="plus" type="primary">新增</a-button> |
||||
|
</a-form> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'Search', |
||||
|
data() { |
||||
|
return { |
||||
|
form: this.$form.createForm(this, { name: 'search' }), |
||||
|
groups: [ |
||||
|
{ id: '1', value: '1', name: '对照组一' }, |
||||
|
{ id: '2', value: '2', name: '对照组二' }, |
||||
|
{ id: '3', value: '3', name: '对照组三' }, |
||||
|
], |
||||
|
groupValue: '对照组一', |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 选择对照组 |
||||
|
handleGroupChange(value) { |
||||
|
console.log('value: ', value); |
||||
|
}, |
||||
|
|
||||
|
// 提交 |
||||
|
handleSubmit(e) { |
||||
|
e.preventDefault(); |
||||
|
this.form.validateFields(async (err, values) => { |
||||
|
if (!err) { |
||||
|
this.$emit('searchPatientMes', values); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
Loading…
Reference in new issue