فهرست منبع

Squashed commit of the following:

commit 6c38756e3ca1c80cc8e517d91d04a2dcde7a3ff7
Author: Luolei <16657115156@163.com>
Date:   Wed Jan 30 16:00:51 2019 +0800

    打印医生签名自动获取

commit 98273ce5f5c7895fb32b0b1fd9c55c196aa27e2d
Author: Luolei <16657115156@163.com>
Date:   Wed Jan 30 14:09:41 2019 +0800

    样式调整

commit 1e5d96c6aed399cb07d43e400eb4ed57b2c19f4c
Author: Luolei <16657115156@163.com>
Date:   Wed Jan 30 14:02:27 2019 +0800

    化验填写单清空按钮,弹窗还在

commit a03cece3ea73d9dfd3eca1a44cf5fa248859cb48
Author: Luolei <16657115156@163.com>
Date:   Wed Jan 30 13:46:36 2019 +0800

    模板列表获取时机

commit 892cb82886b87e2e868f7f5ab8c896a3b4a031ff
Author: Luolei <16657115156@163.com>
Date:   Wed Jan 30 13:34:03 2019 +0800

    模板名称重复弹窗不关闭

commit 87c6d028a2657d667686ed1f8235ef86bf2ff400
Author: Luolei <16657115156@163.com>
Date:   Wed Jan 30 10:46:13 2019 +0800

    模板保存跟之前所有保存的模板作对比

commit 29c1368835bc2bd4c4dcd368419b916e86512b9e
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 17:35:01 2019 +0800

    底部几个按钮换行设置最小宽度

commit 7400613a1eb642e1d01004c7818883fd73c2350c
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 17:28:45 2019 +0800

    历史病例时间和按钮不能共存

commit eda3f4b08a3460360541cd2af1c2ca071681c595
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 17:12:47 2019 +0800

    bug修改

commit d13d3006f770c75fef4a4d16ac1e7b32691d5afc
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 15:54:49 2019 +0800

    还是符号处理...

commit 50e03ffa0a5ceaac50f9585ebefae27a05e838c7
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 14:17:40 2019 +0800

    顿号去重

commit d01d40bd967f15acc0872e83174ee8ad3e684b6f
Merge: 4095b3f b09559b
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 13:59:54 2019 +0800

    Merge branch 'dev/new1' into dev/byll

commit 4095b3ffaf8aa6c98e912bcbc5eef7f66ecb25b4
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 13:55:47 2019 +0800

    样式宽度更改和逗号处理

commit 79e0195a9b13069db729afe732bc5b466d43a37f
Author: Luolei <16657115156@163.com>
Date:   Fri Jan 25 14:06:09 2019 +0800

    date修改

# Conflicts:
#	src/utils/tools.js
liucf 6 سال پیش
والد
کامیت
2123a1e983

+ 1 - 1
src/common/components/InspectCommon/index.less

@@ -2,7 +2,7 @@
 .wrapper {
     position: absolute;
     top: 40px;
-    z-index: 20;
+    z-index: 99;
     background-color: #fff;
     padding:28px 8px 8px 8px;
     min-width: 300px;

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

@@ -6,7 +6,7 @@
     box-sizing: border-box;
     position: absolute;
     top: 40px;
-    z-index: 20;
+    z-index: 99;
     background-color: #fff;
     box-shadow: 0 6px 20px 0 #989DA3;
     margin-bottom: 80px;

+ 7 - 0
src/components/AddAssistCheck/Textarea/index.less

@@ -10,4 +10,11 @@
   line-height: 20px;
   resize: none;
   font-family: inherit;
+}
+.divTextarea:empty:before{ 
+  content: '报告描述或意见'; 
+  color: gray; 
+} 
+.divTextarea:focus:before{
+  content:none;
 }

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

@@ -3,7 +3,6 @@ import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@
 import { deepClone } from '@utils/tools';
 import styles from './index.less';
 import date1 from './img/date1.png';
-import date2 from './img/date2.png';
 import close from './img/close.png';
 import store from '@store';
 import $ from 'jquery';
