ソースを参照

删除项有问题

Luolei 6 年 前
コミット
4309f693fc
2 ファイル変更9 行追加7 行削除
  1. 8 6
      src/components/AddInspect/index.jsx
  2. 1 1
      src/containers/CurrentIll.js

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

@@ -38,8 +38,9 @@ class Inspect extends React.Component {
         this.handleSearchShow = this.handleSearchShow.bind(this)
     }
     delConfirm(){//弹窗确定
-        const{delPartItem,handleCloseExcel} = this.props;
-        const{type,id} = this.state;
+        const {delPartItem,handleCloseExcel} = this.props;
+        const {type,id} = this.state;
+        console.log(id)
         if(type==1){
             delPartItem(id)
         }else if(type==2){
@@ -58,6 +59,7 @@ class Inspect extends React.Component {
             id:idx,
             visible:true
         })
+        console.log(idx)
         if(type==1){//单项
             this.setState({
                 toastText:'是否删除该化验项?'
@@ -102,7 +104,7 @@ class Inspect extends React.Component {
         let date = info.year+'-'+(info.month<10?'0'+info.month:info.month)+'-'+(info.day<10?'0'+info.day:info.day);
         this.setState({dateTime:date,date:false})
     }
-    handleSearchShow(e) {console.log(666);
+    handleSearchShow(e) {
         let tmpShow = this.state.show;
         this.setState({ show: !tmpShow })
         // e.stopPropagation();
@@ -267,11 +269,11 @@ class Inspect extends React.Component {
             <div className={styles.wrapper}>
                 <div className={styles.check}>
                     {
-                        getExcelDataList.length > 0 && getExcelDataList.map((items,idx)=>{
+                        getExcelDataList.length > 0 && getExcelDataList.map((items,index)=>{
                             return <div style={{marginTop:'10px'}}>
                                 {
                                     items && items.lisExcelRes.length > 0 ? <ul className={styles.excelDataLists}>
-                                    <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={(idx)=>{this.handleDelClick(2,idx)}}/>
+                                    <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={()=>{this.handleDelClick(2,index)}}/>
                                     {
                                         items.lisExcelRes.map((item,idx)=>{
                                             return <li className={styles.excelDataLis} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
@@ -370,7 +372,7 @@ class Inspect extends React.Component {
                                             : null
                                         }
                                     </div>
-                                    <img className={styles.partDel} src={close} alt="删除项" onClick={(idx)=>{this.handleDelClick(1,idx)}}/>
+                                    <img className={styles.partDel} src={close} alt="删除项" onClick={()=>{this.handleDelClick(1,idx)}}/>
                                 </li>
                             })
                         }

+ 1 - 1
src/containers/CurrentIll.js

@@ -11,7 +11,7 @@ import {billing} from '@store/async-actions/pushMessage';
 import {getModule} from '@store/async-actions/fetchModules.js';
 
 
-function mapStateToProps(state) {console.log(11,state);
+function mapStateToProps(state) {//console.log(11,state);
   const {homePage} = state;
     return {
         data:state.currentIll.data,//主诉模板