소스 검색

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

zhangxc 6 년 전
부모
커밋
bdf7ba61e6
34개의 변경된 파일749개의 추가작업 그리고 553개의 파일을 삭제
  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. 1 0
      src/components/DiagnosticItem/index.jsx
  13. 2 1
      src/components/Inspect/index.jsx
  14. 2 1
      src/components/NumberDrop/index.jsx
  15. 1 1
      src/components/SpreadDrop/index.jsx
  16. 2 1
      src/config/index.js
  17. 3 2
      src/containers/AssistCheck.js
  18. 1 0
      src/containers/CheckBody.js
  19. 3 2
      src/containers/Inspect.js
  20. 9 5
      src/containers/SpreadDrop.js
  21. 3 2
      src/store/actions/assistCheck.js
  22. 13 5
      src/store/actions/checkBody.js
  23. 29 24
      src/store/actions/currentIll.js
  24. 10 0
      src/store/actions/homePage.js
  25. 3 2
      src/store/actions/inspect.js
  26. 7 8
      src/store/actions/mainSuit.js
  27. 4 4
      src/store/actions/otherHistory.js
  28. 39 5
      src/store/async-actions/homePage.js
  29. 3 1
      src/store/async-actions/patInfo.js
  30. 8 2
      src/store/reducers/assistCheck.js
  31. 9 3
      src/store/reducers/homePage.js
  32. 8 2
      src/store/reducers/inspect.js
  33. 3 1
      src/store/types/homePage.js
  34. 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'}}>

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

@@ -84,6 +84,7 @@ class DiagnosticItem extends Component{
                 hideSearch&&hideSearch()
         //     })
         // }, 0)
+        document.getElementById("diagnosisResult").scrollIntoView(true)
     }
 
     render(){

+ 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();

+ 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,

+ 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){

+ 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;

+ 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;
 }
 //搜索结果

+ 39 - 5
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};
@@ -29,11 +31,12 @@ function modulesParseJson(data){
 export const getInitModules= (dispatch,getStore)=>{
   const state = getStore();
   const {message} = state.patInfo;
+  const chronicId = '';//诊断为慢病复诊时储存慢病信息到store
   const param = {
     age:message.patientAge,
     sexType:message.sex,
-    mouduleType:1,//慢病2  科室1 其他0
-    relationId:message.hospitalDeptId, //慢病id  科室id  其他0
+    mouduleType:chronicId?2:(message.hospitalDeptId?1:0),//慢病2  科室1 其他0
+    relationId:chronicId?chronicId:(message.hospitalDeptId?message.hospitalDeptId:0), //慢病id  科室id  其他0
   }
   // return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
   return json(api.getModules,param).then((res) => {
@@ -108,4 +111,35 @@ export const getChronic = (dispatch,getState)=>{
       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));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
       // }

+ 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();

+ 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) {

+ 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';    //化验

+ 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
 };