|
@@ -1,8 +1,8 @@
|
|
|
import React from 'react';
|
|
|
-import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
|
|
|
+import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add,DelToast} from '@commonComp';
|
|
|
import SlideExcel from './SlideExcel';
|
|
|
import SlideSelect from './SlideSelect';
|
|
|
-import { deepClone } from '@utils/tools';
|
|
|
+import { deepClone,getPageCoordinate } from '@utils/tools';
|
|
|
import styles from './index.less';
|
|
|
import date1 from './img/date1.png';
|
|
|
import close from './img/close.png';
|
|
@@ -22,11 +22,11 @@ class Inspect extends React.Component {
|
|
|
currentData: {},
|
|
|
numPlus: 0, //判断是否所有的填写单都是空
|
|
|
num: 0, //暂存数据,获取一次,不能每次都是新的数据
|
|
|
- toastText: '',
|
|
|
- visible: false,
|
|
|
type: null,
|
|
|
id: null,
|
|
|
- tmpIds: [], //内层外层
|
|
|
+ pageTop:'',
|
|
|
+ // tmpIds: [], //内层外层
|
|
|
+ importFlag:false //导入数据删除标识
|
|
|
}
|
|
|
this.handleChangeDate = this.handleChangeDate.bind(this)
|
|
|
this.handleShowDate = this.handleShowDate.bind(this)
|
|
@@ -52,9 +52,9 @@ class Inspect extends React.Component {
|
|
|
handleCloseExcel(id)
|
|
|
}
|
|
|
this.setState({
|
|
|
- visible: false,
|
|
|
type: null,
|
|
|
id: null,
|
|
|
+ importFlag:false
|
|
|
})
|
|
|
Notify.success("删除成功");
|
|
|
handlePush && handlePush(); //右侧推送
|
|
@@ -62,24 +62,19 @@ class Inspect extends React.Component {
|
|
|
handleDelClick(type, idx) {
|
|
|
this.setState({
|
|
|
type: type,
|
|
|
- id: idx,
|
|
|
- visible: true
|
|
|
+ id: idx
|
|
|
})
|
|
|
- if (type == 1) {//单项
|
|
|
+ if (type == 2){
|
|
|
this.setState({
|
|
|
- toastText: '是否删除该化验项?'
|
|
|
- })
|
|
|
- } else if (type == 2) {//导入项
|
|
|
- this.setState({
|
|
|
- toastText: '是否删除导入项?'
|
|
|
+ importFlag: true
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
handleCancel() {
|
|
|
this.setState({
|
|
|
- visible: false,
|
|
|
type: null,
|
|
|
id: null,
|
|
|
+ importFlag:false
|
|
|
})
|
|
|
}
|
|
|
componentDidMount() {
|
|
@@ -114,7 +109,7 @@ class Inspect extends React.Component {
|
|
|
}
|
|
|
handleSearchShow(e) {
|
|
|
let tmpShow = this.state.show;
|
|
|
- this.setState({ show: !tmpShow })
|
|
|
+ this.setState({ show: !tmpShow,pageTop:getPageCoordinate(e).boxTop })
|
|
|
// e.stopPropagation();
|
|
|
}
|
|
|
handleFillShow(e, idx) {
|
|
@@ -284,18 +279,23 @@ class Inspect extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
render() {
|
|
|
- const { getInfomation,handleChangeValue,inspectVal, list, labelList, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
|
|
|
- const { toastText, visible, tmpId, tmpIdx } = this.state;
|
|
|
+ const { getInfomation,handleChangeValue,inspectVal, list, labelList,windowHeight, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
|
|
|
+ const { tmpId, tmpIdx,id ,importFlag,pageTop} = this.state;
|
|
|
|
|
|
return (
|
|
|
<div className={styles.wrapper}>
|
|
|
<div className={styles.check}>
|
|
|
{
|
|
|
- getExcelDataList.length > 0 && getExcelDataList.map((items, id) => {
|
|
|
+ getExcelDataList.length > 0 && getExcelDataList.map((items, ind) => {
|
|
|
return <div style={{ marginTop: '10px' }}>
|
|
|
{
|
|
|
items && items.lisExcelRes.length > 0 ? <ul className={styles.excelDataLists}>
|
|
|
- <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={() => { this.handleDelClick(2, id) }} />
|
|
|
+ {/*<img className={styles.close} src={close} alt="关闭导入excel数据" onClick={() => { this.handleDelClick(2, id) }} />*/}
|
|
|
+ <span className={styles.close} onClick={() => { this.handleDelClick(2, ind) }}></span>
|
|
|
+ <DelToast show={id==ind && importFlag?true:false}
|
|
|
+ name="该导入项"
|
|
|
+ cancel={this.handleCancel}
|
|
|
+ confirm={this.delConfirm}/>
|
|
|
{
|
|
|
items.lisExcelRes.map((item, idx) => {
|
|
|
return <SlideExcel
|
|
@@ -334,6 +334,7 @@ class Inspect extends React.Component {
|
|
|
getItemList={this.getItemList}
|
|
|
changeActivePart={this.changeActivePart}
|
|
|
handleDelClick={this.handleDelClick}
|
|
|
+ handleDelConfirm={this.delConfirm}
|
|
|
handleConfirm={handleConfirm}
|
|
|
getInfomation={getInfomation}
|
|
|
></SlideSelect>
|
|
@@ -343,7 +344,7 @@ class Inspect extends React.Component {
|
|
|
</div>
|
|
|
<div style={{ position: "relative", clear: "both" }}>
|
|
|
<Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap" />
|
|
|
- {this.state.show ? <SearchOption handleChangeValue={handleChangeValue} visible={true}>
|
|
|
+ {this.state.show ? <SearchOption windowHeight={windowHeight} height={280} 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 != '')?'':<div>
|
|
@@ -355,19 +356,6 @@ class Inspect extends React.Component {
|
|
|
}
|
|
|
</SearchOption> : ''}
|
|
|
</div>
|
|
|
- <ConfirmModal
|
|
|
- visible={visible}
|
|
|
- confirm={this.delConfirm}
|
|
|
- close={this.handleCancel}
|
|
|
- cancel={this.handleCancel}
|
|
|
- okText="删除"
|
|
|
- cancelText='取消'
|
|
|
- okBorderColor={'#3B9ED0'}
|
|
|
- okColor={'#fff'}
|
|
|
- oKBg={'#3B9ED0'}
|
|
|
- >
|
|
|
- <p className={styles['center']}>{toastText}</p>
|
|
|
- </ConfirmModal>
|
|
|
</div>
|
|
|
)
|
|
|
}
|