Browse Source

时间修改

luolei 4 năm trước cách đây
mục cha
commit
fa85f015bf

+ 0 - 1
src/common/components/SearchOption/index.jsx

@@ -99,7 +99,6 @@ class SearchOption extends React.Component {
         });
     }
     handleFocus(){
-        console.log(1223);
       this.setState({showInsp:false})
       if(this.state.val.trim() != ''){
         return;

+ 25 - 7
src/components/AddAssistCheck/index.jsx

@@ -179,7 +179,19 @@ class AddAssistCheck extends React.Component {
     this.props.handleChangeDate(date,idx)
     this.setState({ date: false })
   }
-
+  setEdit(e){
+    $('.canEdit').blur().attr('disabled','disabled')
+    $(e.target).removeAttr('disabled').focus()
+  }
+  handleBlur(){
+    const {handlePush} = this.props;
+    $('.canEdit').attr('disabled','disabled')
+    handlePush && handlePush({mode:8});       //右侧推送
+  }
+  handleInput(e,item,idx){
+    const {setTipValue} = this.props
+    setTipValue(item,e.target.value,idx)
+  }
   getAssistLabel() {
     const { assistLabel,checkedListImport, handleChangeAssistValue,checkOnOff, handleChangeDate, isRead, handlePush, winWidth,getInfomation,assistList } = this.props;
     const { visible,activeName,id,date } = this.state;
@@ -232,13 +244,19 @@ class AddAssistCheck extends React.Component {
                 </ScrollArea>
               </div>
               <div className={`${styles.pointerFinger} ${setFontColorSize(2,2)}`}>
-                <p>报告日期:<span>{item.time || this.state.dateTime}</span></p>
-                {/* <i onClick={() => this.handleShowDate(idx)}></i> */}
-                {/*<a href="javascript:void(0);" onClick={() => { this.handleDelClick(idx,item) }}><img src={close} alt="" /></a>*/}
+                <p>报告日期:<span>
+                  <input disabled="disabled" type="text" 
+                      class="canEdit"
+                      onDoubleClick={(e)=>this.setEdit(e)}
+                      style={'#333'}
+                      placeholder='时间'
+                      autoComplete="off"
+                      value={item.time}
+                      onInput={(e)=>{this.handleInput(e,item,idx)}}
+                      onBlur={()=>{this.handleBlur()}}
+                      />
+                </span></p>
                 <span className={styles.closeIcon} id="assiClose" onClick={() => { this.handleDelClick(idx,item) }}></span>
-                {/* {
-                  this.state.date && idx == this.state.active ?<Calendar timeLis={staticTime} isShow={true} timeSure={(date)=>this.timeSure(date,idx)} needTime={true} sure={true} handleChange={(info) => { this.handleChangeDate(info, idx) }} top={30}></Calendar>:null
-                } */}
               </div>
               <DelToast show={idx==id&&item.name==activeName?visible:false}
                   name={activeName}

+ 2 - 2
src/components/AddInspect/SlidePic/index.jsx

@@ -158,7 +158,7 @@ class SlideSelect extends Component {
                     class="canEdit" 
                     onDoubleClick={(e)=>this.setEdit(e)}
                     style={{color:style==2||style==4?'red':style==1?'#D949FF':'#333'}}
-                    placeholder='(填写)'
+                    placeholder='时间'
                     autoComplete="off"
                     value={item.time}
                     onInput={(e)=>{this.handleInput(e,item,1)}}
@@ -196,7 +196,7 @@ class SlideSelect extends Component {
                 class="canEdit" 
                 onDoubleClick={(e)=>this.setEdit(e)}
                 style={{color:style==2||style==4?'red':style==1?'#D949FF':'#333'}}
-                placeholder='(填写)'
+                placeholder='时间'
                 autoComplete="off"
                 value={item.time}
                 onInput={(e)=>{this.handleInput(e,item,1)}}

+ 24 - 62
src/components/AddNewInspect/SlidePic/index.jsx

@@ -78,16 +78,6 @@ class SlidePic extends Component {
       show:!tmpShow
     })
   }
-  setEdit(){
-    this.setState({
-      canEdit:false
-    },()=>{
-      $(".canEdit").focus()
-      $(".canEdit").blur(()=>{
-        this.setState({canEdit:true})
-      })
-    })
-  }
   handleDel(time){
     const {handleDelClick,item} = this.props;
     this.setState({
@@ -126,17 +116,13 @@ class SlidePic extends Component {
       refreshScroller()&&refreshScroller().scrollYTo(290);
     })*/
   }
-  handleInput(e,item){
+  handleInput(e,item,sign){
     const {setTipValue} = this.props
-    setTipValue(item,e.target.value)
-    let type = getArrow(item.minValue,item.maxValue,e.target.value||null)
-    this.setState({
-      value:e.target.value,
-      style:type
-    })
+    setTipValue(item,e.target.value,sign)
   }
   handleBlur(){
     const {handlePush} = this.props;
+    $('.canEdit').attr('disabled','disabled')
     handlePush && handlePush({mode:8});       //右侧推送
   }
   checkOnOff(item){
@@ -144,69 +130,45 @@ class SlidePic extends Component {
     checkOnOff(item)
     handlePush && handlePush({mode:8});       //右侧推送
   }
+  setEdit(e){
+    $('.canEdit').blur().attr('disabled','disabled')
+    $(e.target).removeAttr('disabled').focus()
+  }
   render() {
     const {item,time} = this.props;
     const {canEdit,activeInd,activeName,value,style} = this.state;
     return (
-      item.flg == 1?<li key={item.time} className={`${styles.slideLi} clearfix`}> 
-          <span className={styles.bigname}>{item.uniqueName}</span>
-          <span className={styles.smallname}></span>
-          <span className={styles.edit}></span>
-          <span className={styles.maxmin}></span>
-          <span className={styles.pass}>检验时间:{item.time}</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)}}/>
-      </li>:(item.flg == 5||item.flg == 6)?<li key={item.time} className={`${styles.slideLi} clearfix`}> 
+      <li key={item.time} className={`${styles.slideLi} clearfix`}> 
           <img className={styles.imgCheck} src={item.check?checkOn:checkOff} onClick={()=>this.checkOnOff(item)} alt=""/>
           <span className={styles.bigname}>{item.name}</span>
           <span className={styles.smallname}>{item.flg == 5?'药品':'手术/操作'}</span>
           <span className={styles.edit}>
             {
               item.flg == 5?
-              <input disabled={canEdit} type="text" 
-                className="canEdit" 
-                onDoubleClick={this.setEdit}
+              <input disabled='disabled' type="text" 
+                class="canEdit" 
+                onDoubleClick={(e)=>this.setEdit(e)}
                 style={{color:style==2||style==4?'red':style==1?'#D949FF':'#333'}}
                 placeholder='(填写用法计量)'
                 autoComplete="off"
-                value={value}
-                onInput={(e)=>{this.handleInput(e,item)}}
+                value={item.value}
+                onInput={(e)=>{this.handleInput(e,item,2)}}
                 onBlur={()=>{this.handleBlur()}}
                 />:null
             }
           </span>
-          {/* <span className={styles.maxmin}></span> */}
-          <span className={styles.pass}>{item.time}</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)}}/>
-      </li>:<li key={item.time} className={`${styles.slideLi} clearfix`}> 
-          <span className={styles.bigname}>{item.name}</span>
-          <span className={styles.smallname}>{item.uniqueName}</span>
-          <span className={styles.edit}>
-            <input disabled={canEdit} type="text" 
-              className="canEdit" 
-              onDoubleClick={this.setEdit}
-              style={{color:style==2||style==4?'red':style==1?'#D949FF':'#333'}}
-              placeholder='(填写用法计量)'
-              autoComplete="off"
-              value={value}
-              title={value}
-              onInput={(e)=>{this.handleInput(e,item)}}
-              onBlur={()=>{this.handleBlur()}}
-              />
+          <span className={styles.pass}>
+            <input disabled="disabled" type="text" 
+                class="canEdit" 
+                onDoubleClick={(e)=>this.setEdit(e)}
+                style={{color:'#333'}}
+                placeholder='时间'
+                autoComplete="off"
+                value={item.time}
+                onInput={(e)=>{this.handleInput(e,item,1)}}
+                onBlur={()=>{this.handleBlur()}}
+                />
           </span>
-          <span className={styles.maxmin}>{normalVal(item.minValue,item.maxValue)}</span>
-          <span className={styles.pass}>检验时间:{item.time}</span>
           <span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item.time)}}></span>
           <DelToast show={time==item.time&&activeInd?true:false}
                     name={activeName}

