Browse Source

Merge remote-tracking branch 'origin/dev/zhangxc' into dev/new

# Conflicts:
#	src/common/components/ItemBox/index.jsx
#	src/components/AddInspect/index.jsx
#	src/components/Diagnosis/index.jsx
#	src/components/Diagnosis/index.less
zhouna 6 years ago
parent
commit
4a897b473c

+ 5 - 5
src/common/components/ItemBox/index.jsx

@@ -19,8 +19,8 @@ class ItemBox extends Component {
     this.handleClick = this.handleClick.bind(this);
   }
   getBoxStyle(){
-    const {boxHeight,boxWidth,boxLineHeight,marginTop} = this.props;
-    return {width:boxWidth?boxWidth:undefined,height:boxHeight?boxHeight:undefined,lineHeight:boxLineHeight?boxLineHeight:'22px',marginTop:marginTop};
+    const {boxHeight,boxWidth,boxLineHeight,marginTop,backgroundColor} = this.props;
+    return {width:boxWidth?boxWidth:undefined,height:boxHeight?boxHeight:undefined,lineHeight:boxLineHeight?boxLineHeight:'22px',marginTop:marginTop,backgroundColor:backgroundColor?backgroundColor:''};
   }
 
   handleClick(e){
@@ -29,11 +29,11 @@ class ItemBox extends Component {
   }
 
   render(){
-    const {title,children,editable,className,handleFocus,onchange,fuzhen,border,handleBlur} = this.props;
+    const {title,children,editable,className,handleFocus,onchange,fuzhen,border,handleBlur,titleTop,backgroundColor} = this.props;
     // console.log(title,editable)
     return <div className={style["box"]+" "+"clearfix"} >
-      <div className={style["title"] + ' ' + className}>{title}</div>
-      <div className={`${style["content"]} ${border?style["border"]:''}`} contentEditable={editable} style={this.getBoxStyle()} onFocus={handleFocus} onInput={onchange} onClick={(e)=>{this.handleClick(e);}} onBlur={handleBlur}>
+      <div className={style["title"] + ' ' + className} style={{marginTop:titleTop?'22px':''}}>{title}</div>
+      <div className={`${style["content"]} ${border?style["border"]:''} ${backgroundColor?style["noBorder"]:''}`} contentEditable={editable} style={this.getBoxStyle()} onFocus={handleFocus} onInput={onchange} onClick={(e)=>{this.handleClick(e);}} onBlur={handleBlur}>
         {fuzhen?children||fuzhen:children}
       </div>
     </div>

+ 4 - 0
src/common/components/ItemBox/index.less

@@ -22,8 +22,12 @@
     padding:5px;
     outline: none;
     border-bottom:1px @part-border-color dashed;
+    border-radius: 4px;
   }
   .border {
       border:1px @part-border-color dashed !important;
   }
+  .noBorder{
+    border: none;
+  }
 }

+ 2 - 0
src/components/AddAssistCheck/index.jsx

@@ -3,6 +3,7 @@ import { SearchOption, Calendar } from '@commonComp';
 import styles from './index.less';
 import $ from 'jquery';
 import Textarea from './Textarea';
