Browse Source

新增文件

luolei 4 years ago
parent
commit
afee59cc47
32 changed files with 22295 additions and 0 deletions
  1. 75 0
      src/components/AddNewInspect/InspectName/index.jsx
  2. 256 0
      src/components/AddNewInspect/InspectName/index.less
  3. 99 0
      src/components/AddNewInspect/SlideExcel/index.jsx
  4. 199 0
      src/components/AddNewInspect/SlideExcel/index.less
  5. 185 0
      src/components/AddNewInspect/SlidePic/index.jsx
  6. 258 0
      src/components/AddNewInspect/SlidePic/index.less
  7. 255 0
      src/components/AddNewInspect/SlideSelect/index.jsx
  8. 234 0
      src/components/AddNewInspect/SlideSelect/index.less
  9. BIN
      src/components/AddNewInspect/img/close.png
  10. BIN
      src/components/AddNewInspect/img/date1.png
  11. BIN
      src/components/AddNewInspect/img/date2.png
  12. BIN
      src/components/AddNewInspect/img/info2.png
  13. BIN
      src/components/AddNewInspect/img/info3.png
  14. 397 0
      src/components/AddNewInspect/index.jsx
  15. 260 0
      src/components/AddNewInspect/index.less
  16. BIN
      src/components/NewAdvice/dists/FileAPI.flash.camera.swf
  17. BIN
      src/components/NewAdvice/dists/FileAPI.flash.image.swf
  18. BIN
      src/components/NewAdvice/dists/FileAPI.flash.swf
  19. 3608 0
      src/components/NewAdvice/dists/FileAPI.html5.js
  20. 2 0
      src/components/NewAdvice/dists/FileAPI.html5.min.js
  21. 4418 0
      src/components/NewAdvice/dists/FileAPI.js
  22. 2 0
      src/components/NewAdvice/dists/FileAPI.min.js
  23. 11008 0
      src/components/NewAdvice/dists/jQuery.js
  24. 4 0
      src/components/NewAdvice/dists/jq.js
  25. 2 0
      src/components/NewAdvice/dists/jquery.fileapi.min.js
  26. 357 0
      src/components/NewAdvice/index.jsx
  27. 112 0
      src/components/NewAdvice/index.less
  28. 116 0
      src/containers/NewAdvice.js
  29. 79 0
      src/store/actions/newAdvice.js
  30. 64 0
      src/store/async-actions/newAdvice.js
  31. 288 0
      src/store/reducers/newAdvice.js
  32. 17 0
      src/store/types/newAdvice.js

+ 75 - 0
src/components/AddNewInspect/InspectName/index.jsx

@@ -0,0 +1,75 @@
+import React, { Component } from "react";
+import styles from "./index.less";
+import edit1 from "@common/images/edit1.png";
+import edit2 from "@common/images/edit2.png";
+import { normalVal, timestampToTime, getStatusImg,setFontColorSize } from '@utils/tools';
+class InspectName extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      isEdit: false,
+      value:''
+    };
+    this.handleInput = this.handleInput.bind(this)
+    this.handleBlur = this.handleBlur.bind(this)
+    this.handleEdit = this.handleEdit.bind(this)
+  }
+  componentDidMount(){
+    const {item} = this.props
+    this.setState({
+      value:item.inpValue,
+      isEdit:item.inpValue?true:false
+    });
+    if(this.refs.iptTip){
+      this.refs.iptTip.getDOMNode().value = item.inpValue
+    }
+  }
+  handleEdit(){
+    this.setState({
+      isEdit:true
+    },()=>{
+      this.refs.iptTip.getDOMNode().focus()
+    })
+  }
+  handleBlur(){
+    let val = this.state.value
+    if (val) return
+    this.setState({
+      isEdit:false
+    })
+  }
+  handleInput(e){
+    const {setTipValue,idx} = this.props
+    this.setState({
+      value:e.target.value
+    })
+    this.props.setTipValue(idx,e.target.value)
+  }
+  render(){
+    const {item,getInfomation,idx,handleLabelSub} = this.props
+    return item.show ? <p className={styles.staticTagActive}>
+        <span className={`${styles.tagSpan} ${styles.selectTagSpan} ${setFontColorSize(2,6)}`} data-flg="current" onClick={(e)=>handleLabelSub(e,item.questionId,idx)}>
+          {item.name}
+          <span className={styles.imgInfo1} title='点击i图标可查看详细说明' onClick={()=>getInfomation({name:item.uniqueName || '', position: 1, type: 12})}></span>
+        </span>
+        {
+          item.inpValue||this.state.isEdit?<div title={this.state.value} className={styles.iptTipWrap} onClick={this.handleEdit}>
+            <input 
+            ref="iptTip"
+            onBlur={this.handleBlur}
+            onInput={this.handleInput}
+            className={styles.iptValue}
+            type="text"/>
+            <span></span>
+          </div>:<span className={styles.iptValueBtn} onClick={this.handleEdit}>点击备注</span>
+        }
+    </p>:
+    <p >
+        <i className={`${styles.tagSpan} ${styles.tagSpanS} ${setFontColorSize(2)}`} data-flg="current" onClick={(e)=>handleLabelSub(e,item.questionId,idx)}>
+          {item.name}
+          <span className={styles.imgInfo} title='点击i图标可查看详细说明' onClick={()=>getInfomation({name:item.uniqueName || '', position: 1, type: 12})}></span>
+        </i>
+    </p>
+  }
+}
+export default InspectName;

+ 256 - 0
src/components/AddNewInspect/InspectName/index.less

@@ -0,0 +1,256 @@
+@import "~@less/variables.less";
+.slideLi {
+    // cursor: pointer;
+    // color: #767676;
+    position: relative;
+    padding: 10px 0px 10px 0;
+    border-bottom:1px dashed #989DA3;
+    margin-top: 5px;
+    i {
+        font-style: normal;
+        display: inline-block;
+        vertical-align: top;
+        padding-top: 3px;
+        &:before {
+            content: '\300C';
+        }
+        &:after {
+            content: '\300D';
+        }
+    }  
+    &>p {
+        cursor: pointer;
+        color: #767676;
+        display: inline-block;
+        position: relative;
+        vertical-align: top;
+    } 
+    .partDel {
+        width: 15px;
+        height: 15px;
+        margin-bottom: 11px;
+        cursor: pointer;
+        display: inline-block;
+        position: absolute;
+        right: -4px;
+        top: 0px;
+        background: @closeIcon;
+        background-color: #fff;
+        background-size: 100% 100%;
+    }
+}
+.slideLi:hover{
+    background:#F2F2F2;
+    border-radius: 4px;
+       .partDel{
+        background: @closeHor;
+        background-color: #fff;
+        background-size: 100% 100%;
+      } 
+}
+.staticTagActive {
+    cursor: pointer;
+    color: #333;
+    // display: inline-block;
+    position: relative;
+    vertical-align: top;
+    padding: 2px 10px 10px 10px;
+    box-sizing: border-box;
+    width: 100%;
+    float: left;
+    span {
+        border-bottom: 1px solid #666666 ;
+    }
+}
+
+.staticTag {
+    cursor: pointer;
+    // color: #767676;
+    color: @blue;
+    padding-top: 10px;
+    display: inline-block;
+    position: relative;
+    /* &:before {
+        content: '\300C';
+    }
+    &:after {
+        content: '\300D';
+    } */
+}
+.table {
+    color: #000;
+    width: 100%;
+    tr {
+        line-height: 18px;
+        height: 18px;
+        width: 100%;
+        font-size: unset;
+        td {
+          cursor: default;
+          padding-top: 3px;
+          font-size: unset;
+          span {
+              font-size: unset;
+          }
+        }
+    }
+    tr > td {
+        padding: 0 10px;
+        box-sizing: border-box;
+    }
+}
+
+.searchResult {
+    .searchResultT {
+        img {
+            float: right;
+        }
+    }
+}
+
+.excelDataLists {
+    position: relative;
+    background-color: #f1f1f1;
+    border: 1px solid #ccc;
+    .close {
+        width: 13px;
+        height: 13px;
+        position: absolute;
+        top: -5px;
+        right: -5px;
+        z-index: 30;
+        background-color: #fff;
+        border-radius: 50%;
+    }
+    .excelDataLis {
+        padding: 2px 0px;
+        border-bottom: 1px dashed #989DA3;
+        .excelDataTitle {
+            display: inline-block;
+            width: 20%;
+            vertical-align: top;
+            padding-left: 10px;
+            float: left;
+        }
+        table {
+            width: 80%;
+            tr {
+                height: 16px;
+                line-height: 16px;
+                width: 100%;
+            }
+            td {
+                text-align: left;
+                padding-top: 6px;
+                cursor: default;
+            }
+            .excelUnit {
+                width: auto;
+                margin-left: 5px;
+            }
+        }
+    }
+}
+.center {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
+}
+.slides {
+  background-color: #EDEDED;
+  text-align: center;
+  height: 28px;
+  line-height: 28px;
+  margin: 10px 0 8px 0;
+  cursor: pointer;
+  span {
+    color:#7d7d7d;
+  }
+  img{
+    vertical-align: middle;
+  }
+  .num {
+    color: @blue;
+  }
+}
+.imgInfo {
+  position: relative;
+}
+.imgInfo, .imgInfo1 {
+  width: 15px;
+  height: 17px;
+  border-bottom: 0 none !important;
+  background: url('../img/info2.png') no-repeat center center;
+  background-size: 100% auto; 
+  position: absolute;
+  top: -10px;
+  left: 50%;
+  margin-left: -8px;
+  display: none;
+  cursor: pointer;
+}
+.imgInfo1 {
+    top: -13px;
+  }
+  .imgInfo:hover, .imgInfo1:hover {
+    background: url('../img/info3.png') no-repeat center center;
+    background-size: 100% auto; 
+  }
+.tagSpan {
+  display: inline-block;
+  position: relative;
+}
+.tagSpanS {
+    font-weight: bold;
+    color: #000;
+}
+.selectTagSpan {
+  color: #000;
+  font-weight: bold;
+}
+.tagSpan:hover {
+    .imgInfo, .imgInfo1 {
+        display: block;
+      }
+}
+.iptValue {
+    width: 100px;
+    color: #3B9ED0;
+    font-size: 12px;
+    margin-left: 10px;
+    background-color: #EDF8FF;
+    padding: 0 16px 0 3px;
+}
+.iptValueBtn {
+    color: #3B9ED0;
+    width: 60px;
+    height: 22px;
+    line-height: 22px;
+    background-color: #EDF8FF;
+    text-align: center;
+    display: inline-block;
+    font-size: 12px;
+    border-radius: 4px;
+    border-bottom: 0 !important;
+    margin-left: 10px;
+}
+.iptTipWrap {
+    display: inline-block;
+    position: relative;
+    span {
+        display: inline-block;
+        width: 10px;
+        height: 11px;
+        background: url('../../../common/images/edit1.png') no-repeat;
+        position: absolute;
+        right: 3px;
+        top: 5px;
+        border-bottom: 0;
+    }
+}
+.iptTipWrap:hover {
+    span {
+        background: url('../../../common/images/edit2.png') no-repeat;
+    }
+}

+ 99 - 0
src/components/AddNewInspect/SlideExcel/index.jsx