@@ -340,7 +339,7 @@ class Inspect extends React.Component {
                                                     handleClear={(e)=>{
                                                         handleClear(e,idx)
                                                         this.setState({
-                                                            showFill:false
+                                                            currentData:fillActive
                                                         })
                                                     }}
                                                     handleConfirm={(e)=>{

+ 1 - 1
src/components/EMRContainer/index.less

@@ -6,7 +6,7 @@
   padding: 0px 0 10px 0 ;
   box-sizing: border-box;
   position: relative;
-  min-width: 720px;
+  min-width: 700px;
 }
 .inner{
 //   overflow-y: auto;

+ 6 - 1
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -49,11 +49,16 @@ class HistoryCaseContainer extends React.Component {
                                 items && items.length > 0? items.map((val,idx)=>{
                                     return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{handleCaseClick(e,idx)}}>
                                         <span title={val.diagnose}>{val.diagnose}</span>
-                                        <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
+                                        {/* <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
                                         <button 
                                             className={val.id == activeHistory.id?`${styles.quote} ${styles.quoteShow}`:styles.quote} 
                                             onClick={(e)=>{handleQuoteClick(e,val)}}
+                                        >引 用</button> */}
+                                        <button 
+                                            className={styles.quote} 
+                                            onClick={(e)=>{handleQuoteClick(e,val)}}
                                         >引 用</button>
+                                        <span className={styles.time}>{val.inquiryDate}</span>
                                     </li>
                                 }):<Empty message={'无历史病历'}></Empty>
                             }

+ 12 - 10
src/components/HistoryCaseContainer/HistoryList/index.less

@@ -6,7 +6,7 @@
     right: 0;
     bottom:0;
     margin: auto;
-    width: 1080px;
+    width: 1120px;
     top: 70px;
     bottom: 70px;
     background-color: #fff;
@@ -17,7 +17,7 @@
         right: 0;
     }
     .mainHistoryLeft {
-        width: 260px;
+        width: 300px;
         height: 100%;
         background: #F1F1F1;
         position: relative;
@@ -50,7 +50,7 @@
             height: 100%;
             span {
                 display: inline-block;
-                max-width: 150px;
+                max-width: 130px;
                 overflow: hidden;
                 text-overflow: ellipsis;
                 white-space: nowrap;
@@ -58,7 +58,7 @@
             li {
                 height: 54px;
                 line-height: 54px;
-                padding: 0 20px;
+                padding: 0 10px;
                 font-size: 14px;
                 cursor: pointer;
                 border: 1px solid transparent;
@@ -73,17 +73,19 @@
                 background-color: #fff;
             }
             .quote {
-                width: 60px;
-                height: 30px;
-                line-height: 30px;
+                width: 50px;
+                height: 22px;
+                line-height: 22px;
                 border-radius: 15px;
                 border: 0 none;
                 color: #fff;
                 background-color: @template-color;
                 float: right;
-                margin-top: 12px;
-                display: none;
+                margin-top: 16px;
+                font-size: 12px;
+                // display: none;
                 outline: none;
+                margin-left: 10px;
             }
             .quoteShow {
                 display: block;
@@ -94,6 +96,6 @@
         }
     }
     .mainHistoryRight {
-        margin-left: 260px;
+        margin-left: 300px;
     }
 }

+ 45 - 24
src/components/Operation/index.jsx

@@ -6,7 +6,6 @@ import saveHistory from '@common/images/saveHistory.png';
 import PrintPreviewContainer from '@containers/PrintPreviewContainer';
 import PreviewContainer from '@containers/PreviewContainer';
 import { ConfirmModal, Notify } from '@commonComp';
-import { changeVisible } from '@store/actions/tabTemplate';
 import {getAllDataList,getAllDataStringList} from '@utils/tools';
 import store from '@store';
 
@@ -143,17 +142,18 @@ class Operation extends Component {
       title: val
     })
   }
