Browse Source

选择子医院进入

zhouna 3 năm trước cách đây
mục cha
commit
da31e272e7

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

@@ -242,7 +242,6 @@ function OrgManager(){
                             </Form.Item>
                         </Col>
                         <Col span={5} key={1}>
-
                             <Form.Item name="type" label="类型">
                                 <Select
                                     allowClear

+ 1 - 1
src/components/PageLayout/index.js

@@ -27,7 +27,7 @@ function PageLayout(){
         post(api.getManagerBoxInfo).then((res) => {
             if (res.data.code === 200) {
                 const data = res.data.data;
-                dispatch(setHisTypeList(data[43]));
+                dispatch(setHisTypeList(data[43]||data[45]));       //非单家医院为医院类型43,单家医院为病区45
                 dispatch(setStatusList(data[47]));
                 dispatch(setTitleList(data[40]));
                 dispatch(setDataList(data[48]));

+ 28 - 5
src/components/SysChoose/index.js

@@ -1,7 +1,7 @@
 import {useEffect,useState} from 'react';
 import { useDispatch, useSelector } from 'react-redux'
 import { setSys } from '@reducers/userInfo.js';
-import { Radio, Row, Col,Steps } from 'antd';
+import { Radio, Row, Col,Steps, Select, Button } from 'antd';
 import AHeader from '../AHeader'
 import './index.less'
 import iconLb from '@images/lb.png';
@@ -13,11 +13,14 @@ import apiObj from '@api/index';
 const {api,xPost,interceptors} = apiObj;
 
 const { Step } = Steps;
+const {Option} = Select;
 function SysChoose({history}) {
     //const [current, setCurrent] = useState(1);
-    const [sysId, setSysId] = useState(1);
-    const [orgList, setOrgList] = useState([]);
-    const [hisList, setHisList] = useState([]);
+    const [sysId, setSysId] = useState(1);      //选中的系统id
+    const [subHisId, setSubHisId] = useState('');      //选中的子医院id
+    const [showId, setShowId] = useState('');       //要显示子医院列表的医院id
+    const [orgList, setOrgList] = useState([]);     //系统列表
+    const [hisList, setHisList] = useState([]);     //当前选中系统下的医院列表
     const dispatch = useDispatch();
     const steps = [
         {
@@ -59,6 +62,13 @@ function SysChoose({history}) {
         interceptors({sysId,hisId:id});
         history.push("/manage");
     }
+    //显示子医院列表,传空为隐藏,传id为显示
+    function showSubPop(id){
+        setShowId(id);
+    }
+    function onSelect(id){
+        setSubHisId(id);
+    }
     useEffect(()=>{
         getOrgList();
     },[]);
@@ -111,7 +121,20 @@ function SysChoose({history}) {
                                                         </div>
                                                         <div className="card-content">
                                                             <div className='name'>{it.hospitalName}</div>
-                                                            <a className='get-in' onClick={()=>getIn(it.hospitalId)}>点击进入 <img src={rightIcon} alt="箭头"/></a>
+                                                            {it.type!==0?(<><a className='get-in' onClick={()=>showSubPop(it.hospitalId)}>点击选择 <img src={rightIcon} alt="箭头"/></a>
+                                                                {showId===it.hospitalId?<div className="pop-select">
+                                                                <p className='pop-title'>
+                                                                    <span>选择子组织</span>
+                                                                    <a className='close' onClick={()=>showSubPop('')}>收起</a>
+                                                                </p>
+                                                                <Select size='small' placeholder='请选择' onChange={(id)=>onSelect(id)} style={{ width: 278,marginRight:'6px' }}>
+                                                                    {(it.children||[]).map((item)=>{
+                                                                       return (<Option value={item.hospitalId} key={item.hospitalId}>{item.hospitalName}</Option>)
+                                                                    })
+                                                                    }
+                                                                </Select>
+                                                                <Button type='primary' size='small' onClick={()=>getIn(subHisId)}>进入</Button>
+                                                            </div>:''}</>):(<a className='get-in' onClick={()=>getIn(it.hospitalId)}>点击进入 <img src={rightIcon} alt="箭头"/></a>)}
                                                         </div>
                                                     </div>
                                                 </Col>

+ 24 - 0
src/components/SysChoose/index.less

@@ -83,5 +83,29 @@
       line-height: 30px;
       border-radius: 4px;
     }
+    .pop-select{
+      width: 364px;
+      height: 213px;
+      position: absolute;
+      left: 173px;
+      top: 56px;
+      padding: 10px;
+      box-sizing: border-box;
+      background: #FFFFFF;
+      box-shadow: 0px 2px 12px 0px #B3BDBF;
+      border-radius: 4px;
+      .pop-title{
+        color: @disabled-color;
+        margin-bottom: 3px;
+        .close{
+          float: right;
+          color: @disabled-color;
+        }
+      }
+    }
+  }
+  .card-content{
+    position: relative;
+
   }
 }