@@ -0,0 +1,99 @@
+import React, { Component } from "react";
+import styles from "./index.less";
+import { normalVal, timestampToTime, getStatusImg,setFontColorSize } from '@utils/tools';
+import slideUp from "@common/images/slide-up.png";
+import slideDown from "@common/images/slide-down.png";
+class SlideExcel extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      show: false
+    };
+    this.toTime = this.toTime.bind(this)
+    this.handleSlide = this.handleSlide.bind(this)
+  }
+  toTime(time) {
+    let tmpTim = time.split(',').join('') - 0
+    if (time && tmpTim.toString() != 'NaN') {
+      let date = new Date('1900-01-01');
+      let dateTim = date.getTime();
+      let times = (tmpTim - 2) * 24 * 60 * 60 * 1000;
+      let result = timestampToTime(dateTim + times).split(' ')[0]
+      return result;
+    } else {
+      return time;
+    }
+  }
+  handleSlide() {
+    let tmpShow = this.state.show
+    this.setState({
+      show: !tmpShow
+    })
+  }
+  render() {
+    const { items, item, idx, getInfomation, dateTime } = this.props;
+    const { show } = this.state;
+    return (
+      <li className={`${styles.excelDataLis} clearfix`} style={{ border: items.lisExcelRes.length - 1 == idx ? 0 : '' }}>
+        <span className={styles.excelDataTitle}>
+          <span className={`${styles.tagSpan} ${styles.selectTagSpan}`}>
+            <span className={`${styles.menus} ${setFontColorSize(2)}`}>{item.menus}</span>
+            <span className={styles.imgInfo} title='点击i图标可查看详细说明' onClick={() => getInfomation({ name: item.lisExcelItem[0].uniquemealName || '', type: 12, position: 1 })}></span>
+          </span>
+        </span>
+        <table className={`${styles.table} ${setFontColorSize(2)}`}>
+          {show ? (item.lisExcelItem && item.lisExcelItem.map((value, idx) => {
+            return <tr>
+              <td style={{ width: '30%' }}>
+                <span className={styles.tagSpan}>
+                  {value.itemName}
+                  <span className={styles.imgInfo1} title='点击i图标可查看详细说明' onClick={() => getInfomation({ name: value.uniqueName || '', type: 12, position: 1 })}></span>
+                </span>
+              </td>
+              <td style={{ width: '20%' }}>
+                {
+                  getStatusImg(value.type, value.value, 1)
+                }
+                {value.unit}</td>
+              <td style={{ width: '25%' }}>
+                {normalVal(value.min, value.max)}
+              </td>
+              <td style={{ width: '25%' }}>{value.time == '' ? ('导入时间: ' + dateTime) : '化验时间: ' + this.toTime(value.time)}</td>
+            </tr>
+          })) : (item.lisExcelItem && item.lisExcelItem.map((value, idx) => {
+            if (idx < 4) {
+              return <tr>
+                <td style={{ width: '30%' }}>
+                  <span className={styles.tagSpan}>
+                    {value.itemName}
+                    <span className={styles.imgInfo1} title='点击i图标可查看详细说明' onClick={() => getInfomation({ name: value.uniqueName || '', type: 12, position: 1 })}></span>
+                  </span>
+                </td>
+                <td style={{ width: '20%' }}>
+                  {
+                    getStatusImg(value.type, value.value, 1)
+                  }
+                  {value.unit}</td>
+                <td style={{ width: '25%' }}>
+                  {normalVal(value.min, value.max)}
+                </td>
+                <td style={{ width: '25%' }}>{value.time == '' ? ('导入时间: ' + dateTime) : '化验时间: ' + this.toTime(value.time)}</td>
+              </tr>
+            }
+          }))
+          }
+        </table>
+        {
+          item.lisExcelItem && item.lisExcelItem.length > 5 ?
+            <div className={`${styles.slides} ${setFontColorSize(2)}`} onClick={this.handleSlide}>
+              {
+                show ? <span>收起</span> : <span>剩余<span className={styles.num}>{item.lisExcelItem.length - 4}</span>项</span>
+              }
+              <img src={show ? slideUp : slideDown} alt="" />
+            </div> : null
+        }
+      </li>
+    );
+  }
+}
+export default SlideExcel;

+ 199 - 0
src/components/AddNewInspect/SlideExcel/index.less

@@ -0,0 +1,199 @@
+@import "~@less/variables.less";
+.excelDataLis {
+    // cursor: pointer;
+    color: #767676;
+    position: relative;
+    padding-top: 10px;
+    padding-bottom: 10px;
+    border-bottom:1px dashed #989DA3;
+    i {
+        font-style: normal;
+        display: inline-block;
+        vertical-align: top;
+        padding-top: 3px;
+        &:before {
+            content: '\300C';
+        }
+        &:after {
+            content: '\300D';
+        }
+    }  
+    &>p {
+        cursor: pointer;
+        color: #767676;
+        display: inline-block;
+        position: relative;
+        vertical-align: top;
+    } 
+    .partDel {
+        width: 13px;
+        height: 13px;
+        margin-bottom: 11px;
+        cursor: pointer;
+        display: inline-block;
+        position: absolute;
+        right: 0;
+        top: 12px;
+        background-color: #fff;
+    }
+}
+
+
+.table {
+  color: #000;
+  width: 100%;
+  // display: inline-block;
+  tr {
+    line-height: 18px;
+    height: 18px;
+    width: 100%;
+    font-size: unset;
+    td {
+      padding-top: 3px;
+      font-size: unset;
+      span {
+        font-size: unset;
+      }
+    }
+  }
+}
+
+
+.itemPart {
+    height: 28px;
+    // line-height: 28px;
+    overflow: hidden;
+    padding-top: 0 !important;
+    width: 290px;
+    float: left;
+    padding: 0 15px;
+    box-sizing: border-box;
+    span {
+        display: inline-block;
+    }
+    .itemPartL {
+        max-width: 180px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        float: left;
+    }
+    .itemPartR {
+        width: 62px;
+        outline: none;
+        float: right;
+    }
+    .itemPartT {
+        float: right;
+        input {
+            width: 40px;
+            text-align: center;
+        }
+        .unit {
+            display: inline-block;
+        }
+    }
+}
+.itemPartOne {
+    width: 100% !important;
+}
+
+.excelDataLis {
+    padding: 2px 0px;
+    border-bottom: 1px dashed #989DA3;
+    .excelDataTitle {
+        width: 100%;
+        vertical-align: top;
+        padding-left: 10px;
+        float: left;
+        color: #000;
+    }
+    table {
+        width: 100%;
+        tr {
+            height: 16px;
+            line-height: 16px;
+            width: 100%;
+        }
+        td {
+            text-align: left;
+            padding-top: 6px;
+            padding-left: 10px;
+            cursor: default;
+        }
+        .excelUnit {
+            width: auto;
+            margin-left: 5px;
+        }
+    }
+}
+.center {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
+}
+.slides {
+  background-color: #EDEDED;
+  text-align: center;
+  height: 28px;
+  line-height: 28px;
+  margin: 10px 0 8px 0;
+  cursor: pointer;
+  span {
+    color:#7d7d7d;
+    font-size: unset;
+  }
+  img{
+    vertical-align: middle;
+  }
+  .num {
+    color: @blue;
+  }
+}
+.imgInfo {
+  position: relative;
+}
+.imgInfo , .imgInfo1{
+  width: 15px;
+  height: 17px;
+  border-bottom: 0 none !important;
+  background: url('../img/info2.png') no-repeat center center;
+  background-size: 100% auto; 
+  position: absolute;
+  top: -10px;
+  left: 50%;
+  margin-left: -8px;
+  display: none;
+  cursor: pointer;
+}
+.imgInfo1 {
+  top: -13px;
+}
+.imgInfo:hover, .imgInfo1:hover {
+  background: url('../img/info3.png') no-repeat center center;
+  background-size: 100% auto; 
+}
+.excelDataTitle {
+  .tagSpan {
+    display: inline-block;
+    line-height: 28px;
+  }
+}
+.tagSpan {
+  display: inline-block;
+  position: relative;
+}
+.selectTagSpan {
+  // color: #000;
+  // font-weight: bold;
+  // .menus {
+  //   border-bottom: 1px solid #666666;
+  // }
+}
+.tagSpan:hover {
+  .imgInfo, .imgInfo1 {
+    display: block;
+  }
+ 
+}

+ 185 - 0
src/components/AddNewInspect/SlidePic/index.jsx

@@ -0,0 +1,185 @@
+import React, { Component } from "react";
+import styles from "./index.less";
+import { normalVal,getArrow,timestampToTime,getDomUpDown,getPageCoordinate,setPosition,setFontColorSize } from '@utils/tools';
+import { InspectCommon, Notify,DelToast} from '@commonComp';
+import slideUp from "@common/images/slide-up.png";
+import slideDown from "@common/images/slide-down.png";
+import $ from 'jquery';
+import date1 from '../img/date1.png';
+import ScrollArea from 'react-scrollbar';
+import InspectName from '../InspectName';
+
+import up from '@images/up.png';
+import down from '@images/down.png';
+
+class SlidePic extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      show:false,
+      activeInd:false,
+      activeName:'',
+      canEdit:true,
+      style:'',
+    };
+    this.toTime = this.toTime.bind(this);
+    this.handleSlide = this.handleSlide.bind(this);
+    this.handleDel = this.handleDel.bind(this);
+    this.handleCancel = this.handleCancel.bind(this);
+    this.delConfirm = this.delConfirm.bind(this);
+    this.timeSure = this.timeSure.bind(this);
+    this.setEdit = this.setEdit.bind(this);
+    this.handleLabelSub = this.handleLabelSub.bind(this);
+    this.handleBlur = this.handleBlur.bind(this);
+  }
+  handleChangeDate(date) {
+    // console.log(date,'外')
+  }
+  
+  componentDidMount() {
+    const {item} = this.props;
+    $(document).click((event) => {
+      if($(event.target).attr("id")!='addClose'&&$(event.target).attr("id")!='delTit'){
+        this.setState({
+          activeInd:false
+        })
+      }
+    });
+    let type = getArrow(item.minValue,item.maxValue,item.value||null)
+    this.setState({style:type,value:item.value,time:item.time})
+    const that = this;
+    document.addEventListener('mousedown',function(e){
+      //onMousedown的目标为滚动条时,标签填写单不关闭
+      if(e.target.className=='scrollbar'){
+        that.isBar = true;
+      }else{
+        that.isBar = false;
+      }
+    });
+    // this.setState({ dateTime: getCurrentDate(1) })
+  }
+  toTime(time){
+    let tmpTim = time.split(',').join('')-0
+    if(time && tmpTim.toString() != 'NaN'){
+      let date = new Date('1900-01-01');
+      let dateTim = date.getTime();
+      let times = (tmpTim-2)*24*60*60*1000;
+      let result = timestampToTime(dateTim+times).split(' ')[0]
+      return result;
+    }else{
+      return time;
+    }
+  }
+  handleSlide(){
+    let tmpShow = this.state.show
+    this.setState({
+      show:!tmpShow
+    })
+  }
+  setEdit(){
+    this.setState({
+      canEdit:false
+    },()=>{
+      $("#canEdit").focus()
+      $("#canEdit").blur(()=>{
+        this.setState({canEdit:true})
+      })
+    })
+  }
+  handleDel(time){
+    const {handleDelClick,item} = this.props;
+    this.setState({
+      activeInd:true,
+      activeName:item.uniqueName,
+    })
+    handleDelClick&&handleDelClick(1,time);
+  }
+  handleCancel(){
+    this.setState({
+      activeInd:false,
+      activeName:''
+    })
+  }
+  delConfirm(item){
+    const {handleDelConfirm,handlePush} = this.props;
+    handleDelConfirm&&handleDelConfirm(item);
+    Notify.success("删除成功");
+    handlePush && handlePush({mode:8});       //右侧推送
+    this.setState({
+      activeInd:false,
+      activeName:''
+    })
+  }
+  timeSure(date){
+    const {handleChangeDate} = this.props;
+    handleChangeDate&&handleChangeDate(date)
+  }
+  handleLabelSub(e,questionId,idx){
+    const {handleLabelSub,handleFillShow,setHighter,refreshScroller} = this.props;
+    handleLabelSub(e,questionId,idx);
+    handleFillShow(e,idx);
+    //弹窗高度超出屏幕,增加页面高度
+    setPosition(e,"#inspectFill",setHighter);
+    /*setTimeout(function(){//如果化验下面有很多数据,则会跳过头
+      refreshScroller()&&refreshScroller().scrollYTo(290);
+    })*/
+  }
+  handleInput(e,item){
+    const {setTipValue} = this.props
+    setTipValue(item,e.target.value)
+    let type = getArrow(item.minValue,item.maxValue,e.target.value||null)
+    this.setState({
+      value:e.target.value,
+      style:type
+    })
+  }
+  handleBlur(){
+    const {handlePush} = this.props;
+    handlePush && handlePush({mode:8});       //右侧推送
+  }
+  render() {
+    const {item,time} = this.props;
+    const {canEdit,activeInd,activeName,value,style} = this.state;
+    return (
+      item.flg == 1?<li key={item.time} className={`${styles.slideLi} clearfix`}> 
+          <span className={styles.bigname}>{item.uniqueName}</span>
+          <span className={styles.smallname}></span>
+          <span className={styles.edit}></span>
+          <span className={styles.maxmin}></span>
+          <span className={styles.pass}>化验时间:{item.time}</span>
+          <span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item.time)}}></span>
+          <DelToast show={time==item.time&&activeInd?true:false}
+                    name={activeName} 
+                    right={'-34px'}
+                    top={'30px'}
+                    cancel={this.handleCancel}
+                    confirm={()=>{this.delConfirm(item)}}/>
+      </li>:<li key={item.time} className={`${styles.slideLi} clearfix`}> 
+          <span className={styles.bigname}>{item.name}</span>
+          <span className={styles.smallname}>{item.uniqueName}</span>
+          <span className={styles.edit}>
+            <input disabled={canEdit} type="text" 
+              id="canEdit" 
+              onDoubleClick={this.setEdit}
+              style={{color:style==2||style==4?'red':style==1?'#D949FF':'#333'}}
+              placeholder='(填写)'
+              autoComplete="off"
+              value={value}
+              onInput={(e)=>{this.handleInput(e,item)}}
+              onBlur={()=>{this.handleBlur()}}
+              /><img style={{display:style==1||style==2?'inline-block':'none'}} src={style==1?down:style==2?up:''} />{item.units}
+          </span>
+          <span className={styles.maxmin}>{normalVal(item.minValue,item.maxValue)}</span>
+          <span className={styles.pass}>化验时间:{item.time}</span>
+          <span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item.time)}}></span>
+          <DelToast show={time==item.time&&activeInd?true:false}
+                    name={activeName}
+                    right={'-34px'}
+                    top={'30px'}
+                    cancel={this.handleCancel}
+                    confirm={()=>{this.delConfirm(item)}}/>
+      </li>
+    );
+  }
+}
+export default SlidePic;

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