+ 2 - 1
src/components/AssistCheck/index.jsx

@@ -96,7 +96,7 @@ class AssistCheck extends React.Component {
     render(){
         const {setHighter,checkOnOff,checkedListImport,list,getInfomation,windowHeight,hospitalMsg,assistLabel,assistVal,
           handleChangeValue,handleSign,fetchPushInfos,handleDelAssist,handleChangeAssistValue,handleChangeDate,
-          isRead,winWidth,assistList,hideAllDrop} = this.props;
+          isRead,winWidth,assistList,hideAllDrop,setTipValue} = this.props;
         const {showSlideImport,checkSystemIpt,onClose,closeInIcss} = this;
         const {importLis,ieVersion,hide} = this.state;
         // if(JSON.stringify(hospitalMsg) != {} && document.getElementById("choose")){//动态绑定只绑定一次
@@ -148,6 +148,7 @@ class AssistCheck extends React.Component {
                 >
                     <div style={{padding:'10px',boxSizing:'border-box',color:'#000'}} >
                         <AddAssistCheck
+                            setTipValue={setTipValue}
                             checkOnOff={checkOnOff}
                             handleChangeValue={handleChangeValue}
                             refreshScroller={this.refreshScroller}

+ 2 - 2
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -141,8 +141,8 @@ class HistoryCaseContainer extends React.Component {
               this.handleCaseClick(0, items[0])
               // this.$scrollRef.scrollArea.refresh();
               // this.context.scrollArea.scrollYTo(40);
-              console.log(this.$scrollRef,'this.$scrollRef');
-              console.log(this.context,'this.context');
+              // console.log(this.$scrollRef,'this.$scrollRef');
+              // console.log(this.context,'this.context');
               this.forceUpdate()
             }
           })