+import more from '@common/images/addItem1.png';
 
 class AddAssistCheck extends React.Component {
     constructor(props) {
@@ -120,6 +121,7 @@ class AddAssistCheck extends React.Component {
             <div className={styles.wrapper}>
                 {this.getAssistLabel()}
                 <div id="searchWrapAssist" style={{position:"relative"}}>
+                    <img src={more} style={{verticalAlign:'middle',marginRight:'2px'}}/>
                     <span className={`${styles.staticTag}`} onClick={(e) => this.handleSearchShow(e)} id="assistCheck">添加辅检项目</span>
                     <SearchOption handleChangeValue={handleChangeValue} visible={this.state.show}>
                         {this.getSearchList(list)}

+ 4 - 3
src/components/AddAssistCheck/index.less

@@ -2,17 +2,18 @@
 
 .staticTag {
     cursor: pointer;
-    color: #767676;
+    // color: #767676;
+    color: @blue;
     /*padding-top: 6px;*/
     box-sizing: border-box;
     display: inline-block;
     position: relative;
-    &:before {
+    /* &:before {
         content: '\300C';
     }
     &:after {
         content: '\300D';
-    }
+    } */
 }
 .searchLi {
     height: 44px;

+ 66 - 6
src/components/AddInspect/index.jsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import { SearchOption, InspectCommon, Calendar } from '@commonComp';
+import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
 import { deepClone } from '@utils/tools';
 import styles from './index.less';
 import date1 from './img/date1.png';
@@ -7,7 +7,7 @@ import date2 from './img/date2.png';
 import close from './img/close.png';
 import store from '@store';
 import $ from 'jquery';
-
+import more from '@common/images/addItem1.png';
 class Inspect extends React.Component {
     constructor(props) {
         super(props);
@@ -20,6 +20,10 @@ class Inspect extends React.Component {
             currentData:{},
             numPlus:0,     //判断是否所有的填写单都是空
             num:0,            //暂存数据,获取一次,不能每次都是新的数据
+            toastText:'',
+            visible:false,
+            type:null,
+            id:null
         }
         this.handleChangeDate = this.handleChangeDate.bind(this)
         this.handleShowDate = this.handleShowDate.bind(this)
@@ -29,8 +33,48 @@ class Inspect extends React.Component {
         this.changeActivePart = this.changeActivePart.bind(this)
         this.normalVal = this.normalVal.bind(this)
         this.showDetails = this.showDetails.bind(this)
+        this.delConfirm = this.delConfirm.bind(this)
+        this.handleCancel = this.handleCancel.bind(this)
+        this.handleSearchShow = this.handleSearchShow.bind(this)
+    }
+    delConfirm(){//弹窗确定
+        const{delPartItem,handleCloseExcel} = this.props;
+        const{type,id} = this.state;
+        if(type==1){
+            delPartItem(id)
+        }else if(type==2){
+            handleCloseExcel(id)
+        }
+        this.setState({
+            visible:false,
+            type:null,
+            id:null,
+        })
+        Notify.success("删除成功");
+    }
+    handleDelClick(type,idx){
+        this.setState({
+            type:type,
+            id:idx,
+            visible:true
+        })
+        if(type==1){//单项
+            this.setState({
+                toastText:'是否删除该化验项?'
+            })
+        }else if(type==2){//导入项
+            this.setState({
+                toastText:'是否删除导入项?'
+            })
+        }
+    }
+    handleCancel(){
+        this.setState({
+            visible:false,
+            type:null,
+            id:null,
+        })
     }
-
     componentDidMount() {
         $(document).click((event) => {
             let searchWrap = $('#searchWrap')[0];   // 搜索按钮
@@ -61,7 +105,8 @@ class Inspect extends React.Component {
     handleSearchShow(e) {
         let tmpShow = this.state.show;
         this.setState({ show: !tmpShow })
-        e.stopPropagation();
+        console.trace(789,this.state.show);
+        // e.stopPropagation();
     }
     handleFillShow(e,idx) {
         let tmpShow = this.state.showFill;
@@ -216,6 +261,7 @@ class Inspect extends React.Component {
     }
     render() {
         const { handleChangeValue, list, labelList,delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive,getExcelDataList,handleCloseExcel } = this.props;
+        const {toastText,visible} = this.state;
         return (
             <div className={styles.wrapper}>
                 <div className={styles.check}>
@@ -224,7 +270,7 @@ class Inspect extends React.Component {
                             return <div style={{marginTop:'10px'}}>
                                 {
                                     items && items.lisExcelRes.length > 0 ? <ul className={styles.excelDataLists}>
-                                    <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={()=>{handleCloseExcel(idx)}}/>
+                                    <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={(idx)=>{this.handleDelClick(2,idx)}}/>
                                     {
                                         items.lisExcelRes.map((item,idx)=>{
                                             return <li className={styles.excelDataLis} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
@@ -323,18 +369,32 @@ class Inspect extends React.Component {
                                             : null
                                         }
                                     </div>
-                                    <img className={styles.partDel} src={close} alt="删除项" onClick={()=>{delPartItem(idx)}}/>
+                                    <img className={styles.partDel} src={close} alt="删除项" onClick={(idx)=>{this.handleDelClick(1,idx)}}/>
                                 </li>
                             })
                         }
                     </ul>
                 </div>
                 <div style={{position:"relative"}}>
+                    <img src={more} style={{verticalAlign:'middle',marginRight:'2px'}}/>
                     <span id="searchWrap" className={`${styles.staticTag}`} onClick={(e) => this.handleSearchShow(e)}>添加化验项</span>
                     <SearchOption handleChangeValue={handleChangeValue} visible={this.state.show}>
                         {this.getSearchList(list)}
                     </SearchOption>
                 </div>
+                <ConfirmModal 
+                    visible={visible}
+                    confirm={()=>{this.delConfirm()}}
+                    close={this.handleCancel}
+                    cancel={this.handleCancel}
+                    okText="删除"
+                    cancelText='取消'
+                    okBorderColor={'#3B9ED0'}
+                    okColor={'#fff'}
+                    oKBg={'#3B9ED0'}
+                >
+                    <p className={styles['center']}>{toastText}</p>
+                </ConfirmModal>
             </div>
         )
     }

+ 4 - 3
src/components/AddInspect/index.less

@@ -52,16 +52,17 @@
 
 .staticTag {
     cursor: pointer;
-    color: #767676;
+    // color: #767676;
+    color: @blue;
     padding-top: 10px;
     display: inline-block;
     position: relative;
-    &:before {
+    /* &:before {
         content: '\300C';
     }
     &:after {
         content: '\300D';
-    }
+    } */
 }
 .labelWrap {
     .table {

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

@@ -69,7 +69,7 @@ class Advice extends Component{
     })
 
     return  <div className={`${'mainsuit-box'} ${style['main-suit']}`}>
-      <ItemBox title='医嘱' editable={false}>
+      <ItemBox title='医嘱' editable={false} border={true} marginTop="10px">
         <div className={style['billing']}>
           {advice.assay && advice.assay.length > 0 || advice.check && advice.check.length > 0 ? <h1>开单项目</h1> : ''}
             {advice.assay && <span className={style['treat-input']}> {advice.assay}</span>}

+ 4 - 1
src/components/CurrentIll/index.jsx

@@ -4,6 +4,7 @@ import {Button,InlineTag,ItemBox,Notify,Textarea} from '@commonComp';
 import TailInlineTag from '@commonComp/TailInlineTag';
 import chooseType from '@containers/eleType.js';
 import SearchDrop from '@components/SearchDrop';
+import {filterDataArr} from '@utils/tools'
 
 class CurrentIll extends Component{
   constructor(props){
@@ -35,7 +36,9 @@ class CurrentIll extends Component{
     // 判断主诉是否为空
     const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear} = this.props;
     const that = this;
-    if(mainData.length == 0 && !mainText[0]){
+    let mainFinallyText = filterDataArr(mainText);console.log(88,mainText,mainFinallyText);
+    // if(mainData.length == 0 && !mainText[0]){
+    if(!mainFinallyText){
       //弹窗提醒
       Notify.error("无法操作,请先输入主诉");
       this.setState({

+ 6 - 3
src/components/Diagnosis/index.jsx

@@ -5,7 +5,7 @@ import DiagnosticList from '@containers/DiagnosticList.js';
 // import TreatDrug from '@containers/TreatDrug.js'
 import DiagResultSearch from '@containers/DiagResultSearch'
 import $ from 'jquery';
-
+import more from '@common/images/addItem1.png';
 
 class Diagnosis extends Component {
     constructor(props) {
@@ -43,9 +43,12 @@ class Diagnosis extends Component {
         
         
         return (<div>
-            <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto'>
+            <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
                 <DiagnosticList></DiagnosticList>
-                <div><span id='addDiag' className={style['add-diag']} onClick={this.handleshowSearch}>添加诊断结果</span></div>
+                <div style={{marginLeft:'10px'}}>
+                    <img src={more} style={{verticalAlign:'middle',marginRight:'2px'}}/>
+                    <span id='addDiag' className={style['add-diag']} onClick={this.handleshowSearch}>添加诊断结果</span>
+                </div>
                 <DiagResultSearch></DiagResultSearch>
                 
             </ItemBox>

+ 9 - 6
src/components/Diagnosis/index.less

@@ -1,13 +1,16 @@
+@import "~@less/variables.less";
 .add-diag {
-    height: 32px;
-    line-height: 32px;
-    padding: 0 10px;
-    color: #767676;
+    height: 50px;
+    line-height: 50px;
+    // padding: 0 10px;
+    // margin-left: 10px;
+    // color: #767676;
+    color: @blue;
     cursor: pointer;
 }
-.add-diag:before{
+/* .add-diag:before{
     content: '「';
 }
 .add-diag:after{
     content: '」';
-}
+} */

+ 7 - 2
src/components/DiagnosticList/index.jsx

@@ -80,13 +80,18 @@ class DiagnosticList extends Component {
         return(
                 <div className={style['diaglist-wrap']}>
                     {list && (list.length > 0) && list.map((item, index) => {
+                        const hasTreat = item.treat.commonTreatment && item.treat.surgeryTreatment && item.treat.treatment.length>0
                         return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.id} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img src={diagDown}/></span>}
-                                    <span className={style['diag-number']}>{index === 0 ? '主' : index+1}</span>
+                                    <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '主' : index+1}</span>
                                     <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
-                                    <span className={style['treat']} onClick={() =>{this.showTreat(item)}}>治疗方案</span>
+                                    <span className={style['treat']}
+                                          style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'' : '1px solid gray'}}
+                                          onClick={() =>{hasTreat && this.showTreat(item)}}>
+                                          治疗方案
+                                    </span>
                                     <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item.id)}}/>
                         </div>)
                     })}

+ 7 - 1
src/components/DiagnosticList/index.less

@@ -7,6 +7,7 @@
     line-height: 50px;
     border-bottom: 1px dotted #989DA3;
     position: relative;
+    background: #EAF7FD;
 }
 .diag-number {
     display: inline-block;
@@ -40,7 +41,10 @@
 }
 .diag-first {
     background: #EAF7FD;;
-    color: #000;
+    color: #3B9ED0;
+    border: 1px solid #3B9ED0;
+    border-radius: 4px;
+    line-height: 17px;
 }
 
 
@@ -49,6 +53,8 @@
     border-bottom: 1px solid #666;
     box-sizing: border-box;
     position: relative;
+    color:#000;
+    font-weight: bold;
 }
 
 .diag-up, .diag-down {

+ 2 - 1
src/components/TreatDesc/DrugInfo/index.jsx

@@ -12,8 +12,9 @@ class DrugInfo extends Component {
         return (<div className={style['drug-info-wrapper']}>
                 <h3 className={style['drug-title']}>{drugInfo.title}说明书  <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/> </h3>
                 { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']}>
+                    <div className={style['drug-title1']}>{drugInfo.title}说明书</div>
                     {drugInfo.drugDesc.map((item, index) =>{
-                        return <div className={style['drug-desc-item']}>{item.title}: <span dangerouslySetInnerHTML ={{__html: item.content}}></span> </div>
+                        return <div className={style['drug-desc-item']}><span className={style['drug-desc-title']}>{item.title}</span> <span className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></span> </div>
                     })}
                 </div> }
 

+ 26 - 1
src/components/TreatDesc/DrugInfo/index.less

@@ -20,9 +20,34 @@
     height: 40px;
     line-height: 40px;
     padding: 0 40px;
+    border-bottom: 1px solid #979797;
 }
 .close-drug-desc {
     position: absolute;
     right: 0;
     width: 30px;
-}
+}
+.drug-desc-item {
+    padding: 5px 0;
+}
+.drug-desc-title {
+    display: inline-block;
+    font-weight: bold;
+    font-size: 14px;
+    height: 100%;
+    float: left;
+}
+.drug-desc-title::before {
+    content: '【'
+}
+.drug-desc-title::after {
+    content: '】'
+}
+.drug-title1 {
+    height: 60px;
+    line-height: 60px;
+    font-size: 32px;
+    color: #000000;
+    text-align: center;
+}
+.drug-desc-content {}

+ 6 - 4
src/containers/DiagnosticItem.js

@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
 import DiagnosticItem from '@components/DiagnosticItem';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList'; 
 import {  SHOW_SEARCH,  HIDE_SEARCH, SET_SEARCH_VALUE } from '@store/types/diagnosticSearch';
+import { addDiagnostic } from '@store/async-actions/treat';
 import { getSearchResult } from '@store/async-actions/diagnosticSearch';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 import {billing, getTips} from '../store/async-actions/pushMessage';
@@ -17,10 +18,11 @@ function mapStateToProps(state) {
 function mapDispatchToProps(dispatch) {
     return{
         addDiagnostic: (item) => {
-            dispatch({
-                type: ADD_DIAGNOSTIC,
-                item: item
-            });
+            dispatch(addDiagnostic(item))
+            // dispatch({
+            //     type: ADD_DIAGNOSTIC,
+            //     item: item
+            // });
             dispatch({
                 type: GET_DIAGNOSTIC_STR
             });

+ 0 - 1
src/store/actions/diagnosticList.js

@@ -7,7 +7,6 @@ export const addDiagnostic = (state, action) => {
 export const delDiagnostic = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
     res.diagnosticList = res.diagnosticList.filter(item => item.id !== action.id);
-    console.log('del',state,action.id)
     return res;
 }
 

+ 53 - 1
src/store/async-actions/treat.js

@@ -1,5 +1,6 @@
 import { json } from "@utils/ajax";
 import { SET_TREAT } from '@store/types/diagnosticList';
+import { ADD_DIAGNOSTIC} from '@store/types/diagnosticList'; 
 import { SET_DRUG_INFO, SET_TREATMENT, SET_RECOMMEND_BASIC } from '@store/types/treat';
 import {getEMRParams} from '@store/async-actions/fetchModules';
 const api={
@@ -7,6 +8,58 @@ const api={
     textPush:'/api/icss/push/pushText'
 }
 
+export const addDiagnostic = (item) => {
+        return (dispatch, getState) => {
+            const state = getState();
+            let url = api.push;
+            if(+state.typeConfig.confirmType===1){
+                url=api.textPush;
+            }
+            const emrData = getEMRParams();
+            const diagnosticList = state.diagnosticList.diagnosticList;
+            let diag = '';
+            if(diagnosticList) {
+                for (let i = 0; i < diagnosticList.length; i++ ) {
+                    if(i ===0 ) {
+                        diag = diag + diagnosticList[i].name;
+                    } else {
+                        diag = diag + ',' + diagnosticList[i].name;
+                    }
+                    
+                }
+            }
+            if (item.type === 1) {
+                diag = diag + ',' + item.name
+            } else {
+                diag = diag + ',' + item.name
+            }
+            const params = {
+                "age": emrData.age,
+                "featureType": "8",
+                "diag": diag,
+                "diseaseId":  item.id,
+                "lis": emrData.lis,
+                "other": emrData.other,
+                "pacs": emrData.pacs,
+                "sex": emrData.sex,
+                "symptom": emrData.current||emrData.main,
+                "vital": emrData.vital
+            };
+            
+            json(url, params).then((data) =>{
+                item.treat = data.data.data.treat
+            
+                return dispatch({
+                    type: ADD_DIAGNOSTIC,
+                    item: item
+                })
+            }).catch((e) =>{
+                console.log(e)
+            })
+        }
+
+}
+
 export const getTreatResult = (item) =>{
     return (dispatch, getState) => {
         const state = getState();
@@ -146,7 +199,6 @@ export const getTreatResult = (item) =>{
     
 } 
 export const getInstroduce = (item)=>{
-    // const instroduce = '<p>药品说明1</p><p>药品说明2</p><p>药品说明3</p>'
 
     return (dispatch, getState) =>{
         const url = '/api/icss/introduceInfo/getByQuestionId';