@@ -0,0 +1,258 @@
+@import "~@less/variables.less";
+.slideLi {
+    // cursor: pointer;
+    // color: #767676;
+    position: relative;
+    padding: 10px 0px 10px 0;
+    border-bottom:1px dashed #989DA3;
+    margin-top: 5px;
+    span {
+        display: inline-block;
+        padding: 0 5px;
+        box-sizing: border-box;
+    }
+    i {
+        font-style: normal;
+        display: inline-block;
+        vertical-align: top;
+        padding-top: 3px;
+        // &:before {
+        //     content: '\300C';
+        // }
+        // &:after {
+        //     content: '\300D';
+        // }
+    }  
+    &>p {
+        cursor: pointer;
+        color: #767676;
+        display: inline-block;
+        position: relative;
+        vertical-align: top;
+    } 
+    .partDel {
+        width: 15px;
+        height: 15px;
+        margin-bottom: 11px;
+        cursor: pointer;
+        display: inline-block;
+        position: absolute;
+        right: -4px;
+        top: 0px;
+        background: @closeIcon;
+        background-color: #fff;
+        background-size: 100% 100%;
+    }
+    .bigname {
+        width: 20%;
+        font-weight: bold;
+    }
+    .smallname {
+        width: 25%;
+    }
+    .edit {
+        width: 15%;
+        input {
+            width: 40px;
+        }
+        i {
+            
+        }
+    }
+    .maxmin {
+        width: 15%;
+    }
+}
+.slideLi:hover{
+    background:#F2F2F2;
+    border-radius: 4px;
+       .partDel{
+        background: @closeHor;
+        background-color: #fff;
+        background-size: 100% 100%;
+      } 
+}
+.staticTagActive {
+    cursor: pointer;
+    color: #333;
+    // display: inline-block;
+    position: relative;
+    vertical-align: top;
+    padding: 2px 10px 10px 10px;
+    box-sizing: border-box;
+    width: 100%;
+    float: left;
+    span {
+        border-bottom: 1px solid #666666 ;
+    }
+}
+
+.staticTag {
+    cursor: pointer;
+    // color: #767676;
+    color: @blue;
+    padding-top: 10px;
+    display: inline-block;
+    position: relative;
+    /* &:before {
+        content: '\300C';
+    }
+    &:after {
+        content: '\300D';
+    } */
+}
+.table {
+    color: #000;
+    width: 100%;
+    tr {
+        line-height: 18px;
+        height: 18px;
+        width: 100%;
+        font-size: unset;
+        td {
+          cursor: default;
+          padding-top: 3px;
+          font-size: unset;
+          span {
+              font-size: unset;
+          }
+        }
+    }
+    tr > td {
+        padding: 0 10px;
+        box-sizing: border-box;
+    }
+}
+
+.searchResult {
+    .searchResultT {
+        img {
+            float: right;
+        }
+    }
+}
+
+.excelDataLists {
+    position: relative;
+    background-color: #f1f1f1;
+    border: 1px solid #ccc;
+    .close {
+        width: 13px;
+        height: 13px;
+        position: absolute;
+        top: -5px;
+        right: -5px;
+        z-index: 30;
+        background-color: #fff;
+        border-radius: 50%;
+    }
+    .excelDataLis {
+        padding: 2px 0px;
+        border-bottom: 1px dashed #989DA3;
+        .excelDataTitle {
+            display: inline-block;
+            width: 20%;
+            vertical-align: top;
+            padding-left: 10px;
+            float: left;
+        }
+        table {
+            width: 80%;
+            tr {
+                height: 16px;
+                line-height: 16px;
+                width: 100%;
+            }
+            td {
+                text-align: left;
+                padding-top: 6px;
+                cursor: default;
+            }
+            .excelUnit {
+                width: auto;
+                margin-left: 5px;
+            }
+        }
+    }
+}
+.center {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
+}
+.slides {
+  background-color: #EDEDED;
+  text-align: center;
+  height: 28px;
+  line-height: 28px;
+  margin: 10px 0 8px 0;
+  cursor: pointer;
+  span {
+    color:#7d7d7d;
+  }
+  img{
+    vertical-align: middle;
+  }
+  .num {
+    color: @blue;
+  }
+}
+.imgInfo {
+  position: relative;
+}
+.imgInfo, .imgInfo1 {
+  width: 15px;
+  height: 17px;
+  border-bottom: 0 none !important;
+  background: url('../img/info2.png') no-repeat center center;
+  background-size: 100% auto; 
+  position: absolute;
+  top: -10px;
+  left: 50%;
+  margin-left: -8px;
+  display: none;
+  cursor: pointer;
+}
+.imgInfo1 {
+    top: -13px;
+  }
+  .imgInfo:hover, .imgInfo1:hover {
+    background: url('../img/info3.png') no-repeat center center;
+    background-size: 100% auto; 
+  }
+.tagSpan {
+  display: inline-block;
+  position: relative;
+}
+.tagSpanS {
+    font-weight: bold;
+    color: #000;
+}
+.selectTagSpan {
+  color: #000;
+  font-weight: bold;
+}
+.tagSpan:hover {
+    .imgInfo, .imgInfo1 {
+        display: block;
+      }
+}
+.iptValue {
+    width: 60px;
+    color: #3B9ED0;
+    font-size: 12px;
+}
+.iptValueBtn {
+    color: #3B9ED0;
+    width: 60px;
+    height: 22px;
+    line-height: 22px;
+    background-color: #EDF8FF;
+    text-align: center;
+    display: inline-block;
+    font-size: 12px;
+    border-radius: 4px;
+    border-bottom: 0 !important;
+    margin-left: 10px;
+}

+ 255 - 0
src/components/AddNewInspect/SlideSelect/index.jsx

@@ -0,0 +1,255 @@
+import React, { Component } from "react";
+import styles from "./index.less";
+import { normalVal,timestampToTime,getPageCoordinate,setPosition,setFontColorSize } from '@utils/tools';
+import { InspectCommon, Calendar,DelToast} from '@commonComp';
+import slideUp from "@common/images/slide-up.png";
+import slideDown from "@common/images/slide-down.png";
+import $ from 'jquery';
+import date1 from '../img/date1.png';
+import ScrollArea from 'react-scrollbar';
+import InspectName from '../InspectName';
+
+class SlideSelect extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      show:false,
+      activeInd:false,
+      activeName:'',
+    };
+    this.toTime = this.toTime.bind(this);
+    this.handleSlide = this.handleSlide.bind(this);
+    this.handleDel = this.handleDel.bind(this);
+    this.handleCancel = this.handleCancel.bind(this);
+    this.delConfirm = this.delConfirm.bind(this);
+    this.timeSure = this.timeSure.bind(this);
+    this.handleLabelSub = this.handleLabelSub.bind(this);
+  }
+  handleChangeDate(date) {
+    // console.log(date,'外')
+  }
+  componentDidMount() {
+    $(document).click((event) => {
+      let inspectToggleDate = document.getElementById("inspectToggleDate")
+      let timeIcon = document.getElementById("timeIcon")
+      let calendarDate = document.getElementById("calendarDate")
+      if (calendarDate) {
+        if (inspectToggleDate != event.target && timeIcon != event.target && !calendarDate.contains(event.target)) {
+          this.props.handleShowDate();
+        }
+      }
+    });
+  }
+  toTime(time){
+    let tmpTim = time.split(',').join('')-0
+    if(time && tmpTim.toString() != 'NaN'){
+      let date = new Date('1900-01-01');
+      let dateTim = date.getTime();
+      let times = (tmpTim-2)*24*60*60*1000;
+      let result = timestampToTime(dateTim+times).split(' ')[0]
+      return result;
+    }else{
+      return time;
+    }
+  }
+  handleSlide(){
+    let tmpShow = this.state.show
+    this.setState({
+      show:!tmpShow
+    })
+  }
+  handleDel(){
+    const {handleDelClick,idx,item} = this.props;
+    this.setState({
+      activeInd:true,
+      activeName:item.name
+    })
+    handleDelClick&&handleDelClick(1,idx);
+  }
+  handleCancel(){
+    this.setState({
+      activeInd:false,
+      activeName:''
+    })
+  }
+  delConfirm(){
+    const {handleDelConfirm} = this.props;
+    handleDelConfirm&&handleDelConfirm();
+    this.setState({
+      activeInd:false,
+      activeName:''
+    })
+  }
+  timeSure(date){
+    const {handleChangeDate} = this.props;
+    handleChangeDate&&handleChangeDate(date)
+  }
+  handleLabelSub(e,questionId,idx){
+    const {handleLabelSub,handleFillShow,setHighter,refreshScroller} = this.props;
+    handleLabelSub(e,questionId,idx);
+    handleFillShow(e,idx);
+    //弹窗高度超出屏幕,增加页面高度
+    setPosition(e,"#inspectFill",setHighter);
+    /*setTimeout(function(){//如果化验下面有很多数据,则会跳过头
+      refreshScroller()&&refreshScroller().scrollYTo(290);
+    })*/
+  }
+  render() {
+    const {windowWidth,handleFillShow,setTipValue,setHighter,refreshScroller,getInfomation,handleConfirm,changeActivePart,getItemList,date,item,idx,showDetails,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,showToast} = this.props;
+    const {show,activeInd,activeName} = this.state;
+    let numPlus = 0,numPlus1 = 0;
+    let staticTime = {}
+    if(dateTime){
+      let tmp1 = dateTime.split(' ')[0].split('-')
+      let tmp2 = (dateTime).split(' ').length>1&&(dateTime).split(' ')[1].split(':')
+      staticTime = {
+        year: tmp1[0]-0,
+        month: tmp1[1]-0,
+        day: tmp1[2]-0,
+        hour: tmp2[0],
+        minute: tmp2[1],
+        second: tmp2[2]
+      }
+    }
+    const contStyle={
+      opacity:'0.4',
+      right:'0',
+      top:'6px',
+      zIndex:'15',
+      width:'14px',
+      background:'#f1f1f1'};
+    const barStyle={background:'#777',width:'100%'};
+    const listLen = currentData.details&&currentData.details.length;
+    const stopScroll =(windowWidth<1300&&listLen>12)||(windowWidth>1299&&listLen>24);
+    return (
+      <li key={item.questionId} className={`${styles.slideLi} clearfix`}> 
+        <InspectName 
+          item={item} 
+          handleLabelSub={this.handleLabelSub} 
+          idx={idx} 
+          getInfomation={getInfomation} 
+          refreshScroller={refreshScroller} 
+          setHighter={setHighter} 
+          setTipValue={setTipValue}
+          handleFillShow={handleFillShow}></InspectName>
+        {
+          item.details && item.details.map((val)=>{
+            if(val.value && val.value != ''){
+              numPlus = ++numPlus
+            }
+          })
+        }
+        {
+            item.show ?
+                <table className={`${styles.table} ${setFontColorSize(2)}`}>
+                    {
+                        show?(item.details.map((val)=>{
+                            if(val.value && val.value != ''){
+                                return <tr>
+                                    <td style={{width:'30%'}}>
+                                      <span className={styles.tagSpan}>
+                                        {val.name}
+                                        <span className={styles.imgInfo1} title='点击i图标可查看详细说明' onClick={()=>getInfomation({name:val.uniqueName || '', position: 1, type: 12,showName:item.name+'('+val.name+')'})}></span>                                        
+                                      </span>
+                                    </td>
+                                    {showDetails(val)}
+                                    <td style={{width:'25%'}}>
+                                      {val.questionDetailList.length > 0?'':normalVal(val.minValue,val.maxValue)}
+                                    </td>
+                                    <td style={{width:'25%'}}>{'化验时间:'+item.time}</td>
+                                </tr>
+                            }
+                        })):(item.details.map((val)=>{
+                          if(val.value && val.value != '' ){
+                              ++numPlus1;
+                              if(numPlus1 < 5){
+                                return <tr>
+                                    <td style={{width:'30%'}}>
+                                      <span className={styles.tagSpan}>
+                                        {val.name}
+                                        <span className={styles.imgInfo1} title='点击i图标可查看详细说明' onClick={()=>getInfomation({name:val.uniqueName || '', position: 1, type: 12,showName:item.name+'('+val.name+')'})}></span>
+                                      </span>
+                                    </td>
+                                    {showDetails(val)}
+                                    <td style={{width:'25%'}}>
+                                        {val.questionDetailList.length > 0?'':normalVal(val.minValue,val.maxValue)}
+                                    </td>
+                                    <td style={{width:'25%'}}>{'化验时间:'+item.time}</td>
+                                </tr>
+                              }
+                          }
+                      }))
+                    }
+                </table>:null
+        }
+        {
+          numPlus > 4 ?  
+          <div className={styles.slides} onClick={this.handleSlide}>
+              {
+                show ? <span>收起</span> :<span>剩余<span className={styles.num}>{numPlus-4}</span>项</span>
+              }
+              <img src={show ?slideUp:slideDown} alt=""/>
+          </div>:null
+        }
+        <div className={styles.searchResult}>
+            {
+                showFill && fillActive.id == item.id && idx == currentIdx ?
+                    <InspectCommon
+                        showFill={showFill}
+                        handleClear={(e)=>{
+                            changeActivePart('','',true)
+                        }}
+                        handleConfirm={(e)=>{
+                            if(JSON.stringify(currentData) == '{}'){
+                                handleConfirm(e,idx,dateTime,fillActive);
+                            }else{
+                                handleConfirm(e,idx,dateTime,currentData);
+                            }
+                            changeShowFill()
+                            handlePush&&handlePush({mode:8});     //右侧推送
+                        }}
+                    >
+                    
+                        <div className={styles.searchResultT}>
+                            <img style={{"position":"absolute","top":"8px","right":"8px",cursor:"pointer"}} onClick={handleShowDate} src={date1} alt="" id="inspectToggleDate"/>
+                            <p style={{position:"absolute",right:"25px",top:"4px",lineHeight:"28px",cursor:"pointer",paddingRight:"10px"}} onClick={handleShowDate} id="timeIcon">
+                                {
+                                  dateTime
+                                }
+                            </p>
+                            <div style={{display:date?"block":"none",position:"relative"}}>
+                                {/* 日期组件 */}
+                                {
+                                  date?<Calendar timeLis={staticTime} isShow={true} timeSure={this.timeSure} needTime={true} sure={true} handleChange={this.handleChangeDate}></Calendar>:null
+                                }
+                                {/* <Calendar timeLis={staticTime} isShow={true} timeSure={this.timeSure} needTime={true} sure={true} handleChange={handleChangeDate}></Calendar> */}
+                            </div>
+                        </div>
+                            {/* 填写单内容显示 */}
+                      {stopScroll?<ScrollArea speed={0.8}
+                                  horizontal={false}
+                                  stopScrollPropagation={true}
+                                  style={{maxHeight:'358px'}}
+                                  className={styles["area"]}
+                                  verticalContainerStyle={contStyle}
+                                  verticalScrollbarStyle={barStyle}
+                                  contentClassName="content">
+                            { getItemList() }
+                      </ScrollArea>:getItemList()}
+                    </InspectCommon>
+                : null
+            }
+        </div>
+        {/*<img className={styles.partDel} src={close} alt="删除项" onClick={()=>{handleDelClick(1,idx)}}/>*/}
+        <span id="addClose" className={styles.partDel} onClick={this.handleDel}></span>
+        <DelToast show={showToast&&activeInd?true:false}
+                    name={activeName} 
+                    right={'-34px'}
+                    top={'30px'}
+                    cancel={this.handleCancel}
+                    confirm={this.delConfirm}/>
+    </li>
+    );
+  }
+}
+export default SlideSelect;

