hotfix/2.9.42309.01-个税
This commit is contained in:
parent
cd163693c8
commit
d61fccaf43
|
|
@ -4,7 +4,7 @@ export const declareConditions = [
|
|||
{
|
||||
colSpan: 1,
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["salaryMonthStr"],
|
||||
domkey: ["salaryMonth"],
|
||||
fieldcol: 14,
|
||||
label: "薪资所属月",
|
||||
lanId: 542604,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
|||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { getTaxAgentSelectListAsAdmin } from "../../../../apis/taxAgent";
|
||||
import { saveDeclare } from "../../../../apis/declare";
|
||||
import { saveDeclare, taxdeclarationGetRate } from "../../../../apis/declare";
|
||||
import { declareConditions } from "./condition";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
|
|
@ -56,17 +56,40 @@ class Index extends Component {
|
|||
const { declareStore: { declareForm } } = this.props;
|
||||
declareForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = declareForm.getFormParams();
|
||||
const { salaryMonth, ...payload } = declareForm.getFormParams();
|
||||
this.setState({ loading: true });
|
||||
saveDeclare({ ...payload }).then(({ status, errormsg }) => {
|
||||
saveDeclare({ ...payload, salaryMonth: salaryMonth + "-01" })
|
||||
.then(async ({ status, data, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.destroy();
|
||||
message.loading(getLabel(111, "生成中..."), 0);
|
||||
this.timer = setInterval(async () => {
|
||||
const { status: resStatus, data: result } = await taxdeclarationGetRate({ index: data });
|
||||
const { status: rateStatus, finish, msg } = result;
|
||||
if (resStatus && rateStatus) {
|
||||
if (finish) {
|
||||
clearInterval(this.timer);
|
||||
message.destroy();
|
||||
message.success(getLabel(30700, "操作成功"));
|
||||
this.props.onCancel("refresh");
|
||||
}
|
||||
} else {
|
||||
clearInterval(this.timer);
|
||||
message.destroy();
|
||||
message.warning(msg);
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
clearInterval(this.timer);
|
||||
message.destroy();
|
||||
message.warning(errormsg);
|
||||
}
|
||||
}).catch(() => {
|
||||
message.destroy();
|
||||
clearInterval(this.timer);
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功"));
|
||||
this.props.onCancel("refresh");
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue