2023-08-11 16:06:21 +08:00
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* name: 人员信息报送-查看详情
|
|
|
|
|
* Description:
|
|
|
|
|
* Date: 2023/8/11
|
|
|
|
|
*/
|
|
|
|
|
import React, { Component } from "react";
|
2023-08-11 17:14:43 +08:00
|
|
|
import { WeaDatePicker, WeaLocaleProvider, WeaSelect, WeaTab, WeaTop } from "ecCom";
|
2023-08-16 10:21:42 +08:00
|
|
|
import { Button, Dropdown, Menu, message, Modal, Spin } from "antd";
|
2023-08-14 14:46:19 +08:00
|
|
|
import BaseInfo from "./components/baseInfo";
|
2023-08-14 17:08:40 +08:00
|
|
|
import EmployeeDeclareDetailSchemaEditDialog from "./components/employeeDeclareDetailSchemaEditDialog";
|
2023-08-16 10:21:42 +08:00
|
|
|
import { commonEnumList } from "../../apis/payrollFiles";
|
|
|
|
|
import {
|
|
|
|
|
employeedeclareDeclare,
|
2023-12-06 17:06:44 +08:00
|
|
|
employeedeclareExport,
|
2023-08-16 10:21:42 +08:00
|
|
|
employeedeclareGetRate,
|
|
|
|
|
employeedeclareList,
|
|
|
|
|
employeedeclareList4Add,
|
|
|
|
|
employeedeclareList4Update,
|
|
|
|
|
employeedeclareRefresh,
|
|
|
|
|
employeeDelete,
|
|
|
|
|
getDeclareFeedback
|
|
|
|
|
} from "../../apis/declare";
|
2023-08-14 14:46:19 +08:00
|
|
|
import { advanceConditions, submitStatus } from "./constants";
|
2023-08-16 10:21:42 +08:00
|
|
|
import moment from "moment";
|
2023-08-14 14:46:19 +08:00
|
|
|
import { getSearchs } from "../../util";
|
2023-08-11 16:06:21 +08:00
|
|
|
import { inject, observer } from "mobx-react";
|
2023-08-14 14:46:19 +08:00
|
|
|
import { toJS } from "mobx";
|
2023-08-16 10:21:42 +08:00
|
|
|
import { getQueryString } from "../../util/url";
|
2023-08-11 16:06:21 +08:00
|
|
|
import "./index.less";
|
|
|
|
|
|
|
|
|
|
const { getLabel } = WeaLocaleProvider;
|
2023-08-16 10:21:42 +08:00
|
|
|
const API = {
|
|
|
|
|
list: employeedeclareList,
|
|
|
|
|
list4Add: employeedeclareList4Add,
|
|
|
|
|
list4Update: employeedeclareList4Update
|
|
|
|
|
};
|
2023-08-11 16:06:21 +08:00
|
|
|
|
2023-08-14 14:46:19 +08:00
|
|
|
@inject("taxAgentStore", "employeeDeclareStore")
|
2023-08-11 16:06:21 +08:00
|
|
|
@observer
|
|
|
|
|
class Index extends Component {
|
2023-08-11 17:14:43 +08:00
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
2023-08-16 10:21:42 +08:00
|
|
|
selectedKey: "list", showSearchAd: false, declareStatus: "ALL",
|
2023-12-06 17:06:44 +08:00
|
|
|
taxCycle: new Date(), pageInfo: { current: 1, pageSize: 10, total: 0 },
|
|
|
|
|
loading: { query: false, refresh: false, feedback: false, declare: false, exportLoading: false },
|
2023-08-16 10:21:42 +08:00
|
|
|
declareEditDialog: { visible: false, id: "", title: "" },
|
|
|
|
|
declareStatusList: [], employmentStatusList: [],
|
|
|
|
|
employmentTypeList: [], adConditons: [],
|
2023-12-18 14:56:18 +08:00
|
|
|
selectedRowKeys: [], exportPayload: {}
|
2023-08-11 17:14:43 +08:00
|
|
|
};
|
2023-08-16 10:21:42 +08:00
|
|
|
this.baseInfoRef = null;
|
2023-08-21 18:14:18 +08:00
|
|
|
this.timer = null;
|
2023-08-11 17:14:43 +08:00
|
|
|
}
|
|
|
|
|
|
2023-08-11 16:06:21 +08:00
|
|
|
componentDidMount() {
|
|
|
|
|
document.title = getLabel(544289, "人员信息报送");
|
2023-08-14 14:46:19 +08:00
|
|
|
window.addEventListener("message", this.handleReceive, false);
|
2023-08-16 10:21:42 +08:00
|
|
|
this.initEmployeeDeclare().then(r => {
|
|
|
|
|
});
|
2023-08-11 16:06:21 +08:00
|
|
|
}
|
|
|
|
|
|
2023-08-16 10:21:42 +08:00
|
|
|
initEmployeeDeclare = async () => {
|
|
|
|
|
const { employeeDeclareStore: { advanceForm } } = this.props;
|
|
|
|
|
const [declareStatusList, employmentStatusList, employmentTypeList] = await Promise.all([this.commonEnumList("DeclareStatusEnum"), this.commonEnumList("EmploymentStatusEnum"), this.commonEnumList("EmploymentTypeEnum")]);
|
|
|
|
|
if (declareStatusList.status && employmentStatusList.status && employmentTypeList.status) {
|
|
|
|
|
this.setState({
|
|
|
|
|
declareStatusList: declareStatusList.data,
|
|
|
|
|
employmentStatusList: employmentStatusList.data,
|
|
|
|
|
employmentTypeList: employmentTypeList.data,
|
|
|
|
|
adConditons: _.map(advanceConditions, it => {
|
|
|
|
|
return {
|
|
|
|
|
...it,
|
|
|
|
|
items: _.map(it.items, child => {
|
|
|
|
|
if (child.domkey[0] === "employmentStatus") {
|
|
|
|
|
return {
|
|
|
|
|
...child,
|
|
|
|
|
options: _.map(employmentStatusList.data, it => ({
|
|
|
|
|
key: it.enum,
|
|
|
|
|
showname: getLabel(it.labelId, it.defaultLabel)
|
|
|
|
|
}))
|
|
|
|
|
};
|
|
|
|
|
} else if (child.domkey[0] === "employmentType") {
|
|
|
|
|
return {
|
|
|
|
|
...child,
|
|
|
|
|
options: _.map(employmentTypeList.data, it => ({
|
|
|
|
|
key: it.enum,
|
|
|
|
|
showname: getLabel(it.labelId, it.defaultLabel)
|
|
|
|
|
}))
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (child.conditionType === "SELECT" && child.domkey[0] !== "employmentStatus" && child.domkey[0] !== "employmentType") {
|
|
|
|
|
return {
|
|
|
|
|
...child,
|
|
|
|
|
options: [
|
|
|
|
|
{ key: "ON", showname: getLabel(538048, "是") },
|
|
|
|
|
{ key: "OFF", showname: getLabel(111, "否") }
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return { ...child };
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
}, () => {
|
|
|
|
|
advanceForm.initFormFields(this.state.adConditons);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-14 14:46:19 +08:00
|
|
|
componentWillUnmount() {
|
2023-12-18 14:56:18 +08:00
|
|
|
this.setState({ exportPayload: {} });
|
2023-08-14 14:46:19 +08:00
|
|
|
window.removeEventListener("message", this.handleReceive, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleReceive = ({ data }) => {
|
|
|
|
|
const { type, payload: { id, params } = {} } = data;
|
|
|
|
|
if (type === "init") {
|
2023-08-16 10:21:42 +08:00
|
|
|
this.queryEmployeeList();
|
2023-08-14 14:46:19 +08:00
|
|
|
} else if (type === "turn") {
|
|
|
|
|
if (id === "PAGEINFO") {
|
|
|
|
|
const { pageNum: current, size: pageSize } = params;
|
2023-10-24 14:04:37 +08:00
|
|
|
this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.queryEmployeeList());
|
2023-08-16 10:21:42 +08:00
|
|
|
} else if (id === "EDIT") {
|
|
|
|
|
this.setState({
|
|
|
|
|
declareEditDialog: {
|
|
|
|
|
...this.state.declareEditDialog,
|
|
|
|
|
visible: true, id: params.id, title: params.employeeName
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else if (id === "DELETE") {
|
|
|
|
|
this.handleDeleteDeclare([params.id]);
|
|
|
|
|
} else if (id === "ROWSELECT") {
|
|
|
|
|
const { selectedRowKeys } = params;
|
|
|
|
|
this.setState({ selectedRowKeys });
|
2023-08-14 14:46:19 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2023-08-16 10:21:42 +08:00
|
|
|
postMessageToChild = (payload = {}) => {
|
|
|
|
|
const i18n = {
|
|
|
|
|
"总计": getLabel(523, "总计"), "编辑": getLabel(501169, "编辑"),
|
|
|
|
|
"操作": getLabel(30585, "操作"), "删除": getLabel(535052, "删除"),
|
|
|
|
|
"共": getLabel(83698, "共"), "条": getLabel(18256, "条"),
|
|
|
|
|
"加载中": getLabel(83698, "加载中")
|
|
|
|
|
};
|
2023-08-14 14:46:19 +08:00
|
|
|
const childFrameObj = document.getElementById("atdTable");
|
2023-08-16 10:21:42 +08:00
|
|
|
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
|
|
|
|
};
|
|
|
|
|
commonEnumList = (key) => {
|
|
|
|
|
const payload = { enumClass: `com.engine.salary.enums.employeedeclare.${key}` };
|
|
|
|
|
return commonEnumList(payload);
|
|
|
|
|
};
|
|
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* Description: 报送列表查询
|
|
|
|
|
* Params:
|
|
|
|
|
* Date: 2023/8/14
|
|
|
|
|
*/
|
|
|
|
|
queryEmployeeList = () => {
|
|
|
|
|
const { employeeDeclareStore: { advanceForm: form } } = this.props;
|
|
|
|
|
const { pageInfo, declareStatus, taxCycle, selectedKey, selectedRowKeys } = this.state;
|
|
|
|
|
const { departmentIds, positionIds, ...formParams } = form.getFormParams();
|
|
|
|
|
const payload = {
|
|
|
|
|
...formParams, ...pageInfo,
|
|
|
|
|
declareStatus,
|
|
|
|
|
taxAgentId: getQueryString("id"),
|
|
|
|
|
taxCycle: moment(taxCycle).startOf("month").format("YYYY-MM-DD"),
|
|
|
|
|
departmentIds: departmentIds ? departmentIds.split(",") : [],
|
|
|
|
|
positionIds: positionIds ? positionIds.split(",") : []
|
|
|
|
|
};
|
2023-12-18 14:56:18 +08:00
|
|
|
this.setState({ exportPayload: payload, loading: { ...this.state.loading, query: true } });
|
2023-08-16 10:21:42 +08:00
|
|
|
API[selectedKey](payload).then(({ status, data }) => {
|
|
|
|
|
this.setState({ loading: { ...this.state.loading, query: false } });
|
|
|
|
|
if (status) {
|
|
|
|
|
const { pageInfo: result } = data;
|
|
|
|
|
const { columns, list: dataSource, pageNum: current, pageSize, total } = result;
|
|
|
|
|
this.baseInfoRef.getEmployeeDeclareInfo();
|
|
|
|
|
this.setState({
|
|
|
|
|
pageInfo: { ...pageInfo, current, pageSize, total }
|
|
|
|
|
}, () => {
|
|
|
|
|
const payload = {
|
2023-08-28 16:22:22 +08:00
|
|
|
dataSource, selectedRowKeys, selectedKey,
|
2023-08-16 10:21:42 +08:00
|
|
|
pageInfo: this.state.pageInfo,
|
|
|
|
|
columns: _.map(columns, it => {
|
|
|
|
|
if (it.dataIndex === "employeeName" || it.dataIndex === "subCompanyName") {
|
|
|
|
|
return { ...it, width: 150, fixed: "left" };
|
|
|
|
|
}
|
|
|
|
|
if (it.dataIndex === "declareStatusDesc") {
|
|
|
|
|
return { ...it, width: 150, fixed: "right" };
|
|
|
|
|
}
|
|
|
|
|
return { ...it, width: 150 };
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
this.postMessageToChild(payload);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}).then(() => this.setState({ loading: { ...this.state.loading, query: false } }));
|
|
|
|
|
};
|
|
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* Description: 刷新数据
|
|
|
|
|
* Params:
|
|
|
|
|
* Date: 2023/8/14
|
|
|
|
|
*/
|
|
|
|
|
employeedeclareRefresh = () => {
|
|
|
|
|
const payload = {
|
|
|
|
|
taxAgentId: getQueryString("id"),
|
|
|
|
|
taxCycle: moment(this.state.taxCycle).startOf("month").format("YYYY-MM-DD")
|
|
|
|
|
};
|
|
|
|
|
this.setState({ loading: { ...this.state.loading, refresh: true } });
|
|
|
|
|
employeedeclareRefresh(payload).then(async ({ status, data, errormsg }) => {
|
|
|
|
|
if (status) {
|
2023-08-21 18:14:18 +08:00
|
|
|
message.destroy();
|
|
|
|
|
message.loading(getLabel(111, "刷新中..."), 0);
|
|
|
|
|
this.timer = setInterval(async () => {
|
|
|
|
|
const { status: resStatus, data: result } = await employeedeclareGetRate({ index: data });
|
|
|
|
|
const { status: rateStatus, finish, msg } = result;
|
|
|
|
|
if (resStatus && rateStatus) {
|
|
|
|
|
if (finish) {
|
2023-08-28 16:22:22 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, refresh: false } });
|
2023-08-21 18:14:18 +08:00
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
|
|
|
|
message.success(getLabel(111, "刷新成功!"));
|
|
|
|
|
this.queryEmployeeList();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2023-08-28 16:22:22 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, refresh: false } });
|
2023-08-21 18:14:18 +08:00
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
|
|
|
|
message.warning(msg || getLabel(111, "刷新失败!"));
|
|
|
|
|
this.queryEmployeeList();
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
2023-08-16 10:21:42 +08:00
|
|
|
} else {
|
2023-08-28 16:22:22 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, refresh: false } });
|
2023-08-21 18:14:18 +08:00
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
2023-08-16 10:21:42 +08:00
|
|
|
message.error(errormsg);
|
|
|
|
|
}
|
2023-08-21 18:14:18 +08:00
|
|
|
}).catch(() => {
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
|
|
|
|
this.setState({ loading: { ...this.state.loading, refresh: false } });
|
|
|
|
|
});
|
2023-08-16 10:21:42 +08:00
|
|
|
};
|
|
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* Description:获取报送结果反馈
|
|
|
|
|
* Params:
|
|
|
|
|
* Date: 2023/8/15
|
|
|
|
|
*/
|
|
|
|
|
getDeclareFeedback = () => {
|
|
|
|
|
const payload = {
|
|
|
|
|
taxAgentId: getQueryString("id"),
|
|
|
|
|
taxCycle: moment(this.state.taxCycle).startOf("month").format("YYYY-MM-DD")
|
|
|
|
|
};
|
|
|
|
|
this.setState({ loading: { ...this.state.loading, feedback: true } });
|
|
|
|
|
getDeclareFeedback(payload).then(async ({ status, data, errormsg }) => {
|
|
|
|
|
if (status) {
|
2023-08-21 18:14:18 +08:00
|
|
|
message.destroy();
|
|
|
|
|
message.loading(getLabel(111, "获取报送中..."), 0);
|
|
|
|
|
this.timer = setInterval(async () => {
|
|
|
|
|
const { status: resStatus, data: result } = await employeedeclareGetRate({ index: data });
|
|
|
|
|
const { status: rateStatus, finish, msg } = result;
|
|
|
|
|
if (resStatus && rateStatus) {
|
|
|
|
|
if (finish) {
|
2023-08-28 16:22:22 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, feedback: false } });
|
2023-08-21 18:14:18 +08:00
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
|
|
|
|
message.success(getLabel(111, "获取报送结果成功!"));
|
|
|
|
|
this.queryEmployeeList();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2023-08-28 16:22:22 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, feedback: false } });
|
2023-08-21 18:14:18 +08:00
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
|
|
|
|
message.warning(msg || getLabel(111, "获取失败!"));
|
|
|
|
|
this.queryEmployeeList();
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
2023-08-16 10:21:42 +08:00
|
|
|
} else {
|
2023-08-28 16:22:22 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, feedback: false } });
|
2023-08-21 18:14:18 +08:00
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
2023-08-16 10:21:42 +08:00
|
|
|
message.error(errormsg);
|
|
|
|
|
}
|
2023-08-21 18:14:18 +08:00
|
|
|
}).catch(() => {
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
|
|
|
|
this.setState({ loading: { ...this.state.loading, feedback: false } });
|
|
|
|
|
});
|
2023-08-16 10:21:42 +08:00
|
|
|
};
|
|
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* Description: 删除个税申报人员信息
|
|
|
|
|
* Params:
|
|
|
|
|
* Date: 2023/8/15
|
|
|
|
|
*/
|
|
|
|
|
handleDeleteDeclare = (paylaod) => {
|
|
|
|
|
const { selectedRowKeys } = this.state;
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: getLabel(131329, "信息确认"),
|
|
|
|
|
content: getLabel(543548, "确认删除吗?"),
|
|
|
|
|
onOk: () => {
|
|
|
|
|
employeeDelete(paylaod).then(({ status, errormsg }) => {
|
|
|
|
|
if (status) {
|
|
|
|
|
message.success(getLabel(502230, "删除成功!"));
|
|
|
|
|
this.setState({
|
|
|
|
|
selectedRowKeys: _.xorWith(selectedRowKeys, paylaod, _.isEqual)
|
|
|
|
|
});
|
|
|
|
|
this.queryEmployeeList();
|
|
|
|
|
} else {
|
|
|
|
|
message.error(errormsg || getLabel(20462, "删除失败!"));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* Description: 全部报送
|
|
|
|
|
* Params:
|
|
|
|
|
* Date: 2023/8/15
|
|
|
|
|
*/
|
|
|
|
|
employeedeclareDeclare = () => {
|
|
|
|
|
const payload = {
|
|
|
|
|
taxAgentId: getQueryString("id"),
|
|
|
|
|
taxCycle: moment(this.state.taxCycle).startOf("month").format("YYYY-MM-DD")
|
|
|
|
|
};
|
|
|
|
|
this.setState({ loading: { ...this.state.loading, declare: true } });
|
|
|
|
|
employeedeclareDeclare(payload).then(async ({ status, data, errormsg }) => {
|
|
|
|
|
if (status) {
|
2023-08-21 18:14:18 +08:00
|
|
|
message.destroy();
|
|
|
|
|
message.loading(getLabel(111, "报送中..."), 0);
|
|
|
|
|
this.timer = setInterval(async () => {
|
|
|
|
|
const { status: resStatus, data: result } = await employeedeclareGetRate({ index: data });
|
|
|
|
|
const { status: rateStatus, finish, msg } = result;
|
|
|
|
|
if (resStatus && rateStatus) {
|
|
|
|
|
if (finish) {
|
2023-08-28 16:22:22 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, declare: false } });
|
2023-08-21 18:14:18 +08:00
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
|
|
|
|
message.success(getLabel(111, "全部报送成功!"));
|
|
|
|
|
this.queryEmployeeList();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2023-08-28 16:22:22 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, declare: false } });
|
2023-08-21 18:14:18 +08:00
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
|
|
|
|
message.warning(msg || getLabel(111, "报送失败!"));
|
|
|
|
|
this.queryEmployeeList();
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
2023-08-16 10:21:42 +08:00
|
|
|
} else {
|
2023-08-28 16:22:22 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, declare: false } });
|
2023-08-21 18:14:18 +08:00
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
2023-08-16 10:21:42 +08:00
|
|
|
message.error(errormsg);
|
|
|
|
|
}
|
2023-08-21 18:14:18 +08:00
|
|
|
}).catch(() => {
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
message.destroy();
|
|
|
|
|
this.setState({ loading: { ...this.state.loading, declare: false } });
|
|
|
|
|
});
|
2023-08-14 14:46:19 +08:00
|
|
|
};
|
2023-08-14 17:08:40 +08:00
|
|
|
handleAdd = () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
declareEditDialog: {
|
2023-08-16 10:21:42 +08:00
|
|
|
...this.state.declareEditDialog,
|
2023-08-14 17:08:40 +08:00
|
|
|
visible: true
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
2023-08-16 10:21:42 +08:00
|
|
|
handleMenuClick = ({ key }) => {
|
|
|
|
|
const { selectedRowKeys } = this.state;
|
|
|
|
|
switch (key) {
|
|
|
|
|
case "1":
|
|
|
|
|
if (_.isEmpty(selectedRowKeys)) {
|
|
|
|
|
message.warning(getLabel(111, "请先选择需要删除的人员!"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.handleDeleteDeclare(selectedRowKeys);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
};
|
2023-12-18 14:56:18 +08:00
|
|
|
handleEmployeedeclareExport = async ({ key }) => {
|
|
|
|
|
const { selectedRowKeys, exportPayload } = this.state;
|
|
|
|
|
if (key === "selected" && _.isEmpty(selectedRowKeys)) {
|
|
|
|
|
message.warning(getLabel(111, "请先选择需要导出的人员!"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-12-06 17:06:44 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, exportLoading: true } });
|
2023-12-18 14:56:18 +08:00
|
|
|
const promise = await employeedeclareExport(_.omit({
|
|
|
|
|
...exportPayload,
|
|
|
|
|
ids: selectedRowKeys
|
|
|
|
|
}, ["current", "total", "pageSize"]));
|
2023-12-06 17:06:44 +08:00
|
|
|
this.setState({ loading: { ...this.state.loading, exportLoading: false } });
|
|
|
|
|
};
|
2023-08-14 14:46:19 +08:00
|
|
|
|
2023-08-11 16:06:21 +08:00
|
|
|
render() {
|
2023-08-16 10:21:42 +08:00
|
|
|
const {
|
|
|
|
|
selectedKey, showSearchAd, declareStatus, declareStatusList, taxCycle, declareEditDialog, loading,
|
|
|
|
|
pageInfo, adConditons, employmentTypeList, employmentStatusList
|
|
|
|
|
} = this.state;
|
|
|
|
|
const { taxAgentStore: { showOperateBtn }, employeeDeclareStore: { advanceForm: form, declareForm } } = this.props;
|
2023-08-11 17:14:43 +08:00
|
|
|
const menu = (
|
2023-08-16 10:21:42 +08:00
|
|
|
<Menu onClick={this.handleMenuClick}>
|
2023-08-11 17:14:43 +08:00
|
|
|
<Menu.Item key="1">{getLabel(32136, "批量删除")}</Menu.Item>
|
2023-08-25 14:42:31 +08:00
|
|
|
{/*<Menu.Item key="2">{getLabel(111, "批量编辑")}</Menu.Item>*/}
|
|
|
|
|
{/*<Menu.Item key="3">{getLabel(81272, "导出全部")}</Menu.Item>*/}
|
|
|
|
|
{/*<Menu.Item key="4">{getLabel(543715, "导出所选")}</Menu.Item>*/}
|
2023-08-11 17:14:43 +08:00
|
|
|
</Menu>
|
|
|
|
|
);
|
2023-08-11 16:06:21 +08:00
|
|
|
const buttons = [
|
2023-08-14 14:46:19 +08:00
|
|
|
<WeaDatePicker arrow type="month" className="pickerDateCustom flex a-center" value={taxCycle}
|
2023-08-16 10:21:42 +08:00
|
|
|
onChange={val => this.setState({
|
|
|
|
|
taxCycle: val,
|
|
|
|
|
pageInfo: {
|
|
|
|
|
...pageInfo,
|
|
|
|
|
current: 1
|
|
|
|
|
}
|
|
|
|
|
}, () => this.queryEmployeeList())}/>,
|
|
|
|
|
<Button type="primary" onClick={this.employeedeclareDeclare}
|
|
|
|
|
loading={loading.declare}>{getLabel(111, "全部报送")}</Button>,
|
|
|
|
|
<Button type="ghost" onClick={this.getDeclareFeedback}
|
|
|
|
|
loading={loading.feedback}>{getLabel(111, "获取报送结果")}</Button>,
|
|
|
|
|
<Button type="ghost" onClick={this.employeedeclareRefresh}
|
|
|
|
|
loading={loading.refresh}>{getLabel(111, "刷新数据")}</Button>,
|
2023-08-11 17:14:43 +08:00
|
|
|
<Dropdown overlay={menu}>
|
2023-08-11 16:06:21 +08:00
|
|
|
<Button type="ghost" icon="ellipsis" className="moreBtn"/>
|
|
|
|
|
</Dropdown>
|
|
|
|
|
];
|
2023-08-11 17:14:43 +08:00
|
|
|
const topTab = [
|
2023-08-16 10:21:42 +08:00
|
|
|
{ title: getLabel(332, "全部"), viewcondition: "list" },
|
|
|
|
|
{ title: getLabel(111, "本月新增"), viewcondition: "list4Add" },
|
|
|
|
|
{ title: getLabel(111, "本月信息变动"), viewcondition: "list4Update" }
|
|
|
|
|
];
|
|
|
|
|
const tabBtns = [
|
2023-12-18 14:56:18 +08:00
|
|
|
<Button type="ghost" onClick={this.handleAdd}>{getLabel(1421, "新增")}</Button>,
|
|
|
|
|
// <Dropdown.Button
|
|
|
|
|
// onClick={this.handleAdd}
|
|
|
|
|
// overlay={
|
|
|
|
|
// <Menu>
|
|
|
|
|
// {/*<Menu.Item key="1">{getLabel(32935, "导入")}</Menu.Item>*/}
|
|
|
|
|
// </Menu>
|
|
|
|
|
// }
|
|
|
|
|
// type="primary">{getLabel(1421, "新增")}</Dropdown.Button>,
|
2023-08-16 10:21:42 +08:00
|
|
|
<Dropdown.Button
|
2023-12-18 14:56:18 +08:00
|
|
|
onClick={() => this.handleEmployeedeclareExport({ key: "all" })}
|
|
|
|
|
loading={loading.exportLoading}
|
2023-08-16 10:21:42 +08:00
|
|
|
overlay={
|
2023-12-18 14:56:18 +08:00
|
|
|
<Menu onClick={this.handleEmployeedeclareExport}>
|
|
|
|
|
<Menu.Item key="selected">{getLabel(543715, "导出所选")}</Menu.Item>
|
2023-08-16 10:21:42 +08:00
|
|
|
</Menu>
|
|
|
|
|
}
|
2023-12-18 14:56:18 +08:00
|
|
|
type="primary">{getLabel(17416, "导出全部")}</Dropdown.Button>,
|
|
|
|
|
// <Button type="ghost" onClick={this.handleEmployeedeclareExport}
|
|
|
|
|
// loading={loading.exportLoading}>{getLabel(17416, "导出")}</Button>,
|
2023-08-16 10:21:42 +08:00
|
|
|
<WeaSelect
|
|
|
|
|
value={declareStatus}
|
|
|
|
|
style={{ width: 150 }}
|
|
|
|
|
options={[
|
|
|
|
|
..._.map(submitStatus, it => ({ ...it, showname: getLabel(it.lanId, it.showname) })),
|
|
|
|
|
..._.map(declareStatusList, it => ({
|
|
|
|
|
key: it.enum,
|
|
|
|
|
showname: getLabel(it.labelId, it.defaultLabel)
|
|
|
|
|
}))
|
|
|
|
|
]}
|
|
|
|
|
onChange={declareStatus => this.setState({
|
|
|
|
|
declareStatus,
|
|
|
|
|
pageInfo: {
|
|
|
|
|
...pageInfo,
|
|
|
|
|
current: 1
|
|
|
|
|
}
|
|
|
|
|
}, () => this.queryEmployeeList())}
|
|
|
|
|
/>
|
2023-08-11 17:14:43 +08:00
|
|
|
];
|
2023-08-16 10:21:42 +08:00
|
|
|
// !showOperateBtn && tabBtns.shift();
|
2023-08-16 11:20:06 +08:00
|
|
|
selectedKey !== "list" && tabBtns.shift();
|
2023-12-06 17:06:44 +08:00
|
|
|
selectedKey !== "list" && tabBtns.shift();
|
2023-08-11 16:06:21 +08:00
|
|
|
return (
|
|
|
|
|
<WeaTop
|
|
|
|
|
title={getLabel(544289, "人员信息报送")} iconBgcolor="#F14A2D"
|
|
|
|
|
icon={<i className="icon-coms-fa"/>} className="declareWrapper"
|
2023-08-16 10:21:42 +08:00
|
|
|
buttons={buttons}
|
|
|
|
|
// buttons={showOperateBtn ? buttons : []}
|
2023-08-11 16:06:21 +08:00
|
|
|
>
|
2023-08-14 14:46:19 +08:00
|
|
|
<div style={{ height: "100%", background: "#f6f6f6" }} className="flex flex-rollback">
|
|
|
|
|
{/*基础信息*/}
|
2023-08-16 10:21:42 +08:00
|
|
|
<BaseInfo
|
|
|
|
|
ref={dom => this.baseInfoRef = dom}
|
|
|
|
|
taxCycle={moment(taxCycle).startOf("month").format("YYYY-MM-DD")}
|
|
|
|
|
/>
|
2023-08-14 14:46:19 +08:00
|
|
|
{/*列表数据*/}
|
|
|
|
|
<div className="listview-com-layout flex-1 flex flex-rollback">
|
2023-08-11 17:14:43 +08:00
|
|
|
<WeaTab
|
2023-08-14 14:46:19 +08:00
|
|
|
datas={topTab} keyParam="viewcondition" showSearchAd={showSearchAd}
|
2023-08-11 17:14:43 +08:00
|
|
|
selectedKey={selectedKey} searchType={["base", "advanced"]}
|
2023-08-14 14:46:19 +08:00
|
|
|
setShowSearchAd={bool => this.setState({ showSearchAd: bool })}
|
2023-08-16 10:21:42 +08:00
|
|
|
advanceHeight={300} searchsAd={getSearchs(form, toJS(adConditons), 2)}
|
|
|
|
|
buttons={tabBtns} searchsBaseValue={form.getFormParams().keyword}
|
2023-08-14 14:46:19 +08:00
|
|
|
onSearchChange={(v) => form.updateFields({ keyword: v })}
|
2023-08-16 10:21:42 +08:00
|
|
|
onChange={key => this.setState({
|
|
|
|
|
selectedKey: key,
|
|
|
|
|
pageInfo: { ...pageInfo, current: 1 }
|
|
|
|
|
}, () => this.queryEmployeeList())}
|
2023-08-14 14:46:19 +08:00
|
|
|
onAdReset={() => form.resetForm()}
|
2023-08-16 10:21:42 +08:00
|
|
|
onSearch={() => this.setState({
|
|
|
|
|
pageInfo: { ...pageInfo, current: 1 }
|
|
|
|
|
}, () => this.queryEmployeeList())}
|
|
|
|
|
onAdSearch={() => this.setState({
|
|
|
|
|
pageInfo: {
|
|
|
|
|
...pageInfo,
|
|
|
|
|
current: 1
|
|
|
|
|
}
|
|
|
|
|
}, () => this.queryEmployeeList())}
|
2023-08-11 17:14:43 +08:00
|
|
|
/>
|
2023-08-14 14:46:19 +08:00
|
|
|
<div className="flex-1">
|
2023-08-16 10:21:42 +08:00
|
|
|
<Spin spinning={loading.query}>
|
2023-08-14 14:46:19 +08:00
|
|
|
<iframe
|
|
|
|
|
style={{ border: 0, width: "100%", height: "100%" }}
|
2023-08-16 10:21:42 +08:00
|
|
|
// src="http://localhost:7607/#/employeeDeclareTable"
|
|
|
|
|
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/employeeDeclareTable"
|
2023-08-14 14:46:19 +08:00
|
|
|
id="atdTable"
|
|
|
|
|
/>
|
|
|
|
|
</Spin>
|
2023-08-14 17:08:40 +08:00
|
|
|
{/*新增编辑报送信息*/}
|
|
|
|
|
<EmployeeDeclareDetailSchemaEditDialog
|
|
|
|
|
{...declareEditDialog}
|
2023-08-16 10:21:42 +08:00
|
|
|
taxCycle={moment(taxCycle).startOf("month").format("YYYY-MM-DD")}
|
|
|
|
|
employmentStatusList={employmentStatusList}
|
|
|
|
|
employmentTypeList={employmentTypeList}
|
|
|
|
|
onClose={(isFresh) => {
|
2023-08-14 17:08:40 +08:00
|
|
|
this.setState({
|
|
|
|
|
declareEditDialog: {
|
2023-08-16 10:21:42 +08:00
|
|
|
...declareEditDialog,
|
|
|
|
|
visible: false, id: "", title: ""
|
2023-08-14 17:08:40 +08:00
|
|
|
}
|
2023-08-16 10:21:42 +08:00
|
|
|
}, () => {
|
|
|
|
|
declareForm.resetForm();
|
|
|
|
|
isFresh === "true" && this.queryEmployeeList();
|
2023-08-14 17:08:40 +08:00
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2023-08-14 14:46:19 +08:00
|
|
|
</div>
|
2023-08-11 17:14:43 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-08-11 16:06:21 +08:00
|
|
|
</WeaTop>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Index;
|