Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/dev5.3.2' into testedMerge

zhouna 5 gadi atpakaļ
vecāks
revīzija
b90623688d
36 mainītis faili ar 618 papildinājumiem un 125 dzēšanām
  1. 4 2
      src/common/components/EditableSpan/index.jsx
  2. BIN
      src/common/components/SearchBox/imgs/clear.png
  3. BIN
      src/common/components/SearchBox/imgs/search.png
  4. 162 0
      src/common/components/SearchBox/index.jsx
  5. 57 0
      src/common/components/SearchBox/index.less
  6. 3 1
      src/common/components/index.js
  7. 4 0
      src/components/AddAssistCheck/Textarea/index.jsx
  8. 1 1
      src/components/AddAssistCheck/index.jsx
  9. 2 3
      src/components/AssistCheck/index.jsx
  10. 0 1
      src/components/EMRContainer/index.jsx
  11. 0 3
      src/components/HistoryCaseContainer/HistoryList/index.jsx
  12. 2 2
      src/components/MainSuit/index.jsx
  13. 10 10
      src/components/PushContainer/index.jsx
  14. 1 2
      src/components/PushItems/index.jsx
  15. 63 11
      src/components/SpreadDrop/index.jsx
  16. 12 1
      src/components/SpreadDrop/index.less
  17. 7 7
      src/components/TimeInterval/index.jsx
  18. 1 1
      src/containers/Emergency.js
  19. 67 0
      src/containers/SearchBox.js
  20. 2 20
      src/containers/SpreadDrop.js
  21. 2 1
      src/containers/eleType.js
  22. 21 5
      src/modules/HomePage/index.jsx
  23. 6 0
      src/modules/HomePage/index.less
  24. 17 7
      src/store/actions/checkBody.js
  25. 51 1
      src/store/actions/mainSuit.js
  26. 4 2
      src/store/async-actions/historyTemplates.js
  27. 37 3
      src/store/async-actions/patInfo.js
  28. 1 1
      src/store/async-actions/pushMessage.js
  29. 4 1
      src/store/async-actions/tabTemplate.js
  30. 9 2
      src/store/reducers/homePage.js
  31. 10 3
      src/store/reducers/mainSuit.js
  32. 2 0
      src/store/types/homePage.js
  33. 2 0
      src/store/types/mainSuit.js
  34. 5 18
      src/utils/ajax.js
  35. 1 1
      src/utils/config.js
  36. 48 15
      src/utils/tools.js

+ 4 - 2
src/common/components/EditableSpan/index.jsx

@@ -60,7 +60,7 @@ class EditableSpan extends Component{
   }
   onChange(e){
     e.stopPropagation();
-    const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds,handleClear} = this.props;
+    const {handleChange,boxMark,i,handleSearch,noSearch,mainSaveText,mainIds,handleClear} = this.props;
     const {labelVal,searchPre} = this.state;
     const text1 = e.target.innerText || e.target.innerHTML;
     // e.newValue IE浏览器DOMCharacterDataModified监听
@@ -88,7 +88,9 @@ class EditableSpan extends Component{
 
     const that = this;
     handleChange&&handleChange({text1,boxMark,i});
-
+    if(noSearch){
+      return;
+    }
     //延迟搜索
     clearTimeout(this.state.timer);
     const timer = setTimeout(function(){

BIN
src/common/components/SearchBox/imgs/clear.png


BIN
src/common/components/SearchBox/imgs/search.png


+ 162 - 0
src/common/components/SearchBox/index.jsx

@@ -0,0 +1,162 @@
+import React from 'react';
+import styles from './index.less';
+import clear from './imgs/clear.png';
+import search from './imgs/search.png';
+import config from '@config/index';
+import classNames from 'classnames';
+import SearchDrop from '@components/SearchDrop';
+import ScrollArea from 'react-scrollbar';
+/**
+ * 主诉“添加症状”下拉中的:搜索框(含结果下拉)
+ * 接收参数:
+ * show:上级下拉是否隐藏,用于componentWillReceiveProps中
+ */
+class SearchBox extends React.Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+          showBox:false, //显示搜索结果
+          border:'',
+          showClear:false, //显示清空icon
+          timer:null
+        }
+        this.textInput = React.createRef();
+        this.handleClearVal = this.handleClearVal.bind(this);
+        this.handleFocus = this.handleFocus.bind(this);
+        this.handleBlur = this.handleBlur.bind(this);
+        this.clickIcon = this.clickIcon.bind(this);
+        this.handleSearchSelect = this.handleSearchSelect.bind(this);
+        this.reset = this.reset.bind(this);
+    }
+    handleClearVal(){
+        const { clearSearch } = this.props;
+        this.textInput.current.value = '';
+        this.textInput.current.focus();
+        this.setState({
+          showClear:false
+        });
+        clearSearch&&clearSearch();
+    }
+    handleSearchSelect(e,item){
+      e.stopPropagation();
+      e.preventDefault();
+      const {clearSearch,onSelect} = this.props;
+      onSelect(item);//上一级的“确定”事件
+      clearSearch&&clearSearch();
+      this.textInput.current.value = "";
+    }
+    handleInput(e){
+      e.stopPropagation();
+      e.preventDefault();
+      const { getSearchData ,mainIds,clearSearch,pushIds} = this.props;
+      const ids = [...mainIds,...pushIds];
+        clearTimeout(this.state.timer);
+        let timer = setTimeout(()=>{
+            clearTimeout(this.state.timer);
+            if(e.target.value.trim() == ''){
+              this.setState({
+                showClear:false
+              });
+              clearSearch();
+              return
+            }
+            this.setState({
+              showClear:true
+            })
+            getSearchData && getSearchData({inpStr:e.target.value.replace('<br>',''),boxMark:1,itemType:0,mainIds:ids});
+        },config.delayTime);
+        this.setState({
+          timer
+        });
+    }
+    handleFocus(e){//聚焦时边框变蓝色
+      e.stopPropagation();
+      e.preventDefault();
+      this.setState({border:true})
+    }
+    handleBlur(e){
+      e.stopPropagation();
+      e.preventDefault();
+      this.setState({border:false})
+    }
+    clickIcon(){
+      this.setState({showBox:true})
+      setTimeout(()=>{
+        this.textInput.current.focus();
+      },0)
+    }
+    // 重置事件
+    reset(){
+      const { clearSearch } = this.props;
+      clearSearch();
+      this.textInput.current.value = "";
+      this.setState({
+        showBox:false,
+        border:false,
+        showClear:false
+      })
+    }
+    componentDidMount(){
+      this.props.onRef(this);
+    }
+    componentWillReceiveProps(next){
+      // 隐藏时,清空搜索框内文字,清空搜索结果,隐藏搜索框
+      const { clearSearch } = this.props;
+      if(!next.show && next.show != this.props.show){
+        this.reset();
+      }
+    }
+    render() {
+        const { mainSearchData } = this.props;
+        const { showClear ,border, showBox} = this.state;
+        const showBd = showBox?styles['borderNone']:'';//显示边框
+        const borderCor = border?styles['border']:''; //蓝色边框
+        const isShow = showBox?styles['show']:styles['hide']; //是否显示输入框
+        let litext = '';
+        const contStyle={
+          opacity:'0.4',
+          right:'0',
+          top:'1px',
+          zIndex:'15',
+          width:'14px',
+          background:'#f1f1f1'};
+        const barStyle={background:'#777',width:'100%'};
+        return (
+            <div className={classNames(styles['search'])} onClick={this.clickIcon} onBlur={(e)=>{e.stopPropagation();}}>
+                <img className={styles.searchVal} src={search} alt="搜索"/>
+                <img style={{display:showClear?'block':'none'}} className={styles.clearVal} src={clear} onClick={this.handleClearVal} alt="清空" />
+                <input
+                    className={classNames(isShow,borderCor,showBd)}
+                    type="text"
+                    maxLength="30"
+                    ref={this.textInput}
+                    onFocus={this.handleFocus}
+                    onBlur={this.handleBlur}
+                    onInput={(e) => { 
+                      this.handleInput(e)
+                    }}
+                    onPropertyChange={(e) => {  // 兼容ie
+                      this.handleInput(e)
+                    }}
+                />
+                {mainSearchData&&mainSearchData.length>0 ? <div className={styles.autoList}>
+                    <ScrollArea speed={0.8}
+                      horizontal={false}
+                      stopScrollPropagation={mainSearchData.length>6?true:false}
+                      style={{maxHeight:'180px'}}
+                      verticalContainerStyle={contStyle}
+                      verticalScrollbarStyle={barStyle}
+                      contentClassName="content">
+                      <ul>
+                        {mainSearchData&&mainSearchData.map((it)=>{
+                          litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
+                          return <li key={it.conceptId} onClick={(e)=>this.handleSearchSelect(e,it)} title={litext}>{litext}</li>
+                        })}
+                      </ul>
+                    </ScrollArea>
+                  </div>:''}
+            </div>
+        )
+    }
+}
+export default SearchBox;