+ 234 - 0
src/components/AddNewInspect/SlideSelect/index.less

@@ -0,0 +1,234 @@
+@import "~@less/variables.less";
+.slideLi {
+    // cursor: pointer;
+    // color: #767676;
+    position: relative;
+    padding: 10px 0px 10px 0;
+    border-bottom:1px dashed #989DA3;
+    margin-top: 5px;
+    i {
+        font-style: normal;
+        display: inline-block;
+        vertical-align: top;
+        padding-top: 3px;
+        &:before {
+            content: '\300C';
+        }
+        &:after {
+            content: '\300D';
+        }
+    }  
+    &>p {
+        cursor: pointer;
+        color: #767676;
+        display: inline-block;
+        position: relative;
+        vertical-align: top;
+    } 
+    .partDel {
+        width: 15px;
+        height: 15px;
+        margin-bottom: 11px;
+        cursor: pointer;
+        display: inline-block;
+        position: absolute;
+        right: -4px;
+        top: 0px;
+        background: @closeIcon;
+        background-color: #fff;
+        background-size: 100% 100%;
+    }
+}
+.slideLi:hover{
+    background:#F2F2F2;
+    border-radius: 4px;
+       .partDel{
+        background: @closeHor;
+        background-color: #fff;
+        background-size: 100% 100%;
+      } 
+}
+.staticTagActive {
+    cursor: pointer;
+    color: #333;
+    // display: inline-block;
+    position: relative;
+    vertical-align: top;
+    padding: 2px 10px 10px 10px;
+    box-sizing: border-box;
+    width: 100%;
+    float: left;
+    span {
+        border-bottom: 1px solid #666666 ;
+    }
+}
+
+.staticTag {
+    cursor: pointer;
+    // color: #767676;
+    color: @blue;
+    padding-top: 10px;
+    display: inline-block;
+    position: relative;
+    /* &:before {
+        content: '\300C';
+    }
+    &:after {
+        content: '\300D';
+    } */
+}
+.table {
+    color: #000;
+    width: 100%;
+    tr {
+        line-height: 18px;
+        height: 18px;
+        width: 100%;
+        font-size: unset;
+        td {
+          cursor: default;
+          padding-top: 3px;
+          font-size: unset;
+          span {
+              font-size: unset;
+          }
+        }
+    }
+    tr > td {
+        padding: 0 10px;
+        box-sizing: border-box;
+    }
+}
+
+.searchResult {
+    .searchResultT {
+        img {
+            float: right;
+        }
+    }
+}
+
+.excelDataLists {
+    position: relative;
+    background-color: #f1f1f1;
+    border: 1px solid #ccc;
+    .close {
+        width: 13px;
+        height: 13px;
+        position: absolute;
+        top: -5px;
+        right: -5px;
+        z-index: 30;
+        background-color: #fff;
+        border-radius: 50%;
+    }
+    .excelDataLis {
+        padding: 2px 0px;
+        border-bottom: 1px dashed #989DA3;
+        .excelDataTitle {
+            display: inline-block;
+            width: 20%;
+            vertical-align: top;
+            padding-left: 10px;
+            float: left;
+        }
+        table {
+            width: 80%;
+            tr {
+                height: 16px;
+                line-height: 16px;
+                width: 100%;
+            }
+            td {
+                text-align: left;
+                padding-top: 6px;
+                cursor: default;
+            }
+            .excelUnit {
+                width: auto;
+                margin-left: 5px;
+            }
+        }
+    }
+}
+.center {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
+}
+.slides {
+  background-color: #EDEDED;
+  text-align: center;
+  height: 28px;
+  line-height: 28px;
+  margin: 10px 0 8px 0;
+  cursor: pointer;
+  span {
+    color:#7d7d7d;
+  }
+  img{
+    vertical-align: middle;
+  }
+  .num {
+    color: @blue;
+  }
+}
+.imgInfo {
+  position: relative;
+}
+.imgInfo, .imgInfo1 {
+  width: 15px;
+  height: 17px;
+  border-bottom: 0 none !important;
+  background: url('../img/info2.png') no-repeat center center;
+  background-size: 100% auto; 
+  position: absolute;
+  top: -10px;
+  left: 50%;
+  margin-left: -8px;
+  display: none;
+  cursor: pointer;
+}
+.imgInfo1 {
+    top: -13px;
+  }
+  .imgInfo:hover, .imgInfo1:hover {
+    background: url('../img/info3.png') no-repeat center center;
+    background-size: 100% auto; 
+  }
+.tagSpan {
+  display: inline-block;
+  position: relative;
+}
+.tagSpanS {
+    font-weight: bold;
+    color: #000;
+}
+.selectTagSpan {
+  color: #000;
+  font-weight: bold;
+}
+.tagSpan:hover {
+    .imgInfo, .imgInfo1 {
+        display: block;
+      }
+}
+.iptValue {
+    width: 60px;
+    color: #3B9ED0;
+    font-size: 12px;
+}
+.iptValueBtn {
+    color: #3B9ED0;
+    width: 60px;
+    height: 22px;
+    line-height: 22px;
+    background-color: #EDF8FF;
+    text-align: center;
+    display: inline-block;
+    font-size: 12px;
+    border-radius: 4px;
+    border-bottom: 0 !important;
+    margin-left: 10px;
+}

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


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


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


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


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


+ 397 - 0
src/components/AddNewInspect/index.jsx

