luolei 4 years atrás
parent
commit
19fa43f58b

+ 3 - 3
src/common/components/SearchOption/index.jsx

@@ -36,7 +36,7 @@ class SearchOption extends React.Component {
       if(searchType==1){
           this.setState({txt:'细项'})
       }else if(searchType==2){
-        this.setState({txt:'药'})
+        this.setState({txt:'药'})
       }
       refreshScroller()&&refreshScroller().refresh();    //点开搜索弹窗更新滚动条,
       if(windowHeight - pageTop < height){
@@ -126,8 +126,8 @@ class SearchOption extends React.Component {
                             <li onClick={()=>{this.detailClick(1,'套餐')}}>套餐</li>
                         </ul>:
                         <ul className={styles.lisul} style={{'display':showInsp?'block':'none'}}>
-                            <li onClick={()=>{this.detailClick(5,'药物')}}>药物</li>
-                            <li onClick={()=>{this.detailClick(6,'手术及操作')}}>手术及操作</li>
+                            <li onClick={()=>{this.detailClick(5,'药品')}}>药品</li>
+                            <li onClick={()=>{this.detailClick(6,'手术/操作')}}>手术/操作</li>
                         </ul>
                     }
                 </div>

+ 1 - 1
src/common/components/SearchOption/index.less

@@ -48,7 +48,7 @@
 .searchSpecial {
     min-height: 160px;
     .seleImg {
-        left: 82px;
+        left: 86px;
         cursor: pointer;
     }
     .searchInsp {

+ 1 - 1
src/components/AddAssistCheck/AssistName/index.jsx

@@ -27,7 +27,7 @@ class AssistName extends Component {
 				<span className={`${styles.assistName} ${setFontColorSize(2)}`} style={{ width: winWidth < 1150 ? '120px' : 'auto',fontWeight:normal?'normal':'bold' }} ref={this.$assistName}>
 					<span className={styles.tagSpan} title={name}>
 						{name&&this.splitName(name)}:
-            <span className={styles.imgInfo} title='点击i图标可查看详细说明' onClick={() => getInfomation({ name: name, position: 1, type: 6 })}></span>
+            {/* <span className={styles.imgInfo} title='点击i图标可查看详细说明' onClick={() => getInfomation({ name: name, position: 1, type: 6 })}></span> */}
 					</span>
 				</span>
 		);

+ 1 - 1
src/components/AddAssistCheck/index.jsx

@@ -133,7 +133,7 @@ class AddAssistCheck extends React.Component {
     return <ScrollArea speed={0.8}
                        horizontal={false}
                        stopScrollPropagation={list.length>6?true:false}
-                       style={{height:'225px',width:'356px'}}
+                       style={{height:'205px',width:'356px'}}
                        className={styles["area"]}
                        verticalContainerStyle={contStyle}
                        verticalScrollbarStyle={barStyle}

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

@@ -5,7 +5,8 @@ import { InspectCommon, Notify,DelToast} from '@commonComp';
 import slideUp from "@common/images/slide-up.png";
 import slideDown from "@common/images/slide-down.png";
 import $ from 'jquery';
-import date1 from '../img/date1.png';
+import checkOff from '@common/images/check_off.png';
+import checkOn from '@common/images/check_on.png';
 import ScrollArea from 'react-scrollbar';
 import InspectName from '../InspectName';
 
@@ -31,6 +32,7 @@ class SlidePic extends Component {
     this.setEdit = this.setEdit.bind(this);
     this.handleLabelSub = this.handleLabelSub.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
+    this.checkOnOff = this.checkOnOff.bind(this);
   }
   handleChangeDate(date) {
     // console.log(date,'外')
@@ -137,6 +139,10 @@ class SlidePic extends Component {
     const {handlePush} = this.props;
     handlePush && handlePush({mode:8});       //右侧推送
   }
+  checkOnOff(item){
+    const {checkOnOff} = this.props
+    checkOnOff(item)
+  }
   render() {
     const {item,time} = this.props;
     const {canEdit,activeInd,activeName,value,style} = this.state;
@@ -154,6 +160,31 @@ class SlidePic extends Component {
                     top={'30px'}
                     cancel={this.handleCancel}
                     confirm={()=>{this.delConfirm(item)}}/>
+      </li>:(item.flg == 5||item.flg == 6)?<li key={item.time} className={`${styles.slideLi} clearfix`}> 
+          <img 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}>
+            <input disabled={canEdit} type="text" 
+              id="canEdit" 
+              onDoubleClick={this.setEdit}
+              style={{color:style==2||style==4?'red':style==1?'#D949FF':'#333'}}
+              placeholder='(填写)'
+              autoComplete="off"
+              value={value}
+              onInput={(e)=>{this.handleInput(e,item)}}
+              onBlur={()=>{this.handleBlur()}}
+              /><img style={{display:style==1||style==2?'inline-block':'none'}} src={style==1?down:style==2?up:''} />{item.units}
+          </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>

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

@@ -44,7 +44,7 @@
         background-size: 100% 100%;
     }
     .bigname {
-        width: 20%;
+        width: 40%;
         font-weight: bold;
     }
     .smallname {

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

@@ -325,7 +325,7 @@ class AddNewInspect extends React.Component {
     }
   }
   render() {
-    const {setHighter,refreshScroller, getInfomation,setTipValue, handleChangeValue,labelListSmall,inspectList, inspectVal, list, labelListBig, windowHeight, windowWidth,detailClick, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush,handleDelConfirm } = this.props;
+    const {setHighter,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 contStyle={
       opacity:'0.4',
@@ -341,9 +341,10 @@ class AddNewInspect extends React.Component {
           
           <ul className={styles.labelWrap} >
             {
-              labelListSmall && labelListSmall.map((item, idx) => {
+              labelListBig && labelListBig.map((item, idx) => {
                 return <SlidePic
                   item={item}
+                  checkOnOff={checkOnOff}
                   time={time}
                   handlePush={handlePush}
                   handleDelClick={this.handleDelClick}
@@ -353,9 +354,10 @@ class AddNewInspect extends React.Component {
               })
             }
             {
-              labelListBig && labelListBig.map((item, idx) => {
+              labelListSmall && labelListSmall.map((item, idx) => {
                 return <SlidePic
                   item={item}
+                  checkOnOff={checkOnOff}
                   time={time}
                   handlePush={handlePush}
                   handleDelClick={this.handleDelClick}

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

@@ -240,7 +240,7 @@ class NewAdvice extends React.Component {
 
   }
   render() {
-    const {hideAllDrop,setHighter,labelListBig, fetchPushInfos,getInfomation,labelListSmall, hospitalMsg, inspectVal, windowHeight, windowWidth,setTipValue, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList,detailClick,handleDelConfirm } = this.props;
+    const {hideAllDrop,setHighter,labelListBig, fetchPushInfos,getInfomation,labelListSmall, hospitalMsg, inspectVal, windowHeight, windowWidth,setTipValue, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList,detailClick,handleDelConfirm,checkOnOff } = this.props;
     const { ieVersion, isIE, hide,importLis } = this.state;
     const { checkSystemIpt, onClose,handleBindFileApi,closeInIcss,showSlideImport } = this;
     if(JSON.stringify(hospitalMsg) != {} && document.getElementById("choose")){//动态绑定只绑定一次
@@ -298,6 +298,7 @@ class NewAdvice extends React.Component {
         >
           <div style={{ padding: '10px', boxSizing: 'border-box',color:'#000' }} >
             <AddNewInspect
+              checkOnOff={checkOnOff}
               handleDelConfirm={handleDelConfirm}
               labelListBig={labelListBig}
               labelListSmall={labelListSmall}

+ 4 - 0
src/containers/NewAdvice.js

@@ -20,6 +20,7 @@ import {
   searchTypeNew,
   resetLabel,
   delOnePic,
+  checkOffOn,
 } from '@store/actions/newAdvice';
 import {
   billing,
@@ -51,6 +52,9 @@ function mapStateToProps(state) {//console.log(state)
 
 function mapDispatchToProps(dispatch) {
   return {
+    checkOnOff(item){
+      dispatch(checkOffOn(item))
+    },
     detailClick(val){
       dispatch(searchTypeNew(val))
     },

+ 5 - 1
src/store/actions/newAdvice.js

@@ -1,4 +1,4 @@
-import {SET_CONTEXT,DEL_ONE_PIC,ADD_LABEL,SEARCH_LIST,SET_LABEL,SET_TIP,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL_NEW,CLEAR_ALL_LABEL,DEL_PART_ITEM_NEW,DEL_EXCEL_LIST,SEARCH_TYPE_NEW} from '../types/newAdvice';
+import {SET_CONTEXT,CHECK_OFF_ON,DEL_ONE_PIC,ADD_LABEL,SEARCH_LIST,SET_LABEL,SET_TIP,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL_NEW,CLEAR_ALL_LABEL,DEL_PART_ITEM_NEW,DEL_EXCEL_LIST,SEARCH_TYPE_NEW} from '../types/newAdvice';
 
 export const setLabel = (idx,sign) => ({          //搜索后点击选中的结果
     type:SET_LABEL,
@@ -77,3 +77,7 @@ export const delOnePic = (item) => ({
     type:DEL_ONE_PIC,
     item
 })
+export const checkOffOn = (item) => ({
+    type:CHECK_OFF_ON,
+    item
+})

+ 8 - 17
src/store/async-actions/newAdvice.js

@@ -20,25 +20,16 @@ export const getSearchList = (val) => {
         .then((res)=>{
             if(res.data.code==0){
                 const data = res.data.data;let curDate=[];
-                if(type==2){
-                    curDate = data.lisDetailNames
-                }else{
-                    let arr = data.lisNames,tmp=[];
-                    for (var key in arr) {
-                        let obj = {}
-                        obj['uniqueName'] = arr[key];
-                        obj['detailName'] = arr[key];
-                        obj['name'] = arr[key];
-                        obj['flg'] = 1;
-                        tmp.push(obj)
-                    }
+                //药:阿替乐尔;手术:髂动脉造影
+                let arr = type==5?data.drugNames:data.operationNames,tmp=[];
+                for(let i = 0;i < arr.length;i++){
                     let obj = {}
-                        obj['flg'] = type==5?2:1;
-                        obj['name'] = '手术';
-                        obj['uniqueName'] = '手术';
-                        tmp.push(obj)
-                    curDate=tmp
+                    obj['uniqueName'] = arr[i].name;
+                    obj['name'] = arr[i].name;
+                    obj['flg'] = type;
+                    tmp.push(obj)
                 }
+                curDate=tmp
                 dispatch(searchList(curDate,val.trim()));
             }else{
                 Notify.success(res.data.msg)

+ 27 - 2
src/store/reducers/newAdvice.js

@@ -14,6 +14,7 @@ import {
     SET_TIP,
     DEL_ONE_PIC,
     SEARCH_TYPE_NEW,
+    CHECK_OFF_ON,
 } from '../types/newAdvice';
 import store from '@store';
 import { getStringPlus,  getPushLists,  getPushList,getCurrentDate} from '@utils/tools.js';
@@ -38,12 +39,36 @@ const initSearchList = {
 }
 
 export default (state = initSearchList, action) => {
+    if (action.type == CHECK_OFF_ON) {
+        const newState = Object.assign({}, state);
+        let tempArr = newState.labelListBig;
+        let tempArrs = newState.labelListSmall;
+        let tmpLis = action.item
+        if(tmpLis&&tmpLis.flg == 5){//药品
+            for(let i = 0;i < tempArr.length;i++){
+                if(tempArr[i].time == tmpLis.time){
+                    let flg = tempArr[i].check;
+                    tempArr[i].check = !flg
+                }
+            }
+            newState.labelListBig = [...tempArr]
+        }else{//手术、操作
+            for(let i = 0;i < tempArrs.length;i++){
+                if(tempArrs[i].time == tmpLis.time){
+                    let flg = tempArrs[i].check;
+                    tempArrs[i].check = !flg
+                }
+            }
+            newState.labelListSmall = [...tempArrs]
+        }
+        return newState;
+    }
     if (action.type == DEL_ONE_PIC) {
         const newState = Object.assign({}, state);
         let tempArr = newState.labelListBig;
         let tempArrs = newState.labelListSmall;
         let tmpLis = action.item
-        if(tmpLis&&tmpLis.flg == 1){//大项
+        if(tmpLis&&tmpLis.flg == 5){//大项
             tempArr = tempArr.filter((item)=>item.time != tmpLis.time)
             newState.labelListBig = [...tempArr]
         }else{//小项
@@ -78,7 +103,7 @@ export default (state = initSearchList, action) => {
         const tempArrs = newState.labelListSmall;
         let tmpLis = action.list
         tmpLis['time'] = getCurrentDate(1)
-        if(tmpLis.flg == 1){//大项
+        if(tmpLis.flg == 5){//大项
             tempArr.push(tmpLis)
             newState.labelListBig = [...tempArr]
         }else{//小项

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

@@ -15,3 +15,4 @@ export const SET_CONTEXT = 'SET_CONTEXT';
 export const SET_TIP = 'SET_TIP';
 export const SEARCH_TYPE_NEW = 'SEARCH_TYPE_NEW';
 export const DEL_ONE_PIC = 'DEL_ONE_PIC';
+export const CHECK_OFF_ON = 'CHECK_OFF_ON';