个税对接-人员信息报送详情页
This commit is contained in:
parent
892e0f10f9
commit
c58472ad8f
|
|
@ -1,68 +1,128 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
import { postFetch } from '../util/request';
|
||||
import { WeaTools } from "ecCom";
|
||||
import { postFetch } from "../util/request";
|
||||
|
||||
//个税申报表-个税申报表列表
|
||||
export const getDeclareList = params => {
|
||||
return fetch('/api/bs/hrmsalary/taxdeclaration/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/taxdeclaration/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//个税申报表-个税申报表表单
|
||||
export const getDeclareForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/taxdeclaration/getForm', 'get', params);
|
||||
}
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getForm", "get", params);
|
||||
};
|
||||
|
||||
//个税申报表-个税申报表生成
|
||||
export const saveDeclare = params => {
|
||||
return fetch('/api/bs/hrmsalary/taxdeclaration/save', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/taxdeclaration/save", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//个税申报表-个税申报表相关信息
|
||||
export const getDeclareInfo = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo', 'get', params);
|
||||
}
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", "get", params);
|
||||
};
|
||||
|
||||
// 个税申报表详情列表
|
||||
export const getDetailList = params => {
|
||||
return fetch('/api/bs/hrmsalary/taxdeclaration/detail/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/taxdeclaration/detail/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
|
||||
// 个税申报表导出
|
||||
export const exportSalaryArchive = (id = "") => {
|
||||
fetch('/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=' + id).then(res => res.blob().then(blob => {
|
||||
var filename=`个税申报表.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
fetch("/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=" + id).then(res => res.blob().then(blob => {
|
||||
var filename = `个税申报表.xlsx`;
|
||||
var a = document.createElement("a");
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}));
|
||||
};
|
||||
//个税申报表-撤回申报
|
||||
export const withDrawTaxDeclaration = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/taxdeclaration/withDrawTaxDeclaration', params);
|
||||
}
|
||||
return postFetch("/api/bs/hrmsalary/taxdeclaration/withDrawTaxDeclaration", params);
|
||||
};
|
||||
|
||||
//人员信息报送-个税扣缴义务人列表
|
||||
export const taxAgentDeclareList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/taxAgentDeclareList", params);
|
||||
};
|
||||
//人员信息报送-全部人员列表
|
||||
export const employeedeclareList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/list", params);
|
||||
};
|
||||
//人员信息报送-本月新增人员列表
|
||||
export const employeedeclareList4Add = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/list4Add", params);
|
||||
};
|
||||
//人员信息报送-本月信息变动列表
|
||||
export const employeedeclareList4Update = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/list4Update", params);
|
||||
};
|
||||
|
||||
//人员信息报送-本月报送失败人员列表
|
||||
export const employeedeclareList4Fail = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/list4Fail", params);
|
||||
};
|
||||
|
||||
//人员报送-刷新数据
|
||||
export const employeedeclareRefresh = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/refresh", params);
|
||||
};
|
||||
|
||||
//人员报送-获取报送结果反馈
|
||||
export const getDeclareFeedback = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/getDeclareFeedback", params);
|
||||
};
|
||||
|
||||
//人员报送-获取整体的报送情况
|
||||
export const getEmployeeDeclareInfo = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/getDeclareInfo", params);
|
||||
};
|
||||
|
||||
//人员报送-后端业务逻辑是否已经完成
|
||||
export const employeedeclareGetRate = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/employeedeclare/getRate", "GET", params);
|
||||
};
|
||||
|
||||
//人员报送-获取新建或编辑的表单
|
||||
export const employeedeclareGetForm = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/employeedeclare/getForm", "GET", params);
|
||||
};
|
||||
|
||||
//人员报送-新增人员/编辑人员保存
|
||||
export const getEmployeeSave = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/save", params);
|
||||
};
|
||||
|
||||
//人员报送-删除
|
||||
export const employeeDelete = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/delete", params);
|
||||
};
|
||||
|
||||
//人员报送-全部报送
|
||||
export const employeedeclareDeclare = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/employeedeclare/declare", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
||||
import { Col, Row } from "antd";
|
||||
import { Col, message, Row } from "antd";
|
||||
import { taxAgentDeclareList } from "../../apis/declare";
|
||||
import TipLabel from "../../components/TipLabel";
|
||||
import "./index.less";
|
||||
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
|
|
@ -15,13 +18,35 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
loading: false
|
||||
dataSource: [], loading: false, taxAgentName: "",
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.taxAgentDeclareList();
|
||||
}
|
||||
|
||||
taxAgentDeclareList = () => {
|
||||
const { pageInfo, taxAgentName } = this.state;
|
||||
const payload = { ...pageInfo, taxAgentName };
|
||||
this.setState({ loading: true });
|
||||
taxAgentDeclareList(payload).then(({ status, data, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { pageNum: current, pageSize, total, list: dataSource } = data;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { pageInfo } = this.state;
|
||||
const { pageInfo, taxAgentName, dataSource } = this.state;
|
||||
const tipList = [
|
||||
getLabel(544290, "1、点击查看详情,管理各个个税扣缴义务人的人员报送信息,如购买了在线报送服务,可在线报送,如未购买在线报送服务,也可导出数据线下报送。")
|
||||
];
|
||||
|
|
@ -31,6 +56,8 @@ class Index extends Component {
|
|||
icon={<i className="icon-coms-fa"/>}
|
||||
buttons={[
|
||||
<WeaInputSearch placeholder={getLabel(543634, "请输入个税扣缴义务人名称")}
|
||||
value={taxAgentName} onChange={val => this.setState({ taxAgentName: val })}
|
||||
onSearch={this.taxAgentDeclareList}
|
||||
/>
|
||||
]}
|
||||
>
|
||||
|
|
@ -38,6 +65,7 @@ class Index extends Component {
|
|||
<Row gutter={16}>
|
||||
<Col span={16}>
|
||||
<WeaTable
|
||||
className="declareTable"
|
||||
columns={[
|
||||
{
|
||||
title: getLabel(537996, "个税扣缴义务人"),
|
||||
|
|
@ -47,10 +75,12 @@ class Index extends Component {
|
|||
title: getLabel(30585, "操作"),
|
||||
dataIndex: "operate",
|
||||
width: 260,
|
||||
render: () => (<a href="javascript: void(0);">{getLabel(83110, "查看详情")}</a>)
|
||||
render: (_, record) => (<a
|
||||
href={`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclareDetail?id=${record.id}&taxName=${record.taxAgentName}`}
|
||||
target="_blank">{getLabel(83110, "查看详情")}</a>)
|
||||
}
|
||||
]}
|
||||
dataSource={[]}
|
||||
dataSource={dataSource}
|
||||
pagination={{
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
|
|
@ -60,12 +90,12 @@ class Index extends Component {
|
|||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
});
|
||||
}, () => this.taxAgentDeclareList());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
});
|
||||
}, () => this.taxAgentDeclareList());
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
.declareTable {
|
||||
background: #FFF;
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ import React, { Component } from "react";
|
|||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { getQueryString } from "../../../util/url";
|
||||
import EmployeeDeclareDetailCalcDialog from "./employeeDeclareDetailCalcDialog";
|
||||
import { getEmployeeDeclareInfo } from "../../../apis/declare";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
|
|
@ -16,29 +17,47 @@ class BaseInfo extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
declareCalcDialog: {
|
||||
visible: false
|
||||
}
|
||||
visible: false, taxCycle: ""
|
||||
},
|
||||
declareInfo: {}
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 人员报送-获取整体的报送情况
|
||||
* Params:
|
||||
* Date: 2023/8/14
|
||||
*/
|
||||
getEmployeeDeclareInfo = () => {
|
||||
const payload = {
|
||||
taxAgentId: getQueryString("id"),
|
||||
taxCycle: this.props.taxCycle
|
||||
};
|
||||
getEmployeeDeclareInfo(payload).then(({ status, data }) => {
|
||||
if (status) this.setState({ declareInfo: data });
|
||||
});
|
||||
};
|
||||
handleOpenFailDialog = () => {
|
||||
this.setState({
|
||||
declareCalcDialog: {
|
||||
visible: true
|
||||
visible: true, taxCycle: this.props.taxCycle
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { declareCalcDialog } = this.state;
|
||||
const { declareCalcDialog, declareInfo } = this.state;
|
||||
const { declareFailSize, notDeclareSize } = declareInfo;
|
||||
return (
|
||||
<div className="base-info">
|
||||
<div className="left"><span>{getLabel(537996, "个税扣缴义务人")}:{getQueryString("taxName")}</span></div>
|
||||
<div className="left">
|
||||
<span>{getLabel(537996, "个税扣缴义务人")}:{decodeURIComponent(getQueryString("taxName") || "")}</span></div>
|
||||
<div className="right">
|
||||
<div className="header-declare-info">
|
||||
<a href="javascript:void(0);" className="fail"
|
||||
onClick={this.handleOpenFailDialog}>{getLabel(111, "报送失败")}: 0</a>
|
||||
<span className="not">{getLabel(111, "未报送")}: 0</span>
|
||||
onClick={this.handleOpenFailDialog}>{getLabel(111, "报送失败")}: {declareFailSize || 0}</a>
|
||||
<span className="not">{getLabel(111, "未报送")}: {notDeclareSize || 0}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/*报送失败数据查看*/}
|
||||
|
|
@ -47,7 +66,7 @@ class BaseInfo extends Component {
|
|||
onCancel={() => {
|
||||
this.setState({
|
||||
declareCalcDialog: {
|
||||
visible: false
|
||||
visible: false, taxCycle: ""
|
||||
}
|
||||
});
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<WeaDialog
|
||||
{...this.props}
|
||||
|
|
@ -38,8 +89,9 @@ class EmployeeDeclareDetailCalcDialog extends Component {
|
|||
>
|
||||
<div className="declareCalcDialogContent">
|
||||
<WeaTable
|
||||
columns={[{ dataIndex: "opt", title: "操作" }]}
|
||||
dataSource={[]}
|
||||
columns={columns} dataSource={dataSource}
|
||||
loading={loading} className="declareTable"
|
||||
pagination={pagination}
|
||||
/>
|
||||
</div>
|
||||
</WeaDialog>
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<WeaSlideModal
|
||||
{...this.props}
|
||||
|
|
@ -48,13 +218,13 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
title={(<Row className="declareSchemeDialogTitle" type="flex">
|
||||
<Col span={12} className="declareSchemeDialogTitle-left">
|
||||
<div className="icon-circle-base"><i className="icon-coms-fa"/></div>
|
||||
<span className="title">{getLabel(111, "本月新增数据")}</span>
|
||||
<span className="title">{title || getLabel(111, "本月新增数据")}</span>
|
||||
</Col>
|
||||
<Col span={12} className="declareSchemeDialogTitle-right">
|
||||
<Button type="primary" onClick={this.handleSubmit}>{getLabel(537558, "保存")}</Button>
|
||||
<Button type="primary" onClick={this.handleSubmit} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
</Col>
|
||||
</Row>)}
|
||||
content={(<div className="declareSchemeDialog">{getSearchs(form, declareConditions, 1)}</div>)}
|
||||
content={(<div className="declareSchemeDialog">{getSearchs(form, eConditions, 1, false, this.onChange)}</div>)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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("<style id=\"theme-style\" type=\"text/css\">" + ".ant-calendar-picker-container { right: 0 !important; left: auto !important}" + "</style>");
|
||||
};
|
||||
|
||||
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 = (
|
||||
<Menu>
|
||||
<Menu onClick={this.handleMenuClick}>
|
||||
<Menu.Item key="1">{getLabel(32136, "批量删除")}</Menu.Item>
|
||||
<Menu.Item key="2">{getLabel(111, "批量编辑")}</Menu.Item>
|
||||
<Menu.Item key="3">{getLabel(81272, "导出全部")}</Menu.Item>
|
||||
|
|
@ -84,73 +330,119 @@ class Index extends Component {
|
|||
</Menu>
|
||||
);
|
||||
const buttons = [
|
||||
<Button type="primary">{getLabel(111, "全部报送")}</Button>,
|
||||
<Button type="ghost">{getLabel(111, "获取报送结果")}</Button>,
|
||||
<Button type="ghost">{getLabel(111, "刷新数据")}</Button>,
|
||||
<WeaDatePicker arrow type="month" className="pickerDateCustom flex a-center" value={taxCycle}
|
||||
onChange={val => console.log(val)}/>,
|
||||
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>,
|
||||
<Dropdown overlay={menu}>
|
||||
<Button type="ghost" icon="ellipsis" className="moreBtn"/>
|
||||
</Dropdown>
|
||||
];
|
||||
const topTab = [
|
||||
{ title: getLabel(332, "全部"), viewcondition: "0" },
|
||||
{ title: getLabel(111, "本月新增"), viewcondition: "1" },
|
||||
{ title: getLabel(111, "本月信息变动"), viewcondition: "2" }
|
||||
{ title: getLabel(332, "全部"), viewcondition: "list" },
|
||||
{ title: getLabel(111, "本月新增"), viewcondition: "list4Add" },
|
||||
{ title: getLabel(111, "本月信息变动"), viewcondition: "list4Update" }
|
||||
];
|
||||
const tabBtns = [
|
||||
<Dropdown.Button
|
||||
onClick={this.handleAdd}
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item key="1">{getLabel(32935, "导入")}</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="primary">{getLabel(1421, "新增")}</Dropdown.Button>,
|
||||
<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())}
|
||||
/>
|
||||
];
|
||||
// !showOperateBtn && tabBtns.shift();
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(544289, "人员信息报送")} iconBgcolor="#F14A2D"
|
||||
icon={<i className="icon-coms-fa"/>} className="declareWrapper"
|
||||
buttons={showOperateBtn ? buttons : []}
|
||||
buttons={buttons}
|
||||
// buttons={showOperateBtn ? buttons : []}
|
||||
>
|
||||
<div style={{ height: "100%", background: "#f6f6f6" }} className="flex flex-rollback">
|
||||
{/*基础信息*/}
|
||||
<BaseInfo/>
|
||||
<BaseInfo
|
||||
ref={dom => this.baseInfoRef = dom}
|
||||
taxCycle={moment(taxCycle).startOf("month").format("YYYY-MM-DD")}
|
||||
/>
|
||||
{/*列表数据*/}
|
||||
<div className="listview-com-layout flex-1 flex flex-rollback">
|
||||
<WeaTab
|
||||
datas={topTab} keyParam="viewcondition" showSearchAd={showSearchAd}
|
||||
selectedKey={selectedKey} searchType={["base", "advanced"]}
|
||||
setShowSearchAd={bool => this.setState({ showSearchAd: bool })}
|
||||
advanceHeight={300} searchsAd={getSearchs(form, toJS(advanceConditions), 2)}
|
||||
buttons={[
|
||||
<Dropdown.Button
|
||||
onClick={this.handleAdd}
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item key="1">{getLabel(32935, "导入")}</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="primary">{getLabel(1421, "新增")}</Dropdown.Button>,
|
||||
<WeaSelect
|
||||
value={declareStatus}
|
||||
style={{ width: 150 }}
|
||||
options={_.map(submitStatus, it => ({ ...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())}
|
||||
/>
|
||||
<div className="flex-1">
|
||||
<Spin spinning={false}>
|
||||
<Spin spinning={loading.query}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
src="http://localhost:7607/#/employeeDeclareTable"
|
||||
// src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/employeeDeclareTable"
|
||||
// src="http://localhost:7607/#/employeeDeclareTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/employeeDeclareTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
{/*新增编辑报送信息*/}
|
||||
<EmployeeDeclareDetailSchemaEditDialog
|
||||
{...declareEditDialog}
|
||||
onClose={() => {
|
||||
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();
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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, "保存失败!"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue