瀏覽代碼

日期bug

Luolei 6 年之前
父節點
當前提交
d2eca9d801

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

@@ -1,8 +1,9 @@
 import React from 'react';
 import { SearchOption, Calendar } from '@commonComp';
-import styles from './index.less';
 import $ from 'jquery';
+import styles from './index.less';
 import Textarea from './Textarea';
+import close from './img/close.png';
 import more from '@common/images/addItem1.png';
 
 class AddAssistCheck extends React.Component {
@@ -24,7 +25,6 @@ class AddAssistCheck extends React.Component {
         $(document).click((event) => {
             let _con = $('#searchWrapAssist');   // 设置目标区域
             let _cons = $('#datePick');   // 设置目标区域
-           
             if (searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
                 this.setState({ show: false });
             }
@@ -98,10 +98,10 @@ class AddAssistCheck extends React.Component {
                             ></textarea> */}
                             <Textarea value={item.value} isRead={isRead} handleChangeAssistValue={handleChangeAssistValue} idx={idx}></Textarea>
                         </p>
-                        <div>
-                            <p>报告日期:<span>{item.time || this.state.dateTime}</span></p>
+                        <div className={styles.pointerFinger}>
+                            <p onClick={()=>this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
                             <i onClick={()=>this.handleShowDate(idx)}></i>
-                            <a href="javascript:void(0);" onClick={()=>{handleDelAssist(idx)}}></a>
+                            <a href="javascript:void(0);" onClick={()=>{handleDelAssist(idx)}}><img src={close} alt=""/></a>
                             <div style={{display:this.state.date && idx == this.state.active?"block":"none",position:"relative"}}>
                                 <Calendar isShow={true} handleChange={(info)=>{handleChangeDate(info,idx);this.setState({date:false})}}></Calendar>
                             </div>

File diff suppressed because it is too large
+ 19 - 6
src/components/AddAssistCheck/index.less


+ 6 - 4
src/components/AddInspect/index.jsx

@@ -111,10 +111,12 @@ class Inspect extends React.Component {
     handleFillShow(e,idx) {
         let tmpShow = this.state.showFill;
         let baseList = store.getState().inspect.fillActive;
+        const tmpTime = this.state.dateTime
         this.setState({ 
             showFill: !tmpShow, 
             currentIdx:idx,
-            currentData:baseList
+            currentData:baseList,
+            dateTime:baseList.time?baseList.time:tmpTime
         })
         e.stopPropagation();
     }
@@ -130,7 +132,6 @@ class Inspect extends React.Component {
         let day = myDate.getDate();            //获取当前日(1-31)
         let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
         this.setState({dateTime:date})
-        
     }
     changeActivePart(idx,val){
         let nums = this.state.num;
@@ -169,6 +170,7 @@ class Inspect extends React.Component {
         }else{
             fillActive = this.state.currentData;
         }
+        // this.setState({dataTime:fillActive.time})
         return <ul className={styles.searchLis}>
             {
                 fillActive && fillActive.details && fillActive.details.map((item,idx) => {
@@ -363,8 +365,8 @@ class Inspect extends React.Component {
                                                             <Calendar isShow={true} handleChange={this.handleChangeDate}></Calendar>
                                                         </div>
                                                     </div>
-                                                        {/* 填写单内容显示 */}
-                                                        { this.getItemList(idx) }
+                                                    {/* 填写单内容显示 */}
+                                                    { this.getItemList(idx) }
                                                 </InspectCommon>
                                             : null
                                         }

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

@@ -32,7 +32,7 @@
         cursor: pointer;
         display: inline-block;
         position: absolute;
-        right: 0;
+        right: -4px;
         top: 12px;
     }
 }

+ 2 - 2
src/components/Inspect/index.less

@@ -34,10 +34,10 @@
     button {
         outline: none;
         font-size: 12px;
-        width: 90px;
+        padding: 0 8px;
         background-color: #fff;
         height: 28px;
-        line-height: 28px;
+        line-height: 30px;
         border: 0 none;
         color: @template-color;
     }

+ 6 - 2
src/components/Operation/index.jsx

@@ -171,8 +171,7 @@ class Operation extends Component {
     let whichSign = baseList.typeConfig.typeConfig;
     let activeItemData = baseList.tabTemplate.activeItem;
     // let preview = (activeItemData.preview).split('-').join('');
-    // console.log(activeItemData.dataJson,4545554)
-    // console.log(JSON.stringify(jsonData),4545554)
+
     if (whichSign == 0) {
       if (activeItemData && JSON.stringify(activeItemData) != '{}' && (activeItemData.dataJson == JSON.stringify(jsonData)) && (JSON.stringify(jsonStr) == JSON.stringify(JSON.parse(activeItemData.preview)))) {
         Notify.info('该模板已保存');
@@ -194,6 +193,11 @@ class Operation extends Component {
         return true;
       }
     } else if(whichSign == 1) {
+      console.log(JSON.parse(jsonStr.chief))
+      
+      if(activeItemData && JSON.stringify(activeItemData) != '{}'){
+        console.log(JSON.parse(JSON.parse(activeItemData.preview).chief))
+      }
       if (activeItemData && JSON.stringify(activeItemData) != '{}' && (JSON.stringify(jsonStr) == JSON.stringify(JSON.parse(activeItemData.preview)))) {
         Notify.info('该模板已保存');
         return false;