Browse Source

请假单列表回复状态修改

FANGLH 6 years ago
parent
commit
ac51e6b52e

+ 9 - 0
frontend/wechat-web/src/modules/hiPages/LeaveDetail/LeaveDetail.js

@@ -15,6 +15,7 @@ import LazyLoad from 'react-lazyload';
 import ImagesViewer from '../../../components/imagesVIewer/index';
 import {Toast} from 'antd-mobile';
 import {getIntValue, getStrValue, isObjEmpty,getSearchParams} from "../../../utils/common";
+import {saveListState} from "../../../redux/actions/listState";
 
 class LeaveDetail extends Component {
     constructor(props) {
@@ -188,6 +189,13 @@ class LeaveDetail extends Component {
                 // this.backTask = setTimeout(() => {
                 //     this.props.history.goBack();
                 // }, 2000)
+
+                if (this.props.listState && !isObjEmpty(this.props.listState.listData)) {
+                    this.props.listState.listData[this.props.listState.itemIndex].leaveMessages = this.state.messageContent
+                    saveListState({
+                        listData: this.props.listState.listData,
+                    })()
+                }
             }
         }).catch((error) => {
             Toast.fail(error)
@@ -243,6 +251,7 @@ class LeaveDetail extends Component {
 }
 
 let mapStateToProps = (state) => ({
+    listState: {...state.redListState},
     userInfo: {...state.redUserInfo}
 })