|
@@ -29,15 +29,20 @@ function DiagManager() {
|
|
|
const [size, setSize] = useState(15);//每页显示条数
|
|
|
const [total, setTotal] = useState(0);
|
|
|
const [current, setCurrent] = useState(1);//当前页
|
|
|
+ const [uploadStatus, setUploadStatus] = useState(0);//导入状态,0初始,1成功,2格式错误,3导入数据错误
|
|
|
+ const [uploadTip,setUploadTip] = useState(""); //导入状态提示语
|
|
|
const [params, setParams] = useState({
|
|
|
pages: 1,
|
|
|
current: 1,
|
|
|
size: 15
|
|
|
});
|
|
|
const [form] = Form.useForm();
|
|
|
+ const tipMap={
|
|
|
+ 0:'提示:EXCEL导入,模板样式及数据请在【朗通云平台-CDSS数据维护-医学术语关联维护】中导出获取。',
|
|
|
+ 2:"模板格式错误,模板样式及数据请在【朗通云平台-CDSS数据维护-医学术语关联维护】中导出获取",
|
|
|
+ 3:'模板导入失败,失败原因已在Excel中标识并自动下载,请检查后重新导入',
|
|
|
+ };
|
|
|
|
|
|
-
|
|
|
- let list = []
|
|
|
let data = {
|
|
|
pages: 1,
|
|
|
current: 1,
|
|
@@ -68,38 +73,20 @@ function DiagManager() {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- //模糊查询
|
|
|
- // function getCodeCategory(val){
|
|
|
- // xPost(api.getCodeCategory,{groupType:val}).then((res) => {
|
|
|
- // if (res.data.code === 200) {
|
|
|
- // const data = res.data.data;
|
|
|
- // setgroupTypeList(data)
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // function onSearch(value) {
|
|
|
- // getCodeCategory(value)
|
|
|
- // }
|
|
|
- // function onFocus() {
|
|
|
- // getCodeCategory("")
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
//删除
|
|
|
function delDiseaseById() {
|
|
|
- console.log(Diagid)
|
|
|
- xPost(api.delDiseaseById,{id:Diagid}).then((res) => {
|
|
|
+ post(api.delDiseaseById,{ids:Diagid}).then((res) => {
|
|
|
+ setMsvisible(false);
|
|
|
if (res.data.code === 200) {
|
|
|
getDiseasePage();
|
|
|
- setMsvisible(false);
|
|
|
- setDiagid(null)
|
|
|
+ setDiagid([])
|
|
|
message.success("删除成功");
|
|
|
} else {
|
|
|
message.warning(res.data.msg || '操作失败');
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
+ setMsvisible(false);
|
|
|
message.error("接口出错");
|
|
|
});
|
|
|
}
|
|
@@ -143,12 +130,12 @@ function DiagManager() {
|
|
|
//导入弹窗取消或关闭
|
|
|
function handleCancel1() {
|
|
|
setvisible1(false);
|
|
|
+ setUploadStatus(0);
|
|
|
}
|
|
|
//打开匹配弹窗
|
|
|
function match(row){
|
|
|
setvisible2(true)
|
|
|
setFormData(row)
|
|
|
- console.log(row)
|
|
|
}
|
|
|
//导入弹窗取消或关闭
|
|
|
function handleCancel2() {
|
|
@@ -197,7 +184,6 @@ function DiagManager() {
|
|
|
setVisible(false)
|
|
|
getDiseasePage();
|
|
|
}
|
|
|
- const DataType =[]
|
|
|
const rowSelection = {
|
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
|
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
|
|
@@ -207,25 +193,33 @@ function DiagManager() {
|
|
|
//导入模板
|
|
|
const props = {
|
|
|
name: 'file',
|
|
|
- action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
|
|
|
+ accept:".xls",
|
|
|
+ showUploadList:false,
|
|
|
+ action: api.importDisease,
|
|
|
headers: {
|
|
|
authorization: 'authorization-text',
|
|
|
},
|
|
|
onChange(info) {
|
|
|
- console.log(info);
|
|
|
- if (info.file.status !== 'uploading') {
|
|
|
- console.log(info);
|
|
|
- }
|
|
|
- if (info.file.status === 'done') {
|
|
|
- message.success(`${info.file.name} file uploaded successfully`);
|
|
|
- } else if (info.file.status === 'error') {
|
|
|
- message.error(`${info.file.name} file upload failed.`);
|
|
|
- }
|
|
|
+ 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);
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
|
|
|
const columns = [
|
|
|
- { title: '序号', dataIndex: 'id',},
|
|
|
+ { title: '序号', dataIndex: 'index',render: (text, record,index) => (current-1)*params.size+index+1},
|
|
|
{ title: '医院诊断名称', dataIndex: 'name',},
|
|
|
{ title: 'ICD-10编码', dataIndex: 'icd10',},
|
|
|
{ title: '标准诊断名称', dataIndex: 'standard',},
|
|
@@ -249,17 +243,17 @@ function DiagManager() {
|
|
|
initialValues={{ status: '' }}
|
|
|
>
|
|
|
<Row gutter={24}>
|
|
|
- <Col span={4} key={0}>
|
|
|
+ <Col span={5} key={0}>
|
|
|
<Form.Item label="医院诊断名称" name="name">
|
|
|
<Input placeholder="医院诊断名称" autoComplete='off'/>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
- <Col span={4} key={1}>
|
|
|
+ <Col span={5} key={1}>
|
|
|
<Form.Item label="ICD-10编码" name="icd10">
|
|
|
<Input placeholder="ICD-10编码" autoComplete='off'/>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
- <Col span={4} key={2}>
|
|
|
+ <Col span={5} key={2}>
|
|
|
<Form.Item label="标准诊断名称" name="standard">
|
|
|
<Input placeholder="标准诊断名称" autoComplete='off'/>
|
|
|
</Form.Item>
|
|
@@ -273,14 +267,13 @@ function DiagManager() {
|
|
|
// onFocus={onFocus}
|
|
|
placeholder="全部"
|
|
|
>
|
|
|
+ <Option value={-1} key={-1}>全部</Option>
|
|
|
<Option value={0} key={0}>未匹配</Option>
|
|
|
<Option value={1} key={1}>已匹配</Option>
|
|
|
</Select>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
-
|
|
|
-
|
|
|
- <Col span={8} key={4}>
|
|
|
+ <Col span={5} key={4}>
|
|
|
<Form.Item>
|
|
|
<Button type="primary" htmlType="submit">
|
|
|
查询
|
|
@@ -332,7 +325,7 @@ function DiagManager() {
|
|
|
<Modal
|
|
|
title={title}
|
|
|
okText='确定'
|
|
|
- cancelText='取消'
|
|
|
+ cancelText='关闭'
|
|
|
width={'45%'}
|
|
|
visible={visible}
|
|
|
onCancel={cancel}
|
|
@@ -345,7 +338,7 @@ function DiagManager() {
|
|
|
<Modal
|
|
|
title="提示"
|
|
|
okText='确定'
|
|
|
- cancelText='取消'
|
|
|
+ cancelText='关闭'
|
|
|
width={400}
|
|
|
visible={unsaved}
|
|
|
onOk={addCancel}
|
|
@@ -358,7 +351,7 @@ function DiagManager() {
|
|
|
<Modal
|
|
|
title="提示"
|
|
|
okText='确定'
|
|
|
- cancelText='取消'
|
|
|
+ cancelText='关闭'
|
|
|
width={400}
|
|
|
visible={msvisible}
|
|
|
onOk={delDiseaseById}
|
|
@@ -367,17 +360,18 @@ function DiagManager() {
|
|
|
<p>诊断信息删除后将无法恢复,确认删除这{Diagid.length}条信息。</p>
|
|
|
</Modal>
|
|
|
<Modal
|
|
|
+ destroyOnClose={true}
|
|
|
title="提示"
|
|
|
- cancelText='关闭'
|
|
|
width={400}
|
|
|
visible={visible1}
|
|
|
onCancel={handleCancel1}
|
|
|
- footer={<Button key="back" onClick={handleCancel1}>取消</Button>}
|
|
|
+ footer={<Button key="back" onClick={handleCancel1}>关闭</Button>}
|
|
|
>
|
|
|
<div style={{marginBottom: 10 + 'px'}}>
|
|
|
- <span>诊断信息导入:</span><Upload {...props}><Button type="primary" >导入目录</Button></Upload>
|
|
|
+ <span>诊断信息导入:</span>
|
|
|
+ <Upload {...props}><Button type="primary" >导入目录</Button></Upload>
|
|
|
</div>
|
|
|
- <span style={{color: 'red'}}>提示:EXCEL导入,模板样式及数据请在【朗通云平台-CDSS数据维护-医学术语关联维护】中导出获取。</span>
|
|
|
+ {uploadStatus===1?(<span style={{color: '#00AF71'}}>{uploadTip}</span>):(<span style={{color: '#E3505B'}}>{tipMap[uploadStatus]}</span>)}
|
|
|
</Modal>
|
|
|
<Modal
|
|
|
title="提示"
|
|
@@ -385,7 +379,7 @@ function DiagManager() {
|
|
|
width={800}
|
|
|
visible={visible2}
|
|
|
onCancel={handleCancel2}
|
|
|
- footer={[<Button key="back" onClick={handleCancel2}>取消</Button>,<Button key="1" onClick={handleCancel2}>保存</Button>]}
|
|
|
+ footer={[<Button key="back" onClick={handleCancel2}>关闭</Button>,<Button key="1" onClick={handleCancel2}>保存</Button>]}
|
|
|
>
|
|
|
<MatchDiag row={formData}></MatchDiag>
|
|
|
</Modal>
|