Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

zhouna 3 лет назад
Родитель
Сommit
8c13e4bd62

+ 23 - 0
src/api/request.js

@@ -82,6 +82,29 @@ const request = {
     delOfficialCapacityPage:"/daqe-center/officialCapacityManage/delOfficialCapacityPage",      //删除职务变更
     getRecordTemplateManage:"/daqe-center/recordTemplateManage/getRecordTemplateManage",        //查看文书模板
     getRecordTemplatePage:"/daqe-center/recordTemplateManage/getRecordTemplatePage",        //文书模板列表
+	
+	//诊断管理
+	getDiseasePage:'/daqe-center/diseaseManage/getDiseasePage',//获取诊断分页列表
+	addDisease:'/daqe-center/diseaseManage/addDisease',//添加诊断
+	delDiseaseById:'/daqe-center/diseaseManage/delDiseaseById',//通过id删除诊断
+	matchingDisease:'/daqe-center/diseaseManage/matchingDisease',//匹配诊断
+	upDiseaseById:'/daqe-center/diseaseManage/upDiseaseById',//修改诊断
+	
+	//药品管理
+	getDrugPage:'/daqe-center/drugManage/getDrugPage',//获取药品分页列表
+	delDrugById:'/daqe-center/drugManage/delDrugById',//通过id删除药品
+	addDrug:'/daqe-center/drugManage/addDrug',//新增药品
+	matchingDrug:'/daqe-center/drugManage/matchingDrug',//匹配药品信息
+	upDrugById:'/daqe-center/drugManage/upDrugById',//通过id修改药品
+	
+	//手术管理
+	getOperationPage:'/daqe-center/operationManage/getOperationPage',//获取手术分页列表
+	delOperationById:'/daqe-center/operationManage/delOperationById',//通过id删除手术
+	addOperation:'/daqe-center/operationManage/addOperation',//新增手术
+	matchingOperation:'/daqe-center/operationManage/matchingOperation',//匹配手术信息
+	upOperationById:'/daqe-center/operationManage/upOperationById',//通过id修改手术
+	
+	
 
 }
 

+ 2 - 0
src/components/AMenu/index.js

@@ -14,6 +14,7 @@ import LoginLog from "../LoginLog";
 import ExceptionLog from "../ExceptionLog";
 import MyMessage from "../MyMessage";
 import MsgManage from "../MsgManage";
+import DiagManager from "../DiagManager"
 import DocTemplate from "../DocTemplate";
 import DutyRecord from "../DutyRecord";
 import MedicalTeam from "../MedicalTeam";
