Luolei1992 5 rokov pred
rodič
commit
31b6d81f38

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

@@ -113,6 +113,7 @@ class DiagnosticList extends Component {
         // showHistoryCaseModal && showHistoryCaseModal()
         // store.dispatch(initItemList(chronicMagItem))
         initItemList(chronicMagItem).then((res)=>{
+          console.log(99999,chronicMagItem)
             const result = res.data;
             if(result.code==0 && result.data){
               store.dispatch(setInitHistory(result.data));

+ 18 - 16
src/components/Operation/index.jsx

@@ -162,31 +162,33 @@ class Operation extends Component {
     }
     console.log(jsonStr,'文本')
     console.log(jsonData,'结构')       //测试需要用到,不要删了
+    console.log(tmpLis)
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       let dataJson = tmpLis[i].dataJson;
       // console.log(jsonStr.chief , JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')))
-      // console.log(jsonData.chief , JSON.parse(dataJson).chief)
+      // console.log(jsonData.chief)
       if(whichSign == 0){
         if(
           jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
           jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
           jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
-          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
-          JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
-          JSON.stringify(jsonData.checkedListImport) == JSON.stringify(JSON.parse(dataJson).checkedListImport) &&    
-          JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
-          JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&
-          JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
-          JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
-          JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
-          JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-          JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
-          JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
-          JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
-          JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
-          JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
-          JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))
+          // &&
+          // JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
+          // JSON.stringify(jsonData.checkedListImport) == JSON.stringify(JSON.parse(dataJson).checkedListImport) &&    
+          // JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
+          // JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&
+          // JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
+          // JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
+          // JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
+          // JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+          // JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
+          // JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
+          // JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
+          // JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
+          // JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
+          // JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
         ){
           Notify.info('该模板已保存');
           return false;

+ 16 - 6
src/components/PushContainer/index.jsx

@@ -2,8 +2,7 @@ import React, { Component } from 'react';
 import style from './index.less';
 import { Tab, ConfirmModal, Notify } from '@commonComp';
 import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow } from '@store/actions/tabTemplate';
-import { initItemList, delItem, delBatchItem, changeTitleAsync, saveTemplateDetail } from '@store/async-actions/tabTemplate';
-import { CHANGE_TYPE } from "@store/types/typeConfig";
+import { initItemList, delItem, delBatchItem, changeTitleAsync, setPageView } from '@store/async-actions/tabTemplate';
 import { connect } from "react-redux";
 import store from '@store';
 import { billing } from '@store/async-actions/pushMessage';
@@ -66,7 +65,7 @@ class PushContainer extends Component {
    */
   handleActiveClick(id) {
     if (id == '1') {
-      store.dispatch(initItemList());
+      store.dispatch(initItemList("",1));
     }
     store.dispatch(tabChange(id))
   }
@@ -205,6 +204,11 @@ class PushContainer extends Component {
     })
     store.dispatch(changeVisible(true))
   }
+  handleClickGetMore(page){
+    let tmpPage = ++page
+    store.dispatch(initItemList("",tmpPage,true))
+  }
+  
   makeSure() {
     if (this.state.type == 1) {
       store.dispatch(delItem(this.state.id))
@@ -225,11 +229,12 @@ class PushContainer extends Component {
       store.dispatch(changeTitleAsync(tempObj))
     } else if (this.state.type == 4) {        //模板引入
       const { items } = this.props;
+      store.dispatch(setPageView(this.state.id,items[0].type))
       items && items.map((part) => {
         if (this.state.id == part.id) {
           let typeConfig = part.type;
-          store.dispatch(keepPushData(part, 'part'))                 //引用数据的存储,用于保存模板是判断数据是否变化
-          pushAllDataList(typeConfig, 'push', part, 'template')       //引用
+          // store.dispatch(keepPushData(part, 'part'))//引用数据的存储,用于保存模板是判断数据是否变化
+          // pushAllDataList(typeConfig, 'push', part, 'template')//引用
           if (didPushParamChange()) {
             store.dispatch(billing())
           }
@@ -242,7 +247,7 @@ class PushContainer extends Component {
     store.dispatch(changeVisible(false));
   }
   render() {
-    const { activeId, checkItems, visible, showMsg, items, allCheckShow } = this.props;
+    const { activeId, checkItems, visible, showMsg,hasMore,current, items, allCheckShow } = this.props;
     return <div className={style["container"]} ref={this.$cont} >
       <Tab tabs={this.state.tabs}
         activeId={activeId}
@@ -252,6 +257,8 @@ class PushContainer extends Component {
           <PushItemsContainer></PushItemsContainer>
           <TemplateItems
             items={items}
+            current={current}
+            hasMore={hasMore}
             checkItems={checkItems}
             allCheckShow={allCheckShow}
             handleContentClick={this.handleContentClick}
@@ -260,6 +267,7 @@ class PushContainer extends Component {
             handleDelList={this.handleDelList}
             handleMangerTemplate={this.handleMangerTemplate}
             handleAllCheckbox={this.handleAllCheckbox}
+            handleClickGetMore={this.handleClickGetMore}
           ></TemplateItems>
           <MedicalInfoContainer></MedicalInfoContainer>
           <ScaleSearchContainer></ScaleSearchContainer>
@@ -285,6 +293,8 @@ class PushContainer extends Component {
 const mapStateToProps = (state) => {
   return {
     items: state.tabTemplate.items,
+    current: state.tabTemplate.current,
+    hasMore: state.tabTemplate.hasMore,
     activeId: state.tabTemplate.activeId,
     checkItems: state.tabTemplate.checkItems,
     allChecked: state.tabTemplate.allChecked,

+ 6 - 1
src/components/TemplateItems/index.jsx

@@ -50,7 +50,8 @@ class TemplateItems extends React.Component {
         }
     }
     render() {
-        const { allCheckShow, handleMangerTemplate, handleDelList, handleAllCheckbox, items,checkItems } = this.props;
+        const { allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
+        // console.log(hasMore,current,7877877)
         return (
             <div className={style.wrapper}>
                 {
@@ -75,6 +76,10 @@ class TemplateItems extends React.Component {
                         this.genItems().length > 0?this.genItems():
                         <Empty message={'还没有保存模板'}></Empty>
                     }
+                    {
+                      hasMore?<p onClick={()=>handleClickGetMore(current)} className={style.loadMore}>点击查看更多</p>:null
+                    }
+                    
                 </div>
             </div>
         )

+ 6 - 0
src/components/TemplateItems/index.less

@@ -52,5 +52,11 @@
             color: @template-color;
         }
     }
+    .loadMore {
+      text-align: center;
+      color: #2a9bd5;
+      cursor: pointer;
+      margin-top: 15px;
+    }
 }
 

+ 2 - 5
src/containers/DiagnosticList.js

@@ -1,16 +1,13 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
-import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList'; 
+import { DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
 import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
 import {keepPushData} from '@store/actions/tabTemplate';
-import { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
-import {CURRENT_CHRONIC} from '@store/types/currentIll';
+import { visibleHistory } from '@store/actions/historyTemplates'
 import {autoFillModules} from '@store/async-actions/fetchModules';
-import { initItemList } from '@store/async-actions/historyTemplates';
-import {MODI_LOADING} from '@store/types/homePage.js';
 import {SET_ASSESS_DATA} from '@types/assessResult';
 
 function mapStateToProps(state) {

+ 1 - 1
src/containers/PushContainer.js

@@ -7,7 +7,7 @@ function mapStateToProps(state) {
     return {
         showHistoryCases:state.historyTemplates.showHistoryCases,
         activeHistory:state.historyTemplates.activeHistory,
-        items:state.historyTemplates.items,
+        items:state.historyTemplates.items
     }
 }
 

+ 1 - 1
src/containers/TypeConfigContainer.js

@@ -49,7 +49,7 @@ function mapDispatchToProps(dispatch) {
           });
           dispatch(getOtherHisRecord());        //获取其他史最近记录
           Notify.success("模式切换成功");
-          dispatch(initItemList(confirmType));
+          dispatch(initItemList(confirmType,1));//切换模式调用模板接口
           dispatch(allCheckedShow(false))    //全选反选显示重置
           dispatch({//推送重置
             type: BILLING_ADVICE,

+ 8 - 6
src/store/async-actions/historyTemplates.js

@@ -4,14 +4,16 @@ import { initHistory } from '@store/actions/historyTemplates';
 import store from '@store';
 
 export const initItemList = (item) => {
-    let baseList = store.getState();
-    // let whichSign = baseList.typeConfig.typeConfig;
-    let state = baseList.patInfo.message;
-    const param = {
+  let baseList = store.getState();
+  // let whichSign = baseList.typeConfig.typeConfig;
+  let state = baseList.patInfo.message;
+  const param = {
       "hospitalId": state.hospitalId,
       "patientId": state.patientId,
-      "disName":item?item.name : 'dis',
-      "disType":item?1:0
+      "disName":item&&item.name?item.name : 'dis',
+      "disType":item?1:0,
+      "current": 1,
+      "size": 9999
     }
     /*return (dispatch) => {
         axios.json('/inquiryInfo/hisInquirys',param).then((res)=>{

+ 3 - 3
src/store/async-actions/patInfo.js

@@ -74,10 +74,10 @@ export const initHistoryDetails = (dispatch) => {
                         confirmType: detail.sign
                     })
                     if(baseList.tabTemplate.items.length == 0){
-                      dispatch(initItemList());        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+                      dispatch(initItemList("",1));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
                     }
                 }else{
-                  dispatch(initItemList(baseList.typeConfig.typeConfig))
+                  dispatch(initItemList(baseList.typeConfig.typeConfig,1))
                 }
                 dispatch({type:MODI_LOADING,flag:false});
             } else {
@@ -104,7 +104,7 @@ export async function getPatientMessage(dispatch, getState){
   let res2 = await json(api.getPatBaseInfo, params);
   /*console.log(res2);
   console.log(2);*/
-  let data1 = {},data2={};
+  let data1 = {},data2 = {};
   if(res1.data.code=='0'){
     data1 = res1.data.data;
   }

+ 26 - 5
src/store/async-actions/tabTemplate.js

@@ -12,24 +12,29 @@ import Notify from '@commonComp/Notify';
 import store from '@store';
 import {
   getAllDataList,
-  getAllDataStringList
+  getAllDataStringList,
+  pushAllDataList
 } from '@utils/tools';
 
-export const initItemList = (type) => { //初始化数据
+export const initItemList = (type,current,flg) => { //初始化数据
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
   let state = baseList.patInfo.message;
 
   return (dispatch) => {
-    axios.json('/templateInfo/getByDoctorIdTemplates', {
+    axios.json('/templateInfo/getTemplatePageAlls', {
       "doctorId": state.doctorId,
       "hospitalDeptId": state.hospitalDeptId,
       "hospitalId": state.hospitalId,
       "type": type || whichSign,
+      "current": current,
+      "sex":[1,2,3],
+      "size": 9999
     }).then((res) => {
       const data = res.data;
       if (data.code == 0) {
-        dispatch(initItems(data));
+        // data.data.flg = flg||false  //获取下一页,暂时不用
+        dispatch(initItems(data.data));
       } else {
         Notify.error(data.msg)
       }
@@ -71,7 +76,7 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
       const data = res.data;
       if (data.code == 0) {
         Notify.success('模板保存成功');
-        dispatch(initItemList());
+        dispatch(initItemList("",1));
         dispatch(keepPushData(getdata(1),'part'));
         dispatch({
           type: DIAG_SHOW,
@@ -124,6 +129,7 @@ export const delBatchItem = (ids) => { //批量删除
     })
   }
 };
+
 export const changeTitleAsync = (obj) => { //改标题
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
@@ -152,4 +158,19 @@ export const changeTitleAsync = (obj) => { //改标题
       }
     })
   }
+};
+
+export const setPageView = (id,typeConfig) => { //批量删除
+  return (dispatch) => {
+    axios.json('/templateInfo/getTemplateIdAlls', {
+      id: id
+    }).then((res) => {
+      let data = res.data;
+      if (data.code == 0) {
+        pushAllDataList(typeConfig, 'push', data.data, 'template')//引用
+      } else {
+        Notify.error(data.msg);
+      }
+    })
+  }
 };

+ 1 - 1
src/store/reducers/historyTemplates.js

@@ -28,7 +28,7 @@ export default (state = initHistoryList, action) => {
     }
     if (action.type === HISTORY_INIT) {
         const newState = Object.assign({}, state);
-        const tempArr = action.data || [];
+        const tempArr = action.data.records || [];
         newState.items = [...tempArr];
         newState.activeHistory = tempArr[0];
         return newState;

+ 13 - 1
src/store/reducers/tabTemplate.js

@@ -27,6 +27,8 @@ const initDataList = {
   activeItem: {}, //引用的模板
   activeItemHis: {}, //引用的历史病例
   allCheckShow: false, //全选反选是否显示
+  current:1,//当前页
+  hasMore:true,//是否显示更多
 }
 export default (state = initDataList, action) => {
   if (action.type === DEL_ITEMS) {
@@ -49,7 +51,17 @@ export default (state = initDataList, action) => {
   }
   if (action.type === INIT_ITEMS) {
     const newState = Object.assign({}, state);
-    newState.items = action.state.data;
+    // let tmpItems = JSON.parse(JSON.stringify(newState.items))
+    // let tmpCurrent = JSON.parse(JSON.stringify(newState.current))
+    // console.log(action.state.flg,action.state.pages,tmpCurrent,45544)
+    // if(action.state.current == 1&&!action.state.flg){//进入页面会调取分页相关先去掉
+    //   newState.items = action.state.records
+    // }else{
+    //   newState.items = tmpItems.concat(action.state.records);
+    // }
+    newState.items = action.state.records
+    newState.current = action.state.current;
+    newState.hasMore = action.state.current<action.state.pages;
     return newState;
   }
   if (action.type === CHANGE_VISIBLE) {

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
-const host='http://192.168.2.241:5050';//后端接口访问地址
+// const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-// const host='http://192.168.2.236:5050';//后端接口访问地址
+const host='http://192.168.2.236:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚

+ 2 - 1
src/utils/tools.js

@@ -286,7 +286,8 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
           //其他史data
           const oData = dataJson.other;
           const onlyOneText = oData.length==1&&oData[0].tagType==8&&!(oData[0].name||oData[0].value);
-            if(type == 'template'){        //结构化模板回读
+          if(type == 'template'){        //结构化模板回读
+            console.log(reData,1111111)
               let dataJsonStr = JSON.parse(reData.preview);
                 // console.log(dataJson,dataJsonStr,'结构化模板引用')
                 store.dispatch({