Przeglądaj źródła

Merge remote-tracking branch 'origin/optimize' into dev/new1

zhouna 6 lat temu
rodzic
commit
642bac0edc

+ 1 - 0
src/components/AddInspect/SlideExcel/index.less

@@ -42,6 +42,7 @@
 .table {
   color: #000;
   width: 80%;
+  display: inline-block;
   tr {
       line-height: 18px;
       height: 18px;

+ 8 - 7
src/components/ChronicInfo/index.jsx

@@ -216,8 +216,9 @@ class ChronicInfo extends React.Component{
     addAssessItem(v,pIndex,i);
   }
   addFormula(it,v,pIndex,i){
+    const {chronicMagItem} = this.props;
     this.closeFormula(it);
-    this.handleAddAssessItem(v,pIndex,i);
+    chronicMagItem&&this.handleAddAssessItem(v,pIndex,i);
   }
   handleReg(e){   //只能输入数字
     const hasDot = e.target.value.indexOf('.')!=-1;
@@ -267,14 +268,14 @@ class ChronicInfo extends React.Component{
   }
   confirmOption(parent,pIndex,i){//可能结果确定
     const {radioVal,possible} = this.state;
-    const {savePossibleResult} = this.props;
+    const {savePossibleResult,chronicMagItem} = this.props;
     this.setState({
       possible:Object.assign({},possible,radioVal),
       radioVal:Object.assign({},possible,radioVal),//不设置radioVal只有最近一次选中的值
       optionId:null,
     });
     savePossibleResult&&savePossibleResult({possible:Object.assign({},possible,radioVal),radioVal:Object.assign({},possible,radioVal)})
-    this.handleAddAssessItem(parent,pIndex,i);
+    chronicMagItem&&this.handleAddAssessItem(parent,pIndex,i);
 
   }
   handleSaveCalcu(obj){
@@ -343,7 +344,7 @@ class ChronicInfo extends React.Component{
   }
   
   getDetail(){
-    const {data,formulaResult,calcuResult,indexs} = this.props;
+    const {data,formulaResult,calcuResult,chronicMagItem} = this.props;
     const {formulaId,optionId,possible,radioVal,calcuValues,currentIndex,hasEnterImg} = this.state;
     let list = data&&data.map((v,i)=>{
                     return <div className={style["list"]}>
@@ -387,7 +388,7 @@ class ChronicInfo extends React.Component{
                             </span>
                             {formulaId&&formulaId==v.conceptId&&<MiniToast title={it.content.name}
                                 icon={allTableIcon}
-                                confirmText='加入病例记录'
+                                confirmText={chronicMagItem?'加入病例记录':'确定'}
                                 show={formulaId&&formulaId==v.conceptId?true:false}
                                 close={this.closeFormula.bind(this,it)}
                                 confirm={this.addFormula.bind(this,it,v,i,j)}
@@ -451,7 +452,7 @@ class ChronicInfo extends React.Component{
                             </span>
                             <MiniToast title='结果选择'
                                 icon={checkIcon}
-                                confirmText='加入病例记录'
+                                confirmText={chronicMagItem?'加入病例记录':'确定'}
                                 show={optionId&&optionId==v.conceptId?true:false}
                                 close={this.closeOption}
                                 confirm={this.confirmOption.bind(this,v,i,j)}
@@ -498,7 +499,7 @@ class ChronicInfo extends React.Component{
     const {comfirnFlag,flag,ff} = this.state;
     const {chronicMagItem,chronicDesease,formulaResult,showHide,slideUp} = this.props;
     const scaleFooter = <Footer print={true}
-                                footText={showHide.isPop?"确定":"加入病例记录"}
+                                footText={showHide.isPop||!chronicMagItem?"确定":"加入病例记录"}
                                 handlePrint={this.onPrint}
                                 handleConfirm={()=>{this.comfirnTable()}}/>;
     return <div className={style["tips"]} style={{marginBottom:'15px'}}>

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

@@ -52,7 +52,7 @@ class CurrentIll extends Component{
       })
     }else if(!text) {//现病史框里没有内容时才设置模板
       let num = moduleNum.num;//主诉使用了几个模板
-      console.log(999,isChronic)
+      //console.log(999,isChronic)
       if(data.length==0 && !isChronic){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回

+ 1 - 1
src/containers/CurrentIll.js

@@ -11,7 +11,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {didPushParamChange} from '@utils/tools.js';
 
 
-function mapStateToProps(state) { console.log(111,state);
+function mapStateToProps(state) {
   const {homePage,currentIll,mainSuit,diagnosticList} = state;
     return {
         data:currentIll.data,//主诉模板

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

@@ -6,7 +6,7 @@ export const addDiagnostic = (state, action) => {
 
 export const delDiagnostic = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    res.diagnosticList = res.diagnosticList.filter(item => (item.conceptId !== action.item.conceptId && item.name !== action.item.name));
+    res.diagnosticList = res.diagnosticList.filter(item => (item.conceptId !== action.item.conceptId || item.name !== action.item.name));
     return res;
 }
 

+ 2 - 0
src/store/actions/pushMessage.js

@@ -260,6 +260,8 @@ export const clearAllPushMessage = (state, action) => {
 	res.assay = [];
 	res.check = [];
 	res.chronicPushItems = [];//量表
+	res.formulaResult = {};   //量表计算结果
+	res.scaleInfo = {};			//量表选中项
 	res.drugList = []; //开单药品列表
 	return res;
 }

+ 9 - 1
src/store/reducers/assessResult.js

@@ -1,5 +1,5 @@
 import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_SAVE_ASSESS_DATA,SET_INDEX_SUB_TYPE,ADD_ASSESS_ITEMS,
-  REMOVE_ASSESS_ITEMS,CLEAR_INDEX_DATA,SET_CHRONIC_CALCU_RESULT,ADD_WHOLE_SCALE_ITEMS,SET_CALCU_VALUES} from '@types/assessResult';
+  REMOVE_ASSESS_ITEMS,CLEAR_INDEX_DATA,SET_CHRONIC_CALCU_RESULT,ADD_WHOLE_SCALE_ITEMS,SET_CALCU_VALUES,CLEAR_ASSESS_RESULT_VALUE} from '@types/assessResult';
 import config from "@config";
 
 const init = {
@@ -46,6 +46,14 @@ export default (state=init,action)=>{
       res.indexData = {};
       res.indexTimeTypes = {};
       return res;
+    case CLEAR_ASSESS_RESULT_VALUE:
+      res.addedScaleIds = [];
+      res.calcuResult = {};
+      res.calcuValues = {};
+      res.wholeAssess = [];
+      res.wholeIndexs = {};
+      res.wholeResults = {};
+      return res;
     case SET_INDEX_SUB_TYPE:
       if(!index){
         return res;

+ 2 - 1
src/store/types/assessResult.js

@@ -7,4 +7,5 @@ export const REMOVE_ASSESS_ITEMS = 'REMOVE_ASSESS_ITEMS';  //整体评估删除
 export const CLEAR_INDEX_DATA = 'CLEAR_INDEX_DATA';     //删除图表数据
 export const SET_CHRONIC_CALCU_RESULT = 'SET_CHRONIC_CALCU_RESULT';   //保存评估中计算结果
 export const ADD_WHOLE_SCALE_ITEMS  = 'ADD_WHOLE_SCALE_ITEMS';    //从全部量表中添加的整体评估
-export const SET_CALCU_VALUES = 'SET_CALCU_VALUES';  //保存计算公式数据
+export const SET_CALCU_VALUES = 'SET_CALCU_VALUES';  //保存计算公式数据
+export const CLEAR_ASSESS_RESULT_VALUE = 'CLEAR_ASSESS_RESULT_VALUE';       //清空加入病例及指标推送的数据

+ 6 - 2
src/utils/tools.js

@@ -10,8 +10,8 @@ import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS} from '@store/types/pushMessage';
 import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
 import {CLEAR_FIRST_MAIN_DIAG, CLEAR_ALL_TREAT} from "../store/types/treat";
 import {tabChange} from '@store/actions/tabTemplate';
+import {CLEAR_ASSESS_RESULT_VALUE} from '@types/assessResult';
 import config from '@config/index.js';
-import $ from 'jquery';
 import up from '@images/up.png';
 import down from '@images/down.png';
 
@@ -259,7 +259,11 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         });
         store.dispatch({
           type: CLEAR_ALL_TREAT,
-        })
+        });
+        //清空已选的指标推送数据及填的值
+        store.dispatch({
+          type: CLEAR_ASSESS_RESULT_VALUE,
+        });
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
     }else{