@@ -0,0 +1,397 @@
+import React from 'react';
+import { SearchOption, InspectCommon, Calendar, Notify, ConfirmModal, Add, DelToast } from '@commonComp';
+import SlideExcel from './SlideExcel';
+import SlidePic from './SlidePic';
+import { deepClone, getPageCoordinate, getStatusImg,getDomUpDown ,getCurrentDate,setPosition,getCalendarDate} from '@utils/tools';
+import styles from './index.less';
+import ScrollArea from 'react-scrollbar';
+import store from '@store';
+import $ from 'jquery';
+class AddNewInspect extends React.Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      show: false,
+      showFill: false,
+      date: false,
+      currentIdx: '',
+      dateTime: "",
+      currentData: {},
+      numPlus: 0,     //判断是否所有的填写单都是空
+      num: 0,            //暂存数据,获取一次,不能每次都是新的数据
+      type: null,
+      time: null,
+      pageTop: '',
+      // tmpIds: [],      //内层外层
+      impId: null
+    }
+    this.$ul = React.createRef();
+    this.handleChangeDate = this.handleChangeDate.bind(this)
+    this.handleShowDate = this.handleShowDate.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.handleDelConfirm = this.handleDelConfirm.bind(this)
+    this.handleCancel = this.handleCancel.bind(this)
+    this.handleSearchAdvice = this.handleSearchAdvice.bind(this)
+    this.changeShowFill = this.changeShowFill.bind(this)
+    this.handleFillShow = this.handleFillShow.bind(this)
+    this.handleDelClick = this.handleDelClick.bind(this)
+  }
+  handleDelConfirm() {//弹窗确定
+    const { delPartItem, handleCloseExcel, handlePush } = this.props;
+    const { type, id, impId } = this.state;
+    if (type == 1) {
+      delPartItem(id)
+    } else if (type == 2) {
+      handleCloseExcel(impId)
+    }
+    Notify.success("删除成功");
+    handlePush && handlePush({mode:8});       //右侧推送
+  }
+  handleDelClick(type, time) {
+    if (type == 2) {
+      this.setState({
+        impId: idx,
+        type: type,
+        id: null
+      })
+    } else {
+      this.setState({
+        type: type,
+        time: time,
+        impId: null
+      })
+    }
+  }
+  handleCancel() {
+    this.setState({
+      type: null,
+      id: null,
+      impId: null
+    })
+  }
+  componentDidMount() {
+    $(document).click((event) => {
+      let searchWrap = document.getElementById("searchWrapAdvice");   // 搜索按钮
+      let searchOption = document.getElementById("searchOption");   // 搜索列表
+      let inspectFill = document.getElementById("inspectFill");         // 公共填写单
+
+      let _del = $('#delBox')[0];       // 删除弹窗  
+      let _impClose = $('#impClose')[0];         // 导入删除按钮
+      let _addClose = $('#addClose')[0];         // 添加删除按钮
+      let _closeTil = $('#delTit')[0];   // 弹窗标题
+      if (searchOption&&!this.isBar) {//onMousedown的目标为滚动条时,添加弹窗不关闭
+        if (searchOption != event.target && searchWrap != event.target && searchWrap != event.target.parentNode && !$.contains(searchOption, event.target)) { // Mark 1
+          if(this.state.show){
+            this.props.setHighter(48)
+          }
+          this.setState({ show: false });
+        }
+      }
+      if (inspectFill&&!this.isBar) {//onMousedown的目标为滚动条时,子项弹窗不关闭
+        if ($(event.target).attr('id') != "getSureTime"&&event.target.getAttribute('data-flg') != 'current' && inspectFill != event.target && !$.contains(inspectFill, event.target)) { // Mark 1
+          if(this.state.showFill){
+            this.props.setHighter(48)
+          }
+          this.setState({ showFill: false, date: false });
+        }
+      }
+
+      if (_del&&!this.isBar) {//onMousedown的目标为滚动条时,删除弹窗不关闭
+        if (!event.target.isEqualNode(_impClose) && !event.target.isEqualNode(_addClose) && !event.target.isEqualNode(_del) && event.target.parentNode != _del && !event.target.isEqualNode(_closeTil)) {
+          this.setState({
+            id: null,
+            impId: null
+          })
+        }
+      }
+    });
+    const that = this;
+    document.addEventListener('mousedown',function(e){
+      //onMousedown的目标为滚动条时,标签填写单不关闭
+      if(e.target.className=='scrollbar'){
+        that.isBar = true;
+      }else{
+        that.isBar = false;
+      }
+    });
+    // this.setState({ dateTime: getCurrentDate(1) })
+  }
+  componentWillReceiveProps(nextProps) {
+    if (nextProps.fillActive.name != this.props.fillActive.name) {
+      this.setState({ num: 0 })
+    }
+  }
+  changeShowFill() {
+    this.setState({ showFill: false })
+    this.props.setHighter(48)
+  }
+  handleChangeDate(info) {
+    let date = getCalendarDate(info);
+    this.setState({ dateTime: date, date: false })
+  }
+  handleSearchAdvice(e) {
+    let tmpShow = this.state.show;
+    this.setState({ show: !tmpShow, pageTop: getPageCoordinate(e).boxTop })
+    // e.stopPropagation();
+    if(tmpShow){
+      this.props.setHighter(48)
+    }else{
+      this.props.detailClick(5)
+      setPosition(e,"#searchOption",this.props.setHighter)
+    }
+  }
+  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 : getCurrentDate(1)
+    })
+    // e.stopPropagation();
+  }
+  handleShowDate() {
+    this.setState({
+      date: !this.state.date
+    })
+  }
+  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 = getCurrentDate(1);
+      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 })
+    }
+  }
+  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} ref={this.$ul}>
+      {
+        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>
+                <span className={styles.itemPartT}>
+                  <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>
+                </span>
+              </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} title={item.labelSuffix}>{item.labelSuffix}</p>
+                </span>
+              </li>
+            )
+          }
+        })
+      }
+    </ul>
+  }
+  getSearchList(list) {//搜索列表
+    const { handleSign } = this.props;
+    const contStyle={
+      opacity:'0.4',
+      right:'0',
+      top:'1px',
+      zIndex:'15',
+      width:'14px',
+      background:'#f1f1f1'};
+    const barStyle={background:'#777',width:'100%'};
+    return <ScrollArea speed={0.8}
+                       horizontal={false}
+                       stopScrollPropagation={list.length>6?true:false}
+                       style={{'max-height':'205px'}}
+                       className={styles["area"]}
+                       verticalContainerStyle={contStyle}
+                       verticalScrollbarStyle={barStyle}
+                       contentClassName="content">
+      <ul className={`${styles.searchLiUl} ${styles.searchIsp}`}>
+      {
+        list && list.map((item, idx) => {
+          return <li key={idx}
+            className={styles.searchLi}
+            title={item.uniqueName}
+            onClick={() => {
+              this.props.setHighter(48)
+              handleSign(item, idx, 'search');
+              this.setState({ show: false })
+            }}
+          >
+            {item.uniqueName}
+          </li>
+        })
+      }
+      </ul></ScrollArea>;
+  }
+  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={() => {
+              this.props.setHighter(48)
+              handleSign(item.questionId, idx, 'common');
+              this.setState({ show: false })
+            }}
+          >
+            {item.name}
+          </li>
+        })
+      }
+    </ul>
+  }
+  showDetails(val) {
+    let min = val.minValue, max = val.maxValue, value = val.value, dom = '';
+    dom = getDomUpDown(min,max,value)
+    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>
+      return <td style={{ width: '20%' }}>{dom} {val.labelSuffix}</td>
+    }
+  }
+  render() {
+    const {setHighter,refreshScroller, getInfomation,setTipValue, handleChangeValue,labelListSmall,inspectList, inspectVal, list, labelListBig, windowHeight, windowWidth,detailClick, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush,handleDelConfirm } = this.props;
+    const { tmpId, tmpIdx, time, pageTop, impId } = this.state;
+    const contStyle={
+      opacity:'0.4',
+      right:'0',
+      top:'1px',
+      zIndex:'15',
+      width:'14px',
+      background:'#f1f1f1'};
+    const barStyle={background:'#777',width:'100%'};
+    return (
+      <div className={styles.wrapper}>
+        <div className={styles.check}>
+          
+          <ul className={styles.labelWrap} >
+            {
+              labelListSmall && labelListSmall.map((item, idx) => {
+                return <SlidePic
+                  item={item}
+                  time={time}
+                  handlePush={handlePush}
+                  handleDelClick={this.handleDelClick}
+                  setTipValue={setTipValue}
+                  handleDelConfirm={handleDelConfirm}
+                ></SlidePic>
+              })
+            }
+            {
+              labelListBig && labelListBig.map((item, idx) => {
+                return <SlidePic
+                  item={item}
+                  time={time}
+                  handlePush={handlePush}
+                  handleDelClick={this.handleDelClick}
+                  setTipValue={setTipValue}
+                  handleDelConfirm={handleDelConfirm}
+                ></SlidePic>
+              })
+            }
+          </ul>
+        </div>
+        <div style={{ position: "relative", clear: "both", top: "5px" }}>
+          <Add showText="添加医嘱" handleClick={(e) => this.handleSearchAdvice(e)} id="searchWrapAdvice" />
+          {this.state.show ? <SearchOption searchType="2" detailClick={detailClick} windowHeight={windowHeight} height={280} refreshScroller={refreshScroller} pageTop={pageTop} handleChangeValue={handleChangeValue} visible={true}>
+            {list && list.length > 0 ? this.getSearchList(list) : (inspectVal == '' ? '' : <p style={{ padding: '5px 30px', color: '#bfbfbf' }}>暂无筛选项</p>)}
+            {/* {
+              (list && list.length > 0) || (inspectVal != '') || (inspectList&&inspectList.length==0) ? '' : <div>
+                <p style={{ padding: '5px 30px', color: '#bfbfbf' }}>常用化验项</p>
+                <ScrollArea speed={0.8}
+                            horizontal={false}
+                            stopScrollPropagation={true}
+                            style={{height:'225px'}}
+                            className={styles["area"]}
+                            verticalContainerStyle={contStyle}
+                            verticalScrollbarStyle={barStyle}
+                            contentClassName="content">
+                {
+                  this.getCommonList()
+                }
+                </ScrollArea>
+              </div>
+            } */}
+          </SearchOption> : ''}
+        </div>
+      </div>
+    )
+  }
+}
+
+export default AddNewInspect;

+ 260 - 0
src/components/AddNewInspect/index.less

@@ -0,0 +1,260 @@
+
+@import "~@less/variables.less";
+.labelWrap>li {
+    // cursor: pointer;
+    // color: #767676;
+    position: relative;
+    padding-top: 10px;
+    padding-bottom: 10px;
+    border-bottom:1px dashed #989DA3;
+    i {
+        font-style: normal;
+        display: inline-block;
+        vertical-align: top;
+        padding-top: 3px;
+        &:before {
+            content: '\300C';
+        }
+        &:after {
+            content: '\300D';
+        }
+    }  
+    &>p {
+        cursor: pointer;
+        color: #767676;
+        display: inline-block;
+        position: relative;
+        vertical-align: top;
+    } 
+    .partDel {
+        width: 13px;
+        height: 13px;
+        margin-bottom: 11px;
+        cursor: pointer;
+        display: inline-block;
+        position: absolute;
+        right: 0;
+        top: 12px;
+        background-color: #fff;
+    }
+}
+.staticTagActive {
+    cursor: pointer;
+    color: #333;
+    display: inline-block;
+    position: relative;
+    vertical-align: top;
+    padding: 2px 10px;
+    box-sizing: border-box;
+    width: 20%;
+    float: left;
+    span {
+        border-bottom: 1px solid #666666 ;
+    }
+}
+
+.staticTag {
+    cursor: pointer;
+    // color: #767676;
+    color: @blue;
+    padding-top: 10px;
+    display: inline-block;
+    position: relative;
+    /* &:before {
+        content: '\300C';
+    }
+    &:after {
+        content: '\300D';
+    } */
+}
+.labelWrap {
+    .table {
+        color: #000;
+        width: 80%;
+        tr {
+            line-height: 18px;
+            height: 18px;
+            width: 100%;
+            td {
+                padding-top: 3px;
+            }
+        }
+    }
+
+}
+
+.wrapper {
+    position: relative;
+}
+.fillWrap {
+    display: none;
+}
+.searchLiUl {
+  /*overflow-y: auto;
+  max-height: 225px;*/
+  // min-height: 80px;
+}
+.searchIsp {
+    display: block !important;
+    left: 107px !important;
+    width: 250px !important;
+    top: 0 !important;
+    float: right;
+}
+.searchLi {
+    height: 36px;
+    line-height: 36px;
+    padding: 0 30px;
+    padding-top: 0;
+    box-sizing: border-box;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    border: 1px solid transparent;
+    cursor: pointer;
+    background-color: #f5f5f5;
+}
+
+.searchLi:hover {
+    border: 1px solid @blue;
+}
+
+.searchResult {
+    .searchResultT {
+        img {
+            float: right;
+        }
+    }
+}
+.searchLis {
+    padding-top: 10px;
+    margin-top: 5px;
+    margin-bottom: 5px;
+    border-top: 1px solid #EAEDF1;
+    overflow: hidden;
+    box-sizing: border-box;
+}
+.itemPart {
+    height: 28px;
+    line-height: 28px;
+    overflow: hidden;
+    padding-top: 0 !important;
+    width: 330px;
+    float: left;
+    padding: 0 15px;
+    box-sizing: border-box;
+    span {
+        display: inline-block;
+    }
+    .itemPartL {
+        max-width: 180px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        float: left;
+    }
+    .itemPartR {
+        width: 62px;
+        outline: none;
+        float: left;
+        margin-top: 5px;
+    }
+    .itemPartT {
+        float: right;
+        width: 120px;
+        input {
+            width: 40px;
+            text-align: center;
+            float: left;
+            margin-right: 10px;
+            height: 28px;
+            line-height: 28px;
+        }
+        .unit {
+            display: inline-block;
+            width: 70px;
+            height: 28px;
+            line-height: 28px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+        }
+    }
+}
+.itemPartOne {
+    width: 100% !important;
+}
+.excelDataLists {
+    position: relative;
+    background-color: rgba(237,237,237,0.4);
+    border: 1px solid #ccc;
+    .close {
+        display: inline-block;
+        width: 15px;
+        height: 15px;
+        position: absolute;
+        top: -5px;
+        right: -5px;
+        z-index: 1;
+        border-radius: 50%;
+        background: @closeIcon;
+        // background: url('/img/close.png') no-repeat center center;
+        background-size: 100% 100%;
+        background-color: #fff;
+    }
+    .excelDataLis {
+        padding: 2px 0px;
+        border-bottom: 1px dashed #989DA3;
+        .excelDataTitle {
+            display: inline-block;
+            width: 20%;
+            vertical-align: top;
+            padding-left: 10px;
+            float: left;
+        }
+        table {
+            width: 80%;
+            tr {
+                height: 16px;
+                line-height: 16px;
+                width: 100%;
+            }
+            td {
+                text-align: left;
+                padding-top: 6px;
+            }
+            .excelUnit {
+                width: auto;
+                margin-left: 5px;
+            }
+        }
+    }
+}
+.excelDataLists:hover{
+    .close{
+        background: @closeHor;
+        background-size: 100% 100%;
+        background-color: #fff;
+        cursor: pointer;
+    }   
+}
+.center {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
+}
+.slides {
+  background-color: #ccc;
+  text-align: center;
+  height: 28px;
+  line-height: 28px;
+  margin: 10px 0 8px 0;
+  cursor: pointer;
+  span {
+    color:#7d7d7d;
+  }
+  img{
+    vertical-align: middle;
+  }
+}

