Kaynağa Gözat

合并分支并解决冲突

liucf 6 yıl önce
ebeveyn
işleme
8f4aa1cc6f

+ 1 - 0
src/common/components/MiniToast/index.less

@@ -36,6 +36,7 @@
       text-align: center;
       border: 1px solid #3B9ED0;
       border-radius: 4px;
+      cursor: pointer;
     }
   }
 }

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

@@ -23,7 +23,7 @@ class Textarea extends Component {
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput,isChronic} = this.props;
     handleFocus&&handleFocus();         //其他史、查体获取数据的方法
-    if(fuzhen&&!isChronic&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
+    if(fuzhen&& !isChronic.name&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
       const text = config.currentText.replace("(**)",fuzhen);
       this.$dom.current.innerText?(this.$dom.current.innerText = text):(this.$dom.current.innerHTML = text);
       handleInput&&handleInput({text});

Dosya farkı çok büyük olduğundan ihmal edildi
+ 115 - 50
src/components/ChronicInfo/index.jsx


+ 15 - 0
src/components/ChronicInfo/index.less

@@ -128,6 +128,7 @@
       }
       .blue{
         color:#3B9ED0;
+        cursor: pointer;
       }
       .mainList{
         .listBtn{
@@ -245,3 +246,17 @@
         margin-right: 20px;
       }
     }
+  .chooseItem{
+    display: inline-block;
+    margin-right: 10px;
+  }
+  .forMulBtn{
+    height: 32px;
+    line-height: 32px;
+    text-align: center;
+    color: #fff;
+    background: #DBDBDB;
+    border-radius: 4px;
+    cursor: auto;
+    margin-top: 15px;
+  }

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

@@ -56,12 +56,11 @@ class CurrentIll extends Component{
       })
     }else {
       let num = moduleNum.num;//主诉使用了几个模板
-      // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
-      if(data.length==0 && !isChronic){
-        // setData && setData({useEmpty,num,mainData,mainIds});
+        // isChronic为一个对象
+      if(data.length==0 && !isChronic.name ){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
-          setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic});
+            setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic});   
         },200)  
         this.setState({
           setDataTimer
@@ -71,6 +70,7 @@ class CurrentIll extends Component{
           showMoudle:true,
           forbidInput:false,
           boxEditable:false,
+          setDataTimer
       })
       changeEditIll(false)
       /*const showTimer = setTimeout(function(){

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

@@ -36,7 +36,8 @@ class DiagnosticItem extends Component{
     }
     chooseDiagodal(item) {
         const { diagnosticList,getTips } = this.props;
-        getTips && getTips(item);
+        // getTips && getTips(item);
+        getTips && getTips({id:item.id,type:7});
         for (let i = 0; i < diagnosticList.length; i++) {
             if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
                 Notify.info('该诊断已存在');

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

@@ -86,7 +86,8 @@ class DiagnosticList extends Component {
     } 
     handleClickDiag(item) {
         const { getTips } = this.props;
-        getTips && getTips(item);
+        // getTips && getTips(item);
+        getTips && getTips({id:item.id,type:7});
     }
     referRecord() {
         const { hideReferRecord, showHistoryCaseModal ,chronicMagItem} = this.props

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

@@ -297,7 +297,7 @@ class MainSuit extends Component{
     autoFillMoudles && autoFillMoudles()
   }
   referCase() {
-        const { items } = this.props
+        const { items ,pureSaveChronic} = this.props
         this.setState({
           showHistoryCase:false
         })
@@ -307,6 +307,7 @@ class MainSuit extends Component{
         // let baseList = store.getState(); 
         let baseObj = items[this.state.activeHistory];
         pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
+        pureSaveChronic && pureSaveChronic({name:'糖尿病',id:21773}); //储存慢病疾病
         this.props.getBilling();
         this.setState({
             activeHistory: -1

+ 72 - 11
src/components/ScaleTable/index.jsx

@@ -1,7 +1,8 @@
 import React from 'react';
 import style from './index.less';
 import mocks from '../../mock/chronicTable.js'
-import Information from '../Information'
+import { Radio,CheckBtn } from '@commonComp';
+ import Information from '../Information'
 /**
 *量表 具体信息页面
 *title:量表标题
@@ -10,20 +11,56 @@ import Information from '../Information'
 class ScaleTable extends React.Component{
   constructor(props){
     super(props);
+    this.state={
+      data:props.data && data[1].content|| [],
+      selecteds:{}
+    }
     this.handleChange = this.handleChange.bind(this);
   }
 
   handleChange(event){
     console.log(event.target.value);
   }
+  handleRadio(name,value){
+    const {selecteds} = this.state;
+    this.setState({
+      selecteds:Object.assign({},selecteds,{[name]:value})
+    })
+  }
+  handleCheckbox(name,value){
+    let {selecteds} = this.state;
+    selecteds[name]?selecteds[name]:selecteds[name]=[];
+    const index = selecteds[name].findIndex((i)=>i==value);
+    if(index!=-1){
+      selecteds[name].splice(index,1);
+    }else{
+      selecteds[name].push(value);
+    }
+    this.setState({
+      selecteds:selecteds
+    });
+  }
+
+  handleFormula(data){
+    const {tableId,getResult,parentId} = this.props; 
+    const params = {
+      type:1,
+      content:data, //选择后的数据--字符串形式
+      id:parentId,
+      scaleId:tableId,
+    }
+    // console.log("调计算接口");
+    // getResult&&getResult(params);
+  }
 
   render(){
     const {data,title} = this.props;
+    let {selecteds} = this.state;
     const content = data && data[1].content;//表格内容
     const preContent = data && data[0].content;//表前文字
     const footContent = data && data[2].content; //表后文字
     const datas = content && JSON.parse(content);
-
+    // console.log(555,datas,content);
     return <div className={style['tableBox']} id="printcontent">
             <div className={style['printShow']}>
               <Information></Information>
@@ -43,14 +80,35 @@ class ScaleTable extends React.Component{
                     return <tr>
                     <td>{v.name}</td>
                     <td>
-                      {v.details.map((it,index)=>{
-                        return <td className={style['block']}>
-                          <label>
-                            <input type="radio" name={v.name} value={it.score} onChange={this.handleChange}/>{it.detailName}
-                            <span style={{display:it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
-                          </label>
-                        </td>
-                      })}
+                      {/*{v.details.map((it,index)=>{
+                            return <td className={style['block']}>
+                              <label>
+                                <input type="radio" name={v.name} value={it.score} onChange={this.handleChange}/>{it.detailName}
+                                <span style={{display:it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
+                              </label>
+                            </td>
+                            
+                          })}*/}
+                      {v.controltype==0?v.details.map((it,index)=>{
+                          return <td className={style['block']}>
+                            <Radio label={it.detailName}
+                                   id={it.id}
+                                   isSelect={selecteds[v.name]==it.detailName}
+                                   handleClick={this.handleRadio.bind(this,v.name,it.detailName)}>
+                            </Radio>
+                            {it.state==1?<span style={{color:'#3B9ED0'}}>(智能推荐)</span>:''}
+                          </td>
+                        }):v.details.map((it,index)=>{
+                          return <td className={style['block']}>
+                              <CheckBtn id={it.detailName}
+                                        value={it.detailName}
+                                        label={it.detailName}
+                                        isSelect={selecteds[v.name]&&selecteds[v.name].includes(it.detailName)}
+                                        handleClick={this.handleCheckbox.bind(this,v.name,it.detailName)}>
+                              </CheckBtn>
+                            </td>
+                        })
+                    }
                     </td>
                     <td>
                       {v.details.map((it,index)=>{
@@ -63,7 +121,10 @@ class ScaleTable extends React.Component{
               </tbody>
               <tfoot>
                 <tr>
-                  <td colspan="4" className={style['sum']}>总计:</td>
+                  <td colspan="4" className={style['sum']}>
+                  总计:<i>95</i>
+                  <span className={style['formulaBtn']} onClick={this.handleFormula.bind(this,datas)}>计算</span>
+                  </td>
                 </tr>
               </tfoot>
             </table>

+ 19 - 0
src/components/ScaleTable/index.less

@@ -32,6 +32,25 @@
   }
   .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;

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

@@ -39,4 +39,4 @@ class AdverseReactions extends Component {
 
 }
 
-export default AdverseReactions;
+export default AdverseReactions;

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

@@ -30,4 +30,4 @@ class LastTreat extends Component {
 
 }
 
-export default LastTreat;
+export default LastTreat;

+ 8 - 3
src/containers/ChronicInfo.js

@@ -1,10 +1,10 @@
 import {connect} from 'react-redux';
 import ChronicInfo from '../components/ChronicInfo';
 import {SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
-import {getTableList,getScaleInfo} from '../store/async-actions/pushMessage';
+import {getTableList,getScaleInfo,getTips} from '../store/async-actions/pushMessage';
 import {ADD_ASSESS_ITEMS,SET_SAVE_ASSESS_DATA} from "@types/assessResult";
 
-function mapStateToProps(state){
+function mapStateToProps(state){//console.log(999,state)
   return{
     chronicMagItem: state.diagnosticList.chronicMagItem,
     questionId: state.diagnosticList.clickDiag,
@@ -12,7 +12,8 @@ function mapStateToProps(state){
     showList: state.pushMessage.showList,
     scaleInfo: state.pushMessage.scaleInfo,//量表明细
     chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
-    update:state.assessResult.update1
+    update:state.assessResult.update1,
+    formulaResult:state.pushMessage.formulaResult //量表信息
   }
 }
 
@@ -41,6 +42,10 @@ function mapDispatchToProps(dispatch){
     //保存管理评估
     saveAssessInfos(obj){
       dispatch(Object.assign({},obj,{type:SET_SAVE_ASSESS_DATA}));
+    },
+    // 获取量表静态知识
+    getInfomation(item){
+      dispatch(getTips(item));
     }
   }
 }

+ 1 - 1
src/containers/CurrentIll.js

@@ -43,7 +43,7 @@ function mapStateToProps(state) { //console.log(111,state);
         boxLeft:state.homePage.boxLeft,
         allModules:state.homePage.allModules,
         // isChronic:!!state.diagnosticList.chronicMagItem,
-        isChronic:!!state.mainSuit.chronicDesease,
+        isChronic:state.mainSuit.chronicDesease,
 
     }
 }

+ 7 - 0
src/containers/MainSuit.js

@@ -207,6 +207,13 @@ function mapDispatchToProps(dispatch) {
         dispatch({type:SHOW_HISTORY_BOX});
 
       },
+      pureSaveChronic(item){//引用病例时储存
+        // 存慢病
+        dispatch({
+          type:SAVE_CHRONIC,
+          data:item
+        })
+      },
       closeHisBox(){
         dispatch({type:HIDE_HISTORY_BOX})
       },

+ 20 - 0
src/containers/ScaleTable.js

@@ -0,0 +1,20 @@
+import {connect} from 'react-redux';
+import ScaleTable from '@components/ScaleTable';
+import {getFormulaResult} from '@store/async-actions/fetchModules.js'
+
+function mapStateToProps (state){
+  return {
+    formulaResult:state.pushMessage.formulaResult //计算结果
+  }
+}
+
+function mapDispatchToProps (dispatch){
+  return {
+    getResult(obj){//计算结果
+      dispatch(getFormulaResult(obj));
+    }
+  }
+}
+
+const ScaleTableContainer = connect(mapStateToProps,mapDispatchToProps)(ScaleTable);
+export default ScaleTableContainer;

+ 19 - 12
src/containers/SpreadDrop.js

@@ -154,18 +154,25 @@ function currentIll(dispatch,store,params){
   fetchModules(ids).then((res)=>{
     if(+res.data.code===0){
       const list = res.data.data;
-      existsId.map((i)=>{
-        // has.push(...list[i].questionMapping);
-        has.push(list[i]);
-      });
-      withsId.map((i)=>{
-        // wes.push(...list[i].questionMapping);
-        wes.push(list[i]);
-      });
-      dispatch({
-        type: CURRENT_CONFIRM,
-        data: {exists:has,withs:wes,nones:nones,ikey,ban,noneIds}
-      });
+      if(list&&list.length>0){
+        existsId.map((i)=>{
+          // has.push(...list[i].questionMapping);
+          has.push(list[i]);
+        });
+        withsId.map((i)=>{
+          // wes.push(...list[i].questionMapping);
+          wes.push(list[i]);
+        });
+        dispatch({
+          type: CURRENT_CONFIRM,
+          data: {exists:has,withs:wes,nones:nones,ikey,ban,noneIds}
+        });
+      }else{
+        dispatch({
+          type: CURRENT_CONFIRM,
+          data: {exists,withs,nones,ikey,ban,noneIds}
+        });
+      }
       dispatch({    //自由文本标签数据更新
         type:ISREAD
       });

+ 2 - 2
src/store/actions/currentIll.js

@@ -382,7 +382,7 @@ export const confirm = (state,action) =>{
   let res = Object.assign({},state);
   let length1 = res.data.length;
   let arr = JSON.parse(JSON.stringify(res.data));
-  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
+  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;console.log(111,action)
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
@@ -403,7 +403,7 @@ export const confirm = (state,action) =>{
   if(withs && withs.length>0){
     // for(let i in withs){
     for(let i=0;i<withs.length; i++){
-      withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
       /*withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));*/
     }
   }

+ 39 - 0
src/store/async-actions/fetchModules.js

@@ -7,6 +7,7 @@ import {getEMRParams,didPushParamChange} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import {billing} from '@store/async-actions/pushMessage';
 import {SETOTHERHISTORY,ISREAD} from "../types/homePage";
+import {SAVE_TABLE_RESULT} from "../types/pushMessage";
 import config from "@config/index";
 
 const api={
@@ -19,6 +20,7 @@ const api={
   getSymptomFeature:'/feature/getSymptomFeature',
   getAssess:'/evaluationModuleMapping/getEvaluationModules',    //获取管理评估-慢病
   getIndexData:'/indexData/getIndexDatas',    //获取指标数据-图表-慢病
+  getFormulaResult:'/push/calculate',  // 计算接口
 };
 
 export const getFeature = (item)=>{
@@ -248,4 +250,41 @@ export function getIndexData(range){
     };
     return json(api.getIndexData,param);
   }
+}
+
+// 计算接口
+export const getFormulaResult = (item)=>{
+  // type:1-量表 11-计算公式
+  const type = item.type;
+  const id = item.id;//计算量表的id
+  let param;
+  if(type==1){
+    param = {
+      type:type,
+      scale:item.content
+    }
+  }else if(type==11){
+    param = {
+      type:type,
+      formula:item.content
+    }
+  }
+  return (dispatch) => {
+    json(api.getFormulaResult,param).then((res)=>{
+      if(+res.data.code==0){
+        dispatch({
+          type:SAVE_TABLE_RESULT,
+          id:id, //外层疾病id
+          data:{
+            data:item.content, //量表内容
+            // id:item.scaleId,  //量表id
+            type:type,
+            result:res.data.data, //计算结果
+          }
+        })
+      }else{
+        console.log(res.msg)
+      }
+    })
+  }
 }

+ 4 - 3
src/store/async-actions/pushMessage.js

@@ -7,7 +7,7 @@ import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
 const api={
   push:'/push/pushInner',
   textPush:'/push/pushText',
-  getTableList:'/scale/getList' //获取量表列表
+  getTableList:'/scale/getList', //获取量表列表
 }
 
 //获取右侧推送信息
@@ -23,6 +23,7 @@ export const billing = (mdata) => {
     age: emrData.age,
     // featureType: "4,5,6,7,22",
     featureType: "22",
+    // featureType: "4,5,6,22",
     diag: emrData.dis,
     lis: emrData.lis,
     other: emrData.other,
@@ -90,7 +91,7 @@ export const getTips = (diagItem) =>{
         const url = '/introduceInfo/getByQuestionId';
         const params = {
             questionId: diagItem.id,
-            type: 7,
+            type: diagItem.type,
             position: 1
         }
         json(url, params)
@@ -114,7 +115,7 @@ export const getTipsDetails = () => {
 
         //弹窗显示
         const url ='/introduceInfo/getByQuestionId'
-        
+        console.log(123,state.diagnosticList.clickDiag)
         const params = {
             type: 7,
             questionId: state.diagnosticList.clickDiag.id,

+ 2 - 1
src/store/reducers/mainSuit.js

@@ -26,7 +26,8 @@ const initState = {
   symptomFeature:{//分词
     featureData:[],
     refresh:false //用于数据更新
-  }
+  },
+  chronicDesease:{} //慢病
 }
 
 export default function(state=initState,action){

+ 6 - 2
src/store/reducers/pushMessage.js

@@ -1,4 +1,4 @@
-import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,HIDE_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS} from '../types/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,HIDE_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,SAVE_TABLE_RESULT} from '../types/pushMessage';
 import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, setCommontreatment, isFirstMainDiag, setAdviceInput } from '../actions/pushMessage';
 
 const initState = {
@@ -18,7 +18,8 @@ const initState = {
   },
   AdviceStr: '',
   tmpFlg:'',
-  tableList:[]
+  tableList:[],
+  formulaResult:{}
 };
 export default function(state = initState, action) {
   let res = Object.assign({},state);
@@ -70,6 +71,9 @@ export default function(state = initState, action) {
     case SET_SCALE_INFO://量表明细
       res.scaleInfo = action.data;
       return res;
+    case SAVE_TABLE_RESULT://量表计算结果
+      res.formulaResult = Object.assign({},res.formulaResult,{[action.id]:action.data});
+      return res;
     default:
       return state;
   }

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

@@ -20,5 +20,6 @@ export const SHOW_TABLE_LIST = 'SHOW_TABLE_LIST' ; //显示量表列表
 export const HIDE_TABLE_LIST = 'HIDE_TABLE_LIST' ; //隐藏量表列表
 export const SET_CHRONIC_PUSHS ='SET_CHRONIC_PUSHS'; //右侧慢病量表评估推送模块数据
 export const SET_SCALE_INFO = 'SET_SCALE_INFO' ; //量表明细
+export const SAVE_TABLE_RESULT = 'SAVE_TABLE_RESULT' ; //量表计算结果