Browse Source

Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

zhangxc 6 years ago
parent
commit
f32a03ee9c

+ 22 - 8
src/components/DiagnosticList/index.jsx

@@ -7,7 +7,7 @@ import {ConfirmModal, Message} from '@commonComp';
 import Notify from '@commonComp/Notify';
 import Treat from '@containers/Treat'
 import store from '@store';
-import { initItemList } from '@store/async-actions/historyTemplates';
+import { initItemList ,setInitHistory} from '@store/async-actions/historyTemplates';
 import { pushAllDataList,inspectAndAssist } from '@utils/tools';
 import iconRadioDefault from '@common/images/icon-radio-default.png'
 import iconRadioActive from '@common/images/icon-radio-active.png'
@@ -92,15 +92,28 @@ class DiagnosticList extends Component {
         getTips && getTips({id:item.id,type:7});
     }
     referRecord() {
-        const { hideReferRecord, showHistoryCaseModal ,chronicMagItem} = this.props
+        const { hideReferRecord, showHistoryCaseModal ,chronicMagItem,hisTemplates,autoFillModules} = this.props
         hideReferRecord && hideReferRecord()
-        showHistoryCaseModal && showHistoryCaseModal()
-        store.dispatch(initItemList(chronicMagItem));
-
+        // showHistoryCaseModal && showHistoryCaseModal()
+        // store.dispatch(initItemList(chronicMagItem))
+        initItemList(chronicMagItem).then((res)=>{
+            const result = res.data;
+            if(result.code==0 && result.data){
+              store.dispatch(setInitHistory(result.data));
+              showHistoryCaseModal && showHistoryCaseModal();
+            }else{
+              Notify.info("暂无历史病例,默认引用通用模板");
+              const timer = setTimeout(function(){
+                autoFillModules && autoFillModules();
+                clearTimeout(timer);
+              },1000) //需求要求延时
+            }
+        })
     }
     noReferRecord() {
-        const { hideReferRecord } = this.props
-        hideReferRecord && hideReferRecord()
+        const { hideReferRecord ,autoFillModules} = this.props
+        hideReferRecord && hideReferRecord();
+        autoFillModules&&autoFillModules();
     }
     referCase() {
         const { hideHistoryCaseModal, items } = this.props
@@ -120,11 +133,12 @@ class DiagnosticList extends Component {
         })
     }
     closeHistoryCaseModal() {
-        const { hideHistoryCaseModal } = this.props
+        const { hideHistoryCaseModal ,autoFillModules} = this.props
         this.setState({
             activeHistory: -1
         })
         hideHistoryCaseModal && hideHistoryCaseModal()
+        autoFillModules && autoFillModules();
     }
     handleQuoteClick(item, index) {
         console.log('asadsd', item)

+ 13 - 4
src/components/InfoTitle/index.jsx

@@ -6,10 +6,10 @@ import historyCase from '@common/images/history.png';
 import health from '@common/images/health.png'
 import store from '@store';
 import { showHistory } from '@store/actions/historyTemplates';
-import { initItemList } from '@store/async-actions/historyTemplates';
+import { initItemList,setInitHistory } from '@store/async-actions/historyTemplates';
 import HistoryCases from '@containers/HistoryCases';
 import $ from 'jquery';
-
+import Notify from '@commonComp/Notify';
 class InfoTitle extends Component {
     constructor(props){
         super(props);
@@ -19,8 +19,17 @@ class InfoTitle extends Component {
         this.showHistoryBox = this.showHistoryBox.bind(this)
     }
     showHistoryBox(){
-        store.dispatch(initItemList());
-        store.dispatch(showHistory(true))
+        // store.dispatch(initItemList());
+        // store.dispatch(showHistory(true))
+        initItemList().then((res)=>{
+            const result = res.data;
+            if(result.code==0 && result.data){
+                store.dispatch(setInitHistory(result.data));
+                store.dispatch(showHistory(true))
+            }else{
+                Notify.info("暂无历史病例");
+            }
+        })
     }
     componentWillReceiveProps(next){
         const that = this;

+ 23 - 9
src/components/MainSuit/index.jsx

@@ -7,7 +7,7 @@ import CommonSymptom from '@components/CommonSymptom';
 import chooseType from '@containers/eleType.js';
 import config from "@config/index";
 import {isIE,getPageCoordinate,windowEventHandler,filterDataArr,getAllDataList,getAllDataStringList,ifOtherClear} from "@utils/tools.js"
-import { initItemList } from '@store/async-actions/historyTemplates';
+import { initItemList,setInitHistory } from '@store/async-actions/historyTemplates';
 import tableIcon from '@common/images/table.png';
 import iconRadioDefault from '@common/images/icon-radio-default.png'
 import iconRadioActive from '@common/images/icon-radio-active.png'
@@ -282,19 +282,33 @@ class MainSuit extends Component{
 
   // 慢病
   referRecord() {//是否引用历史病例弹窗--是
-    const { chronicDesease,closeHisBox } = this.props
+    const { chronicDesease,closeHisBox ,autoFillModules} = this.props;
+    const that = this;
     closeHisBox&&closeHisBox();//关闭
-    this.setState({
-      showHistoryCase:true
+    initItemList(chronicDesease).then((res)=>{
+      const result = res.data;
+      if(result.code==0 && result.data){
+          store.dispatch(setInitHistory(result.data));
+          that.setState({
+            showHistoryCase:true
+          })
+      }else{
+        Notify.info("暂无历史病例,默认引用通用模板");
+        const timer = setTimeout(function(){
+          autoFillModules && autoFillModules();
+          clearTimeout(timer);
+        },1000)  
+      }
     })
-    store.dispatch(initItemList(chronicDesease));
+    // this.setState({
+    //   showHistoryCase:true
+    // })
+    // store.dispatch(initItemList(chronicDesease));
   }
   noReferRecord() {//否
-    const {closeHisBox,autoFillMoudles} = this.props;
+    const {closeHisBox,autoFillModules} = this.props;
     closeHisBox&&closeHisBox();
-    // 不引用病例 -直接分发模板进行填充
-    autoFillMoudles && autoFillMoudles()
-    inspectAndAssist()//化验辅检模板
+    autoFillModules && autoFillModules()
   }
   referCase() {
         const { items ,pureSaveChronic} = this.props

+ 6 - 13
src/components/ScaleTable/index.jsx

@@ -21,6 +21,7 @@ class ScaleTable extends React.Component{
       start:false,   //点击计算
       scaleResult1:null
     }
+    this.handleFormula = this.handleFormula.bind(this);
   }
   
   handleRadio(groupName,name,item){
@@ -138,22 +139,14 @@ class ScaleTable extends React.Component{
       Notify.info("请先将量表内容选择完整");
       return
     }
-
+    // 将计算结果存在state,防止页面跳动问题
     const params = {
       type:1,
-      // data:JSON.stringify(valueData), //选择后的数据--字符串形式
       data:valueData,
       pId:parentId,
       id:tableId,
       pIndex:parentIndex
-    } 
-    // 替换表格内容
-    // let allDatas = JSON.parse(JSON.stringify(scaleInfo[tableId])) ;
-    //  allDatas[1].content = JSON.stringify(valueData);
-    // 计算接口
-    // getResult&&getResult({params,allDatas});
-
-    // 将计算结果存在state,防止页面跳动问题
+    }
     const that = this;
     getFormulaResult(params).then((res)=>{
       if(+res.data.code==0){
@@ -222,7 +215,7 @@ class ScaleTable extends React.Component{
                                            isSelect={vv.select==1||selecteds[item.name]==vv.detailName}
                                            handleClick={this.handleRadio.bind(this,v.groupName,item.name,vv)}>
                                         </Radio>
-                                        {vv.state==1?<span style={{color:'#3B9ED0'}}>(智能推荐)</span>:''}
+                                        {vv.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}
                                     </div>
                               })}
                               
@@ -237,7 +230,7 @@ class ScaleTable extends React.Component{
                                                     isSelect={vv.select==1||selecteds[item.name]&&selecteds[item.name].includes(vv.detailName)}
                                                     handleClick={this.handleCheckbox.bind(this,v.groupName,item.name,vv)}>
                                           </CheckBtn>
-                                    {vv.state==1?<span style={{color:'#3B9ED0'}}>(智能推荐)</span>:''}
+                                    {vv.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}
                                     </div>
                                   })}
                             </div>
@@ -280,7 +273,7 @@ class ScaleTable extends React.Component{
               {datas&&datas.noCalc==0?<div className={style['total']}>
                     <span>总分:</span>
                     <span>{scaleResult&&scaleResult.calcalculate&&scaleResult.calcalculate.result&&scaleResult.calcalculate.result.value +' '+ scaleResult.calcalculate.result.text||''}</span>
-                    <span className={style['totalBtn']} onClick={this.handleFormula.bind(this)}>得分</span>
+                    <span className={style['totalBtn']} onClick={this.handleFormula}>得分</span>
                   </div>:''}
             </div>
             <div dangerouslySetInnerHTML={{__html:footContent}} className={style['textlh']}></div>

+ 3 - 48
src/components/ScaleTable/index.less

@@ -1,7 +1,6 @@
 .tableBox{
   // height: 690px;
   overflow-y: auto;
-  // padding: 15px;
   padding: 30px;
   h1{
     font-size: 16px;
@@ -10,53 +9,6 @@
     text-align: center;
   }
 }
-.table{
-  width: 100%;
-  margin: 10px 0;
-  border-top: 10px solid #D8D8D8;
-  border-bottom: 10px solid #D8D8D8;
-  tr{
-    border-bottom: 1px solid #979797;
-    td{
-      vertical-align: middle;
-      padding: 7px 0;
-    }
-  }
-  thead,tfoot{
-    tr{
-      height: 54px;
-    }
-    td{
-      color:#000;
-      font-weight: bold;
-    }
-  }
-  .sum{
-    text-align: right;
-    i{
-      display: inline-block;
-      min-width: 30px;
-      border-bottom: 1px solid #979797;
-      text-align: center;
-    }
-    .formulaBtn{
-      display: inline-block;
-      width: 50px;
-      height: 30px;
-      line-height: 30px;
-      text-align: center;
-      color:#fff;
-      background: #3B9ED0;
-      border-radius: 4px;
-      margin-left: 10px;
-      cursor: pointer;
-      font-weight: normal;
-    }
-  }
-  // .block{
-  //   display: block;
-  // }
-}
 strong{
   font-weight: bold;
 }
@@ -75,6 +27,9 @@ strong{
       display: inline-block;
       margin-right: 24px;
     }
+    .recomand{
+      color:#3B9ED0;
+    }
     .block{
       margin-top: 20px;
       padding-top: 5px;

+ 5 - 7
src/containers/DiagnosticList.js

@@ -9,7 +9,7 @@ import {keepPushData} from '@store/actions/tabTemplate';
 import { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
 import {CURRENT_CHRONIC} from '@store/types/currentIll';
 import {autoFillModules} from '@store/async-actions/fetchModules';
-
+import { initItemList } from '@store/async-actions/historyTemplates';
 
 function mapStateToProps(state) {
     return {
@@ -86,7 +86,6 @@ function mapDispatchToProps(dispatch) {
             dispatch({
                 type: HIDE_REFER_RECORD
             })
-            dispatch(autoFillModules())//自动分发模板
         },
         showHistoryCaseModal: ()=> {
             dispatch({
@@ -97,16 +96,15 @@ function mapDispatchToProps(dispatch) {
             dispatch({
                 type: HIDE_HISTORY_CASE
             })
-            dispatch(autoFillModules())//自动分发模板
         },
-        handleQuoteClick(data){
-            
+        handleQuoteClick(data){   
             dispatch(keepPushData(data,'his'))      //历史病历引用
             // dispatch(activeHistory(idx))
             dispatch(visibleHistory(true))
-           
         },
-        
+        autoFillModules(){
+            dispatch(autoFillModules())//自动分发模板
+        },  
     }
 }
 

+ 1 - 1
src/containers/MainSuit.js

@@ -219,7 +219,7 @@ function mapDispatchToProps(dispatch) {
       getBilling: () => {
         dispatch(billing())
       },
-      autoFillMoudles() {//自动填充模板
+      autoFillModules() {//自动填充模板
         dispatch(autoFillModules())
       }
     }

+ 9 - 2
src/store/async-actions/historyTemplates.js

@@ -13,7 +13,7 @@ export const initItemList = (item) => {
       "disName":item?item.name : 'dis',
       "disType":item?1:0
     }
-    return (dispatch) => {
+    /*return (dispatch) => {
         axios.json('/inquiryInfo/hisInquirys',param).then((res)=>{
             const data =res.data;
             if(data.code == 0){
@@ -22,5 +22,12 @@ export const initItemList = (item) => {
                 console.log(data)
             }
         })
-    }
+    }*/
+    return axios.json('/inquiryInfo/hisInquirys',param);
 };
+
+export function setInitHistory(data){
+  return (dispatch) => {
+    dispatch(initHistory(data));
+  }
+}

+ 1 - 1
src/utils/ajax.js

@@ -6,7 +6,7 @@ const axios=require('axios');
 const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
 // const qhost = isLocal?host+prefix:prefix;
-const qhost = isLocal?host+prefix:host+prefix;
+const qhost = isLocal?host+prefix:prefix;
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 //axios.defaults.baseURL = host;       //默认地址
 // axios.defaults.timeout = 60000;       //请求超时