BIN
src/components/NewAdvice/dists/FileAPI.flash.camera.swf


BIN
src/components/NewAdvice/dists/FileAPI.flash.image.swf


BIN
src/components/NewAdvice/dists/FileAPI.flash.swf


File diff suppressed because it is too large
+ 3608 - 0
src/components/NewAdvice/dists/FileAPI.html5.js


File diff suppressed because it is too large
+ 2 - 0
src/components/NewAdvice/dists/FileAPI.html5.min.js


File diff suppressed because it is too large
+ 4418 - 0
src/components/NewAdvice/dists/FileAPI.js


File diff suppressed because it is too large
+ 2 - 0
src/components/NewAdvice/dists/FileAPI.min.js


File diff suppressed because it is too large
+ 11008 - 0
src/components/NewAdvice/dists/jQuery.js


File diff suppressed because it is too large
+ 4 - 0
src/components/NewAdvice/dists/jq.js


File diff suppressed because it is too large
+ 2 - 0
src/components/NewAdvice/dists/jquery.fileapi.min.js


+ 357 - 0
src/components/NewAdvice/index.jsx

@@ -0,0 +1,357 @@
+import React from 'react';
+import { ItemBox, ConfirmModal, WrapModalContainer } from '@commonComp';
+import AddNewInspect from '../AddNewInspect';
+import styles from './index.less';
+import { getExcelList } from '@store/actions/inspect';
+import Notify from '@commonComp/Notify';
+import store from '@store';
+import $ from 'jquery';
+import { host, prefix } from '@utils/config.js';
+import { isIE, getUrlArgObject,getCurrentDate,setFontColorSize } from '@utils/tools.js';
+import { dragBox } from '@utils/drag';
+import WrapModalBody from '@containers/WrapModalBody';
+import {getMRAnalyse} from '@store/async-actions/pushMessage';
+import {SET_CURRENT_MODULE} from '@types/homePage';
+
+
+(function ($) {
+  var FileAPI = {
+    // @default: "./dist/"
+    staticPath: './dists/',
+
+    // @default: FileAPI.staticPath + "FileAPI.flash.swf"
+    flashUrl: './dists/FileAPI.flash.swf',
+
+    // @default: FileAPI.staticPath + "FileAPI.flash.image.swf"
+    flashImageUrl: './dists/FileAPI.flash.image.swf'
+  };
+  return FileAPI
+})($)
+
+import "./dists/FileAPI.js";
+
+const isLocal = window.location.hostname.indexOf('localhost') != -1;
+const qhost = isLocal ? host + prefix : prefix;
+const api = { 
+  upload: qhost + '/lisExcelRes/lisExcelAnalysis'
+};
+let numFlg = 0;
+
+class NewAdvice extends React.Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      val: '',
+      visible: false,
+      dom: [],
+      isIE: isIE(),
+      ieVersion: null,
+      height: '-1',
+      hide: false,
+      importLis:false
+    }
+    this.handleImportExcel = this.handleImportExcel.bind(this);
+    this.cancel = this.cancel.bind(this);
+    this.getWarings = this.getWarings.bind(this);
+    this.checkSystemIpt = this.checkSystemIpt.bind(this);
+    this.onClose = this.onClose.bind(this);
+    this.handleBindFileApi = this.handleBindFileApi.bind(this);
+    this.closeInIcss = this.closeInIcss.bind(this);
+    this.showSlideImport = this.showSlideImport.bind(this);
+    this.refreshScroller = this.refreshScroller.bind(this);
+  }  
+  componentDidMount() {
+    $(document).click((event) => {
+      let searchWrap = $('#importInspectBtn')[0];   // 导入按钮按钮
+      let searchOption = $('#importList')[0];   // 下拉列表
+      if (searchOption&&$('#importList').css("display")=="block") {
+        if(searchWrap != event.target){
+          this.setState({ importLis: false });
+        }
+      }
+    });
+    this.props.setContext(this.context)
+  }
+  handleBindFileApi(){
+    const {message} = this.props;
+    var ua = navigator.userAgent;
+    var _isIE = ua.indexOf("MSIE") > -1;
+    if (_isIE) {
+      let version = ua.match(/MSIE ([\d.]+)/)[1];
+      this.setState({
+        ieVersion: version
+      })
+    }
+    $('iframe').bind('load', function () { })
+    const { fetchPushInfos } = this.props;
+    // FileAPI.debug = true
+    $.support.cors = true;
+    const that = this;
+    var choose = document.getElementById('choose');
+    FileAPI.event.on(choose, 'change', function (evt) {
+      var files = FileAPI.getFiles(evt);
+      FileAPI.filterFiles(files, function (file, info) {
+        let name = file.name;
+        // if( name.split('.')[1] == 'xlsx' || name.split('.')[1] == 'xls' ){
+        //     Notify.error('请选择正确的excel表格')
+        //     return false;
+        // }else{
+        //     return true;
+        //   }
+          return true;
+      },
+        function (files, rejected) {
+          if (files.length) {
+            //console.log(files[0])
+            const securityCode = getUrlArgObject("code");
+            const appKeyId = getUrlArgObject("appI");
+            const appKeySecret = getUrlArgObject("appS");
+            const productId = getUrlArgObject("productId");
+            FileAPI.upload({
+              // url: '/api/icss/lisExcelRes/lisExcelAnalysis',
+              url: api.upload,
+              data: { hospitalCode: message == '{}' ? '' : message.hospitalCode },
+              files: { uploadfile: files[0] },
+              headers: {
+                appKeyId: appKeyId,
+                appKeySecret: appKeySecret,
+                securityCode: securityCode,
+                productId: productId
+              },
+              complete: function (err, xhr) {
+                if (!err) {
+                  let res = JSON.parse(xhr.response);
+                  if(res.code == 0){
+                    let message = res.data.messages;
+                    if(res.data.lisExcelRes){
+                      for(let i = 0;i < res.data.lisExcelRes.length;i++){
+                        let tmpLisExcelItem = res.data.lisExcelRes[i]
+                        if(tmpLisExcelItem.lisExcelItem){
+                          for(let j = 0;j < tmpLisExcelItem.lisExcelItem.length;j++){
+                            tmpLisExcelItem.lisExcelItem[j].time = tmpLisExcelItem.lisExcelItem[j].time||getCurrentDate(1)
+                          }
+                        }
+                      }
+                    }
+                    store.dispatch(getExcelList(res.data));
+                    store.dispatch(getMRAnalyse());
+                    fetchPushInfos && fetchPushInfos({mode:8});
+                    if (message && message.length != 0) {
+                      that.setState({
+                        visible: true,
+                        dom: message,
+                        height: message.length
+                      })
+                    }
+                  }else{
+                    Notify.error(res.msg)
+                  }
+                  $("#choose").val("");
+                } else {
+                  let res = JSON.parse(xhr.response);
+                  Notify.error(res.msg)
+                  $("#choose").val("");
+                }
+              }
+            });
+          }
+        });
+    });
+  }
+  handleImportExcel() {
+    this.inputRef.click();
+    const storeState = store.getState()
+    const {moduleName} = storeState.homePage
+    if(moduleName != '化验') {
+      store.dispatch({
+        type: SET_CURRENT_MODULE,
+        moduleName:'化验'
+      });
+      store.dispatch(getMRAnalyse());
+    }
+  }
+  cancel() {
+    this.setState({ visible: false })
+  }
+  getStyle() {
+    const { ieVersion } = this.state;
+    if (ieVersion && ieVersion <= 9) {
+      return styles.disabledBtn;
+    } else {
+      return styles.button;
+    }
+  }
+  getWarings(lis) {
+    <ul>
+      {
+        lis.length > 0 && lis.map((val) => {
+          return <li>
+            {val}
+          </li>
+        })
+      }
+    </ul>
+  }
+  checkSystemIpt() {
+    this.setState({
+      hide: true
+    })
+    const storeState = store.getState()
+    const {moduleName} = storeState.homePage
+    if(moduleName != '化验') {
+      store.dispatch({
+        type: SET_CURRENT_MODULE,
+        moduleName:'化验'
+      });
+      store.dispatch(getMRAnalyse());
+    }
+  }
+  onClose() {
+    this.setState({
+      hide: false
+    })
+    dragBox('previewWrapper', 'previewStatic', 'del')
+  }
+  closeInIcss(){
+    this.setState({
+      hide: false
+    })
+  }
+  showSlideImport(){
+    let flg = this.state.importLis
+    this.setState({
+      importLis:!flg
+    })
+    const storeState = store.getState()
+    const {moduleName} = storeState.homePage
+    if(moduleName != '化验') {
+      store.dispatch({
+        type: SET_CURRENT_MODULE,
+        moduleName:'化验'
+      });
+      store.dispatch(getMRAnalyse());
+    }
+  }
+  refreshScroller(){
+    //滚动条对象
+    return this.context.scrollArea;
+    /*this.context.scrollArea.refresh();
+    this.context.scrollArea.scrollBottom();*/
+
+  }
+  render() {
+    const {hideAllDrop,setHighter,labelListBig, fetchPushInfos,getInfomation,labelListSmall, hospitalMsg, inspectVal, windowHeight, windowWidth,setTipValue, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList,detailClick,handleDelConfirm } = this.props;
+    const { ieVersion, isIE, hide,importLis } = this.state;
+    const { checkSystemIpt, onClose,handleBindFileApi,closeInIcss,showSlideImport } = this;
+    if(JSON.stringify(hospitalMsg) != {} && document.getElementById("choose")){//动态绑定只绑定一次
+      ++numFlg
+      numFlg == 1?handleBindFileApi():null
+    }
+    return (
+      <div className={styles.wrapper}>
+        {/* 导入功能插件,ie8/9权限问题暂未解决,先隐藏 */}
+        <div className={styles.top}>
+          <span id="inspectResultData" className={styles.newAdviceTitle}> </span>
+          {/* <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}> */}
+          {/* <div className={this.getStyle()} style={{ display: hospitalMsg.import_way_lis == 0||hospitalMsg.import_way_lis ==undefined ? 'none' : 'block' }}> */}
+            {/* <button disabled={ieVersion&&ieVersion>9?true:false}onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>导入化验结果</button>
+            <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} /> */}
+            {/* {0没有,1本地,2医院,3本地和医院} */}
+            {/* {
+              hospitalMsg.import_way_lis == 1 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>
+                <p className={styles.importInspectBtn}>导入化验结果</p>
+                <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
+              </div> : hospitalMsg.import_way_lis == 2 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
+                <p className={styles.importInspectBtn}>导入化验结果</p>
+              </div> : hospitalMsg.import_way_lis == 3 ? <div className={`${styles.pushButton} ${styles.importInspect}`} onClick={showSlideImport}>
+                <p id="importInspectBtn" className={styles.importInspectBtn}>导入化验结果</p>
+                {
+                  <ul className={styles.importSelect} style={{display:importLis?'block':'none'}} id="importList">
+                    <li className={styles.excelIpt}>
+                      <div onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>本地导入</div>
+                      <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
+                    </li>
+                    <li className={`${styles.excelIpt} ${styles.systemIpt}`} onClick={checkSystemIpt}>从设备导入</li>
+                  </ul>
+                }
+              </div> : null
+            } */}
+
+            {/* {
+              hide ? <WrapModalContainer title={'导入化验数据'} width={1000} height={570} onClose={onClose}>
+                <WrapModalBody
+                  height={570}
+                  closeInIcss={closeInIcss}
+                ></WrapModalBody>
+              </WrapModalContainer> : null
+            } */}
+          {/* </div> */}
+        </div>
+        <ItemBox
+          hideAllDrop={hideAllDrop}
+          className={styles.title}
+          title={'医嘱'}
+          editable={false}
+          border={true}
+          // style={{marginRight:'0'}}
+          marginTop={'0px'}
+        >
+          <div style={{ padding: '10px', boxSizing: 'border-box',color:'#000' }} >
+            <AddNewInspect
+              handleDelConfirm={handleDelConfirm}
+              labelListBig={labelListBig}
+              labelListSmall={labelListSmall}
+              handleSign={handleSign}
+              setHighter={setHighter}
+              refreshScroller={this.refreshScroller}
+              handleChangeValue={handleChangeValue}
+              list={list}
+              handlePush={fetchPushInfos}
+              detailClick={detailClick}
+              labelList={labelList}
+              handleLabelSub={handleLabelSub}
+              fillActive={fillActive}
+              handleClear={handleClear}
+              handleConfirm={handleConfirm}
+              changeActivePart={changeActivePart}
+              getExcelDataList={getExcelDataList}
+              handleCloseExcel={handleCloseExcel}
+              labelListActive={labelListActive}
+              delPartItem={delPartItem}
+              inspectList={inspectList}
+              getInfomation={getInfomation}
+              inspectVal={inspectVal}
+              windowHeight={windowHeight}
+              windowWidth={windowWidth}
+              setTipValue={setTipValue}
+            >
+            </AddNewInspect>
+          </div>
+        </ItemBox>
+        <ConfirmModal visible={this.state.visible}
+          okText='删除'
+          cancelText='确定'
+          width="450"
+          height={(this.state.height > 2 && this.state.height < 8) ? ((this.state.height * 30 + 120) + 'px') : this.state.height > 8 ? '350px' : '200px'}
+          noFooter={true}
+          close={this.cancel}>
+          <ul className={styles.excelList}>
+            {
+              this.state.dom.length > 0 && this.state.dom.map((val) => {
+                return <li className={styles.excelListWaring}>
+                  {val}
+                </li>
+              })
+            }
+          </ul>
+          <div onClick={this.cancel} className={styles.confirmBtn}>确定</div>
+        </ConfirmModal>
+      </div>
+    )
+  }
+}
+
+NewAdvice.contextTypes = {
+  scrollArea: React.PropTypes.object
+};
+export default NewAdvice;

