|
@@ -26,7 +26,7 @@ class Inspect extends React.Component {
|
|
|
id: null,
|
|
|
pageTop:'',
|
|
|
// tmpIds: [], //内层外层
|
|
|
- importFlag:false //导入数据删除标识
|
|
|
+ impId:null
|
|
|
}
|
|
|
this.handleChangeDate = this.handleChangeDate.bind(this)
|
|
|
this.handleShowDate = this.handleShowDate.bind(this)
|
|
@@ -45,28 +45,32 @@ class Inspect extends React.Component {
|
|
|
}
|
|
|
delConfirm() {//弹窗确定
|
|
|
const { delPartItem, handleCloseExcel, handlePush } = this.props;
|
|
|
- const { type, id } = this.state;
|
|
|
+ const { type, id ,impId} = this.state;
|
|
|
if (type == 1) {
|
|
|
delPartItem(id)
|
|
|
} else if (type == 2) {
|
|
|
- handleCloseExcel(id)
|
|
|
+ handleCloseExcel(impId)
|
|
|
}
|
|
|
this.setState({
|
|
|
type: null,
|
|
|
id: null,
|
|
|
- importFlag:false
|
|
|
+ impId: null
|
|
|
})
|
|
|
Notify.success("删除成功");
|
|
|
handlePush && handlePush(); //右侧推送
|
|
|
}
|
|
|
- handleDelClick(type, idx) {
|
|
|
- this.setState({
|
|
|
- type: type,
|
|
|
- id: idx
|
|
|
- })
|
|
|
+ handleDelClick(type, idx) {
|
|
|
if (type == 2){
|
|
|
this.setState({
|
|
|
- importFlag: true
|
|
|
+ impId:idx,
|
|
|
+ type: type,
|
|
|
+ id:null
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.setState({
|
|
|
+ type: type,
|
|
|
+ id: idx,
|
|
|
+ impId:null
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -74,7 +78,7 @@ class Inspect extends React.Component {
|
|
|
this.setState({
|
|
|
type: null,
|
|
|
id: null,
|
|
|
- importFlag:false
|
|
|
+ impId: null
|
|
|
})
|
|
|
}
|
|
|
componentDidMount() {
|
|
@@ -82,6 +86,11 @@ class Inspect extends React.Component {
|
|
|
let searchWrap = $('#searchWrap')[0]; // 搜索按钮
|
|
|
let searchOption = $('#searchOption')[0]; // 搜索列表
|
|
|
let inspectFill = $('#inspectFill')[0]; // 公共填写单
|
|
|
+
|
|
|
+ let _del = $('#delBox')[0]; // 删除弹窗
|
|
|
+ let _impClose = $('#impClose')[0]; // 导入删除按钮
|
|
|
+ let _addClose = $('#addClose')[0]; // 添加删除按钮
|
|
|
+ let _closeTil = $('#delTit')[0]; // 弹窗标题
|
|
|
if (searchOption) {
|
|
|
if (searchOption != event.target && searchWrap != event.target && searchWrap != event.target.parentNode && !$.contains(searchOption, event.target)) { // Mark 1
|
|
|
this.setState({ show: false });
|
|
@@ -92,6 +101,12 @@ class Inspect extends React.Component {
|
|
|
this.setState({ showFill: false, date: false });
|
|
|
}
|
|
|
}
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ }
|
|
|
});
|
|
|
this.getCurrentDate();
|
|
|
}
|
|
@@ -280,7 +295,7 @@ class Inspect extends React.Component {
|
|
|
}
|
|
|
render() {
|
|
|
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;
|
|
|
+ const { tmpId, tmpIdx,id,pageTop,impId} = this.state;
|
|
|
|
|
|
return (
|
|
|
<div className={styles.wrapper}>
|
|
@@ -291,8 +306,8 @@ class Inspect extends React.Component {
|
|
|
{
|
|
|
items && items.lisExcelRes.length > 0 ? <ul className={styles.excelDataLists}>
|
|
|
{/*<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}
|
|
|
+ <span className={styles.close} id="impClose" onClick={() => { this.handleDelClick(2, ind) }}></span>
|
|
|
+ <DelToast show={impId==ind?true:false}
|
|
|
name="该导入项"
|
|
|
cancel={this.handleCancel}
|
|
|
confirm={this.delConfirm}/>
|
|
@@ -318,6 +333,7 @@ class Inspect extends React.Component {
|
|
|
return <SlideSelect
|
|
|
item={item}
|
|
|
idx={idx}
|
|
|
+ showToast={idx==id?true:false}
|
|
|
showFill={this.state.showFill}
|
|
|
handlePush={handlePush}
|
|
|
fillActive={fillActive}
|