+ 57 - 0
src/common/components/SearchBox/index.less

@@ -0,0 +1,57 @@
+@import "~@less/variables.less";
+
+.search {
+    .contentZIndex1;
+    width: 316px;
+    height: 50px;
+    padding: 8px;
+    box-sizing: border-box;
+    position: relative;
+    background-color: #fff;
+    margin-left: 78px;
+    .autoList {
+      position: absolute;
+      width: 300px;
+      background: #fff;
+      border: 1px solid #ccc;
+       ul{
+        li:hover{
+          border: 1px solid #3B9ED0;
+        }
+      } 
+    }
+    input {
+        width: 100%;
+        height: 34px;
+        line-height: 34px;
+        padding: 0 32px;
+        box-sizing: border-box;
+    }
+    input::ms-clear{
+        display: none;
+    }
+    .border {
+        border: 1px solid @blue !important;
+    }
+    .borderNone {
+        border: 1px solid #979797;
+    }
+    img {
+        position: absolute;
+        top: 15px;
+    }
+    .searchVal {
+        left: 14px;
+        cursor: pointer;
+    }
+    .clearVal{
+        cursor: pointer;
+        right: 18px;
+    }
+}
+.show {
+    display:block;
+}
+.hide {
+    display: none;
+}

+ 3 - 1
src/common/components/index.js

@@ -24,6 +24,7 @@ import DelToast from "./DelToast";
 import TailInlineTag from "./TailInlineTag";
 import Footer from "./Footer";
 import WrapModalContainer from "./WrapModalContainer";
