1178232204@qq.com 3 年之前
父节点
当前提交
a2cb979647

+ 1 - 1
src/api/index.js

@@ -1,7 +1,7 @@
 import api from './request';
 import { Modal } from 'antd';
 const axios=require('axios');
-// axios.defaults.baseURL = 'http://192.168.2.237:8871';//'http://192.168.2.237:8871/';
+axios.defaults.baseURL = 'http://192.168.2.237:8871';//'http://192.168.2.237:8871/';
 const CancelToken = axios.CancelToken;
 const source = CancelToken.source();
 const post=(url,data)=>{

+ 0 - 128
src/components/DrugManager/MatchDrug.js

@@ -1,128 +0,0 @@
-import React, {
-  useState, useEffect
-} from 'react';
-import {  Input, Table,Row,Col } from 'antd';
-import apiObj from '@api/index';
-const { post, api } = apiObj;
-const { Search } = Input;
-
-function MatchDrug(props) {
-  const isMapping = props.row.isMapping==="已匹配";
-  const [DrugList, setDrugList] = 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 [DrugId,setDrugId] = useState(props.row.id);//诊断id
-  const [selectedRowKeys,setselectedRowKeys] = useState([]);//选中的行id
-  const [params, setParams] = useState({
-    pages: 1,
-  	current: 1,
-    size: 15,
-    name:""
-  });
- 
- const columns = [
-   { title: 'ICD-10编码', dataIndex: 'icd10',},
-   { 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 = {icd10:selectedRows[0].icd10,
-       standard:selectedRows[0].standard,
-       synonym:selectedRows[0].synonym,
-       id:DrugId
-     };
-	 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.getDrugById:api.getConceptLibraryPage;
-   const pm = param||params;
-   const paramData = isMapping?pm:{...pm,type:3};  //type:1:诊断,2:手术,3:药品
-   post(url, paramData).then((res) => {
-	 if (res.data.code === 200) {
-	   const data = res.data.data;
-	   const list = isMapping?[data]:data.records;
-	   setselectedRowKeys(isMapping?[data.id]:[]);
-	   setDrugList(list);
-	   setTotal(data.total||0)
-	 }
-   })
- }
-
-  return (
-    <>
-	  <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={DrugList}
-        rowKey={record => record.standard}
-        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,
-          showQuickJumper:true,
-        }} />
-        
-          
-
-    </>
-  );
-}
-
-export default MatchDrug;

+ 42 - 87
src/components/DrugManager/index.js

@@ -277,93 +277,48 @@ function DrugManager() {
 		  </Form>
 		</div>
 
-        <Table
-          rowSelection={{ type: 'checkbox', ...rowSelection, }}
-          columns={columns}
-          dataSource={DrugList}
-          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,
-            showQuickJumper:true,
-          }} />
-      {visible && formData ?
-        <Modal
-          title={title}
-          okText='确定'
-          cancelText='关闭'
-          width={'45%'}
-          visible={visible}
-          onCancel={cancel}
-          footer={null}
-          forceRender={true}
-          maskClosable={false}
-        >
-          <DrugContext.Provider value={{ type, formData }}>
-            <AddDrug DrugChange={DrugChange} cancel={cancel} isChange={isChange} />
-          </DrugContext.Provider>
-          <Modal
-            maskClosable={false}
-            title="提示"
-            okText='确定'
-            cancelText='关闭'
-            width={400}
-            visible={unsaved}
-            onOk={addCancel}
-            onCancel={unsavedCancel}
-          >
-            <p>当前数据未保存 是否确认关闭?</p>
-          </Modal>
-        </Modal>
-        : ''}
-      <Modal
-        maskClosable={false}
-        title="提示"
-        okText='确定'
-        cancelText='关闭'
-        width={400}
-        visible={msvisible}
-        onOk={delDrugById}
-        onCancel={handleCancel}
-      >
-        <p>药品信息删除后将无法恢复,确认删除这{Drugid.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}
-      >
-        <MatchDrug row={formData} onChange={matchChange}></MatchDrug>
-      </Modal>
-    </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('新增药品信息',1)}>新增</Button>
+			  </Col>
+			</Row>
+		  </div>
+		  <ConfigProvider renderEmpty={loading?renderEmpty:""}>
+		  <Table
+              /*rowSelection={{ type: 'checkbox', ...rowSelection, }}*/
+			  columns={columns}
+			  dataSource={DrugList}
+			  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
+			  }} />
+			  </ConfigProvider>
+		</div>
+		  <AddTerm formData={formData}  termSType={5} termType={5} onOk={saveMatching} title={title} visible={visible} cancel={cancel} flag={flag}/>
+		<Modal
+			maskClosable={false}
+			title="删除药品信息"
+			okText='确定'
+			cancelText='关闭'
+			width={400}
+			visible={delvisible}
+			onOk={delDrugeryById}
+			onCancel={handleCancel}
+		>
+		  <p>药品信息删除后将无法恢复,确认删除这条药品信息。</p>
+		</Modal>
+	  </div>
   )
 }
 

