1178232204@qq.com пре 3 година
родитељ
комит
8dbecd6d58

+ 2 - 1
src/components/AddNewInspect/SearchSelect/index.jsx

@@ -44,6 +44,7 @@ class SearchSelect extends Component {
     selectJiType(item, idx, type)
     handlePush && handlePush({ mode: 8 });
   }
+  
   handleFocu(e){
     const val = e.target.value;
     this.getDrugWayList(val)
@@ -66,6 +67,7 @@ class SearchSelect extends Component {
   }
   //获取药品剂型15,、给药途径16
   getDrugWayList(val) {
+    console.log(123);
     const { hosId, type } = this.props;
     if(!val && type == 15){
       this.setState({
@@ -98,7 +100,6 @@ 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="" />
         {inpVal? <img className={styles.clear} src={del} alt="清空" onClick={(e) => this.handleChange(e, true)} /> : ''}
         {
           show ? <ul className={styles.selectLis}>

+ 3 - 1
src/components/AddNewInspect/SearchSelect/index.less

@@ -36,7 +36,9 @@
         z-index: 9;
         overflow: auto;
         li{
-            padding-left: 5px;
+            height: 35 px;
+            line-height: 35px;
+            padding: 0 8px;
             cursor: pointer;
             white-space:nowrap;
             overflow:hidden;

+ 12 - 3
src/components/AddNewInspect/SearchSelect2/index.jsx

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

+ 59 - 48
src/components/AddNewInspect/SearchSelect2/index.less

@@ -1,53 +1,64 @@
 @import "~@less/variables.less";
-.medType{
+.medType {
+  display: inline-block;
+  width: 110px;
+  border: 1px solid #aaa;
+  border-radius: 3px;
+  position: relative;
+  margin-right: 10px;
+  .down {
+    width: 8px;
+    height: 5px;
+    position: absolute;
+    cursor: pointer;
+    top: 8px;
+    right: 5px;
+  }
+  .up {
+    width: 8px;
+    height: 5px;
+    position: absolute;
+    cursor: pointer;
+    top: 8px;
+    right: 5px;
+    transform: rotate(180deg);
+  }
+  .clear {
+    display: none;
+    width: 12px;
+    height: 12px;
+    position: absolute;
+    cursor: pointer;
+    top: 5px;
+    right: 4px;
+  }
+  &:hover .clear {
     display: inline-block;
-    width: 110px;
-    border:1px solid #aaa;
-    border-radius: 3px;
-    position: relative;
-    margin-right: 10px;
-    .down{
-        width: 8px;
-        height: 5px;
-        position: absolute;
-        cursor: pointer;
-        top:8px;
-        right: 5px;
-    }
-    .clear{
-        display: none;
-        width: 12px;
-        height: 12px;
-        position: absolute;
-        cursor: pointer;
-        top: 5px;
-        right: 4px;
-    }
-    &:hover .clear{
-        display: inline-block;
+  }
+  .selectLis {
+    position: absolute;
+    top: 24px;
+    background: #fff;
+    width: 100%;
+    max-height: 110px;
+    box-shadow: 0 10px 20px 0 #989da3;
+    z-index: 9;
+    overflow: auto;
+    li {
+      height: 35 px;
+      line-height: 35px;
+      padding: 0 8px;
+      cursor: pointer;
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
     }
-    .selectLis{
-        position: absolute;
-        top:24px;
-        background: #fff;
-        width: 100%;
-        max-height: 110px;
-        box-shadow: 0 10px 20px 0 #989da3;
-        z-index: 9;
-        overflow: auto;
-        li{
-            padding-left: 5px;
-            cursor: pointer;
-            white-space:nowrap;
-            overflow:hidden;
-            text-overflow:ellipsis;
-        }
-        li:hover{
-            background: #E2F1F8;
-        }
+    li:hover {
+      background: #e2f1f8;
     }
+  }
+}
+.inpSearch {
+  width: 100%;
+  padding-left: 5px;
 }
-.inpSearch{
-    width: 100%;
-    padding-left: 5px;
-}

+ 1 - 1
src/components/AddNewInspect/SlidePic/index.jsx

@@ -112,7 +112,7 @@ class SlidePic extends Component {
           <img className={styles.imgCheck} src={item.check?checkOn:checkOff} onClick={()=>this.checkOnOff(item,idx)} alt=""/>
           <span className={styles.bigname} title={item.detailName}>{item.detailName}</span>
           <span className={styles.smallname}>{item.flg == 5?'药品':item.flg == 6?'手术/操作':'输血'}</span>
-          {hosId===-1 && item.flg == 5?<SearchSelect title='选择剂型' hosId={hosId} selected={item.form} type={15} selectJiType={selectJiType} handlePush={handlePush} idx={idx}></SearchSelect>:<p style={{width:'110px',marginRight:'10px'}}></p>}
+          {hosId===-1 && item.flg == 5?<SearchSelect title='搜索剂型' hosId={hosId} selected={item.form} type={15} selectJiType={selectJiType} handlePush={handlePush} idx={idx}></SearchSelect>:<p style={{width:'110px',marginRight:'10px'}}></p>}
           {item.flg == 5?<SearchSelect2 title='选择给药途径' hosId={hosId} selected={item.routeName} type={16} selectJiType={selectJiType} handlePush={handlePush} idx={idx}></SearchSelect2>:<p style={{width:'108px',marginRight:'10px'}}></p>}
           
           <span className={styles.edit}>