+import SearchBox from "./SearchBox";
 
 module.exports = {
     Banner,
@@ -52,5 +53,6 @@ module.exports = {
     MiniToast,
     TailInlineTag,
     Footer,
-    WrapModalContainer
+    WrapModalContainer,
+    SearchBox
 };

+ 4 - 0
src/components/AddAssistCheck/Textarea/index.jsx

@@ -2,6 +2,7 @@ import React, { Component } from "react";
 import style from "./index.less";
 import config from '@config/index';
 import $ from 'jquery';
+import {windowEventHandler} from '@utils/tools';
 
 class Textarea extends Component {
   constructor(props) {
@@ -64,6 +65,9 @@ class Textarea extends Component {
     }else{
       this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = '报告描述或意见'):(this.$dom.current.nextSibling.innerHTML = '报告描述或意见')
     }
+    windowEventHandler('resize', ()=>{
+      $(".TextareaRsize").css({marginTop:0})
+    });
   }
   handleFocus(){     //ie8下提示语挡住输入框,导致输入框无法聚焦
     this.textInput.current.previousSibling.focus();

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

@@ -266,7 +266,7 @@ class AddAssistCheck extends React.Component {
                             className={styles["area"]}
                             verticalContainerStyle={contStyle}
                             verticalScrollbarStyle={barStyle}
-                            contentClassName="content">
+                            contentClassName="content TextareaRsize">
                 <Textarea value={item.value} disabled={item.disabled} handlePush={handlePush} isRead={isRead} handleChangeAssistValue={handleChangeAssistValue} idx={idx}></Textarea>
                 </ScrollArea>
               </div>

+ 2 - 3
src/components/AssistCheck/index.jsx

@@ -10,7 +10,6 @@ import WrapModalBodyPac from '@containers/WrapModalBodyPac';
 import { getExcelList } from '@store/actions/inspect';
 import { host, prefix } from '@utils/config.js';
 
-
 class AssistCheck extends React.Component {
   constructor(props){
         super(props);
@@ -30,7 +29,7 @@ class AssistCheck extends React.Component {
         this.closeInIcss=this.closeInIcss.bind(this)
         this.onClose=this.onClose.bind(this)
         this.handleImportExcel=this.handleImportExcel.bind(this)
-    this.refreshScroller = this.refreshScroller.bind(this);
+        this.refreshScroller = this.refreshScroller.bind(this);
     }
     handleImportExcel() {
       this.inputRef.click();
@@ -115,7 +114,7 @@ class AssistCheck extends React.Component {
                     marginTop={'20px'}
                 >
                     <div style={{padding:'10px',boxSizing:'border-box'}} >
-                        <AddAssistCheck 
+                        <AddAssistCheck
                             handleChangeValue={handleChangeValue}
                             refreshScroller={this.refreshScroller}
                             list={list}

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

@@ -79,5 +79,4 @@ class EMRContainer extends Component {
         </div>
     }
 }
-
 export default EMRContainer;

+ 0 - 3
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -65,9 +65,6 @@ class HistoryCaseContainer extends React.Component {
         //store.dispatch({type: CONFIRM_TYPE, confirmType: activeHis.sign});
         //store.dispatch({type: SET_READ_MODE, readMode: activeHis.sign});
         store.dispatch(getHistempDetail(activeHis));
-        if(didPushParamChange()){
-          store.dispatch(billing());
-        }
         const {handleQuoteClick} = this.props;
         handleQuoteClick&&handleQuoteClick();
         dragBox('hisWrapMove','closeHis','del');

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

@@ -162,8 +162,8 @@ class MainSuit extends Component{
         return
       }
       ev.target.blur();
-      ev.target.innerText?(ev.target.innerText = data.substr(0,config.limited)):(ev.target.innerHTML = data.substr(0,config.limited));  //输入法内输入多个字再按enter的情况
-      console.log(333,data,ev)
+      // ev.target.innerText?(ev.target.innerText = data.substr(0,config.limited)):(ev.target.innerHTML = data.substr(0,config.limited));  //输入法内输入多个字再按enter的情况
+      //console.log(333,data,ev)
       // ev.target.blur();
       this.setState({
         inpText:data.substr(0,config.limited),

+ 10 - 10
src/components/PushContainer/index.jsx

@@ -229,16 +229,16 @@ class PushContainer extends Component {
     } else if (this.state.type == 4) {        //模板引入
       const { items } = this.props;
       store.dispatch(setPageView(this.state.id))
-      items && items.map((part) => {
-        if (this.state.id == part.id) {
-          let typeConfig = part.type;
-          // store.dispatch(keepPushData(part, 'part'))//引用数据的存储,用于保存模板是判断数据是否变化
-          // pushAllDataList(typeConfig, 'push', part, 'template')//引用
-          if (didPushParamChange()) {
-            store.dispatch(billing())
-          }
-        }
-      })
+      // items && items.map((part) => {
+      //   if (this.state.id == part.id) {
+      //     let typeConfig = part.type;
+      //     // store.dispatch(keepPushData(part, 'part'))//引用数据的存储,用于保存模板是判断数据是否变化
+      //     // pushAllDataList(typeConfig, 'push', part, 'template')//引用
+      //     // if (didPushParamChange()) {
+      //       // store.dispatch(billing())
+      //     // }
+      //   }
+      // })
       store.dispatch(changeVisible(false))
     }
   }

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

@@ -12,7 +12,7 @@ import DiagnosticItem from "@containers/DiagnosticItem";
 import store from "@store";
 import {addLabel} from '@store/actions/inspect';
 import {addAssistLabel} from '@store/actions/assistCheck';
-import {windowEventHandler,getCurrentDate,getWindowInnerHeight} from '@utils/tools'
+import {windowEventHandler,getCurrentDate,getWindowInnerHeight,didPushParamChange} from '@utils/tools'
 import {ConfirmModal} from '@commonComp';
 import ChronicInfo from '@containers/ChronicInfo';//慢病推送模块
 import RecommendInspect from './RecommendInspect';
@@ -147,7 +147,6 @@ class PushItems extends Component {
       }
     });
   }
-
   setDataIdx(index){
     this.setState({
       idx:index+''

+ 63 - 11
src/components/SpreadDrop/index.jsx

@@ -5,6 +5,7 @@ import style from './index.less';
 import {setPosition,deepClone,filterArr,handleEnter,isIE,windowEventHandler,filterDataArr,getIds,getPageCoordinate} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import ScrollArea from 'react-scrollbar';
+import SearchBox from '@containers/SearchBox'
 import $ from 'jquery';
 /****
  * 标签组合下拉,选中的项目展开
@@ -200,7 +201,7 @@ class SpreadDrop extends Component{
     this.clearState();
   }
   handleConfirm(e){
-    e.stopPropagation();
+    // e.stopPropagation();
     const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType,value,mainData} = this.props;
     const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType,value,mainData});
     delete params.tmpDom;       //避免上面deepClone selecteds报错
@@ -209,7 +210,7 @@ class SpreadDrop extends Component{
     //点确定后隐藏弹窗
     this.props.handleHide();
   }
-  handleSelect(item,isExclu,joint,listIndex,selected){//console.log(item,selected)
+  handleSelect(item,isExclu,joint,listIndex,selected){
     let {withOn,withs,noneOn,exclusion,exists,nowOn,nones,noneIds,ban} = this.state;
     /*if(this.props.selecteds)
     console.log(exists,this.props.selecteds.exists,exists===this.props.selecteds.exists)*/
@@ -359,8 +360,9 @@ class SpreadDrop extends Component{
     }
   }*/
   render(){
-    const {placeholder,value,show,data,order} = this.props;
+    const {placeholder,value,show,data,order,type,tagType,ikey,pos} = this.props;
     const {tmpDom,left} = this.state
+    const clickIndx = ikey.split('-')[1];//展开下拉的index
     if(!show&&tmpDom){
       $(tmpDom).parent().prev().attr({"contentEditable":true})
     }
@@ -379,7 +381,7 @@ class SpreadDrop extends Component{
         onInput={this.onChange}
         onkeydown={handleEnter}
         >{value||placeholder}</div>
-          <ListItems parDiv={this.$list} data={data} order={order} left={left}
+          <ListItems parDiv={this.$list} pos={pos} data={data} order={order} left={left} boxMark={type} tagType={tagType}
              show={show} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
       </div>
   }
@@ -389,6 +391,7 @@ class ListItems extends Component{
   constructor(props){
     super(props);
     this.$cont = React.createRef();
+    this.clickConfirm = this.clickConfirm.bind(this);
   }
   getLabels(){
     const {data,handleSelect} = this.props;
@@ -396,6 +399,7 @@ class ListItems extends Component{
     let isSpecialPos = false;       //是否特殊位置(单行在上面,如无殊)
     let isExclu = false;      //是否与其他互斥
     let isRadio;      //是否为单选列,默认多选列
+    let isSingle = data.length == 1?true:false; //是否为单列,无伴的情况
     const list = data&&data.map((it,i)=>{
       isSpecialPos = (+it.formPosition === 1);
       isExclu = (+it.exclusionType===1);
@@ -407,6 +411,7 @@ class ListItems extends Component{
       }
       return <ListItem datas={detail}
                        isRadio={isRadio}
+                       isSingle={isSingle}
                        joint={it.joint}
                        listIndex={i}
                        isSpecialPos={isSpecialPos}
@@ -416,6 +421,11 @@ class ListItems extends Component{
     });
     return list;
   }
+  clickConfirm(){
+    const {handleConfirm} = this.props;
+    this.child&&this.child.reset();//重置搜索框中的数据
+    handleConfirm();   
+  }
   getStyle(){
     const {show,left} = this.props;
     return {
@@ -423,14 +433,34 @@ class ListItems extends Component{
       left:left
     }
   }
+  searchSelect(item){
+    const {handleSelect,handleConfirm} = this.props;
+    //添加id字段,用于调尾巴
+    const it = Object.assign({id:item.questionId},item);
+    handleSelect&&handleSelect(it);     //添加到大数据推送一起选中
+    handleConfirm&&handleConfirm();       //确定事件
+  }
+  getPushItemIds(list){         //获取推送症状的id数组,去重用
+    return list&&list.map((it)=>{
+      return it.conceptId;
+    })||[];
+  }
   render (){
-    const {handleClear,handleConfirm,order,parDiv} = this.props;
+    const {handleClear,order,parDiv,boxMark,tagType,show,data,pos} = this.props;
+    const pushUl = data.find((it)=>it.controlType===99);
+    const pushList = pushUl&&pushUl.questionDetailList;
+    //推送标签没有推送结果时不显示顺序说明
+    const noPush = tagType===11&&(!pushList||pushList.length===0);
+    const noSearch = boxMark==1 && tagType==11 && !pos;       //非第一病程添加症状标签不显示搜索
     return <div className={style["drop-list"]} ref={parDiv} style={this.getStyle()} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
-        <p className={style['orderTips']}>按{order?'从左到右从上到下':'点击'}顺序成文</p>
+      {noPush?'':<p className={style['orderTips']}>按{order?'从左到右从上到下':'点击'}顺序成文</p>}
         {this.getLabels()}
+        {noSearch && <div className="search">
+          <SearchBox show={show} pushIds={this.getPushItemIds(pushList)} onSelect={this.searchSelect.bind(this)} onRef={(child)=>{this.child = child;}}/>
+        </div>}
         <div className="oper clearfix">
           <span className={style['clear']} onClick={handleClear}>清空选项</span>
-          <span className={style['confirm']} onClick={handleConfirm}>确定</span>
+          <span className={style['confirm']} onClick={this.clickConfirm}>确定</span>
         </div>
       </div>
   }
@@ -502,6 +532,9 @@ class ListItem extends Component{
       width:'6px',
       background:'#f1f1f1'};
     const barStyle={background:'#777',width:'100%'};
+    if(!datas||datas.length===0){
+      return <li className={style['no-push-data']}>暂无推送</li>
+    }
     if(datas&&datas.length>11){
       return <ScrollArea speed={0.8}
                     horizontal={false}
@@ -526,11 +559,30 @@ class ListItem extends Component{
       return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
     });
   }
-  render(){
+
+  getMainData(){//主诉添加症状-带搜索框
     const {datas,isSpecialPos} = this.props;
-    const pos = isSpecialPos?style['independent']:'';
-    return  <ul className={classNames(style['row'],pos)} onBlur={(e)=>e.stopPropagation()}>
-      {this.getData()}
+    if(!datas||datas.length===0){
+      return <li className={style['no-push-data']}>暂无推送数据,可通过搜索查找更多内容~ </li>
+    }
+    return datas&&datas.map((it,i)=>{
+      return <li onClick={(e)=>this.handleClick(e,it,i)} 
+            className={this.getClass(it.id)} 
+            title={it.name.length>4?it.name:''}
+            style={{'width':'55px','display':'inline-block'}}>
+            {it.name&&it.name.length>4?it.name.slice(0,4)+'...':it.name}
+          </li>
+    });
+  }
+
+  render(){
+    const {datas,isSpecialPos,boxMark,tagType,listIndex,isSingle,pos} = this.props;
+    const posit = isSpecialPos?style['independent']:'';
+    const ifMainSear = boxMark==1 && tagType==11 && !pos?true:false;
+    // 单列直接设置宽度,多列则第二列设置(伴字ul不设置宽度)
+    const main = ifMainSear&&!isSingle&&listIndex==1?style['mainUl']:(ifMainSear&&isSingle?style['mainUl']:'');
+    return  <ul className={classNames(style['row'],posit,main)} onBlur={(e)=>e.stopPropagation()}>
+      {ifMainSear?this.getMainData():this.getData()}
     </ul>
   }
 }

+ 12 - 1
src/components/SpreadDrop/index.less

@@ -20,6 +20,17 @@
     width: 100%;
     border-bottom: 1px @disable-border-color solid;
   }
+  .mainUl{
+    width: 495px;
+    white-space: normal;
+    li{
+      width: 99px !important;
+    }
+    .no-push-data{
+      color:@disable-color;
+      width: auto !important;
+    }
+  }
   li{
     padding-left: 20px;
     cursor: pointer;
@@ -34,7 +45,7 @@
     .select-li;
     background-image: url(../../common/images/then.png);
   }
-  .exclusion{
+  .no-push-data,.exclusion{
     color:@disable-color;
   }
 }

+ 7 - 7
src/components/TimeInterval/index.jsx

@@ -64,9 +64,9 @@ class TimeInterval extends React.Component {
       let arr = this.state.endTime.replace(/ |:/g, '-').split('-');
       let dateBegin = (new Date(Date.UTC(tmpTime[0],tmpTime[1],tmpTime[2],tmpTime[3],tmpTime[4]))).getTime();
       let dateEnd = (new Date(Date.UTC(arr[0], arr[1], arr[2], arr[3],arr[4]))).getTime();
-      let dateDes = (dateEnd - dateBegin)/(24 * 3600 * 1000)
-      if(dateEnd - dateBegin < 0){
-        Notify.info("终止时间不能早于起始时间");
+      let dateDes = (dateEnd - dateBegin)/(24 * 3600 * 1000) 
+      if(dateEnd - dateBegin <= 0){
+        Notify.info("终止时间不能早于和等于起始时间");
         return
       }else if(dateDes>90){
         Notify.info("只能搜索最近90天的数据");
@@ -81,12 +81,12 @@ class TimeInterval extends React.Component {
     } else if (this.state.flg == 2) {
       let time = getCalendarDate(date);
       let tmpTime = time.replace(/ |:/g, '-').split('-');
-      let arr = this.state.endTime.replace(/ |:/g, '-').split('-');
+      let arr = this.state.startTime.replace(/ |:/g, '-').split('-');
       let dateBegin = (new Date(Date.UTC(arr[0], arr[1], arr[2], arr[3],arr[4]))).getTime();
       let dateEnd = (new Date(Date.UTC(tmpTime[0],tmpTime[1],tmpTime[2],tmpTime[3],tmpTime[4]))).getTime();
-      let dateDes = (dateEnd - dateBegin)/(24 * 3600 * 1000)
-      if(dateEnd - dateBegin < 0){
-        Notify.info("终止时间不能早于起始时间");
+      let dateDes = (dateEnd - dateBegin)/(24 * 3600 * 1000);
+      if(dateEnd - dateBegin <= 0){
+        Notify.info("终止时间不能早于和等于起始时间");
         return
       }else if(dateDes>90){
         Notify.info("只能搜索最近90天的数据");

+ 1 - 1
src/containers/Emergency.js

@@ -28,7 +28,7 @@ const mapDispatchToProps = function(dispatch){
     },
     async getDownload(obj){
       let resData = await downloadData(obj.ids);
-      downloadExportedData(resData.data,obj.info.hospitalDeptName+"病历");
+      downloadExportedData(resData.data,obj.info.hospitalDeptName+"病历.xls");
     },
     clearHisRecord(){
       dispatch({type:CLEAR_RECORD})

+ 67 - 0
src/containers/SearchBox.js

@@ -0,0 +1,67 @@
+import {connect} from 'react-redux';
+import SearchBox from '@commonComp/SearchBox';
+import {getSearch} from '@store/async-actions/fetchModules.js';
+import {CLEAR_ADD_SEARCH,SET_ADD_SEARCH,CHOOSE_SEARCH} from '@store/types/mainSuit';
+import {ISREAD} from '@store/types/homePage.js';
+import {billing} from '@store/async-actions/pushMessage';
+import {Notify} from '@commonComp';
+import {filterDataArr} from '@utils/tools.js';
+import store from '@store';
+import config from '@config/index.js';
+
+function mapStateToProps(state){
+  return{
+    mainSearchData:state.mainSuit.addSearchData,//主诉-添加症状-搜索结果
+    mainIds:state.mainSuit.mainIds,  //搜索去重id
+  }
+}
+
+function mapDispatchToProps(dispatch){
+  return{
+    // 主诉-添加症状-搜索
+    getSearchData:(item)=>{
+      getSearch(item).then((res)=>{
+          let result = res.data;
+          if(+result.code == 0){
+            let data = result.data;
+            dispatch({
+              type:SET_ADD_SEARCH,
+              data:data
+            })
+          }else{
+            console.log(result.msg);
+          }
+      });
+    },
+    chooseSearch(obj){
+      // 主诉字数限制
+      let state = store.getState();
+      let mainSaveText = state.mainSuit.saveText;
+      let text = filterDataArr(mainSaveText);
+      let total = text.length + obj.item.name.length + 1; //+1是因为顿号
+      if(total >= config.limited){
+        Notify.info(config.limitText);
+        return
+      }
+      dispatch({
+        type: CHOOSE_SEARCH,
+        info:obj
+      })
+      dispatch({    //自由文本标签数据更新
+        type:ISREAD
+      });
+      //右侧推送
+      setTimeout(function(){ 
+        dispatch(billing());
+      },200);
+    },
+    clearSearch:()=>{
+      dispatch({
+        type: CLEAR_ADD_SEARCH
+      })
+    },
+  }
+}
+
+const SearchBoxContainer = connect(mapStateToProps,mapDispatchToProps)(SearchBox);
+export default SearchBoxContainer;

+ 2 - 20
src/containers/SpreadDrop.js

@@ -509,26 +509,8 @@ function mapDispatchToProps(dispatch,store){
           }else{
             pushDataList = bigDataList;
           }
-          /*if(pushDataList.length > 0){
-            if(obj.type == 1){// 主诉--添加症状
-              dispatch({
-                type:GET_BIGDATAPUSH,
-                data:pushDataList,
-                info:obj
-              })
-            }else if(obj.type == 2){// 现病史--添加其他症状
-              dispatch({
-                type:CURRENT_GET_BIGDATAPUSH,
-                data:pushDataList,
-                info:obj
-              })
-            }
-          }else{
-            Notify.info("暂无推送");
-            // return
-          }*/
           //推送无数据显示空下拉并提示暂无推送--1.9/1.18
-          if(!pushDataList || pushDataList.length == 0){Notify.info("暂无推送");}
+          //if(!pushDataList || pushDataList.length == 0){Notify.info("暂无推送");}
           if(obj.type == 1){// 主诉--添加症状
               dispatch({
                 type:GET_BIGDATAPUSH,
@@ -544,7 +526,7 @@ function mapDispatchToProps(dispatch,store){
             }
         }else{
           console.log(result.msg);
-          Notify.info("暂无推送");
+          //Notify.info("暂无推送");
           // 接口请求失败,不往下执行显示下拉
           return
         }

+ 2 - 1
src/containers/eleType.js

@@ -141,6 +141,7 @@ function multCheckLabels(params,tagType){
   let isHigh=importLabel&&importLabel.includes(data.id);
   const showInx = boxMark+"-"+i+'-0';
   return <SpreadDrop data={data.questionMapping}
+                     pos={data.pos}
                      ikey={showInx}
                      setHighter={setHighter}
                      placeholder={data.name}
@@ -182,7 +183,7 @@ export default function(params){
         }
       }
       // 删除后value为空,应展示空而不是name
-      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} full={data.full||isLast}/>;
+      return <EditableSpan {...params} noSearch={data.noSearch} value={data.value||data.value==''?data.value:data.name} full={data.full||isLast}/>;
     case 11://推送类型
       return multCheckLabels(params,data.tagType);
     default:

+ 21 - 5
src/modules/HomePage/index.jsx

@@ -3,15 +3,19 @@ import { connect } from "react-redux";
 import BannerContainer from '@containers/TypeConfigContainer';
 //  引入组件
 import BodyContainer from "@components/BodyContainer";
+import {ConfirmModal} from '@commonComp';
+import store from '@store';
 
-import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG} from '@store/types/homePage.js';
+import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE} from '@store/types/homePage.js';
+import {billing} from '@store/async-actions/pushMessage';
 import {CLEAR_SEARCH} from '@types/mainSuit';
 import {CURRENT_CLEAR} from '@types/currentIll';
 import {OTHERHIS_CLEAR} from '@types/otherHistory';
 import {CHECKBODY_CLEAR} from '@types/checkBody';
 import style from './index.less';
 import {getInitModules,getChronic,getSystemConfig} from '@store/async-actions/homePage.js';
-import { getUrlArgObject,parseNameVal } from "@utils/tools";
+import {getPreMsg} from '@store/async-actions/patInfo.js';
+import { getUrlArgObject,parseNameVal,pushAllDataList } from "@utils/tools";
 import $ from 'jquery';
 import loading from '@common/images/loading.gif';
 class HomePage extends Component {
@@ -65,12 +69,15 @@ class HomePage extends Component {
     }
   }
     render() {
-        const {flag} = this.props;
+        const {flag,showPre,noReferRecord,referRecord} = this.props;
         return <div className={style['home-page']}
                     onClick={this.hidePops} onmousedown={this.setElem.bind(this)}>
             <BannerContainer />
             {/* <InfoTitle /> */}
             <BodyContainer></BodyContainer>
+          <ConfirmModal visible={showPre} okText='是' cancelText='否' confirm={referRecord}  cancel={noReferRecord} close={noReferRecord}>
+              <div className={style['confirm-info']}>是否引用预问诊信息?</div>
+          </ConfirmModal>
           {flag?<div className={style['mask']}>
                 <img src={loading} className={style['load']}/>
             </div>:""}
@@ -80,11 +87,20 @@ class HomePage extends Component {
 
 const mapStateToProps = function (state) {
   return {
-    flag:state.homePage.loadingFlag
+    flag:state.homePage.loadingFlag,
+    showPre:state.homePage.showPre
   }
 };
 const mapDispatchToProps = function (dispatch) {
-    return {
+  return {
+    referRecord(){
+        pushAllDataList(1,'push',store.getState().homePage.preData,'preIcss');
+        dispatch(billing())
+        dispatch({type:SETPRE,show:false});
+      },
+      noReferRecord(){
+        dispatch({type:SETPRE,show:false});
+      },
       handleClear(){//清空搜索结果
            dispatch({type:CLEAR_SEARCH});
            dispatch({type:CURRENT_CLEAR});

+ 6 - 0
src/modules/HomePage/index.less

@@ -18,4 +18,10 @@
     left:50%;
     margin-top: -20px;
     margin-left: -20px;
+}
+.confirm-info {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
 }

+ 17 - 7
src/store/actions/checkBody.js

@@ -10,13 +10,22 @@ export function preSetCheckbody(state,action) {
 //设置查体数据
 export function set(state,action){
   let res = Object.assign({},state);
-  const {data} = action;
+  const {data,isText,isEmpty} = action;
+  if(isText){        //查体只显示文本时(引用预问诊)
+    const label = Object.assign(JSON.parse(config.textLabel),{value:data,noSearch:true});
+    res.data = [label];
+    res.saveText = [data];
+    res.showAll = true;
+    res.update = Math.random();
+    res.isEmpty = isEmpty;
+    return res;
+  }
   const obj = checkFullfillText(data);
   res.data = obj.newArr;
   res.saveText = obj.saveText;//存逗号
   res.showAll = obj.checkHiddenDefault;
   res.update = Math.random();
-  res.isEmpty = action.isEmpty;
+  res.isEmpty = isEmpty;
   return res;
 }
 //多选标签选中确定处理
@@ -90,7 +99,7 @@ export function setNumberValue(state,action){
       if(it.value){     //至少有一个子值才黑显
         hasValue = true;
       }
-      if(it.tagType===8&&!config.punctuationReg.test(it.name)){
+      if(it.tagType===8){
         return it.name;
       }else{
         return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
@@ -146,7 +155,7 @@ export function setRadioValue(state,action){
       if(it.value){     //至少有一个子值才黑显
         hasValue = true;
       }
-      if(it.tagType===8&&!config.punctuationReg.test(it.name)){
+      if(it.tagType===8){
         return it.name;
       }else {
         return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
@@ -183,7 +192,7 @@ export const setRadioInputValue = (state,action)=>{
         if(it.value){     //至少有一个子值才黑显
           hasValue = true;
         }
-        if(it.tagType===8&&!config.punctuationReg.test(it.name)){
+        if(it.tagType===8){
           return it.name;
         }else {
           return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
@@ -219,7 +228,7 @@ export const setRadioInputValue = (state,action)=>{
   if(res.data[index].tagType!=1){
     let hasValue = false;
     const sub = res.data[index].questionMapping.map((it)=>{
-      if(it.tagType===8&&!config.punctuationReg.test(it.name)){
+      if(it.tagType===8){
         return it.name;
       }else {
         return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
@@ -444,6 +453,7 @@ export function clearCheckBody(state,action){  //清空
   res.saveText = action.saveText;
   res.isEmpty = action.isEmpty;
   res.selecteds = action.selecteds?action.selecteds:[];
+  if(action.flg){res.showAll = true}
   return res;
 }
 
@@ -455,7 +465,7 @@ export function setInputLabel(state,action){
   if(+item.tagType===3){      //multSpred标签
     item.questionMapping[subIndex].value = text;
     let texts = item.questionMapping.map((it)=>{
-      if(it.tagType===8&&!config.punctuationReg.test(it.name)){
+      if(it.tagType===8){
         return it.name;
       }else{
         return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');

+ 51 - 1
src/store/actions/mainSuit.js

@@ -403,6 +403,54 @@ export const setSearch = (state,action)=>{
   res.isEnd = action.isEnd;
   return res;
 }
+// 主诉-添加症状-选中搜索结果
+export const chooseSearch = (state,action)=>{
+  const res = Object.assign({},state);
+  const {item,cliIndex,ban} = action.info;
+  const index = parseInt(cliIndex);
+  let data = res.data;
+  let text = {id:item.questionId,name:item.name,value:item.name,tagType:config.tagType,conceptId:item.conceptId};
+  // 判断index前是saveText中是否有伴
+  let nText = {};
+  if(!data[index].pos){//第一病程
+    const preText = res.saveText.slice(0,index);
+    const ind = preText.indexOf("伴");
+    if(ind != -1 || ban){
+      nText = Object.assign({},text,{exist:2});
+    }else{
+      nText = Object.assign({},text,{exist:1});
+    }
+  }else{//第二及以上病程
+    nText = Object.assign({},text);
+  }
+
+  // 缓存到localStorage中
+  const mainSymp = storageLocal.get('mainSymp');
+  if(mainSymp){
+    let localArr = JSON.parse(mainSymp);
+    let sympArr = JSON.parse(JSON.stringify(localArr));
+    for(let k=0; k<localArr.length; k++){//判断是否已存在
+      if(localArr[k].conceptId==item.conceptId){
+        sympArr.splice(k,1);
+      }
+    }
+    sympArr.push(nText);
+    if(sympArr.length>5){
+      storageLocal.set('mainSymp',sympArr.slice(sympArr.length-5,));
+    }else{
+      storageLocal.set('mainSymp',sympArr);
+    }
+  }
+  // 插入data中
+  res.data.splice(index,0,Object.assign({},nText,{name:'、'+item.name,value:'、'+item.name}));
+  res.saveText.splice(index,0,'、'+item.name);
+  res.mainIds.push(item.conceptId);
+  if(item.questionId){
+    res.mainTailIds.push(item.questionId);
+  }
+  res.update=Math.random();
+  return res;
+}
 
 //将选中的搜索结果插入
 export const insertSearch = (state,action)=>{
@@ -754,6 +802,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   res.mainTailIds = action.mainTailIds || [];
   res.chronicDesease = action.chronicDesease;//慢病疾病字段
   res.mainReadSonM = action.mainReadSonM || [];//子模板
+  res.moduleNum.num = 0; //恢复子模板点击次数
   /*const readModule = action.mainReadSonM;
   if(readModule&&readModule.length>0){//有回读子模板,则覆盖
     res.addSmoduleData = readModule;
@@ -858,7 +907,8 @@ export function backspaceText(state,action){
     }else if(data[delIndex+1] && data[delIndex+1].tagType==8){
       data.splice(delIndex,1);
       res.saveText.splice(delIndex,1);
-    }else if(data[delIndex-1] && data[delIndex-1].tagType !=8){//最后一个文本标签
+    }
+    else if(!data[delIndex+1] && data[delIndex-1] && data[delIndex-1].tagType !=8){//最后一个文本标签
       console.log("删除最后一个啦")
     }
     else{

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

@@ -1,8 +1,9 @@
 import axios from '@utils/ajax';
-import { pushAllDataList } from '@utils/tools';
+import { pushAllDataList,didPushParamChange } from '@utils/tools';
 import { initHistory } from '@store/actions/historyTemplates';
 import Notify from '@commonComp/Notify';
 import store from '@store';
+import { billing } from '@store/async-actions/pushMessage';
 
 export const initItemList = (item) => {
   let baseList = store.getState();
@@ -40,7 +41,8 @@ export const getHistempDetail = (item) => {
                 // let tmpList = tmpData.inquiryDetailList
                 // tmpData.detailList = tmpList
                 // console.log(tmpData)
-                pushAllDataList(item.sign,'push',tmpData,'history')       //引用                
+                pushAllDataList(item.sign,'push',tmpData,'history')       //引用     
+                store.dispatch(billing());
             }else{
                 // console.log(data)
                 Notify.error(data.msg);

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

@@ -5,16 +5,43 @@ import {getInfos} from '@store/actions/getInfoByUuid';
 import {getUrlArgObject,pushAllDataList} from '@utils/tools';
 import {getInitModules,getCommonList} from '@store/async-actions/homePage.js';
 import store from '@store'
-import {ISREAD,MODI_LOADING} from "../types/homePage";
+import {ISREAD,MODI_LOADING,SETPRE,SETPREDATA} from "../types/homePage";
 import { initItemList } from '@store/async-actions/tabTemplate';
 import config from '@config/index';
+import {Notify} from '@commonComp';
 
 const api = {
     getPatInfo: '/patientInfo/getTopPatientInfo',
     getPatBaseInfo: '/patientInfo/getPatientInfo',
-    getHospitalInfo:'/hospitalInfo/getHospitalInfo'
+    getHospitalInfo:'/hospitalInfo/getHospitalInfo',
+    getPreMsg:'/api/prec/inquiryInfo/getInquiryDetail'
 };
 
+//获取预问诊信息
+export const getPreMsg = (dispatch, getState) => {
+    // let baseList = getState();
+    // let state = baseList.patInfo.message;
+    json(api.getPreMsg, {
+        "hospitalCode": getUrlArgObject('hospitalId'),
+        "inquiryCode":getUrlArgObject("recordId"),
+        "patientCode": getUrlArgObject("patientNo")
+    },true).then((res) => {
+        const data = res.data;
+        if (data.code == 0) {
+            let result = data.data;
+            let preIcss = {
+              chief:result.chiefComplaint?new Array(result.chiefComplaint):[],
+              current:result.xbs?new Array(result.xbs):[],
+              other:result.qts?new Array(result.qts):[],
+              checkBody:result.supplement?result.supplement:''
+            }
+            dispatch({type:SETPRE,show:true});
+            dispatch({type:SETPREDATA,preData:preIcss});
+        } else {
+            // console.log(res)
+        }
+    })
+}
 //获取医院id
 export const initHospitalInfo = (dispatch, getState) => {
     let baseList = getState();
@@ -63,7 +90,14 @@ export const initHistoryDetails = (dispatch) => {
             const data = res.data;
             if (data.code == 0) {
                 const detail = data.data;
-                pushAllDataList(detail.sign,'push',detail,'history');
+                if(detail.dataJson){
+                  pushAllDataList(detail.sign,'push',detail,'history');
+                }else{
+                  let pre = baseList.homePage.sysConfig.connect_prec;
+                  (pre==1)&&getPreMsg(dispatch)
+                  // (pre==1)&&dispatch({type:SETPRE,show:true});
+
+                }
                 dispatch({
                   type:ISREAD
                 });

+ 1 - 1
src/store/async-actions/pushMessage.js

@@ -38,7 +38,7 @@ export const billing = (mdata,boxMark) => {
     hosCode: emrData.hosCode
   };
   let savePm = Object.assign({},params);
-   delete savePm.featureType;
+  delete savePm.featureType;
   storageLocal.set('emrParam',savePm);      //推送数据存储,用作推送前对比是否有变,有变才推送
     json(url, params).then((data) => {
         let {dis, lab, pacs,vitalIds,moduleVital} = data.data.data||{};

+ 4 - 1
src/store/async-actions/tabTemplate.js

@@ -13,8 +13,10 @@ import store from '@store';
 import {
   getAllDataList,
   getAllDataStringList,
-  pushAllDataList
+  pushAllDataList,
+  didPushParamChange
 } from '@utils/tools';
+import { billing } from '@store/async-actions/pushMessage';
 
 export const initItemList = (current,name) => { //初始化数据
   let baseList = store.getState();
@@ -169,6 +171,7 @@ export const setPageView = (id) => { //获取模板结构化数据
       if (data.code == 0) {
         //模板列表不筛选模式后,单个模式引用时看本身的模式
         pushAllDataList(data.data.type, 'push', data.data, 'template')//引用
+        store.dispatch(billing())
       } else {
         Notify.error(data.msg);
       }

+ 9 - 2
src/store/reducers/homePage.js

@@ -1,5 +1,5 @@
-import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG} from '../types/homePage.js';
+import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,SETPREDATA,
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG,SETPRE} from '../types/homePage.js';
 import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList} from '../actions/homePage.js';
 
 const initState = {
@@ -17,6 +17,8 @@ const initState = {
   assistList:[],
   inspectList:[],
   sysConfig:{},
+  showPre:false,
+  preData:{}
 };
 
 export default function (state=initState,action) {
@@ -72,6 +74,11 @@ export default function (state=initState,action) {
       return res;
     case SETSYSTEMCONFIG:
       res.sysConfig = action.data;
+      return res;
+    case SETPRE:
+      res.showPre = action.show;
+    case SETPREDATA:
+      res.preData = action.preData;
     default:
       return res;
   }

+ 10 - 3
src/store/reducers/mainSuit.js

@@ -2,11 +2,11 @@ import {RECOVER_TAG_MAIN,COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   SET_SEARCH,CLEAR_SEARCH,GET_BIGDATAPUSH,SET_MAINSUIT,MIX_CONFIRM,NUMBER_SELECT,
   RADIO_SELECT,COMM_CONFIRM,CHANGE_LABELVAL,SAVE_FREE,CLEAR_MAIN_SUIT,SET_DATA,
   INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,
-  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC,MAIN_REMOVE_SPAN} from '../types/mainSuit'
+  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC,MAIN_REMOVE_SPAN,SET_ADD_SEARCH,CLEAR_ADD_SEARCH} from '../types/mainSuit'
 import {recoveTag,getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,
   addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,
-  getSymptomFeature,setRadioInputValue} from '../actions/mainSuit'
+  getSymptomFeature,setRadioInputValue,chooseSearch} from '../actions/mainSuit'
 
 
 const initState = {
@@ -29,7 +29,8 @@ const initState = {
   },
   chronicDesease:null, //慢病
   mainTailIds:[],  //获取症状尾巴用
-  mainReadSonM:[] //回读的子模板
+  mainReadSonM:[], //回读的子模板
+  addSearchData:[] //添加症状里的搜索
 }
 
 export default function(state=initState,action){
@@ -118,6 +119,12 @@ export default function(state=initState,action){
         res.editClear = true;
       }
       return res;
+    case SET_ADD_SEARCH: //添加症状-搜索
+      res.addSearchData = action.data;
+      return res;
+    case CLEAR_ADD_SEARCH://清空症状搜索结果
+      res.addSearchData = [];
+      return res;
     default:
       return state;
   }

+ 2 - 0
src/store/types/homePage.js

@@ -16,3 +16,5 @@ export const GET_ASSIST_LIST = 'GET_ASSIST_LIST';    //辅检
 export const GET_INSPECT_LIST = 'GET_INSPECT_LIST';    //化验
 export const SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据
 export const SETSYSTEMCONFIG = 'SETSYSTEMCONFIG';   //设置配置数据
+export const SETPRE = 'SETPRE';   //设置预问诊引用弹窗
+export const SETPREDATA = 'SETPREDATA';   //设置预问诊数据暂存

+ 2 - 0
src/store/types/mainSuit.js

@@ -31,3 +31,5 @@ export const SET_MS_RADIO_INPUT_VAL = 'SET_MS_RADIO_INPUT_VAL';
 export const SAVE_CHRONIC = 'SAVE_CHRONIC'; //储存慢病信息
 export const RECOVER_TAG_MAIN = 'RECOVER_TAG_MAIN';   //恢复已删除标签
 export const MAIN_REMOVE_SPAN = 'MAIN_REMOVE_SPAN';   //删除最后一个空span
+export const SET_ADD_SEARCH = 'SET_ADD_SEARCH';   //添加症状-搜索
+export const CLEAR_ADD_SEARCH = 'CLEAR_ADD_SEARCH';   //添加症状-搜索

+ 5 - 18
src/utils/ajax.js

@@ -5,7 +5,7 @@ $.support.cors = true;
 const axios=require('axios');
 const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-// const qhost = isLocal?host+prefix:prefix;
+const orgin = window.location.origin
 const qhost = isLocal?host+prefix:prefix;
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 //axios.defaults.baseURL = host;       //默认地址
@@ -64,26 +64,13 @@ const post=(url,data)=>{
 };
 
 //json传参
-const json=(url,data)=>{
+const json=(url,data,spec)=>{     //spec:请求地址前缀不是api/icss,预问诊结果引用时添加
   //兼容ie8,axios在ie8下content-type设置不成功且会把headers置为null
   return axios({
     method:'post',
-    url:url.indexOf('http:')!=-1?url:qhost+url,
+    url:url.indexOf('http:')!=-1?url:((spec&&isLocal)?host+url:((spec&&!isLocal)?orgin+url:qhost+url)),
     data
-  });/*new Promise((resolve,reject)=>{
-    $.ajax({
-      method:'post',
-      url:qhost+url,
-      data:JSON.stringify(data),
-      contentType:"application/json; charset=UTF-8",
-      success:function(res){
-        resolve({data:res});
-      },
-      error:function(error){
-        reject(error);
-      },
-    });
-  });*/
+  });
 };
 
 // 导出
@@ -92,7 +79,7 @@ const expJson = (url,data) =>{
     method:'post',
     url:url.indexOf('http:')!=-1?url:qhost+url,
     data,
-    contentType: "application/vnd.ms-excel" ,
+    contentType: "application/vnd.ms-excel;charset=UTF-8" ,
     responseType: 'blob' //必须添加,否则会乱码
   });
 }

+ 1 - 1
src/utils/config.js

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

+ 48 - 15
src/utils/tools.js

@@ -2,11 +2,11 @@ import store from '@store';
 import {CLEAR_MAIN_SUIT} from '@store/types/mainSuit';
 import {CLEAR_CURRENT_ILL} from '@store/types/currentIll';
 import {CLEAROTHERHISTORY} from '@store/types/otherHistory';
-import {CLEARCHECKBODY} from '@store/types/checkBody';
+import {CLEARCHECKBODY,SET} from '@store/types/checkBody';
 import {clearAssistData,addAssistLabel} from '@store/actions/assistCheck';
 import {clearAllLabel,addLabel} from '@store/actions/inspect';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
-import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS,BILLING_ADVICE} from '@store/types/pushMessage';
+import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS,BILLING_ADVICE,PUSHCHANGE} 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';
@@ -230,7 +230,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
 /**
  * 
  * @param {回读数据} reData 
- * @param {回读数据是历史病历'history',还是模板'template'} type 
+ * @param {回读数据是历史病历'history',还是模板'template',预问诊引用'preIcss'} type 
  * @param {什么操作,回读'push'还是清空'clear'} action 
  * @param {引用的话是保存时候的文本类型,编辑的时候是当前页面设置的文本类型} whichSign 
  */
@@ -289,6 +289,30 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         });
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
+    }else if(type == 'preIcss'){
+      store.dispatch({type: SET_READ_MODE, readMode: whichSign});
+      store.dispatch({     //主诉文本框
+          type: CLEAR_MAIN_SUIT,
+          data:[],
+          saveText:reData.chief
+      });
+      store.dispatch({
+          type: CLEAR_CURRENT_ILL,
+          data:[],
+          saveText:reData.current
+      });
+      store.dispatch({
+          type: CLEAROTHERHISTORY,
+          data:[],
+          isEmpty:false,
+          saveText:reData.other
+      });
+      store.dispatch({
+          type: SET,
+          isEmpty:false,
+          data:reData.checkBody,
+          isText:true,    //查体只显示文本
+      });
     }else{
         //回读/引用设置回读模式值(主诉-其他史使用)
         store.dispatch({type: SET_READ_MODE, readMode: whichSign});
@@ -461,6 +485,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
                     isEmpty:dataJson.checkBodyIsEmpty,
+                    flg:true,
                     saveText:JSON.parse(dataJsonStr.vital)
                 });
                 store.dispatch(clearAllLabel(
@@ -516,6 +541,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 store.dispatch({
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
+                    flg:true,
                     isEmpty:dataJson.checkBodyIsEmpty,
                     saveText:dataJsonStr[3].content ? JSON.parse(dataJsonStr[3].content):[]
                 });
@@ -818,7 +844,7 @@ function getCurrentDate(flg,con){
     var h = myDate.getHours();
     var m = myDate.getMinutes();
     var s = myDate.getSeconds();
-    date = year+link+(mon<10?"0"+mon:mon)+link+(day<10?"0"+day:day)+' '+(h<10?"0"+h:h)+':'+(m<10?"0"+m:m)+':'+(s<10?"0"+s:s);
+    date = year+link+(mon<10?"0"+mon:mon)+link+(day<10?"0"+day:day)+' '+(h<10&&h!=0?"0"+h:h)+':'+(m<10&&m!=0?"0"+m:m)+':'+(s<10&&s!=0?"0"+s:s);
   }else{
     date = year+link+(mon<10?"0"+mon:mon)+link+(day<10?"0"+day:day);
   }
@@ -930,7 +956,7 @@ function dateParser(timestamp,link = '-'){
   let minute = time.getMinutes();
   let second = time.getSeconds();
   // let result = year+link+month+link+date;
-  let result = year+link+(month<10?"0"+month:month)+link+(date<10?"0"+date:date)+' '+(hour<10?"0"+hour:hour)+':'+(minute<10?"0"+minute:minute)+':'+(second<10?"0"+second:second);
+  let result = year+link+(month<10?"0"+month:month)+link+(date<10?"0"+date:date)+' '+(hour<10&&hour!=0?"0"+hour:hour)+':'+(minute<10&&minute!=0?"0"+minute:minute)+':'+(second<10&&second!=0?"0"+second:second);
   return result;
 }
 
@@ -1178,22 +1204,29 @@ function getIds(data){
  */
 function getCalendarDate(info) {
   let conect = '-';
-  let date = info.year + conect + (info.month < 10 ? '0' + info.month : info.month) + conect + (info.day < 10 ? '0' + info.day : info.day) + ' '+ (info.hour < 10 ? '0' + info.hour : info.hour)+':'+ (info.minute < 10 ? '0' + info.minute : info.minute)+':'+ (info.second < 10 ? '0' + info.second : info.second);
+  let date = info.year + conect + (info.month < 10 ? '0' + info.month : info.month) + conect + (info.day < 10 ? '0' + info.day : info.day) + ' '+ (info.hour != 0&&(info.hour).toString().length<2 ? '0' + info.hour : info.hour)+':'+ (info.minute != 0&&(info.minute).toString().length<2 ? '0' + info.minute : info.minute)+':'+ (info.second&&(info.second).toString().length<2 ? '0' + info.second : info.second);
   return date;
 }
 
 // 导出
 function downloadExportedData(data, fileName) {
     // var blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}); //type表示xlsx类型
-    var blob = new Blob([data], {type: 'application/vnd.ms-excel'}); //type表示xlsx类型
-    var downloadElement = document.createElement('a');
-    var href = window.URL.createObjectURL(blob); //创建下载的链接
-    downloadElement.href = href;
-    downloadElement.download = fileName; //下载后文件名
-    document.body.appendChild(downloadElement);
-    downloadElement.click(); //点击下载
-    document.body.removeChild(downloadElement); //下载完成移除元素
-    window.URL.revokeObjectURL(href);
+    var blob = new Blob([data], {type: 'application/vnd.ms-excel;charset=UTF-8'}); //type表示xlsx类型
+    var href = window.URL.createObjectURL(blob);//创建下载的链接
+    // 为兼容FF26 (不支持a标签的模拟点击事件)
+     if (navigator.userAgent.indexOf("Firefox") > -1){
+        //window.open(requestUrl);
+        window.location.href = href;
+     }else {
+        var downloadElement = document.createElement('a');
+        downloadElement.href = href;
+        downloadElement.download = fileName; //下载后文件名
+        document.body.appendChild(downloadElement);
+        downloadElement.click(); //点击下载
+        document.body.removeChild(downloadElement); //下载完成移除元素
+        window.URL.revokeObjectURL(href);
+     }
+    
 }
 
 function getStatusImg(type,val,status){