-  keypress(e) {
+  keypress(event) {
+    let e = event?event:window.event;
     if (e.keyCode == 13) {
-      this.makeSure()
-      store.dispatch(changeVisible(false))
+      // this.makeSure()
+      // store.dispatch(changeVisible(false))
     }
   }
   saveHis(type) {
-    let flg = this.getAllData()
+    const { diagShowTmp } = this.props;
+    let flg = this.getAllData();
     if(flg){
       this.setState({
-        visible: true,
         title: '',
         type: type,
         okText: '保存',
@@ -162,6 +162,7 @@ class Operation extends Component {
         oKBg: '#3B9ED0',
         msg: this.changeTitle()
       })
+      diagShowTmp(true)
     }
   }
   getAllData(){
@@ -169,16 +170,18 @@ class Operation extends Component {
     let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
-    let activeItemData = baseList.tabTemplate.activeItem;
-    // let preview = (activeItemData.preview).split('-').join('');
-
+    let tmpLis = baseList.tabTemplate.items;
     if (whichSign == 0) {
-      if (activeItemData && JSON.stringify(activeItemData) != '{}' && (activeItemData.dataJson == JSON.stringify(jsonData)) && (JSON.stringify(jsonStr) == JSON.stringify(JSON.parse(activeItemData.preview)))) {
-        Notify.info('该模板已保存');
-        return false;
-      }else if (
+      for(let i = 0;i <tmpLis.length;i++){
+        let dataStr = tmpLis[i].dataJson;
+        if(dataStr == JSON.stringify(jsonData)){
+          Notify.info('该模板已保存');
+          return false;
+        }
+      }
+      if (
         JSON.stringify(jsonData.advice) == '{}' &&
-        jsonData.chief.length < 1 &&
+        (jsonData.chief.length < 1 && jsonStr.chief == '[]') &&
         jsonData.diag.length < 1 &&
         jsonData.vital.length < 1 &&
         jsonData.other.length < 1 &&
@@ -193,10 +196,16 @@ class Operation extends Component {
         return true;
       }
     } else if(whichSign == 1) {
-      if (activeItemData && JSON.stringify(activeItemData) != '{}' && (JSON.stringify(jsonStr) == JSON.stringify(JSON.parse(activeItemData.preview)))) {
-        Notify.info('该模板已保存');
-        return false;
-      }else if (JSON.stringify(jsonData.advice) == '{}' && 
+      for(let i = 0;i <tmpLis.length;i++){
+        let dataStr = tmpLis[i].preview;
+        let jsStr = tmpLis[i].dataJson;
+        console.log(dataStr == JSON.stringify(jsonStr))
+        if(JSON.stringify(JSON.parse(dataStr)) == JSON.stringify(jsonStr) && jsStr == JSON.stringify(jsonData)){
+          Notify.info('该模板已保存');
+          return false;
+        }
+      }
+      if (JSON.stringify(jsonData.advice) == '{}' && 
           jsonStr.chief == '[]' && 
           jsonStr.present == '[]' && 
           jsonStr.other == '[]' && 
@@ -236,7 +245,7 @@ class Operation extends Component {
     </div>
   }
   makeSure() {
-    const { save, clear, saveDataAll } = this.props;
+    const { save, clear, saveDataAll,diagShowTmp } = this.props;
     const { type } = this.state;
     if (type == 1) {
       this.setState({ visible: false, title: '' })
@@ -249,15 +258,15 @@ class Operation extends Component {
         Notify.error('请输入模板名称')
         return;
       }
+      // diagShowTmp(false)
       saveDataAll(this.state.title);
-      this.setState({ visible: false, title: '' });
     }
   }
   render() {
     const { showPrint, closePrint, showPreview, closePreview } = this;
-    const { visible, preVisible } = this.props.print;
+    const { visible, preVisible,diagShow } = this.props.print;
+    const { diagShowTmp } = this.props;
     const {zIndex} = this.state;
-
     return <div className={style['container']} style={{zIndex:zIndex}}>
       <button className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</button>
       <button className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</button>
@@ -269,8 +278,20 @@ class Operation extends Component {
       <ConfirmModal
         visible={this.state.visible}
         confirm={() => { this.makeSure() }}
-        close={() => { this.setState({ visible: false, title: '' }) }}
-        cancel={() => { this.setState({ visible: false, title: '' }) }}
+        close={() => {this.setState({ visible: false, title: '' }) }}
+        cancel={() => {this.setState({ visible: false, title: '' }) }}
+        okText={this.state.okText}
+        okBorderColor={this.state.borderColor}
+        okColor={this.state.okColor}
+        oKBg={this.state.oKBg}
+      >
+        {this.state.msg}
+      </ConfirmModal>
+      <ConfirmModal
+        visible={diagShow}
+        confirm={() => { this.makeSure() }}
+        close={() => { diagShowTmp(false); this.setState({ title: '' }) }}
+        cancel={() => { diagShowTmp(false); this.setState({ title: '' }) }}
         okText={this.state.okText}
         okBorderColor={this.state.borderColor}
         okColor={this.state.okColor}

+ 2 - 1
src/components/Operation/index.less

@@ -5,7 +5,8 @@
     position: fixed;
     bottom: 0;
     left: 10px;
-    right: 480px;
+    right: 470px;
+    min-width: 720px;
     background-color: #fff;
     // z-index: 240;
     padding-bottom: 10px;

+ 22 - 76
src/components/PreviewBody/index.jsx

@@ -2,75 +2,22 @@ import React, { Component } from "react";
 import style from "./index.less";
 import $ from "jquery";
 import {filterDataArr} from '@utils/tools'
-(function ($) {
-    var opt;
-
-    $.fn.jqprint = function (options) {
-        opt = $.extend({}, $.fn.jqprint.defaults, options);
-
-        var $element = (this instanceof $) ? this : $(this);
-
-        if (opt.operaSupport && $.browser.opera) {
-            var tab = window.open("", "jqPrint-preview");
-            tab.document.open();
-
-            var doc = tab.document;
-        }
-        else {
-            var $iframe = $("<iframe  />");
-
-            if (!opt.debug) { $iframe.css({ position: "absolute", width: "200px", height: "0px", left: "-300px", top: "-300px" }); }
-
-            $iframe.appendTo("body");
-            var doc = $iframe[0].contentWindow.document;
-        }
-
-        if (opt.importCSS) {
-            if ($("link[media=print]").length > 0) {
-                $("link[media=print]").each(function () {
-                    doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />");
-                });
-            }
-            else {
-                $("link").each(function () {
-                    doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
-                });
-            }
-        }
-
-        if (opt.printContainer) { doc.write($element.outer()); }
-        else { $element.each(function () { doc.write($(this).html()); }); }
-
-        doc.close();
-
-        (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).focus();
-        setTimeout(function () { (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).print(); if (tab) { tab.close(); } }, 1000);
-    }
-
-    $.fn.jqprint.defaults = {
-        debug: false,
-        importCSS: true,
-        printContainer: true,
-        operaSupport: true
-    };
-
-    $.fn.outer = function () {
-        return $($('<div></div>').html(this.clone())).html();
-    }
-})($);
 class PreviewBody extends Component {
     constructor(props) {
         super(props)
         this.state={
             dateTime:"",
         }
-        this.onPrint = this.onPrint.bind(this);
+        this.$content = React.createRef();
         this.normalVal = this.normalVal.bind(this);
         this.getCurrentDate = this.getCurrentDate.bind(this);
     }
     componentDidMount(){
         this.getCurrentDate();
     }
+    componentWillReceiveProps(){
+        this.$content.current.scrollTo(0,0)
+    }
     getCurrentDate(){
         let myDate = new Date();
         let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
@@ -79,15 +26,6 @@ class PreviewBody extends Component {
         let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
         this.setState({dateTime:date})
     }
-    onPrint() {
-        $("#content").jqprint({
-            debug: false,
-            importCSS: true,
-            printContainer: true,
-            operaSupport: false
-        });
-        this.props.onClose()
-    }
     normalVal(min,max){
         if((min-0) && (max-0)){
             return `正常值: (${min}~${max})`
@@ -116,7 +54,8 @@ class PreviewBody extends Component {
     }
     render() {
         const { show, preInfo, dataJson, dataStr,baseObj } = this.props;
-        return <div className={style['content']}>
+
+        return <div className={style['content']} ref={this.$content}>
             <div style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px',textAlign:'center' }}>{preInfo.hospitalName}</div>
             <table className={style['patInfo']} style={{ margin: '0px 15px 30px 0px', borderCollapse: 'collapse', width: "100%",fontSize:'12px' }}>
                 <tr>
@@ -177,12 +116,12 @@ class PreviewBody extends Component {
                                             {
                                                 item.lisExcelItem && item.lisExcelItem.map((value)=>{
                                                     return <tr style={{lineHeight:'1.5',width:'650px'}}>
-                                                        <td style={{width:'23%',fontSize:'12px'}}>{value.itemName}</td>
+                                                        <td style={{width:'25%',fontSize:'12px'}}>{value.itemName}</td>
                                                         <td style={{width:'23%',fontSize:'12px'}}><span className={value.type == 1?'red':null} style={{fontSize:'12px'}}>{value.value}</span> {value.unit}</td>
                                                         <td style={{width:'24%',fontSize:'12px'}}>
                                                             {this.normalVal(value.min,value.max)}
                                                         </td>
-                                                        <td style={{width:'30%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
+                                                        <td style={{width:'28%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
                                                     </tr>
                                                 })
                                             }
@@ -199,14 +138,14 @@ class PreviewBody extends Component {
                                                 item.details.map((val)=>{
                                                     if(val.value && val.value != ''){
                                                         return <tr style={{lineHeight:'1.5',width:'100%',fontSize:'12px'}}>
-                                                            <td style={{width:'23%'}}>{val.name}</td>
+                                                            <td style={{width:'25%'}}>{val.name}</td>
                                                             {/* <td style={{width:'23%'}} className={item.abnormal != '0' ?"red":'' }>{val.value} { val.labelSuffix}</td> */}
                                                             {this.showDetails(val)}
                                                             
                                                             <td style={{width:'24%'}}>
                                                                 {this.normalVal(val.minValue,val.maxValue)}
                                                             </td>
-                                                            <td style={{width:'30%'}}>{'化验时间:'+item.time}</td>
+                                                            <td style={{width:'28%'}}>{'化验时间:'+item.time}</td>
                                                         </tr>
                                                     }
                                                 })
@@ -262,10 +201,11 @@ class PreviewBody extends Component {
                     </td>
                 </tr>
             </table>
-            <table className={style.partTtable} style={{ marginTop: '10px',display: show ? 'block' : 'none' }}>
-                <tr className={style.verticalT}>
-                    <td style={{ width: 70, textAlign: 'right',verticalAlign:'top', padding: '0px 5px 16px 0px', fontSize: '14px' }}>签名:</td>
-                    <td style={{ width: '220px',
+            <table className={style.partTtable} style={{ marginTop: '10px',marginBottom:'30px',display: show ? 'block' : 'none' }}>
+                <tr className={`${style.verticalT} ${style.siginNature}`}>
+                    <td style={{ width: 80, textAlign: 'right',verticalAlign:'top', padding: '0px 5px 0 0px', fontSize: '14px' }}>医生签名:</td>
+                    {/* <td style={{ 
+                        width: '220px',
                         height: '60px',
                         textAlign: 'center',
                         lineHeight: '60px',
@@ -273,7 +213,13 @@ class PreviewBody extends Component {
                         color: '#cbc7c7',
                         border: '1px solid #cbc7c7',
                         paddingBottom: '0'
-                    }}>此处签名</td>
+                    }}>此处签名</td> */}
+                    <td style={{
+                      minWidth:'50px',
+                      padding:'0 5px 2px 5px',
+                      borderBottom:'1px solid #333',
+                    }}
+                    >{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
                 </tr>
             </table>
         </div>

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

@@ -4,7 +4,7 @@
       overflow: auto;
       top:120px;
       width: 820px;
-      padding: 0 40px 20px 40px;
+      padding: 0 40px 60px 40px;
     }
 
     .foot{
@@ -78,6 +78,10 @@
       .verticalT {
           vertical-align: top;
       }
+      .siginNature {
+        vertical-align: bottom;
+        float: right;
+      }
       .partTtableList {
           width: 70px;
           text-align: right;

+ 8 - 7
src/components/PushContainer/index.jsx

@@ -27,11 +27,11 @@ class PushContainer extends Component {
             }],
             visible:false,
             message:'',                 //提示的内容
-            type:'',                   //1:删除模板 2:批量删除   3.修改标题   4.引用  
+            type:'',                    //1:删除模板 2:批量删除   3.修改标题   4.引用  
             id:'',                      //单个删除
-            obj:{},                       //修改模板标题      
+            obj:{},                     //修改模板标题      
             title:'',                   //修改后的标题
-            okText:'确定',                  //确认按钮
+            okText:'确定',              //确认按钮
             okBorderColor:'red',
             oKBg:'',
             okColor:'red',
@@ -110,10 +110,11 @@ class PushContainer extends Component {
             })
         })
     }
-    keypress(e){
+    keypress(event){
+        let e = event?event:window.event;
         if(e.keyCode == 13) {
-            this.makeSure()
-            store.dispatch(changeVisible(false))
+            // this.makeSure()
+            // store.dispatch(changeVisible(false))
         }
     }
     changeTitle(){
@@ -192,7 +193,7 @@ class PushContainer extends Component {
         }else if(this.state.type == 3){
             if(this.state.title == this.state.obj.text){
                 store.dispatch(changeVisible(false))
-                Notify.info('标题修改成功');
+                Notify.success('标题修改成功');
                 return;
             }
             let tempObj = {

+ 10 - 5
src/containers/OperationContainer.js

@@ -5,15 +5,14 @@ import {
     SHOW_PRINT_PREVIEW,
     CLOSE_PRINT_PREVIEW,
     SHOW_PREVIEW,
-    CLOSE_PREVIEW
+    CLOSE_PREVIEW,
+    DIAG_SHOW
 } from "../store/types/print";
 import {saveMessage,clearMessages} from "../store/async-actions/print";
 import {saveTemplateDetail} from '@store/async-actions/tabTemplate';
 import {saveClickNum} from '@store/async-actions/homePage';
 
-function mapStateToProps({
-    print
-}) {
+function mapStateToProps({print}) {
     return ({
         print
     });
@@ -49,8 +48,14 @@ function mapDispatchToProps(dispatch) {
             clearMessages()
         },
         saveDataAll(val){
-            dispatch(saveTemplateDetail(val))
+          dispatch(saveTemplateDetail(val))
         },
+        diagShowTmp(bool){
+          dispatch({
+            type: DIAG_SHOW,
+            data:bool
+          });
+        }
     };
 }
 

+ 6 - 0
src/store/actions/print.js

@@ -27,3 +27,9 @@ export const saveMessage=(state,action)=>{
   res.saveMessage = action.data
   return res;
 };
+
+export const diagShow=(state,action)=>{
+  const res=Object.assign({},state);
+  res.diagShow = action.data
+  return res;
+};

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

@@ -9,7 +9,7 @@ import {
     CHANGE_VISIBLE,
     SHOW_MESSAGE,
     KEEP_PUSH_DATA,
-    ALL_CHECKED_SHOW
+    ALL_CHECKED_SHOW,
 } from '@store/types/tabTemplate';
 
 export const delItems = (id) => ({ //删除模板

+ 0 - 1
src/store/async-actions/assistCheck.js

@@ -18,7 +18,6 @@ export const getSearchList = (val) => {
             sexType: sex == '男'?'1' : sex == '女'?'2':'3'
         })
         .then((res)=>{
-            console.log(res.data.data)
             const data = res.data.data;
             dispatch(searchList(data));
         })

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

@@ -7,6 +7,7 @@ import store from '@store';
 import {fullfillText} from '@common/js/func';
 import {getOtherHisRecord,getInitData} from '@store/async-actions/fetchModules.js';
 import {initHistoryDetails} from '@store/async-actions/patInfo';
+import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
   getModules:'/api/icss/moduleInfo/getAll',
@@ -57,6 +58,9 @@ export const getInitModules= (dispatch,getStore)=>{
           saveEmpty:initSaveText.currentEmpty,
         });
         dispatch(getOtherHisRecord());          //获取其他史最近记录
+        if(state.tabTemplate.items.length == 0){
+          dispatch(initItemList());         //模板列表没有就获取模板列表
+        }
         initHis(dispatch)
       }else{
         initHis(dispatch)

+ 18 - 2
src/store/async-actions/tabTemplate.js

@@ -4,8 +4,9 @@ import {
   delItems,
   batchDelItems,
   changeTitle,
-  keepPushData
+  keepPushData,
 } from '@store/actions/tabTemplate';
+import {DIAG_SHOW} from "@store/types/print";
 import Notify from '@commonComp/Notify';
 import store from '@store';
 import {
@@ -34,7 +35,7 @@ export const initItemList = (type) => { //初始化数据
   }
 };
 
-export const saveTemplateDetail = (val) => { //保存为模板(先判断是否引入模板,是的话需要判断是否改变了值)
+export const saveTemplateDetail = (val) => { //保存为模板
   let baseList = store.getState();
   let jsonData = getAllDataList(baseList);
   let jsonStr = getAllDataStringList(baseList);
@@ -69,7 +70,22 @@ export const saveTemplateDetail = (val) => { //保存为模板(先判断是否
         Notify.success('模板保存成功');
         dispatch(initItemList());
         dispatch(keepPushData(getdata(1),'part'));
+        dispatch({
+          type: DIAG_SHOW,
+          data:false
+        });
       } else {
+        if(data.msg == '该模板名存在'){         //存在不关闭弹窗
+          dispatch({
+            type: DIAG_SHOW,
+            data:true
+          });
+        }else{
+          dispatch({
+            type: DIAG_SHOW,
+            data:false
+          });
+        }
         Notify.error(data.msg);
       }
     })

+ 10 - 10
src/store/reducers/assistCheck.js

@@ -26,7 +26,7 @@ export default (state = initSearchList, action) => {
         newState.list = action.list
         return newState;
     }
-    if (action.type == GET_ASSIST_LABEL) {
+    if (action.type == GET_ASSIST_LABEL) {             //默认
         const newState = Object.assign({}, state);
         const tempArr = newState.list;
         const tempArrs = newState.assistLabel;
@@ -37,14 +37,14 @@ export default (state = initSearchList, action) => {
                 tempArrs.push(tempArr[i]);
                 newState.assistLabel = [...tempArrs];
             }
-            for (let j = 0; j < tempArrs.length; j++) {
-                tmpString += (tempArrs[j].name+(tempArrs[j].value?(','+tempArrs[j].value):'')+(tempArrs[j].time?',报告日期,'+tempArrs[j].time:'')+';')
-            }
+        }
+        for (let j = 0; j < tempArrs.length; j++) {
+            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value):'')+(tempArrs[j].time?',报告日期:'+tempArrs[j].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
     }
-    if (action.type == DEL_ASSIST_LABEL) {
+    if (action.type == DEL_ASSIST_LABEL) {        //删除
         const newState = Object.assign({}, state);
         const tempArr = newState.assistLabel;
         let tmpString = '';
@@ -54,13 +54,13 @@ export default (state = initSearchList, action) => {
             return
         }
         for (let i = 0; i < tempArr.length; i++) {
-            tmpString += (tempArr[i].name+(tempArr[i].value?(','+tempArr[i].value):'')+(tempArr[i].time?',报告日期,'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?',报告日期:'+tempArr[i].time:'')+';')
         }
         newState.assistLabel = [...tempArr]
         newState.dataString = tmpString
         return newState;
     }
-    if (action.type == CHANGE_ASSIST_VAL) {
+    if (action.type == CHANGE_ASSIST_VAL) {           //改变输入值
         const newState = Object.assign({}, state);
         const tempArr = newState.assistLabel;
         let tmpString = '';
@@ -69,12 +69,12 @@ export default (state = initSearchList, action) => {
                 tempArr[i].value = action.val
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(','+tempArr[i].value):'')+(tempArr[i].time?',报告日期,'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?',报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
     }
-    if (action.type == CHANGE_DATE) {
+    if (action.type == CHANGE_DATE) {             //新增
         const newState = Object.assign({}, state);
         const tempArr = newState.assistLabel;
         let tmpString = '';
@@ -83,7 +83,7 @@ export default (state = initSearchList, action) => {
                 tempArr[i].time = action.date
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(','+tempArr[i].value):'')+(tempArr[i].time?',报告日期,'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?',报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;

+ 6 - 3
src/store/reducers/print.js

@@ -1,10 +1,11 @@
-import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,CLEAR_MESSAGE } from "../types/print";
-import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview } from "../actions/print";
+import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,CLEAR_MESSAGE,DIAG_SHOW } from "../types/print";
+import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow } from "../actions/print";
 
 const initState = {
   visible: false,
   preVisible: false,
-  saveMessage: {}
+  saveMessage: {},
+  diagShow:false
 };
 export default function(state = initState, action) {
   switch (action.type) {
@@ -20,6 +21,8 @@ export default function(state = initState, action) {
       return saveMessage(state, action);
     case CLEAR_MESSAGE:
       return clearMessage(state, action);
+    case DIAG_SHOW:
+      return diagShow(state, action);
     default:
       return state;
   }

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

@@ -9,7 +9,7 @@ import {
   CHANGE_VISIBLE,
   SHOW_MESSAGE,
   KEEP_PUSH_DATA,
-  ALL_CHECKED_SHOW
+  ALL_CHECKED_SHOW,
 } from '../types/tabTemplate';
 
 

+ 2 - 1
src/store/types/print.js

@@ -3,4 +3,5 @@ export const CLOSE_PRINT_PREVIEW = 'CLOSE_PRINT_PREVIEW'
 export const SAVE_MESSAGE = 'SAVE_MESSAGE'
 export const CLEAR_MESSAGE = 'CLEAR_MESSAGE'
 export const SHOW_PREVIEW = 'SHOW_PREVIEW'
-export const CLOSE_PREVIEW = 'CLOSE_PREVIEW'
+export const CLOSE_PREVIEW = 'CLOSE_PREVIEW'
+export const DIAG_SHOW = 'DIAG_SHOW'

+ 22 - 20
src/utils/tools.js

@@ -479,32 +479,34 @@ function filterDataArr(arrTmp){   //数据处理
     let arr = arrTmp.join('').split('');
     for(let i = 0;i < arr.length;i++){
         if(arr[i] && arr[i].indexOf('undefined') == -1){
-            if(tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != ',' ){
+            if(tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != '、' && tmpArr[tmpArr.length-1] != '。'){
                 tmpArr.push(arr[i])
-            }else if((tmpArr[tmpArr.length-1] == ',' && (arr[i] != ',' || arr[i] != ',')) || (tmpArr[tmpArr.length-1] == ',' && (arr[i] != ',' || arr[i] != ','))) {
-              if(arr[i] == '。'){     //前面逗号后面句号 [',','。']
-                tmpArr.pop();
-                tmpArr.push(arr[i]);
-              }else if(tmpArr[tmpArr.length-2] == '。' && (tmpArr[tmpArr.length-1] == ',' || tmpArr[tmpArr.length-1] == ',')){//前面句号后面逗号 ['。',',']
-                tmpArr.pop();
-                tmpArr.push(arr[i]);
-              }else if(arr[i] == ',' || arr[i] == ','){    //  中英文逗号交替[',',',']
-                tmpArr.pop();
-                tmpArr.push(arr[i]);
-              }else if(arr[i] == '、'){    //前面逗号后面句号 [',','、']
-                tmpArr.pop();
-                tmpArr.push(arr[i]);
-              }else if(tmpArr[tmpArr.length-2] == '、' && (tmpArr[tmpArr.length-1] == ',' || tmpArr[tmpArr.length-1] == ',')){    //前面逗号后面句号 ['、',',']
-                tmpArr.splice(tmpArr.length-2,1);
-                tmpArr.push(arr[i]);
-              }else{
-                tmpArr.push(arr[i]);
+            }else {
+              if(tmpArr[tmpArr.length-1] == '。' && arr[i] != ',' && arr[i] != ',' && arr[i] != '、' && arr[i] != '。'){
+                  tmpArr.push(arr[i]);
+              }else if(tmpArr[tmpArr.length-1] != '。'){
+                if(arr[i] == '。'){
+                  tmpArr.pop();
+                  tmpArr.push(arr[i]);
+                }else if(arr[i] != '。' && tmpArr[tmpArr.length-1] == '、'){    //前面逗号后面顿号 [',','、']
+                  if(arr[i] != ',' && arr[i] != ',' && arr[i] != '、'){
+                    tmpArr.push(arr[i]);
+                  }else{
+                    tmpArr.pop();
+                    tmpArr.push(arr[i]);
+                  }
+                }else if(arr[i] != '。' && tmpArr[tmpArr.length-1] != '、'){
+                  if(arr[i] != ',' && arr[i] != ',' && arr[i] != '、'){
+                    tmpArr.push(arr[i]);
+                  }
+                }
               }
             }
         }
     }
-    return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/,+$/,"");
+    return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/、+$/,"");
 }
+filterDataArr(['sds','、',',','sds'])
 // 取消默认行为
 function preventDefault(event) {
     if (event.preventDefault) {