@@ -36,6 +37,7 @@ const pageMap = {
     'RZGL-YCRZ': <ExceptionLog />,
     'ZNTZ-WDTZ': <MyMessage />,
     'ZNTZ-TZGL': <MsgManage />,
+	'JCSJ-ZDXXWH': <DiagManager />,
   	'JCSJ-WSMBWH': <DocTemplate />,
     'JCSJ-ZWZCBGJL': <DutyRecord />,
     'QXGL-YLZGL': <MedicalTeam />,

+ 4 - 0
src/components/DiagManager/Diag-context.js

@@ -0,0 +1,4 @@
+import { createContext } from 'react';
+const DiagContext = createContext(null);
+
+export default DiagContext;

+ 92 - 0
src/components/DiagManager/MatchDiag.js

@@ -0,0 +1,92 @@
+import React, {
+  useState, useEffect, useContext
+} from 'react';
+import { Form, Input, Select, Button, Switch, TreeSelect, message, Space,Table } from 'antd';
+import apiObj from '@api/index';
+import { getCookie,setCookie } from '@utils/index';
+import DiagContext from './Diag-context';
+import { useSelector } from 'react-redux'
+import Item from 'antd/lib/list/Item';
+const { post, api } = apiObj;
+const { TextArea } = Input;
+
+function AddDiag(props) {
+  const [size, setSize] = useState(15);//每页显示条数
+  const [total, setTotal] = useState(0);
+  const [current, setCurrent] = useState(1);//当前页
+  const [params, setParams] = useState({
+    pages: 1,
+  	current: 1,
+    size: 15
+  });
+  const [form] = Form.useForm();
+  const staticInfo = useSelector(state => {
+    return state.staticInfo;
+  });
+console.log(props.row)
+ 
+ const columns = [
+   { title: 'ICD-10编码', dataIndex: 'icd10',},
+   { title: '标准诊断名称', dataIndex: 'standard',},
+   { title: '同义词', dataIndex: 'isMapping',},
+ ]
+ const rowSelection = {
+   onChange: (selectedRowKeys, selectedRows) => {
+     console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
+   },
+   getCheckboxProps: (record) => ({
+     disabled: record.name === 'Disabled User',
+     // Column configuration not to be checked
+     name: record.name,
+   }),
+ };
+ //每页显示条数切换
+ function onSizeChange(current, pageSize) {
+   params.current = current
+   params.size = pageSize
+   setSize(pageSize)
+   setCurrent(current)
+   setParams(params)
+   getPage()
+ }
+ //翻页
+ function changePage(page, pageSize) {
+   params.current = page
+   params.size = pageSize
+   setCurrent(page)
+   setParams(params)
+   getPage()
+ }
+ function getPage() {
+   
+ }
+ const list=[]
+  
+
+  return (
+    <>
+      <Table
+        rowSelection={{type: 'checkbox',...rowSelection,}}
+        columns={columns}
+        scroll={{ y: 'calc(100vh - 320px)' }}
+        dataSource={list}
+        rowKey={record => record.code}
+        pagination={{
+          current: current,
+          pageSize: size,
+          size: 'small',
+          showSizeChanger: true,
+          pageSizeOptions: ['15', '30', '60', '120'],
+          showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
+          onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
+          onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
+          total: total
+        }} />
+        
+          
+
+    </>
+  );
+}
+
+export default AddDiag;

+ 145 - 0
src/components/DiagManager/addDiag.js

@@ -0,0 +1,145 @@
+import React, {
+  useState, useEffect, useContext
+} from 'react';
+import { Form, Input, Select, Button, Switch, TreeSelect, message, Space } from 'antd';
+import apiObj from '@api/index';
+import { getCookie,setCookie } from '@utils/index';
+import DiagContext from './Diag-context';
+import { useSelector } from 'react-redux'
+import Item from 'antd/lib/list/Item';
+const { post, api } = apiObj;
+const { TextArea } = Input;
+
+function AddDiag(props) {
+  
+  const [form] = Form.useForm();
+  const { type, formData} = useContext(DiagContext);
+  const staticInfo = useSelector(state => {
+    return state.staticInfo;
+  });
+  const initialValues = formData;
+
+  const onFinish = values => {
+	  values.status ? values.status=1:values.status=0
+    let params = values
+    if (type == 3) {
+	  params.id=initialValues.id
+      upDiseaseById(params)
+    } else {
+      addDisease(params)
+    }
+
+  };
+  function addDisease(param) {
+    const hisId = getCookie("hospitalId");
+	const params ={
+		hospitalId:hisId,
+		...param
+	}
+	post(api.addDisease, params).then((res) => {
+      if (res.data.code === 200) {
+        props.DiagChange()
+        message.success(res.data.message);
+      } else {
+        message.error(res.data.message);
+      }
+    })
+  }
+  function upDiseaseById(param) {
+	  const hisId = getCookie("hospitalId");
+	  const params ={
+	  	hospitalId:hisId,
+	  	...param
+	  }
+    post(api.upDiseaseById, params).then((res) => {
+      if (res.data.code === 200) {
+        props.DiagChange()
+        message.success(res.data.message);
+      } else {
+        message.error(res.data.message);
+      }
+    })
+  }
+  function cancel() {
+  	props.cancel()
+  }
+  
+  function onValuesChange() {
+  	props.isChange(form.isFieldsTouched())
+  }
+
+  return (
+    <>
+      <Form
+        labelCol={{ span: 6 }}
+        wrapperCol={{ span: 16 }}
+        form={form}
+        name="register"
+        onFinish={onFinish}
+        initialValues={initialValues}
+		onValuesChange={onValuesChange}
+      >
+
+        <Form.Item
+          name="name"
+          label="医院诊断名称"
+          rules={[
+            {
+              required: true,
+              message: '请输入医院诊断名称',
+            },
+          ]}
+        >
+          {type == 3 ?
+		    <Input  autoComplete='off'/>
+            :
+            <Input placeholder="请输入医院诊断名称" autoComplete='off'/>
+          }
+
+        </Form.Item>
+		<Form.Item
+		  name="code"
+		  label="code"
+		  rules={[
+		    {
+		      required: true,
+		      message: '请输入code',
+		    },
+		  ]}
+		>
+		  {type == 3 ?
+		    <Input  autoComplete='off'/>
+		    :
+		    <Input placeholder="请输入code" autoComplete='off'/>
+		  }
+		
+		</Form.Item>
+        <Form.Item
+          name="icd10"
+          label="ICD-10编码:"
+        >
+          {type == 3 ?
+            <Input  autoComplete='off'/>
+            :
+            <Input placeholder="请输入ICD-10编码:" autoComplete='off'/>
+          }
+
+        </Form.Item>
+        
+          <Form.Item wrapperCol={{ offset: 8, span: 16 }}>
+            <Space size="middle">
+              <Button htmlType="button" onClick={e => cancel()}>
+                取消
+            </Button>
+              <Button type="primary" htmlType="submit">
+                保存
+            </Button>
+            </Space>
+          </Form.Item>
+
+      </Form>
+    </>
+  );
+}
+
+export default AddDiag;

+ 396 - 0
src/components/DiagManager/index.js

@@ -0,0 +1,396 @@
+import React, { useState, useEffect, useRef } from 'react';
+import { Form, Input, Button, Table, Select, Pagination, Space, Modal,  message, Row, Col, Upload } from 'antd';
+import { PlusOutlined } from '@ant-design/icons';
+import AddDiag from './addDiag'
+import MatchDiag from './MatchDiag.js'
+import '@common/common.less';
+// import { useSelector } from 'react-redux'
+import apiObj from '@api/index';
+import DiagContext from './Diag-context';
+
+const { post, api, xPost } = apiObj;
+const { Option } = Select;
+//获取列表
+function DiagManager() {
+  useEffect(() => {
+    getDiseasePage();
+  }, []);
+  const [DiagList, setDiagList] = useState([]);//当前页列表数据
+  const [Diagid, setDiagid] = useState([]);//当前列表id
+  const [title, setTitle] = useState("");//数据总量
+  const [visible, setVisible] = useState(false);//新增修改 弹窗
+  const [msvisible, setMsvisible] = useState(false);//删除 弹窗
+  const [visible1, setvisible1] = useState(false);//导入 弹窗
+  const [visible2, setvisible2] = useState(false);//匹配 弹窗
+  const [unsaved, setUnsaved] = useState(false);//修改未保存弹窗
+  const [revise, setRevise] = useState(false);//是否修改 新增修改内容
+  const [type, setType] = useState("");
+  const [formData, setFormData] = useState(null);//当前行数据
+  const [size, setSize] = useState(15);//每页显示条数
+  const [total, setTotal] = useState(0);
+  const [current, setCurrent] = useState(1);//当前页
+  const [params, setParams] = useState({
+    pages: 1,
+	current: 1,
+    size: 15
+  });
+  const [form] = Form.useForm();
+
+
+  let list = []
+  let data = {
+    pages: 1,
+    current: 1,
+    size: size
+  }
+  //新增 弹窗
+  const showModal = (name, type, flag, Diagrow) => {
+    setVisible(type);
+    setTitle(name);
+    setType(flag)
+    if (flag == 1) {
+      setFormData({
+        status: '1'
+      })
+    }
+    if (flag == 3) {
+		setFormData(Diagrow)
+		getDiseasePage()
+		}
+  }
+  //表格数据
+  function getDiseasePage(param) {
+    post(api.getDiseasePage, param || params).then((res) => {
+      if (res.data.code === 200) {
+        const data = res.data.data;
+        setDiagList(data.records);
+        setTotal(data.total)
+      }
+    })
+  }
+  
+  //模糊查询
+  // 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) => {
+      if (res.data.code === 200) {
+        getDiseasePage();
+        setMsvisible(false);
+		setDiagid(null)
+        message.success("删除成功");
+      } else {
+        message.warning(res.data.msg || '操作失败');
+      }
+    }).catch(() => {
+      message.error("接口出错");
+    });
+  }
+  //每页显示条数切换
+  function onSizeChange(current, pageSize) {
+    params.current = current
+    params.size = pageSize
+    setSize(pageSize)
+    setCurrent(current)
+    setParams(params)
+    getDiseasePage()
+  }
+  //翻页
+  function changePage(page, pageSize) {
+    params.current = page
+    params.size = pageSize
+    setCurrent(page)
+    setParams(params)
+    getDiseasePage()
+  }
+  const onFinish = (value) => {
+    const param = {
+      ...data,
+      ...value
+    }
+    setCurrent(1)
+    setParams(param)
+    getDiseasePage(param);
+  };
+  //重置
+  const onReset = () => {
+    setCurrent(1)
+    setParams(data)
+    form.resetFields();
+    getDiseasePage(data);
+  };
+  //打开导入弹窗
+  const ImportBox = () => {
+    setvisible1(true)
+  }
+  //导入弹窗取消或关闭
+  function handleCancel1() {
+      setvisible1(false);
+  }
+  //打开匹配弹窗
+  function match(row){
+    setvisible2(true)
+	setFormData(row)
+	console.log(row)
+  }
+  //导入弹窗取消或关闭
+  function handleCancel2() {
+      setvisible2(false);
+  }
+  const messageBox = () => {
+	if(!Diagid.length){
+	  message.warning("请先选择要删除的记录~",1);
+	  return;
+	}
+    setMsvisible(true)
+  }
+//删除 提示框取消或关闭
+  function handleCancel() {
+    setMsvisible(false);
+  }
+  
+  //新增修改 取消或关闭
+  function cancel() {
+	if(revise){
+		setUnsaved(true)
+	}else{
+		setVisible(false)
+		setFormData(null)
+	}
+  }
+  
+  function isChange(a) {
+  	setRevise(a)
+  }
+  
+  function addCancel() {
+	setRevise(false)
+	setVisible(false)
+	setUnsaved(false)
+	setFormData(null)
+  }
+  
+  function unsavedCancel() {
+    setUnsaved(false)
+  }
+
+  //新增修改 保存
+  function DiagChange() {
+	setRevise(false)
+    setVisible(false)
+	getDiseasePage();
+  }
+  const DataType =[]
+  const rowSelection = {
+    onChange: (selectedRowKeys, selectedRows) => {
+      console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
+	  setDiagid(selectedRowKeys)
+    }
+  };
+  //导入模板
+  const props = {
+    name: 'file',
+    action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
+    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 columns = [
+    { title: '序号', dataIndex: 'id',},
+    { title: '医院诊断名称', dataIndex: 'name',},
+    { title: 'ICD-10编码', dataIndex: 'icd10',},
+    { title: '标准诊断名称', dataIndex: 'standard',},
+    { title: '是否匹配', dataIndex: 'isMapping',},
+    {
+      title: '操作', dataIndex: 'key', render: (text, record) => (
+        <Space size="middle">
+          <a onClick={e => showModal('修改字典', true, 3, record)}>修改</a>
+		  <a onClick={e => match(record)}>匹配</a>
+        </Space>
+      )
+    }
+  ]
+  return (
+    <div className="wrapper">
+      <div className="filter-box">
+        <Form
+          form={form}
+          name="normal_login"
+          onFinish={onFinish}
+          initialValues={{ status: '' }}
+        >
+          <Row gutter={24}>
+		  <Col span={4} key={0}>
+		    <Form.Item label="医院诊断名称" name="name">
+		      <Input placeholder="医院诊断名称" autoComplete='off'/>
+		    </Form.Item>
+		  </Col>
+		  <Col span={4} key={1}>
+		    <Form.Item label="ICD-10编码" name="icd10">
+		      <Input placeholder="ICD-10编码" autoComplete='off'/>
+		    </Form.Item>
+		  </Col>
+		  <Col span={4} key={2}>
+		    <Form.Item label="标准诊断名称" name="standard">
+		      <Input placeholder="标准诊断名称" autoComplete='off'/>
+		    </Form.Item>
+		  </Col>
+            <Col span={4} key={3}>
+              <Form.Item id="groupTypeval" label="是否匹配" name="isMapping">
+                <Select
+                  showSearch
+                      optionFilterProp="children"
+					  // onSearch={onSearch}
+					  // onFocus={onFocus}
+					  placeholder="全部"
+                >
+                    <Option value={0} key={0}>未匹配</Option>
+					<Option value={1} key={1}>已匹配</Option>
+                </Select>
+              </Form.Item>
+            </Col>
+            
+            
+            <Col span={8} key={4}>
+              <Form.Item>
+                <Button type="primary" htmlType="submit">
+                  查询
+                </Button>
+                <Button onClick={onReset}>
+                  重置
+                </Button>
+              </Form.Item>
+            </Col>
+          </Row>
+        </Form>
+      </div>
+
+      <div className="table">
+        <div className="table-header">
+          <h2 className="table-title">诊断信息维护</h2>
+		  <Row gutter={12}>
+		    <Col key={0}>
+              <Button type="primary" icon={<PlusOutlined />} onClick={e => showModal('新增', true, 1)}>新增</Button>
+		    </Col>
+			<Col key={1}>
+		      <Button  onClick={e => messageBox()} className="delete" >删除</Button>
+		    </Col>
+			<Col key={2}>
+			  <Button type="primary"  onClick={e => ImportBox()}>导入</Button>
+			</Col>
+		  </Row>
+        </div>
+
+        <Table
+		  rowSelection={{type: 'checkbox',...rowSelection,}}
+          columns={columns}
+          scroll={{ y: 'calc(100vh - 320px)' }}
+          dataSource={DiagList}
+          rowKey={record => record.id}
+          pagination={{
+            current: current,
+            pageSize: size,
+            size: 'small',
+            showSizeChanger: true,
+            pageSizeOptions: ['15', '30', '60', '120'],
+            showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
+            onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
+            onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
+            total: total
+          }} />
+      </div>
+      {visible && formData ?
+        <Modal
+          title={title}
+          okText='确定'
+          cancelText='取消'
+          width={'45%'}
+          visible={visible}
+          onCancel={cancel}
+          footer={null}
+          forceRender={true}
+        >
+          <DiagContext.Provider value={{type, formData}}>
+            <AddDiag DiagChange={DiagChange} cancel={cancel} isChange={isChange}/>
+          </DiagContext.Provider>
+				<Modal
+				title="提示"
+				okText='确定'
+				cancelText='取消'
+				width={400}
+				visible={unsaved}
+				onOk={addCancel}
+				onCancel={unsavedCancel}
+				 >
+				<p>当前数据未保存 是否确认关闭?</p>
+				</Modal>
+        </Modal>
+        : ''}
+      <Modal
+        title="提示"
+        okText='确定'
+        cancelText='取消'
+        width={400}
+        visible={msvisible}
+        onOk={delDiseaseById}
+        onCancel={handleCancel}
+      >
+        <p>诊断信息删除后将无法恢复,确认删除这{Diagid.length}条信息。</p>
+      </Modal>
+	  <Modal
+	    title="提示"
+	    cancelText='关闭'
+	    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>
+		<span style={{color: 'red'}}>提示:EXCEL导入,模板样式及数据请在【朗通云平台-CDSS数据维护-医学术语关联维护】中导出获取。</span>
+	  </Modal>
+	  <Modal
+	    title="提示"
+	    cancelText='关闭'
+	    width={800}
+	    visible={visible2}
+	    onCancel={handleCancel2}
+	  	footer={[<Button key="back" onClick={handleCancel2}>取消</Button>,<Button key="1" onClick={handleCancel2}>保存</Button>]}
+	  >
+	    <MatchDiag row={formData}></MatchDiag>	
+	  </Modal>
+    </div>
+  )
+}
+
+export default DiagManager;

+ 1 - 0
src/components/DutyRecord/index.js

@@ -57,6 +57,7 @@ function DutyRecord() {
   }
   //删除弹窗确认
   function showDelModal(flag){
+	  console.log(selectedRowKeys)
     if(flag&&!selectedRowKeys.length){
 	  message.warning("请先选择要删除的记录~",1);
 	  return;