+ 112 - 0
src/components/NewAdvice/index.less

@@ -0,0 +1,112 @@
+@import "~@less/mixin.less";
+
+.wrapper{
+  // margin-right: 470px;
+}
+.top {
+    position: relative;
+    margin: 20px 20px -21px 20px;
+    span {
+        margin-left: 60px;
+        border: 1px dashed @part-border-color;
+        border-bottom: 1px solid #fff;
+        display: inline-block;
+        width: 118px;
+        height: 30px;
+        line-height: 30px;
+        text-align: center;
+        position: relative;
+        z-index: 10;
+    }
+    .newAdviceTitle {
+      border: 0 none;
+    }
+    .button {
+        float: right;
+        border-radius: 5px;
+        border: 1px solid @template-color;
+        // overflow: hidden;
+        margin-top: -3px;
+        position: relative;
+        z-index: 10;
+    }
+    .disabledBtn{
+        float: right;
+        border-radius: 5px;
+        border: 1px solid @placeholder-color;
+        overflow: hidden;
+        button{
+            color:@placeholder-color;
+        }
+    }
+    .pushButton {
+        font-size: 12px;
+        padding: 0 8px;
+        background-color: #fff;
+        height: 28px;
+        line-height: 28px;
+        border-radius: 5px;
+        color: @template-color;
+        cursor: pointer;
+        // &:hover {
+        //   .importSelect {
+        //     display: block !important;
+        //   }
+        // }
+    }
+}
+.title {
+    margin-top: 12px !important;
+}
+.excelList {
+    padding-bottom: 20px;
+    max-height: 240px;
+    overflow-y: auto;
+}
+.excelListWaring {
+    height: 30px;
+    line-height: 30px;
+    text-align: center;
+}
+.confirmBtn {
+    .btnCom;
+    width: 100px;
+    height: 34px;
+    line-height: 34px;
+    margin: 10px auto;
+    background-color: #78bddd;
+    // border-radius: 5px;
+    // text-align: center;
+    color: #fff;
+    // cursor: pointer;
+}
+.importInspect{
+  padding: 0 !important;
+}
+.importInspectBtn {
+  padding: 0 8px;
+  font-size: 12px;
+}
+.importSelect {
+  position: absolute;
+  width: 120%;
+  top: 29px;
+  left: 0;
+  z-index: 10;
+  font-size: 12px;
+  box-shadow: 0 10px 20px 0 #989DA3;
+  border: 1px solid #dedede;
+  background-color: #fff;
+  display: none;
+  li {
+    height: 34px;
+    line-height: 34px;
+    padding-left: 10px;
+    cursor: pointer;
+  }
+  li:hover {
+    background-color: @ipt-color;
+    color: #2A9BD5;
+  }
+}
+

+ 116 - 0
src/containers/NewAdvice.js

@@ -0,0 +1,116 @@
+import React from 'react';
+import {
+  connect
+} from 'react-redux';
+import newAdvice from '@components/NewAdvice';
+import {
+  getSearchList,
+  getSublableList,
+} from '@store/async-actions/newAdvice';
+import {
+  setLabel,
+  fillActived,
+  fillActiveDetail,
+  checkValueIsChange,
+  delExcelLis,
+  clearLabel,
+  delPartItem,
+  setContext,
+  setTip,
+  searchTypeNew,
+  resetLabel,
+  delOnePic,
+} from '@store/actions/newAdvice';
+import {
+  billing,
+  embedPush,
+  getConceptDetail,
+  getMRAnalyse
+} from '@store/async-actions/pushMessage';
+import {HIDEDROP} from '@types/homePage';
+
+function mapStateToProps(state) {//console.log(state)
+  return {
+    list: state.newAdvice.list,
+    labelList: state.newAdvice.labelList,
+    fillActive: state.newAdvice.fillActive,
+    shType: state.newAdvice.shType,
+    getExcelDataList: state.newAdvice.getExcelDataList,
+    labelListActive: state.newAdvice.labelListActive,
+    inspectList: state.homePage.inspectList,
+    windowHeight: state.homePage.windowHeight,
+    windowWidth: state.homePage.windowWidth,
+    inspectVal: state.newAdvice.inspectVal,
+    message: state.patInfo.message,
+    labelListBig: state.newAdvice.labelListBig,
+    labelListSmall: state.newAdvice.labelListSmall,
+    hospitalMsg: state.homePage.sysConfig || {},
+    typeConfig: state.typeConfig
+  }
+}
+
+function mapDispatchToProps(dispatch) {
+  return {
+    detailClick(val){
+      dispatch(searchTypeNew(val))
+    },
+    setContext(obj){
+      dispatch(setContext(obj))
+    },
+    handleDelConfirm(obj){
+      dispatch(delOnePic(obj))
+    },
+    handleChangeValue(val) {
+      dispatch(getSearchList(val))
+    },
+    getInfomation(item) {
+      dispatch(getConceptDetail(item))
+    },
+    handleSign(arr,id, idx, type) {
+      dispatch(resetLabel(arr))
+      // dispatch(setLabel(idx, type))
+      // dispatch(getSublableList(id))
+      // dispatch(getMRAnalyse())
+    },
+    handleLabelSub(e, id, idx) {
+      dispatch(fillActived(id, idx))
+      // e.stopPropagation()
+    },
+    handleClear(e, idx) {
+      e.stopPropagation();
+      dispatch(clearLabel(idx))
+    },
+    handleConfirm(e, idx, time, arr) {
+      e.stopPropagation();
+      dispatch(checkValueIsChange(idx, time, arr))
+    },
+    changeActivePart(idx, value) {
+      dispatch(fillActiveDetail(idx, value))
+    },
+    handleCloseExcel(idx) {
+      dispatch(delExcelLis(idx));
+      dispatch(getMRAnalyse())
+    },
+    delPartItem(idx) {
+      dispatch(delPartItem(idx))
+      dispatch(getMRAnalyse())
+    },
+    setTipValue(item,value) {
+      dispatch(setTip(item,value))
+    },
+    //右侧推送
+    fetchPushInfos(obj) {
+      //调右侧推送
+      dispatch(embedPush(obj));
+    },
+    hideAllDrop(){
+      dispatch({
+        type:HIDEDROP
+      });
+    },
+  }
+}
+
+const NewInspectAction = connect(mapStateToProps, mapDispatchToProps)(newAdvice);
+
+export default NewInspectAction;

+ 79 - 0
src/store/actions/newAdvice.js

@@ -0,0 +1,79 @@
+import {SET_CONTEXT,DEL_ONE_PIC,ADD_LABEL,SEARCH_LIST,SET_LABEL,SET_TIP,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL_NEW,CLEAR_ALL_LABEL,DEL_PART_ITEM_NEW,DEL_EXCEL_LIST,SEARCH_TYPE_NEW} from '../types/newAdvice';
+
+export const setLabel = (idx,sign) => ({          //搜索后点击选中的结果
+    type:SET_LABEL,
+    idx,
+    sign
+})
+export const addLabel = (lis) => ({          //右侧开单
+    type:ADD_LABEL,
+    lis
+})
+export const resetLabel = (list,uniqueName) => ({          //搜索后点击选中的结果重组
+    type:RESET_LABEL_NEW,
+    list,
+    uniqueName
+})
+
+export const fillActived = (id,idx) => ({
+    type:FILL_ACTIVE,                          //选中的标签的填写单
+    id,
+    idx
+})
+
+export const fillActiveDetail = (idx,val) => ({
+    type:FILL_ACTIVE_DETAIL,                       //填写数据更新
+    idx,
+    val
+})
+export const getExcelList = (data) => ({                 //获取导入数据
+    type:GET_EXCEL,
+    data
+})
+export const checkValueIsChange = (idx,time,arr) => ({                 //检查值是否变化
+    type:CHECK_VALUE_IS_CHANGE,
+    idx,
+    time,
+    arr
+})
+export const searchList = (list,val) => ({         //检索数据
+  type:SEARCH_LIST,
+  list,
+  val
+})
+export const clearLabel = (idx) => ({                  //清空
+    type:CLEAR_LABEL,
+    idx
+})
+export const delPartItem = (idx) => ({                  //删除部分
+    type:DEL_PART_ITEM_NEW,
+    idx
+})
+export const delExcelLis = (idx) => ({                  //删除导入的数据
+    type:DEL_EXCEL_LIST,
+    idx
+})
+export const clearAllLabel = (data,dataExcel,saveTextData) => ({                  //清空所有
+    type:CLEAR_ALL_LABEL,
+    data,
+    dataExcel,
+    saveTextData
+})
+export const setContext = (obj) => ({
+    type:SET_CONTEXT,
+    obj
+})
+export const setTip = (item,value) => ({
+    type:SET_TIP,
+    item,
+    value
+})
+export const searchTypeNew = (value) => ({
+    type:SEARCH_TYPE_NEW,
+    value
+})
+
+export const delOnePic = (item) => ({
+    type:DEL_ONE_PIC,
+    item
+})

+ 64 - 0
src/store/async-actions/newAdvice.js

@@ -0,0 +1,64 @@
+import axios from '@utils/ajax';
+import store from '@store';
+import { searchList,resetLabel } from '../actions/newAdvice';
+
+export const getSearchList = (val) => {
+    if(val.trim() == ''){
+        const data = [];
+        return (dispatch) => dispatch(searchList(data,''));
+    }
+    let baseList = store.getState();
+    let type = baseList.newAdvice.shType;
+    return (dispatch) => {
+        axios.json('/demo/retrieval/index',{
+            "age": 10,
+            "inputStr": val,
+            "sex": 1,
+            "type": type
+        })
+        .then((res)=>{
+            const data = res.data.data;let curDate=[];
+            if(type==2){
+                curDate = data.lisDetailNames
+            }else{
+                let arr = data.lisNames,tmp=[];
+                for (var key in arr) {
+                    let obj = {}
+                    obj['uniqueName'] = arr[key];
+                    obj['detailName'] = arr[key];
+                    obj['name'] = arr[key];
+                    obj['flg'] = 1;
+                    tmp.push(obj)
+                }
+                let obj = {}
+                    obj['flg'] = type==5?2:1;
+                    obj['name'] = '手术';
+                    obj['uniqueName'] = '手术';
+                    tmp.push(obj)
+                curDate=tmp
+            }
+            dispatch(searchList(curDate,val.trim()));
+        })
+    }
+};
+export const getSublableList = (id,idx) => {//getById
+    let baseList = store.getState();
+    let sex = baseList.patInfo.message.patientSex;
+    return (dispatch) => {
+        axios.json('/questionInfo/getById',{
+            age:baseList.patInfo.message.patientAge,
+            sexType:sex == '男'?'1' : sex == '女'?'2':'3',
+            id: id
+        })
+        .then((res)=>{
+            const data = res.data.data;
+            if (data.controlType == 0) {
+                dispatch(resetLabel(data.questionMapping,data.uniqueName||''));
+            }else if(data.controlType == 1||data.controlType == 6){
+                let arr = [];
+                arr[0] = data;
+                dispatch(resetLabel(arr));
+            }
+        })
+    }
+};

