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.
256 lines
6.7 KiB
256 lines
6.7 KiB
<template> |
|
<div> |
|
<BasicTable @register="registerTable" |
|
@selection-change="handleSelectionChange" |
|
> |
|
<template #tableTitle> |
|
<a-button |
|
type="primary" |
|
preIcon="ant-design:plus-outlined" |
|
@click="handleAdd()" |
|
>新增</a-button> |
|
<a-button |
|
preIcon="ant-design:plus-outlined" |
|
type="primary" |
|
@click="handleAdd()" |
|
>批量新增</a-button> |
|
<a-button type="primary" |
|
preIcon="ant-design:upload-outlined" |
|
@click="handleClickMergeUpload()" |
|
>合并上传</a-button> |
|
<a-button type="primary" |
|
preIcon="ant-design:user-outlined" |
|
@click="handleClickBatchCollect()" |
|
>设置收样员</a-button> |
|
<a-button type="primary" |
|
preIcon="ant-design:printer-outlined" |
|
@click="handleClickBatchPrint()" |
|
>批量打印</a-button> |
|
<a-button type="primary" |
|
preIcon="ant-design:download-outlined" |
|
@click="handleClickBatchDownload()" |
|
>批量下载</a-button> |
|
<a-button type="primary" |
|
preIcon="ant-design:export-outlined" |
|
@click="handleClickExport(0)" |
|
>导出</a-button> |
|
<a-button preIcon="ant-design:export-outlined" |
|
type="primary" |
|
@click="handleClickExport(1)" |
|
>合并导出</a-button> |
|
<a-button type="primary" |
|
preIcon="ant-design:export-outlined" |
|
@click="handleClickExportPreCode()" |
|
>导出预制码</a-button> |
|
</template> |
|
<template #action="{ record }"> |
|
<TableAction :dropDownActions="getDropDownAction(record)"/> |
|
</template> |
|
</BasicTable> |
|
<!--弹出窗体区域--> |
|
<ReportModal @register="registerModal" @success="handleRefreshTable"/> |
|
</div> |
|
</template> |
|
|
|
<script lang="ts" setup> |
|
/** |
|
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
|
* 采用vben-动态表格表单封装组件编写,采用 setup 写法 |
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
|
* author entfrm开发团队-王翔 |
|
*/ |
|
import { reactive, ref, toRaw } from 'vue'; |
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
import {listReport, delReport} from '/@/api/platform/common/controller/report'; |
|
import { useModal } from '/@/components/Modal'; |
|
import { columns, searchFormSchema } from './report.data'; |
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
import ReportModal from './ReportModal.vue'; |
|
import { useDrawer } from '/@/components/Drawer'; |
|
const showFooter = ref(true); |
|
|
|
/** 类型规范统一声明定义区域 */ |
|
interface TableState { |
|
single: boolean; |
|
multiple: boolean; |
|
} |
|
|
|
/** 通用变量统一声明区域 */ |
|
const state = reactive<TableState>({ |
|
// 非单个禁用 |
|
single: true, |
|
// 非多个禁用 |
|
multiple: true |
|
}); |
|
const { createConfirm, createMessage } = useMessage(); |
|
const [registerModal, { openModal }] = useModal(); |
|
const [rolePermissionDrawer, { openDrawer: openRolePermissionDrawer }] = useDrawer(); |
|
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ |
|
api: listReport, |
|
rowKey: 'id', |
|
columns, |
|
formConfig: { |
|
labelWidth: 120, |
|
schemas: searchFormSchema, |
|
autoSubmitOnEnter: true, |
|
fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']] |
|
}, |
|
rowSelection: { type: 'checkbox' }, |
|
useSearchForm: true, |
|
showTableSetting: true, |
|
bordered: true, |
|
clickToRowSelect: false, |
|
showIndexColumn: false, |
|
actionColumn: { |
|
width: 220, |
|
title: '操作', |
|
dataIndex: 'action', |
|
slots: { customRender: 'action' }, |
|
fixed: false |
|
}, |
|
handleSearchInfoFn: () => clearSelectedRowKeys() |
|
}); |
|
|
|
/** 处理多选框选中数据 */ |
|
function handleSelectionChange(selection?: Recordable) { |
|
const rowSelection = toRaw(selection?.keys) || []; |
|
state.single = rowSelection.length != 1; |
|
state.multiple = !rowSelection.length; |
|
} |
|
|
|
/** 新增按钮操作,行内新增与工具栏局域新增通用 */ |
|
function handleAdd() { |
|
openModal(true,{ _tag: 'add' }); |
|
} |
|
|
|
/** 编辑按钮操作,行内编辑 */ |
|
function handleEdit(record?: Recordable) { |
|
record = record || { id: getSelectRowKeys() }; |
|
openModal(true, { _tag: 'edit', record }); |
|
} |
|
|
|
/** 删除按钮操作,行内删除 */ |
|
async function handleDel(record?: Recordable) { |
|
const id = record?.id || getSelectRowKeys(); |
|
createConfirm({ |
|
iconType: 'warning', |
|
title: '警告', |
|
content: `是否确认删除医生编号为${id}医生吗?`, |
|
onOk: async () => { |
|
await delReport(id); |
|
createMessage.success('删除成功!'); |
|
handleRefreshTable(); |
|
} |
|
}); |
|
} |
|
|
|
/**编辑*/ |
|
function handleClickEditor(record) { |
|
|
|
} |
|
/**收取*/ |
|
function handleClickCollect(record) { |
|
|
|
} |
|
/**送达*/ |
|
function handleClickDelivered(record){ |
|
|
|
} |
|
/**确认收到*/ |
|
function handleClickReceived(record){ |
|
|
|
} |
|
/**上传结果*/ |
|
function handleClickUpload(record) { |
|
|
|
} |
|
/**查看病情*/ |
|
function handleClickPatientDetail(record){ |
|
|
|
} |
|
/**上传病情*/ |
|
function handleClickHealthUpload(record) { |
|
|
|
} |
|
/**联系医生*/ |
|
function handleClickLinkDoctor(record) { |
|
|
|
} |
|
/**合并上传*/ |
|
function handleClickMergeUpload() { |
|
|
|
} |
|
/**设置收样员*/ |
|
function handleClickBatchCollect() { |
|
|
|
} |
|
/**批量打印*/ |
|
function handleClickBatchPrint() { |
|
|
|
} |
|
/**批量下载*/ |
|
function handleClickBatchDownload() { |
|
|
|
} |
|
/**导出*/ |
|
function handleClickExport() { |
|
|
|
} |
|
/**导出预制码*/ |
|
function handleClickExportPreCode() { |
|
|
|
} |
|
function getDropDownAction(record) { |
|
return [ |
|
{ |
|
label: '查看', |
|
onClick: handleEdit.bind(null, record), |
|
}, |
|
{ |
|
label: '编辑', |
|
onClick: handleClickEditor.bind(null, record), |
|
}, |
|
{ |
|
label: '收取', |
|
onClick: handleClickCollect.bind(null, record), |
|
}, |
|
{ |
|
label: '送达', |
|
onClick: handleClickDelivered.bind(null, record), |
|
}, |
|
{ |
|
label: '确认收到', |
|
onClick: handleClickReceived.bind(null, record), |
|
}, |
|
{ |
|
label: '添加项目', |
|
onClick: handleAdd.bind(null, record), |
|
}, |
|
{ |
|
label: '上传结果', |
|
onClick: handleClickUpload.bind(null, record), |
|
}, |
|
{ |
|
label: '查看病情', |
|
onClick: handleClickPatientDetail.bind(null, record), |
|
}, |
|
{ |
|
label: '上传病情', |
|
onClick: handleClickHealthUpload.bind(null, record), |
|
}, |
|
{ |
|
label: '联系医生', |
|
onClick: handleClickLinkDoctor.bind(null, record), |
|
}, |
|
{ |
|
label: '删除', |
|
onClick: handleDel.bind(null, record), |
|
}, |
|
]; |
|
} |
|
/** 处理表格刷新 */ |
|
function handleRefreshTable() { |
|
clearSelectedRowKeys(); |
|
reload(); |
|
} |
|
</script>
|
|
|