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

+ 1 - 0
src/components/AddNewInspect/SlideIpt/index.jsx

@@ -43,6 +43,7 @@ class SlideIpt extends Component {
           onInput={(e)=>{this.handleInput(e,item,1,idx)}}
           onFocus={()=>{this.handleFocus()}}
           />
+          
     );
   }
 }

+ 50 - 0
src/components/AddNewInspect/SlideIpt2/index.jsx

@@ -0,0 +1,50 @@
+import React, { Component } from "react";
+import $ from 'jquery';
+import config from '@config/index';
+
+class SlideIpt extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      show:false,
+      activeInd:false,
+      activeName:'',
+      canEdit:true,
+      style:'',
+      value:''
+    };
+  }
+  
+  handleInput(e,item,sign,idx){
+    const {setTipValue,handlePush} = this.props;
+    setTipValue(item,e.target.value,sign,idx)
+    //右侧推送--延时推送
+    const stimer = this.state.timer;
+    clearTimeout(stimer);
+    let timer = setTimeout(function(){
+      handlePush&&handlePush({mode:8});
+      clearTimeout(stimer);
+    },config.delayPushTime);
+    this.setState({timer})
+  }
+  handleFocus(){
+    const {handlePush} = this.props;
+    handlePush&&handlePush({mode:8});
+  }
+  render() {
+    const {item,idx} = this.props;
+    return (
+      <input type="text"
+          class="canEdit"
+          style={{color:'#333'}}
+          placeholder='时间'
+          autoComplete="off"
+          value={item.finishDateValue}
+          onInput={(e)=>{this.handleInput(e,item,3,idx)}}
+          onFocus={()=>{this.handleFocus()}}
+          />
+          
+    );
+  }
+}
+export default SlideIpt;

+ 86 - 83
src/components/AddNewInspect/SlidePic/index.jsx

@@ -1,12 +1,13 @@
 import React, { Component } from "react";
 import styles from "./index.less";
-import {  Notify,DelToast} from '@commonComp';
+import { Notify, DelToast } from '@commonComp';
 import config from '@config/index';
 import $ from 'jquery';
 import checkOff from '@common/images/check_off.png';
 import checkOn from '@common/images/check_on.png';
 import dowm from '../img/down.png';
 import SlideIpt from '../SlideIpt';
+import SlideIpt2 from '../SlideIpt2';
 import SearchSelect from '../SearchSelect';
 import SearchSelect2 from '../SearchSelect2';
 import singleB from '../img/singleB.png';
