31 changed files with 1463 additions and 316 deletions
@ -0,0 +1,104 @@ |
|||
<template> |
|||
<div> |
|||
<!-- search --> |
|||
<div style="width: 100%" v-if="list && list.length > 0"> |
|||
<a-table |
|||
:columns="columns" |
|||
:data-source="list" |
|||
:loading="loading" |
|||
:pagination="false" |
|||
:row-key="record => record.hospitalization" |
|||
@change="handleTableChange" |
|||
bordered |
|||
class="white pa-3" |
|||
> |
|||
<template slot="sampleType" slot-scope="text, record"> |
|||
<span v-if="record.sampleType === 0">尿标本</span> |
|||
<span v-else-if="record.sampleType === 1">抗凝血标本</span> |
|||
</template> |
|||
<template slot="collectTime" slot-scope="text, record"> |
|||
<span>{{ record.collectTime }}天</span> |
|||
</template> |
|||
</a-table> |
|||
</div> |
|||
<a-empty v-else /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapMutations, mapState } from 'vuex'; |
|||
|
|||
const columns = [ |
|||
{ |
|||
title: '医院', |
|||
align: 'center', |
|||
dataIndex: 'name', |
|||
key: 'name', |
|||
}, |
|||
{ |
|||
title: '住院号', |
|||
align: 'center', |
|||
dataIndex: 'hospitalization', |
|||
key: 'hospitalization', |
|||
}, |
|||
{ |
|||
title: '研究编号', |
|||
align: 'center', |
|||
dataIndex: 'patientCode', |
|||
key: 'patientCode', |
|||
}, |
|||
// { |
|||
// title: '生物样本编号', |
|||
// align: 'center', |
|||
// dataIndex: 'code', |
|||
// key: 'code', |
|||
// }, |
|||
{ |
|||
title: '类型', |
|||
align: 'center', |
|||
dataIndex: 'sampleType', |
|||
key: 'sampleType', |
|||
scopedSlots: { customRender: 'sampleType' }, |
|||
}, |
|||
{ |
|||
title: '修改时间', |
|||
align: 'center', |
|||
dataIndex: 'updateAt', |
|||
key: 'updateAt', |
|||
scopedSlots: { customRender: 'updateAt' }, |
|||
}, |
|||
{ |
|||
title: '采集时间', |
|||
align: 'center', |
|||
dataIndex: 'collectTime', |
|||
scopedSlots: { customRender: 'collectTime' }, |
|||
}, |
|||
]; |
|||
|
|||
export default { |
|||
name: 'PatientTable', |
|||
|
|||
props: { list: { type: Array, default: () => [] } }, |
|||
|
|||
data() { |
|||
return { |
|||
columns, |
|||
loading: false, |
|||
}; |
|||
}, |
|||
|
|||
methods: { |
|||
...mapMutations('home', ['setPatientId']), |
|||
|
|||
// 选择病患 |
|||
chooseItem(id) { |
|||
this.setPatientId(id); |
|||
}, |
|||
|
|||
handleTableChange(pagination) { |
|||
const { current } = pagination; |
|||
this.$emit('handleSelPatientMes', current); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
@ -0,0 +1,285 @@ |
|||
<template> |
|||
<div class="flex-1 flex-wrap"> |
|||
<div style="width: 100%"> |
|||
<a-form :form="form" class="d-flex flex-nowrap align-center" layout="inline"> |
|||
<a-form-item> |
|||
<a-select placeholder="请选择医生" style="min-width: 120px" @change="changeDoctorId" allow-clear> |
|||
<a-select-option :key="item.id" :value="item.id" v-for="item in doctorList">{{ item.name }}</a-select-option> |
|||
</a-select> |
|||
</a-form-item> |
|||
<a-form-item> |
|||
<a-range-picker @change="changeTime"> |
|||
<template slot="dateRender" slot-scope="current"> |
|||
<div class="ant-calendar-date" :style="getCurrentStyle(current)"> |
|||
{{ current.date() }} |
|||
</div> |
|||
</template> |
|||
</a-range-picker> |
|||
</a-form-item> |
|||
<a-form-item> |
|||
<a-select placeholder="请选择状态" :default-value="recordStatus" style="min-width: 120px" @change="changeStatus" allow-clear> |
|||
<a-select-option :key="index" :value="index" v-for="(item, index) in status">{{ item }}</a-select-option> |
|||
</a-select> |
|||
</a-form-item> |
|||
<a-form-item> |
|||
<a-select placeholder="请选择组别" style="min-width: 360px" @change="changeInpatientId" allow-clear> |
|||
<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 @click="handleSearch" class="mr-4" html-type="submit" icon="search" type="primary">搜索</a-button> |
|||
</a-form> |
|||
<a-table |
|||
v-if="lists && lists.list && lists.list.length > 0" |
|||
:columns="columns" |
|||
:data-source="lists.list" |
|||
:loading="loading" |
|||
:pagination="pagination" |
|||
:row-key="record => record.id" |
|||
bordered |
|||
class="white pa-3 mt-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 |
|||
? '数据收集超时中' |
|||
: record.inputStatus === 4 |
|||
? '废弃' |
|||
: record.inputStatus === 5 |
|||
? '审核通过' |
|||
: '已结算' |
|||
}} |
|||
</span> |
|||
</template> |
|||
|
|||
<template slot="edit" slot-scope="text, record"> |
|||
<a-popconfirm placement="left" ok-text="确定" cancel-text="取消" @confirm="changeRecordStatus(record.id)"> |
|||
<template slot="title"> |
|||
<p>是否确定通过该患者记录</p> |
|||
</template> |
|||
<a-button v-if="record.inputStatus === 2" size="small" type="primary">审核通过</a-button> |
|||
</a-popconfirm> |
|||
|
|||
<a-button type="primary" size="small" class="ml-4" @click="details(record.id, record.hospitalization, record.code)"> |
|||
查看详情 |
|||
</a-button> |
|||
</template> |
|||
</a-table> |
|||
<a-empty v-else /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import { mapState, mapActions, mapMutations } from 'vuex'; |
|||
import { selPatientMes, upPatientMes } from 'config/api'; |
|||
const columns = [ |
|||
{ |
|||
title: '序号', |
|||
align: 'center', |
|||
dataIndex: 'id', |
|||
key: 'id', |
|||
scopedSlots: { customRender: 'id' }, |
|||
}, |
|||
{ |
|||
title: '研究编号', |
|||
align: 'center', |
|||
dataIndex: 'code', |
|||
key: 'code', |
|||
}, |
|||
{ |
|||
title: '住院号', |
|||
align: 'center', |
|||
dataIndex: 'hospitalization', |
|||
key: 'hospitalization', |
|||
}, |
|||
{ |
|||
title: '主治医生', |
|||
align: 'center', |
|||
dataIndex: 'doctorName', |
|||
key: 'doctorName', |
|||
}, |
|||
{ |
|||
title: '组别', |
|||
align: 'center', |
|||
dataIndex: 'name', |
|||
key: 'name', |
|||
}, |
|||
{ |
|||
title: '状态', |
|||
align: 'center', |
|||
dataIndex: 'inputStatus', |
|||
key: 'inputStatus', |
|||
scopedSlots: { customRender: 'inputStatus' }, |
|||
}, |
|||
{ |
|||
title: '编辑', |
|||
align: 'center', |
|||
dataIndex: 'edit', |
|||
key: 'edit', |
|||
width: 250, |
|||
scopedSlots: { customRender: 'edit' }, |
|||
}, |
|||
]; |
|||
export default { |
|||
name: 'Examine', |
|||
data() { |
|||
return { |
|||
str: '项目助理审核界面', |
|||
columns, |
|||
form: this.$form.createForm(this, { name: 'search' }), |
|||
loading: false, |
|||
visible: false, |
|||
lists: { pageNum: 1, pageSize: 10, total: 1, list: [] }, |
|||
codes: '', |
|||
pagination: { |
|||
current: 1, |
|||
pageSize: 10, |
|||
total: 0, |
|||
}, |
|||
hospitalization: '', |
|||
inpatientId: '', |
|||
statusModal: false, |
|||
recordStatus: 2, |
|||
status: ['新建', '数据搜集中', '数据搜集完成', '数据搜集超时', '废弃', '审核通过', '已结算'], |
|||
startTime: '', |
|||
endTime: '', |
|||
doctorId: '', |
|||
}; |
|||
}, |
|||
computed: mapState('home', ['controlGroups', 'doctorList']), |
|||
created() { |
|||
this.getControlGroups(); |
|||
this.getDoctor(1); |
|||
this.handleSelPatientMes(); |
|||
}, |
|||
methods: { |
|||
...mapMutations('home', ['setPatientId', 'setHospitalization', 'setRecordCode']), |
|||
...mapActions('home', ['getDoctor', 'getControlGroups']), |
|||
handleSearch() { |
|||
this.pagination.current = 1; |
|||
this.handleSelPatientMes(); |
|||
}, |
|||
async handleSelPatientMes() { |
|||
try { |
|||
const { hospitalization, pagination, inpatientId, doctorId, codes, startTime, endTime, recordStatus } = this; |
|||
const params = { |
|||
param: { |
|||
hospitalization, |
|||
inpatientId, |
|||
pageNum: pagination.current, |
|||
code: codes, |
|||
inputStatus: recordStatus, |
|||
pageSize: 10, |
|||
doctorId, |
|||
role: 1, |
|||
startTime, |
|||
endTime, |
|||
}, |
|||
}; |
|||
const res = await selPatientMes(params); |
|||
const { code, msg, data } = res.data; |
|||
console.log('获取列表'); |
|||
if (code === 200) { |
|||
let { lists } = this; |
|||
lists = { ...data }; |
|||
this.lists = { ...lists }; |
|||
} else { |
|||
this.$message.error(msg || '查询失败'); |
|||
throw msg; |
|||
} |
|||
} catch (error) { |
|||
throw new Error(error); |
|||
} |
|||
}, |
|||
// 查看患者的详情 |
|||
details(Id, hospitalization, code) { |
|||
this.setPatientId(Id); |
|||
this.setHospitalization(hospitalization); |
|||
this.setRecordCode(code); |
|||
localStorage.setItem('patientId', Id); |
|||
localStorage.setItem('hospitalization', hospitalization); |
|||
localStorage.setItem('recordCode', code); |
|||
this.$router.push('/patientInfo'); |
|||
}, |
|||
// 显示修改审核状态框 |
|||
showStatus(inputStatus) { |
|||
this.recordStatus = inputStatus; |
|||
this.statusModal = true; |
|||
}, |
|||
// 时间选择框的样式 |
|||
getCurrentStyle(current, today) { |
|||
const style = {}; |
|||
if (current.date() === 1) { |
|||
style.border = '1px solid #1890ff'; |
|||
style.borderRadius = '50%'; |
|||
} |
|||
return style; |
|||
}, |
|||
// 修改医生 |
|||
changeDoctorId(e) { |
|||
if (typeof e !== 'number') { |
|||
this.doctorId = e; |
|||
} else { |
|||
this.doctorId = ''; |
|||
} |
|||
}, |
|||
// 修改时间 |
|||
changeTime(e) { |
|||
if (e && e.length) { |
|||
this.startTime = this.$moment(e[0]._d).format('YYYY-MM-DD HH:mm:ss'); |
|||
this.endTime = this.$moment(e[1]._d).format('YYYY-MM-DD HH:mm:ss'); |
|||
} else { |
|||
this.startTime = ''; |
|||
this.endTime = ''; |
|||
} |
|||
}, |
|||
// 修改对照组 |
|||
changeInpatientId(e) { |
|||
if (typeof e !== 'number') { |
|||
this.inpatientId = e; |
|||
} else { |
|||
this.inpatientId = ''; |
|||
} |
|||
}, |
|||
// 修改状态 |
|||
changeStatus(e) { |
|||
if (typeof e) { |
|||
this.recordStatus = e; |
|||
} else { |
|||
this.changeStatus = ''; |
|||
} |
|||
}, |
|||
// 确认通过当前信息 |
|||
async changeRecordStatus(id) { |
|||
try { |
|||
const params = { |
|||
param: { |
|||
id, |
|||
inputStatus: 5, |
|||
}, |
|||
}; |
|||
const res = await upPatientMes(params); |
|||
const { code } = res.data; |
|||
if (code === 200) { |
|||
this.$message.success('已通过'); |
|||
this.handleSelPatientMes(); |
|||
} |
|||
} catch (error) { |
|||
this.$message.error(error); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="stylus" scoped ></style> |
@ -0,0 +1,318 @@ |
|||
<template> |
|||
<div class="flex-1 flex-wrap"> |
|||
<div style="width: 100%"> |
|||
<a-form :form="form" class="d-flex flex-nowrap align-center" layout="inline"> |
|||
<a-form-item> |
|||
<a-select placeholder="请选择医院" style="min-width: 240px" @change="changeHospitalId" allow-clear> |
|||
<a-select-option :key="item.id" :value="item.id" v-for="item in hospitals">{{ item.name }}</a-select-option> |
|||
</a-select> |
|||
</a-form-item> |
|||
<a-form-item> |
|||
<a-select placeholder="请选择医生" style="min-width: 120px" @change="changeDoctorId" allow-clear> |
|||
<a-select-option :key="item.id" :value="item.id" v-for="item in doctorList">{{ item.name }}</a-select-option> |
|||
</a-select> |
|||
</a-form-item> |
|||
<a-form-item> |
|||
<a-range-picker @change="changeTime" style="width: 300px"> |
|||
<template slot="dateRender" slot-scope="current"> |
|||
<div class="ant-calendar-date" :style="getCurrentStyle(current)"> |
|||
{{ current.date() }} |
|||
</div> |
|||
</template> |
|||
</a-range-picker> |
|||
</a-form-item> |
|||
<a-form-item> |
|||
<a-select placeholder="请选择状态" :default-value="recordStatus" style="min-width: 120px" @change="changeStatus" allow-clear> |
|||
<a-select-option :key="index" :value="index" v-for="(item, index) in status">{{ item }}</a-select-option> |
|||
</a-select> |
|||
</a-form-item> |
|||
<a-form-item> |
|||
<a-select placeholder="请选择组别" style="min-width: 360px" @change="changeInpatientId" allow-clear> |
|||
<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 @click="handleSearch" class="mr-4" html-type="submit" icon="search" type="primary">搜索</a-button> |
|||
</a-form> |
|||
<a-table |
|||
v-if="lists && lists.list && lists.list.length > 0" |
|||
:columns="columns" |
|||
:data-source="lists.list" |
|||
:loading="loading" |
|||
:pagination="pagination" |
|||
:row-key="record => record.id" |
|||
bordered |
|||
class="white pa-3 mt-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 |
|||
? '数据收集超时中' |
|||
: record.inputStatus === 4 |
|||
? '废弃' |
|||
: record.inputStatus === 5 |
|||
? '审核通过' |
|||
: '已结算' |
|||
}} |
|||
</span> |
|||
</template> |
|||
|
|||
<template slot="edit" slot-scope="text, record"> |
|||
<a-popconfirm placement="left" ok-text="确定" cancel-text="取消" @confirm="changeRecordStatus(record.id)"> |
|||
<template slot="title"> |
|||
<p>是否确定通过该患者记录</p> |
|||
</template> |
|||
<a-button v-if="record.inputStatus === 5" size="small" type="primary">审核通过</a-button> |
|||
</a-popconfirm> |
|||
|
|||
<a-button type="primary" size="small" class="ml-4" @click="details(record.id, record.hospitalization, record.code)"> |
|||
查看详情 |
|||
</a-button> |
|||
</template> |
|||
</a-table> |
|||
<a-empty v-else /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import { mapState, mapActions, mapMutations } from 'vuex'; |
|||
import { selPatientMes, upPatientMes, getHList } from 'config/api'; |
|||
const columns = [ |
|||
{ |
|||
title: '序号', |
|||
align: 'center', |
|||
dataIndex: 'id', |
|||
key: 'id', |
|||
scopedSlots: { customRender: 'id' }, |
|||
}, |
|||
{ |
|||
title: '研究编号', |
|||
align: 'center', |
|||
dataIndex: 'code', |
|||
key: 'code', |
|||
}, |
|||
{ |
|||
title: '住院号', |
|||
align: 'center', |
|||
dataIndex: 'hospitalization', |
|||
key: 'hospitalization', |
|||
}, |
|||
{ |
|||
title: '主治医生', |
|||
align: 'center', |
|||
dataIndex: 'doctorName', |
|||
key: 'doctorName', |
|||
}, |
|||
{ |
|||
title: '组别', |
|||
align: 'center', |
|||
dataIndex: 'name', |
|||
key: 'name', |
|||
}, |
|||
{ |
|||
title: '状态', |
|||
align: 'center', |
|||
dataIndex: 'inputStatus', |
|||
key: 'inputStatus', |
|||
scopedSlots: { customRender: 'inputStatus' }, |
|||
}, |
|||
{ |
|||
title: '编辑', |
|||
align: 'center', |
|||
dataIndex: 'edit', |
|||
key: 'edit', |
|||
width: 250, |
|||
scopedSlots: { customRender: 'edit' }, |
|||
}, |
|||
]; |
|||
export default { |
|||
name: 'General', |
|||
data() { |
|||
return { |
|||
str: '项目助理审核界面', |
|||
columns, |
|||
form: this.$form.createForm(this, { name: 'search' }), |
|||
loading: false, |
|||
visible: false, |
|||
lists: { pageNum: 1, pageSize: 10, total: 1, list: [] }, |
|||
codes: '', |
|||
pagination: { |
|||
current: 1, |
|||
pageSize: 10, |
|||
total: 0, |
|||
}, |
|||
hospitals: [], |
|||
hospitalization: '', |
|||
inpatientId: '', |
|||
statusModal: false, |
|||
recordStatus: 5, |
|||
status: ['新建', '数据搜集中', '数据搜集完成', '数据搜集超时', '废弃', '审核通过', '已结算'], |
|||
startTime: '', |
|||
endTime: '', |
|||
doctorId: '', |
|||
HospitalId: '', |
|||
}; |
|||
}, |
|||
computed: mapState('home', ['controlGroups', 'doctorList']), |
|||
created() { |
|||
this.getHospital(); |
|||
this.getControlGroups(); |
|||
this.getDoctor(1); |
|||
this.handleSelPatientMes(); |
|||
}, |
|||
methods: { |
|||
...mapMutations('home', ['setPatientId', 'setHospitalization', 'setRecordCode']), |
|||
...mapActions('home', ['getDoctor', 'getControlGroups']), |
|||
//修改所选医院 |
|||
changeHospitalId(e) { |
|||
console.log(typeof e); |
|||
if (typeof e === 'string') { |
|||
this.HospitalId = e; |
|||
} else { |
|||
this.HospitalId = ''; |
|||
} |
|||
}, |
|||
// 获取所有医院 |
|||
async getHospital() { |
|||
try { |
|||
const res = await getHList(); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
this.hospitals = data; |
|||
console.log(data); |
|||
} else { |
|||
this.$message.error('查询医院列表失败'); |
|||
} |
|||
} catch (error) { |
|||
this.$message.error('查询医院列表失败'); |
|||
} |
|||
}, |
|||
handleSearch() { |
|||
this.pagination.current = 1; |
|||
this.handleSelPatientMes(); |
|||
}, |
|||
async handleSelPatientMes() { |
|||
try { |
|||
const { HospitalId, hospitalization, pagination, inpatientId, doctorId, codes, startTime, endTime, recordStatus } = this; |
|||
const params = { |
|||
param: { |
|||
hospitalId: HospitalId, |
|||
hospitalization, |
|||
inpatientId, |
|||
pageNum: pagination.current, |
|||
code: codes, |
|||
inputStatus: recordStatus, |
|||
pageSize: 10, |
|||
doctorId, |
|||
role: 1, |
|||
startTime, |
|||
endTime, |
|||
}, |
|||
}; |
|||
const res = await selPatientMes(params); |
|||
const { code, msg, data } = res.data; |
|||
console.log('获取列表'); |
|||
if (code === 200) { |
|||
let { lists } = this; |
|||
lists = { ...data }; |
|||
this.lists = { ...lists }; |
|||
} else { |
|||
this.$message.error(msg || '查询失败'); |
|||
throw msg; |
|||
} |
|||
} catch (error) { |
|||
throw new Error(error); |
|||
} |
|||
}, |
|||
// 查看患者的详情 |
|||
details(Id, hospitalization, code) { |
|||
this.setPatientId(Id); |
|||
this.setHospitalization(hospitalization); |
|||
this.setRecordCode(code); |
|||
localStorage.setItem('patientId', Id); |
|||
localStorage.setItem('hospitalization', hospitalization); |
|||
localStorage.setItem('recordCode', code); |
|||
this.$router.push('/patientInfo'); |
|||
}, |
|||
// 显示修改审核状态框 |
|||
showStatus(inputStatus) { |
|||
this.recordStatus = inputStatus; |
|||
this.statusModal = true; |
|||
}, |
|||
// 时间选择框的样式 |
|||
getCurrentStyle(current, today) { |
|||
const style = {}; |
|||
if (current.date() === 1) { |
|||
style.border = '1px solid #1890ff'; |
|||
style.borderRadius = '50%'; |
|||
} |
|||
return style; |
|||
}, |
|||
// 修改医生 |
|||
changeDoctorId(e) { |
|||
if (typeof e !== 'number') { |
|||
this.doctorId = e; |
|||
} else { |
|||
this.doctorId = ''; |
|||
} |
|||
}, |
|||
// 修改时间 |
|||
changeTime(e) { |
|||
if (e && e.length) { |
|||
this.startTime = this.$moment(e[0]._d).format('YYYY-MM-DD HH:mm:ss'); |
|||
this.endTime = this.$moment(e[1]._d).format('YYYY-MM-DD HH:mm:ss'); |
|||
} else { |
|||
this.startTime = ''; |
|||
this.endTime = ''; |
|||
} |
|||
}, |
|||
// 修改对照组 |
|||
changeInpatientId(e) { |
|||
if (typeof e !== 'number') { |
|||
this.inpatientId = e; |
|||
} else { |
|||
this.inpatientId = ''; |
|||
} |
|||
}, |
|||
// 修改状态 |
|||
changeStatus(e) { |
|||
if (typeof e) { |
|||
this.recordStatus = e; |
|||
} else { |
|||
this.changeStatus = ''; |
|||
} |
|||
}, |
|||
// 确认通过当前信息 |
|||
async changeRecordStatus(id) { |
|||
try { |
|||
const params = { |
|||
param: { |
|||
id, |
|||
inputStatus: 6, |
|||
}, |
|||
}; |
|||
const res = await upPatientMes(params); |
|||
const { code } = res.data; |
|||
if (code === 200) { |
|||
this.$message.success('已通过'); |
|||
this.handleSelPatientMes(); |
|||
} |
|||
} catch (error) { |
|||
this.$message.error(error); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="stylus" scoped ></style> |
@ -0,0 +1,106 @@ |
|||
<template> |
|||
<div> |
|||
<div style="width: 100%" v-if="objList && objList.list && objList.list.length > 0"> |
|||
<a-table |
|||
:columns="columns" |
|||
:data-source="objList.list" |
|||
:loading="loading" |
|||
:pagination="pagination" |
|||
:row-key="record => record.id" |
|||
@change="getTableData" |
|||
bordered |
|||
class="white pa-3" |
|||
> |
|||
<template slot="shijian" slot-scope="text, record"> |
|||
<span>{{ record.shijian.toLocaleString().replace(/:\d{1,2}$/, ' ') }}</span> |
|||
</template> |
|||
</a-table> |
|||
</div> |
|||
<a-empty v-else> |
|||
<span slot="description" style="color: #bfbfbf"> 暂无任务 </span> |
|||
</a-empty> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import { getHospitalTask } from 'config/api'; |
|||
const columns = [ |
|||
{ |
|||
title: '研究编号', |
|||
align: 'center', |
|||
dataIndex: 'code', |
|||
key: 'code', |
|||
}, |
|||
{ |
|||
title: '日期', |
|||
align: 'center', |
|||
dataIndex: 'shijian', |
|||
key: 'shijian', |
|||
scopedSlots: { customRender: 'shijian' }, |
|||
}, |
|||
{ |
|||
title: '医生', |
|||
align: 'center', |
|||
dataIndex: 'doctorName', |
|||
key: 'doctorName', |
|||
scopedSlots: { customRender: 'doctorName' }, |
|||
}, |
|||
{ |
|||
title: '任务', |
|||
align: 'center', |
|||
dataIndex: 'task', |
|||
key: 'task', |
|||
scopedSlots: { customRender: 'task' }, |
|||
}, |
|||
]; |
|||
|
|||
export default { |
|||
name: 'Statistics', |
|||
data() { |
|||
return { |
|||
str: '项目助理数据统计界面', |
|||
columns, |
|||
objList: {}, |
|||
pagination: { |
|||
current: 1, |
|||
pageSize: 20, |
|||
total: 0, |
|||
}, |
|||
loading: false, |
|||
}; |
|||
}, |
|||
|
|||
created() { |
|||
this.getData(); |
|||
}, |
|||
methods: { |
|||
async getData() { |
|||
try { |
|||
this.loading = true; |
|||
const params = { |
|||
param: { |
|||
pageNum: this.pagination.current, |
|||
pageSize: this.pagination.pageSize, |
|||
}, |
|||
}; |
|||
const res = await getHospitalTask(params); |
|||
console.log(res); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
this.objList = { ...data }; |
|||
console.log(data); |
|||
this.loading = false; |
|||
} |
|||
} catch (error) { |
|||
console.log(error); |
|||
} |
|||
}, |
|||
getTableData(pagination) { |
|||
const { current } = pagination; |
|||
this.pagination.current = current; |
|||
this.getData(); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="stylus" scoped ></style> |
Loading…
Reference in new issue