Переглянути джерело

Squashed commit of the following:

commit cb129f4387019b64cf9599d723ce14ccfbf7972b
Merge: ad39ae7 110ddb8
Author: liucf <liucf@zjlantone.com>
Date:   Wed Mar 27 19:19:14 2019 +0800

    Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

    # Conflicts:
    #	src/components/DiagnosticItem/index.jsx

commit 110ddb881e835a0f4fb356cf80c99bf51c0d895a
Merge: 0523358 dcc0a57
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 18:44:47 2019 +0800

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

commit dcc0a578db4cf2139940ac63df2457fd1cabfd8a
Merge: 80efa80 6dd5a34
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 17:43:30 2019 +0800

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

    # Conflicts:
    #	src/config/index.js

commit 80efa802c476cb6e95b9039b77ab5520b0b021b9
Merge: 46babe5 04817be
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 17:42:12 2019 +0800

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

commit 46babe5f7cb0318b2f6e11c15390dff778dcae54
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 17:42:04 2019 +0800

    合并错误修改

commit 6dd5a34dc7fc1261c914b1a24ec155b09b202630
Author: liucf <liucf@zjlantone.com>
Date:   Wed Mar 27 17:42:00 2019 +0800

    文本模式下主诉禁止回车;杂音类型处理函数调整

commit 7dd410121ec7f9ea76eaf92912a9e50467b9baed
Merge: a01a46f b0fe21c
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 17:40:17 2019 +0800

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

commit a01a46f1479ef4dd0396288871c83061c4424fab
Merge: be04abe 91bbb09
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 17:40:09 2019 +0800

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

    # Conflicts:
    #	src/utils/tools.js

commit 91bbb09b55489c7349b0847cc4091e34c623ead6
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 17:38:29 2019 +0800

    查体隐藏区域有默认选中默认全部显示

commit 04817be42c03339da6c147cd4cd50c95b676bb83
Author: Luolei <16657115156@163.com>
Date:   Wed Mar 27 17:16:07 2019 +0800

    诊断聚焦到可视区域

commit 0523358a9fd9c6aa5412e4060a1e43ee105dd9e6
Merge: cb5fb93 2ac4cce
Author: Luolei <16657115156@163.com>
Date:   Wed Mar 27 16:55:09 2019 +0800

    Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

commit cb5fb93cdfd275f66dd4bde58cd74c93ed00d564
Author: Luolei <16657115156@163.com>
Date:   Wed Mar 27 16:55:01 2019 +0800

    添加化验辅检常用标签

commit 62cdafb432eb9bb78911ebb34642f16aaa32af43
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 16:07:56 2019 +0800

    查体显示隐藏规则优化

commit 2ac4cce91f3b5174aebc4c8c18a515a167625e24
Author: zhangxc <zhangxc@zjlantone.com>
Date:   Wed Mar 27 15:58:31 2019 +0800

    判断是否走慢病

commit f6dc83837e0878d20fc18fa793fb45e424820c88
Author: liucf <liucf@zjlantone.com>
Date:   Wed Mar 27 13:15:29 2019 +0800

    智能模式下主诉手动输入的症状移植到现病史

commit 68f8f4ff8dcd7933a3fb4942e99792fe74681bc8
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 13:10:37 2019 +0800

    杂音单选列连接不显示bug修改

commit f44c8fa4aaa10365799cc1ecf9cd9c0591a23bf7
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 11:15:06 2019 +0800

    数字组件双击编辑bug

commit 0ef45eeb0c62ce30665c54d24f9d55d3134a39f6
Author: zhouna <zhouna@zjlantone.com>
Date:   Wed Mar 27 10:59:27 2019 +0800

    模板连续标点处理
liucf 6 роки тому
батько
коміт
40a72419db
46 змінених файлів з 910 додано та 600 видалено
  1. 3 3
      src/common/components/SearchOption/index.less
  2. 11 1
      src/common/components/Textarea/index.jsx
  3. 20 14
      src/common/js/func.js
  4. 167 140
      src/components/AddAssistCheck/index.jsx
  5. 5 1
      src/components/AddAssistCheck/index.less
  6. 340 312
      src/components/AddInspect/index.jsx
  7. 5 0
      src/components/AddInspect/index.less
  8. 2 1
      src/components/AssistCheck/index.jsx
  9. 16 4
      src/components/CheckBody/index.jsx
  10. 1 0
      src/components/DiagResultSearch/index.less
  11. 1 1
      src/components/Diagnosis/index.jsx
  12. 22 20
      src/components/DiagnosticItem/index.jsx
  13. 15 1
      src/components/DiagnosticList/index.jsx
  14. 7 0
      src/components/DiagnosticList/index.less
  15. 2 1
      src/components/Inspect/index.jsx
  16. 2 1
      src/components/NumberDrop/index.jsx
  17. 23 5
      src/components/PushItems/index.jsx
  18. 1 1
      src/components/SpreadDrop/index.jsx
  19. 2 1
      src/config/index.js
  20. 3 2
      src/containers/AssistCheck.js
  21. 1 0
      src/containers/CheckBody.js
  22. 8 2
      src/containers/DiagnosticList.js
  23. 3 2
      src/containers/Inspect.js
  24. 13 3
      src/containers/PushItemsContainer.js
  25. 9 5
      src/containers/SpreadDrop.js
  26. 3 2
      src/store/actions/assistCheck.js
  27. 13 5
      src/store/actions/checkBody.js
  28. 29 24
      src/store/actions/currentIll.js
  29. 18 0
      src/store/actions/diagnosticList.js
  30. 10 0
      src/store/actions/homePage.js
  31. 3 2
      src/store/actions/inspect.js
  32. 7 8
      src/store/actions/mainSuit.js
  33. 4 4
      src/store/actions/otherHistory.js
  34. 33 12
      src/store/async-actions/diagnosticList.js
  35. 36 4
      src/store/async-actions/homePage.js
  36. 3 1
      src/store/async-actions/patInfo.js
  37. 1 1
      src/store/async-actions/pushMessage.js
  38. 8 2
      src/store/reducers/assistCheck.js
  39. 10 2
      src/store/reducers/diagnosticList.js
  40. 9 3
      src/store/reducers/homePage.js
  41. 8 2
      src/store/reducers/inspect.js
  42. 7 1
      src/store/reducers/pushMessage.js
  43. 6 1
      src/store/types/diagnosticList.js
  44. 3 1
      src/store/types/homePage.js
  45. 2 0
      src/store/types/pushMessage.js
  46. 15 4
      src/utils/tools.js

+ 3 - 3
src/common/components/SearchOption/index.less

@@ -11,9 +11,9 @@
     margin-bottom: 80px;
     .llStyle;
     .autoList {
-        max-height: 225px;
-        min-height: 80px;
-        overflow-y: auto;
+        // max-height: 225px;
+        // min-height: 80px;
+        // overflow-y: auto;
     }
     input {
         width: 100%;

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

@@ -18,6 +18,7 @@ class Textarea extends Component {
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
+    this.handleKeydown = this.handleKeydown.bind(this);
   }
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput} = this.props;
@@ -98,6 +99,14 @@ class Textarea extends Component {
     //存值到store
     handleInput&&handleInput({text});
   }
