1178232204@qq.com %!s(int64=3) %!d(string=hai) anos
pai
achega
db0b8b5a5b

+ 13 - 13
src/components/AddNewInspect/SearchSelect/index.jsx

@@ -44,17 +44,21 @@ class SearchSelect extends Component {
     selectJiType(item, idx, type)
     handlePush && handlePush({ mode: 8 });
   }
+  handleFocu(e){
+    const val = e.target.value;
+    const { type } = this.props;
+    if(type == 16){
+      this.getDrugWayList(val)
+    }
+  }
   handleChange(e, isClear) {
     const val = e.target.value;
-    console.log(e.target.value);
-
     if (isClear || !val) {
       this.setState({
         data: [],
         inpVal: ''
       });
       this.handleSelect({ name: '', uniqueName: '' }, this.props.idx);
-      return;
     }
     this.setState({
       show: true,
@@ -66,21 +70,17 @@ class SearchSelect extends Component {
   //获取药品剂型15,、给药途径16
   getDrugWayList(val) {
     const { hosId, type } = this.props;
-    if (!val.trim()) {
-      this.setState({
-        data: []
-      });
-      return;
-    }
     axios.json('/demo/retrieval/index', {
       "inputStr": val.trim(),
       "type": type,
-      "hospitalId": hosId
+      "hospitalId": hosId,
+      "defaultList":type==15?0:1
     }).then((res) => {
       if (res.data.code == 0) {
         const data = res.data.data;
         this.setState({
-          data: data.nameList || []
+          data: data.nameList || [],
+          show: true,
         })
       } else {
         Notify.success(res.data.msg)
@@ -92,9 +92,9 @@ class SearchSelect extends Component {
     const { show, data, inpVal } = this.state; 
     return (
       <div className={styles.medType}>
-        <input placeholder={title} value={selected} title={selected} className={styles.inpSearch} onInput={(e) => this.handleChange(e)} />
+        <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)} /> : ''}
+        {inpVal? <img className={styles.clear} src={del} alt="清空" onClick={(e) => this.handleChange(e, true)} /> : ''}
         {
           show ? <ul className={styles.selectLis}>
             {

+ 4 - 2
src/components/AddNewInspect/SlidePic/index.jsx

@@ -111,8 +111,9 @@ 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?<SearchSelect title='选择剂型' hosId={hosId} selected={item.form} type={15} selectJiType={selectJiType} handlePush={handlePush} idx={idx}></SearchSelect>:''}
-          <SearchSelect title='选择给药途径' hosId={hosId} selected={item.routeName} type={16} selectJiType={selectJiType} handlePush={handlePush} idx={idx}></SearchSelect>
+          {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?<SearchSelect title='选择给药途径' hosId={hosId} selected={item.routeName} type={16} selectJiType={selectJiType} handlePush={handlePush} idx={idx}></SearchSelect>:<p style={{width:'108px',marginRight:'10px'}}></p>}
+          
           <span className={styles.edit}>
             {
               item.flg == 5||item.flg == 8?
@@ -121,6 +122,7 @@ class SlidePic extends Component {
                 style={{color:'#333'}}
                 placeholder='(填写用量)'
                 autoComplete="off"
+                maxLength='10'
                 value={item.value}
                 title={item.value}
                 onInput={(e)=>{this.handleInput(e,item,2,idx)}}

+ 58 - 48
src/components/PreviewBody/MedicalAdvice/index.jsx

@@ -3,66 +3,76 @@ import style from "../index.less";
 class MedicalAdvice extends Component {
   constructor(props) {
     super(props);
-    this.state = {  }
+    this.state = {}
   }
-  render() { 
-    const {advice} = this.props
+  render() {
+    const { advice } = this.props
     // console.log(advice,'===========');
-    const {labelListBig,labelListSmall,labelListBlood} = advice
+    const { labelListBig, labelListSmall, labelListBlood } = advice
     // console.log(advice, 'advice');
-    return ( 
-        <tr className={style['patInfoFst']}>
-          <td className={style['patInfoSec']}>医嘱:</td>
-          <td className={style['patInfoSec']}>
-            <table className={style.assistTable}>
-              {
-              labelListBig && labelListBig.map((item,index)=>{
+    return (
+      <tr className={style['patInfoFst']}>
+        <td className={style['patInfoSec']}>医嘱:</td>
+        <td className={style['patInfoSec']}>
+          <table className={style.assistTable}>
+            {
+              labelListBig && labelListBig.map((item, index) => {
                 return (
                   <tr>
-                    <td className={style.adviceTableTdFst}>{item.uniqueName}</td>
-                    
-                    <td className={style.assistTableTdTrd}>药品</td>
-                    <td className={style.assistTableTdSec}>{item.form}</td>
-                      <td className={style.assistTableTdSec}>{item.routeName}</td>
-                    <td className={style.assistTableTdSec}>{item.value}</td>
-                    <td className={style.assistTableTdFor}>{item.time}</td>
+                    <div className={style.adviceTable}>
+                      <div className={style.adviceTableTop}>
+                        <p className={style.adviceTableTopFst}>{item.uniqueName}</p>
+                        <p className={style.assistTableTopTwo}>药品</p>
+                      </div>
+                      <p className={style.assistTableTopFor}>{item.form}</p>
+                      <p className={style.assistTableTopFor}>{item.routeName}</p>
+                      <p className={style.assistTableTopFor}>{item.value}</p>
+                      <p className={style.assistTableTopTime}>{item.time}</p>
+                    </div>
                   </tr>
                 )
               })
-              }
-              {
+            }
+            {
               labelListSmall && labelListSmall.map((item, index) => {
-                  return (
-                    <tr>
-                      <td className={style.adviceTableTdFst}>{item.name}</td>
-                      {/* <td className={style.assistTableTdSec}></td> */}
-                      <td className={style.assistTableTdTrd}>手术/操作</td>
-                      <td className={style.assistTableTdSec}></td>
-                      <td className={style.assistTableTdSec}>{item.value}</td>
-                      <td className={style.assistTableTdFor}>{item.time}</td>
-                    </tr>
-                  )
-                })
-              }
-              {
+                return (
+                  <tr>
+                    <div className={style.adviceTable} className={style.adviceTables}>
+                      <div className={style.adviceTableTop}>
+                        <p className={style.adviceTableTopFst}>{item.name}</p>
+                        <p className={style.assistTableTopTwo}>手术/操作</p>
+                      </div>
+                      <p className={style.assistTableTdSec}>{item.value}</p>
+                      <p className={style.assistTableTopTime}>{item.time}</p>
+                    </div>
+
+                  </tr>
+                )
+              })
+            }
+            {
               labelListBlood && labelListBlood.map((item, index) => {
-                  return (
-                    <tr>
-                      <td className={style.adviceTableTdFst}>{item.name}</td>
-                      <td className={style.assistTableTdTrd}>输血</td>
-                      <td className={style.assistTableTdSec}></td>
-                      <td className={style.assistTableTdSec}>{item.value}</td>
-                      <td className={style.assistTableTdFor}>{item.time}</td>
-                    </tr>
-                  )
-                })
-              }
-            </table>
-          </td>
-        </tr>
+                return (
+                  <tr>
+                    <div className={style.adviceTable}>
+                      <div className={style.adviceTableTop}>
+                        <p className={style.adviceTableTopFst}>{item.name}</p>
+                        <p className={style.assistTableTopTwo}>输血</p>
+                      </div>
+                      <p className={style.assistTableTopFor}>{item.value}</p>
+                      <p className={style.assistTableTopTime}>{item.time}</p>
+                    </div>
+
+                  </tr>
+                )
+              })
+            }
+          </table>
+        </td>
+      </tr>
 
     );
   }
 }
- 
+
 export default MedicalAdvice;

+ 30 - 1
src/components/PreviewBody/index.less

@@ -134,7 +134,36 @@ table{
   margin-right: 10px;
 }
 .adviceTableTdFst {
-  width: 28%;
+  width: 100%;
+}
+.adviceTable{
+  padding: 0 0 0 12px;
+}
+.adviceTables{
+  margin-top: 10px;
+}
+.adviceTableTop{
+  display: flex;
+  justify-content: space-between;
+}
+.adviceTableTopFst{
+  line-height: 25px;
+ 
+}
+.assistTableTopTwo{
+  margin-right: 15px;
+}
+.assistTableTopFor{
+  margin-right: 15px;
+  line-height: 25px;
+  color: #666666;
+}
+.assistTableTopTime{
+  width: 100%;
+  border-top: 1px solid #E2E2E2;
+  text-align: right;
+  padding: 5px 0;
+  padding-right: 5px;
 }
 .assistTableTdSec {
   width: 120px;