diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js
index e01b1e35..c5d90a68 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js
@@ -150,8 +150,8 @@ class WelfareRecordList extends Component {
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js
index 8bcd6ff5..16dd0855 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js
@@ -46,8 +46,9 @@ class WelfareRecordQuery extends Component {
};
})
}, () => {
- const { standingBookStore: { welfareRQForm } } = this.props;
+ const { standingBookStore: { welfareRQForm }, onPutAccountOptions } = this.props;
welfareRQForm.initFormFields(this.state.conditions);
+ onPutAccountOptions(_.map(data, g => ({ key: g.id.toString(), showname: g.name })));
});
}
});
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js
index c9f542e6..8abb378f 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js
@@ -8,10 +8,14 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTop } from "ecCom";
-import { Button } from "antd";
+import { Button, message } from "antd";
+import * as API from "../../../apis/standingBook";
+import { getCalculateProgress } from "../../../apis/calculate";
import WelfareRecordQuery from "./components/welfareRecordQuery";
import WelfareRecordList from "./components/welfareRecordList";
import Accountdialog from "./components/accountDialog";
+import ProgressModal from "../../../components/progressModal";
+import { convertToUrlString } from "../../../util/url";
import moment from "moment";
import "./index.less";
@@ -27,10 +31,11 @@ class StandingBook extends Component {
startTime: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
endTime: moment(new Date()).endOf("year").format("YYYY-MM"),
taxAgents: ""
- },
+ }, progressVisible: false, progress: 0,
accountDialog: { visible: false, title: "", loading: false, options: [] }
};
this.wfListRef = null;
+ this.timer = null;
}
/*
@@ -39,13 +44,63 @@ class StandingBook extends Component {
* Params:
* Date: 2024/1/23
*/
- handleAccount = (formVal) => {
+ handleAccount = async (formVal) => {
const { billMonth, ...extra } = formVal;
const payload = {
billMonth: moment(billMonth).format("YYYY-MM"),
...extra
};
- console.log(formVal, payload);
+ this.setState({ accountDialog: { ...this.state.accountDialog, loading: true } });
+ const { data: creator, status, errormsg } = await API.save(payload);
+ if (status) {
+ this.setState({
+ accountDialog: { ...this.state.accountDialog, loading: false },
+ progressVisible: true
+ }, () => {
+ this.timer = setInterval(() => {
+ getCalculateProgress(moment(billMonth).format("YYYY-MM")).then(({ status, data }) => {
+ if (status) {
+ if (!data.status) {
+ clearInterval(this.timer);
+ this.setState({ progressVisible: false, progress: 0 });
+ message.error(data.message);
+ return;
+ }
+ if (this.state.progress !== 100) {
+ this.setState({
+ progress: (Number(data.progress).toFixed(2)) * 100
+ });
+ } else {
+ clearInterval(this.timer);
+ this.setState({ progressVisible: false, progress: 0 }, () => {
+ message.success(getLabel(543232, "核算成功"));
+ this.setState({
+ accountDialog: { ...this.state.accountDialog, visible: false }
+ }, () => {
+ this.wfListRef.wrappedInstance.getWelfareRecordList();
+ const calcPayload = { ...payload, creator };
+ window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(calcPayload)}`);
+ });
+ });
+ }
+ } else {
+ clearInterval(this.timer);
+ this.setState({ progressVisible: false, progress: 0 });
+ }
+ }).catch(() => {
+ clearInterval(this.timer);
+ this.setState({ progressVisible: false, progress: 0 });
+ });
+ }, 600);
+ });
+ } else {
+ message.error(errormsg);
+ clearInterval(this.timer);
+ this.setState({
+ accountDialog: { ...this.state.accountDialog, loading: false },
+ progressVisible: false, progress: 0
+ });
+ }
};
render() {
@@ -59,18 +114,30 @@ class StandingBook extends Component {
}
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []}>
- {
- this.setState({
- queryForm: { ...queryForm, ...payload }
- }, () => this.wfListRef.wrappedInstance.getWelfareRecordList());
- }}/>
+ {
+ this.setState({
+ queryForm: { ...queryForm, ...payload }
+ }, () => this.wfListRef.wrappedInstance.getWelfareRecordList());
+ }}
+ onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })}
+ />
this.wfListRef = dom} queryForm={queryForm}/>
this.setState({
- accountDialog: { visible: false, title: "", loading: false }
+ accountDialog: { ...accountDialog, visible: false, title: "", loading: false }
})} onOk={this.handleAccount}
/>
+ {/*核算进度条*/}
+ {
+ this.state.progressVisible &&
+ {
+ this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer));
+ }}
+ />
+ }
);