Quellcode durchsuchen

手术信息维护

zhouna vor 3 Jahren
Ursprung
Commit
5af7b5ae24

+ 2 - 0
src/api/request.js

@@ -107,6 +107,8 @@ const request = {
 	matchingOperation:'/daqe-center/operationManage/matchingOperation',//匹配手术信息
 	upOperationById:'/daqe-center/operationManage/upOperationById',//通过id修改手术
     importOperation:'/daqe-center/operationManage/importOperation',  //手术导入
+    getMatchingOperationPage:'/daqe-center/operationManage/getMatchingOperationPage',   //待匹配列表
+    getOperationById:'/daqe-center/operationManage/getOperationById',   //已匹配标准手术获取
 	
 
     getColumnVerifyPage:'/daqe-center/columnVerifyManagement/getColumnVerifyPage',//字段校验规则维护列表

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

@@ -20,6 +20,7 @@ import DutyRecord from "../DutyRecord";
 import MedicalTeam from "../MedicalTeam";
 import FieldRules from "../FieldRules";
 import FieldProblem from "../FieldProblem";
+import SurgeryManager from "../SurgeryManager";
 
 // import SurgeryManager from "../SurgeryManager";
 import apiObj from '@api/index';
@@ -47,6 +48,7 @@ const pageMap = {
     'QXGL-YLZGL': <MedicalTeam />,
     'SJZL-ZDJYGZWH': <FieldRules />,
     'SJZL-ZDJYWTMX': <FieldProblem />,
+  	'JCSJ-SSXXWH': <SurgeryManager />,
 }
 
 let firstMenuPage = {};         //第一个菜单,自动激活时用

+ 1 - 1
src/components/DiagManager/MatchDiag.js

@@ -104,7 +104,7 @@ function MatchDiag(props) {
         columns={columns}
         scroll={{ y: 'calc(100vh - 320px)' }}
         dataSource={DiagList}
-        rowKey={record => record.id}
+        rowKey={record => record.icd10}
         pagination={{
           current: current,
           pageSize: size,

+ 111 - 67
src/components/SurgeryManager/MatchSurg.js

@@ -1,81 +1,125 @@
 import React, {
-  useState,
+  useState, useEffect
 } from 'react';
-import { Table } from 'antd';
-import { getCookie,setCookie } from '@utils/index';
+import {  Input, Table,Row,Col } from 'antd';
+import apiObj from '@api/index';
+const { post, api } = apiObj;
+const { Search } = Input;
 
-function AddSurg(props) {
+function MatchSurg(props) {
+  const isMapping = props.row.isMapping==="已匹配";
+  const [DiagList, setDiagList] = useState([]);//当前页列表数据
   const [size, setSize] = useState(15);//每页显示条数
   const [total, setTotal] = useState(0);
   const [current, setCurrent] = useState(1);//当前页
+  const [text,setText] = useState(isMapping?"":props.row.name);//输入框中内容
+  const [diagId,setDiagId] = useState(props.row.id);//诊断id
+  const [selectedRowKeys,setselectedRowKeys] = useState([]);//选中的行id
   const [params, setParams] = useState({
-    pages: 1,
-  	current: 1,
-    size: 15
+	pages: 1,
+	current: 1,
+	size: 15,
+	name:""
   });
- 
- const columns = [
-   { title: '手术和操作代码', dataIndex: 'code',},
-   { title: '标准手术/操作名称', dataIndex: 'standard',},
-   { title: '同义词', dataIndex: 'synonym',},
- ]
- 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=[]
-  
+
+  const columns = [
+	{ title: '手术和操作代码', dataIndex: 'code',},
+	{ title: '标准手术/操作名称', dataIndex: 'standard',},
+	{ title: '同义词', dataIndex: 'synonym',},
+  ];
+  useEffect(() => {
+	let param={};
+	if(isMapping){
+	  param = {id:props.row.id};
+	}else{
+	  //默认搜索手术名称
+	  param = {...params,name:text.trim(),current:1};
+	}
+	getPage(param);
+  }, []);
+  const rowSelection = {
+	preserveSelectedRowKeys:true,
+	selectedRowKeys:selectedRowKeys||[],
+	onChange: (selectedRowKeys, selectedRows) => {
+	  const param = {code:selectedRows[0].code,
+		standard:selectedRows[0].standard,
+		synonym:selectedRows[0].synonym,
+		id:diagId
+	  };
+	  setselectedRowKeys(selectedRowKeys);
+	  //setParams(param);
+	  props.onChange(param);
+	},
+  };
+  //每页显示条数切换
+  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 onSearch(){
+	const param = {...params,name:text.trim(),current:1};
+	setParams({...params,name:text.trim(),current:1});
+	getPage(param);
+  }
+  function onChange(e){
+	const val = e.target.value;
+	setText(val);
+  }
+  function getPage(param) {
+	//已匹配的获取已被匹配的那条数据即可
+	const url = isMapping?api.getOperationById:api.getMatchingOperationPage;
+	post(url, param||params).then((res) => {
+	  if (res.data.code === 200) {
+		const data = res.data.data;
+		const list = isMapping?[data]:data.records;
+		setselectedRowKeys(isMapping?[data.id]:[]);
+		setDiagList(list);
+		setTotal(data.total||1)
+	  }
+	})
+  }
 
   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
-        }} />
-        
-          
+      <>
+		<Row gutter={24}>
+		  <Col span={12} key={0}>
+			<Search placeholder="请输入手术/操作名称" onSearch={onSearch} value={text} onChange={onChange} enterButton style={{marginBottom:'14px'}}/>
+		  </Col>
+		</Row>
+		<Table
+			rowSelection={{type: 'radio',...rowSelection,}}
+			columns={columns}
+			scroll={{ y: 'calc(100vh - 320px)' }}
+			dataSource={DiagList}
+			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 AddSurg;
+export default MatchSurg;

+ 3 - 3
src/components/SurgeryManager/addSurg.js

@@ -62,7 +62,7 @@ function AddSurg(props) {
   return (
     <>
       <Form
-        labelCol={{ span: 6 }}
+        labelCol={{ span: 7 }}
         wrapperCol={{ span: 16 }}
         form={form}
         name="register"
@@ -77,7 +77,7 @@ function AddSurg(props) {
           rules={[
             {
               required: true,
-              message: '请输入',
+              message: '请输入医院手术/操作名称',
             },
           ]}
         >
@@ -94,7 +94,7 @@ function AddSurg(props) {
 		  rules={[
 		    {
 		      required: true,
-		      message: '请输入',
+		      message: '请输入手术和操作代码',
 		    },
 		  ]}
 		>

+ 25 - 4
src/components/SurgeryManager/index.js

@@ -30,6 +30,7 @@ function SurgManager() {
   const [current, setCurrent] = useState(1);//当前页
   const [uploadStatus, setUploadStatus] = useState(0);//导入状态,0初始,1成功,2格式错误,3导入数据错误
   const [uploadTip,setUploadTip] = useState("");		//导入状态提示语
+  const [saveParams, setSaveParams] = useState({});		//匹配诊断选中
   const [params, setParams] = useState({
     pages: 1,
 	current: 1,
@@ -216,7 +217,22 @@ function SurgManager() {
 	}
     },
   };
-  
+
+  function saveMatching(){
+	post(api.matchingOperation, saveParams).then((res) => {
+	  setvisible2(false);
+	  if (res.data.code === 200) {
+		message.success("匹配成功");
+	  }else{
+		message.warning(res.data.message||"匹配失败,请重试");
+	  }
+	}).catch((error)=>{
+	  message.warning(error.message||"接口出错,请重试",);
+	})
+  }
+  function matchChange(data){
+	setSaveParams(data);
+  }
   const columns = [
     { title: '序号', dataIndex: 'index',render: (text, record,index) => (current-1)*params.size+index+1},
     { title: '医院手术/操作名称', dataIndex: 'name',},
@@ -321,7 +337,7 @@ function SurgManager() {
           }} />
       </div>
       {visible && formData ?
-        <Modal
+        <Modal maskClosable={false}
           title={title}
           okText='确定'
           cancelText='关闭'
@@ -348,6 +364,7 @@ function SurgManager() {
         </Modal>
         : ''}
       <Modal
+		maskClosable={false}
         title="提示"
         okText='确定'
         cancelText='关闭'
@@ -359,6 +376,7 @@ function SurgManager() {
         <p>诊断信息删除后将无法恢复,确认删除这{Surgid.length}条信息。</p>
       </Modal>
 	  <Modal
+		maskClosable={false}
 		destroyOnClose={true}
 	    title="提示"
 	    width={400}
@@ -373,14 +391,17 @@ function SurgManager() {
 		{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}
-	  	footer={[<Button key="back" onClick={handleCancel2}>关闭</Button>,<Button key="1" onClick={handleCancel2}>保存</Button>]}
+		onOk={saveMatching}
 	  >
-	    <MatchSurg row={formData}></MatchSurg>
+	    <MatchSurg row={formData} onChange={matchChange}></MatchSurg>
 	  </Modal>
     </div>
   )