|
@@ -3,7 +3,7 @@ import axios from '@utils/ajax';
|
|
|
import styles from "./index.less";
|
|
|
import { Notify, DelToast } from '@commonComp';
|
|
|
import $ from 'jquery';
|
|
|
-import dowm from '../img/down.png';
|
|
|
+import down from '../img/down.png';
|
|
|
import del from '../img/close.png';
|
|
|
|
|
|
class SearchSelect extends Component {
|
|
@@ -16,6 +16,7 @@ class SearchSelect extends Component {
|
|
|
};
|
|
|
this.handleBlur = this.handleBlur.bind(this);
|
|
|
this.getDrugWayList = this.getDrugWayList.bind(this);
|
|
|
+ this.confirm = this.confirm.bind(this);
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
@@ -43,6 +44,9 @@ class SearchSelect extends Component {
|
|
|
const item = Object.assign(part, { uniqueName: hosId === -1 ? part.name : undefined }); //朗通的需要传uniqueName
|
|
|
selectJiType(item, idx, type)
|
|
|
handlePush && handlePush({ mode: 8 });
|
|
|
+ this.setState({
|
|
|
+ inpVal: part.name,
|
|
|
+ });
|
|
|
}
|
|
|
handleFocu(e){
|
|
|
const val = e.target.value;
|
|
@@ -64,6 +68,11 @@ class SearchSelect extends Component {
|
|
|
//搜索
|
|
|
this.getDrugWayList(val)
|
|
|
}
|
|
|
+ confirm(){
|
|
|
+ let val = this.state.inpVal
|
|
|
+ console.log(this.state);
|
|
|
+ this.getDrugWayList(val)
|
|
|
+ }
|
|
|
//获取药品剂型15,、给药途径16
|
|
|
getDrugWayList(val) {
|
|
|
const { hosId, type } = this.props;
|
|
@@ -76,7 +85,7 @@ class SearchSelect extends Component {
|
|
|
return
|
|
|
}
|
|
|
axios.json('/demo/retrieval/index', {
|
|
|
- "inputStr": val.trim(),
|
|
|
+ "inputStr": val,
|
|
|
"type": type,
|
|
|
"hospitalId": hosId,
|
|
|
"defaultList":type==15?0:1
|
|
@@ -98,7 +107,7 @@ class SearchSelect extends Component {
|
|
|
return (
|
|
|
<div className={styles.medType}>
|
|
|
<input placeholder={title} value={selected} title={selected} className={styles.inpSearch} onFocus={(e) => this.handleFocu(e)} onInput={(e) => this.handleChange(e)} />
|
|
|
- <img className={styles.down} src={dowm} alt="" />
|
|
|
+ <img className={show?styles.up:styles.down} src={down} alt="" onClick={this.confirm}/>
|
|
|
{inpVal? <img className={styles.clear} src={del} alt="清空" onClick={(e) => this.handleChange(e, true)} /> : ''}
|
|
|
{
|
|
|
show ? <ul className={styles.selectLis}>
|