-
{getLabel(537996, "个税扣缴义务人")}:{getQueryString("taxName")}
+
+ {getLabel(537996, "个税扣缴义务人")}:{decodeURIComponent(getQueryString("taxName") || "")}
{getLabel(111, "报送失败")}: 0
-
{getLabel(111, "未报送")}: 0
+ onClick={this.handleOpenFailDialog}>{getLabel(111, "报送失败")}: {declareFailSize || 0}
+
{getLabel(111, "未报送")}: {notDeclareSize || 0}
{/*报送失败数据查看*/}
@@ -47,7 +66,7 @@ class BaseInfo extends Component {
onCancel={() => {
this.setState({
declareCalcDialog: {
- visible: false
+ visible: false, taxCycle: ""
}
});
}}
diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailCalcDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailCalcDialog.js
index 83e88345..f4fa0756 100644
--- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailCalcDialog.js
+++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailCalcDialog.js
@@ -6,13 +6,64 @@
*/
import React, { Component } from "react";
import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
+import { employeedeclareList4Fail } from "../../../apis/declare";
import { Button, Col, Row } from "antd";
+import { getQueryString } from "../../../util/url";
const { getLabel } = WeaLocaleProvider;
class EmployeeDeclareDetailCalcDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ pageInfo: { current: 1, pageSize: 10, total: 0 },
+ loading: false, columns: [], dataSource: []
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.employeedeclareList4Fail(nextProps);
+ }
+
+ employeedeclareList4Fail = (props) => {
+ const { pageInfo } = this.state;
+ const payload = {
+ ...pageInfo,
+ taxAgentId: getQueryString("id"),
+ taxCycle: props.taxCycle
+ };
+ this.setState({ loading: true });
+ employeedeclareList4Fail(payload).then(({ status, data }) => {
+ this.setState({ loading: false });
+ if (status) {
+ const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
+ this.setState({
+ columns, dataSource,
+ pageInfo: { ...pageInfo, current, pageSize, total }
+ });
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
render() {
+ const { loading, columns, dataSource, pageInfo } = this.state;
+ const pagination = {
+ ...pageInfo,
+ showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
+ showQuickJumper: true,
+ showSizeChanger: true,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ onShowSizeChange: (current, pageSize) => {
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize }
+ }, () => this.employeedeclareList4Fail(this.props));
+ },
+ onChange: current => {
+ this.setState({
+ pageInfo: { ...pageInfo, current }
+ }, () => this.employeedeclareList4Fail(this.props));
+ }
+ };
return (
diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js
index dc483a65..c65d2ef0 100644
--- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js
+++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js
@@ -6,30 +6,199 @@
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaSlideModal } from "ecCom";
-import { Button, Col, Row } from "antd";
+import { Button, Col, message, Modal, Row } from "antd";
import { inject, observer } from "mobx-react";
import { declareConditions } from "../constants";
import { getSearchs } from "../../../util";
+import { getQueryString } from "../../../util/url";
+import { employeedeclareGetForm, getEmployeeSave } from "../../../apis/declare";
const { getLabel } = WeaLocaleProvider;
@inject("employeeDeclareStore")
@observer
class EmployeeDeclareDetailSchemaEditDialog extends Component {
- componentDidMount() {
- const { employeeDeclareStore: { declareForm } } = this.props;
- declareForm.initFormFields(declareConditions);
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false,
+ eConditions: []
+ };
}
componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.employeedeclareGetForm(nextProps);
}
+ employeedeclareGetForm = (props) => {
+ employeedeclareGetForm(_.pick(props, ["id"])).then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ eConditions: _.map(declareConditions, it => {
+ return {
+ ...it,
+ items: _.map(it.items, child => {
+ if (child.domkey[0] === "employmentStatus") {
+ return {
+ ...child,
+ value: _.take(props.employmentStatusList)[0].enum,
+ options: _.map(props.employmentStatusList, it => ({
+ key: it.enum,
+ showname: getLabel(it.labelId, it.defaultLabel)
+ }))
+ };
+ } else if (child.domkey[0] === "employmentType") {
+ return {
+ ...child,
+ value: _.take(props.employmentTypeList)[0].enum,
+ options: _.map(props.employmentTypeList, it => ({
+ key: it.enum,
+ showname: getLabel(it.labelId, it.defaultLabel)
+ }))
+ };
+ } else if (child.domkey[0] === "gender") {
+ return {
+ ...child,
+ value: "MALE",
+ options: [
+ { key: "MALE", showname: getLabel(111, "男") },
+ { key: "FEMALE", showname: getLabel(111, "女") }
+ ]
+ };
+ } else if (child.domkey[0] === "employeeType") {
+ return {
+ ...child,
+ viewAttr: props.id ? 1 : 3,
+ options: [
+ { key: "ORGANIZATION", showname: getLabel(30042, "人员") }
+ ]
+ };
+ }
+ if (child.conditionType === "SELECT" && child.domkey[0] !== "gender" && child.domkey[0] !== "employmentStatus" && child.domkey[0] !== "employmentType") {
+ return {
+ ...child,
+ options: [
+ { key: "ON", showname: getLabel(538048, "是") },
+ { key: "OFF", showname: getLabel(111, "否") }
+ ]
+ };
+ }
+ return { ...child };
+ })
+ };
+ })
+ }, () => {
+ const { data: result, columns } = data;
+ const { employeeDeclareStore: { declareForm } } = this.props;
+ declareForm.initFormFields(this.state.eConditions);
+ const filedKes = _.map(columns, it => it.dataIndex);
+ _.map(filedKes, item => {
+ if (item === "disability" || item === "lonelyOld" || item === "martyrDependents") {
+ declareForm.updateFields({ [item]: result[item] || "OFF" });
+ } else if (item === "deductExpenses") {
+ declareForm.updateFields({ [item]: result[item] || "ON" });
+ } else if (item === "gender") {
+ declareForm.updateFields({ [item]: result[item] || "MALE" });
+ } else if (item === "employmentStatus") {
+ declareForm.updateFields({ [item]: result[item] || _.take(props.employmentStatusList)[0].enum });
+ } else if (item === "employmentType") {
+ declareForm.updateFields({ [item]: result[item] || _.take(props.employmentTypeList)[0].enum });
+ } else if (item === "cardType") {
+ declareForm.updateFields({ [item]: "居民身份证" });
+ } else if (item === "employee") {
+ declareForm.updateFields({
+ // employeeType: {
+ // value: ["ORGANIZATION", ["13", "郑世珍", [{ id: "13", lastname: "郑世珍" }]]],
+ // valueSpan: ["employeeId"]
+ // }
+ });
+ } else {
+ declareForm.updateFields({ [item]: result[item] || "" });
+ }
+ });
+ });
+ }
+ });
+ };
+ onChange = (res) => {
+ const { eConditions } = this.state;
+ const { employeeDeclareStore: { declareForm } } = this.props;
+ const key = Object.keys(res)[0];
+ const value = res[key].value;
+ switch (key) {
+ case "employmentStatus":
+ this.setState({
+ eConditions: _.map(eConditions, it => {
+ return {
+ ...it,
+ items: _.map(it.items, child => {
+ if (child.domkey[0] === "dismissDate") {
+ return {
+ ...child,
+ viewAttr: value === "ABNORMAL" ? 3 : 2
+ };
+ }
+ return { ...child };
+ })
+ };
+ })
+ }, () => {
+ declareForm.initFormFields(this.state.eConditions);
+ });
+ break;
+ case "employmentType":
+ this.setState({
+ eConditions: _.map(eConditions, it => {
+ return {
+ ...it,
+ items: _.map(it.items, child => {
+ if (child.domkey[0] === "employmentDate") {
+ return {
+ ...child,
+ viewAttr: value !== "OTHER" ? 3 : 2
+ };
+ }
+ return { ...child };
+ })
+ };
+ })
+ }, () => {
+ declareForm.initFormFields(this.state.eConditions);
+ });
+ break;
+ default:
+ break;
+ }
+ };
+
handleSubmit = () => {
const { employeeDeclareStore: { declareForm: form } } = this.props;
form.validateForm().then(f => {
if (f.isValid) {
- const payload = form.getFormParams();
- console.log(payload);
+ const { employmentType, employmentDate, employmentStatus, dismissDate, ...params } = form.getFormParams();
+ if ((employmentType !== "OTHER" && !employmentDate) || (employmentStatus === "ABNORMAL" && !dismissDate)) {
+ Modal.warning({
+ title: getLabel(131329, "信息确认"),
+ content: getLabel(518702, "必要信息不完整,红色*为必填项!")
+ });
+ return;
+ }
+ const payload = {
+ ...form.getFormParams(), id: this.props.id,
+ cardType: "RESIDENT_IDENTITY_CARDS", //暂时写死身份证类型
+ taxAgentId: getQueryString("id"),
+ taxCycle: this.props.taxCycle
+ };
+ this.setState({ loading: true });
+ getEmployeeSave(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success(getLabel(22619, "保存成功!"));
+ this.props.onClose("true");
+ } else {
+ message.error(errormsg || getLabel(22620, "保存失败!"));
+ }
+ }).catch(() => this.setState({ loading: false }));
} else {
f.showErrors();
}
@@ -37,7 +206,8 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
};
render() {
- const { employeeDeclareStore: { declareForm: form } } = this.props;
+ const { eConditions, loading } = this.state;
+ const { employeeDeclareStore: { declareForm: form }, title = "" } = this.props;
return (
- {getLabel(111, "本月新增数据")}
+ {title || getLabel(111, "本月新增数据")}
-
+
)}
- content={({getSearchs(form, declareConditions, 1)}
)}
+ content={({getSearchs(form, eConditions, 1, false, this.onChange)}
)}
/>
);
}
diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js
index 9134619a..9b3ff734 100644
--- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js
+++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js
@@ -2,26 +2,6 @@ export const submitStatus = [
{
key: "ALL",
showname: "全部(报送状态)",
- lanId: 332
- },
- {
- key: "NOT_DECLARE",
- showname: "待报送",
- lanId: 111
- },
- {
- key: "DECLARING",
- showname: "报送中",
- lanId: 111
- },
- {
- key: "DECLARE_FAIL",
- showname: "报送失败",
- lanId: 111
- },
- {
- key: "DECLARE_SUCCESS",
- showname: "报送成功",
lanId: 111
}
];
@@ -197,7 +177,7 @@ export const declareConditions = [
rules: "selectLinkageRequired",
conditionType: "SELECT_LINKAGE",
selectLinkageDatas: {
- "1": {
+ "ORGANIZATION": {
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
@@ -218,18 +198,15 @@ export const declareConditions = [
type: "1"
},
conditionType: "BROWSER",
- domkey: ["INPUT"]
+ domkey: ["employeeId"]
},
- "2": {
- conditionType: "CHECKBOX",
- domkey: ["CHECKBOX"]
+ "EXT_EMPLOYEE": {
+ conditionType: "BROWSER",
+ domkey: ["INPUT2"]
}
},
- options: [
- { key: "1", showname: "今天" },
- { key: "2", showname: "本周" }
- ],
- domkey: ["secleve"],
+ options: [],
+ domkey: ["employeeType"],
label: "系统名称",
lanId: 111,
viewAttr: 3
@@ -237,7 +214,7 @@ export const declareConditions = [
{
colSpan: 1,
conditionType: "INPUT",
- domkey: ["keyword"],
+ domkey: ["employeeName"],
fieldcol: 12,
label: "证件姓名",
lanId: 111,
@@ -245,6 +222,211 @@ export const declareConditions = [
value: "",
rules: "required",
viewAttr: 3
+ },
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["jobNum"],
+ fieldcol: 12,
+ label: "工号",
+ lanId: 1933,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2
+ },
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["nationality"],
+ fieldcol: 12,
+ label: "国籍",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 1
+ },
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["cardType"],
+ fieldcol: 12,
+ label: "证件类型",
+ lanId: 111,
+ labelcol: 6,
+ value: "居民身份证",
+ viewAttr: 1
+ },
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["cardNum"],
+ fieldcol: 12,
+ label: "证件号码",
+ lanId: 1839,
+ labelcol: 6,
+ value: "",
+ rules: "required",
+ viewAttr: 3
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["gender"],
+ fieldcol: 12,
+ label: "性别",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 3,
+ rules: "required",
+ options: []
+ },
+ {
+ colSpan: 1,
+ conditionType: "DATEPICKER",
+ domkey: ["birthday"],
+ fieldcol: 12,
+ label: "出生日期",
+ lanId: 111,
+ labelcol: 6,
+ rules: "required",
+ value: "",
+ viewAttr: 3
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["employmentStatus"],
+ fieldcol: 12,
+ label: "状态",
+ lanId: 535101,
+ labelcol: 6,
+ value: "",
+ viewAttr: 3,
+ rules: "required",
+ detailtype: 3,
+ options: []
+ },
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["mobile"],
+ fieldcol: 12,
+ label: "手机号码",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ rules: "required",
+ viewAttr: 3
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["employmentType"],
+ fieldcol: 12,
+ label: "任职受雇从业类型",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 3,
+ rules: "required",
+ options: []
+ },
+ {
+ colSpan: 1,
+ conditionType: "DATEPICKER",
+ domkey: ["employmentDate"],
+ fieldcol: 12,
+ label: "任职受雇从业日期",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 3
+ },
+ {
+ colSpan: 1,
+ conditionType: "DATEPICKER",
+ domkey: ["dismissDate"],
+ fieldcol: 12,
+ label: "离职日期",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["disability"],
+ fieldcol: 12,
+ label: "是否残疾",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2,
+ detailtype: 3,
+ options: []
+ },
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["disabilityCardNo"],
+ fieldcol: 12,
+ label: "残疾证号",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["lonelyOld"],
+ fieldcol: 12,
+ label: "是否孤老",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2,
+ detailtype: 3,
+ options: []
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["martyrDependents"],
+ fieldcol: 12,
+ label: "是否是烈属",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2,
+ detailtype: 3,
+ options: []
+ },
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["martyrDependentsCardNo"],
+ fieldcol: 12,
+ label: "烈属证号",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["deductExpenses"],
+ fieldcol: 12,
+ label: "是否扣除减除费用",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2,
+ detailtype: 3,
+ options: []
}
],
defaultshow: true
diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js
index 022bbf27..74b8d9d2 100644
--- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js
+++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js
@@ -6,16 +6,34 @@
*/
import React, { Component } from "react";
import { WeaDatePicker, WeaLocaleProvider, WeaSelect, WeaTab, WeaTop } from "ecCom";
-import { Button, Dropdown, Menu, Spin } from "antd";
+import { Button, Dropdown, Menu, message, Modal, Spin } from "antd";
import BaseInfo from "./components/baseInfo";
import EmployeeDeclareDetailSchemaEditDialog from "./components/employeeDeclareDetailSchemaEditDialog";
+import { commonEnumList } from "../../apis/payrollFiles";
+import {
+ employeedeclareDeclare,
+ employeedeclareGetRate,
+ employeedeclareList,
+ employeedeclareList4Add,
+ employeedeclareList4Update,
+ employeedeclareRefresh,
+ employeeDelete,
+ getDeclareFeedback
+} from "../../apis/declare";
import { advanceConditions, submitStatus } from "./constants";
+import moment from "moment";
import { getSearchs } from "../../util";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
+import { getQueryString } from "../../util/url";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
+const API = {
+ list: employeedeclareList,
+ list4Add: employeedeclareList4Add,
+ list4Update: employeedeclareList4Update
+};
@inject("taxAgentStore", "employeeDeclareStore")
@observer
@@ -23,60 +41,288 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
- selectedKey: "0",
- showSearchAd: false,
- declareStatus: "ALL",
- taxCycle: new Date(),
- declareEditDialog: {
- visible: false
- }
+ selectedKey: "list", showSearchAd: false, declareStatus: "ALL",
+ taxCycle: new Date(), loading: { query: false, refresh: false, feedback: false, declare: false },
+ pageInfo: { current: 1, pageSize: 10, total: 0 },
+ declareEditDialog: { visible: false, id: "", title: "" },
+ declareStatusList: [], employmentStatusList: [],
+ employmentTypeList: [], adConditons: [],
+ selectedRowKeys: []
};
+ this.baseInfoRef = null;
}
componentDidMount() {
- const { employeeDeclareStore: { advanceForm } } = this.props;
document.title = getLabel(544289, "人员信息报送");
- advanceForm.initFormFields(advanceConditions);
window.addEventListener("message", this.handleReceive, false);
- this.setCss();
+ this.initEmployeeDeclare().then(r => {
+ });
}
+ 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);
+ });
+ }
+ };
+
componentWillUnmount() {
window.removeEventListener("message", this.handleReceive, false);
}
- setCss = () => {
- $($("head")[0]).append("");
- };
-
handleReceive = ({ data }) => {
const { type, payload: { id, params } = {} } = data;
if (type === "init") {
- this.postMessageToChild({});
+ this.queryEmployeeList();
} else if (type === "turn") {
if (id === "PAGEINFO") {
const { pageNum: current, size: pageSize } = params;
this.setState({ pageInfo: { ...pageInfo, current, pageSize } });
+ } 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 });
}
}
};
- postMessageToChild = (payload) => {
+ postMessageToChild = (payload = {}) => {
+ const i18n = {
+ "总计": getLabel(523, "总计"), "编辑": getLabel(501169, "编辑"),
+ "操作": getLabel(30585, "操作"), "删除": getLabel(535052, "删除"),
+ "共": getLabel(83698, "共"), "条": getLabel(18256, "条"),
+ "加载中": getLabel(83698, "加载中")
+ };
const childFrameObj = document.getElementById("atdTable");
- childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({}), "*");
+ 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(",") : []
+ };
+ this.setState({ loading: { ...this.state.loading, query: true } });
+ 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 = {
+ dataSource, selectedRowKeys,
+ 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 }) => {
+ this.setState({ loading: { ...this.state.loading, refresh: false } });
+ if (status) {
+ const { status, data: result } = await employeedeclareGetRate({ index: data });
+ const { msg } = result || {};
+ (status && !msg) ? message.success(getLabel(111, "刷新成功!")) : message.warning(msg || getLabel(111, "刷新失败!"));
+ this.queryEmployeeList();
+ } else {
+ message.error(errormsg);
+ }
+ }).catch(() => this.setState({ loading: { ...this.state.loading, refresh: false } }));
+ };
+ /*
+ * 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 }) => {
+ this.setState({ loading: { ...this.state.loading, feedback: false } });
+ if (status) {
+ const { status, data: result } = await employeedeclareGetRate({ index: data });
+ const { msg } = result || {};
+ (status && !msg) ? message.success(getLabel(111, "获取报送结果成功!")) : message.warning(msg || "");
+ this.queryEmployeeList();
+ } else {
+ message.error(errormsg);
+ }
+ }).catch(() => this.setState({ loading: { ...this.state.loading, feedback: false } }));
+ };
+ /*
+ * 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 }) => {
+ this.setState({ loading: { ...this.state.loading, declare: false } });
+ if (status) {
+ const { status, data: result } = await employeedeclareGetRate({ index: data });
+ const { msg } = result || {};
+ (status && !msg) ? message.success(getLabel(111, "全部报送成功!")) : message.warning(msg || "");
+ this.queryEmployeeList();
+ } else {
+ message.error(errormsg);
+ }
+ }).catch(() => this.setState({ loading: { ...this.state.loading, declare: false } }));
};
handleAdd = () => {
this.setState({
declareEditDialog: {
+ ...this.state.declareEditDialog,
visible: true
}
});
};
+ handleMenuClick = ({ key }) => {
+ const { selectedRowKeys } = this.state;
+ switch (key) {
+ case "1":
+ if (_.isEmpty(selectedRowKeys)) {
+ message.warning(getLabel(111, "请先选择需要删除的人员!"));
+ return;
+ }
+ this.handleDeleteDeclare(selectedRowKeys);
+ break;
+ default:
+ break;
+ }
+ };
render() {
- const { selectedKey, showSearchAd, declareStatus, taxCycle, declareEditDialog } = this.state;
- const { taxAgentStore: { showOperateBtn }, employeeDeclareStore: { advanceForm: form } } = this.props;
+ const {
+ selectedKey, showSearchAd, declareStatus, declareStatusList, taxCycle, declareEditDialog, loading,
+ pageInfo, adConditons, employmentTypeList, employmentStatusList
+ } = this.state;
+ const { taxAgentStore: { showOperateBtn }, employeeDeclareStore: { advanceForm: form, declareForm } } = this.props;
const menu = (
-
+ }
+ type="primary">{getLabel(1421, "新增")},
+ ({ ...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())}
+ />
+ ];
+ // !showOperateBtn && tabBtns.shift();
return (
} className="declareWrapper"
- buttons={showOperateBtn ? buttons : []}
+ buttons={buttons}
+ // buttons={showOperateBtn ? buttons : []}
>
{/*基础信息*/}
-
+
this.baseInfoRef = dom}
+ taxCycle={moment(taxCycle).startOf("month").format("YYYY-MM-DD")}
+ />
{/*列表数据*/}
this.setState({ showSearchAd: bool })}
- advanceHeight={300} searchsAd={getSearchs(form, toJS(advanceConditions), 2)}
- buttons={[
-
- {getLabel(32935, "导入")}
-
- }
- type="primary">{getLabel(1421, "新增")},
- ({ ...it, showname: getLabel(it.lanId, it.showname) }))}
- onChange={declareStatus => this.setState({ declareStatus })}
- />
- ]} searchsBaseValue={form.getFormParams().keyword}
+ advanceHeight={300} searchsAd={getSearchs(form, toJS(adConditons), 2)}
+ buttons={tabBtns} searchsBaseValue={form.getFormParams().keyword}
onSearchChange={(v) => form.updateFields({ keyword: v })}
- onChange={key => this.setState({ selectedKey: key })}
+ onChange={key => this.setState({
+ selectedKey: key,
+ pageInfo: { ...pageInfo, current: 1 }
+ }, () => this.queryEmployeeList())}
onAdReset={() => form.resetForm()}
+ onSearch={() => this.setState({
+ pageInfo: { ...pageInfo, current: 1 }
+ }, () => this.queryEmployeeList())}
+ onAdSearch={() => this.setState({
+ pageInfo: {
+ ...pageInfo,
+ current: 1
+ }
+ }, () => this.queryEmployeeList())}
/>
-
+
{/*新增编辑报送信息*/}
{
+ taxCycle={moment(taxCycle).startOf("month").format("YYYY-MM-DD")}
+ employmentStatusList={employmentStatusList}
+ employmentTypeList={employmentTypeList}
+ onClose={(isFresh) => {
this.setState({
declareEditDialog: {
- visible: false
+ ...declareEditDialog,
+ visible: false, id: "", title: ""
}
+ }, () => {
+ declareForm.resetForm();
+ isFresh === "true" && this.queryEmployeeList();
});
}}
/>
diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.less b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.less
index 946f67aa..9d69d1fa 100644
--- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.less
+++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.less
@@ -70,10 +70,10 @@
}
-//.ant-calendar-picker-container {
-// right: 0 !important;
-// left: auto !important;
-//}
+.declareTable {
+ background: #FFF;
+}
+
.wea-slide-modal-title {
border-bottom: 1px solid #e5e5e5 !important;
diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js
index b3647225..e218995d 100644
--- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js
+++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js
@@ -144,7 +144,7 @@ class TaxAgentSlide extends Component {
API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, errormsg }) => {
this.setState({ verifyLoading: false });
if (status) {
- message.error(errormsg || getLabel(22619, "保存成功!"));
+ message.success(getLabel(22619, "保存成功!"));
jumpAll ? this.props.onCancel(true) : this.props.onOk();
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));