+  handleKeydown(e){
+    const {boxMark} = this.props;
+    const ev = e||window.event;
+    if(+boxMark==1){
+      //禁止回车事件
+      if(ev.keyCode==13){return false;}
+    }
+  }
   render() {
     const { title } = this.props;
     return (
@@ -109,7 +118,8 @@ class Textarea extends Component {
              ref={this.$dom}
              contentEditable={true}
              onInput={this.handleInput}
-             onBlur={this.handleBlur}>
+             onBlur={this.handleBlur}
+             onkeydown={this.handleKeydown}>
         </div>
       </div>
     );

+ 20 - 14
src/common/js/func.js

@@ -82,7 +82,8 @@ function notTextLabel(label){
 * 入参:arr源数组,
 *       noPre是否不添加前置文本标签,默认false即添加
 *       noEnd是否不添加后置文本标签,默认false即添加
-*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体
+*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体,
+*       showInCheck是否默认在查体中展开
 * */
 export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
   let newArr =[],
@@ -92,19 +93,22 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       notText = true,
       saveText=[],
       tempText = '',
-      value = '';
+      value = '',
+      item={},
+      checkHiddenDefault=false;
   arr.map((it,i)=>{
     notText = notTextLabel(it);
     value = it.value||'';
-    textLabel = JSON.parse(config.textLabel);
-    _textLabel = JSON.parse(config._textLabel);
+    textLabel = !ifEmpty&&i==0?Object.assign({},JSON.parse(config.textLabel),{showInCheck:true}):JSON.parse(config.textLabel);
+    _textLabel = !ifEmpty&&i<config.showCheckNum+1?Object.assign({},JSON.parse(config._textLabel),{showInCheck:true}):JSON.parse(config._textLabel);
     if(i===0){
       //第一个标签不是文本标签时在前面添加文本标签
       if(!noPre&&notText){
         newArr.push(textLabel);
         saveText.push('');
       }
-      newArr.push(it);
+      item = ifEmpty?it:Object.assign({},it,{showInCheck:true});
+      newArr.push(item);
       if(it.tagType != 3){
         tempText = value?it.labelPrefix+value+it.labelSuffix:'';
         tempText = notText?tempText:it.value||it.name;
@@ -114,23 +118,25 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       saveText.push(tempText);
     }else{
       pre = arr[i-1];
+      item = !ifEmpty&&i<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;
+      //判断单选项是否有默认选中,位置在隐藏区域时,查体所有标签展示
+      if(!ifEmpty&&!checkHiddenDefault&&i>config.showCheckNum&&+it.tagType===1&&(+it.controlType===0||+it.controlType===1)){
+        if(it.questionDetailList.find((it)=>it.defaultSelect=='1')){
+          checkHiddenDefault=true;
+        }
+      }
       //如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
       if(notTextLabel(pre)&&notText){
           // newArr.push(textLabel,it);
-          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,it);
+          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,item);
           if(it.tagType != 3) {
             tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
           }else{
             tempText = getSaveText(it);
           }
-          saveText.push("",tempText); 
-        //最后一个非文本标签,后面添加一个文本标签
-        /*if(!noEnd&&i===arr.length-1){
-          newArr.push(textLabel);
-          saveText.push("");
-        }*/
+          saveText.push("",tempText);
       }else{    //本身是或者前面是文本标签时,前面不添加文本标签
-        newArr.push(it);
+        newArr.push(item);
         if(it.tagType != 3) {
           tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
           // tempText = notText?tempText:it.value||it.name;
@@ -147,7 +153,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }
     }
   });
-  return {newArr,saveText};
+  return {newArr,saveText,checkHiddenDefault};
 };
 
 

+ 167 - 140
src/components/AddAssistCheck/index.jsx

@@ -1,159 +1,186 @@
 import React from 'react';
-import { SearchOption, Calendar ,ConfirmModal,Notify,Add} from '@commonComp';
+import { SearchOption, Calendar, ConfirmModal, Notify, Add } from '@commonComp';
 import styles from './index.less';
 import $ from 'jquery';
 import Textarea from './Textarea';
 import close from './img/close.png';
 
 class AddAssistCheck extends React.Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-            show: false,
-            date: false,
-            dateTime:"",
-            active:'',
-            visible:false,
-            id:null
-        }
-        this.handleShowDate = this.handleShowDate.bind(this)
-        this.getCurrentDate = this.getCurrentDate.bind(this)
-        this.getSearchList = this.getSearchList.bind(this)
-        this.getAssistLabel = this.getAssistLabel.bind(this)
-        this.handleDelClick = this.handleDelClick.bind(this)
-        this.delConfirm = this.delConfirm.bind(this)
-        this.handleCancel = this.handleCancel.bind(this)
+  constructor(props) {
+    super(props);
+    this.state = {
+      show: false,
+      date: false,
+      dateTime: "",
+      active: '',
+      visible: false,
+      id: null
     }
+    this.handleShowDate = this.handleShowDate.bind(this)
+    this.getCurrentDate = this.getCurrentDate.bind(this)
+    this.getSearchList = this.getSearchList.bind(this)
+    this.getAssistLabel = this.getAssistLabel.bind(this)
+    this.handleDelClick = this.handleDelClick.bind(this)
+    this.delConfirm = this.delConfirm.bind(this)
+    this.handleCancel = this.handleCancel.bind(this)
+  }
 
-    handleDelClick(id){
-        this.setState({
-            visible:true,
-            id:id
-        })
-    }
+  handleDelClick(id) {
+    this.setState({
+      visible: true,
+      id: id
+    })
+  }
 
-    delConfirm(){
-        const {handleDelAssist,handlePush} = this.props;
-        const {id} = this.state;
-        handleDelAssist&&handleDelAssist(id);
-        handlePush&&handlePush();           //右侧推送
-        this.setState({
-            visible:false,
-            id:null
-        })
-        Notify.success("删除成功");
-    }
+  delConfirm() {
+    const { handleDelAssist, handlePush } = this.props;
+    const { id } = this.state;
+    handleDelAssist && handleDelAssist(id);
+    handlePush && handlePush();           //右侧推送
+    this.setState({
+      visible: false,
+      id: null
+    })
+    Notify.success("删除成功");
+  }
 
-    handleCancel(){
-        this.setState({
-            visible:false,
-            id:null
-        })
-    }
+  handleCancel() {
+    this.setState({
+      visible: false,
+      id: null
+    })
+  }
 
-    componentDidMount() {
-        $(document).click((event) => {
-            let _con = $('#searchWrapAssist');   // 设置目标区域
-            let _cons = $('#datePick');   // 设置目标区域
-            if (searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
-                this.setState({ show: false });
-            }
-            if (!_cons.is(event.target) && _cons.has(event.target).length === 0) { // Mark 1
-                this.setState({ date: false });
-            }
-        });
-        this.getCurrentDate();
-    }
-    handleSearchShow(e) {
-        let tmpShow = this.state.show;
-        this.setState({ show: !tmpShow })
-        // e.stopPropagation();
-    }
-    handleShowDate(idx){
-        this.setState({
-            date:!this.state.date,
-            active:idx
+  componentDidMount() {
+    $(document).click((event) => {
+      let _con = $('#searchWrapAssist');   // 设置目标区域
+      let _cons = $('#datePick');   // 设置目标区域
+      if (searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
+        this.setState({ show: false });
+      }
+      if (!_cons.is(event.target) && _cons.has(event.target).length === 0) { // Mark 1
+        this.setState({ date: false });
+      }
+    });
+    this.getCurrentDate();
+  }
+  handleSearchShow(e) {
+    let tmpShow = this.state.show;
+    this.setState({ show: !tmpShow })
+    // e.stopPropagation();
+  }
+  handleShowDate(idx) {
+    this.setState({
+      date: !this.state.date,
+      active: idx
+    })
+  }
+  getCurrentDate() {
+    let myDate = new Date();
+    let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
+    let mon = myDate.getMonth() - 0 + 1;       //获取当前月份(0-11,0代表1月)
+    let day = myDate.getDate();            //获取当前日(1-31)
+    let date = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day);
+    this.setState({ dateTime: date })
+  }
+
+  getSearchList(list) {      //搜索列表
+    const { handleSign } = this.props;
+    return <ul className={styles.searchLiUl}>
+      {
+        list && list.map((item, idx) => {
+          return <li key={item.id}
+            className={styles.searchLi}
+            title={item.name}
+            onClick={() => {
+              handleSign(item.questionId, idx,'search');
+              this.setState({ show: false })
+            }}
+          >
+            {item.name}{item.name == item.retrievalName ? null : '(' + item.retrievalName + ')'}
+          </li>
         })
-    }
-    getCurrentDate(){
-        let myDate = new Date();
-        let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
-        let mon = myDate.getMonth()-0+1;       //获取当前月份(0-11,0代表1月)
-        let day = myDate.getDate();            //获取当前日(1-31)
-        let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
-        this.setState({dateTime:date})
-    }
-    
-    getSearchList(list){      //搜索列表
-        const {handleSign} = this.props;
-        return <ul>
-        {
-            list && list.map((item,idx) => {
-                return <li key={item.id}
-                    className={styles.searchLi}
-                    title={item.name}
-                    onClick={() => {
-                        handleSign(item.questionId,idx);
-                        this.setState({ show: false })
-                    }}
-                >
-                    {item.name}{item.name == item.retrievalName?null:'('+item.retrievalName+')'}
-                </li>
-            })
-        }
+      }
     </ul>
-    }
-    getAssistLabel(){
-        const {assistLabel,handleChangeAssistValue,handleChangeDate,isRead,handlePush,winWidth} = this.props;
-        return <ul className={styles.labelWrap} id="datePick">
+  }
+  getCommonList() {      //常用列表
+    const { handleSign,assistList } = this.props;
+    return <ul className={styles.searchLiUl}>
+      {
+        assistList && assistList.map((item, idx) => {
+          return <li key={item.id}
+            className={styles.searchLi}
+            title={item.name}
+            onClick={() => {
+              handleSign(item.questionId, idx,'common');
+              this.setState({ show: false })
+            }}
+          >
+            {item.name}
+          </li>
+        })
+      }
+    </ul>
+  }
+  getAssistLabel() {
+    const { assistLabel, handleChangeAssistValue, handleChangeDate, isRead, handlePush, winWidth } = this.props;
+    return <ul className={styles.labelWrap} id="datePick">
+      {
+        assistLabel.map((item, idx) => {
+          return (<li key={item.id} className={styles.assistLists}>
+            <span className={styles.assistName} style={{ width: winWidth < 1200 ? '120px' : 'auto' }}>{item.name}:</span>
+            <div className={styles.textareaWrap}>
+              <Textarea value={item.value} handlePush={handlePush} isRead={isRead} handleChangeAssistValue={handleChangeAssistValue} idx={idx}></Textarea>
+            </div>
+            <div className={styles.pointerFinger}>
+              <p onClick={() => this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
+              <i onClick={() => this.handleShowDate(idx)}></i>
+              <a href="javascript:void(0);" onClick={() => { this.handleDelClick(idx) }}><img src={close} alt="" /></a>
+              <div style={{ display: this.state.date && idx == this.state.active ? "block" : "none", position: "relative" }}>
+                <Calendar isShow={true} handleChange={(info) => { handleChangeDate(info, idx); this.setState({ date: false }) }}></Calendar>
+              </div>
+            </div>
+          </li>)
+        })
+      }
+    </ul>
+  }
+  render() {
+    const { handleChangeValue, list } = this.props;
+    const { visible } = this.state;
+    return (
+      <div className={styles.wrapper}>
+        {this.getAssistLabel()}
+        <div id="searchWrapAssist" style={{ position: "relative", clear: 'both' }}>
+          <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck" />
+          {this.state.show ? <SearchOption handleChangeValue={handleChangeValue} visible={true}>
+            {list && list.length>0?this.getSearchList(list):''}
             {
-              assistLabel.map((item,idx) => {
-                    return (<li key={item.id} className={styles.assistLists}>
-                        <span className={styles.assistName} style={{width:winWidth < 1200?'120px':'auto'}}>{item.name}:</span>
-                        <div className={styles.textareaWrap}>
-                            <Textarea value={item.value} handlePush={handlePush} isRead={isRead} handleChangeAssistValue={handleChangeAssistValue} idx={idx}></Textarea>
-                        </div>
-                        <div className={styles.pointerFinger}>
-                            <p onClick={()=>this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
-                            <i onClick={()=>this.handleShowDate(idx)}></i>
-                            <a href="javascript:void(0);" onClick={()=>{this.handleDelClick(idx)}}><img src={close} alt=""/></a>
-                            <div style={{display:this.state.date && idx == this.state.active?"block":"none",position:"relative"}}>
-                                <Calendar isShow={true} handleChange={(info)=>{handleChangeDate(info,idx);this.setState({date:false})}}></Calendar>
-                            </div>
-                        </div>
-                    </li>)
-                })
+              list && list.length>0?'':<div>
+                <p style={{padding:'5px 30px',color:'#bfbfbf'}}>常用辅检项</p>
+                {
+                  this.getCommonList()
+                }
+              </div> 
             }
-        </ul>
-    }
-    render() {
-        const { handleChangeValue, list } = this.props;
-        const { visible } = this.state;
-        return (
-            <div className={styles.wrapper}>
-                {this.getAssistLabel()}
-                <div id="searchWrapAssist" style={{position:"relative",clear:'both'}}>
-                    <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck"/>
-                  {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
-                        {this.getSearchList(list)}
-                    </SearchOption>:''}
-                </div>
-                <ConfirmModal 
-                    visible={visible}
-                    confirm={this.delConfirm}
-                    close={this.handleCancel}
-                    cancel={this.handleCancel}
-                    okText="删除"
-                    cancelText='取消'
-                    okBorderColor={'#3B9ED0'}
-                    okColor={'#fff'}
-                    oKBg={'#3B9ED0'}
-                >
-                    <p className={styles['center']}>是否删除该辅检项?</p>
-                </ConfirmModal>
-            </div>
-        )
-    }
+          </SearchOption> : ''}
+        </div>
+        <ConfirmModal
+          visible={visible}
+          confirm={this.delConfirm}
+          close={this.handleCancel}
+          cancel={this.handleCancel}
+          okText="删除"
+          cancelText='取消'
+          okBorderColor={'#3B9ED0'}
+          okColor={'#fff'}
+          oKBg={'#3B9ED0'}
+        >
+          <p className={styles['center']}>是否删除该辅检项?</p>
+        </ConfirmModal>
+      </div>
+    )
+  }
 }
 
 export default AddAssistCheck;

+ 5 - 1
src/components/AddAssistCheck/index.less

@@ -23,7 +23,11 @@
     box-sizing: border-box;
     cursor: pointer;
 }
-
+.searchLiUl {
+  overflow-y: auto;
+  max-height: 225px;
+  min-height: 80px;
+}
 .searchLi:hover {
     border: 1px solid @blue;
     box-sizing: border-box;

+ 340 - 312
src/components/AddInspect/index.jsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
+import { SearchOption, InspectCommon, Calendar, Notify, ConfirmModal, Add } from '@commonComp';
 import SlideExcel from './SlideExcel';
 import SlideSelect from './SlideSelect';
 import { deepClone } from '@utils/tools';
@@ -11,335 +11,363 @@ import slideDown from "@common/images/slide-down.png";
 import store from '@store';
 import $ from 'jquery';
 class Inspect extends React.Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-            show: false,
-            showFill: false,
-            date: false,
-            currentIdx: '',
-            dateTime:"",
-            currentData:{},
-            numPlus:0,     //判断是否所有的填写单都是空
-            num:0,            //暂存数据,获取一次,不能每次都是新的数据
-            toastText:'',
-            visible:false,
-            type:null,
-            id:null,
-            tmpIds:[],      //内层外层
-        }
-        this.handleChangeDate = this.handleChangeDate.bind(this)
-        this.handleShowDate = this.handleShowDate.bind(this)
-        this.getCurrentDate = this.getCurrentDate.bind(this)
-        this.getItemList = this.getItemList.bind(this)
-        this.getSearchList = this.getSearchList.bind(this)
-        this.changeActivePart = this.changeActivePart.bind(this)
-        this.showDetails = this.showDetails.bind(this)
-        this.delConfirm = this.delConfirm.bind(this)
-        this.handleCancel = this.handleCancel.bind(this)
-        this.handleSearchShow = this.handleSearchShow.bind(this)
-        this.changeShowFill = this.changeShowFill.bind(this)
-        this.handleFillShow = this.handleFillShow.bind(this)
-        this.handleDelClick = this.handleDelClick.bind(this)
+  constructor(props) {
+    super(props);
+    this.state = {
+      show: false,
+      showFill: false,
+      date: false,
+      currentIdx: '',
+      dateTime: "",
+      currentData: {},
+      numPlus: 0,     //判断是否所有的填写单都是空
+      num: 0,            //暂存数据,获取一次,不能每次都是新的数据
+      toastText: '',
+      visible: false,
+      type: null,
+      id: null,
+      tmpIds: [],      //内层外层
     }
-    delConfirm(){//弹窗确定
-        const{delPartItem,handleCloseExcel,handlePush} = this.props;
-        const{type,id} = this.state;
-        if(type==1){
-            delPartItem(id)
-        }else if(type==2){
-            handleCloseExcel(id)
-        }
-        this.setState({
-            visible:false,
-            type:null,
-            id:null,
-        })
-        Notify.success("删除成功");
-        handlePush&&handlePush();       //右侧推送
+    this.handleChangeDate = this.handleChangeDate.bind(this)
+    this.handleShowDate = this.handleShowDate.bind(this)
+    this.getCurrentDate = this.getCurrentDate.bind(this)
+    this.getItemList = this.getItemList.bind(this)
+    this.getSearchList = this.getSearchList.bind(this)
+    this.getCommonList = this.getCommonList.bind(this)
+    this.changeActivePart = this.changeActivePart.bind(this)
+    this.showDetails = this.showDetails.bind(this)
+    this.delConfirm = this.delConfirm.bind(this)
+    this.handleCancel = this.handleCancel.bind(this)
+    this.handleSearchShow = this.handleSearchShow.bind(this)
+    this.changeShowFill = this.changeShowFill.bind(this)
+    this.handleFillShow = this.handleFillShow.bind(this)
+    this.handleDelClick = this.handleDelClick.bind(this)
+  }
+  delConfirm() {//弹窗确定
+    const { delPartItem, handleCloseExcel, handlePush } = this.props;
+    const { type, id } = this.state;
+    if (type == 1) {
+      delPartItem(id)
+    } else if (type == 2) {
+      handleCloseExcel(id)
     }
-    handleDelClick(type,idx){
-        this.setState({
-            type:type,
-            id:idx,
-            visible:true
-        })
-        if(type==1){//单项
-            this.setState({
-                toastText:'是否删除该化验项?'
-            })
-        }else if(type==2){//导入项
-            this.setState({
-                toastText:'是否删除导入项?'
-            })
-        }
-    }
-    handleCancel(){
-        this.setState({
-            visible:false,
-            type:null,
-            id:null,
-        })
-    }
-    componentDidMount() {
-        $(document).click((event) => {
-            let searchWrap = $('#searchWrap')[0];   // 搜索按钮
-            let searchOption = $('#searchOption')[0];   // 搜索列表
-            let inspectFill = $('#inspectFill')[0];         // 公共填写单
-            if(searchOption){
-                if ( searchOption != event.target && searchWrap != event.target && searchWrap != event.target.parentNode && !$.contains(searchOption, event.target)) { // Mark 1
-                    this.setState({ show: false });
-                }
-            }
-            if(inspectFill){
-                if ( event.target.getAttribute('data-flg') != 'current' && inspectFill != event.target && !$.contains(inspectFill, event.target)) { // Mark 1
-                    this.setState({ showFill: false ,date:false});
-                }
-            }
-        });
-        this.getCurrentDate();
+    this.setState({
+      visible: false,
+      type: null,
+      id: null,
+    })
+    Notify.success("删除成功");
+    handlePush && handlePush();       //右侧推送
+  }
+  handleDelClick(type, idx) {
+    this.setState({
+      type: type,
+      id: idx,
+      visible: true
+    })
+    if (type == 1) {//单项
+      this.setState({
+        toastText: '是否删除该化验项?'
+      })
+    } else if (type == 2) {//导入项
+      this.setState({
+        toastText: '是否删除导入项?'
+      })
     }
-    componentWillReceiveProps(nextProps){
-        if(nextProps.fillActive.name != this.props.fillActive.name){
-            this.setState({num:0})
+  }
+  handleCancel() {
+    this.setState({
+      visible: false,
+      type: null,
+      id: null,
+    })
+  }
+  componentDidMount() {
+    $(document).click((event) => {
+      let searchWrap = $('#searchWrap')[0];   // 搜索按钮
+      let searchOption = $('#searchOption')[0];   // 搜索列表
+      let inspectFill = $('#inspectFill')[0];         // 公共填写单
+      if (searchOption) {
+        if (searchOption != event.target && searchWrap != event.target && searchWrap != event.target.parentNode && !$.contains(searchOption, event.target)) { // Mark 1
+          this.setState({ show: false });
         }
+      }
+      if (inspectFill) {
+        if (event.target.getAttribute('data-flg') != 'current' && inspectFill != event.target && !$.contains(inspectFill, event.target)) { // Mark 1
+          this.setState({ showFill: false, date: false });
+        }
+      }
+    });
+    this.getCurrentDate();
+  }
+  componentWillReceiveProps(nextProps) {
+    if (nextProps.fillActive.name != this.props.fillActive.name) {
+      this.setState({ num: 0 })
     }
-    changeShowFill(){
-      this.setState({showFill:false})
-    }
-    handleChangeDate(info) {
-        let date = info.year+'-'+(info.month<10?'0'+info.month:info.month)+'-'+(info.day<10?'0'+info.day:info.day);
-        this.setState({dateTime:date,date:false})
-    }
-    handleSearchShow(e) {
-        let tmpShow = this.state.show;
-        this.setState({ show: !tmpShow })
-        // e.stopPropagation();
-    }
-    handleFillShow(e,idx) {
-        let tmpShow = this.state.showFill;
-        let baseList = store.getState().inspect.fillActive;
-        this.setState({
-            showFill: !tmpShow, 
-            currentIdx:idx,
-            currentData:baseList,
-            dateTime:baseList.time?baseList.time:this.getCurrentDate()
-        })
-        e.stopPropagation();
-    }
-    handleShowDate(){
-        this.setState({
-            date:!this.state.date
-        })
-    }
-    getCurrentDate(){
-        let myDate = new Date();
-        let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
-        let mon = myDate.getMonth()-0+1;       //获取当前月份(0-11,0代表1月)
-        let day = myDate.getDate();            //获取当前日(1-31)
-        let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
-        this.setState({dateTime:date})
-        return date;
+  }
+  changeShowFill() {
+    this.setState({ showFill: false })
+  }
+  handleChangeDate(info) {
+    let date = info.year + '-' + (info.month < 10 ? '0' + info.month : info.month) + '-' + (info.day < 10 ? '0' + info.day : info.day);
+    this.setState({ dateTime: date, date: false })
+  }
+  handleSearchShow(e) {
+    let tmpShow = this.state.show;
+    this.setState({ show: !tmpShow })
+    // e.stopPropagation();
+  }
+  handleFillShow(e, idx) {
+    let tmpShow = this.state.showFill;
+    let baseList = store.getState().inspect.fillActive;
+    this.setState({
+      showFill: !tmpShow,
+      currentIdx: idx,
+      currentData: baseList,
+      dateTime: baseList.time ? baseList.time : this.getCurrentDate()
+    })
+    e.stopPropagation();
+  }
+  handleShowDate() {
+    this.setState({
+      date: !this.state.date
+    })
+  }
+  getCurrentDate() {
+    let myDate = new Date();
+    let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
+    let mon = myDate.getMonth() - 0 + 1;       //获取当前月份(0-11,0代表1月)
+    let day = myDate.getDate();            //获取当前日(1-31)
+    let date = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day);
+    this.setState({ dateTime: date })
+    return date;
+  }
+  changeActivePart(idx, val, clear) {
+    let nums = this.state.num;
+    let fillActive;
+    if (nums == 0) {
+      fillActive = this.props.fillActive;
+    } else {
+      fillActive = this.state.currentData;
     }
-    changeActivePart(idx,val,clear){
-        let nums = this.state.num;
-        let fillActive;
-        if(nums == 0){
-            fillActive = this.props.fillActive;
-        }else{
-            fillActive = this.state.currentData;
+    ++nums;
+    this.setState({ num: nums });
+    let tempArr = deepClone(fillActive);
+
+    if (clear) {    //点击清空按钮,至清初输入的数字
+      for (let i = 0; i < tempArr.details.length; i++) {
+        tempArr.details[i].value = ''
+        tempArr.show = false;
+      }
+      tempArr.time = this.getCurrentDate();
+      this.setState({ currentData: tempArr })
+      return;
+    } else {
+      let tempNumPlus = 0;
+      for (let i = 0; i < tempArr.details.length; i++) {
+        if (i == idx) {
+          tempArr.details[i].value = val
         }
-        ++nums;
-        this.setState({num:nums});
-        let tempArr = deepClone(fillActive);
-        
-        if(clear){    //点击清空按钮,至清初输入的数字
-          for (let i = 0; i < tempArr.details.length; i++) {
-            tempArr.details[i].value = ''
+        if (tempArr.details[i].value != undefined && tempArr.details[i].value != '') {
+          tempArr.show = true;
+        } else {
+          ++tempNumPlus;
+          if (tempNumPlus == tempArr.details.length) {
             tempArr.show = false;
           }
-          tempArr.time = this.getCurrentDate();
-          this.setState({currentData:tempArr})
-          return;
-        }else{
-          let tempNumPlus = 0;
-          for (let i = 0; i < tempArr.details.length; i++) {
-              if (i == idx) {
-                  tempArr.details[i].value = val
-              }
-              if(tempArr.details[i].value != undefined && tempArr.details[i].value != ''){
-                  tempArr.show = true;
-              }else{
-                  ++tempNumPlus;
-                  if(tempNumPlus == tempArr.details.length){
-                      tempArr.show = false;
-                  }
-              }
-          }
-          tempArr.time = this.state.dateTime;
-          this.setState({currentData:tempArr})
         }
+      }
+      tempArr.time = this.state.dateTime;
+      this.setState({ currentData: tempArr })
     }
-    getItemList(){        //填写单展示
-        let number = this.state.num;
-        let fillActive;
-        if(number == 0){
-            fillActive = this.props.fillActive;
-        }else{
-            fillActive = this.state.currentData;
-        }
-        return <ul className={styles.searchLis}>
-            {
-                fillActive && fillActive.details && fillActive.details.map((item,idx) => {
-                    if(item.controlType == 1){
-                        return (
-                            <li className={`${styles.itemPart} ${fillActive.details.length>1?'':styles.itemPartOne}`}>
-                                <span className={styles.itemPartL}>{item.name}</span>
-                                <select className={styles.itemPartR} onChange={(e)=>{
-                                        if(e.target.value == '请选择') {
-                                            this.changeActivePart(idx,'')
-                                            return;
-                                        }
-                                        this.changeActivePart(idx,e.target.value);
-                                    }}
-                                >
-                                    <option value="请选择">请选择</option>
-                                    {
-                                        (item.questionDetailList).map((val)=>{
-                                            return <option value={val.name} 
-                                                selected={val.name == item.value?true:false}
-                                            >{val.name}</option>
-                                        })
-                                    }
-                                </select>
-                            </li>
-                        )
-                    }else if(item.controlType == 6){
-                        return (
-                            <li className={`${styles.itemPart} ${fillActive.details.length>1?'':styles.itemPartOne}`}>
-                                <span className={styles.itemPartL} title={item.name}>{item.name}</span>
-                                <span className={styles.itemPartT}>
-                                    <input type="text" 
-                                        placeholder="(填写)"
-                                        value={item.value}
-                                        onKeyUp={(e)=>{this.changeActivePart(idx,e.target.value.trim())}} 
-                                    />
-                                    <p className={styles.unit}>{item.labelSuffix}</p>
-                                </span>
-                            </li>
-                        )
-                    }
-                })
-            }
-        </ul>
+  }
+  getItemList() {        //填写单展示
+    let number = this.state.num;
+    let fillActive;
+    if (number == 0) {
+      fillActive = this.props.fillActive;
+    } else {
+      fillActive = this.state.currentData;
     }
-    getSearchList(list){      //搜索列表
-        const {handleSign} = this.props;
-        return <ul>
-        {
-            list && list.map((item,idx) => {
-                return <li key={idx}
-                    className={styles.searchLi}
-                    title={item.name}
-                    onClick={() => {
-                        handleSign(item.questionId,idx);
-                        this.setState({ show: false })
-                    }}
+    return <ul className={styles.searchLis}>
+      {
+        fillActive && fillActive.details && fillActive.details.map((item, idx) => {
+          if (item.controlType == 1) {
+            return (
+              <li className={`${styles.itemPart} ${fillActive.details.length > 1 ? '' : styles.itemPartOne}`}>
+                <span className={styles.itemPartL}>{item.name}</span>
+                <select className={styles.itemPartR} onChange={(e) => {
+                  if (e.target.value == '请选择') {
+                    this.changeActivePart(idx, '')
+                    return;
+                  }
+                  this.changeActivePart(idx, e.target.value);
+                }}
                 >
-                    {item.name}{item.name == item.retrievalName?null:'('+item.retrievalName+')'}
-                </li>
-            })
-        }
+                  <option value="请选择">请选择</option>
+                  {
+                    (item.questionDetailList).map((val) => {
+                      return <option value={val.name}
+                        selected={val.name == item.value ? true : false}
+                      >{val.name}</option>
+                    })
+                  }
+                </select>
+              </li>
+            )
+          } else if (item.controlType == 6) {
+            return (
+              <li className={`${styles.itemPart} ${fillActive.details.length > 1 ? '' : styles.itemPartOne}`}>
+                <span className={styles.itemPartL} title={item.name}>{item.name}</span>
+                <span className={styles.itemPartT}>
+                  <input type="text"
+                    placeholder="(填写)"
+                    value={item.value}
+                    onKeyUp={(e) => { this.changeActivePart(idx, e.target.value.trim()) }}
+                  />
+                  <p className={styles.unit}>{item.labelSuffix}</p>
+                </span>
+              </li>
+            )
+          }
+        })
+      }
     </ul>
-    }
-    showDetails(val){
-        if(val.questionDetailList.length > 0){
-            return val.questionDetailList.map((item)=>{
-                if(val.value == item.name){
-                    return <td style={{width:'20%'}} className={item.abnormal != '0' ?"red":'' }>{val.value}</td>
-                }
-            })
-        }else{
-            return <td style={{width:'20%'}}><span className={(val.value - 0).toString() == 'NaN'?"red":(val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue?"red":''):''}>{val.value}</span> { val.labelSuffix}</td>
+  }
+  getSearchList(list) {//搜索列表
+    const { handleSign } = this.props;
+    return <ul className={styles.searchLiUl}>
+      {
+        list && list.map((item, idx) => {
+          return <li key={idx}
+            className={styles.searchLi}
+            title={item.name}
+            onClick={() => {
+              handleSign(item.questionId, idx,'search');
+              this.setState({ show: false })
+            }}
+          >
+            {item.name}{item.name == item.retrievalName ? null : '(' + item.retrievalName + ')'}
+          </li>
+        })
+      }
+    </ul>
+  }
+  getCommonList(){//常用列表
+    const { handleSign,inspectList } = this.props;
+    return <ul className={styles.searchLiUl}>
+      {
+        inspectList && inspectList.map((item, idx) => {
+          return <li key={idx}
+            className={styles.searchLi}
+            title={item.name}
+            onClick={() => {
+              handleSign(item.questionId, idx,'common');
+              this.setState({ show: false })
+            }}
+          >
+            {item.name}
+          </li>
+        })
+      }
+    </ul>
+  }
+  showDetails(val) {
+    if (val.questionDetailList.length > 0) {
+      return val.questionDetailList.map((item) => {
+        if (val.value == item.name) {
+          return <td style={{ width: '20%' }} className={item.abnormal != '0' ? "red" : ''}>{val.value}</td>
         }
+      })
+    } else {
+      return <td style={{ width: '20%' }}><span className={(val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : '') : ''}>{val.value}</span> {val.labelSuffix}</td>
     }
-    render() {
-        const { handleChangeValue, list, labelList,delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive,getExcelDataList,handleCloseExcel,handlePush } = this.props;
-        const {toastText,visible,tmpId,tmpIdx} = this.state;
-        return (
-            <div className={styles.wrapper}>
-                <div className={styles.check}>
+  }
+  render() {
+    const { handleChangeValue, list, labelList, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
+    const { toastText, visible, tmpId, tmpIdx } = this.state;
+    return (
+      <div className={styles.wrapper}>
+        <div className={styles.check}>
+          {
+            getExcelDataList.length > 0 && getExcelDataList.map((items, id) => {
+              return <div style={{ marginTop: '10px' }}>
+                {
+                  items && items.lisExcelRes.length > 0 ? <ul className={styles.excelDataLists}>
+                    <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={() => { this.handleDelClick(2, id) }} />
                     {
-                        getExcelDataList.length > 0 && getExcelDataList.map((items,id)=>{
-                            return <div style={{marginTop:'10px'}}>
-                                {
-                                    items && items.lisExcelRes.length > 0 ? <ul className={styles.excelDataLists}>
-                                    <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={()=>{this.handleDelClick(2,id)}}/>
-                                    {
-                                        items.lisExcelRes.map((item,idx)=>{
-                                            return <SlideExcel
-                                              items={items}
-                                              item={item}
-                                              idx={idx}
-                                              dateTime={this.state.dateTime}
-                                            ></SlideExcel>
-                                        })
-                                    }
-                                </ul>:null
-                                }
-                            </div>
-                        })
+                      items.lisExcelRes.map((item, idx) => {
+                        return <SlideExcel
+                          items={items}
+                          item={item}
+                          idx={idx}
+                          dateTime={this.state.dateTime}
+                        ></SlideExcel>
+                      })
                     }
-                    <ul className={styles.labelWrap} >
-                        {
-                            labelList && labelList.map((item,idx) => {
-                                return <SlideSelect
-                                  item={item}
-                                  idx={idx}
-                                  showFill={this.state.showFill}
-                                  handlePush={handlePush}
-                                  fillActive={fillActive}
-                                  handleLabelSub={handleLabelSub}
-                                  date={this.state.date}
-                                  dateTime={this.state.dateTime}
-                                  currentIdx={this.state.currentIdx}
-                                  currentData={this.state.currentData}
-                                  showDetails={this.showDetails}
-                                  handleShowDate={this.handleShowDate}
-                                  handleChangeDate={this.handleChangeDate}
-                                  changeShowFill={this.changeShowFill}
-                                  handleFillShow={this.handleFillShow}
-                                  getItemList={this.getItemList}
-                                  changeActivePart={this.changeActivePart}
-                                  handleDelClick={this.handleDelClick}
-                                  handleConfirm={handleConfirm}
-                                ></SlideSelect>
-                            })
-                        }
-                    </ul>
-                </div>
-                <div style={{position:"relative",clear:"both"}}>
-                    <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap"/>
-                  {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
-                        {this.getSearchList(list)}
-                    </SearchOption>:''}
-                </div>
-                <ConfirmModal 
-                    visible={visible}
-                    confirm={this.delConfirm}
-                    close={this.handleCancel}
-                    cancel={this.handleCancel}
-                    okText="删除"
-                    cancelText='取消'
-                    okBorderColor={'#3B9ED0'}
-                    okColor={'#fff'}
-                    oKBg={'#3B9ED0'}
-                >
-                    <p className={styles['center']}>{toastText}</p>
-                </ConfirmModal>
-            </div>
-        )
-    }
+                  </ul> : null
+                }
+              </div>
+            })
+          }
+          <ul className={styles.labelWrap} >
+            {
+              labelList && labelList.map((item, idx) => {
+                return <SlideSelect
+                  item={item}
+                  idx={idx}
+                  showFill={this.state.showFill}
+                  handlePush={handlePush}
+                  fillActive={fillActive}
+                  handleLabelSub={handleLabelSub}
+                  date={this.state.date}
+                  dateTime={this.state.dateTime}
+                  currentIdx={this.state.currentIdx}
+                  currentData={this.state.currentData}
+                  showDetails={this.showDetails}
+                  handleShowDate={this.handleShowDate}
+                  handleChangeDate={this.handleChangeDate}
+                  changeShowFill={this.changeShowFill}
+                  handleFillShow={this.handleFillShow}
+                  getItemList={this.getItemList}
+                  changeActivePart={this.changeActivePart}
+                  handleDelClick={this.handleDelClick}
+                  handleConfirm={handleConfirm}
+                ></SlideSelect>
+              })
+            }
+          </ul>
+        </div>
+        <div style={{ position: "relative", clear: "both" }}>
+          <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap" />
+          {this.state.show ? <SearchOption handleChangeValue={handleChangeValue} visible={true}>
+            {list && list.length>0?this.getSearchList(list):''}
+            {
+              list && list.length>0?'':<div>
+                  <p style={{padding:'5px 30px',color:'#bfbfbf'}}>常用化验项</p>
+                  {
+                    this.getCommonList()
+                  }
+                </div> 
+            }
+          </SearchOption> : ''}
+        </div>
+        <ConfirmModal
+          visible={visible}
+          confirm={this.delConfirm}
+          close={this.handleCancel}
+          cancel={this.handleCancel}
+          okText="删除"
+          cancelText='取消'
+          okBorderColor={'#3B9ED0'}
+          okColor={'#fff'}
+          oKBg={'#3B9ED0'}
+        >
+          <p className={styles['center']}>{toastText}</p>
+        </ConfirmModal>
+      </div>
+    )
+  }
 }
 
 export default Inspect;

+ 5 - 0
src/components/AddInspect/index.less

@@ -88,6 +88,11 @@
 .fillWrap {
     display: none;
 }
+.searchLiUl {
+  overflow-y: auto;
+  max-height: 225px;
+  min-height: 80px;
+}
 .searchLi {
     height: 36px;
     line-height: 36px;

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

@@ -10,7 +10,7 @@ class AssistCheck extends React.Component {
     }
 
     render(){
-        const {list,assistLabel,handleChangeValue,handleSign,fetchPushInfos,handleDelAssist,handleChangeAssistValue,handleChangeDate,isRead,winWidth} = this.props;
+        const {list,assistLabel,handleChangeValue,handleSign,fetchPushInfos,handleDelAssist,handleChangeAssistValue,handleChangeDate,isRead,winWidth,assistList} = this.props;
         return (
             <div className={styles.wrapper}>
                 <div className={styles.top}>
@@ -36,6 +36,7 @@ class AssistCheck extends React.Component {
                             handleChangeDate={handleChangeDate}
                             isRead={isRead}
                             winWidth={winWidth}
+                            assistList={assistList}
                         >
 
                         </AddAssistCheck>

+ 16 - 4
src/components/CheckBody/index.jsx

@@ -31,9 +31,13 @@ class CheckBody extends Component{
   }
   getLabels(){
     const {data,showArr,saveText,selecteds} = this.props;
-    let arr = [],list=[];
+    let arr = [],list=[];//console.log(data,saveText)
     const {boxMark,showAll} = this.state;
-    const showData = showAll?[...data]:[...data].splice(0,config.showCheckNum*2+1);
+    let showArray = data.filter((it)=>{
+      if(it.showInCheck)
+        return it;
+    });
+    const showData = this.props.showAll||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{
@@ -89,6 +93,14 @@ class CheckBody extends Component{
     //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
     if(hasMain&&isEmpty!=false){
       this.props.getInit();
+      //隐藏区域有默认选中项,默认全部展开-有延迟,弃用
+      /*const that = this;
+      setTimeout(function(){
+        that.props.showAll&&that.setState({
+          showAll:true
+        });
+      },900)*/
+
     }
   }
   showHide(){
@@ -107,8 +119,8 @@ class CheckBody extends Component{
     const {searchData,totalHide,data,boxLeft,boxTop,saveText} = this.props;
     const {showAll} = this.state;
     const moreNum =config.showCheckNum*2+1;
-    const moreText = filterDataArr([...saveText].splice(moreNum));
-    const more = showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
+    const moreText = filterDataArr([...saveText].splice(moreNum));      //被收起的标签中是否有有值得,有则不能再收起
+    const more = this.props.showAll||showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
     const showMoreBtn = data.length>moreNum&&!moreText;
     return  <div className={style['container']}>
       <ItemBox title='查体' handleClick={this.handleClick}>

+ 1 - 0
src/components/DiagResultSearch/index.less

@@ -42,6 +42,7 @@
 
 .search-result {
     max-height: 266px;
+    overflow-y: auto;
 }
 
 .search-result-item {

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

@@ -41,7 +41,7 @@ class Diagnosis extends Component {
     render() {
         
         
-        return (<div>
+        return (<div id="diagnosisResult">
             <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
                 <DiagnosticList></DiagnosticList>
                 <div style={{marginLeft:'10px', position:'relative'}}>

+ 22 - 20
src/components/DiagnosticItem/index.jsx

@@ -30,10 +30,10 @@ class DiagnosticItem extends Component{
         this.addDiagodal(diagType)
     }
     close(){
-            this.setState({
-                visible: false
-            })
-        }
+        this.setState({
+            visible: false
+        })
+    }
     chooseDiagodal(item) {
         const { diagnosticList,getTips } = this.props;
         getTips && getTips(item);
@@ -62,28 +62,29 @@ class DiagnosticItem extends Component{
                 //         return
                 //     }
                 // }
-                isChronicMag(item);
-                // 从缓存取慢病列表
-                let chronicList = JSON.parse(storageLocal.get('chronic'));
-                if(!chronicList){
-                    getChronic();
-                    chronicList = JSON.parse(storageLocal.get('chronic'));
-                }
-                console.log(999,chronicList)
-                // 判断是否为慢病复诊 且页面为空 才走慢病流程
-                for(let i=0; i<chronicList.length; i++){
-                    if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
-                        //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
-                        // 是--引用   
-                        //否--判断页面是否为空--空->走慢病流程,获取慢病模板;
-                        console.log("是慢病!")
-                    }
+                if(item.type == 2) {
+                    isChronicMag(item);
                 }
+                // 从缓存取慢病列表
+                // let chronicList = JSON.parse(storageLocal.get('chronic'));
+                // if(!chronicList){
+                //     getChronic();
+                //     chronicList = JSON.parse(storageLocal.get('chronic'));
+                // }
+                // console.log(999,chronicList)
+                // for(let i=0; i<chronicList.length; i++){
+                //     if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                //         //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
+                //         // 是--引用   否--走慢病流程
+                //         console.log("是慢病!")
+                //     }
+                // }
                 addDiagnostic&&addDiagnostic(item);
                 clearInput&&clearInput();
                 hideSearch&&hideSearch()
         //     })
         // }, 0)
+        document.getElementById("diagnosisResult").scrollIntoView(true)
     }
 
     render(){
@@ -98,6 +99,7 @@ class DiagnosticItem extends Component{
                     <ConfirmModal visible={visible} okText='初诊' cancelText='复诊' confirm={this.confirm}  cancel={this.cancel} close={this.close}>
                         <div className={style['confirm-info']}>确定选择“{item.name}”为</div> 
                     </ConfirmModal>
+                   
                 </span>)
     }
 }

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

@@ -20,6 +20,8 @@ class DiagnosticList extends Component {
         this.close = this.close.bind(this);
         this.showTreat = this.showTreat.bind(this);
         this.handleClickDiag = this.handleClickDiag.bind(this);
+        this.referRecord = this.referRecord.bind(this);
+        this.noReferRecord = this.noReferRecord.bind(this);
     }
 
     componentWillReceiveProps(nextprops) {
@@ -75,10 +77,19 @@ class DiagnosticList extends Component {
         const { getTips } = this.props;
         getTips && getTips(item);
     }
+    referRecord() {
+        const { hideReferRecord } = this.props
+        hideReferRecord && hideReferRecord()
+    }
+    noReferRecord() {
+        const { hideReferRecord } = this.props
+        hideReferRecord && hideReferRecord()
+    }
+    
     
 
     render(){
-        const { list, treatment } = this.props
+        const { list, treatment, showReferRecord } = this.props
         const { visible, treatTitle } = this.state
         const lastIndex = list.length -1;
         return(
@@ -109,6 +120,9 @@ class DiagnosticList extends Component {
                                   >
                                   <div className={style['del-msg']}>是否删除该诊断?</div> 
                     </ConfirmModal>
+                    <ConfirmModal visible={showReferRecord} okText='是' cancelText='否' confirm={this.referRecord}  cancel={this.noReferRecord} close={this.noReferRecord}>
+                        <div className={style['confirm-info']}>是否引用往期病历</div> 
+                    </ConfirmModal>
                 </div>
                
             

+ 7 - 0
src/components/DiagnosticList/index.less

@@ -101,4 +101,11 @@
 .diag-up, .diag-down, .diag-del {
     width: 20px;
     margin-bottom: 4px;
+}
+.confirm-info {
+    height: 70px;
+    font-size: 16px;
+    line-height: 16px;
+    text-align: center;
+    padding: 10px 30px;
 }

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

@@ -141,7 +141,7 @@ class Inspect extends React.Component {
         </ul>
     }
     render() {
-        const {fetchPushInfos, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList,delPartItem } = this.props;
+        const {fetchPushInfos, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList,delPartItem,inspectList } = this.props;
         const {ieVersion,isIE} = this.state;
         return (
             <div className={styles.wrapper} >
@@ -177,6 +177,7 @@ class Inspect extends React.Component {
                             handleCloseExcel={handleCloseExcel}
                             labelListActive={labelListActive}
                             delPartItem={delPartItem}
+                            inspectList={inspectList}
                         >
                         </AddInspect>
                     </div>

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

@@ -97,7 +97,6 @@ class NumberDrop extends Component{
   }
   handleNumClick(e){     //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
-    this.$span.current.focus();
     if(show) {
       handleHide && handleHide();
       return;
@@ -111,6 +110,7 @@ class NumberDrop extends Component{
       clearTimeout(that.state.timer);
       const timer = setTimeout(function(){
         //只有弹窗关闭则点击数字键盘会清空当前数据
+        that.$span.current.focus();
         that.setState({
           hasSelect:false
         });
@@ -138,6 +138,7 @@ class NumberDrop extends Component{
     if(show){      //修改清空后第一次点击键盘不触发click事件bug
       return;
     }
+    //输入超出合理范围提示且清空
     const txt = e.target.innerText.replace(/^\s*/,'');
     if(max!=undefined&&!isNaN(+txt)&&(min>+txt||max<+txt)){
       this.beyondArea();

+ 23 - 5
src/components/PushItems/index.jsx

@@ -14,8 +14,8 @@ import store from "@store";
 import { getWindowInnerHeight } from "@common/js/func";
 import {addLabel} from '@store/actions/inspect';
 import {addAssistLabel} from '@store/actions/assistCheck';
-import {getTableList} from '@store/async-actions/pushMessage';
 import {windowEventHandler} from '@utils/tools'
+import {ConfirmModal} from '@commonComp';
 
 class PushItems extends Component {
   constructor(props) {
@@ -34,6 +34,8 @@ class PushItems extends Component {
     this.showTips = this.showTips.bind(this);
     this.hideTips = this.hideTips.bind(this);
     this.showTableList = this.showTableList.bind(this);
+    this.confirm = this.confirm.bind(this);
+    this.close = this.close.bind(this);
     this.$cont = React.createRef();
   }
 
@@ -134,8 +136,16 @@ class PushItems extends Component {
     hideTipsDetailsModal && hideTipsDetailsModal()
   }
   showTableList(item){
-    console.log("量表",item);
-    getTableList(item.id);
+    const {chronicMagItem,getTableList} = this.props;
+    getTableList(chronicMagItem.id);
+  }
+  confirm(){
+    const {hideList} = this.props;
+    hideList&&hideList();
+  }
+  close(){
+    const {hideList} = this.props;
+    hideList&&hideList();
   }
   componentDidMount() {
     const height = getWindowInnerHeight() - 200;
@@ -159,7 +169,7 @@ class PushItems extends Component {
       showTipsDetails,
       tipsDetails
     } = this.props.pushMessage;
-    const { tipsDiscalimer } = this.props;
+    const { tipsDiscalimer,tableList ,showList} = this.props;
     const { moreAssay, moreCheck } = this.state;
     const {
       showMore,
@@ -489,7 +499,15 @@ class PushItems extends Component {
             showTipsDetails = {showTipsDetails}
             hideTips = {this.hideTips}
             tipsDetails = {tipsDetails}/>}
-        
+        <ConfirmModal visible={showList} okText='确定' cancelText='' confirm={this.confirm} close={this.close}>
+            {/*<div className={style['confirm-info']}>确定选择“{item.name}”为</div>*/}
+            <div>
+              {tableList&&tableList.map((v,i)=>{
+                return <label><input type="radio" name="chronic" />{v.name}</label>
+              })}
+            </div>
+             
+        </ConfirmModal>
       </div>
     );
   }

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

@@ -228,7 +228,7 @@ class SpreadDrop extends Component{
       const tIndex= exists.findIndex((it)=>it.questionId===item.questionId);
       const bIndex= withs.findIndex((it)=>it.questionId===item.questionId);
       if(tIndex!=-1){
-        exists.splice(tIndex,1,item);
+        exists.splice(tIndex,1,Object.assign({},item,{name}));    //修改单选列连接字符不显示bug
         this.setState({
           exists,
         })

+ 2 - 1
src/config/index.js

@@ -44,5 +44,6 @@ export default {
     },
     showCheckNum:16,        //查体默认展开非自由文本标签的个数
     radioOptionPer:'()',     //单选项输入占位符
-    Params
+    textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
+  Params
 };

+ 3 - 2
src/containers/AssistCheck.js

@@ -14,6 +14,7 @@ function mapStateToProps(state) {//console.log(state.assistCheck)
         assistLabel:state.assistCheck.assistLabel,
         isRead:state.homePage.isRead,
         winWidth:state.homePage.windowWidth,
+        assistList:state.homePage.assistList,
     }
 }
 
@@ -22,8 +23,8 @@ function mapDispatchToProps(dispatch, store) {
         handleChangeValue(val) {
             dispatch(getSearchList(val))
         },
-        handleSign(id,idx){
-            dispatch(assistLable(id,idx))
+        handleSign(id,idx,type){
+            dispatch(assistLable(id,idx,type))
         },
         handleDelAssist(idx){
             dispatch(delAssistLabel(idx))

+ 1 - 0
src/containers/CheckBody.js

@@ -11,6 +11,7 @@ function mapStateToProps(state){
   const hasMain = filterDataArr(mainSuit.saveText);//||mainSuit.data.length;
   return {
     data:checkBody.data,
+    showAll:checkBody.showAll,
     isEmpty:checkBody.isEmpty,
     update:checkBody.update,   //用于触发更新
     showArr:homePage.showDrop,

+ 8 - 2
src/containers/DiagnosticList.js

@@ -1,7 +1,7 @@
 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 } from '@store/types/diagnosticList'; 
+import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD } from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT } from '../store/types/treat';
 import {billing, getTips} from '../store/async-actions/pushMessage';
@@ -13,7 +13,8 @@ function mapStateToProps(state) {
         list: state.diagnosticList.diagnosticList,
         treatment: state.treat.show,
         isFirst: state.diagnosticList.isFirst,
-        diagnosticStr: state.diagnosticList.diagnosticStr
+        diagnosticStr: state.diagnosticList.diagnosticStr,
+        showReferRecord: state.diagnosticList.showReferRecord,
     }
 }
 
@@ -62,6 +63,11 @@ function mapDispatchToProps(dispatch) {
         },
         getBilling: () => {
             dispatch(billing())
+        },
+        hideReferRecord: ()=>{
+            dispatch({
+                type: HIDE_REFER_RECORD
+            })
         }
     }
 }

+ 3 - 2
src/containers/Inspect.js

@@ -11,6 +11,7 @@ function mapStateToProps(state) {
         fillActive:state.inspect.fillActive,
         getExcelDataList:state.inspect.getExcelDataList,
         labelListActive:state.inspect.labelListActive,
+        inspectList:state.homePage.inspectList,
     }
 }
 
@@ -19,8 +20,8 @@ function mapDispatchToProps(dispatch, store) {
         handleChangeValue(val){
             dispatch(getSearchList(val))
         },
-        handleSign(id,idx){
-            dispatch(setLabel(idx))
+        handleSign(id,idx,type){
+            dispatch(setLabel(idx,type))
             dispatch(getSublableList(id))
         },
         handleLabelSub(e,id,idx){

+ 13 - 3
src/containers/PushItemsContainer.js

@@ -1,15 +1,18 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import PushItems from '../components/PushItems'
-import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS} from '@store/types/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS,SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList';
-import {billing, getTips, getTipsDetails} from '../store/async-actions/pushMessage';
+import {billing, getTips, getTipsDetails,getTableList} from '../store/async-actions/pushMessage';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
 function mapStateToProps(state) {
         return {
         pushMessage: state.pushMessage,
-        tipsDiscalimer:  state.copyRight.disContent
+        tipsDiscalimer:  state.copyRight.disContent,
+        chronicMagItem: state.diagnosticList.chronicMagItem,
+        tableList: state.pushMessage.tableList,
+        showList: state.pushMessage.showList,
     }
 }
 
@@ -55,6 +58,13 @@ function mapDispatchToProps(dispatch) {
             dispatch({
                 type: HIDE_TIPS_DETAILS
             })
+        },
+        getTableList(id){
+            dispatch(getTableList(id))
+            dispatch({type:SHOW_TABLE_LIST})
+        },
+        hideList(){
+            dispatch({type:HIDE_TABLE_LIST})
         }
     }
 }

+ 9 - 5
src/containers/SpreadDrop.js

@@ -136,7 +136,7 @@ function currentIll(dispatch,store,params){
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   // const ids = existsId.join(",")+withsId.join(",");
-  const ids = (existsId.concat(withsId)).join(",");console.log("点击的下标是:",index,"选中的id是:",ids)
+  const ids = (existsId.concat(withsId)).join(",");
   let has = [],wes=[];
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
@@ -309,7 +309,8 @@ function mainSuitCheck(dispatch,store,params){
   let ikey = getLabelIndex(index);
   dispatch({
     type: COMM_CONFIRM,
-    data: {exists:exists,existsName:existsName,ikey}
+    // data: {exists:exists,existsName:existsName,ikey}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   });
   dispatch({//隐藏下拉
     type:HIDEDROP
@@ -324,7 +325,8 @@ function currentCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETMAINCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 
@@ -337,7 +339,8 @@ function checkBodyCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 //其他史普通多选确定
@@ -348,7 +351,8 @@ function otherHisCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETOTHERCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 

+ 3 - 2
src/store/actions/assistCheck.js

@@ -4,10 +4,11 @@ export const searchList = (list) => ({         //获取搜索数据
     type:GET_ASSIST_SEARCH_LIST,
     list
 })
-export const assistLable = (id,idx) => ({         //添加数据
+export const assistLable = (id,idx,sign) => ({         //添加数据
     type:GET_ASSIST_LABEL,
     id,
-    idx
+    idx,
+    sign
 })
 export const addAssistLabel = (lis) => ({         //右侧推送交到左侧
     type:ADD_ASSIST_LABEL,

+ 13 - 5
src/store/actions/checkBody.js

@@ -4,8 +4,10 @@ import {getLabelIndex,fullfillText} from '@common/js/func.js';
 export function set(state,action){
   let res = Object.assign({},state);
   const {data} = action;
+  const obj = fullfillText(data,false,false,false);
   res.data = [...data];
-  res.saveText = fullfillText(res.data).saveText;//存逗号
+  res.saveText = obj.saveText;//存逗号
+  res.showAll = obj.checkHiddenDefault;
   res.update = Math.random();
   res.isEmpty = action.isEmpty;
   return res;
@@ -228,8 +230,8 @@ export function setCheckText(state,action) {
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
@@ -254,11 +256,17 @@ export function setSearchData(state,action){
 //插入标签数据-搜索
 export function insertLabelData(state,action){
   let res = Object.assign({},state);
-  const text = Object.assign({},JSON.parse(config.textLabel));
   const searchStr = res.searchStr;
   const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
-  const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  let tempLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  //查体中,默认显示区域搜索出来的标签要默认显示,隐藏区域搜索出的默认隐藏
+  let hideAreaIndex = [...res.data].reverse().findIndex((it)=>it.showInCheck);
+  hideAreaIndex = res.data.length-hideAreaIndex-1;        //默认显示的最后一个标签的位置
+  const text = Object.assign({},JSON.parse(config.textLabel),{showInCheck:index>hideAreaIndex?false:true});
+  let spreadLabels =tempLabels.map((it)=>{
+    return Object.assign({},it,{showInCheck:index>hideAreaIndex?false:true});
+  });
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||'';
   if(!isReplace){

+ 29 - 24
src/store/actions/currentIll.js

@@ -63,12 +63,10 @@ export const setData = (state,action) =>{
   res.symptomIds = JSON.parse(JSON.stringify(mainIds));
   const num = action.info.num;//点击了几次添加病情变化
   const symptomFeature = action.info.symptomFeature;//分词
-  // const useEmpty = action.info.useEmpty;
   let useEmpty,mainData;
-  // let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
-  let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
+  // let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
   let current = JSON.parse(JSON.stringify(moduleData));
   let newMain = [];
   let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
@@ -102,7 +100,7 @@ export const setData = (state,action) =>{
     })
     useEmpty = existData&&existData.length>0?false:true;
   }
-  // console.log(888,useEmpty);
+  
   if (useEmpty) {
     // res.data = res.emptyData;
     res.data = JSON.parse(JSON.stringify(res.emptyData));
@@ -137,12 +135,8 @@ export const setData = (state,action) =>{
       // 主症状添加tongYong标签选中文字
       let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
       let mainCopy = JSON.parse(JSON.stringify(main));
-      /*if(tongYText){
-        for(let j=0; j<mainCopy.length; j++){
-          mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
-          mainCopy[j].value = tongYong + (mainCopy[j].value).replace('、',"");
-        }
-      }*/
+      let manInput = [];
+      // 去掉主诉添加的顿号 
       for(let j=0; j<mainCopy.length; j++){
         if(tongYText){
           mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
@@ -150,11 +144,18 @@ export const setData = (state,action) =>{
         }else{
           mainCopy[j].name = (mainCopy[j].name).replace('、',"");
           mainCopy[j].value = (mainCopy[j].value).replace('、',"");
+        }  
+        //查询是否有手动输入--输入的内容放到最后(3-27)
+        if(mainCopy[j].name != mainCopy[j].value){
+          const inputText = mainCopy[j].value.replace(mainCopy[j].name,"");
+          const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+          if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+             manInput.push(textObj);
+          }
+          mainCopy[j].value = mainCopy[j].name;
         }
-        
       }
 
-
        // 将ids接口获取到的模板匹配到对应主症状后面
       // 主症状
       let newMainCopy = JSON.parse(JSON.stringify(mainCopy));
@@ -193,15 +194,20 @@ export const setData = (state,action) =>{
       }
       // 伴随
       // 去掉顿号
-     /* for(let b=0; b<withs.length; b++){
-        withs[b].name = withs[b].name.replace('、',"");
-      }*/
-      // let newWiths = JSON.parse(JSON.stringify(withs));
       let newWiths = [];
+      let manWithInput = [];
       if(withs.length>0){
         for(let b=0; b<withs.length; b++){
           withs[b].name = withs[b].name.replace('、',"");
           withs[b].value = withs[b].value.replace('、',"");
+          if(withs[b].name != withs[b].value){
+            const inputText = withs[b].value.replace(withs[b].name,"");
+            const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+            if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+              manWithInput.push(textObj);
+            }           
+            withs[b].value = withs[b].name;  
+          }
         }
         newWiths = JSON.parse(JSON.stringify(withs));
         let withInd = 0;
@@ -237,7 +243,7 @@ export const setData = (state,action) =>{
         }
       }
       
-      let symptomArr = newMainCopy.concat(newWiths);
+      let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
       let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));  
       //组装好的主症状和伴随症状插入现病史模板(flag=4前)
       let insertIdx = null;
@@ -363,16 +369,15 @@ export const confirm = (state,action) =>{
 //普通多选确定事件-主诉通用特征、初为后为等
 export const setCheckBox = (state,action)=>{
   const res = Object.assign({},state);
-  const {exists,labelInx,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
-  let arr = res.data;
-  arr[labelInx].value = names;
-  res.saveText[labelInx] = names;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   return res;

+ 18 - 0
src/store/actions/diagnosticList.js

@@ -81,4 +81,22 @@ export const setClickDiag = (state, action) => {
     const res = Object.assign({}, state);
     res.clickDiag = action.clickDiag
     return res;
+}
+
+export const setChronicMagItem = (state, action) => {
+    const res = Object.assign({}, state);
+    res.chronicMagItem = action.chronicMagItem;
+    return res;
+}
+
+export const showReferRecord = (state, action) => {
+    const res = Object.assign({}, state);
+    res.showReferRecord = true
+    return res;
+}
+
+export const hideReferRecord = (state, action) => {
+    const res = Object.assign({}, state);
+    res.showReferRecord = false
+    return res;
 }

+ 10 - 0
src/store/actions/homePage.js

@@ -100,3 +100,13 @@ export const searchDropLocation = (state,action)=>{
   res.boxLeft = action.left?action.left+action.dis:res.left;
   return res;
 };
+export const getInspectList = (state,action)=>{
+  let res = Object.assign({},state);
+  res.inspectList = action.data
+  return res;
+};
+export const getAssistList = (state,action)=>{
+  let res = Object.assign({},state);
+  res.assistList = action.data
+  return res;
+};

+ 3 - 2
src/store/actions/inspect.js

@@ -5,9 +5,10 @@ export const searchList = (list) => ({         //初始化数据
     list
 })
 
-export const setLabel = (idx) => ({          //搜索后点击选中的结果
+export const setLabel = (idx,sign) => ({          //搜索后点击选中的结果
     type:SET_LABEL,
-    idx
+    idx,
+    sign
 })
 export const addLabel = (lis) => ({          //右侧开单
     type:ADD_LABEL,

+ 7 - 8
src/store/actions/mainSuit.js

@@ -264,17 +264,16 @@ export const confirm = (state,action) =>{
 // 普通多选确定事件
 export const commConfirm=(state,action)=>{
   const res = Object.assign({},state);
-  const {exists,ikey,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
-  let arr = res.data;
-  arr[ikey].value = names;
-  res.saveText[ikey] = names;
-  res.selecteds[ikey] = action.data;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
+  res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   return res;
 }

+ 4 - 4
src/store/actions/otherHistory.js

@@ -196,10 +196,10 @@ export function setOtherInput(state,action){
 
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
-  let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const res = Object.assign({},state);
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
     showText = showText.substr(0,showText.length-1);
@@ -207,7 +207,7 @@ export function setCheckBoxValue(state,action) {
   res.data[labelInx].value = showText;
   res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
-  res.update = Math.random();
+  res.update=Math.random();
   return res;
 }
 //搜索结果

+ 33 - 12
src/store/async-actions/diagnosticList.js

@@ -1,4 +1,4 @@
-import { SET_DIAG_TO_MAINSUIT } from '@store/types/diagnosticList';
+import { SET_DIAG_TO_MAINSUIT, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD } from '@store/types/diagnosticList';
 import {getAllDataList,getAllDataStringList,isAllClear,filterDataArr} from '@utils/tools';
 import {getChronic} from '@store/async-actions/homePage.js';
 import {storageLocal} from '@utils/tools'
@@ -38,21 +38,42 @@ export const isChronicMag = (item) => {
         let jsonStr = getAllDataStringList(state);
         let flg = isAllClear(jsonData,jsonStr,state);
         if(!flg) {
-            console.log('页面为空');
              // 从缓存取慢病列表
              let chronicList = JSON.parse(storageLocal.get('chronic'));
              if(!chronicList){
-                 getChronic();
-                 chronicList = JSON.parse(storageLocal.get('chronic'));
-             }
-             console.log(999,chronicList)
-             for(let i=0; i<chronicList.length; i++){
-                 if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
-                     //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
-                     // 是--引用   否--走慢病流程
-                     console.log("是慢病1111!")
-                 }
+                 getChronic().then(() =>{
+                    chronicList = JSON.parse(storageLocal.get('chronic'));
+                    for(let i=0; i<chronicList.length; i++){
+                        if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                            //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
+                            // 是--引用   否--走慢病流程
+                            dispatch({
+                                type: SET_CHRONIC_MAG_ITEM,
+                                chronicMagItem: item
+                            })
+                            dispatch({
+                                type: SHOW_REFER_RECORD
+                            })
+                        }
+                    }
+                 });
+             } else {
+                // console.log(999,chronicList)
+                for(let i=0; i<chronicList.length; i++){
+                    if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                        //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
+                        // 是--引用   否--走慢病流程
+                        dispatch({
+                            type: SET_CHRONIC_MAG_ITEM,
+                            chronicMagItem: item
+                        })
+                        dispatch({
+                            type: SHOW_REFER_RECORD
+                        })
+                    }
+                }
              }
+             
         }
         
     }

+ 36 - 4
src/store/async-actions/homePage.js

@@ -1,10 +1,11 @@
 import {post,json} from '@utils/ajax.js';
-import {SETINITDATA,MODI_LOADING} from '@store/types/homePage.js';
+import {SETINITDATA,MODI_LOADING,GET_ASSIST_LIST,GET_INSPECT_LIST} from '@store/types/homePage.js';
 import {SET_CURRENT} from '@store/types/currentIll';
 import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
 import store from '@store';
 import {fullfillText} from '@common/js/func';
+import {formatContinueDots} from '@utils/tools';
 import {getOtherHisRecord,getInitData} from '@store/async-actions/fetchModules.js';
 import {initHistoryDetails} from '@store/async-actions/patInfo';
 import {storageLocal} from '@utils/tools';
@@ -12,7 +13,8 @@ import {storageLocal} from '@utils/tools';
 const api = {
   getModules:'/api/icss/moduleInfo/getAll',
   clickCount:'/api/icss/buriedSomeStatistical/saveBuriedSomeStatisticals', //埋点统计
-  getChronic:'/api/icss/disType/getDisType' //慢病列表
+  getChronic:'/api/icss/disType/getDisType', //慢病列表
+  getQuestionUsual:'/api/icss/questionUsual/getQuestionUsual' //化验常用标签
 };
 
 function modulesParseJson(data){
@@ -20,7 +22,7 @@ function modulesParseJson(data){
   data.map((it)=>{
     moduleName[config.moduleCP[it.id]] = it.name;//添加病情变化/病程变化子模板需要使用模板名称
     obj = fullfillText(it.moduleDetailDTOList);
-    json[config.moduleCP[it.id]] = obj.newArr;
+    json[config.moduleCP[it.id]] = formatContinueDots(obj.newArr);
     saveTextJson[config.moduleCP[it.id]] = obj.saveText;
   });
   return {json,saveTextJson,moduleName};
@@ -102,11 +104,41 @@ export const getChronic = (dispatch,getState)=>{
  return json(api.getChronic,{}).then((res) => {
     const result = res.data;
     if (result.code == '0') {
-      console.log("请求成功",result);
       const chronic = JSON.stringify(result.data.chronic);
       storageLocal.set('chronic',chronic);
     }else{
       console.log("请求失败",res);
     } 
   }) 
+}
+// 请求化验辅检常用标签
+export const getCommonList = (val)=>{
+  return (dispatch,getState) => {
+    const state = getState();
+    const patientInfo = state.patInfo.message;
+    const params = {
+      "age":patientInfo.patientAge ,   //年龄
+      "deptId": patientInfo.hospitalDeptId,       //科室id
+      "sexType": patientInfo.sex,        //性别
+      "type": val
+    }
+    json(api.getQuestionUsual,params).then((res) => {
+      const result = res.data;
+      if (result.code == '0') {
+        if(val == 5){
+          dispatch({
+            type:GET_INSPECT_LIST,
+            data:result.data
+          })
+        }else{
+          dispatch({
+            type:GET_ASSIST_LIST,
+            data:result.data
+          })
+        }
+      }else{
+        console.log("请求失败",res);
+      }
+    }) 
+  }
 }

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

@@ -3,7 +3,7 @@ import {GET_PATIENT_MESSAGE} from "../types/patInfo";
 import {CONFIRM_TYPE} from "../types/typeConfig";
 import {getInfos} from '@store/actions/getInfoByUuid';
 import {getUrlArgObject,pushAllDataList} from '@utils/tools';
-import {getInitModules} from '@store/async-actions/homePage.js';
+import {getInitModules,getCommonList} from '@store/async-actions/homePage.js';
 import store from '@store'
 import {ISREAD,MODI_LOADING} from "../types/homePage";
 import { initItemList } from '@store/async-actions/tabTemplate';
@@ -99,6 +99,8 @@ export const getPatientMessage = (dispatch, getState) => {
         confirmType:data1.modeValue
       });
       dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
+      dispatch(getCommonList(5));     //获取常用化验标签列表
+      dispatch(getCommonList(6));     //获取常用辅检标签列表
       // if(state.tabTemplate.items.length == 0){
       //   dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
       // }

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

@@ -121,7 +121,7 @@ export const getTipsDetails = () => {
     }
 }
 
-export const getTableList = (id)=>{console.log("疾病ID:",id)
+export const getTableList = (id)=>{
     return (dispatch,getState)=>{
         json(api.getTableList, {disId:id})
         .then((res)=>{

+ 8 - 2
src/store/reducers/assistCheck.js

@@ -7,7 +7,7 @@ import {
     CLEAR_ASSIST_DATA,
     ADD_ASSIST_LABEL
 } from '../types/assistCheck';
-
+import store from '@store';
 const initSearchList = {
     list: [], //点击的结果
     assistLabel: [], //搜索的结果
@@ -48,9 +48,15 @@ export default (state = initSearchList, action) => {
     }
     if (action.type == GET_ASSIST_LABEL) {             //默认
         const newState = Object.assign({}, state);
-        const tempArr = newState.list;
         const tempArrs = newState.assistLabel;
+        let tempArr = [];
         let tmpString = '';
+        if(action.sign == 'common'){
+          let tmpAssistList = store.getState().homePage.assistList
+          tempArr = tmpAssistList;
+        }else{
+          tempArr = newState.list
+        }
         for (let i = 0; i < tempArr.length; i++) {
             if (tempArr[i].questionId == action.id && i == action.idx) {
                 tempArr[i].time = getCurrentDate();

+ 10 - 2
src/store/reducers/diagnosticList.js

@@ -1,5 +1,7 @@
-import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, SET_TREAT, GET_DIAGNOSTIC_STR, SET_DIAG_TO_MAINSUIT, GET_IS_FIRST,CLEAR_ALL_DIAG, SET_CLICK_DIAG ,CLEAR_DIAGNOSE} from '../types/diagnosticList';
-import { addDiagnostic,  delDiagnostic, upDiagnostic, downDiagnostic, setTreat, getDiagnosticStr, setDiagToMainSuit, getIsFirst,clearAllDiag, setClickDiag} from '../actions/diagnosticList';
+import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, SET_TREAT, GET_DIAGNOSTIC_STR, SET_DIAG_TO_MAINSUIT, 
+            GET_IS_FIRST,CLEAR_ALL_DIAG, SET_CLICK_DIAG ,CLEAR_DIAGNOSE, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD, HIDE_REFER_RECORD} from '../types/diagnosticList';
+import { addDiagnostic,  delDiagnostic, upDiagnostic, downDiagnostic, setTreat, getDiagnosticStr, setDiagToMainSuit, 
+        getIsFirst,clearAllDiag, setClickDiag, setChronicMagItem, showReferRecord, hideReferRecord} from '../actions/diagnosticList';
 
 const initState = {
     isFirst: true,
@@ -58,6 +60,12 @@ export default function (state=initState, action) {
             return clearAllDiag(state, action);
         case SET_CLICK_DIAG: 
             return setClickDiag(state, action);
+        case SET_CHRONIC_MAG_ITEM:
+            return setChronicMagItem(state, action);
+        case SHOW_REFER_RECORD: 
+            return showReferRecord(state, action);
+        case HIDE_REFER_RECORD: 
+        return hideReferRecord(state, action);
         case CLEAR_DIAGNOSE: 
             res.mainSuitStr = "";
             return res;

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

@@ -1,6 +1,6 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,SEARCH_DROP_LOCATION} from '../types/homePage.js';
-import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,searchDropLocation} from '../actions/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,SEARCH_DROP_LOCATION,GET_INSPECT_LIST,GET_ASSIST_LIST} from '../types/homePage.js';
+import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,searchDropLocation,getInspectList,getAssistList} from '../actions/homePage.js';
 import SearchDrop from '../../components/SearchDrop/index.jsx';
 
 const initState = {
@@ -13,7 +13,9 @@ const initState = {
   commSymHide:false,
   loadingFlag:true,
   boxTop:0,
-  boxLeft:0
+  boxLeft:0,
+  assistList:[],
+  inspectList:[],
 };
 
 export default function (state=initState,action) {
@@ -65,6 +67,10 @@ export default function (state=initState,action) {
       return res;
     case SEARCH_DROP_LOCATION:
       return searchDropLocation(state,action);
+    case GET_INSPECT_LIST:
+      return getInspectList(state,action);
+    case GET_ASSIST_LIST:
+      return getAssistList(state,action);
     default:
       return res;
   }

+ 8 - 2
src/store/reducers/inspect.js

@@ -11,7 +11,7 @@ import {
     DEL_EXCEL_LIST,
     ADD_LABEL
 } from '../types/inspect';
-
+import store from '@store'
 const initSearchList = {
     list: [], //搜索的结果
     labelList: [], //选中的结果,也是需要保存的数据
@@ -33,7 +33,13 @@ export default (state = initSearchList, action) => {
     }
     if (action.type == SET_LABEL) {             //选中的结果    
         const newState = Object.assign({}, state);
-        const tempArr = newState.list;
+        let tempArr = [];
+        if(action.sign == 'common'){
+          let tmpInspectList = store.getState().homePage.inspectList
+          tempArr = tmpInspectList;
+        }else{
+          tempArr = newState.list
+        }
         const tempArrs = newState.labelList;
         for (let i = 0; i < tempArr.length; i++) {
             if (i == action.idx) {

+ 7 - 1
src/store/reducers/pushMessage.js

@@ -1,4 +1,4 @@
-import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST} from '../types/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '../types/pushMessage';
 import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, setCommontreatment, isFirstMainDiag, setAdviceInput } from '../actions/pushMessage';
 
 const initState = {
@@ -57,6 +57,12 @@ export default function(state = initState, action) {
     case SET_CHRONIC_TABLELIST://量表列表数据
       res.tableList = action.data;
       return res;
+    case SHOW_TABLE_LIST://显示量表列表数据
+      res.showList = true;
+      return res;
+    case HIDE_TABLE_LIST://隐藏量表列表数据
+      res.showList = false;
+      return res;
     default:
       return state;
   }

+ 6 - 1
src/store/types/diagnosticList.js

@@ -9,4 +9,9 @@ export const SET_DIAG_TO_MAINSUIT = 'SET_DIAG_TO_MAINSUIT'; //判断第一次添
 export const GET_IS_FIRST = 'GET_IS_FIRST'; //判断是否第一次添加诊断
 export const CLEAR_ALL_DIAG = 'CLEAR_ALL_DIAG'; //清除所有诊断
 export const SET_CLICK_DIAG = 'SET_CLICK_DIAG' //设置点击的诊断,获取提示详情时需要
-export const CLEAR_DIAGNOSE = 'CLEAR_DIAGNOSE' //
+export const CLEAR_DIAGNOSE = 'CLEAR_DIAGNOSE' //
+export const SET_CHRONIC_MAG_ITEM = 'SET_CHRONIC_MAG_ITEM'  //设置慢病信息
+export const SHOW_REFER_RECORD = 'SHOW_REFER_RECORD'  //显示引用历史病历弹窗
+export const HIDE_REFER_RECORD = 'HIDE_REFER_RECORD'  //隐藏引用历史病历弹窗
+
+

+ 3 - 1
src/store/types/homePage.js

@@ -12,4 +12,6 @@ export const ISREAD = 'is_history_or_template';     //是否回读或模板数
 export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
 export const SETMINSCREEN = 'SETMINSCREEN';    //1024标识
 export const MODI_LOADING = 'MODI_LOADING';    //1024标识
-export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识
+export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识
+export const GET_ASSIST_LIST = 'GET_ASSIST_LIST';    //辅检
+export const GET_INSPECT_LIST = 'GET_INSPECT_LIST';    //化验

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

@@ -16,5 +16,7 @@ export const HIDE_TIPS_DETAILS = 'HIDE_TIPS_DETAILS'; //显示提示详情页
 export const SET_COMMONTREATMENT = 'SET_COMMONTREATMENT';    //设置常见治疗
 export const SET_ADVICE_INPUT = 'SET_ADVICE_INPUT' ; //设置医嘱自由输入内容
 export const SET_CHRONIC_TABLELIST = 'SET_CHRONIC_TABLELIST' ; //设置量表列表
+export const SHOW_TABLE_LIST = 'SHOW_TABLE_LIST' ; //显示量表列表
+export const HIDE_TABLE_LIST = 'HIDE_TABLE_LIST' ; //隐藏量表列表
 
 

+ 15 - 4
src/utils/tools.js

@@ -561,6 +561,16 @@ function trimDots(str){
   }).replace(/^[,,.。::"“??”;;、!!]+/,'');
 }
 
+//标签间连续标点只保留一个,保留前面一个
+function formatContinueDots(data){
+  let arr=data.filter((it,i)=>{
+    if(!(it.name==','&&data[i-1].name==',')){
+      return it;
+    }
+  });
+  return arr;
+}
+
 // 取消默认行为
 function preventDefault(event) {
     if (event.preventDefault) {
@@ -696,9 +706,9 @@ function timestampToTime(timestamp) {     //excel导入2019年5月1日会转换
 }
 function getPageLength(event) {     //兼容ie8获取页面距离左和上的距离,包括滚动距离
   let e = event || window.event;
-  let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; 
-  let scrollY = document.documentElement.scrollTop || document.body.scrollTop; 
-  let x = e.pageX || e.clientX + scrollX; 
+  let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
+  let scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+  let x = e.pageX || e.clientX + scrollX;
   let y = e.pageY || e.clientY + scrollY;
   let page = {
     pageX:x,
@@ -736,7 +746,7 @@ function dragBox(domWrap,domDrag){
       }
       if(width-dragX < wrap.offsetWidth){    //不能超出右边界
         dragX = maxDragX
-      } 
+      }
       if(height-dragY < wrap.offsetHeight){     //不能超出下边界
         dragY = maxDragY
       }
@@ -788,4 +798,5 @@ module.exports = {
     timestampToTime,
     getPageLength,
     dragBox,
+    formatContinueDots
 };