+ 1 - 1
src/components/PreviewBody/MedicalAdvice/index.jsx

@@ -7,7 +7,7 @@ class MedicalAdvice extends Component {
   }
   render() { 
     const {advice} = this.props
-    console.log(advice,'===========');
+    // console.log(advice,'===========');
     const {labelListBig,labelListSmall} = advice
     return ( 
         <tr className={style['patInfoFst']}>

+ 0 - 1
src/components/PushData/index.jsx

@@ -38,7 +38,6 @@ class PushData extends Component{
     render(){
         const {hashNum } = this.state
         const {mrId,planCode,showPushData,togglePushData ,windowWidth,windowHeight,hospitalId} = this.props
-        console.log(windowWidth,windowHeight)
         const url =`${pushPage2}?mrId=${mrId}&planCode=${planCode}&hospitalId=${hospitalId}`;
         return <div >
             {!showPushData&&<div className={style['slideButton']} style={{right:(windowWidth-1200)/2+'px'}} onClick={this.showPushData}> 

+ 4 - 1
src/containers/AssistCheck.js

@@ -3,7 +3,7 @@ import {
     connect
 } from 'react-redux';
 import AssistCheck from '@components/AssistCheck';
-import { assistLable,delAssistLabel,changeAssistVal,changeDate,allCheckImports,selectOneChecks,showInIcsss,checkOffOn } from '@store/actions/assistCheck';
+import { assistLable,delAssistLabel,changeAssistVal,changeDate,allCheckImports,selectOneChecks,showInIcsss,checkOffOn,setTipVal } from '@store/actions/assistCheck';
 import { getSearchList,getInstroduce ,getImportLists,getSonDetailList} from '@store/async-actions/assistCheck';
 import {ISREAD,HIDEDROP} from '@store/types/homePage.js';
 import {embedPush, getConceptDetail,getMRAnalyse} from '@store/async-actions/pushMessage';
@@ -34,6 +34,9 @@ function mapStateToProps(state) {//console.log(state.typeConfig)
 
 function mapDispatchToProps(dispatch, store) {
     return {
+        setTipValue(item,val,idx){
+          dispatch(setTipVal(item,val,idx))
+        },
         checkOnOff(item){
           dispatch(checkOffOn(item))
         },

+ 2 - 3
src/containers/NewAdvice.js

@@ -99,9 +99,8 @@ function mapDispatchToProps(dispatch) {
       dispatch(delPartItem(idx))
       dispatch(getMRAnalyse())
     },
-    setTipValue(item,value) {
-      console.log(89898)
-      dispatch(setTip(item,value))
+    setTipValue(item,value,sign) {
+      dispatch(setTip(item,value,sign))
     },
     //右侧推送
     fetchPushInfos(obj) {

+ 7 - 1
src/store/actions/assistCheck.js

@@ -1,4 +1,4 @@
-import {GET_ASSIST_SEARCH_LIST,GET_ASSIST_LABEL,CHECK_OFF_ON,DEL_ASSIST_LABEL,CHANGE_ASSIST_VAL,CHANGE_DATE,CLEAR_ASSIST_DATA,ADD_ASSIST_LABEL} from '../types/assistCheck';
+import {SET_TIP_VAL,GET_ASSIST_SEARCH_LIST,GET_ASSIST_LABEL,CHECK_OFF_ON,DEL_ASSIST_LABEL,CHANGE_ASSIST_VAL,CHANGE_DATE,CLEAR_ASSIST_DATA,ADD_ASSIST_LABEL} from '../types/assistCheck';
 
 export const searchList = (list,val) => ({         //搜索列表渲染
     type:GET_ASSIST_SEARCH_LIST,
@@ -34,6 +34,12 @@ export const checkOffOn = (item) => ({
     type:CHECK_OFF_ON,
     item
 })
+export const setTipVal = (item,val,idx) => ({
+    type:SET_TIP_VAL,
+    item,
+    val,
+    idx
+})
 export const clearAssistData = (data,saveText,checkedListImport) => ({         //清空回读
     type:CLEAR_ASSIST_DATA,
     data,

+ 3 - 2
src/store/actions/newAdvice.js

@@ -63,10 +63,11 @@ export const setContext = (obj) => ({
     type:SET_CONTEXT,
     obj
 })
-export const setTip = (item,value) => ({
+export const setTip = (item,value,sign) => ({
     type:SET_TIP,
     item,
-    value
+    value,
+    sign
 })
 export const searchTypeNew = (value) => ({
     type:SEARCH_TYPE_NEW,

+ 16 - 0
src/store/reducers/assistCheck.js

@@ -9,6 +9,7 @@ import {
   CHECK_OFF_ON,
   REASSISTCHECKDATA,
   CLEARASSISTCHECKDATA,
+  SET_TIP_VAL,
 } from '../types/assistCheck';
 import store from '@store';
 const initSearchList = {
@@ -34,6 +35,21 @@ const initSearchList = {
 import { getCurrentDate,getAllString} from '@utils/tools';
 
 export default (state = initSearchList, action) => {
+  if (action.type == SET_TIP_VAL) { //改变shijian
+    const newState = Object.assign({}, state);
+    const tempArr = newState.assistLabel;
+    for (let i = 0; i < tempArr.length; i++) {
+      if (i == action.idx) {
+        tempArr[i].dateValue = action.val
+        tempArr[i].time = action.val
+        newState.assistLabel = [...tempArr]
+      }
+    }
+    let tmpObj = getAllString(newState.checkedListImport,newState.assistLabel)
+    newState.dataArr = tmpObj.arr
+    newState.dataString = tmpObj.str
+    return newState;
+  }
   if (action.type == ADD_ASSIST_LABEL) {
     const newState = Object.assign({}, state);
     let tempArr = newState.assistLabel;

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

@@ -93,14 +93,29 @@ export default (state = initSearchList, action) => {
     if (action.type == SET_TIP) {    
         const newState = Object.assign({}, state);
         let tempArr = newState.labelListBig;
+        let tempArrs = newState.labelListSmall;
         let tmpLis = action.item
-        console.log(action,888888)
-        for(let i= 0;i < tempArr.length;i++){
-            if(tmpLis.time == tempArr[i].time){
-                tempArr[i].value = action.value
+        if(tmpLis.flg == 5){
+            for(let i= 0;i < tempArr.length;i++){
+                if(tmpLis.time == tempArr[i].time){
+                    if(action.sign == 1){
+                        tempArr[i].time = action.value
+                        tempArr[i].dateValue = action.value
+                    }else{
+                        tempArr[i].value = action.value
+                    }
+                }
+            }
+        }else{
+            for(let i= 0;i < tempArrs.length;i++){
+                if(tmpLis.time == tempArrs[i].time){
+                    tempArrs[i].time = action.value
+                    tempArrs[i].dateValue = action.value
+                }
             }
         }
         newState.labelListBig = [...tempArr]
+        newState.labelListSmall = [...tempArrs]
         return newState;
     }
     if (action.type == SEARCH_TYPE_NEW) {

+ 1 - 0
src/store/types/assistCheck.js

@@ -6,6 +6,7 @@ export const CHANGE_DATE = 'CHANGE_DATE';
 export const CLEAR_ASSIST_DATA = 'CLEAR_ASSIST_DATA';
 export const ADD_ASSIST_LABEL = 'ADD_ASSIST_LABEL';
 export const CHECK_OFF_ON = 'CHECK_OFF_ON';
+export const SET_TIP_VAL = 'SET_TIP_VAL';
 
 
 export const REASSISTCHECKDATA = 'REASSISTCHECKDATA';