+ 288 - 0
src/store/reducers/newAdvice.js

@@ -0,0 +1,288 @@
+import {
+    SEARCH_LIST,
+    SET_LABEL,
+    FILL_ACTIVE,
+    GET_EXCEL,
+    CHECK_VALUE_IS_CHANGE,
+    CLEAR_LABEL,
+    RESET_LABEL_NEW,
+    CLEAR_ALL_LABEL,
+    DEL_PART_ITEM_NEW,
+    DEL_EXCEL_LIST,
+    ADD_LABEL,
+    SET_CONTEXT,
+    SET_TIP,
+    DEL_ONE_PIC,
+    SEARCH_TYPE_NEW,
+} from '../types/newAdvice';
+import store from '@store';
+import { getStringPlus,  getPushLists,  getPushList,getCurrentDate} from '@utils/tools.js';
+
+const initSearchList = {
+    list: [], //搜索的结果
+    labelList: [], //选中的结果,也是需要保存的数据
+    labelListActive: [], //缓存值
+    fillActive: {}, //选中的标签的填写单
+
+    getExcelData: {}, //导入的数据
+    inspectStrPlus:'',
+
+    getExcelDataList: [], //导入的数据
+    pushItem:[],    //推送的数据
+    pushItems:[],    //右侧模板预览的数据
+    inspectVal:'',
+    context:{},
+    shType:5,
+    labelListBig:[],//大项
+    labelListSmall:[],//小项
+}
+
+export default (state = initSearchList, action) => {
+    if (action.type == DEL_ONE_PIC) {
+        const newState = Object.assign({}, state);
+        let tempArr = newState.labelListBig;
+        let tempArrs = newState.labelListSmall;
+        let tmpLis = action.item
+        if(tmpLis&&tmpLis.flg == 1){//大项
+            tempArr = tempArr.filter((item)=>item.time != tmpLis.time)
+            newState.labelListBig = [...tempArr]
+        }else{//小项
+            tempArrs = tempArrs.filter((item)=> item.time != tmpLis.time )
+            newState.labelListSmall = [...tempArrs]
+        }
+        return newState;
+    }
+
+    if (action.type == SET_TIP) {    
+        const newState = Object.assign({}, state);
+        let tempArr = newState.labelListBig;
+        let tempArrs = newState.labelListSmall;
+        let tmpLis = action.item
+        tempArrs = tempArrs.filter((item)=>{
+            if(item.time == tmpLis.time){
+                item.value = action.value
+            }
+            return item
+        })
+        newState.labelListSmall = [...tempArrs]
+        return newState;
+    }
+    if (action.type == SEARCH_TYPE_NEW) {
+        const newState = Object.assign({}, state);
+        newState.shType = action.value
+        return newState;
+    }
+    if (action.type == RESET_LABEL_NEW) {             //选中的结果重组
+        const newState = Object.assign({}, state);
+        const tempArr = newState.labelListBig;
+        const tempArrs = newState.labelListSmall;
+        let tmpLis = action.list
+        tmpLis['time'] = getCurrentDate(1)
+        if(tmpLis.flg == 1){//大项
+            tempArr.push(tmpLis)
+            newState.labelListBig = [...tempArr]
+        }else{//小项
+            tempArrs.push(tmpLis)
+            newState.labelListSmall = [...tempArrs]
+        }
+        return newState;
+    }
+    if (action.type == SEARCH_LIST) {
+        const newState = Object.assign({}, state);
+        newState.list = action.list
+        newState.inspectVal = action.val
+        return newState;
+    }
+    if (action.type == SET_LABEL) {             //选中的结果    
+        const newState = Object.assign({}, state);
+        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) {
+                tempArrs.push(tempArr[i])
+                newState.labelList = [...tempArrs]
+            }
+        }
+        
+        let tmpArr = newState.getExcelDataList;
+        let tmpArr2 = newState.labelList;
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
+        return newState;
+    }
+    if (action.type == ADD_LABEL) {             //右侧推送的化验辅检项,点击开单放到左侧化验辅检的位置上
+        const newState = Object.assign({}, state);
+        const tempArr = newState.labelList;
+        for(let i = 0;i <action.lis.length;i++){
+          tempArr.push(action.lis[i]);
+        }
+        newState.labelList = [...tempArr]
+        
+        let tmpArr = newState.getExcelDataList;
+        let tmpArr2 = newState.labelList;
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems);
+        return newState;
+    }
+    if (action.type == FILL_ACTIVE) {                        //点击标签放到暂存里
+        const newState = Object.assign({}, state);
+        const tempArr = newState.labelList;
+        for (let i = 0; i < tempArr.length; i++) {
+            if (i == action.idx) {
+                newState.fillActive = tempArr[i]
+            }
+        }
+        return newState;
+    }
+    if (action.type == CLEAR_LABEL) {      //清空数据填写
+        const newState = Object.assign({}, state);
+        const tempArrs = newState.fillActive;
+        const tempArr = newState.fillActive.details;
+        let tmpArr = newState.getExcelDataList;
+        let tmpArr2 = newState.labelList;
+        for (let i = 0; i < tempArr.length; i++) {
+          // tempArr[i].value = ''
+        }
+        tempArrs.show = false;
+        newState.pushItem = getPushList(tmpArr,tmpArr2);
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
+        return newState;
+    }
+    if (action.type == GET_EXCEL) {              //导入数据
+        const newState = Object.assign({}, state);
+        let tmpArr = newState.getExcelDataList;
+        let tmpArr2 = newState.labelList;
+        newState.getExcelData = action.data
+
+        tmpArr.push(action.data)
+        newState.getExcelDataList = [...tmpArr]
+        newState.pushItem = getPushList(tmpArr,tmpArr2);
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
+        // getExcelString(action,newState,tmpArr,tmpArr2)
+        return newState;
+    }
+    if(action.type == DEL_EXCEL_LIST){       //删除excel列表的某个数据
+        const newState = Object.assign({}, state);
+        const tempArr2 = newState.labelList;
+        let tmpArr = newState.getExcelDataList;
+        tmpArr.splice(action.idx,1);
+        newState.getExcelDataList = [...tmpArr];
+        let tempArr1 = newState.getExcelDataList;
+        newState.pushItem = getPushList(tempArr1,tempArr2);
+        newState.pushItems = getPushLists(tempArr1,tempArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
+        return newState;
+    }
+    if (action.type == CHECK_VALUE_IS_CHANGE) {     //数据添加后显示与否
+        const newState = Object.assign({}, state);
+        // const tempArrAct = newState.fillActive;
+        const tempArr = action.arr;
+        tempArr.time = action.time;
+        let tmpArr = newState.getExcelDataList;
+        const tempArrs = newState.labelList;
+        tempArrs[action.idx] = tempArr;
+        newState.fillActive = tempArr;
+        newState.labelList = tempArrs;
+        // tempArrAct.show = true;
+        newState.pushItem = getPushList(tmpArr,tempArrs);
+        newState.pushItems = getPushLists(tmpArr,tempArrs);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
+        return newState;
+    }
+    if (action.type == CLEAR_ALL_LABEL) {     //清空所有数据
+        const newState = Object.assign({}, state);
+        newState.labelList =action.data;
+        newState.getExcelDataList = action.dataExcel;
+        let tmpArr = action.dataExcel;
+        const tempArrs = action.data;
+        newState.pushItem = getPushList(tmpArr,tempArrs);
+        newState.inspectStrPlus = action.saveTextData;
+        return newState;
+    }
+    if (action.type == DEL_PART_ITEM_NEW) {     //清空填寫数据
+        const newState = Object.assign({}, state);
+        const tempArr = newState.labelList;
+        tempArr.splice(action.idx,1);
+        newState.labelList = [...tempArr];
+        let tmpArr = newState.getExcelDataList;
+        newState.pushItem = getPushList(tmpArr,tempArr);
+        newState.pushItems = getPushLists(tmpArr,tempArr);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
+        return newState;
+    }
+    if (action.type == SET_CONTEXT) {    
+        const newState = Object.assign({}, state);
+        newState.context = action.obj
+        return newState;
+    }
+    return state;
+}
+
+function getExcelString(action,newState,tmpArr,tmpArr2) {
+  let tmpString = '';
+  if(JSON.stringify(action.data||{}) != '{}' && action.data.lisExcelRes.length > 0){
+    action.data.lisExcelRes.map((item)=>{
+        item.lisExcelItem.map((part)=>{
+            if(part.type == 1){
+                if(part.max != '' && (part.value-0) > (part.max-0) ) {
+                    let rate = (part.value/part.max).toFixed(2);
+                    let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'升高'+rate+';'
+                    tmpString += tmpStr;
+                }else if(part.min != '' && (part.value-0) < (part.min-0) ){
+                    let rate = (part.value/part.min).toFixed(2);
+                    let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'降低'+rate+';'
+                    tmpString += tmpStr;
+                }else{
+                    let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'异常;'
+                    tmpString += tmpStr;
+                }
+            }else{
+                let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'正常;'
+                tmpString += tmpStr;
+            }
+        })
+    })
+    newState.pushItem = getPushList(tmpArr,tmpArr2);
+    newState.pushItems = getPushLists(tmpArr,tmpArr2);
+    newState.inspectStrPlus = getStringPlus(newState.pushItems)
+  }else{
+    newState.inspectStrPlus = '';
+    newState.pushItem = []
+  }
+}
+function getString(lists) {
+    let tmpString = '';
+    lists.map((item)=>{
+        if(item.show == true){
+            item.details.map((part)=>{
+                if(part.value){
+                    if(typeof(part.value) == "number"){
+                        if(part.maxValue != '' && (part.value-0) > (part.maxValue-0) ) {
+                            let rate = (part.value/part.maxValue).toFixed(2);
+                            let tmpStr = item.name+','+part.name+','+part.value+' '+part.labelSuffix+'升高'+rate+';'
+                            tmpString += tmpStr;
+                        }else if(part.minValue != '' && (part.value-0) < (part.minValue-0) ){
+                            let rate = (part.value/part.minValue).toFixed(2);
+                            let tmpStr = item.name+','+part.name+','+part.value+' '+part.labelSuffix+'降低'+rate+';'
+                            tmpString += tmpStr;
+                        }else{
+                            let tmpStr = item.name+','+part.name+','+part.value+' '+part.labelSuffix+';'
+                            tmpString += tmpStr;
+                        }
+                    }else{
+                        tmpString += item.name+','+part.name+','+part.value+' '+part.labelSuffix+';'
+                    }
+                }
+            })
+        }
+    })
+    return tmpString;
+}

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

@@ -0,0 +1,17 @@
+export const SEARCH_LIST = 'SEARCH_LIST';
+export const SET_LABEL = 'SET_LABEL';
+export const FILL_ACTIVE = 'FILL_ACTIVE';
+export const FILL_ACTIVE_DETAIL = 'FILL_ACTIVE_DETAIL';
+export const GET_EXCEL = 'GET_EXCEL';
+export const CHANGE_MODAL_SHOW = 'CHANGE_MODAL_SHOW';
+export const CHECK_VALUE_IS_CHANGE = 'CHECK_VALUE_IS_CHANGE';
+export const CLEAR_LABEL = 'CLEAR_LABEL';
+export const RESET_LABEL_NEW = 'RESET_LABEL_NEW';
+export const CLEAR_ALL_LABEL = 'CLEAR_ALL_LABEL';
+export const DEL_PART_ITEM_NEW = 'DEL_PART_ITEM_NEW';
+export const DEL_EXCEL_LIST = 'DEL_EXCEL_LIST';
+export const ADD_LABEL = 'ADD_LABEL';
+export const SET_CONTEXT = 'SET_CONTEXT';
+export const SET_TIP = 'SET_TIP';
+export const SEARCH_TYPE_NEW = 'SEARCH_TYPE_NEW';
+export const DEL_ONE_PIC = 'DEL_ONE_PIC';