|
@@ -1,14 +1,13 @@
|
|
-import React, { useState, useEffect, useRef } from 'react';
|
|
|
|
-import { Form, Input, Button, Table, Select, Pagination, Space, Modal, message, Row, Col, Upload } from 'antd';
|
|
|
|
|
|
+import React, { useState, useEffect } from 'react';
|
|
|
|
+import { Form, Input, Button, Table, Select, Space, Modal, message, Row, Col } from 'antd';
|
|
import { PlusOutlined } from '@ant-design/icons';
|
|
import { PlusOutlined } from '@ant-design/icons';
|
|
import AddDiag from './addDiag'
|
|
import AddDiag from './addDiag'
|
|
import MatchDiag from './MatchDiag.js'
|
|
import MatchDiag from './MatchDiag.js'
|
|
import '@common/common.less';
|
|
import '@common/common.less';
|
|
-// import { useSelector } from 'react-redux'
|
|
|
|
import apiObj from '@api/index';
|
|
import apiObj from '@api/index';
|
|
import DiagContext from './Diag-context';
|
|
import DiagContext from './Diag-context';
|
|
|
|
|
|
-const { post, api, xPost } = apiObj;
|
|
|
|
|
|
+const { post, api } = apiObj;
|
|
const { Option } = Select;
|
|
const { Option } = Select;
|
|
//获取列表
|
|
//获取列表
|
|
function DiagManager() {
|
|
function DiagManager() {
|
|
@@ -16,12 +15,11 @@ function DiagManager() {
|
|
getDiseasePage();
|
|
getDiseasePage();
|
|
}, []);
|
|
}, []);
|
|
const [DiagList, setDiagList] = useState([]);//当前页列表数据
|
|
const [DiagList, setDiagList] = useState([]);//当前页列表数据
|
|
- const [Diagid, setDiagid] = useState([]);//当前列表id
|
|
|
|
- const [title, setTitle] = useState("");//数据总量
|
|
|
|
|
|
+ const [Diagid, setDiagid] = useState([]);//当前操作行id
|
|
|
|
+ const [title, setTitle] = useState("");//新增/修改的弹窗标题
|
|
const [visible, setVisible] = useState(false);//新增修改 弹窗
|
|
const [visible, setVisible] = useState(false);//新增修改 弹窗
|
|
- const [msvisible, setMsvisible] = useState(false);//删除 弹窗
|
|
|
|
- const [visible1, setvisible1] = useState(false);//导入 弹窗
|
|
|
|
- const [visible2, setvisible2] = useState(false);//匹配 弹窗
|
|
|
|
|
|
+ const [delvisible, setDelvisible] = useState(false);//删除 弹窗
|
|
|
|
+ //const [visible2, setvisible2] = useState(false);//匹配 弹窗
|
|
const [unsaved, setUnsaved] = useState(false);//修改未保存弹窗
|
|
const [unsaved, setUnsaved] = useState(false);//修改未保存弹窗
|
|
const [revise, setRevise] = useState(false);//是否修改 新增修改内容
|
|
const [revise, setRevise] = useState(false);//是否修改 新增修改内容
|
|
const [type, setType] = useState("");
|
|
const [type, setType] = useState("");
|
|
@@ -29,8 +27,6 @@ function DiagManager() {
|
|
const [size, setSize] = useState(15);//每页显示条数
|
|
const [size, setSize] = useState(15);//每页显示条数
|
|
const [total, setTotal] = useState(0);
|
|
const [total, setTotal] = useState(0);
|
|
const [current, setCurrent] = useState(1);//当前页
|
|
const [current, setCurrent] = useState(1);//当前页
|
|
- const [uploadStatus, setUploadStatus] = useState(0);//导入状态,0初始,1成功,2格式错误,3导入数据错误
|
|
|
|
- const [uploadTip, setUploadTip] = useState(""); //导入状态提示语
|
|
|
|
const [saveParams, setSaveParams] = useState({}); //匹配诊断选中
|
|
const [saveParams, setSaveParams] = useState({}); //匹配诊断选中
|
|
const [params, setParams] = useState({
|
|
const [params, setParams] = useState({
|
|
pages: 1,
|
|
pages: 1,
|
|
@@ -38,30 +34,23 @@ function DiagManager() {
|
|
size: 15
|
|
size: 15
|
|
});
|
|
});
|
|
const [form] = Form.useForm();
|
|
const [form] = Form.useForm();
|
|
- const tipMap = {
|
|
|
|
- 0: '提示:EXCEL导入,模板样式及数据请在【朗通云平台-CDSS数据维护-医学术语关联维护】中导出获取。',
|
|
|
|
- 2: "模板格式错误,模板样式及数据请在【朗通云平台-CDSS数据维护-医学术语关联维护】中导出获取",
|
|
|
|
- 3: '模板导入失败,失败原因已在Excel中标识并自动下载,请检查后重新导入',
|
|
|
|
- };
|
|
|
|
|
|
|
|
let data = {
|
|
let data = {
|
|
pages: 1,
|
|
pages: 1,
|
|
current: 1,
|
|
current: 1,
|
|
size: size
|
|
size: size
|
|
}
|
|
}
|
|
- //新增 弹窗
|
|
|
|
- const showModal = (name, type, flag, Diagrow) => {
|
|
|
|
- setVisible(type);
|
|
|
|
|
|
+ //新增/修改 弹窗flag=1新增,3修改
|
|
|
|
+ const showModal = (name, flag, Diagrow) => {
|
|
|
|
+ setVisible(true);
|
|
setTitle(name);
|
|
setTitle(name);
|
|
setType(flag)
|
|
setType(flag)
|
|
- if (flag == 1) {
|
|
|
|
|
|
+ if (flag === 1) {
|
|
setFormData({
|
|
setFormData({
|
|
status: '1'
|
|
status: '1'
|
|
})
|
|
})
|
|
- }
|
|
|
|
- if (flag == 3) {
|
|
|
|
|
|
+ }else if (flag === 3) {
|
|
setFormData(Diagrow)
|
|
setFormData(Diagrow)
|
|
- getDiseasePage()
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//表格数据
|
|
//表格数据
|
|
@@ -74,20 +63,23 @@ function DiagManager() {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ function showDelModal(id){
|
|
|
|
+ setDelvisible(true);
|
|
|
|
+ setDiagid(id);
|
|
|
|
+ }
|
|
//删除
|
|
//删除
|
|
function delDiseaseById() {
|
|
function delDiseaseById() {
|
|
- post(api.delDiseaseById, { ids: Diagid }).then((res) => {
|
|
|
|
- setMsvisible(false);
|
|
|
|
|
|
+ post(api.delDiseaseById, { id: Diagid }).then((res) => {
|
|
|
|
+ setDelvisible(false);
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
getDiseasePage();
|
|
getDiseasePage();
|
|
- setDiagid([])
|
|
|
|
|
|
+ setDiagid("");
|
|
message.success("删除成功");
|
|
message.success("删除成功");
|
|
} else {
|
|
} else {
|
|
message.warning(res.data.msg || '操作失败');
|
|
message.warning(res.data.msg || '操作失败');
|
|
}
|
|
}
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
- setMsvisible(false);
|
|
|
|
|
|
+ setDelvisible(false);
|
|
message.error("接口出错");
|
|
message.error("接口出错");
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -124,34 +116,14 @@ function DiagManager() {
|
|
form.resetFields();
|
|
form.resetFields();
|
|
getDiseasePage(data);
|
|
getDiseasePage(data);
|
|
};
|
|
};
|
|
- //打开导入弹窗
|
|
|
|
- const ImportBox = () => {
|
|
|
|
- setvisible1(true)
|
|
|
|
- }
|
|
|
|
- //导入弹窗取消或关闭
|
|
|
|
- function handleCancel1() {
|
|
|
|
- setvisible1(false);
|
|
|
|
- setUploadStatus(0);
|
|
|
|
- }
|
|
|
|
- //打开匹配弹窗
|
|
|
|
- function match(row) {
|
|
|
|
- setvisible2(true)
|
|
|
|
- setFormData(row)
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
//导入弹窗取消或关闭
|
|
//导入弹窗取消或关闭
|
|
- function handleCancel2() {
|
|
|
|
|
|
+ /*function handleCancel2() {
|
|
setvisible2(false);
|
|
setvisible2(false);
|
|
- }
|
|
|
|
- const messageBox = () => {
|
|
|
|
- if (!Diagid.length) {
|
|
|
|
- message.warning("请先选择要删除的记录~", 1);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- setMsvisible(true)
|
|
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
//删除 提示框取消或关闭
|
|
//删除 提示框取消或关闭
|
|
function handleCancel() {
|
|
function handleCancel() {
|
|
- setMsvisible(false);
|
|
|
|
|
|
+ setDelvisible(false);
|
|
}
|
|
}
|
|
|
|
|
|
//新增修改 取消或关闭
|
|
//新增修改 取消或关闭
|
|
@@ -163,18 +135,18 @@ function DiagManager() {
|
|
setFormData(null)
|
|
setFormData(null)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ //是否有未保存的修改
|
|
function isChange(a) {
|
|
function isChange(a) {
|
|
setRevise(a)
|
|
setRevise(a)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ //不保存当前修改,退出弹窗
|
|
function addCancel() {
|
|
function addCancel() {
|
|
setRevise(false)
|
|
setRevise(false)
|
|
setVisible(false)
|
|
setVisible(false)
|
|
setUnsaved(false)
|
|
setUnsaved(false)
|
|
setFormData(null)
|
|
setFormData(null)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ //未保存提醒弹窗关闭
|
|
function unsavedCancel() {
|
|
function unsavedCancel() {
|
|
setUnsaved(false)
|
|
setUnsaved(false)
|
|
}
|
|
}
|
|
@@ -187,7 +159,7 @@ function DiagManager() {
|
|
}
|
|
}
|
|
function saveMatching() {
|
|
function saveMatching() {
|
|
post(api.matchingDisease, saveParams).then((res) => {
|
|
post(api.matchingDisease, saveParams).then((res) => {
|
|
- setvisible2(false);
|
|
|
|
|
|
+ //setvisible2(false);
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
message.success("匹配成功");
|
|
message.success("匹配成功");
|
|
getDiseasePage();
|
|
getDiseasePage();
|
|
@@ -198,53 +170,23 @@ function DiagManager() {
|
|
message.warning(error.message || "接口出错,请重试",);
|
|
message.warning(error.message || "接口出错,请重试",);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- const rowSelection = {
|
|
|
|
- onChange: (selectedRowKeys, selectedRows) => {
|
|
|
|
- console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
|
|
|
|
- setDiagid(selectedRowKeys)
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- //导入模板
|
|
|
|
- const props = {
|
|
|
|
- name: 'file',
|
|
|
|
- accept: ".xls",
|
|
|
|
- showUploadList: false,
|
|
|
|
- action: api.importDisease,
|
|
|
|
- headers: {
|
|
|
|
- authorization: 'authorization-text',
|
|
|
|
- },
|
|
|
|
- onChange(info) {
|
|
|
|
- const { response, status } = info.file;
|
|
|
|
- if (status === 'done') {
|
|
|
|
- if (response.code === 200) {
|
|
|
|
- getDiseasePage(); //刷新列表
|
|
|
|
- //setvisible1(false); //关闭导入弹窗
|
|
|
|
- //message.success(`${info.file.name} 导入成功`);
|
|
|
|
- setUploadStatus(1);
|
|
|
|
- setUploadTip(response.data);
|
|
|
|
- } else {
|
|
|
|
- //message.error(`${info.file.name} 导入失败.`);
|
|
|
|
- setUploadStatus(2);
|
|
|
|
- }
|
|
|
|
- } else if (status === 'error') {
|
|
|
|
- setUploadStatus(3);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- };
|
|
|
|
|
|
+ //匹配信息修改同步
|
|
function matchChange(data) {
|
|
function matchChange(data) {
|
|
setSaveParams(data);
|
|
setSaveParams(data);
|
|
}
|
|
}
|
|
const columns = [
|
|
const columns = [
|
|
{ title: '序号', dataIndex: 'index', render: (text, record, index) => (current - 1) * params.size + index + 1 },
|
|
{ title: '序号', dataIndex: 'index', render: (text, record, index) => (current - 1) * params.size + index + 1 },
|
|
|
|
+ { title: '操作时间', dataIndex: 'time', },
|
|
{ title: '医院诊断名称', dataIndex: 'name', },
|
|
{ title: '医院诊断名称', dataIndex: 'name', },
|
|
{ title: 'ICD-10编码', dataIndex: 'icd10', },
|
|
{ title: 'ICD-10编码', dataIndex: 'icd10', },
|
|
{ title: '标准诊断名称', dataIndex: 'standard', },
|
|
{ title: '标准诊断名称', dataIndex: 'standard', },
|
|
|
|
+ { title: '标准诊断状态', dataIndex: 'status', },
|
|
{ title: '是否匹配', dataIndex: 'isMapping', },
|
|
{ title: '是否匹配', dataIndex: 'isMapping', },
|
|
{
|
|
{
|
|
title: '操作', dataIndex: 'key', render: (text, record) => (
|
|
title: '操作', dataIndex: 'key', render: (text, record) => (
|
|
<Space size="middle">
|
|
<Space size="middle">
|
|
- <a onClick={e => showModal('修改字典', true, 3, record)}>修改</a>
|
|
|
|
- <a onClick={e => match(record)}>匹配</a>
|
|
|
|
|
|
+ <a onClick={e => showModal('修改诊断信息',3, record)}>修改</a>
|
|
|
|
+ <a onClick={() => showDelModal(record.id)}>删除</a>
|
|
</Space>
|
|
</Space>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
@@ -308,19 +250,13 @@ function DiagManager() {
|
|
<h2 className="table-title">诊断信息维护</h2>
|
|
<h2 className="table-title">诊断信息维护</h2>
|
|
<Row gutter={12}>
|
|
<Row gutter={12}>
|
|
<Col key={0}>
|
|
<Col key={0}>
|
|
- <Button type="primary" icon={<PlusOutlined />} onClick={e => showModal('新增', true, 1)}>新增</Button>
|
|
|
|
- </Col>
|
|
|
|
- <Col key={1}>
|
|
|
|
- <Button onClick={e => messageBox()} type="primary" danger>删除</Button>
|
|
|
|
- </Col>
|
|
|
|
- <Col key={2}>
|
|
|
|
- <Button type="primary" onClick={e => ImportBox()}>导入</Button>
|
|
|
|
|
|
+ <Button type="primary" icon={<PlusOutlined />} onClick={e => showModal('新增诊断信息',1)}>新增</Button>
|
|
</Col>
|
|
</Col>
|
|
</Row>
|
|
</Row>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<Table
|
|
<Table
|
|
- rowSelection={{ type: 'checkbox', ...rowSelection, }}
|
|
|
|
|
|
+ /*rowSelection={{ type: 'checkbox', ...rowSelection, }}*/
|
|
columns={columns}
|
|
columns={columns}
|
|
scroll={{ y: 'calc(100vh - 320px)' }}
|
|
scroll={{ y: 'calc(100vh - 320px)' }}
|
|
dataSource={DiagList}
|
|
dataSource={DiagList}
|
|
@@ -342,14 +278,14 @@ function DiagManager() {
|
|
title={title}
|
|
title={title}
|
|
okText='确定'
|
|
okText='确定'
|
|
cancelText='关闭'
|
|
cancelText='关闭'
|
|
- width={'45%'}
|
|
|
|
|
|
+ width={'65%'}
|
|
visible={visible}
|
|
visible={visible}
|
|
|
|
+ onOk={saveMatching}
|
|
onCancel={cancel}
|
|
onCancel={cancel}
|
|
- footer={null}
|
|
|
|
forceRender={true}
|
|
forceRender={true}
|
|
>
|
|
>
|
|
<DiagContext.Provider value={{ type, formData }}>
|
|
<DiagContext.Provider value={{ type, formData }}>
|
|
- <AddDiag DiagChange={DiagChange} cancel={cancel} isChange={isChange} />
|
|
|
|
|
|
+ <AddDiag matchChange={matchChange} cancel={cancel} isChange={isChange} />
|
|
</DiagContext.Provider>
|
|
</DiagContext.Provider>
|
|
<Modal
|
|
<Modal
|
|
maskClosable={false}
|
|
maskClosable={false}
|
|
@@ -367,43 +303,15 @@ function DiagManager() {
|
|
: ''}
|
|
: ''}
|
|
<Modal
|
|
<Modal
|
|
maskClosable={false}
|
|
maskClosable={false}
|
|
- title="提示"
|
|
|
|
|
|
+ title="删除诊断信息"
|
|
okText='确定'
|
|
okText='确定'
|
|
cancelText='关闭'
|
|
cancelText='关闭'
|
|
width={400}
|
|
width={400}
|
|
- visible={msvisible}
|
|
|
|
|
|
+ visible={delvisible}
|
|
onOk={delDiseaseById}
|
|
onOk={delDiseaseById}
|
|
onCancel={handleCancel}
|
|
onCancel={handleCancel}
|
|
>
|
|
>
|
|
- <p>诊断信息删除后将无法恢复,确认删除这{Diagid.length}条信息。</p>
|
|
|
|
- </Modal>
|
|
|
|
- <Modal
|
|
|
|
- maskClosable={false}
|
|
|
|
- destroyOnClose={true}
|
|
|
|
- title="提示"
|
|
|
|
- width={400}
|
|
|
|
- visible={visible1}
|
|
|
|
- onCancel={handleCancel1}
|
|
|
|
- footer={<Button key="back" onClick={handleCancel1}>关闭</Button>}
|
|
|
|
- >
|
|
|
|
- <div style={{ marginBottom: 10 + 'px' }}>
|
|
|
|
- <span>诊断信息导入:</span>
|
|
|
|
- <Upload {...props}><Button type="primary" >导入目录</Button></Upload>
|
|
|
|
- </div>
|
|
|
|
- {uploadStatus === 1 ? (<span style={{ color: '#00AF71' }}>{uploadTip}</span>) : (<span style={{ color: '#E3505B' }}>{tipMap[uploadStatus]}</span>)}
|
|
|
|
- </Modal>
|
|
|
|
- <Modal
|
|
|
|
- maskClosable={false}
|
|
|
|
- destroyOnClose={true}
|
|
|
|
- title="提示"
|
|
|
|
- okText='保存'
|
|
|
|
- cancelText='关闭'
|
|
|
|
- width={800}
|
|
|
|
- visible={visible2}
|
|
|
|
- onCancel={handleCancel2}
|
|
|
|
- onOk={saveMatching}
|
|
|
|
- >
|
|
|
|
- <MatchDiag row={formData} onChange={matchChange}></MatchDiag>
|
|
|
|
|
|
+ <p>诊断信息删除后将无法恢复,确认删除这条诊断信息。</p>
|
|
</Modal>
|
|
</Modal>
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|