|
@@ -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>
|