+ 0 - 128
src/components/SurgeryManager/MatchSurg.js

@@ -1,128 +0,0 @@
-import React, {
-  useState, useEffect
-} from 'react';
-import {  Input, Table,Row,Col } from 'antd';
-import apiObj from '@api/index';
-const { post, api } = apiObj;
-const { Search } = Input;
-
-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,
-	name:""
-  });
-
-  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.getConceptLibraryPage;
-	const pm = param||params;
-	const paramData = isMapping?pm:{...pm,type:2};  //type:1:诊断,2:手术,3:药品
-	post(url, paramData).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||0)
-	  }
-	})
-  }
-
-  return (
-      <>
-		<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.standard}
-			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,
-			  showQuickJumper:true,
-			}} />
-
-
-
-      </>
-  );
-}
-
-export default MatchSurg;

+ 42 - 86
src/components/SurgeryManager/index.js

@@ -254,92 +254,48 @@ function SurgManager() {
 		  </Form>
 		</div>
 
-        <Table
-          rowSelection={{ type: 'checkbox', ...rowSelection, }}
-          columns={columns}
-          dataSource={SurgList}
-          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,
-            showQuickJumper:true,
-          }} />
-      {visible && formData ?
-        <Modal maskClosable={false}
-          title={title}
-          okText='确定'
-          cancelText='关闭'
-          width={'45%'}
-          visible={visible}
-          onCancel={cancel}
-          footer={null}
-          forceRender={true}
-        >
-          <SurgContext.Provider value={{ type, formData }}>
-            <AddSurg SurgChange={SurgChange} cancel={cancel} isChange={isChange} />
-          </SurgContext.Provider>
-          <Modal
-            title="提示"
-            okText='确定'
-            cancelText='关闭'
-            width={400}
-            visible={unsaved}
-            onOk={addCancel}
-            onCancel={unsavedCancel}
-            maskClosable={false}
-          >
-            <p>当前数据未保存 是否确认关闭?</p>
-          </Modal>
-        </Modal>
-        : ''}
-      <Modal
-        maskClosable={false}
-        title="提示"
-        okText='确定'
-        cancelText='关闭'
-        width={400}
-        visible={msvisible}
-        onOk={delOperationById}
-        onCancel={handleCancel}
-      >
-        <p>诊断信息删除后将无法恢复,确认删除这{Surgid.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}
-      >
-        <MatchSurg row={formData} onChange={matchChange}></MatchSurg>
-      </Modal>
-    </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('新增手术/操作信息',1)}>新增</Button>
+			  </Col>
+			</Row>
+		  </div>
+		<ConfigProvider renderEmpty={loading?renderEmpty:""}>
+		  <Table
+              /*rowSelection={{ type: 'checkbox', ...rowSelection, }}*/
+			  columns={columns}
+			  dataSource={SurgList}
+			  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
+			  }} />
+			  </ConfigProvider>
+		</div>
+		  <AddTerm formData={formData}  termSType={6} termType={6} onOk={saveMatching} title={title} visible={visible} cancel={cancel}  flag={flag}/>
+		<Modal
+			maskClosable={false}
+			title="删除手术/操作信息"
+			okText='确定'
+			cancelText='关闭'
+			width={400}
+			visible={delvisible}
+			onOk={delSurgeryById}
+			onCancel={handleCancel}
+		>
+		  <p>手术信息删除后将无法恢复,确认删除这条手术信息。</p>
+		</Modal>
+	  </div>
   )
 }