Browse Source

新增随访计划

luolei 4 years ago
parent
commit
4b60cc2642

+ 11 - 1
src/components/AddNewInspect/SlidePic/index.jsx

@@ -7,6 +7,8 @@ import checkOff from '@common/images/check_off.png';
 import checkOn from '@common/images/check_on.png';
 import dowm from '../img/down.png';
 import SlideIpt from '../SlideIpt';
+import singleB from '../img/singleB.png';
+import singleL from '../img/singleL.png';
 
 
 class SlidePic extends Component {
@@ -106,6 +108,11 @@ class SlidePic extends Component {
     const {handleSelectShow} = this.props;
     handleSelectShow(idx)
   }
+  handleSui(item,idx){
+    const {handleSuiFang,handlePush} = this.props;
+    handleSuiFang&&handleSuiFang(item,idx)
+    handlePush&&handlePush({mode:8});
+  }
   render() {
     const {item,time,setTipValue,idx,handlePush,staticData,activeIdx} = this.props;
     const {selectShow,activeInd,activeName,value,style} = this.state;
@@ -142,7 +149,10 @@ class SlidePic extends Component {
                 title={item.value}
                 onInput={(e)=>{this.handleInput(e,item,2,idx)}}
                 onFocus={()=>{this.handleFocus()}}
-                />:null
+                />:<span onClick={()=>this.handleSui(item,idx)} className={styles.suifang}>
+                  <img src={item.hasTreat?singleB:singleL} alt=""/>
+                  随访计划
+                </span>
             }
           </span>
           <span className={styles.pass}>

+ 9 - 0
src/components/AddNewInspect/SlidePic/index.less

@@ -82,6 +82,15 @@
         input {
             width: 100%;
         }
+        img {
+            width: 15px;
+            position: relative;
+            top: 3px;
+            right: 5px;
+        }
+        .suifang {
+            cursor: pointer;
+        }
     }
     .pass {
         text-align: right;

BIN
src/components/AddNewInspect/img/singleB.png


BIN
src/components/AddNewInspect/img/singleL.png


+ 4 - 1
src/components/AddNewInspect/index.jsx

@@ -122,7 +122,7 @@ class AddNewInspect extends React.Component {
       </ul>;
   }
   render() {
-    const {activeIdx,labelListBlood,handleSelectShow,selectJiType,setHighter,staticData,refreshScroller,checkOnOff, getInfomation,setTipValue, handleChangeValue,labelListSmall,inspectList, inspectVal, list, labelListBig, windowHeight, windowWidth,detailClick, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush,handleDelConfirm } = this.props;
+    const {activeIdx,labelListBlood,handleSuiFang,handleSelectShow,selectJiType,setHighter,staticData,refreshScroller,checkOnOff, getInfomation,setTipValue, handleChangeValue,labelListSmall,inspectList, inspectVal, list, labelListBig, windowHeight, windowWidth,detailClick, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush,handleDelConfirm } = this.props;
     const { tmpId, tmpIdx, time, pageTop, impId } = this.state;
     const contStyle={
       opacity:'0.4',
@@ -145,6 +145,7 @@ class AddNewInspect extends React.Component {
                   selectJiType={selectJiType}
                   checkOnOff={checkOnOff}
                   staticData={staticData}
+                  handleSuiFang={handleSuiFang}
                   idx={idx}
                   time={time}
                   handlePush={handlePush}
@@ -161,6 +162,7 @@ class AddNewInspect extends React.Component {
                   checkOnOff={checkOnOff}
                   time={time}
                   idx={idx}
+                  handleSuiFang={handleSuiFang}
                   handlePush={handlePush}
                   handleDelClick={this.handleDelClick}
                   setTipValue={setTipValue}
@@ -175,6 +177,7 @@ class AddNewInspect extends React.Component {
                   checkOnOff={checkOnOff}
                   time={time}
                   idx={idx}
+                  handleSuiFang={handleSuiFang}
                   handlePush={handlePush}
                   handleDelClick={this.handleDelClick}
                   setTipValue={setTipValue}

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

@@ -52,7 +52,7 @@ class NewAdvice extends React.Component {
 
   }
   render() {
-    const {hideAllDrop,staticData,activeIdx,selectJiType,handleSelectShow,setHighter,labelListBig, fetchPushInfos,getInfomation,labelListSmall, hospitalMsg, inspectVal, windowHeight, windowWidth,setTipValue, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList,detailClick,handleDelConfirm,checkOnOff ,labelListBlood} = this.props;
+    const {handleSuiFang,hideAllDrop,staticData,activeIdx,selectJiType,handleSelectShow,setHighter,labelListBig, fetchPushInfos,getInfomation,labelListSmall, hospitalMsg, inspectVal, windowHeight, windowWidth,setTipValue, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList,detailClick,handleDelConfirm,checkOnOff ,labelListBlood} = this.props;
 
     return (
       <div className={styles.wrapper}>
@@ -71,6 +71,7 @@ class NewAdvice extends React.Component {
           <div style={{ padding: '0px 10px 10px 10px', boxSizing: 'border-box',color:'#000' }} >
             <AddNewInspect
               activeIdx={activeIdx}
+              handleSuiFang={handleSuiFang}
               handleSelectShow={handleSelectShow}
               selectJiType={selectJiType}
               checkOnOff={checkOnOff}

+ 1 - 1
src/containers/DiagnosticList.js

@@ -12,7 +12,7 @@ import {autoFillModules} from '@store/async-actions/fetchModules';
 import {SET_ASSESS_DATA} from '@types/assessResult';
 import {didPushParamChange} from '@utils/tools';
 
-function mapStateToProps(state) {console.log(state)
+function mapStateToProps(state) {//console.log(state)
     const {diagnosticList,assessResult,pushMessage } = state;
     let diagnC = diagnosticList.chronicMagItem;
     return {

+ 4 - 0
src/containers/NewAdvice.js

@@ -23,6 +23,7 @@ import {
   checkOffOn,
   selectJiType,
   handleSelectShow,
+  handleSuiFang,
 } from '@store/actions/newAdvice';
 import {
   billing,
@@ -57,6 +58,9 @@ function mapStateToProps(state) {//console.log(state)
 
 function mapDispatchToProps(dispatch) {
   return {
+    handleSuiFang(item,idx){
+      dispatch(handleSuiFang(item,idx))
+    },
     handleSelectShow(idx,sign){
       dispatch(handleSelectShow(idx,sign))
     },

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

@@ -1,6 +1,5 @@
 export const addDiagMsg = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    // console.log(98989889898898,action)
     let tmpLis = res.diagnosticList
     for(let i = 0;i < tmpLis.length;i++){
         if(action.idx == i){
@@ -186,5 +185,6 @@ export function reDiagData(state, action) {
     res.diagnosticStr = action.params[10].content;
     res.diagnosticList = action.params[10].contentValue;
     res.diagnosticStrNoType = action.params[10].contentJson;
+    res.diseaseName = action.params[10].diseaseName;
     return res;
 }

+ 5 - 1
src/store/actions/newAdvice.js

@@ -1,4 +1,4 @@
-import {HANDLESELECTSHOW,SELECTJITYPE,SET_CONTEXT,CHECK_OFF_ON_NEW,DEL_ONE_PIC_NEW,ADD_LABEL,SEARCH_LIST,SET_LABEL,SET_TIP_ADVICE,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL_NEW,CLEAR_ALL_LABEL,DEL_PART_ITEM_NEW,DEL_EXCEL_LIST,SEARCH_TYPE_NEW} from '../types/newAdvice';
+import {HANDLESUI,HANDLESELECTSHOW,SELECTJITYPE,SET_CONTEXT,CHECK_OFF_ON_NEW,DEL_ONE_PIC_NEW,ADD_LABEL,SEARCH_LIST,SET_LABEL,SET_TIP_ADVICE,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL_NEW,CLEAR_ALL_LABEL,DEL_PART_ITEM_NEW,DEL_EXCEL_LIST,SEARCH_TYPE_NEW} from '../types/newAdvice';
 
 export const setLabel = (idx,sign) => ({          //搜索后点击选中的结果
     type:SET_LABEL,
@@ -87,6 +87,10 @@ export const selectJiType = (part,idx) => ({
     type:SELECTJITYPE,
     part,idx
 })
+export const handleSuiFang = (item,idx) => ({
+    type:HANDLESUI,
+    item,idx
+})
 
 export const handleSelectShow = (idx,sign) => ({
     type:HANDLESELECTSHOW,

+ 2 - 0
src/store/async-actions/print.js

@@ -143,11 +143,13 @@ export const saveMedicalData = () =>{
         content: tempPreview.diag.diagnosticStr,
         contentValue: tempPreview.diag.diagnosticList,
         contentJson: tempPreview.diag.diagnosticStrNoType,
+        diseaseName: tempPreview.diag.diseaseName,
         type: 11,
       },
       {
         content: tempPreview.advice,
         contentValue: tempPreview.advice,
+        operationName: tempPreview.operationName,
         contentJson: JSON.stringify(tempPreview.advice),
         type: 12,
       },

+ 63 - 67
src/store/reducers/newAdvice.js

@@ -19,6 +19,7 @@ import {
   CLEARNEWADVICEDATA,
   SELECTJITYPE,
   HANDLESELECTSHOW,
+  HANDLESUI,
 } from '../types/newAdvice';
 import store from '@store';
 import {getStringPlus,getPushLists,getPushList,getCurrentDate} from '@utils/tools.js';
@@ -44,10 +45,31 @@ const initSearchList = {
     drugOrder:[],//开单项
     operationOrder:[],//开单项
     transfusionOrder:[],
-    activeIdx:''
+    activeIdx:'',
+    operationName:{}
 }
 
 export default (state = initSearchList, action) => {
+    if (action.type == HANDLESUI) {
+        const newState = Object.assign({}, state);
+        let tempArr = newState.labelListSmall;
+        let tmpLis = action.item
+        for(let i = 0;i < tempArr.length;i++){
+            if(action.idx == i){
+                tempArr[i].hasTreat = 1
+            }else{
+                tempArr[i].hasTreat = 0
+            }
+        }
+        let obj = {
+            "dateValue": tmpLis.dateValue,
+            "name": tmpLis.name,
+            "uniqueName": tmpLis.name
+        }
+        newState.labelListSmall = [...tempArr]
+        newState.operationName = obj
+        return newState;
+    }
     if (action.type == HANDLESELECTSHOW) {
         const newState = Object.assign({}, state);
         let tempArr = newState.labelListBig;
@@ -72,8 +94,6 @@ export default (state = initSearchList, action) => {
             }
         }
         newState.labelListBig = [...tempArr]
-
-        
         return newState;
     }
     if (action.type == CHECK_OFF_ON_NEW) {
@@ -120,7 +140,7 @@ export default (state = initSearchList, action) => {
         let tempArr = newState.labelListBig;
         let tempArrs = newState.labelListSmall;
         let tmpArr = newState.labelListBlood;
-        let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempBloodOrder=[],tempTotalOrder=[];
+        let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempBloodOrder=[],tempTotalOrder=[],num=0;
         if(tmpLis&&tmpLis.flg == 5){
             tempArr = tempArr.filter((item,idx)=>{
                 if(action.tip != idx){
@@ -134,6 +154,20 @@ export default (state = initSearchList, action) => {
                     return item
                 }
             } )
+            for(let i = 0;i < tempArrs.length;i++){
+                if(!tempArrs[i].hasTreat){
+                    ++num
+                }
+            }
+            if(tempArrs.length>0&&num == tempArrs.length){
+                tempArrs[0]['hasTreat'] = 1
+                let obj = {
+                    "dateValue": tempArrs[0].dateValue,
+                    "name": tempArrs[0].name,
+                    "uniqueName": tempArrs[0].name
+                }
+                newState.operationName = obj
+            }
             newState.labelListSmall = [...tempArrs]
         }else if(tmpLis&&tmpLis.flg == 8){
             tmpArr = tmpArr.filter((item,idx)=> {
@@ -176,6 +210,14 @@ export default (state = initSearchList, action) => {
                 if(action.tip == i){
                     tempArrs[i].time = action.value
                     tempArrs[i].dateValue = action.value
+                    if(tmpLis.hasTreat){
+                        let obj = {
+                            "dateValue": action.value,
+                            "name": tmpLis.name,
+                            "uniqueName": tmpLis.name
+                        }
+                        newState.operationName = obj
+                    }
                 }
             }
             newState.labelListSmall = tempArrs
@@ -204,7 +246,7 @@ export default (state = initSearchList, action) => {
         const tempArr = newState.labelListBig;
         const tempArrs = newState.labelListSmall;
         const tmpArr = newState.labelListBlood;
-        let tmpLis = action.list
+        let tmpLis = action.list,num=0
         tmpLis['time'] = getCurrentDate(1)
         tmpLis['dateValue'] = getCurrentDate(1)
         if(tmpLis.flg == 5){
@@ -212,6 +254,20 @@ export default (state = initSearchList, action) => {
             newState.labelListBig = [...tempArr]
         }else if(tmpLis.flg == 6){
             tempArrs.push(tmpLis)
+            for(let i = 0;i < tempArrs.length;i++){
+                if(!tempArrs[i].hasTreat){
+                    ++num
+                }
+            }
+            if(num == tempArrs.length){
+                tempArrs[0]['hasTreat'] = 1
+                let obj = {
+                    "dateValue": tmpLis.dateValue,
+                    "name": tempArrs[0].name,
+                    "uniqueName": tempArrs[0].name
+                }
+                newState.operationName = obj
+            }
             newState.labelListSmall = [...tempArrs]
         }else{
             tmpArr.push(tmpLis)
@@ -363,7 +419,8 @@ export default (state = initSearchList, action) => {
       newState.drugOrder = action.params[11].content.labelListBig;
       newState.operationOrder = action.params[11].content.labelListSmall;
       newState.labelListBlood = action.params[11].content.labelListBlood;
-      newState.transfusionOrder = action.params[11].content.transfusionOrder;;
+      newState.transfusionOrder = action.params[11].content.transfusionOrder;
+      newState.operationName = action.params[11].content.operationName;
       return newState;
     }
     if (action.type == CLEARNEWADVICEDATA) {
@@ -378,64 +435,3 @@ export default (state = initSearchList, action) => {
     }
     return state;
 }
-
-function getExcelString(action,newState,tmpArr,tmpArr2) {
-  let tmpString = '';
-  if(JSON.stringify(action.data||{}) != '{}' && action.data.lisExcelRes.length > 0){
-    action.data.lisExcelRes.map((item)=>{
-        item.lisExcelItem.map((part)=>{
-            if(part.type == 1){
-                if(part.max != '' && (part.value-0) > (part.max-0) ) {
-                    let rate = (part.value/part.max).toFixed(2);
-                    let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'升高'+rate+';'
-                    tmpString += tmpStr;
-                }else if(part.min != '' && (part.value-0) < (part.min-0) ){
-                    let rate = (part.value/part.min).toFixed(2);
-                    let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'降低'+rate+';'
-                    tmpString += tmpStr;
-                }else{
-                    let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'异常;'
-                    tmpString += tmpStr;
-                }
-            }else{
-                let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'正常;'
-                tmpString += tmpStr;
-            }
-        })
-    })
-    newState.pushItem = getPushList(tmpArr,tmpArr2);
-    newState.pushItems = getPushLists(tmpArr,tmpArr2);
-    newState.inspectStrPlus = getStringPlus(newState.pushItems)
-  }else{
-    newState.inspectStrPlus = '';
-    newState.pushItem = []
-  }
-}
-function getString(lists) {
-    let tmpString = '';
-    lists.map((item)=>{
-        if(item.show == true){
-            item.details.map((part)=>{
-                if(part.value){
-                    if(typeof(part.value) == "number"){
-                        if(part.maxValue != '' && (part.value-0) > (part.maxValue-0) ) {
-                            let rate = (part.value/part.maxValue).toFixed(2);
-                            let tmpStr = item.name+','+part.name+','+part.value+' '+part.labelSuffix+'升高'+rate+';'
-                            tmpString += tmpStr;
-                        }else if(part.minValue != '' && (part.value-0) < (part.minValue-0) ){
-                            let rate = (part.value/part.minValue).toFixed(2);
-                            let tmpStr = item.name+','+part.name+','+part.value+' '+part.labelSuffix+'降低'+rate+';'
-                            tmpString += tmpStr;
-                        }else{
-                            let tmpStr = item.name+','+part.name+','+part.value+' '+part.labelSuffix+';'
-                            tmpString += tmpStr;
-                        }
-                    }else{
-                        tmpString += item.name+','+part.name+','+part.value+' '+part.labelSuffix+';'
-                    }
-                }
-            })
-        }
-    })
-    return tmpString;
-}

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

@@ -16,6 +16,7 @@ export const SET_TIP_ADVICE = 'SET_TIP';
 export const SEARCH_TYPE_NEW = 'SEARCH_TYPE_NEW';
 export const DEL_ONE_PIC_NEW = 'DEL_ONE_PIC_NEW';
 export const CHECK_OFF_ON_NEW = 'CHECK_OFF_ON_NEW';
+export const HANDLESUI = 'HANDLESUI';
 
 
 export const RENEWADVICEDATA = 'RENEWADVICEDATA';

+ 3 - 0
src/utils/tools.js

@@ -201,6 +201,7 @@ const formatTextInfo = (baseList) =>{
   newAdviceLabelList.labelListSmall = baseList.newAdvice.labelListSmall;
   newAdviceLabelList.labelListBig = baseList.newAdvice.labelListBig;
   newAdviceLabelList.labelListBlood = baseList.newAdvice.labelListBlood;
+  newAdviceLabelList.operationName = baseList.newAdvice.operationName;
 
   let assistLabelList = {
     dataString: baseList.assistCheck.dataString,
@@ -211,6 +212,7 @@ const formatTextInfo = (baseList) =>{
     diagnosticList: baseList.diagnosticList.diagnosticList,
     diagnosticStrNoType: baseList.diagnosticList.diagnosticStrNoType,
     diagnosticStr: baseList.diagnosticList.diagnosticStr,
+    diseaseName: baseList.diagnosticList.diseaseName,
   };
 
   return {
@@ -960,6 +962,7 @@ function getEMRParams(){
     "marital": filterDataArr(marriageHistory.saveText)||'',  //婚育史
     "menstrual": filterDataArr(menstruationHistory.saveText)||'',  //月经史
     "diseaseName":diagnosticList.diseaseName,
+    "operationName":newAdvice.operationName,
     "infectious": "",
     "operation": tempoperation,
     "allergy": "",