Explorar o código

Merge remote-tracking branch 'origin/ChronicMag' into ChronicMag

# Conflicts:
#	src/components/AssessResult/ScaleItem/index.jsx
#	src/components/AssessResult/index.jsx
#	src/containers/AssessResult.js
zhouna %!s(int64=6) %!d(string=hai) anos
pai
achega
7d43d69490

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

@@ -93,7 +93,7 @@ class Advice extends Component{
             {/* {advice.commontreatment && <div className={style['treat-input']}  onInput={this.handleComTreatInput}  contentEditable={true} style = {{outline: 'none'}}></div>} */}
             {<Textarea value={advice.commontreatment} isRead={isRead} handleChangeAssistValue={this.handleComTreatInput} ></Textarea>}
         </div>}
-        {!isFirstMainDiag && <FollowUp  noTitle="true"   setFollowUp={saveFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
+        {!isFirstMainDiag &&<div><FollowUp  noHeader="true" textStyle={{padding: '0 10px'}}  setFollowUp={saveFollowUp} followUp = {followUp} isRead={isRead}></FollowUp></div>}
         {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={style['scheme']}>
           {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}
           {scheme}

+ 1 - 3
src/components/Treat/AdverseReactions/index.jsx

@@ -18,12 +18,10 @@ class AdverseReactions extends Component {
         const { icon, titleStyle,titleBg, filter, title,  adversReactionList } = this.props
         return(
             <div className={style['last-treat-wrapper']}>
-                { console.log('adversReactionList', adversReactionList) }
                 <div className={style['last-treat-title-box']} style={titleStyle}></div>
                 <div className={style['last-treat-title']} ><img className={style['last-treat-icon']} src={icon}/>{title}</div>
                 {adversReactionList.map((item, index) => {
-                    return (<div key={item.id}><span>{item.tagName}:</span>
-                        {console.log('item.details', item.details)}
+                    return (<div key={item.id}><span className={style['last-treat-name-box']}>{item.tagName}:</span>
                         {item.details.map((it, idx) => {
                             return <span key={item.id + it.name}>
                                 <input type="checkbox" checked={it.checked} id={item.id + it.name} onChange={this.changeReact.bind(this, it, index)}/>

+ 4 - 0
src/components/Treat/AdverseReactions/index.less

@@ -23,5 +23,9 @@
     float: left;
     margin: 10px;
 }
+.last-treat-name-box {
+    display: inline-block;
+    width: 150px;
+}
 
 

+ 2 - 3
src/components/Treat/DrugHistory/index.jsx

@@ -16,14 +16,13 @@ class DrugHistory extends Component {
 
     render() {
         const { icon, titleStyle,titleBg, filter, title, drugHistory, showDrugInfo, setDrugInfo } = this.props
-        console.log('1111111111111111')
         return(
             (drugHistory['慢病用药内容'] && drugHistory['慢病用药内容'].length > 0 || drugHistory['普通病用药内容'] && drugHistory['普通病用药内容'].length > 0) &&
             <div className={style['last-treat-wrapper']}>
                 <div className={style['last-treat-title-box']} style={titleStyle}></div>
                 <div className={style['last-treat-title']} ><img className={style['last-treat-icon']} src={icon}/>{title}</div>
-                {drugHistory['慢病用药内容'].length > 0 && <LastDrug title='普通病用药内容' lastDrugList = {drugHistory['慢病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
-                {drugHistory['普通病用药内容'].length > 0 && <LastDrug title='慢病用药内容' lastDrugList = {drugHistory['普通病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
+                {drugHistory['慢病用药内容'] && drugHistory['慢病用药内容'].length > 0 && <LastDrug title='普通病用药内容' lastDrugList = {drugHistory['慢病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
+                {drugHistory['普通病用药内容'] &&drugHistory['普通病用药内容'].length > 0 && <LastDrug title='慢病用药内容' lastDrugList = {drugHistory['普通病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
             </div>
         )
     }

+ 4 - 4
src/components/Treat/FollowUp/index.jsx

@@ -16,16 +16,16 @@ class FollowUp extends Component {
     }
 
     render() {
-        const { icon, titleStyle,titleBg, filter, title, followUp, isRead, noTitle } = this.props
+        const { icon, titleStyle,titleBg, filter, title, followUp, isRead, noHeader, noTitle, textStyle} = this.props
         return(
             <div className={style['general-wrapper']}>
-                {noTitle? '': <div>
+                {noHeader? '': <div>
                     <div className={style['general-title-box']} style={titleStyle}></div>
                     <div className={style['general-title']} ><img className={style['general-icon']} src={icon}/>{title}</div>
                 </div>}
                 
-                <div>回访时间: 
-                    <Textarea value={followUp} handleInputFollowUp={this.handleInputFollowUp} isRead={isRead}></Textarea>后回访,不适随诊
+                <div style={textStyle}>
+                    {noTitle?'': '回访时间:'}<Textarea value={followUp} handleInputFollowUp={this.handleInputFollowUp} isRead={isRead}></Textarea>后回访,不适随诊
                 </div>
             </div>
         )

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

@@ -75,7 +75,7 @@ class Treat extends Component {
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
-                        {hasFollowUp && <FollowUp icon={followUpIcon} title='回访时间'   setFollowUp={setFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
+                        {hasFollowUp && <FollowUp icon={followUpIcon} title='回访时间' noTitle='true'  setFollowUp={setFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
                         {/* 回访时间 */}
                         {/* {followUp && <div>回访时间: 
                             <span  className={style['follow-up-box']}

+ 18 - 10
src/store/async-actions/treat.js

@@ -51,14 +51,14 @@ export const addDiagnostic = (item) => {
                 "patientId": emrData.patientId,
             };
             //判断是否走慢病系统
-            // const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
-            const isChronic = true
+            const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
+            // const isChronic = true
             if (isChronic) {
                 let chronicList = JSON.parse(storageLocal.get('chronic'));
                 if(!chronicList){
                     getChronic().then(() =>{
                     chronicList = JSON.parse(storageLocal.get('chronic'));
-                    for(let i=0; i<chronicList.length; i++){
+                        for(let i=0; i<chronicList.length; i++){
                             if(chronicList[i].id==item.id&&chronicList[i].name==item.name){ //判断某个病是否为慢病
                                 params.disType = 1
                             }
@@ -160,8 +160,8 @@ export const getTreatResult = (item) =>{
         //         "symptom": "恶心,呕吐",
         //         "vital": ""
         // }
-        // const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
-        const isChronic = true
+        const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
+        // const isChronic = true
         if (isChronic) {
             let chronicList = JSON.parse(storageLocal.get('chronic'));
             if(!chronicList){
@@ -172,7 +172,7 @@ export const getTreatResult = (item) =>{
                             params.disType = 1
                         }
                     }
-                    getTreatment(item, dispatch, state, url,params)
+                    getTreatment(item, dispatch, state, url,params, isChronic)
 
                 });
             } else {
@@ -181,10 +181,10 @@ export const getTreatResult = (item) =>{
                         params.disType = 1
                     }
                 }
-                getTreatment(item, dispatch, state,url,params)
+                getTreatment(item, dispatch, state,url,params, isChronic)
             }
         } else {
-            getTreatment(item, dispatch, state,url,params)
+            getTreatment(item, dispatch, state,url,params, isChronic)
         }
         
     }
@@ -192,7 +192,7 @@ export const getTreatResult = (item) =>{
 } 
 
 //获取治疗方案
-function getTreatment(item, dispatch, state,url,params) {
+function getTreatment(item, dispatch, state,url,params, isChronic) {
     json(url, params).then((data) =>{
         let treat;
         if(data.data.data) {
@@ -226,7 +226,15 @@ function getTreatment(item, dispatch, state,url,params) {
             } else {
                 adverseReactions = []
             }
-            followUp = '2周';
+            if(isChronic) {
+                let chronicList = JSON.parse(storageLocal.get('chronic'));
+                for(let i=0; i<chronicList.length; i++){
+                    if(chronicList[i].id==item.id&&chronicList[i].name==item.name){ //判断某个病是否为慢病
+                        followUp = '2周';
+                    }
+                }
+                
+            }
             if(followUp) {  
                 const followUpList = state.treat.followUpList
                 if(followUpList) {  //判断之前有没有报存过的回访时间,如果有替换掉