@@ -16,12 +17,12 @@ class SlidePic extends Component {
   constructor(props) {
     super(props);
     this.state = {
-      show:false,
-      activeInd:false,
-      selectShow:false,
-      activeName:'',
-      canEdit:true,
-      style:''
+      show: false,
+      activeInd: false,
+      selectShow: false,
+      activeName: '',
+      canEdit: true,
+      style: ''
     };
     this.handleDel = this.handleDel.bind(this);
     this.handleCancel = this.handleCancel.bind(this);
@@ -30,120 +31,122 @@ class SlidePic extends Component {
     this.handleBlur = this.handleBlur.bind(this);
     this.checkOnOff = this.checkOnOff.bind(this);
   }
-  
+
   componentDidMount() {
     $(document).click((event) => {
-      if($(event.target).attr("id")!='addClose'&&$(event.target).attr("id")!='delTit'){
+      if ($(event.target).attr("id") != 'addClose' && $(event.target).attr("id") != 'delTit') {
         this.setState({
-          activeInd:false
+          activeInd: false
         })
       }
-      if($(event.target).attr("id")!='selectJiType'&&$(event.target).attr("id")!='selectJiTypeWrap'){
-        const {handleSelectShow,idx,item} = this.props;
-        item.flg==5&&handleSelectShow(idx,0)
+      if ($(event.target).attr("id") != 'selectJiType' && $(event.target).attr("id") != 'selectJiTypeWrap') {
+        const { handleSelectShow, idx, item } = this.props;
+        item.flg == 5 && handleSelectShow(idx, 0)
       }
     });
   }
-  handleDel(time){
-    const {handleDelClick,item} = this.props;
+  handleDel(time) {
+    const { handleDelClick, item } = this.props;
     this.setState({
-      activeInd:true,
-      activeName:item.detailName,
+      activeInd: true,
+      activeName: item.detailName,
     })
-    handleDelClick&&handleDelClick(1,time);
+    handleDelClick && handleDelClick(1, time);
   }
-  handleCancel(){
+  handleCancel() {
     this.setState({
-      activeInd:false,
-      activeName:''
+      activeInd: false,
+      activeName: ''
     })
   }
-  delConfirm(item,idx){
-    const {handleDelConfirm,handlePush} = this.props;
-    handleDelConfirm&&handleDelConfirm(item,idx);
+  delConfirm(item, idx) {
+    const { handleDelConfirm, handlePush } = this.props;
+    handleDelConfirm && handleDelConfirm(item, idx);
     Notify.success("删除成功");
-    handlePush && handlePush({mode:8});       //右侧推送
+    handlePush && handlePush({ mode: 8 });       //右侧推送
     this.setState({
-      activeInd:false,
-      activeName:''
+      activeInd: false,
+      activeName: ''
     })
   }
-  handleInput(e,item,sign,tip){
+  handleInput(e, item, sign, tip) {
     e.stopPropagation();
-    const {setTipValue,handlePush} = this.props
-    setTipValue(item,e.target.value,sign,tip)
+    const { setTipValue, handlePush } = this.props
+    setTipValue(item, e.target.value, sign, tip)
     //右侧推送--延时推送
     const stimer = this.state.timer;
     clearTimeout(stimer);
-    let timer = setTimeout(function(){
-      handlePush&&handlePush({mode:8});
+    let timer = setTimeout(function () {
+      handlePush && handlePush({ mode: 8 });
       clearTimeout(stimer);
-    },config.delayPushTime);
-    this.setState({timer})
+    }, config.delayPushTime);
+    this.setState({ timer })
   }
-  handleBlur(){
-    const {handlePush} = this.props;
-    $('.canEdit').attr('disabled','disabled')
-    handlePush && handlePush({mode:8});       //右侧推送
+  handleBlur() {
+    const { handlePush } = this.props;
+    $('.canEdit').attr('disabled', 'disabled')
+    handlePush && handlePush({ mode: 8 });       //右侧推送
   }
-  checkOnOff(item,idx){
-    const {checkOnOff,handlePush} = this.props
-    checkOnOff(item,idx)
-    handlePush && handlePush({mode:8});       //右侧推送
+  checkOnOff(item, idx) {
+    const { checkOnOff, handlePush } = this.props
+    checkOnOff(item, idx)
+    handlePush && handlePush({ mode: 8 });       //右侧推送
   }
-  setEdit(e){
+  setEdit(e) {
     // $('.canEdit').blur().attr('disabled','disabled')
     $(e.target).removeAttr('disabled').focus()
   }
-  handleFocus(){
-    const {handlePush} = this.props;
-    handlePush&&handlePush({mode:8});
+  handleFocus() {
+    const { handlePush } = this.props;
+    handlePush && handlePush({ mode: 8 });
   }
-  handleSui(item,idx){
-    const {handleSuiFang,handlePush} = this.props;
-    handleSuiFang&&handleSuiFang(item,idx)
-    handlePush&&handlePush({mode:8});
+  handleSui(item, idx) {
+    const { handleSuiFang, handlePush } = this.props;
+    handleSuiFang && handleSuiFang(item, idx)
+    handlePush && handlePush({ mode: 8 });
   }
   render() {
-    const {item,time,setTipValue,idx,handlePush,hosId,selectJiType} = this.props;
-    const {selectShow,activeInd,activeName,value,style} = this.state;
+    const { item, time, setTipValue, idx, handlePush, hosId, selectJiType } = this.props;
+    const { selectShow, activeInd, activeName, value, style } = this.state;
+    console.log(item);
     return (
       <li key={item.time} className={`${styles.slideLi} clearfix`}>
-          <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>}
-          {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}>
-            {
-              item.flg == 5||item.flg == 8?
-              <input type="text" 
-                class="canEdit" 
-                style={{color:'#333'}}
-                placeholder='(填写用量)'
+        <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>}
+        {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}>
+          {
+            item.flg == 5 || item.flg == 8 ?
+              <input type="text"
+                class="canEdit"
+                style={{ color: '#333' }}
+                placeholder='(填写用量11)'
                 autoComplete="off"
                 maxLength='10'
                 value={item.value}
                 title={item.value}
-                onInput={(e)=>{this.handleInput(e,item,2,idx)}}
-                onFocus={()=>{this.handleFocus()}}
-                />:<span onClick={()=>this.handleSui(item,idx)} className={styles.suifang}>
-                  <img src={item.hasTreat?singleB:singleL} alt=""/>
-                  随访计划
-                </span>
-            }
-          </span>
-          <span className={styles.pass}>
-            <SlideIpt item={item} setTipValue={setTipValue} handlePush={handlePush} idx={idx}/> 
-          </span>
-          <span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item.time)}}></span>
-          <DelToast show={time==item.time&&activeInd?true:false}
-                    name={activeName}
-                    right={'-34px'}
-                    top={'30px'}
-                    cancel={this.handleCancel}
-                    confirm={()=>{this.delConfirm(item,idx)}}/>
+                onInput={(e) => { this.handleInput(e, item, 2, idx) }}
+                onFocus={() => { this.handleFocus() }}
+              /> : <span onClick={() => this.handleSui(item, idx)} className={styles.suifang}>
+                <img src={item.hasTreat ? singleB : singleL} alt="" />
+                随访计划
+              </span>
+          }
+        </span>
+        <span className={styles.pass}>
+          <SlideIpt item={item} setTipValue={setTipValue} handlePush={handlePush} idx={idx} />
+          <SlideIpt2 item={item} setTipValue={setTipValue} handlePush={handlePush} idx={idx} />
+        </span>
+        <span id="addClose" className={styles.partDel} onClick={() => { this.handleDel(item.time) }}></span>
+        <DelToast show={time == item.time && activeInd ? true : false}
+          name={activeName}
+          right={'-34px'}
+          top={'30px'}
+          cancel={this.handleCancel}
+          confirm={() => { this.delConfirm(item, idx) }} />
       </li>
     );
   }

+ 1 - 2
src/components/AddNewInspect/SlidePic/index.less

@@ -46,7 +46,7 @@
     }
     .bigname {
         .ellipsis;
-        width: 360px;
+        width: 193px;
         font-weight: bold;
         margin-right: 15px;
     }
@@ -74,7 +74,6 @@
         text-align: right;
         padding-left: 10px;
         box-sizing: border-box;
-        width: 150px;
         margin-right: 15px;
     }
     .imgCheck {

+ 8 - 3
src/components/AddNewInspect/index.jsx

@@ -17,6 +17,7 @@ class AddNewInspect extends React.Component {
       num: 0,            //暂存数据,获取一次,不能每次都是新的数据
       type: null,
       time: null,
+      finishDateValue:null,
       pageTop: '',
       // tmpIds: [],      //内层外层
       impId: null
@@ -77,11 +78,12 @@ class AddNewInspect extends React.Component {
     Notify.success("删除成功");
     handlePush && handlePush({mode:8});       //右侧推送
   }
-  handleDelClick(type, time) {
+  handleDelClick(type, time,finishDateValue) {
     this.setState({
       type: type,
       time: time,
-      impId: null
+      impId: null,
+      finishDateValue:finishDateValue
     })
   }
   handleSearchAdvice(e) {
@@ -123,7 +125,7 @@ class AddNewInspect extends React.Component {
   }
   render() {
     const {activeIdx,hosId,labelListBlood,handleSuiFang,handleSelectShow,selectJiType,setHighter,staticData,refreshScroller,checkOnOff, getInfomation,setTipValue, handleChangeValue,labelListSmall,inspectList, inspectVal, list, labelListBig, windowHeight, windowWidth,detailClick, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush,handleDelConfirm } = this.props;
-    const { tmpId, tmpIdx, time, pageTop, impId } = this.state;
+    const { tmpId, tmpIdx, time,finishDateValue, pageTop, impId } = this.state;
     const contStyle={
       opacity:'0.4',
       right:'0',
@@ -149,6 +151,7 @@ class AddNewInspect extends React.Component {
                   handleSuiFang={handleSuiFang}
                   idx={idx}
                   time={time}
+                  finishDateValue={finishDateValue}
                   handlePush={handlePush}
                   handleDelClick={this.handleDelClick}
                   setTipValue={setTipValue}
@@ -163,6 +166,7 @@ class AddNewInspect extends React.Component {
                   item={item}
                   checkOnOff={checkOnOff}
                   time={time}
+                  finishDateValue={finishDateValue}
                   idx={idx}
                   handleSuiFang={handleSuiFang}
                   handlePush={handlePush}
@@ -179,6 +183,7 @@ class AddNewInspect extends React.Component {
                   item={item}
                   checkOnOff={checkOnOff}
                   time={time}
+                  finishDateValue={finishDateValue}
                   idx={idx}
                   handleSuiFang={handleSuiFang}
                   handlePush={handlePush}

+ 1 - 0
src/store/async-actions/newAdvice.js

@@ -11,6 +11,7 @@ export const getSearchList = (val) => {
     }
     let baseList = store.getState();
     let type = baseList.newAdvice.shType;
+    console.log(type);
     return (dispatch) => {
         axios.json('/demo/retrieval/index',{
             "inputStr": val.trim(),

+ 9 - 4
src/store/reducers/newAdvice.js

@@ -61,6 +61,7 @@ export default (state = initSearchList, action) => {
                 tempArr[i].hasTreat = 0
             }
         }
+        console.log(tmpLis);
         let obj = {
             "dateValue": tmpLis.dateValue,
             "name": tmpLis.name,
@@ -89,10 +90,10 @@ export default (state = initSearchList, action) => {
         for (let i = 0; i < tempArr.length; i++) {
             if (action.idx == i) {
                 tempArr[i].selectShow = false
-                if(+action.operType===16){   //给药途径
-                    tempArr[i].routeName=action.part.name;
-                    tempArr[i].routeUniqueName=action.part.uniqueName;
-                }else{      //剂型
+                if (+action.operType === 16) {   //给药途径
+                    tempArr[i].routeName = action.part.name;
+                    tempArr[i].routeUniqueName = action.part.uniqueName;
+                } else {      //剂型
                     tempArr[i].form = action.part.name;
                 }
                 tempArr[i].selectVal = action.part.val
@@ -232,10 +233,13 @@ export default (state = initSearchList, action) => {
             newState.labelListSmall = tempArrs
         } if (tmpLis.flg == 8) {//输血
             for (let i = 0; i < tmpArr.length; i++) {
+                console.log(action);
                 if (action.tip == i) {
                     if (action.sign == 1) {
                         tmpArr[i].time = action.value
                         tmpArr[i].dateValue = action.value
+                    } else if (action.sign == 3) {
+                        tmpArr[i].finishDateValue = action.value
                     } else {
                         tmpArr[i].value = action.value
                     }
@@ -258,6 +262,7 @@ export default (state = initSearchList, action) => {
         let tmpLis = action.list, num = 0
         tmpLis['time'] = getCurrentDate(1)
         tmpLis['dateValue'] = getCurrentDate(1)
+        tmpLis['finishDateValue'] = getCurrentDate(1)
         if (tmpLis.flg == 5) {
             tempArr.push(tmpLis)
             newState.labelListBig = [...tempArr]