Bladeren bron

Merge remote-tracking branch 'origin/TCM0513' into testNew

zhouna 4 jaren geleden
bovenliggende
commit
06f960bf3c

+ 1 - 1
src/common/components/Add/index.jsx

@@ -23,7 +23,7 @@ class Add extends Component {
   render(){
     const {showText,handleClick,id,height} = this.props;
     return <div className={style['tag-container']} onClick={(e)=>{this.handleClick(e)}} id={id}>
-        <img src={more} style={{verticalAlign:'middle'}}/>
+        <img src={more} style={{verticalAlign:'text-bottom'}}/>
         <span className={`inline-box ${style['gray']}`} style={{height:height?height:'',lineHeight:height?height:''}}>{showText}</span>
       </div>
   }

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

@@ -5,7 +5,7 @@
   padding: 0 3px 3px;
 }
 .tag-container{
-  margin:5px 2px;
+  margin:5px 70px 5px 2px;
   display: inline-block;
   position: relative;
   cursor: pointer;

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

@@ -111,7 +111,7 @@ class SearchOption extends React.Component {
       this.setState({border:false,val:''})
     }
     render() {
-        const { children,visible,searchType } = this.props;
+        const { children,visible,searchType,showSym } = this.props;
         const { show,showInsp,txt } = this.state;
         return (
             searchType == 1||searchType == 2?
@@ -153,7 +153,7 @@ class SearchOption extends React.Component {
                 <div className={styles.autoList}>
                     {children}
                 </div>
-            </div>:<div id="searchOption" className={visible?`${styles.search} ${styles.show} searchOption`:`${styles.search} ${styles.hide} searchOption`}>
+            </div>:<div id="searchOption" className={visible?`${styles.search} ${styles.show} ${showSym?styles.isSym:''} searchOption`:`${styles.search} ${styles.hide} searchOption`}>
                 <img className={styles.searchVal} src={search} alt="搜索" />
                 <img style={{display:show?'block':'none'}} className={styles.clearVal} src={clear} onClick={this.handleClearVal} alt="清空" />
                 <input

+ 3 - 0
src/common/components/SearchOption/index.less

@@ -10,6 +10,9 @@
     top: 30px;
     background-color: #fff;
     // margin-bottom: 80px;
+    &.isSym{
+        left: 230px;
+    }
     .llStyle;
     .autoList {
         // max-height: 225px;

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

@@ -117,6 +117,8 @@ class BlockEMRCont extends Component {
           <AssistCheck setHighter={this.setHighter}></AssistCheck>
           {/* 诊断 */}
           <Diagnosis setHighter={this.setHighter} hideChronic={true}></Diagnosis>
+          {/* 诊断 */}
+          <Diagnosis setHighter={this.setHighter} isTcm={true} hideChronic={true}></Diagnosis>
           {/* 医嘱 */}
           <NewAdvice setHighter={this.setHighter}></NewAdvice>
           {/* <AdviceContainer></AdviceContainer> */}

+ 21 - 6
src/components/DiagResultSearch/index.jsx

@@ -20,14 +20,26 @@ class DiagResultSearch extends Component {
     const that = this
     $(document).click(function (e) {
       var diagSearch = $('#diagSearch')[0];
+      var diagTcmSearch = $('#diagTcmSearch')[0];
+      var diagSymSearch = $('#diagSymSearch')[0];
       var addDiag = $('#addDiag')[0];
+      var addTcmDiag = $('#addTcmDiag')[0];
+      var addSymDiag = $('#addSymDiag')[0];
       var confirm = $('#confirm')[0];
-      if (diagSearch) {
+      if (diagSearch||diagTcmSearch||diagSymSearch) {
         if (!confirm&&!that.isBar) {//onMousedown的目标为滚动条时,删除弹窗不关闭
-          if (e.target != diagSearch && e.target != addDiag && e.target.parentNode != addDiag && !$.contains(diagSearch, e.target)) {
+          if (diagSearch&&e.target != diagSearch && e.target != addDiag && e.target.parentNode != addDiag && !$.contains(diagSearch, e.target)) {
             that.props.hideSearch();
             that.props.setHighter(48)
           }
+          if (diagTcmSearch&&e.target != diagTcmSearch && e.target != addTcmDiag && e.target.parentNode != addTcmDiag && !$.contains(diagTcmSearch, e.target)) {
+              that.props.hideTcmSearch();
+              that.props.setHighter(48)
+          }
+          if (diagSymSearch&&e.target != diagSymSearch && e.target != addSymDiag && e.target.parentNode != addSymDiag && !$.contains(diagSymSearch, e.target)) {
+              that.props.showSymSearch(false);
+              that.props.setHighter(48)
+          }
         }
       }
     });
@@ -44,6 +56,7 @@ class DiagResultSearch extends Component {
   getSearchList(searchResult, isShowNoDataInfo) {
     // console.log(searchResult,'searchResult');
     // console.log(isShowNoDataInfo,'isShowNoDataInfo');
+    const {isTcm,showSym,setHighter} = this.props;
     if (isShowNoDataInfo === true && searchResult.length === 0 ){
       return <div className={style['search-result-noItem']}><span>暂无筛选项</span></div>
     }
@@ -51,7 +64,7 @@ class DiagResultSearch extends Component {
       {
         searchResult.length !== 0  && searchResult.map((item,idx) => {
           return (<div key={idx} className={style['search-result-item']}>
-            <DiagnosticItem setHighter={this.props.setHighter} title={true} item={item} clearInput={this.clearInput} type='search'/>
+            <DiagnosticItem setHighter={setHighter} isTcm={isTcm} showSym={showSym} title={true} item={item} clearInput={this.clearInput} type='search'/>
           </div>)
         })
       }
@@ -59,7 +72,8 @@ class DiagResultSearch extends Component {
   }
 
   render() {
-    const { show, searchResult, refreshScroller, handleChangeValue, pageTop, windowHeight, isShowNoDataInfo } = this.props;
+    const { show,showTcm,showSym, searchResult, refreshScroller, handleChangeValue, pageTop, windowHeight, isShowNoDataInfo,isTcm } = this.props;
+
     const contStyle={
       opacity:'0.4',
       right:'0',
@@ -68,9 +82,10 @@ class DiagResultSearch extends Component {
       width:'14px',
       background:'#f1f1f1'};
     const barStyle={background:'#777',width:'100%'};
+    const idName = showSym?"diagSymSearch":(showTcm?'diagTcmSearch':'diagSearch');
     return (
-      show && <div id='diagSearch' className={style['search-box']}>
-        <SearchOption handleChangeValue={handleChangeValue} refreshScroller={refreshScroller} pageTop={pageTop} windowHeight={windowHeight} height={180} visible={true}>
+        ((isTcm&&showSym)||(isTcm&&showTcm)||(show&&!isTcm)) && <div id={idName} className={style['search-box']}>
+        <SearchOption showSym={showSym} handleChangeValue={handleChangeValue} refreshScroller={refreshScroller} pageTop={pageTop} windowHeight={windowHeight} height={180} visible={true}>
             {this.getSearchList(searchResult, isShowNoDataInfo)}
         </SearchOption>
       </div>

+ 132 - 56
src/components/Diagnosis/index.jsx

@@ -5,68 +5,144 @@ import { getPageCoordinate,setPosition  } from '@utils/tools';
 import DiagResultSearch from '@containers/DiagResultSearch';
 
 class Diagnosis extends Component {
-  constructor(props) {
-    super(props);
+    constructor(props) {
+        super(props);
 
-    this.state = {
-      diagType: 0,
-      showSearch: props.show,
-      pageTop: ''
+        this.state = {
+            diagType: 0,
+            //showSearch: props.show,
+            pageTop: ''
+        }
+        this.showSearch = this.showSearch.bind(this);
+        this.hideSearch = this.hideSearch.bind(this);
+        this.handleshowSearch = this.handleshowSearch.bind(this);
+        this.handleTcmShowSearch = this.handleTcmShowSearch.bind(this);
+        this.handleSymShowSearch = this.handleSymShowSearch.bind(this);
+        this.refreshScroller = this.refreshScroller.bind(this);
+        this.showTcmSearch=this.showTcmSearch.bind(this);
+        this.showSymSearch=this.showSymSearch.bind(this);
+        this.hideTcmSearch=this.hideTcmSearch.bind(this);
     }
-    this.showSearch = this.showSearch.bind(this);
-    this.hideSearch = this.hideSearch.bind(this);
-    this.handleshowSearch = this.handleshowSearch.bind(this);
-    this.refreshScroller = this.refreshScroller.bind(this);
-  }
-  componentWillReceiveProps() {
-    this.setState({
-      showSearch: this.props.show
-    })
-  }
 
+    /*componentWillReceiveProps() {
+      this.setState({
+        showSearch: this.props.show,
+        showTcmSearch: this.props.showTcm
+      })
+    }*/
 
-  showSearch() {
-    const { showSearch } = this.props;
-    showSearch && showSearch()
-  }
-  hideSearch() {
-    const { hideSearch } = this.props;
-    hideSearch && hideSearch()
-  }
-  handleshowSearch(e) {
-    this.props.show ? this.hideSearch() : this.showSearch()
-    this.setState({ pageTop:getPageCoordinate(e).boxTop })
-    if(this.props.show){
-      this.props.setHighter(48)
-    }else{
-      this.props.getBilling({mode:10});
-      setPosition(e,"#searchOption",this.props.setHighter)
+
+    showSearch() {
+        const {showSearch} = this.props;
+        showSearch && showSearch()
+    }
+
+    hideSearch() {
+        const {hideSearch} = this.props;
+        hideSearch && hideSearch()
+    }
+
+    showTcmSearch() {
+        const {showTcmSearch} = this.props;
+        showTcmSearch && showTcmSearch()
+    }
+
+    hideTcmSearch() {
+        const {hideTcmSearch} = this.props;
+        hideTcmSearch && hideTcmSearch()
+    }
+
+    showSymSearch(flag) {
+        const {showSymSearch} = this.props;
+        showSymSearch && showSymSearch(flag)
     }
-  }
-  refreshScroller(){
-    //更新滚动条状态,解决容器变大滚动条不更新bug
-    return this.context.scrollArea;
-  }
-  render() {
-    return (<div id="diagnosisResult">
-      <ItemBox id="diagnosis" title='诊断' boxHeight='auto' hideAllDrop={this.props.hideAllDrop} titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
-        <DiagnosticList refreshScroller={this.refreshScroller} hideChronic={this.props.hideChronic}></DiagnosticList>
-        <div style={{ marginLeft: '10px', position: 'relative',color:'#000' }}>
-          <Add showText="添加诊断结果" handleClick={this.handleshowSearch} id="addDiag" height="50px" />
-          <DiagResultSearch
-            refreshScroller={this.refreshScroller} 
-            setHighter={this.props.setHighter} 
-            windowHeight={this.props.windowHeight}
-            pageTop={this.state.pageTop} 
-            height={150}>
-          </DiagResultSearch>
-        </div>
-      </ItemBox>
-      <Message></Message>
-    </div>)
-  }
-}
 
+    handleSymShowSearch(e) {
+        this.showSymSearch(this.props.showSym ? false : true)
+        this.setState({pageTop: getPageCoordinate(e).boxTop})
+        if (this.props.showSym) {
+            this.props.setHighter(48)
+        } else {
+            this.props.getBilling({mode: 10});
+            setPosition(e, "#searchOption", this.props.setHighter)
+        }
+    }
+
+    handleshowSearch(e) {
+        this.props.show ? this.hideSearch() : this.showSearch()
+        this.setState({pageTop: getPageCoordinate(e).boxTop})
+        if (this.props.show) {
+            this.props.setHighter(48)
+        } else {
+            this.props.getBilling({mode: 10});
+            setPosition(e, "#searchOption", this.props.setHighter)
+        }
+    }
+
+    handleTcmShowSearch(e) {
+        this.props.showTcm ? this.hideTcmSearch() : this.showTcmSearch()
+        this.setState({pageTop: getPageCoordinate(e).boxTop})
+        if (this.props.showTcm) {
+            this.props.setHighter(48)
+        } else {
+            this.props.getBilling({mode: 10});
+            setPosition(e, "#searchOption", this.props.setHighter)
+        }
+    }
+
+    refreshScroller() {
+        //更新滚动条状态,解决容器变大滚动条不更新bug
+        return this.context.scrollArea;
+    }
+
+    render() {
+        const {isTcm,tcmList} = this.props;
+        if (isTcm) {    //添加中医诊断后才显示中医症候添加按钮
+            const len = tcmList.length>0?tcmList.length-1:0;
+            const showNext = tcmList.length===0||(tcmList.length>0&&tcmList[len].tcmDiag&&tcmList[len].tcmSyndrome);
+            const showZh = tcmList.length>0&&tcmList[len].tcmDiag&&!tcmList[len].tcmSyndrome;
+            return (<div id="diagnosisTcmResult">
+                <ItemBox id="tcmDiagnosis" title="中医诊断" boxHeight='auto' hideAllDrop={this.props.hideAllDrop}
+                         titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
+                    <DiagnosticList isTcm={isTcm}
+                                    refreshScroller={this.refreshScroller}
+                                    setHighter={this.props.setHighter}
+                                    hideChronic={this.props.hideChronic}></DiagnosticList>
+                    {showNext?<div style={{marginLeft: '10px', position: 'relative', color: '#000'}}>
+                        <Add showText="添加中医诊断结果" handleClick={this.handleTcmShowSearch} id="addTcmDiag"
+                             height="50px"/>
+                        <DiagResultSearch
+                            refreshScroller={this.refreshScroller}
+                            setHighter={this.props.setHighter}
+                            windowHeight={this.props.windowHeight}
+                            pageTop={this.state.pageTop}
+                            isTcm={isTcm}
+                            height={150}>
+                        </DiagResultSearch>
+                    </div>:''}
+                </ItemBox>
+                <Message></Message>
+            </div>)
+        }
+        return (<div id="diagnosisResult">
+            <ItemBox id="diagnosis" title='诊断' boxHeight='auto' hideAllDrop={this.props.hideAllDrop} titleTop='22px'
+                     marginTop='9px' backgroundColor='#EAF7FD'>
+                <DiagnosticList refreshScroller={this.refreshScroller} hideChronic={this.props.hideChronic}></DiagnosticList>
+                <div style={{marginLeft: '10px', position: 'relative', color: '#000'}}>
+                    <Add showText="添加诊断结果" handleClick={this.handleshowSearch} id="addDiag" height="50px"/>
+                    <DiagResultSearch
+                        refreshScroller={this.refreshScroller}
+                        setHighter={this.props.setHighter}
+                        windowHeight={this.props.windowHeight}
+                        pageTop={this.state.pageTop}
+                        height={150}>
+                    </DiagResultSearch>
+                </div>
+            </ItemBox>
+            <Message></Message>
+        </div>)
+    }
+}
 Diagnosis.contextTypes = {
   scrollArea: React.PropTypes.object
 };

+ 19 - 13
src/components/DiagnosticItem/index.jsx

@@ -8,7 +8,7 @@ import infoMove from '@common/images/info-move.png';
 import {getChronic} from '@store/async-actions/homePage.js';
 import {storageLocal} from '@utils/tools';
 import {
-    getMRAnalyse
+    embedPush
   } from '@store/async-actions/pushMessage';
 
 class DiagnosticItem extends Component{
@@ -46,15 +46,21 @@ class DiagnosticItem extends Component{
         })
     }
     chooseDiagodal(item) {
-        const { diagnosticList,getTips, type ,addDiagnostic} = this.props;
-        // getTips && getTips(item);
-        // if (type == 'search') {
-        //     getTips && getTips({type:7,name: item.name, position: 1});
-        // }
-        for (let i = 0; i < diagnosticList.length; i++) {
-            if(diagnosticList[i].name === item.name) {
-                Notify.info('该诊断已存在');
-                return
+        const { diagnosticList,isTcm,tcmList,showSym} = this.props;
+        if(isTcm&&showSym){ //添加的是中医症候,判断是否重复,添加中医诊断不需要判断
+            const lastTcmDiag = tcmList[tcmList.length-1].tcmDiag;
+            for (let i = 0; i < tcmList.length-1; i++) {
+                if(tcmList[i].tcmDiag+tcmList[i].tcmSyndrome=== lastTcmDiag+item.name) {
+                    Notify.info('该中医诊断+中医症候已存在');
+                    return
+                }
+            }
+        }else{
+            for (let i = 0; i < diagnosticList.length; i++) {
+                if(diagnosticList[i].name === item.name) {
+                    Notify.info('该诊断已存在');
+                    return
+                }
             }
         }
         this.props.setHighter&&this.props.setHighter(80)
@@ -71,12 +77,12 @@ class DiagnosticItem extends Component{
         getTips && getTips({id:item.id,type:7,name: item.name, position: 1});
     }
     addDiagodal(diagType){
-        const {item, isChronicMag,mode,EMRScrollCont,type,addDiagnostic, clearInput, hideSearch} = this.props;
+        const {item,EMRScrollCont,isTcm,showSym,type,addDiagnostic, clearInput, hideSearch} = this.props;
         item.type = diagType;
          /*if(item.type == 2&&mode=='0') {      //文本模式不走慢病。6.0慢病取消
              isChronicMag(item);
          }*/
-         addDiagnostic&&addDiagnostic(item);
+         addDiagnostic&&addDiagnostic(item,isTcm,showSym);
          clearInput&&clearInput();
          hideSearch&&hideSearch();
         this.context.scrollArea&&this.context.scrollArea.refresh();
@@ -87,7 +93,7 @@ class DiagnosticItem extends Component{
                EMRScrollCont.scrollYTo(scrollTop);
             })
          }
-         store.dispatch(getMRAnalyse())
+        showSym&&store.dispatch(embedPush({mode:10,action: "diag",}))
 
     }
     handleMouseEnterDrug() {

+ 119 - 65
src/components/DiagnosticList/index.jsx

@@ -7,18 +7,19 @@ import diagDown from './img/diagDown.png'
 import manageIcon from '@common/images/manage.png';
 import singleB from './img/singleB.png';
 import singleL from './img/singleL.png';
-import {ConfirmModal, Message,ComplexModal,Footer,Loading} from '@commonComp';
+import {ConfirmModal, Message,ComplexModal,Footer,Loading, Add} from '@commonComp';
 import Notify from '@commonComp/Notify';
 import Treat from '@containers/Treat'
 import store from '@store';
 import { initItemList ,setInitHistory,getHistempDetail} from '@store/async-actions/historyTemplates';
-import { pushAllDataList,inspectAndAssist ,deepClone,setFontColorSize} from '@utils/tools';
+import { getPageCoordinate,setPosition,pushAllDataList,inspectAndAssist ,deepClone,setFontColorSize} from '@utils/tools';
 import { dragBox } from '@utils/drag';
 import iconRadioDefault from '@common/images/icon-radio-default.png'
 import iconRadioActive from '@common/images/icon-radio-active.png'
 import AssessResult from '@containers/AssessResult';
 import {getAssessData} from '@store/async-actions/fetchModules';
 import DetailsModal from '@components/PushItems/DetailsModal';
+import DiagResultSearch from '@containers/DiagResultSearch';
 import tableIcon from '@common/images/table.png';
 import { CONFIRM_TYPE } from "@store/types/typeConfig";
 import config from '@config/index';
@@ -43,7 +44,8 @@ class DiagnosticList extends Component {
             activeItem:{},
             hasEnterItem: -1,
             hasEnterImg: false,
-            timer:null
+            timer:null,
+            pageTop:''
         }
         this.deleteItem = this.deleteItem.bind(this);
         this.cancel = this.cancel.bind(this);
@@ -58,6 +60,10 @@ class DiagnosticList extends Component {
         this.handleSaveAssess = this.handleSaveAssess.bind(this);       //评估弹窗确定
         this.onPrint = this.onPrint.bind(this);
         this.hideTips=this.hideTips.bind(this);
+        this.handleTcmShowSearch = this.handleTcmShowSearch.bind(this);
+        this.handleSymShowSearch = this.handleSymShowSearch.bind(this);
+        this.showTcmSearch=this.showTcmSearch.bind(this);
+        this.showSymSearch=this.showSymSearch.bind(this);
     }
     onPrint() {
       let dom = $("#AssistResult");
@@ -69,31 +75,59 @@ class DiagnosticList extends Component {
       });
     }
     upDiagnostic(index) {
-        const { upDiagnostic } = this.props;
-        upDiagnostic && upDiagnostic(index)
+        const { upDiagnostic,isTcm } = this.props;
+        upDiagnostic && upDiagnostic(index,isTcm)
     }
     downDiagnostic(index) {
-        const { downDiagnostic } = this.props;
-        downDiagnostic && downDiagnostic(index)
+        const { downDiagnostic,isTcm } = this.props;
+        downDiagnostic && downDiagnostic(index,isTcm)
     }
     deleteItem() {
         const { delItem,idxNum } = this.state;
-        const { delDiagnostic, delReact,delFollowUp } = this.props;
-        delDiagnostic && delDiagnostic(delItem,idxNum);
-        delReact && delReact(delItem);
-        delFollowUp && delFollowUp(delItem);
+        const { delDiagnostic, delReact,delFollowUp,isTcm } = this.props;
+        delDiagnostic && delDiagnostic(delItem,idxNum,isTcm);
+        delReact && delReact(delItem);      //删除对应不良反应
+        delFollowUp && delFollowUp(delItem);    //删除对应回访记录
         this.setState({
             visible: false,
         })
         Notify.success('删除成功')
     }
     handleBlur(e,delItem,idxNum){
-      const { delDiagnostic } = this.props;
+      const { delDiagnostic,isTcm } = this.props;
       let name = e.target.value
       if(name.trim() == ''){
-        delDiagnostic && delDiagnostic(delItem,idxNum);
+        delDiagnostic && delDiagnostic(delItem,idxNum,isTcm);
       }
     }
+    handleTcmShowSearch(e) {
+        this.props.showTcm ? this.hideTcmSearch() : this.showTcmSearch()
+        this.setState({pageTop: getPageCoordinate(e).boxTop})
+        if (this.props.showTcm) {
+            this.props.setHighter(48)
+        } else {
+            //this.props.getBilling({mode: 10});
+            setPosition(e, "#searchOption", this.props.setHighter)
+        }
+    }
+    handleSymShowSearch(e) {
+        this.showSymSearch(this.props.showSym ? false : true)
+        this.setState({pageTop: getPageCoordinate(e).boxTop})
+        if (this.props.showSym) {
+            this.props.setHighter(48)
+        } else {
+            //this.props.getBilling({mode: 10});
+            setPosition(e, "#searchOption", this.props.setHighter)
+        }
+    }
+    showTcmSearch(flag) {
+        const {showTcmSearch} = this.props;
+        showTcmSearch && showTcmSearch(flag)
+    }
+    showSymSearch(flag) {
+        const {showSymSearch} = this.props;
+        showSymSearch && showSymSearch(flag)
+    }
     cancel() {
         this.setState({
             visible: false
@@ -112,8 +146,8 @@ class DiagnosticList extends Component {
         })
     }
     showTreat(item, idx) {
-        const  { getTreatResult,getBilling } = this.props;
-        getTreatResult && getTreatResult(item,idx);
+        const  { getTreatResult,getBilling,isTcm } = this.props;
+        getTreatResult && getTreatResult(item,idx,isTcm);
         getBilling({mode:10});
     } 
     handleClickDiag(item) {
@@ -307,24 +341,78 @@ class DiagnosticList extends Component {
       this.setState({timer})
     }
     render(){
-        const { list, treatment,pushMessage, showReferRecord, showHistoryCase ,chronicMagItem,loading,refreshScroller,windowWidth,hideChronic} = this.props;
-      const {showTipsDetails,tipsDetails,showAllName}=pushMessage;
-        const {visible, treatTitle, showAssess, isAssessConfirm, assessId, disName, hasOndel, hasOnIndex,hasEnterItem,hasEnterImg,delItem} = this.state;
-        const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
-        //let isChronic = false;      //是否要显示管理评估
-        const footer = <Footer print={true}
-                               footText="确定"
-                               handlePrint={this.onPrint}
-                               handleConfirm={this.handleSaveAssess}/>;
+        const { list,tcmList, treatment,pushMessage, loading,refreshScroller,windowHeight,setHighter,isTcm} = this.props;
+        const {showTipsDetails,tipsDetails,showAllName}=pushMessage;
+        const {visible, treatTitle,  hasOndel, hasOnIndex,delItem} = this.state;
+        const diagList = isTcm?tcmList:list;
+        if(isTcm){      //中医,添加中医诊断后才显示中医症候添加按钮
+            return(
+                <div className={style['diaglist-wrap']}>
+                    {diagList && (diagList.length > 0) && diagList.map((item, index) => {
+                        const {tcmDiag,tcmSyndrome} = item;
+                        return (<div draggable={false} className={`${style['diag-box']} ${setFontColorSize(2,3)} clearfix`} id="diagListBox" key={index} >
+                            {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
+                            {diagList.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}
+                            <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '1' : index+1}</span>
+
+                                {tcmDiag?<span className={style['diag-name']}
+                                  onMouseEnter={this.handleMouseEnterDrug.bind(this,index)}
+                                  onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
+                            >
+                                      <span title={tcmDiag} className={style['diag-name-box']} style={{'max-width': '300px'}}>
+                                        <input type="text" value={tcmDiag} onFocus={(e)=>{this.handleFocus()}} onBlur={(e)=>{this.handleBlur(e,item,index)}} onInput={(e)=>this.handleInput(e,index)}/>
+                                      </span>
+
+                                    </span>:<Add showText="添加中医诊断结果" isTcm={isTcm} handleClick={this.handleTcmShowSearch} id="addTcmDiag" height="50px" />}
+                            {tcmSyndrome?<span className={style['diag-name']} onMouseEnter={this.handleMouseEnterDrug.bind(this,index)} onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}>
+                                      <span title={tcmSyndrome} className={style['diag-name-box']} style={{'max-width': '300px'}}>
+                                        <input type="text" value={tcmSyndrome} onFocus={(e)=>{this.handleFocus()}} onBlur={(e)=>{this.handleBlur(e,item,index)}} onInput={(e)=>this.handleInput(e,index)}/>
+                                      </span>
+
+                                    </span>:(tcmDiag?<Add showText="添加中医症候" isTcm={isTcm} handleClick={this.handleSymShowSearch} id="addSymDiag" height="50px" />:'')}
+                                {tcmDiag&&tcmSyndrome?'':<DiagResultSearch
+                                        refreshScroller={refreshScroller}
+                                        setHighter={setHighter}
+                                        windowHeight={windowHeight}
+                                        pageTop={this.state.pageTop}
+                                        isTcm={isTcm}
+                                        height={150}>
+                                    </DiagResultSearch>}
+                                {tcmDiag&&tcmSyndrome?<span className={style['treat']}
+                                  onClick={() =>{this.showTreat(item, index)}}>
+                                          <img src={item.hasTreat?singleB:singleL} alt=""/>
+                                          治疗方案
+                                    </span>:''}
+                            <img className={style['diag-del']} src={hasOnIndex == index ? hasOndel ? del_on : del_icon : del_icon} onMouseEnter={this.handleEnterDel.bind(this,index)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={()=>{this.handleDeleteItem(item,index)}}/>
+                        </div>)
+                    })}
+                    {treatment&&<Treat title={treatTitle} refreshScroller={refreshScroller}></Treat>}
+                    {showTipsDetails &&<DetailsModal
+                        showTipsDetails = {showTipsDetails}
+                        hideTips = {this.hideTips}
+                        showAllName = {showAllName}
+                        tipsDetails = {tipsDetails}/>}
+                    <ConfirmModal visible={visible}
+                                  okText='删除'
+                                  cancelText='取消'
+                                  confirm={this.deleteItem}
+                                  cancel={this.cancel}
+                                  close={this.close}
+                    >
+                        <div className={style['del-msg']}>是否删除中医诊断{delItem.tcmDiag}?</div>
+                    </ConfirmModal>
+                    <Loading show={loading}/>
+                </div>
+
+            )
+        }
         return(
                 <div className={style['diaglist-wrap']}>
-                    {list && (list.length > 0) && list.map((item, index) => {
-                        /*const hasTreat = item.treat && ((item.treat.commonTreatment&&item.treat.commonTreatment.content) || (item.treat.surgeryTreatment&&item.treat.surgeryTreatment.content) || item.treat.treatment.length>0 ||(item.adverseReactions&&item.adverseReactions.length > 0)
-                           || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow)
-                        isChronic = !hideChronic&&chronicMagItem&&item.type==2&&chronicList&&chronicList.findIndex((it)=>it.conceptId==item.conceptId)!=-1;*/
+                    {diagList && (diagList.length > 0) && diagList.map((item, index) => {console.log(diagList,item)
+
                         return (<div draggable={false} className={`${style['diag-box']} ${setFontColorSize(2,3)} clearfix`} id="diagListBox" key={item.conceptId} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
-                                    {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}
+                                    {diagList.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}
                                     <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '1' : index+1}</span>
                                     <span className={style['diag-name']} 
                                        onMouseEnter={this.handleMouseEnterDrug.bind(this,index)}
@@ -333,44 +421,17 @@ class DiagnosticList extends Component {
                                       <span title={item.name} className={style['diag-name-box']} style={{'max-width': '300px'}}>
                                         <input type="text" value={item.name} onFocus={(e)=>{this.handleFocus()}} onBlur={(e)=>{this.handleBlur(e,item,index)}} onInput={(e)=>this.handleInput(e,index)}/>
                                       </span>
-                                      {/* <img className={`${style['info-img']}`}
-                                          title='点击i图标可查看详细说明'
-                                          style ={hasEnterItem===index  ? {display: "inline-block"} : {display: "none"}}
-                                          src={hasEnterImg ? infoMove : infoShow} 
-                                          onMouseEnter={this.handleMouseEnterImg.bind(this)}
-                                          onMouseLeave = {this.handleMouseLeaveImg.bind(this)}
-                                          onClick={this.handleClickDiag.bind(this,item,false,false,false)}
-                                      /> */}
-                                    </span> 
-                                    {/* {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>} */}
+
+                                    </span>
                                     <span className={style['treat']}
-                                          // style ={hasTreat ? '' : { color: 'gray', cursor: 'text'}}
                                           onClick={() =>{this.showTreat(item, index)}}>
                                           <img src={item.hasTreat?singleB:singleL} alt=""/>
                                           治疗方案
                                     </span>
-                                    {/*{isChronic&&index===0&&item.conceptId===chronicMagItem.conceptId?<span className={style['assess']}
-                                          onClick={this.showAssessFn.bind(this,item)}>
-                                        管理评估
-                                    </span>:''}*/}
                                     <img className={style['diag-del']} src={hasOnIndex == index ? hasOndel ? del_on : del_icon : del_icon} onMouseEnter={this.handleEnterDel.bind(this,index)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={()=>{this.handleDeleteItem(item,index)}}/>
                         </div>)
                     })}
                      {treatment&&<Treat title={treatTitle} refreshScroller={refreshScroller}></Treat>}
-                     {/*{showAssess?<ComplexModal onclose={this.showAssessFn.bind(this)} footer={footer}
-                                               title='管理和评估'
-                                               icon={manageIcon}
-                                               top={'3%'}
-                                               bottom={'3%'}
-                                               width={820}>
-
-                       <AssessResult closeAssess={this.showAssessFn.bind(this)}
-                                     disId={assessId}
-                                     disName={disName}
-                                     chronicMagItemName={list[0].name}
-                                     isAssessConfirm={isAssessConfirm}
-                                     ></AssessResult>
-                      </ComplexModal>:''}*/}
                     {showTipsDetails &&<DetailsModal
                         showTipsDetails = {showTipsDetails}
                         hideTips = {this.hideTips}
@@ -385,13 +446,6 @@ class DiagnosticList extends Component {
                                   >
                                   <div className={style['del-msg']}>是否删除诊断{delItem.name}?</div> 
                     </ConfirmModal>
-                    {/*<ConfirmModal visible={showReferRecord} okText='是' cancelText='否' confirm={this.referRecord}  cancel={this.noReferRecord} close={this.noReferRecord}>
-                        <div className={style['confirm-info']}>是否引用往期病历</div> 
-                    </ConfirmModal>
-                    <ConfirmModal visible={showHistoryCase} noFooter='true' title='请选择历史病历' close={this.closeHistoryCaseModal} titleBg="#DFEAFE" icon={tableIcon} height={300}>
-                        {this.getHistoryCase()}
-                        <div className={style['confirm-history']}><span className={style['confirm-history-btn']} onClick={this.referCase}>确定</span></div>
-                    </ConfirmModal>*/}
                     <Loading show={loading}/>
                 </div>
                

+ 3 - 1
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -311,7 +311,8 @@ class HistoryCaseContainer extends React.Component {
 
     render(){
         const { items,handleSortClick,showHistoryBox,preInfo } = this.props;
-        const { activeHis, visible, dataJson, dataStr, delVisible, editVisible, historyCase, currentIndex, activeIndex } = this.state;     
+        const { activeHis, visible, dataJson, dataStr, delVisible, editVisible, historyCase, currentIndex, activeIndex } = this.state;
+        //console.log(1,dataStr)
         const getAllDataStringList = (dataStr) =>{           //获取所有模块文本的数据
             let jsonDataString = {};
             jsonDataString.lis = {};
@@ -326,6 +327,7 @@ class HistoryCaseContainer extends React.Component {
             jsonDataString.lis = dataStr[8] && dataStr[8].content || '';      //检验导入填写
             jsonDataString.pacs = dataStr[9] && dataStr[9].content || '';     //检查
             jsonDataString.diag = dataStr[10] &&dataStr[10].content || '';      //诊断
+            jsonDataString.tcmDiag = dataStr[12] &&dataStr[12].content || '';      //诊断
             jsonDataString.advice = dataStr[11] && dataStr[11].content || '';       //医嘱
             return jsonDataString;
         }

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

@@ -82,7 +82,7 @@ class PreviewBody extends Component {
     }
   }
   render() {
-    const { show, preInfo, dataJson, dataStr, baseObj, flg ,come,showAssessBtn,showHistoryCases} = this.props;
+    const { show, preInfo, dataJson, dataStr, baseObj, flg ,come,showAssessBtn,showHistoryCases} = this.props;console.log(3,dataStr)
     let other_data={},lis_data={},pas_data={},other_yjs='',access='',adviceData={};
     let isShowSex = baseObj.sex !== 2 ? false : true
     const contStyle = {
@@ -132,6 +132,7 @@ class PreviewBody extends Component {
           <PreviewInspect dataJson={dataStr.lis} toTime={this.toTime} dateTime={this.state.dateTime} showDetails={this.showDetailsCopy}></PreviewInspect>
           <ItemPart dataStr={dataStr.pacs} title={'检查:'} type={2}></ItemPart>
           <ItemPart dataStr={dataStr.diag} title={'诊断:'} type={2} lastDot={true}></ItemPart>
+          <ItemPart dataStr={dataStr.tcmDiag} title={'中医诊断:'} type={2} lastDot={true}></ItemPart>
           <MedicalAdvice advice={dataStr.advice}></MedicalAdvice>
          
         </table>

+ 20 - 0
src/containers/DiagResultSearch.js

@@ -3,6 +3,8 @@ import { connect } from 'react-redux';
 import {
   SHOW_SEARCH,
   HIDE_SEARCH,
+  SHOW_TCM_SEARCH,
+  HIDE_TCM_SEARCH,
   GET_SEARCH_RESULT,
   SHOWNODATATEXT,
 } from '@store/types/diagnosticSearch';
@@ -12,6 +14,8 @@ import DiagResultSearch from '@components/DiagResultSearch';
 function mapStateToProps(state) {
     return {
       show: state.diagnosticSearch.show,
+      showTcm: state.diagnosticSearch.showTcm,
+      showSym:state.diagnosticSearch.showSym,
       searchValue: state.diagnosticSearch.searchValue,
       searchResult: state.diagnosticSearch.searchResult,
       isShowNoDataInfo: state.diagnosticSearch.isShowNoDataInfo,
@@ -30,6 +34,22 @@ function mapDispatchToProps(dispatch) {
                 type: HIDE_SEARCH
             })
         },
+        showTcmSearch:()=>{
+            dispatch({
+                type: SHOW_TCM_SEARCH
+            })
+        },
+        hideTcmSearch:()=>{
+            dispatch({
+                type: HIDE_TCM_SEARCH
+            })
+        },
+        showSymSearch:(flag)=>{
+            dispatch({
+                type: 'SHOW_SYM_SEARCH',
+                show:flag
+            })
+        },
         clearSearchResult: ()=>{
             dispatch({
                 type: GET_SEARCH_RESULT,

+ 20 - 1
src/containers/Diagnosis.js

@@ -1,13 +1,16 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import Diagnosis from '@components/Diagnosis';
-import { SHOW_SEARCH,  HIDE_SEARCH } from '@store/types/diagnosticSearch';
+import { SHOW_SEARCH,  HIDE_SEARCH ,SHOW_TCM_SEARCH,HIDE_TCM_SEARCH} from '@store/types/diagnosticSearch';
 import {HIDEDROP} from '@types/homePage';
 import {embedPush} from '@store/async-actions/pushMessage';
 
 function mapStateToProps(state) {//console.log(state)
     return {
         show: state.diagnosticSearch.show,
+        showTcm: state.diagnosticSearch.showTcm,
+        showSym: state.diagnosticSearch.showSym,
+        tcmList:state.diagnosticList.tcmList,
         windowHeight:state.homePage.windowHeight,
         typeConfig: state.typeConfig
     }
@@ -25,6 +28,22 @@ function mapDispatchToProps(dispatch) {
                 type: HIDE_SEARCH
             })
         },
+        showSymSearch:(flag)=>{
+            dispatch({
+                type: 'SHOW_SYM_SEARCH',
+                show:flag
+            })
+        },
+        showTcmSearch:()=>{
+            dispatch({
+                type: SHOW_TCM_SEARCH
+            })
+        },
+        hideTcmSearch:()=>{
+            dispatch({
+                type: HIDE_TCM_SEARCH
+            })
+        },
         hideAllDrop(){
           dispatch({
             type:HIDEDROP

+ 16 - 6
src/containers/DiagnosticItem.js

@@ -2,7 +2,7 @@ import React from 'react';
 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 {  SHOW_SEARCH,  HIDE_SEARCH,HIDE_TCM_SEARCH, SET_SEARCH_VALUE } from '@store/types/diagnosticSearch';
 import { isChronicMag, isAddMainSuit } from'@store/async-actions/diagnosticList.js';
 import { addDiagnostic } from '@store/async-actions/treat';
 import { getSearchResult } from '@store/async-actions/diagnosticSearch';
@@ -12,6 +12,8 @@ import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
 function mapStateToProps(state) {
     return {
         diagnosticList: state.diagnosticList.diagnosticList,
+        tcmList: state.diagnosticList.tcmList,
+        symList: state.diagnosticList.symList,
         mode:state.typeConfig.mode,
         EMRScrollCont:state.inspect.context.scrollArea,             //滚动条对象
     }
@@ -19,18 +21,19 @@ function mapStateToProps(state) {
 
 function mapDispatchToProps(dispatch) {
     return{
-        addDiagnostic: (item) => {
+        addDiagnostic: (item,isTcm,showSym) => {
             
             dispatch({
                 type: ADD_DIAGNOSTIC,
-                item: item
+                item: item,
+                isTcm,
+                isSym:showSym,      //是否是中医症候
             });
             dispatch({
-                type: GET_DIAGNOSTIC_STR
+                type: GET_DIAGNOSTIC_STR,
+                isTcm
             });
             dispatch(isAddMainSuit())
-            // dispatch(addDiagnostic(item))
-            //dispatch(getConceptDetail({type:7,name: item.name, position: 1},false,true,true))
         },
         showSearch:()=>{
             dispatch({
@@ -41,6 +44,13 @@ function mapDispatchToProps(dispatch) {
             dispatch({
                 type: HIDE_SEARCH
             })
+            dispatch({
+                type: HIDE_TCM_SEARCH
+            })
+            dispatch({
+                type: 'SHOW_SYM_SEARCH',
+                show:false
+            })
         },
         getTips: (diagItem) => {
             dispatch(getConceptDetail(diagItem))

+ 34 - 10
src/containers/DiagnosticList.js

@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
 import { DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING,ADDDIAGMSG,EDITDIAGMSG} from '@store/types/diagnosticList'; 
 import {SHOW_TIPS_DETAILS,HIDE_TIPS_DETAILS} from '@store/types/pushMessage';
+import { SHOW_TCM_SEARCH,HIDE_TCM_SEARCH} from '@store/types/diagnosticSearch';
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
 import {embedPush, getAllConceptDetail, getConceptDetail, getMRAnalyse} from '../store/async-actions/pushMessage';
@@ -18,6 +19,7 @@ function mapStateToProps(state) {//console.log(state)
     return {
         pushMessage: pushMessage,
         list: diagnosticList.diagnosticList,
+        tcmList:diagnosticList.tcmList,
         treatment: state.treat.show,
         isFirst: diagnosticList.isFirst,
         diagnosticStr: diagnosticList.diagnosticStr,
@@ -56,16 +58,35 @@ function mapDispatchToProps(dispatch) {
             type: GET_DIAGNOSTIC_STR
         });
       },
-        delDiagnostic: (item,idx) => {
+        showTcmSearch:(flag)=>{
+          if(flag){
+              dispatch({
+                  type: SHOW_TCM_SEARCH
+              })
+          }else{
+              dispatch({
+                  type: HIDE_TCM_SEARCH
+              })
+          }
+        },
+        showSymSearch:(flag)=>{
+            dispatch({
+                type: 'SHOW_SYM_SEARCH',
+                show:flag
+            })
+        },
+        delDiagnostic: (item,idx,isTcm) => {
             dispatch({
                 type: DEL_DIAGNOSTIC,
                 item: item,
-                idx:idx
+                idx:idx,
+                isTcm
             });
             dispatch({
-                type: GET_DIAGNOSTIC_STR
+                type: GET_DIAGNOSTIC_STR,
+                isTcm
             });
-            dispatch(getMRAnalyse())
+            dispatch(embedPush({mode:10,action: "diag"}))
         },
         delReact: (item) => {
             dispatch({
@@ -79,19 +100,21 @@ function mapDispatchToProps(dispatch) {
                 delItem: delItem
             })
         },
-        upDiagnostic: (index, id) => {
+        upDiagnostic: (index,isTcm) => {
             dispatch({
                 type: UP_DIAGNOSTIC,
-                index: index
+                index: index,
+                isTcm
             });
             dispatch({
                 type: GET_DIAGNOSTIC_STR
             });
         },
-        downDiagnostic: (index, id) => {
+        downDiagnostic: (index,isTcm) => {
             dispatch({
                 type: DOWN_DIAGNOSTIC,
-                index: index
+                index: index,
+                isTcm
             });
             dispatch({
                 type: GET_DIAGNOSTIC_STR
@@ -102,11 +125,12 @@ function mapDispatchToProps(dispatch) {
                 type: SHOW_TREAT,
             })
         },
-        getTreatResult: (item,idx) => {
+        getTreatResult: (item,idx,isTcm) => {
             dispatch({
                 type:ADDDIAGMSG,
                 item:item,
-                idx:idx
+                idx:idx,
+                isTcm
             });
         },
         getTips: (item) => {

+ 81 - 29
src/store/actions/diagnosticList.js

@@ -19,9 +19,11 @@ export const editDiagMsg = (state, action) => {
     return res;
 }
 
-export const addDiagMsg = (state, action) => {
+export const addDiagMsg = (state, action) => {  //选中诊断依据
     const res = JSON.parse(JSON.stringify(state));
-    let tmpLis = res.diagnosticList
+    const {isTcm} = action;
+    console.log('addDiagMsg',action)
+    let tmpLis = isTcm?res.tcmList:res.diagnosticList;
     for(let i = 0;i < tmpLis.length;i++){
         if(action.idx == i){
             tmpLis[i].hasTreat = 1
@@ -29,20 +31,55 @@ export const addDiagMsg = (state, action) => {
             tmpLis[i].hasTreat = 0
         }
     }
-    let obj = {
-        "dateValue": '',
-        "name": action.item.name,
-        "uniqueName": action.item.uniqueName
+    tmpLis = [...tmpLis]
+    if(isTcm){
+        res.otherIndex=tmpLis[action.idx];
+    }else{
+        res.diseaseName = tmpLis[action.idx]
+    }
+    return res;
+}
+
+export const addTcmDiagnostic = (state, action) => {
+    const res = JSON.parse(JSON.stringify(state));
+    //console.log('addTcmDiagnostic',action)
+    const { isSym } = action;
+    let obj=null;
+    //如果上一个诊断和症候不全,则不添加新行
+    const len = res.tcmList.length;
+    if(len===0){    //len==0,只可能是添加中医诊断
+        obj = {
+            "tcmDiag":action.item.name, //中医诊断
+            "tcmSyndrome":"",      //中医症候
+            "hasTreat":1,       //默认第一个为治疗方案,作为推送入参
+        };
+        res.tcmList.push(obj);
+    }else{
+        if(isSym){      //上一个症候没填,不用新增
+            res.tcmList[len-1].tcmSyndrome=action.item.name;
+            if(len===1){
+                res.otherIndex = {
+                    "tcmDiag":res.tcmList[0].tcmDiag, //中医诊断
+                    "tcmSyndrome":action.item.name,      //中医症候
+                }
+            }
+        }else{
+            obj = {
+                "tcmDiag":action.item.name, //中医诊断
+                "tcmSyndrome":"",      //中医症候
+                "hasTreat":0,
+            };
+            res.tcmList.push(obj);
+        }
     }
-    res.diagnosticList = [...tmpLis]
-    res.diseaseName = obj
     return res;
 }
 
 export const addDiagnostic = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    res.diagnosticList.push(action.item)
-    let tmpLis = res.diagnosticList,num=0
+    let list = res.diagnosticList;
+    list.push(action.item)
+    let tmpLis = list,num=0
     for(let i = 0;i < tmpLis.length;i++){
         tmpLis[i].uniqueName = tmpLis[i].name
         if(!tmpLis[i].hasTreat){
@@ -51,25 +88,27 @@ export const addDiagnostic = (state, action) => {
     }
     if(num == tmpLis.length){
         tmpLis[0]['hasTreat'] = 1
-        let obj = {
-            "dateValue": '',
-            "name": tmpLis[0].name,
-            "uniqueName": tmpLis[0].uniqueName
-        }
+        let obj  = {
+                "dateValue": '',
+                "name": tmpLis[0].name,
+                "uniqueName": tmpLis[0].uniqueName
+            }
         res.diseaseName = obj
     }
-    res.diagnosticList = [...tmpLis]
+    list = [...tmpLis];
     return res;
 }
 
 export const delDiagnostic = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    res.diagnosticList = res.diagnosticList.filter((item,idx) =>{
+    const {isTcm} = action;
+    let k = isTcm?'tcmList':'diagnosticList';
+    let list = res[k].filter((item,idx) =>{
         if(idx != action.idx){
             return item
         }
     });
-    let tmpLis = res.diagnosticList,num=0
+    let tmpLis = list,num=0
     for(let i = 0;i < tmpLis.length;i++){
         if(!tmpLis[i].hasTreat){
             ++num
@@ -82,34 +121,44 @@ export const delDiagnostic = (state, action) => {
             "name": tmpLis[0].name,
             "uniqueName": tmpLis[0].uniqueName
         }
-        res.diseaseName = obj
+        if(isTcm){
+            res.otherIndex=tmpLis[0];
+        }else{
+            res.diseaseName = obj
+        }
     }else{
-        res.diseaseName = {}
+        if(isTcm){
+            res.otherIndex=tmpLis[0];
+        }else{
+            res.diseaseName = {}
+        }
     }
-    res.diagnosticList = [...tmpLis]
+    res[k] = [...tmpLis]
     return res;
 }
 
 export const upDiagnostic = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    const index = action.index;
+    const {index,isTcm} = action;
+    const list = isTcm?res.tcmList:res.diagnosticList;
     if ( index === 0) {
         return res
     }
-    const temp = res.diagnosticList[index-1];
-    res.diagnosticList[index-1] =res.diagnosticList[index];
-    res.diagnosticList[index] = temp;
+    const temp = list[index-1];
+    list[index-1] =list[index];
+    list[index] = temp;
     return res;
 }
 export const downDiagnostic = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    const index = action.index;
+    const {index,isTcm} = action;
+    const list = isTcm?res.tcmList:res.diagnosticList;
     if ( index === state.length-1) {
         return res
     }
-    const temp = res.diagnosticList[index+1];
-    res.diagnosticList[index+1] = res.diagnosticList[index];
-    res.diagnosticList[index] = temp;
+    const temp = list[index+1];
+    list[index+1] = list[index];
+    list[index] = temp;
     return res;
 }
 
@@ -214,5 +263,8 @@ export function reDiagData(state, action) {
     res.diagnosticList = action.params[10].contentValue;
     res.diagnosticStrNoType = action.params[10].contentJson;
     res.diseaseName = action.params[10].diseaseName;
+    //中医数据
+    res.tcmList =action.params[12].contentValue;
+    res.otherIndex = action.params[12].diseaseName;
     return res;
 }

+ 24 - 1
src/store/actions/diagnosticSearch.js

@@ -1,6 +1,8 @@
-export const showSearch = (state,action) => {
+export const showSearch = (state,action) => {console.log(action)
     const res = Object.assign({}, state);
     res.show = true;
+    res.showTcm = false;
+    res.showSym = false;
     return res;
 }
 
@@ -9,6 +11,27 @@ export const hideSearch = (state,action) => {
     res.show = false;
     return res;
 }
+export const showTcmSearch = (state,action) => {
+    const res = Object.assign({}, state);
+    res.show = false;
+    res.showSym = false;
+    res.showTcm = true;
+    return res;
+}
+
+export const showSymSearch = (state,action) => {console.log(action)
+    const res = Object.assign({}, state);
+    res.show = false;
+    res.showTcm = false;
+    res.showSym=action.show;
+    return res;
+}
+
+export const hideTcmSearch = (state,action) => {
+    const res = Object.assign({}, state);
+    res.showTcm = false;
+    return res;
+}
 
 export const setSearchValue = (state,action) => {
     const res = Object.assign({},state);

+ 2 - 1
src/store/async-actions/diagnosticList.js

@@ -5,12 +5,13 @@ import { SET_READ_MODE } from "@store/types/typeConfig";
 import {storageLocal} from '@utils/tools'
 import { SAVE_FREE ,SAVE_CHRONIC} from '@store/types/mainSuit';
 import {ISREAD,MODI_LOADING} from "../types/homePage";
+import {reDiagData} from "../actions/diagnosticList";
 export const isAddMainSuit = () =>{
     return (dispatch, getState) => {
         const state = getState();
         if(state.diagnosticList.diagnosticList.length === 1 && state.diagnosticList.diagnosticList[0].type === 2) {
             const isAddMainSuitFlag = state.mainSuit.data && state.mainSuit.data.length === 0 && state.mainSuit.saveText    //判断主诉和检验查体是否为空
-                                      && (state.mainSuit.saveText.length === 0 || state.mainSuit.saveText.length === 1 
+                                      && (state.mainSuireDiagDatat.saveText.length === 0 || state.mainSuit.saveText.length === 1
                                       &&  state.mainSuit.saveText[0] === '') && state.assistCheck && state.assistCheck.dataString.length === 0
                                       && state.inspect.labelList && state.inspect.labelList.length === 0 && state.inspect.inspectStrPlus.length === 0
             if(isAddMainSuitFlag) {

+ 8 - 3
src/store/async-actions/diagnosticSearch.js

@@ -6,6 +6,10 @@ import { formatFormParmas } from '@utils/tools';
 import store from '@store';
 
 export const getSearchList = (val,flag) => {
+    const state = store.getState();
+    //console.log(state)
+    const showTcm = state.diagnosticSearch.showTcm;
+    const showSym = state.diagnosticSearch.showSym;
     if(val.trim() == ''){
         // const data = [];
         if(flag){
@@ -31,7 +35,7 @@ export const getSearchList = (val,flag) => {
             }
         }
         json('/demo/retrieval/index',{
-            "type":'4',
+            "type":showTcm?'12':(showSym?'13':'4'),
             "age": formatFormParmas('patientAge',state.patInfo.patInfoData),
             "inputStr": val.trim(),
             "sex": formatFormParmas('patientSex',state.patInfo.patInfoData),
@@ -41,14 +45,15 @@ export const getSearchList = (val,flag) => {
             if(res.data.code==0){
                 const data = res.data.data;let curDate=[];
 
-                let arr = data.diseaseNames||[];
+                let arr = data[showTcm?'tcmdiseaseNames':(showSym?'tcmsyndromeNames':'diseaseNames')]||[];
                 for(let i = 0;i < arr.length;i++){
                     let tmp = arr[i]
                     let obj = {}
                     obj['name'] = tmp.name;
                     obj['uniqueName'] = tmp.name;
                     obj['conceptId'] = '';
-                    obj['icd10Code'] = tmp.icd10Code;
+                    obj['icd10Code'] = tmp.icd10Code||tmp.code;
+                    //obj['code'] = tmp.code;
                     curDate.push(obj)
                 }
                 if(flag){ 

+ 8 - 1
src/store/async-actions/print.js

@@ -71,7 +71,7 @@ function formatFormParmas(val,arr){
 // 保存病历_lcq_new_重写
 export const saveMedicalData = () =>{
     let baseList = store.getState();
-    const { patInfo: { patInfoData },homePage:{curHos}} = baseList
+    const { patInfo: { patInfoData },homePage:{curHos}} = baseList;
     let inquiryDate = timestampToTime(new Date().getTime())  // 获取当前时间  
     let modeName = baseList.patInfo.medicalName   //病历名称
     let jsonData = getAllDataList(baseList);
@@ -153,6 +153,13 @@ export const saveMedicalData = () =>{
         contentJson: JSON.stringify(tempPreview.advice),
         type: 12,
       },
+      {
+          content: tempPreview.tcmDiag.diagnosticStr,
+          contentValue: tempPreview.tcmDiag.diagnosticList,
+          diseaseName: tempPreview.tcmDiag.diseaseName,
+          contentJson: tempPreview.tcmDiag.diagnosticStrNoType,
+          type: 13,
+      },
     ];
     // let sex = formatFormParmas('patientSex', patInfoData) === '男' ? 1 : 0
     let params = {

+ 7 - 1
src/store/reducers/diagnosticList.js

@@ -24,6 +24,7 @@ import {
 } from '../types/diagnosticList';
 import {
   addDiagnostic,
+  addTcmDiagnostic,
   delDiagnostic,
   upDiagnostic,
   downDiagnostic,
@@ -49,12 +50,14 @@ const initState = {
     diagnosticList: [
     
     ],
+    tcmList:[],
     mainSuitStr:'',
     diagnosticStrNoType:'',
     diagnosticStr:'',
     diseaseName: {
       
-    }
+    },
+    otherIndex:{}
 }
 
 export default function (state=initState, action) {
@@ -65,6 +68,9 @@ export default function (state=initState, action) {
       case ADDDIAGMSG:
         return addDiagMsg(state, action);
       case ADD_DIAGNOSTIC:
+        if(action.isTcm){
+            return addTcmDiagnostic(state, action);
+        }
         return addDiagnostic(state, action);
       case DEL_DIAGNOSTIC:
         return delDiagnostic(state, action);

+ 10 - 2
src/store/reducers/diagnosticSearch.js

@@ -1,8 +1,10 @@
-import { SHOW_SEARCH,  HIDE_SEARCH, SET_SEARCH_VALUE, GET_SEARCH_RESULT,SHOWNODATATEXT } from '../types/diagnosticSearch'; 
-import { showSearch,  hideSearch, setSearchValue, getSearchResult,showText } from '../actions/diagnosticSearch'; 
+import { SHOW_SEARCH,  HIDE_SEARCH, SHOW_TCM_SEARCH,  HIDE_TCM_SEARCH, SET_SEARCH_VALUE, GET_SEARCH_RESULT,SHOWNODATATEXT } from '../types/diagnosticSearch';
+import { showSearch,  hideSearch,showTcmSearch,hideTcmSearch, setSearchValue, getSearchResult,showText,showSymSearch } from '../actions/diagnosticSearch';
 
 const initState = {
   show: false,
+  showTcm: false,
+  showSym:false,
   searchValue: '',
   searchResult: [],
   isShowNoDataInfo: false
@@ -14,6 +16,12 @@ export default function (state=initState, action) {
             return showSearch(state, action);
         case HIDE_SEARCH: 
             return hideSearch(state, action);
+        case 'SHOW_SYM_SEARCH':
+            return showSymSearch(state, action);
+        case SHOW_TCM_SEARCH:
+            return showTcmSearch(state, action);
+        case HIDE_TCM_SEARCH:
+            return hideTcmSearch(state, action);
         case SET_SEARCH_VALUE: 
             return setSearchValue(state, action);
         case GET_SEARCH_RESULT: 

+ 2 - 0
src/store/types/diagnosticSearch.js

@@ -1,5 +1,7 @@
 export const SHOW_SEARCH = 'SHOW_SEARCH';
 export const HIDE_SEARCH = 'HIDE_SEARCH';
+export const SHOW_TCM_SEARCH = 'SHOW_TCM_SEARCH';
+export const HIDE_TCM_SEARCH = 'HIDE_TCM_SEARCH';
 export const SET_SEARCH_VALUE = 'SET_SEARCH_VALUE';
 export const GET_SEARCH_RESULT = 'GET_SEARCH_RESULT';
 export const SHOWNODATATEXT = 'SHOWNODATATEXT';

+ 9 - 1
src/utils/tools.js

@@ -214,7 +214,13 @@ const formatTextInfo = (baseList) =>{
     diagnosticStr: baseList.diagnosticList.diagnosticStr,
     diseaseName: baseList.diagnosticList.diseaseName,
   };
-
+    const {otherIndex} = baseList.diagnosticList;
+  let diagnosticTcmList = {
+      diagnosticList: baseList.diagnosticList.tcmList,
+      diagnosticStrNoType: otherIndex.tcmDiag+otherIndex.tcmSyndrome,
+      diagnosticStr: otherIndex.tcmDiag+otherIndex.tcmSyndrome,
+      diseaseName: otherIndex,
+  };
   return {
     chief: JSON.stringify(baseList.mainSuit.saveText),
     present: JSON.stringify(baseList.currentIll.saveText),
@@ -227,6 +233,7 @@ const formatTextInfo = (baseList) =>{
     lis: labelList, //化验
     pacs: assistLabelList,
     diag: diagnosticList,
+    tcmDiag:diagnosticTcmList,
     advice: newAdviceLabelList,
   };
 }
@@ -1040,6 +1047,7 @@ function getEMRParams(){
     "marital": marriageHistory.saveText[0]||'',  //婚育史
     "menstrual": menstruationHistory.saveText[0]||'',  //月经史
     "diseaseName":diagnosticList.diseaseName,
+    "otherIndex":diagnosticList.otherIndex,
     "operationName":tempOperationName,
     "infectious": "",
     "operation": tempoperation,