{
(showOperateBtn || showSalaryItemBtn) &&
新增
}
{
- showOperateBtn &&
+ (showOperateBtn || showSalaryItemBtn) &&
+ ]}>
+
+
+ {this.renderInputItem()}
+
+
+
+
+ );
+ }
+}
+
+const TestTip = () => {
+ return
+
涉及到选择具体数据进行运算时,请先检查对应数据源中是否有数据项;
+
涉及到日期控件时,请先选择日期控件的格式,保持和控件本身设置的格式一致,否则可能会导致预期与实际执行结果不一致;
+
涉及到日期控件判断与预期不符合时,请先检查日期控件的格式是否与等号右边的格式保持一致;
+
;
+};
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js
index 5268b20b..ea9c5464 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js
@@ -1,14 +1,27 @@
import React from "react";
import { inject, observer } from "mobx-react";
-import { Col, Row } from "antd";
-import { WeaCheckbox, WeaDatePicker, WeaInput, WeaInputNumber, WeaSelect } from "ecCom";
-import GroupCard from "../../../components/groupCard";
-import cs from "classnames";
+import { message } from "antd";
+import { toJS } from "mobx";
+import { WeaSearchGroup } from "ecCom";
+import {
+ ConsistentWelfare,
+ SocialDatePicker,
+ SocialEditInput,
+ SocialInputNumber,
+ SocialSelect,
+ SocialTitle
+} from "./socialSecurityForm";
import "./index.less";
@inject("archivesStore")
@observer
export default class AccumulationFundForm extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ Welfare: ""
+ };
+ }
componentWillMount() {
const { archivesStore: { getBaseForm, getPaymentForm } } = this.props;
@@ -16,172 +29,161 @@ export default class AccumulationFundForm extends React.Component {
getPaymentForm(this.props.employeeId, "ACCUMULATION_FUND", this.props.record.fundSchemeId, this.props.record.paymentOrganization);
}
- // 表单变化
- handleFormChange(params) {
+ handleFormChange = ({ key, value }) => {
+ const params = { [key]: value };
const { archivesStore: { accumulationFundForm, setAccumulationFundForm }, onChangeRecordFundSchemeId } = this.props;
const { data } = accumulationFundForm;
let request = { ...data, ...params };
- request.fundName = request.fundSchemeId;
let form = { ...accumulationFundForm };
form.data = request;
setAccumulationFundForm(form);
- Object.keys(params).length>1 &&
- onChangeRecordFundSchemeId(params.fundSchemeId)
- }
+ key === "fundSchemeId" && this.setState({ Welfare: "" });
+ key === "fundSchemeId" && this.handleFetchPaymentForm(value);
+ key === "fundSchemeId" && onChangeRecordFundSchemeId(value);
+ };
// 获取基数表单
- handleFetchPaymentForm(fundName) {
+ handleFetchPaymentForm = (fundName) => {
const { archivesStore: { getPaymentForm } } = this.props;
- getPaymentForm(this.props.employeeId, "ACCUMULATION_FUND", fundName, this.props.record.paymentOrganization);
- }
-
-
- //基数变化
- handlePaymentChange(params) {
+ getPaymentForm(this.props.employeeId, "ACCUMULATION_FUND", fundName, this.props.record.paymentOrganization, true);
+ };
+ handlePaymentChange = ({ key, value }) => {
+ const params = { [key]: !_.isNil(value) ? value.toString() : "" };
const { archivesStore: { accumulationFundPaymentForm, setAccumulationFundPaymentForm } } = this.props;
const { data } = accumulationFundPaymentForm;
let request = { ...data, ...params };
let form = { ...accumulationFundPaymentForm };
form.data = request;
setAccumulationFundPaymentForm(form);
- }
-
- render() {
- const { archivesStore: { accumulationFundForm, accumulationFundPaymentForm } } = this.props;
- const { items } = accumulationFundForm;
- let baseData = accumulationFundForm.data;
- let paymentData = accumulationFundPaymentForm.data;
- let paymentItems = accumulationFundPaymentForm.items;
- let data = { ...baseData };
- // Integer数据转为string
- if (data) {
- Object.keys(data).map(key => {
- if (data[key]) {
- data[key] = data[key].toString();
+ };
+ handleBlurChange = ({ key, value, minNum, maxNum }) => {
+ const params = {
+ [key]: _.isNil(value) ? "" : (Number(value) > maxNum && maxNum !== 0) ? maxNum :
+ (Number(value) < minNum && minNum !== 0) ? minNum : value.toString()
+ };
+ const { archivesStore: { accumulationFundPaymentForm, setAccumulationFundPaymentForm } } = this.props;
+ const { data } = accumulationFundPaymentForm;
+ let request = { ...data, ...params };
+ let form = { ...accumulationFundPaymentForm };
+ form.data = request;
+ setAccumulationFundPaymentForm(form);
+ };
+ handleChangeWelfare = (val) => {
+ const { archivesStore: { accumulationFundPaymentForm, setAccumulationFundPaymentForm } } = this.props;
+ let paymentData = toJS(accumulationFundPaymentForm.data);
+ const [paymentFormItems] = toJS(accumulationFundPaymentForm.items);
+ const { items } = paymentFormItems;
+ if (val) {
+ _.forEach(items, (it) => {
+ const { min, max, domkey } = it;
+ const minNum = !_.isNil(min) ? Number(min) : 0, maxNum = !_.isNil(max) ? Number(max) : 0;
+ if ((val < minNum || val > maxNum) && !_.isNil(min) && !_.isNil(max) && (!!maxNum || !!minNum)) {
+ message.warning("超出所选缴纳方案设置的基数上下限范围,将自动按基数上下限填充。");
+ paymentData = {
+ ...paymentData,
+ [domkey[0]]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
+ };
+ } else {
+ paymentData = { ...paymentData, [domkey[0]]: val };
}
});
+ } else {
+ _.forEach(items, (it) => {
+ const { domkey } = it;
+ paymentData = { ...paymentData, [domkey[0]]: "" };
+ });
}
+ setAccumulationFundPaymentForm({ ...accumulationFundPaymentForm, data: { ...paymentData } });
+ };
+
+ render() {
+ const { Welfare } = this.state;
+ const { archivesStore: { accumulationFundForm, accumulationFundPaymentForm } } = this.props;
+ const { items, data: foundData } = accumulationFundForm;
+ const paymentData = accumulationFundPaymentForm.data;
+ const paymentItems = accumulationFundPaymentForm.items;
+ const {
+ nonPayment = "", fundAccount = "", supplementFundAccount = "", fundStartTime = "", fundEndTime = "",
+ fundSchemeId = ""
+ } = foundData || {};
+ const foundItems = !_.isNil(toJS(items)) ? [
+ ..._.map(_.filter(toJS(items)[0].items, it => it.domkey[0] !== "paymentOrganization"),
+ item => ({
+ com: SocialSelect({
+ key: item["domkey"][0],
+ label: item.label,
+ value: !_.isNil(foundData[item["domkey"][0]]) ? foundData[item["domkey"][0]].toString() : "",
+ options: item.options,
+ onChange: this.handleFormChange
+ })
+ })),
+ {
+ com: SocialDatePicker({
+ key: "fundStartTime",
+ label: "公积金起始缴纳月",
+ viewAttr: fundSchemeId ? 3 : 2,
+ value: fundStartTime,
+ disabledDate: (current) => {
+ return current && fundEndTime && current.getTime() > new Date(fundEndTime).getTime();
+ },
+ onChange: this.handleFormChange
+ })
+ },
+ {
+ com: SocialEditInput({
+ key: "fundAccount",
+ label: "公积金账号",
+ value: fundAccount,
+ onChange: this.handleFormChange
+ })
+ },
+ {
+ com: SocialDatePicker({
+ key: "fundEndTime",
+ label: "公积金最后缴纳月",
+ value: fundEndTime,
+ disabledDate: (current) => {
+ return current && fundStartTime && current.getTime() < new Date(fundStartTime).getTime();
+ },
+ onChange: this.handleFormChange
+ })
+ },
+ {
+ com: SocialEditInput({
+ key: "supplementFundAccount",
+ label: "补充公积金账号",
+ value: supplementFundAccount,
+ onChange: this.handleFormChange
+ })
+ }
+ ] : [];
return (
-
- {
- this.handleFormChange({ nonPayment: value });
- }}/>
-
-
-
- 公积金起始缴纳月:
-
- this.handleFormChange({ fundStartTime: value })}
- />
-
-
- 公积金方案名称:
-
- {
- this.handleFormChange({ fundSchemeId: value, fundName: showname });
- this.handleFetchPaymentForm(value);
- }}
- />
-
-
-
- 公积金最后缴纳月:
-
- this.handleFormChange({ fundEndTime: value })}
- />
-
- 公积金账号:
-
- this.handleFormChange({ fundAccount: value })}/>
-
-
-
- 补充公积金账号:
-
- this.handleFormChange({ supplementFundAccount: value })}/>
-
- 公积金个人实际承担方:
-
- {
- this.handleFormChange({ underTake: value });
- }}
- />
-
-
- {/**/}
- {/*公积金缴纳组织:*/}
- {/**/}
- {/* */}
- {/**/}
- {/*
*/}
-
+
}
+ items={foundItems} col={2} showGroup needTigger={false}/>
{
- data.fundSchemeId && paymentItems && paymentItems.map(group => (
-
- {
- group.items && group.items.length > 0 &&
-
- {
- group.items && group.items.map((item, idx) => (
-
-
- {item.label}:
-
- {
- this.handlePaymentChange({ [item.domkey[0]]: String(value) });
- }}
- />
-
-
-
- ))
- }
-
-
- }
-
-
-
- ))
+ fundSchemeId && !_.isEmpty(toJS(paymentItems)) && _.map(toJS(paymentItems), item => {
+ const { title, items } = item;
+ return ({
+ com: SocialInputNumber({
+ key: child["domkey"][0],
+ label: child.label,
+ value: !_.isNil(paymentData[child["domkey"][0]]) ? paymentData[child["domkey"][0]].toString() : "",
+ onChange: this.handlePaymentChange,
+ onBlurChange: this.handleBlurChange,
+ min: child.min,
+ max: child.max
+ })
+ }))}
+ customComponent={ this.setState({ Welfare })}
+ onBlurChange={this.handleChangeWelfare}/>}
+ title={title} col={2} showGroup
+ />;
+ })
}
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js
index 03be2c76..5c658b41 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js
@@ -1,64 +1,43 @@
import React from "react";
-import GroupCard from "../../../components/groupCard";
-import { Col, Row, Tooltip } from "antd";
+import { WeaFormItem, WeaInput, WeaSearchGroup } from "ecCom";
import { inject, observer } from "mobx-react";
import "./index.less";
@inject("archivesStore")
@observer
export default class BaseForm extends React.Component {
-
componentWillMount() {
const { archivesStore: { getBaseForm } } = this.props;
getBaseForm(this.props.employeeId);
}
render() {
- const { archivesStore: { baseFormData } ,record} = this.props;
+ const { archivesStore: { baseFormData }, record } = this.props;
+ const { username, department, position, telephone, hiredate, dimissionDate } = baseFormData;
+ const { paymentOrganizationName } = record;
+ const baseItems = [
+ { com: Input("姓名", username) },
+ { com: Input("部门", department) },
+ { com: Input("岗位", position) },
+ { com: Input("手机号", telephone) },
+ { com: Input("入职日期", hiredate) },
+ { com: Input("合同到期日期", dimissionDate) }
+ ];
+ const taxagentItems = [
+ { com: Input("个税扣缴义务人", paymentOrganizationName) }
+ ];
return (
-
-
- 姓名:
-
-
- {baseFormData.username}
-
-
- 部门:
-
-
- {baseFormData.department}
-
-
- 岗位:
-
-
- {baseFormData.position}
-
-
-
-
-
- 入职日期:
- {baseFormData.hiredate}
- 手机号:
-
-
- {baseFormData.telephone}
-
-
- 合同到期日期:
- {baseFormData.dimissionDate}
-
-
-
-
- 个税扣缴义务人:
- {record.paymentOrganizationName}
-
-
+
+
);
}
}
+const Input = (label, value) => {
+ return (
+
+
+
+ );
+};
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
index d574bacb..c0111c45 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
@@ -2,8 +2,8 @@ import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button, Dropdown, Menu, message, Modal, Popover } from "antd";
-import { WeaHelpfulTip, WeaRightMenu, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom";
-import { getSearchs, renderLoading } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
+import { WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
+import { getSearchs, renderLoading } from "../../../util";
import BaseForm from "./baseForm";
import SlideModalTitle from "../../../components/slideModalTitle";
import SocialSecurityForm from "./socialSecurityForm";
@@ -13,8 +13,12 @@ import { tabCondition } from "./config";
import * as API from "../../../apis/welfareArchive";
import ImportModal from "../../../components/importModal";
import TipLabel from "../../../components/TipLabel";
+import UnifiedTable from "../../../components/UnifiedTable";
+import { convertToUrlString } from "../../../util/url";
+import { salaryArchiveDelete } from "../../../apis/payrollFiles";
import "./index.less";
+const getLabel = WeaLocaleProvider.getLabel;
@inject("archivesStore", "taxAgentStore")
@observer
export default class Archives extends React.Component {
@@ -48,16 +52,16 @@ export default class Archives extends React.Component {
current: 1,
pageSize: 10,
total: 0
- }
+ },
+ salaryArchiveDelete: "" //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是
};
-
this.record = {};
- this.pageInfo = { current: 1, pageSize: 10 };
}
componentDidMount() {
const { archivesStore: { doInit } } = this.props;
doInit();
+ this.salaryArchiveDelete();
this.queryList({ runStatuses: ["1"] });
}
@@ -93,77 +97,103 @@ export default class Archives extends React.Component {
}
});
};
+ salaryArchiveDelete = () => {
+ salaryArchiveDelete().then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ salaryArchiveDelete: data
+ });
+ }
+ });
+ };
- handleEdit(record) {
+ handleEdit = (record) => {
this.record = record;
this.setState({ employeeId: record.employeeId, editSlideVisible: true });
- }
+ };
- setStep(step) {
+ setStep = (step) => {
this.setState({ step });
- }
+ };
- getColumns() {
- const { columns, pageInfo, selectedKey } = this.state;
+ getColumns = () => {
+ const { columns, salaryArchiveDelete, selectedKey } = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
- let tmpV = _.map(columns.filter(item => item.display === "TRUE"), (item, index) => {
- if (index === 0) {
- return {
- ...item, dataIndex: item.column,
- fixed: "left",
- title: item.text
- };
- }
+ let tmpV = _.map(columns.filter(item => item.display === "TRUE"), item => {
return {
...item,
- dataIndex:
- item.column,
+ dataIndex: item.column,
title: item.text,
render: (text) => {
- return
{text};
+ return
{text};
}
};
});
return tmpV.length > 0 ? [
- {
- title: "序号",
- dataIndex: "index",
- width: 60,
- fixed: "left",
- render: (text, record, index) => {
- const { current, pageSize } = pageInfo;
- return (current - 1) * pageSize + index + 1;
- }
- },
...tmpV, {
title: "操作",
+ width: 150,
dataIndex: "operate",
- fixed: "right",
- width: "120px",
render: (text, record) => {
return (
this.handleEdit(record)}>{(showOperateBtn && selectedKey !== "stop") ? "编辑" : "查看"}
+ {
+ showOperateBtn && selectedKey === "pending" &&
+
this.stayAddToPay([record.baseInfo])}>增员
+ }
+ {
+ showOperateBtn && selectedKey === "suspend" &&
+
this.stayDelToStop([record.baseInfo])}>减员
+ }
+ {
+ showOperateBtn && selectedKey === "stop" && salaryArchiveDelete === "1" &&
+
this.deleteSocialArchive([record.baseInfo])}>删除档案
+ }
+ {
+ showOperateBtn && selectedKey === "stop" && salaryArchiveDelete !== "1" &&
+
this.cancelStopPayment([record.baseInfo])}>取消停缴
+ }
{
showOperateBtn && selectedKey === "pending" &&
{
- if (key === "addMember") {
- this.stayAddToPay([record.baseInfo]);
- } else {
- Modal.warning({
- title: "信息确认",
- content: `确定要删除该条待办人员吗?`,
- onOk: () => this.deleteTodoList({ runStatus: "4", ids: [record.baseInfo] })
- });
- }
- }}>
- 增员
- 删除待办
- } title="">
+ content={
+ salaryArchiveDelete === "1" ?
+ :
+
+ } title="">
}
@@ -174,23 +204,20 @@ export default class Archives extends React.Component {
placement="bottomRight"
content={
} title="">
}
{
- showOperateBtn && selectedKey === "stop" &&
+ showOperateBtn && selectedKey === "stop" && salaryArchiveDelete === "1" &&
{
- const { selectedTab } = this.state;
- const { archivesStore: { save, socialSecurityForm, accumulationFundForm, otherForm } } = this.props;
- if (selectedTab == 1) {
- const { data } = socialSecurityForm;
- if (data.socialSchemeId && !data.socialStartTime) {
- Modal.warning({
- title: "信息确认",
- content: "必要信息不完整,红色*为必填项!"
- });
- return;
- }
- save("SOCIAL_SECURITY").then(() => {
- this.query();
- });
- } else if (selectedTab == 2) {
- const { data } = accumulationFundForm;
- if (data.fundSchemeId && !data.fundStartTime) {
- Modal.warning({
- title: "信息确认",
- content: "必要信息不完整,红色*为必填项!"
- });
- return;
- }
- save("ACCUMULATION_FUND").then(() => {
- this.query();
- });
- } else if (selectedTab == 3) {
- const { data } = otherForm;
- if (data.otherSchemeId && !data.otherStartTime) {
- Modal.warning({
- title: "信息确认",
- content: "必要信息不完整,红色*为必填项!"
- });
- return;
- }
- save("OTHER").then(() => {
- this.query();
- });
+ if (!this.handleSave) {
+ this.handleSave = _.debounce(() => {
+ const { selectedTab } = this.state;
+ const { archivesStore: { save, socialSecurityForm, accumulationFundForm, otherForm } } = this.props;
+ if (selectedTab == 1) {
+ const { data } = socialSecurityForm;
+ const { socialSchemeId, socialStartTime } = data;
+ if (socialSchemeId && !socialStartTime) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ save("SOCIAL_SECURITY").then(() => {
+ this.query();
+ });
+ } else if (selectedTab == 2) {
+ const { data } = accumulationFundForm;
+ const { fundSchemeId, fundStartTime } = data;
+ if (fundSchemeId && !fundStartTime) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ save("ACCUMULATION_FUND").then(() => {
+ this.query();
+ });
+ } else if (selectedTab == 3) {
+ const { data } = otherForm;
+ const { otherSchemeId, otherStartTime } = data;
+ if (otherSchemeId && !otherStartTime) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ save("OTHER").then(() => {
+ this.query();
+ });
+ }
+ }, 500);
}
+ this.handleSave();
};
// 导入
- handleBtnImport(runStatus) {
+ handleBtnImport = (runStatus) => {
this.setState({ importVisible: true, runStatus });
- }
+ };
// 模板点击
handleTemplateLinkClick = (exportData) => {
const { selectedKey } = this.state;
- const { archivesStore: { exportTempateDownload } } = this.props;
- exportTempateDownload({
- exportData,
- runStatuses: selectedKey === "pending" ? ["1"] : ["2", "3"]
- });
+ let url = `/api/bs/hrmsalary/scheme/template/export?exportData=${exportData}&runStatuses=${selectedKey === "pending" ? "1" : "2,3"}`;
+ window.open(`${window.location.origin}${url}`);
};
// 导入预览
- handlePreviewImport(params) {
+ handlePreviewImport = (params) => {
const { archivesStore: { previewCurData } } = this.props;
previewCurData(params);
- }
+ };
// 导入
- handleImport(params) {
+ handleImport = (params) => {
const { archivesStore: { importBatch } } = this.props;
const { runStatus } = this.state;
importBatch({ ...params, runStatus });
- }
+ };
// 导入完成
- handleFinish() {
+ handleFinish = () => {
const { archivesStore: { initImportParams } } = this.props;
initImportParams();
this.setState({ importVisible: false, step: 0 }, () => {
this.query();
});
- }
+ };
// 初始化导入参数
- handleInitModal() {
+ handleInitModal = () => {
const { archivesStore: { setPreviewCurDataColumns, setPreviewCurDataDataSource, setImportResult } } = this.props;
setPreviewCurDataColumns([]);
setPreviewCurDataDataSource([]);
setImportResult({});
- }
+ };
// 选项设置
onSelectChange = selectedRowKeys => {
@@ -302,7 +334,7 @@ export default class Archives extends React.Component {
};
// 关闭导入框
- handleImportCancel() {
+ handleImportCancel = () => {
const { archivesStore: { initImportParams, getTableDatas } } = this.props;
initImportParams();
@@ -310,7 +342,7 @@ export default class Archives extends React.Component {
getTableDatas();
}
this.setState({ importVisible: false, step: 0 });
- }
+ };
//切换tab
handleChangeTab = (selectedKey) => {
@@ -401,6 +433,8 @@ export default class Archives extends React.Component {
case "suspend":
if (key === "1") {
this.stayDelToStop(selectedRowKeys);
+ } else if (key === "2") {
+ this.cancelStayDel({ runStatus: "3", ids: selectedRowKeys });
}
break;
default:
@@ -441,7 +475,23 @@ export default class Archives extends React.Component {
}
});
};
-
+ //删除社保档案
+ deleteSocialArchive = (params) => {
+ Modal.confirm({
+ title: getLabel(131329, "信息确认"),
+ content: getLabel(388758, "确认要删除吗?"),
+ onOk: () => {
+ API.deleteArchive(params).then(({ status, errormsg }) => {
+ if (status) {
+ message.success(getLabel(30700, "操作成功"));
+ this.query();
+ } else {
+ message.error(errormsg || getLabel(30651, "操作失败"));
+ }
+ });
+ }
+ });
+ };
//取消停缴
cancelStopPayment = (payload) => {
API.cancelStopPayment(payload).then(({ status, errormsg }) => {
@@ -454,7 +504,7 @@ export default class Archives extends React.Component {
}
});
};
- //删除待办
+ //删除待办-待增员
deleteTodoList = (payload) => {
API.updateRunStatus(payload).then(({ status, errormsg }) => {
if (status) {
@@ -466,6 +516,18 @@ export default class Archives extends React.Component {
}
});
};
+ //删除待办-待减员
+ cancelStayDel = (payload) => {
+ API.cancelStayDel(payload).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("操作成功");
+ this.query();
+ this.onSelectChange([]);
+ } else {
+ message.error(errormsg || "操作失败");
+ }
+ });
+ };
getTipChildren = () => {
const { selectedKey } = this.state;
@@ -493,7 +555,8 @@ export default class Archives extends React.Component {
break;
case "suspend":
dom =
-
1、数据进入【待减员】规则:①员工的人事状态属性从在职变成非在职,且在【在缴员工】里;②【在缴员工】里档案维护了缴纳终止月且小于等于当前月;③个税扣缴义务人发生调整;④某员工分权时在原个税扣缴义务人下处于【在缴员工】里但又将该员工添加到其他的个税扣缴义务人下的情况;
+ {/*④某员工分权时在原个税扣缴义务人下处于【在缴员工】里但又将该员工添加到其他的个税扣缴义务人下的情况;*/}
+
1、数据进入【待减员】规则:①员工的人事状态属性从在职变成非在职,且在【在缴员工】里;②【在缴员工】里档案维护了缴纳终止月且小于等于当前月;③个税扣缴义务人发生调整;
2、【待减员】为是否不再缴纳的待办状态,数据是从【在缴员工】中复制的,若不处理列表中的待办数据,也不影响社保福利核算;【待减员】维护的数据和【在缴员工】数据是同步的;
3、点击【减员】前先维护最后缴纳月,所有有起始缴纳月的福利项的最后缴纳月都小于等于当前月且无未归档的核算数据的档案才能减员成功,减员成功后数据进入【停缴员工】;
{/*
4、数据进入【待减员】规则的第四种情况下,若还需要在当前个税扣缴义务人下进行缴纳的话,当前该员工的【待减员】数据进行【删除待办】操作即可;若不在该个税扣缴义务人下继续缴纳,维护好最后缴纳月后进行【减员】操作,员工进入【停缴员工】;
*/}
@@ -502,7 +565,7 @@ export default class Archives extends React.Component {
default:
dom =
1、不需要缴纳社保福利的员工,保存在【停缴员工】;
-
2、【停缴员工】点击取消停缴,数据会回退到上次的位置(从【待减员】减员到停缴员工的,点击停缴返回到【在缴员工】,不返回到【待减员】);
+ {/*
2、【停缴员工】点击取消停缴,数据会回退到上次的位置(从【待减员】减员到停缴员工的,点击停缴返回到【在缴员工】,不返回到【待减员】);
*/}
{/*
3、若员工的社保福利从一个个税扣缴义务人下转到另一个个税扣缴义务人下去缴纳,则在转后的个税扣缴义务人的【待增员】中进行增员操作成功后,员工进入待【在缴员工】,而在原个税扣缴义务人下的【停缴员工】中,该员工数据将会被删除;是否开启分权员工的档案数据都只保存一份;
*/}
;
break;
@@ -525,28 +588,19 @@ export default class Archives extends React.Component {
form, condition, showSearchAd, setShowSearchAd,
previewCurDataColumns, previewCurDataDataSource, importResult
} = archivesStore;
- if (_.isEmpty(this.getColumns())) { // 无权限处理
- return renderLoading();
- }
- const rightMenu = [// 右键菜单
- // {
- // key: 'BTN_COLUMN',
- // icon:
,
- // content: '显示列定制',
- // onClick: this.showColumn
- // },
- ];
- const collectParams = { // 收藏功能配置
- favname: "社保福利档案",
- favouritetype: 1,
- objid: 0,
- link: "wui/index.html#/ns_demo03/index",
- importantlevel: 1
- };
+ if (_.isEmpty(this.getColumns())) return renderLoading();
const adBtn = [ // 高级搜索内部按钮
{
setShowSearchAd(false);
- this.query();
+ this.setState({
+ pageInfo: {
+ ...pageInfo,
+ current: 1,
+ pageSize: 10
+ }
+ }, () => {
+ this.query();
+ });
}}>搜索,
form.resetForm()}>重置,
setShowSearchAd(false)}>取消
@@ -558,16 +612,16 @@ export default class Archives extends React.Component {
let url = `${window.location.origin}/api/bs/hrmsalary/scheme/export?ids=`;
switch (selectedKey) {
case "pending":
- url = `${url}&runStatuses=1`;
+ url = `${url}&runStatuses=1&${convertToUrlString(form.getFormParams())}`;
break;
case "fixed":
- url = `${url}&runStatuses=2,3`;
+ url = `${url}&runStatuses=2,3&${convertToUrlString(form.getFormParams())}`;
break;
case "suspend":
- url = `${url}&runStatuses=3`;
+ url = `${url}&runStatuses=3&${convertToUrlString(form.getFormParams())}`;
break;
default:
- url = `${url}&runStatuses=4,5`;
+ url = `${url}&runStatuses=4,5&${convertToUrlString(form.getFormParams())}`;
break;
}
window.open(url, "_self");
@@ -649,6 +703,7 @@ export default class Archives extends React.Component {
overlay={
}
type="primary"
@@ -704,59 +759,70 @@ export default class Archives extends React.Component {
};
return (
-
} // 左侧图标
+ iconBgcolor="#F14A2D" // 左侧图标背景色
+ showDropIcon={false} // 是否显示下拉按钮
>
-
} // 左侧图标
- iconBgcolor="#F14A2D" // 左侧图标背景色
- showDropIcon={false} // 是否显示下拉按钮
- dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
- dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
- >
-
setShowSearchAd(bool)} //高级搜索面板受控
- searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
- buttonsAd={adBtn} // 高级搜索内部按钮
- searchsBasePlaceHolder={"请输入姓名"}
- onSearch={this.query} // 点搜索按钮时的回调
- onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
- searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
- />
-
- {
- !_.isEmpty(this.getColumns()) &&
- {this.getTipChildren()}
- }
-
-
+ setShowSearchAd(bool)} //高级搜索面板受控
+ searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
+ buttonsAd={adBtn} // 高级搜索内部按钮
+ searchsBasePlaceHolder={"请输入姓名"}
+ onSearch={() => {
+ this.setState({
+ pageInfo: {
+ ...pageInfo,
+ current: 1,
+ pageSize: 10
+ }
+ }, () => {
+ this.query();
+ });
+ }} // 点搜索按钮时的回调
+ onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
+ searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
+ />
+
+
+
+ {
+ !_.isEmpty(this.getColumns()) &&
+ {this.getTipChildren()}
+ }
+
+
+
{
this.state.editSlideVisible &&
this.handleEditSlideSave()}>保存] : []
}
- subItemChange={
- (selectedTab) => {
- this.setState({ selectedTab });
- }
- }
+ subItemChange={selectedTab => this.setState({ selectedTab })}
/>
}
content={
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less
index dd3e3a88..67111a4e 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less
@@ -1,36 +1,41 @@
.socialFormWrapper {
- .formItem {
- height: 40px;
- line-height: 40px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- padding-left: 10px;
- padding-right: 10px;
- border: 1px solid #e2e2e2;
- margin-bottom: 0 !important;
- .ant-select-selection{
- height: 30px;
- border-radius: 0;
+ .wea-search-group {
+ padding: 0 16px;
+
+ .wea-form-cell-wrapper {
+ border: 1px solid #e5e5e5;
+ border-bottom: none;
+ border-right: none;
+ margin: 0 16px;
+
+ .wea-form-cell {
+ padding: 4px 16px;
+ border-bottom: 1px solid #e5e5e5;
+ border-right: 1px solid #e5e5e5;
+
+ .wea-form-item {
+ padding: 0;
+ }
+ }
}
}
- .borderR-none {
- border-right: none;
- }
-
- .borderB-none {
- border-bottom: none;
+ .welfareBaseWrapper {
+ .title {
+ margin-right: 10px;
+ }
}
}
-.mySalaryBenefitsWrapper{
- .tdEllipsis{
+
+.mySalaryBenefitsWrapper {
+ .tdEllipsis {
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
+
.optWrapper {
display: flex;
align-items: center;
@@ -40,6 +45,7 @@
}
}
}
+
//提示语
.helpWrapper {
display: flex;
@@ -50,30 +56,32 @@
}
}
-.slideOuterWrapper{
- .wea-slide-modal-title{
+.slideOuterWrapper {
+ .wea-slide-modal-title {
height: initial;
line-height: initial;
text-align: left;
}
- .rodal-close{
+
+ .rodal-close {
z-index: 99;
- top: 10px!important;
+ top: 10px !important;
}
}
-@media (min-width: 1260px){
- .slideOuterWrapper{
- .reqTopWrapper .wea-new-top-req-title>div:first-child>div{
- max-width: 100%!important;
+@media (min-width: 1260px) {
+ .slideOuterWrapper {
+ .reqTopWrapper .wea-new-top-req-title > div:first-child > div {
+ max-width: 100% !important;
}
}
}
+
@media screen and (min-width: 1060px) and (max-width: 1260px) {
- .slideOuterWrapper{
- .reqTopWrapper .wea-new-top-req-title>div:first-child>div{
- max-width: calc(100% - 96px)!important;
+ .slideOuterWrapper {
+ .reqTopWrapper .wea-new-top-req-title > div:first-child > div {
+ max-width: calc(100% - 96px) !important;
}
}
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js
index 1707897e..fed359de 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js
@@ -1,9 +1,15 @@
import React from "react";
import { inject, observer } from "mobx-react";
-import {toJS} from 'mobx';
-import { Col, Row } from "antd";
-import { WeaCheckbox, WeaDatePicker, WeaInputNumber, WeaSelect } from "ecCom";
-import GroupCard from "../../../components/groupCard";
+import { message } from "antd";
+import { WeaSearchGroup } from "ecCom";
+import { toJS } from "mobx";
+import {
+ ConsistentWelfare,
+ SocialDatePicker,
+ SocialInputNumber,
+ SocialSelect,
+ SocialTitle
+} from "./socialSecurityForm";
import "./index.less";
@inject("archivesStore")
@@ -12,7 +18,7 @@ export default class OtherForm extends React.Component {
constructor(props) {
super(props);
this.state = {
- inited: false
+ Welfare: ""
};
}
@@ -23,151 +29,141 @@ export default class OtherForm extends React.Component {
}
// 获取基数表单
- handleFetchPaymentForm(value) {
+ handleFetchPaymentForm = (value) => {
const { archivesStore: { getPaymentForm } } = this.props;
- getPaymentForm(this.props.employeeId, "OTHER", value, this.props.record.paymentOrganization);
- }
-
- // 表单变化
- handleFormChange(params) {
+ getPaymentForm(this.props.employeeId, "OTHER", value, this.props.record.paymentOrganization, true);
+ };
+ handleFormChange = ({ key, value }) => {
+ const params = { [key]: value };
const { archivesStore: { otherForm, setOtherForm }, onChangeRecordOtherSchemeId } = this.props;
const { data } = otherForm;
let request = { ...data, ...params };
let form = { ...otherForm };
form.data = request;
setOtherForm(form);
- Object.keys(params).length>1 &&
- onChangeRecordOtherSchemeId(params.otherSchemeId)
- }
-
- //基数变化
- handlePaymentChange(params) {
+ key === "otherSchemeId" && this.setState({ Welfare: "" });
+ key === "otherSchemeId" && this.handleFetchPaymentForm(value);
+ key === "otherSchemeId" && onChangeRecordOtherSchemeId(value);
+ };
+ handlePaymentChange = ({ key, value }) => {
+ const params = { [key]: !_.isNil(value) ? value.toString() : "" };
const { archivesStore: { otherPaymentForm, setOtherPaymentForm } } = this.props;
const { data } = otherPaymentForm;
let request = { ...data, ...params };
let form = { ...otherPaymentForm };
form.data = request;
setOtherPaymentForm(form);
- }
+ };
+ handleBlurChange = ({ key, value, minNum, maxNum }) => {
+ const params = {
+ [key]: _.isNil(value) ? "" : (Number(value) > maxNum && maxNum !== 0) ? maxNum :
+ (Number(value) < minNum && minNum !== 0) ? minNum : value.toString()
+ };
+ const { archivesStore: { otherPaymentForm, setOtherPaymentForm } } = this.props;
+ const { data } = otherPaymentForm;
+ let request = { ...data, ...params };
+ let form = { ...otherPaymentForm };
+ form.data = request;
+ setOtherPaymentForm(form);
+ };
- render() {
- const { archivesStore: { otherForm, otherPaymentForm } } = this.props;
- const { items } = otherForm;
- let baseData = otherForm.data;
- let data = { ...baseData };
- let paymentData = otherPaymentForm.data;
- let paymentItems = otherPaymentForm.items;
- // Integer数据转为string
- if (data) {
- Object.keys(data).map(key => {
- if (data[key]) {
- data[key] = data[key].toString();
+ handleChangeWelfare = (val) => {
+ const { archivesStore: { otherPaymentForm, setOtherPaymentForm } } = this.props;
+ let paymentData = toJS(otherPaymentForm.data);
+ const [paymentFormItems] = toJS(otherPaymentForm.items);
+ const { items } = paymentFormItems;
+ if (val) {
+ _.forEach(items, (it) => {
+ const { min, max, domkey } = it;
+ const minNum = !_.isNil(min) ? Number(min) : 0, maxNum = !_.isNil(max) ? Number(max) : 0;
+ if ((val < minNum || val > maxNum) && !_.isNil(min) && !_.isNil(max) && (!!maxNum || !!minNum)) {
+ message.warning("超出所选缴纳方案设置的基数上下限范围,将自动按基数上下限填充。");
+ paymentData = {
+ ...paymentData,
+ [domkey[0]]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
+ };
+ } else {
+ paymentData = { ...paymentData, [domkey[0]]: val };
}
});
+ } else {
+ _.forEach(items, (it) => {
+ const { domkey } = it;
+ paymentData = { ...paymentData, [domkey[0]]: "" };
+ });
}
+ setOtherPaymentForm({ ...otherPaymentForm, data: { ...paymentData } });
+ };
+
+ render() {
+ const { Welfare } = this.state;
+ const { archivesStore: { otherForm, otherPaymentForm } } = this.props;
+ const { items, data: otherData } = otherForm;
+ let paymentData = otherPaymentForm.data;
+ let paymentItems = otherPaymentForm.items;
+ const { nonPayment = "", otherStartTime = "", otherEndTime = "", otherSchemeId = "" } = otherData || {};
+ const otherItems = !_.isNil(toJS(items)) ? [
+ ..._.map(_.filter(toJS(items)[0].items, it => it.domkey[0] !== "paymentOrganization"),
+ item => ({
+ com: SocialSelect({
+ key: item["domkey"][0],
+ label: item.label,
+ value: !_.isNil(otherData[item["domkey"][0]]) ? otherData[item["domkey"][0]].toString() : "",
+ options: item.options,
+ onChange: this.handleFormChange
+ })
+ })),
+ {
+ com: SocialDatePicker({
+ key: "otherStartTime",
+ label: "其他福利起始缴纳月",
+ viewAttr: otherSchemeId ? 3 : 2,
+ value: otherStartTime,
+ disabledDate: (current) => {
+ return current && otherEndTime && current.getTime() > new Date(otherEndTime).getTime();
+ },
+ onChange: this.handleFormChange
+ })
+ },
+ {
+ com: SocialDatePicker({
+ key: "otherEndTime",
+ label: "其他福利最后缴纳月",
+ value: otherEndTime,
+ disabledDate: (current) => {
+ return current && otherStartTime && current.getTime() < new Date(otherStartTime).getTime();
+ },
+ onChange: this.handleFormChange
+ })
+ }
+ ] : [];
return (
-
- {
- this.handleFormChange({ nonPayment: value });
- }}/>
-
-
-
- 其他福利起始缴纳月:
-
- this.handleFormChange({ otherStartTime: value })}
- />
-
- 其他福利方案名称:
-
- {
- this.handleFormChange({ otherName: showname, otherSchemeId: value });
- this.handleFetchPaymentForm(value);
- }}/>
-
-
-
- 其他福利最后缴纳月:
-
- this.handleFormChange({ otherEndTime: value })}
- />
-
- 其他福利个人实际承担方:
-
- {
- this.handleFormChange({ underTake: value });
- }}
- />
-
-
- {/**/}
- {/*社保缴纳组织:*/}
- {/**/}
- {/* */}
- {/* */}
- {/**/}
- {/*
*/}
-
-
+
}
+ items={otherItems} col={2} showGroup needTigger={false}/>
{
- data.otherSchemeId && paymentItems && paymentItems.map(group => (
-
- {
- group.items && group.items.length > 0 &&
-
- {
- group.items && group.items.map(item => (
-
-
- {item.label}:
-
- {
- this.handlePaymentChange({ [item.domkey[0]]: String(value) });
- }}
- />
-
-
-
- ))
- }
-
-
- }
-
-
- ))
+ otherSchemeId && !_.isEmpty(toJS(paymentItems)) && _.map(toJS(paymentItems), item => {
+ const { title, items } = item;
+ return ({
+ com: SocialInputNumber({
+ key: child["domkey"][0],
+ label: child.label,
+ value: !_.isNil(paymentData[child["domkey"][0]]) ? paymentData[child["domkey"][0]].toString() : "",
+ onChange: this.handlePaymentChange,
+ onBlurChange: this.handleBlurChange,
+ min: child.min,
+ max: child.max
+ })
+ }))}
+ customComponent={ this.setState({ Welfare })}
+ onBlurChange={this.handleChangeWelfare}/>}
+ title={title} col={2} showGroup
+ />;
+ })
}
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js
index 2b508320..0bae1877 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js
@@ -1,14 +1,20 @@
import React from "react";
-import GroupCard from "../../../components/groupCard";
-import { Col, Row } from "antd";
-import { WeaCheckbox, WeaDatePicker, WeaInput, WeaInputNumber, WeaSelect } from "ecCom";
+import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaInput, WeaInputNumber, WeaSearchGroup, WeaSelect } from "ecCom";
+import { message } from "antd";
import { inject, observer } from "mobx-react";
-import cs from "classnames";
+import { toJS } from "mobx";
import "./index.less";
@inject("archivesStore")
@observer
export default class SocialSecurityForm extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ Welfare: ""
+ };
+ }
+
componentWillMount() {
const { archivesStore } = this.props;
const { getBaseForm, getPaymentForm } = archivesStore;
@@ -17,173 +23,227 @@ export default class SocialSecurityForm extends React.Component {
getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", siSchemeId, this.props.record.paymentOrganization);
}
- // 表单变化
- handleFormChange(params) {
- const { archivesStore: { socialSecurityForm, setSocialSecurityForm }, onChangeRecordSchemeId } = this.props;
+ handleFormChange = ({ key, value }) => {
+ const params = { [key]: value };
+ const {
+ archivesStore: { socialSecurityForm, setSocialSecurityForm },
+ onChangeRecordSchemeId
+ } = this.props;
const { data } = socialSecurityForm;
let request = { ...data, ...params };
let form = { ...socialSecurityForm };
form.data = request;
setSocialSecurityForm(form);
- Object.keys(params).length > 1 &&
- onChangeRecordSchemeId(params.socialSchemeId);
- }
+ key === "socialSchemeId" && this.setState({ Welfare: "" });
+ key === "socialSchemeId" && this.handleFetchPaymentForm(value);
+ key === "socialSchemeId" && onChangeRecordSchemeId(value);
+ };
- // 获取基数表单
- handleFetchPaymentForm(value) {
- const { archivesStore: { getPaymentForm } } = this.props;
- getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", value, this.props.record.paymentOrganization);
- }
+ handleFetchPaymentForm = (value) => {
+ const { archivesStore: { getPaymentForm }, employeeId, record } = this.props;
+ const { paymentOrganization } = record;
+ getPaymentForm(employeeId, "SOCIAL_SECURITY", value, paymentOrganization, true);
+ };
- //基数变化
- handlePaymentChange(params) {
+ handlePaymentChange = ({ key, value }) => {
+ const params = { [key]: !_.isNil(value) ? value.toString() : "" };
const { archivesStore: { socialSecurityPaymentForm, setSocialSecurityPaymentForm } } = this.props;
const { data } = socialSecurityPaymentForm;
let request = { ...data, ...params };
let form = { ...socialSecurityPaymentForm };
form.data = request;
setSocialSecurityPaymentForm(form);
- }
-
- render() {
- const { archivesStore: { socialSecurityForm, socialSecurityPaymentForm } } = this.props;
- const { items } = socialSecurityForm;
- let baseData = socialSecurityForm.data;
- let paymentData = socialSecurityPaymentForm.data;
- let paymentItems = socialSecurityPaymentForm.items;
- // Integer数据转为string
- let data = { ...baseData };
- if (data) {
- Object.keys(data).map(key => {
- if (data[key]) {
- data[key] = data[key].toString();
+ };
+ handleBlurChange = ({ key, value, minNum, maxNum }) => {
+ const params = {
+ [key]: _.isNil(value) ? "" : (Number(value) > maxNum && maxNum !== 0) ? maxNum :
+ (Number(value) < minNum && minNum !== 0) ? minNum : value.toString()
+ };
+ const { archivesStore: { socialSecurityPaymentForm, setSocialSecurityPaymentForm } } = this.props;
+ const { data } = socialSecurityPaymentForm;
+ let request = { ...data, ...params };
+ let form = { ...socialSecurityPaymentForm };
+ form.data = request;
+ setSocialSecurityPaymentForm(form);
+ };
+ handleChangeWelfare = (val) => {
+ const { archivesStore: { socialSecurityPaymentForm, setSocialSecurityPaymentForm } } = this.props;
+ let paymentData = toJS(socialSecurityPaymentForm.data);
+ const [paymentFormItems] = toJS(socialSecurityPaymentForm.items);
+ const { items } = paymentFormItems;
+ if (val) {
+ _.forEach(items, (it) => {
+ const { min, max, domkey } = it;
+ const minNum = !_.isNil(min) ? Number(min) : 0, maxNum = !_.isNil(max) ? Number(max) : 0;
+ if ((val < minNum || val > maxNum) && !_.isNil(min) && !_.isNil(max) && (!!maxNum || !!minNum)) {
+ message.warning("超出所选缴纳方案设置的基数上下限范围,将自动按基数上下限填充。");
+ paymentData = {
+ ...paymentData,
+ [domkey[0]]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
+ };
+ } else {
+ paymentData = { ...paymentData, [domkey[0]]: val };
}
});
+ } else {
+ _.forEach(items, (it) => {
+ const { domkey } = it;
+ paymentData = { ...paymentData, [domkey[0]]: "" };
+ });
}
+ setSocialSecurityPaymentForm({ ...socialSecurityPaymentForm, data: { ...paymentData } });
+ };
+
+ render() {
+ const { Welfare } = this.state;
+ const { archivesStore: { socialSecurityForm, socialSecurityPaymentForm } } = this.props;
+ const { items, data: socialData } = socialSecurityForm;
+ const paymentData = toJS(socialSecurityPaymentForm.data);
+ const paymentItems = socialSecurityPaymentForm.items;
+ const {
+ nonPayment = "", schemeAccount = "", socialStartTime = "", socialEndTime = "",
+ socialSchemeId = ""
+ } = socialData || {};
+ const socialItems = !_.isNil(toJS(items)) ? [
+ ..._.map(_.filter(toJS(items)[0].items, it => it.domkey[0] !== "paymentOrganization"),
+ item => ({
+ com: SocialSelect({
+ key: item["domkey"][0],
+ label: item.label,
+ value: !_.isNil(socialData[item["domkey"][0]]) ? socialData[item["domkey"][0]].toString() : "",
+ options: item.options,
+ onChange: this.handleFormChange
+ })
+ })),
+ {
+ com: SocialDatePicker({
+ key: "socialStartTime",
+ label: "社保起始缴纳月",
+ viewAttr: socialSchemeId ? 3 : 2,
+ value: socialStartTime,
+ disabledDate: (current) => {
+ return current && socialEndTime && current.getTime() > new Date(socialEndTime).getTime();
+ },
+ onChange: this.handleFormChange
+ })
+ },
+ {
+ com: SocialEditInput({
+ key: "schemeAccount",
+ label: "社保账号",
+ value: schemeAccount,
+ onChange: this.handleFormChange
+ })
+ },
+ {
+ com: SocialDatePicker({
+ key: "socialEndTime",
+ label: "社保最后缴纳月",
+ value: socialEndTime,
+ disabledDate: (current) => {
+ return current && socialStartTime && current.getTime() < new Date(socialStartTime).getTime();
+ },
+ onChange: this.handleFormChange
+ })
+ }
+ ] : [];
return (
-
- {
- this.handleFormChange({ nonPayment: value });
- }}
- />
-
-
-
- 社保起始缴纳月:
-
- {
- this.handleFormChange({ socialStartTime: value });
- }}
- />
-
- 社保方案名称:
-
- {
- this.handleFormChange({ socialName: showName, socialSchemeId: value });
- this.handleFetchPaymentForm(value);
- }}
- />
-
-
-
- 社保最后缴纳月:
-
- this.handleFormChange({ socialEndTime: value })}
- />
-
- 社保账号:
-
- {
- this.handleFormChange({ schemeAccount: value });
- }}/>
-
-
-
- {/*个税扣缴义务人:*/}
- {/**/}
- {/* */}
- {/**/}
- 社保个人实际承担方:
-
- {
- this.handleFormChange({ underTake: value });
- }}
- />
-
-
-
-
+
}
+ items={socialItems} col={2} showGroup needTigger={false}/>
{
- data.socialSchemeId && paymentItems && paymentItems.map(group => (
-
- {
- group.items && group.items.length > 0 &&
-
- {
- group.items && group.items.map((item, idx) => (
-
-
- {item.label}:
-
- {
- this.handlePaymentChange({ [item.domkey[0]]: String(value) });
- }}
- />
-
-
-
- ))
- }
-
-
- }
-
- ))
+ socialSchemeId && !_.isEmpty(toJS(paymentItems)) && _.map(toJS(paymentItems), item => {
+ const { title, items } = item;
+ return ({
+ com: SocialInputNumber({
+ key: child["domkey"][0],
+ label: child.label,
+ value: !_.isNil(paymentData[child["domkey"][0]]) ? paymentData[child["domkey"][0]].toString() : "",
+ onChange: this.handlePaymentChange,
+ onBlurChange: this.handleBlurChange,
+ min: child.min,
+ max: child.max
+ })
+ }))}
+ customComponent={ this.setState({ Welfare })}
+ onBlurChange={this.handleChangeWelfare}/>}
+ title={title} col={2} showGroup
+ />;
+ })
}
);
}
}
+export const ConsistentWelfare = (props) => {
+ const { onChange, onBlurChange, value } = props;
+ return
+ 各项福利基数一致:
+
+
;
+};
+export const SocialTitle = (props) => {
+ const { value, onChange, keyname: key } = props;
+ return
onChange({ key, value: val })}/>;
+};
+export const SocialSelect = (props) => {
+ const { key, value, onChange, options, label, labelColSpan = 12, wrapperColSpan = 12 } = props;
+ return
+ onChange({ key, value: val })}/>
+ ;
+};
+export const SocialEditInput = (props) => {
+ const { key, value, onChange, label, labelColSpan = 12, wrapperColSpan = 12 } = props;
+ return (
+
+ onChange({ key, value: val })}/>
+
+ );
+};
+export const SocialInputNumber = (props) => {
+ const { key, value, onChange, onBlurChange, label, min, max, labelColSpan = 12, wrapperColSpan = 12 } = props;
+ const minNum = !_.isNil(min) ? Number(min) : 0, maxNum = !_.isNil(max) ? Number(max) : 0;
+ return (
+
+ onChange({ key, value: val })} precision={2}
+ onBlur={(val) => onBlurChange({ key, value: val, minNum, maxNum })}
+ // min={minNum > 0 ? minNum : -999999999999999}
+ // max={maxNum > 0 ? maxNum : 999999999999999}
+ />
+
+ );
+};
+export const SocialDatePicker = (props) => {
+ const {
+ key,
+ value,
+ onChange,
+ label,
+ format = "YYYY-MM",
+ viewAttr = 2,
+ labelColSpan = 12,
+ wrapperColSpan = 12,
+ disabledDate = false
+ } = props;
+ return (
+
+ onChange({ key, value: val })}
+ disabledDate={disabledDate}
+ />
+
+ );
+};
+
+
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js
index 2f45ede4..5acd68bf 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js
@@ -106,47 +106,69 @@ export const insertUpdateColumns = [
{
title: "类型名称",
dataIndex: "insuranceName",
- key: "insuranceName"
+ key: "insuranceName",
+ width: 120,
+ fixed: 'left'
},
{
title: "是否缴费",
dataIndex: "isPayment",
- key: "isPayment"
+ key: "isPayment",
+ width: 100
},
{
title: "缴纳对象",
dataIndex: "paymentScope",
- key: "paymentScope"
+ key: "paymentScope",
+ width: 100
+ },
+ {
+ title: "缴纳周期",
+ dataIndex: "paymentCycle",
+ key: "paymentCycle",
+ width: 200
+ },
+ {
+ title: "核算方式",
+ dataIndex: "accountType",
+ key: "accountType",
+ width: 200
},
{
title: "基数下限",
dataIndex: "lowerLimit",
- key: "lowerLimit"
+ key: "lowerLimit",
+ width: 100
},
{
title: "基数上限",
dataIndex: "upperLimit",
- key: "upperLimit"
+ key: "upperLimit",
+ width: 100
},
{
title: "缴纳比例%",
dataIndex: "paymentProportion",
- key: "paymentProportion"
+ key: "paymentProportion",
+ width: 100
},
{
title: "固定费用",
dataIndex: "fixedCost",
- key: "fixedCost"
+ key: "fixedCost",
+ width: 100
},
{
title: "有效小数位",
dataIndex: "validNum",
- key: "validNum"
+ key: "validNum",
+ width: 100
},
{
title: "进位规则",
dataIndex: "rententionRule",
- key: "rententionRule"
+ key: "rententionRule",
+ width: 100
}
];
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customBenefitsTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customBenefitsTable.js
new file mode 100644
index 00000000..58b51944
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customBenefitsTable.js
@@ -0,0 +1,135 @@
+/*
+ * Author: 黎永顺
+ * name: 社保福利方案-自定义福利表格
+ * Description:
+ * Date: 2023/3/2
+ */
+import React, { Component } from "react";
+import { WeaCheckbox, WeaTable } from "ecCom";
+import { message, Modal } from "antd";
+import { getCustomCategoryList, updateCustomCategoryStatus } from "../../../apis/welfareScheme";
+
+class CustomBenefitsTable extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: {
+ query: false
+ },
+ dataSource: [],
+ columns: [],
+ pageInfo: {
+ current: 1,
+ pageSize: 10,
+ total: 0
+ }
+ };
+ }
+
+ componentDidMount() {
+ this.getCustomCategoryList();
+ }
+
+ getCustomCategoryList = (extraPayload) => {
+ const { loading, pageInfo } = this.state;
+ const { welfareTypeEnum } = this.props;
+ const module = { welfareTypeEnum, ...pageInfo, ...extraPayload };
+ this.setState({ loading: { ...loading, query: true } });
+ getCustomCategoryList(module).then(({ status, data }) => {
+ this.setState({ loading: { ...loading, query: false } });
+ if (status) {
+ const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize, total },
+ dataSource,
+ columns
+ });
+ }
+ }).catch(() => this.setState({ loading: { ...loading, query: false } }));
+ };
+ getColumns = () => {
+ const { columns } = this.state;
+ const { showOperateBtn, onCustomEdit } = this.props;
+ return [..._.map(_.filter(columns, item => !!item.display), child => ({
+ ...child,
+ render: (text, record) => {
+ switch (child.dataIndex) {
+ case "isUse":
+ return (
+ this.handleCustomBenefitsSwitch(record, value)}
+ />
+ );
+ case "welfareType":
+ return {record.welfareTypeSpan};
+ case "paymentScopt":
+ return {record.paymentScopeSpan};
+ default:
+ return ;
+ }
+ }
+ })), {
+ title: "操作",
+ width: 120,
+ dataIndex: "operate",
+ render: (_, record) => {
+ return (
+
+ );
+ }
+ }];
+ };
+ handleCustomBenefitsSwitch = ({ id }, isUse) => {
+ Modal.confirm({
+ title: "信息确认",
+ content: `确认要${isUse ? "启用" : "停用"}吗`,
+ onOk: () => {
+ const payload = { id, isUse };
+ updateCustomCategoryStatus(payload).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("操作成功");
+ this.getCustomCategoryList();
+ } else {
+ message.error(errormsg || "操作失败");
+ }
+ });
+ }
+ });
+ };
+
+ render() {
+ const { dataSource, pageInfo, loading } = this.state;
+ const pagination = {
+ ...pageInfo,
+ showTotal: total => `共 ${total} 条`,
+ showQuickJumper: true,
+ showSizeChanger: true,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ onShowSizeChange: (current, pageSize) => {
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize }
+ }, () => this.getCustomCategoryList());
+ },
+ onChange: current => {
+ this.setState({
+ pageInfo: { ...pageInfo, current }
+ }, () => this.getCustomCategoryList());
+ }
+ };
+ return (
+
+ );
+ }
+}
+
+export default CustomBenefitsTable;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customNewModal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customNewModal.js
index 95339fb1..b5a775e4 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customNewModal.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customNewModal.js
@@ -16,11 +16,11 @@ export default class CustomNewModal extends React.Component {
const { programmeStore: { createSICategory, customRequest, updateCustomCategory } } = this.props;
if (!this.props.edit) { // 新增
createSICategory(customRequest).then(() => {
- this.props.onCancel();
+ this.props.onCancel(true);
});
} else {
updateCustomCategory(customRequest).then(() => {
- this.props.onCancel();
+ this.props.onCancel(true);
});
}
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js
index f523d68f..3e7ebcfa 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js
@@ -1,10 +1,11 @@
import React from "react";
-import { WeaInput, WeaInputNumber, WeaSelect, WeaTable } from "ecCom";
-import { Col, Row, Switch } from "antd";
+import { WeaHelpfulTip, WeaInputNumber, WeaSelect, WeaTab, WeaTable } from "ecCom";
+import { Switch, Table } from "antd";
import { insertUpdateColumns } from "./columns";
import { inject, observer } from "mobx-react";
-import SmallTab from "../../../components/smallTab";
+import PaymentPeriodModal from "./paymentPeriodModal";
import "./index.less";
+import SchemeInfoForm from "./schemeInfoForm";
@inject("programmeStore", "salaryFileStore", "taxAgentStore")
@observer
@@ -13,9 +14,105 @@ export default class DefaultSlideForm extends React.Component {
super(props);
this.state = {
value: "SCHEME_TOWN",
- selectItem: "个人",
- dataSource: {}
+ selectedKey: "PERSONAL",
+ dataSource: {},
+ paymentPeriodModal: {
+ visible: false,
+ record: {},
+ cycleSetting: "000000000000"
+ }
};
+ }
+
+ updateDataSource = (record, e, key) => {
+ const {
+ programmeStore: {
+ defaultCompanyDataSource,
+ defaultPersonDataSource,
+ setDefaultPersonDataSource,
+ setDefaultCompanyDataSource
+ }
+ } = this.props;
+ let result = { ...record };
+ if (key === "paymentCycle" && e === "1") {
+ result["accountType"] = "1";
+ } else if (key === "paymentCycle" && e === "0") {
+ result["accountType"] = record.accountType;
+ }
+ result[key] = e;
+ if (key === "upperLimit" || key === "lowerLimit") {
+ let dataSource = [...defaultPersonDataSource],
+ dataSource_company = [...defaultCompanyDataSource];
+ dataSource = dataSource.map(item => {
+ if (item.insuranceName === result.insuranceName) return { ...item, [key]: e };
+ else return item;
+ });
+ dataSource_company = dataSource_company.map(item => {
+ if (item.insuranceName === result.insuranceName) return { ...item, [key]: e };
+ else return item;
+ });
+ setDefaultPersonDataSource(dataSource);
+ setDefaultCompanyDataSource(dataSource_company);
+ } else {
+ if (this.state.selectedKey === "PERSONAL") {
+ let dataSource = [...defaultPersonDataSource];
+ dataSource = dataSource.map(item => {
+ if (item.id == result.id) return result;
+ else return item;
+ });
+ setDefaultPersonDataSource(dataSource);
+ } else {
+ let dataSource = [...defaultCompanyDataSource];
+ dataSource = dataSource.map(item => {
+ if (item.id == result.id) return result;
+ else return item;
+ });
+ setDefaultCompanyDataSource(dataSource);
+ }
+ }
+ };
+
+ handleSetPaymentPeriod = (cycleSetting) => {
+ let cycleObj = {
+ 1: "0",
+ 2: "0",
+ 3: "0",
+ 4: "0",
+ 5: "0",
+ 6: "0",
+ 7: "0",
+ 8: "0",
+ 9: "0",
+ 10: "0",
+ 11: "0",
+ 12: "0"
+ };
+ if (!_.isEmpty(cycleSetting)) {
+ _.forEach(cycleSetting, item => {
+ _.assign(cycleObj, { [item]: "1" });
+ });
+ } else {
+ _.forEach(Object.keys(cycleObj), item => {
+ _.assign(cycleObj, { [item]: "0" });
+ });
+ }
+ const tmpVStr = _.reduce(Object.values(cycleObj), (pre, cur) => {
+ return pre + cur;
+ }, "");
+ this.setState({
+ paymentPeriodModal: {
+ ...this.state.paymentPeriodModal,
+ cycleSetting: tmpVStr
+ }
+ }, () => {
+ this.updateDataSource(this.state.paymentPeriodModal.record, tmpVStr, "cycleSetting");
+ });
+ };
+
+ render() {
+ const { paymentPeriodModal } = this.state;
+ const { programmeStore, requestParams, onChange } = this.props;
+ const { defaultPersonDataSource, defaultCompanyDataSource } = programmeStore;
insertUpdateColumns.map(item => {
if (item.dataIndex == "isPayment") {
item.render = (text, record) => {
@@ -131,7 +228,7 @@ export default class DefaultSlideForm extends React.Component {
item.render = (text, record) => {
return (
{
@@ -145,6 +242,7 @@ export default class DefaultSlideForm extends React.Component {
return (
{
@@ -153,206 +251,131 @@ export default class DefaultSlideForm extends React.Component {
/>
);
};
+ } else if (item.dataIndex === "paymentCycle") {
+ item.title =
+
缴纳周期
+
+ 例:养老保险缴纳周期选择3/6/9/12;
+
+
+ 若:核算方式选择基数求和*比例;则数据核算逻辑为:
+ 账单月1月2月时,养老保险不会被核算;
+ 账单月3月时,养老保险核算金额为:养老保险月缴纳基数*3*缴纳比例+固定费用*3
+ (3代表1月2月3月 3个月,*3代表3个月基数相加和固定费用相加)
+
+
+
+ 若:核算方式选择基数*比例再求和;则数据核算逻辑为:
+ 账单月1月2月时,养老保险不会被核算;
+ 账单月3月时,养老保险核算金额为:
+ 将1~3月算出来的【养老保险月缴纳基数*缴纳比例+固定费用】求和
+
+
+
+ 若:缴纳周期选择选择月缴,则核算方式默认为【基数*比例+固定费用】,不可修改
+
+
+ }
+ placement="topLeft"
+ />
+ ;
+ item.render = (text, record) => {
+ return (
+
+ );
+ };
+ } else if (item.dataIndex === "accountType") {
+ item.render = (text, record) => {
+ if (record.paymentCycle === "0") {
+ return (
+ 基数*比例+固定费用
+ );
+ } else {
+ return (
+ {
+ this.updateDataSource(record, v, "accountType");
+ }}
+ />
+ );
+ }
+ };
}
});
- }
-
- updateDataSource(record, e, key) {
- const {
- programmeStore: {
- defaultCompanyDataSource,
- defaultPersonDataSource,
- setDefaultPersonDataSource,
- setDefaultCompanyDataSource
- }
- } = this.props;
- let result = { ...record };
- result[key] = e;
- if (key === "upperLimit" || key === "lowerLimit") {
- let dataSource = [...defaultPersonDataSource],
- dataSource_company = [...defaultCompanyDataSource];
- dataSource = dataSource.map(item => {
- if (item.insuranceName === result.insuranceName) return { ...item, [key]: e };
- else return item;
- });
- dataSource_company = dataSource_company.map(item => {
- if (item.insuranceName === result.insuranceName) return { ...item, [key]: e };
- else return item;
- });
- setDefaultPersonDataSource(dataSource);
- setDefaultCompanyDataSource(dataSource_company);
- } else {
- if (this.state.selectItem == "个人") {
- let dataSource = [...defaultPersonDataSource];
- dataSource = dataSource.map(item => {
- if (item.id == result.id) return result;
- else return item;
- });
- setDefaultPersonDataSource(dataSource);
- } else {
- let dataSource = [...defaultCompanyDataSource];
- dataSource = dataSource.map(item => {
- if (item.id == result.id) return result;
- else return item;
- });
- setDefaultCompanyDataSource(dataSource);
- }
- }
- }
-
- componentDidMount() {
- const { taxAgentStore } = this.props;
- const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
- getTaxAgentSelectListAsAdmin();
- }
-
- render() {
- const { programmeStore, salaryFileStore, taxAgentStore } = this.props;
- const { userStatusList } = salaryFileStore;
- const { taxAgentAdminOption, getTaxAgentSelectListAsAdmin } = taxAgentStore;
- const { defaultPersonDataSource, defaultCompanyDataSource } = programmeStore;
- const options = [
- {
- key: "",
- selected: false,
- showname: ""
- },
- {
- key: "SCHEME_TOWN",
- selected: true,
- showname: "城镇"
- },
- {
- key: "SCHEME_VILLAGE",
- selected: false,
- showname: "农村"
- }
- ];
-
- const handleSmallTabChange = item => {
- this.setState({
- selectItem: item.value
- });
- };
-
return (
-
-
-
- 缴纳类型
-
-
- {
- let requestParams = { ...this.props.requestParams };
- requestParams.paymentType = v;
- this.props.onChange(requestParams);
- }}
- />
-
-
-
-
-
- 方案名称
-
-
- {
- let requestParams = { ...this.props.requestParams };
- requestParams.schemeName = value;
- this.props.onChange(requestParams);
- }}
- />
-
-
-
- 可见性
-
- {
- let requestParams = { ...this.props.requestParams };
- visibleVal === "1" && getTaxAgentSelectListAsAdmin();
- (visibleVal === "0" || visibleVal === "") && (requestParams.taxAgentIds = '');
- requestParams.sharedType = visibleVal;
- this.props.onChange(requestParams);
- }}
- />
-
-
- {
- this.props.requestParams.sharedType === "1" &&
-
- 可见性范围
-
- {
- let requestParams = { ...this.props.requestParams };
- requestParams.taxAgentIds = value;
- this.props.onChange(requestParams);
- }}
- />
-
-
- }
-
- 备注
-
- {
- let requestParams = { ...this.props.requestParams };
- requestParams.remarks = value;
- this.props.onChange(requestParams);
- }}
- />
-
-
-
+
onChange({ ...requestParams, ...val })}/>
-
- {
- handleSmallTabChange(item);
- }}
- />
-
+
this.setState({ selectedKey })}
+ />
- {this.state.selectItem == "个人"
- ?
- : }
+ this.setState({
+ paymentPeriodModal: {
+ visible: false,
+ record: {},
+ cycleSetting: "000000000000"
+ }
+ })}
+ onSetPaymentPeriod={this.handleSetPaymentPeriod}
+ />
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/enum.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/enum.js
index cd653e53..f5277ea7 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/enum.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/enum.js
@@ -1,10 +1,65 @@
export const paymentScopeEnum = {
- 1: "SCOPE_COMPANY",
- 2: "SCOPE_PERSON"
-}
+ 1: "SCOPE_COMPANY",
+ 2: "SCOPE_PERSON"
+};
export const welfareTypeEnum = {
- 1: "SOCIAL_SECURITY",
- 2: "ACCUMULATION_FUND",
- 3: "OTHER"
-}
\ No newline at end of file
+ 1: "SOCIAL_SECURITY",
+ 2: "ACCUMULATION_FUND",
+ 3: "OTHER"
+};
+
+export const schemeFields = [
+ {
+ key: "paymentType",
+ label: "缴纳类型",
+ type: "SELECT",
+ options: [
+ {
+ key: "",
+ selected: false,
+ showname: ""
+ },
+ {
+ key: "SCHEME_TOWN",
+ selected: true,
+ showname: "城镇"
+ },
+ {
+ key: "SCHEME_VILLAGE",
+ selected: false,
+ showname: "农村"
+ }
+ ],
+ viewAttr: 3,
+ tip: ""
+ },
+ {
+ key: "schemeName",
+ label: "方案名称",
+ type: "INPUT",
+ viewAttr: 3,
+ tip: ""
+ },
+ {
+ key: "sharedType",
+ label: "可见性",
+ type: "SELECT",
+ viewAttr: 2,
+ tip: ""
+ },
+ {
+ key: "taxAgentIds",
+ label: "可见性范围",
+ type: "SELECT",
+ viewAttr: 3,
+ tip: ""
+ },
+ {
+ key: "remarks",
+ label: "备注",
+ type: "TEXTAREA",
+ viewAttr: 2,
+ tip: ""
+ }
+];
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js
index c6deee37..d9350651 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js
@@ -1,10 +1,9 @@
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
-import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
-import { WeaRightMenu, WeaSelect, WeaSlideModal, WeaTop } from "ecCom";
-import { WeaTableNew } from "comsMobx";
-import { renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
+import { Button, Dropdown, Menu, message, Modal } from "antd";
+import { WeaLocaleProvider, WeaNewScroll, WeaSelect, WeaSlideModal, WeaTop } from "ecCom";
+import { renderNoright } from "../../../util";
import CustomTab from "../../../components/customTab";
import SlideModalTitle from "../../../components/slideModalTitle";
import TipLabel from "../../../components/TipLabel";
@@ -14,10 +13,11 @@ import { paymentScopeEnum, welfareTypeEnum } from "./enum";
import CustomPaginationTable from "../../../components/customPaginationTable";
import TwoColContent from "../../../components/twoColContent";
import CopySchemaModal from "./copySchemaModal";
+import CustomBenefitsTable from "./customBenefitsTable";
import "./index.less";
-const WeaMobxTable = WeaTableNew.WeaTable;
+const { getLabel } = WeaLocaleProvider;
@inject("programmeStore", "taxAgentStore", "salaryFileStore")
@observer
export default class Programme extends React.Component {
@@ -38,39 +38,35 @@ export default class Programme extends React.Component {
}
componentWillMount() {
- const { programmeStore, salaryFileStore } = this.props;
+ const { programmeStore, salaryFileStore, taxAgentStore } = this.props;
const { doInit } = programmeStore;
doInit();
const { commonEnumList } = salaryFileStore;
commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" });
+ const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
+ getTaxAgentSelectListAsAdmin();
}
// 增加编辑功能,重写columns绑定事件
getColumns = columns => {
+ const { taxAgentStore: { showOperateBtn } } = this.props;
let newColumns = columns.filter(
item => item.dataIndex !== "id" && item.dataIndex !== "paymentArea"
);
newColumns = newColumns.map(column => {
let newColumn = column;
- newColumn.render = (text, record, index) => {
+ newColumn.render = (text, record) => {
//前端元素转义
let valueSpan =
record[newColumn.dataIndex + "span"] !== undefined
? record[newColumn.dataIndex + "span"]
: record[newColumn.dataIndex];
- if (newColumn.dataIndex == "id") {
- newColumn.display = false;
- }
+ if (newColumn.dataIndex === "id") newColumn.display = false;
switch (newColumn.dataIndex) {
case "operate":
return (
- {
- this.onEdit(record);
- }}>
- 编辑
-
+ this.onEdit(record)}>编辑
);
default:
return ;
@@ -82,129 +78,56 @@ export default class Programme extends React.Component {
newColumns.push({
title: "操作",
dataIndex: "operate",
+ width: 120,
render: (text, record) => {
return (
- {
- this.onEdit(record);
- }}>
- 编辑
-
- );
- }
- });
- newColumns.push({
- key: "moreOperate",
- dataIndex: "moreOperate",
- render: (text, record) => {
- return (
-
-
- {
- this.onCopy(record);
- }}>
- 复制
-
-
- {/*暂时隐藏*/}
-
- {
- this.onDelete(record);
- }}>
- 删除
-
-
-
- }>
-
-
-
-
-
+
+ this.onEdit(record)}
+ style={{ marginRight: 10 }}>{showOperateBtn ? "编辑" : "查看"}
+ {
+ showOperateBtn &&
+ this.onCopy(record)}
+ style={{ marginRight: 10 }}>{getLabel(77, "复制")}
+ }
+ {
+ showOperateBtn &&
+
+
+ this.onDelete(record)}>{getLabel(535052, "删除")}
+
+
+ }>
+
+
+ }
+
);
}
});
return newColumns;
};
- handleCategoryStatusChange(record, value) {
- const { programmeStore: { updateCustomCategoryStatus } } = this.props;
- Modal.confirm({
- title: "信息确认",
- content: `确认要${value ? "启用" : "停用"}吗`,
- onOk: () => {
- updateCustomCategoryStatus(record.id, value);
- },
- onCancel: () => {
- }
- });
- }
-
- getCustomColumns = columns => {
- const { taxAgentStore: { showOperateBtn } } = this.props;
- let newColumns = [];
- newColumns = columns.map(column => {
- let newColumn = column;
- newColumn.render = (text, record, index) => {
- //前端元素转义
- let valueSpan =
- record[newColumn.dataIndex + "span"] !== undefined
- ? record[newColumn.dataIndex + "span"]
- : record[newColumn.dataIndex];
- switch (newColumn.dataIndex) {
- case "operate":
- return (
- {
- this.onCustomEdit(record);
- }}>
- 编辑
-
- );
- case "is_use":
- return (
- {
- this.handleCategoryStatusChange(record, value);
- }}
- />
- );
- default:
- return ;
- }
- };
- return newColumn;
- });
- return newColumns;
- };
-
- onEdit(record) {
+ onEdit = (record) => {
let id = record.id;
const { programmeStore } = this.props;
const { getForm, selectedKey } = programmeStore;
getForm({
welfareTypeEnum: selectedKey,
id
+ }).then(() => {
+ this.setState({ slideVisiable: true, customEdit: true, currentOperate: "update" });
});
- this.setState({ slideVisiable: true, customEdit: true, currentOperate: "update" });
- }
+ };
- onCopy(record) {
+ onCopy = (record) => {
this.setState({
copyId: record.id,
copyModalValue: record.schemeName,
copyModalVisible: true
});
- }
+ };
onDelete = (record) => {
const { programmeStore: { deleteScheme, deleteLoading, selectedKey } } = this.props;
@@ -220,14 +143,6 @@ export default class Programme extends React.Component {
});
};
- onCustomOperatesClick(record, index, operate, flag) {
- switch (operate.text.toString()) {
- case "编辑": // 编辑
- this.onCustomEdit(record);
- break;
- }
- }
-
onCustomEdit = (record) => {
const {
programmeStore: { getCustomForm, setCustomNewVisible, setCustomRequest },
@@ -243,11 +158,11 @@ export default class Programme extends React.Component {
customEdit: true
});
setCustomRequest({
- insuranceName: record["insurance_name"],
+ insuranceName: record["insuranceName"],
id: record.id,
- isUse: record.is_use,
- paymentScope: record["payment_scope"].split(",").map(item => paymentScopeEnum[item]).join(","),
- welfareType: welfareTypeEnum[record.welfare_type]
+ isUse: record.isUse,
+ paymentScope: record["paymentScope"].split(",").map(item => paymentScopeEnum[item]).join(","),
+ welfareType: welfareTypeEnum[record.welfareType]
});
};
@@ -260,22 +175,10 @@ export default class Programme extends React.Component {
render() {
const { programmeStore, taxAgentStore: { showOperateBtn } } = this.props;
- const {
- loading,
- hasRight,
- form,
- condition,
- tableStore,
- showSearchAd,
- getTableDatas,
- doSearch,
- setShowSearchAd
- } = programmeStore;
+ const { loading, hasRight, form, getTableDatas } = programmeStore;
const {
selectedKey,
setSelectedKey,
- getCustomCategoryList,
- customTableStore,
customSelectkey,
setCustomSelectkey,
requestParams,
@@ -287,34 +190,7 @@ export default class Programme extends React.Component {
tableColumns,
tablePageInfo
} = programmeStore;
- if (!hasRight && !loading) {
- // 无权限处理
- return renderNoright();
- }
-
- const rightMenu = [
- // 右键菜单
- ];
- const collectParams = {
- // 收藏功能配置
- favname: "社保福利方案",
- favouritetype: 1,
- objid: 0,
- link: "wui/index.html#/ns_demo03/index",
- importantlevel: 1
- };
- const adBtn = [
- // 高级搜索内部按钮
-
- 搜索
- ,
- form.resetForm()}>
- 重置
- ,
- setShowSearchAd(false)}>
- 取消
-
- ];
+ if (!hasRight && !loading) return renderNoright();
const topTab = [
{
@@ -377,11 +253,6 @@ export default class Programme extends React.Component {
this.setState({ customEdit: false });
};
- // const renderSearchOperationItem = () => {
- // const { programmeStore: {setCustomSelectkey, getCustomCategoryList}} = this.props;
- // return
- // }
-
const handleOnSave = () => {
const { programmeStore } = this.props;
const { currentOperate } = this.state;
@@ -449,111 +320,109 @@ export default class Programme extends React.Component {
};
return (
-
-
- {/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */}
- } // 左侧图标
- iconBgcolor="#F14A2D" // 左侧图标背景色
- showDropIcon={false} // 是否显示下拉按钮
- dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
- dropMenuProps={{ collectParams }}>
- {/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */}
-
- {/* 操作按钮权限 */}
- {showOperateBtn &&
- {
- if (selectedKey == "custom") {
- handleCustomNewClick();
- } else {
- handleNewClick();
- }
- }}>
- 新建
- }
+
+ } // 左侧图标
+ iconBgcolor="#F14A2D" // 左侧图标背景色
+ showDropIcon={false} // 是否显示下拉按钮
+ >
+
+ {/* 操作按钮权限 */}
+ {showOperateBtn &&
+ {
+ if (selectedKey == "custom") {
+ handleCustomNewClick();
+ } else {
+ handleNewClick();
+ }
+ }}>
+ 新建
+ }
- {selectedKey == "custom" &&
- {
- setCustomSelectkey(v);
- getCustomCategoryList(v);
- }}
- />}
-
+ {selectedKey == "custom" &&
+ {
+ setCustomSelectkey(v);
+ this.customBenefitsTableRef.getCustomCategoryList({ current: 1, welfareTypeEnum: v });
+ }}
+ />}
+
+ }
+ onChange={v => {
+ setSelectedKey(v);
+ handleSlideClose();
+ if (v == "custom") {
+ // 自定义福利
+ } else {
+ getTableDatas(v);
}
- onChange={v => {
- setSelectedKey(v);
- handleSlideClose();
- if (v == "custom") {
- // 自定义福利
- getCustomCategoryList();
- } else {
- getTableDatas(v);
- }
- }}
- />
- {selectedKey == "custom"
- ?
- }
- rightContent={renderCustomRightContent()}
- />
- : {
- this.handlePageChange(value);
- }}
- onShowSizeChange={(current, pageSize) => {
- this.pageInfo = { current, pageSize };
- const {
- programmeStore: { form, getTableDatas, selectedKey }
- } = this.props;
- getTableDatas(selectedKey, this.pageInfo);
- }}
- />}
-
-
+ }}
+ />
+
+
+ {selectedKey == "custom"
+ ? this.customBenefitsTableRef = dom}
+ showOperateBtn={showOperateBtn}
+ welfareTypeEnum={customSelectkey}
+ onCustomEdit={this.onCustomEdit}
+ />
+ }
+ rightContent={renderCustomRightContent()}
+ />
+ : {
+ this.handlePageChange(value);
+ }}
+ onShowSizeChange={(current, pageSize) => {
+ this.pageInfo = { current, pageSize };
+ const {
+ programmeStore: { form, getTableDatas, selectedKey }
+ } = this.props;
+ getTableDatas(selectedKey, this.pageInfo);
+ }}
+ />}
+
+
+
it.viewcondition === selectedKey).title}方案` :
+ `新增${_.find(topTab, it => it.viewcondition === selectedKey).title}方案`
+ }
editable={true}
showOperateBtn={showOperateBtn}
- onSave={() => {
- handleOnSave();
- }}
+ onSave={() => handleOnSave()}
/>
}
content={
@@ -569,10 +438,6 @@ export default class Programme extends React.Component {
onClose={() => {
handleSlideClose();
}}
- showMask={true}
- closeMaskOnClick={() => {
- handleSlideClose();
- }}
/>
{this.state.copyModalVisible &&
@@ -602,8 +467,9 @@ export default class Programme extends React.Component {
condition={formCondition}
form={form}
edit={this.state.customEdit}
- onCancel={() => {
+ onCancel={(isRefresh) => {
setCustomNewVisible(false);
+ isRefresh && this.customBenefitsTableRef.getCustomCategoryList();
}}
/>}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.less
index e3a59e8a..3ccc9d13 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.less
@@ -1,5 +1,20 @@
.defaultSlideForm {
- padding: 20px;
+ padding: 16px;
+
+ .wea-search-group {
+ padding: 0;
+ border: 1px solid #e5e5e5;
+ border-bottom: none;
+
+ .wea-content {
+ padding: 0;
+ }
+
+ .wea-form-item {
+ padding: 4px 16px;
+ border-bottom: 1px solid #e5e5e5;
+ }
+ }
.tableBar {
margin-top: 10px;
@@ -7,6 +22,12 @@
.tableWrapper {
margin-top: 10px;
+
+ .ant-table-fixed-left {
+ tr {
+ height: 63px !important;
+ }
+ }
}
}
@@ -16,12 +37,6 @@
}
}
-.mySalaryBenefitsWrapper {
- .wea-new-top-content {
- overflow: hidden auto !important;
- }
-}
-
.customFLOuter {
.customFLWrapper {
padding: 16px 50px;
@@ -32,6 +47,19 @@
}
}
+.socialSecurityAndWelfareSchemeWrapper, .mySalaryBenefitsWrapper {
+ .wea-new-top-content {
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+
+ .tableWrapper {
+ flex: 1;
+ overflow: hidden;
+ }
+ }
+}
+
.copyDialogWrapper {
.wea-dialog-body {
height: auto !important;
@@ -71,3 +99,37 @@
}
}
}
+
+//设置缴纳周期
+.paymentPeriodWrapper {
+ .paymentPeriodContent {
+ padding: 16px;
+
+ .paymentPeriodAll {
+ height: 48px;
+ display: flex;
+ align-items: center;
+ padding: 8px 8px 8px 45px;
+ border: 1px solid #e5e5e5;
+ }
+
+ .ant-checkbox-group {
+ padding: 5px 16px;
+ width: 100%;
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ align-content: flex-start;
+ border: 1px solid #e5e5e5;
+ border-top: none;
+
+ .ant-checkbox-group-item {
+ margin: 8px 0;
+ padding-left: 30px;
+ width: 33.3%;
+ max-width: 33.3%;
+ overflow: hidden;
+ }
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/paymentPeriodModal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/paymentPeriodModal.js
new file mode 100644
index 00000000..6621acd5
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/paymentPeriodModal.js
@@ -0,0 +1,101 @@
+/*
+ * Author: 黎永顺
+ * name: 设置缴纳周期
+ * Description:
+ * Date: 2023/2/1
+ */
+import React, { Component } from "react";
+import { WeaDialog } from "ecCom";
+import { Button, Checkbox } from "antd";
+import "./index.less";
+
+const CheckboxGroup = Checkbox.Group;
+
+class PaymentPeriodModal extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ allSelect: false,
+ monthList: []
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ this.setState({
+ monthList: _.filter(_.map(nextProps.cycleSetting.split(""), (item, index) => {
+ return item === "1" ? (index + 1).toString() : "";
+ }), child => !!child)
+ }, () => {
+ this.setState({
+ allSelect: this.state.monthList.length === 12
+ });
+ });
+ }
+ }
+
+ handleChangeALl = (e) => {
+ this.setState({ allSelect: e.target.checked }, () => {
+ if (this.state.allSelect) {
+ this.setState({
+ monthList: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]
+ }, () => this.props.onSetPaymentPeriod(this.state.monthList));
+ } else {
+ this.setState({
+ monthList: []
+ }, () => this.props.onSetPaymentPeriod(this.state.monthList));
+ }
+ });
+ };
+ handleChangeMonth = (monthList) => {
+ this.setState({ monthList }, () => {
+ this.props.onSetPaymentPeriod(this.state.monthList);
+ this.setState({
+ allSelect: this.state.monthList.length === 12
+ });
+ });
+ };
+
+ render() {
+ const { onCancel, visible } = this.props;
+ const { monthList, allSelect } = this.state;
+ const buttons = [
+
保存,
+
this.setState({ monthList: [], allSelect: false })}>重置
+ ];
+ const options = [
+ { label: "一月", value: "1" },
+ { label: "二月", value: "2" },
+ { label: "三月", value: "3" },
+ { label: "四月", value: "4" },
+ { label: "五月", value: "5" },
+ { label: "六月", value: "6" },
+ { label: "七月", value: "7" },
+ { label: "八月", value: "8" },
+ { label: "九月", value: "9" },
+ { label: "十月", value: "10" },
+ { label: "十一月", value: "11" },
+ { label: "十二月", value: "12" }
+ ];
+ return (
+
+
+
+ );
+ }
+}
+
+export default PaymentPeriodModal;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/schemeInfoForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/schemeInfoForm.js
new file mode 100644
index 00000000..2afbd1a3
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/schemeInfoForm.js
@@ -0,0 +1,97 @@
+/*
+ * Author: 黎永顺
+ * name: 社保福利方案-信息表单
+ * Description:
+ * Date: 2023/2/13
+ */
+import React, { Component } from "react";
+import { WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTextarea } from "ecCom";
+import { schemeFields } from "./enum";
+
+class SchemeInfoForm extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ schemeFieldsItem: schemeFields
+ };
+ }
+
+ componentDidMount() {
+ const { schemeFieldsItem } = this.state;
+ const { requestParams, salaryFileStore: { userStatusList }, taxAgentStore: { taxAgentAdminOption } } = this.props;
+ const { sharedType } = requestParams;
+ this.setState({
+ schemeFieldsItem: _.map(schemeFieldsItem, item => {
+ const { key } = item;
+ switch (key) {
+ case "sharedType":
+ return {
+ ...item,
+ options: userStatusList
+ };
+ case "taxAgentIds":
+ return {
+ ...item,
+ multiple: true,
+ display: !_.isNil(sharedType) && sharedType.toString() === "1",
+ options: taxAgentAdminOption
+ };
+ default:
+ break;
+ }
+ return { ...item };
+ })
+ });
+ }
+
+ handleChangeSchemeFiledItems = (key, v) => {
+ const { onChangeFieldsItem } = this.props;
+ const { schemeFieldsItem } = this.state;
+ this.setState({
+ schemeFieldsItem: _.map(schemeFieldsItem, item => {
+ if (key === "sharedType" && item.key === "taxAgentIds") {
+ return { ...item, display: v === "1" };
+ }
+ return { ...item };
+ })
+ }, () => {
+ onChangeFieldsItem({ [key]: (key === "useDefault" || key === "useInEmployeeSalary") ? Number(v) : v });
+ });
+ };
+
+ render() {
+ const { requestParams } = this.props;
+ const { schemeFieldsItem } = this.state;
+ return (
+
+ {
+ _.map(schemeFieldsItem, item => {
+ const { key, label, type, viewAttr, options, display = true, multiple = false } = item;
+ const value = !_.isNil(requestParams[key]) ? requestParams[key].toString() : "";
+ return
+ {
+ (type === "INPUT" && display) ?
+
+ this.handleChangeSchemeFiledItems(key, v)}/> :
+ (type === "SELECT" && display) ?
+
+ this.handleChangeSchemeFiledItems(key, v)}/>
+ :
+ (type === "TEXTAREA" && display) ?
+
+ this.handleChangeSchemeFiledItems(key, v)}/>
+ : null
+ }
+ ;
+ })
+ }
+
+ );
+ }
+}
+
+export default SchemeInfoForm;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js
index f93b6684..6daf854d 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js
@@ -38,7 +38,7 @@ class Accountdialog extends Component {
return (
{
const { billStatus, billMonth, creator } = r;
return (
- {billStatus === "未归档" && (
+ {billStatus === "0" && (
this.handleGoDetail(billMonth, "", r.paymentOrganizationId, creator)}>
核算
)}
- {billStatus === "已归档" && (
+ {billStatus === "0" && (
+ this.handleOperate({
+ key: "archive",
+ billMonth,
+ paymentOrganizationId: r.paymentOrganizationId,
+ creator
+ })}>
+ 归档
+
+ )}
+ {billStatus === "1" && (
+ this.handleOperate({
+ key: "view",
+ billMonth,
+ paymentOrganizationId: r.paymentOrganizationId,
+ creator
+ })}>
+ 查看
+
+ )}
+ {billStatus === "1" && (
this.socialSecurityBenefitsRecalculate({ id: r.id })}>
重新核算
)}
- {billStatus === "未归档" && (
+ {billStatus === "0" && (
- 归档
- {/* 异常详情 */}
删除
- {/* 操作日志 */}
}>
-
-
- )}
- {billStatus === "已归档" && (
-
- this.handleOperate({
- key,
- billMonth,
- paymentOrganizationId: r.paymentOrganizationId,
- creator
- })
- }>
- 查看
-
- }>
-
+
)}
@@ -318,39 +324,62 @@ export default class StandingBook extends React.Component {
break;
}
};
- handleOk = (formVal) => {
+ handleOk = async (formVal) => {
const { save } = this.props.standingBookStore;
const { billMonth, ...extra } = formVal;
const payload = {
billMonth: moment(billMonth).format("YYYY-MM"),
...extra
};
- save(payload).then(({ data }) => {
- this.setState({
- progressVisible: true
- }, () => {
- this.timer = setInterval(() => {
- if (this.state.progress !== 100) {
- this.setState({
- progress: this.state.progress + 10
- });
+ const { data: saveData } = await save(payload);
+ this.setState({
+ progressVisible: true
+ }, () => {
+ this.timer = setInterval(() => {
+ getCalculateProgress(moment(billMonth).format("YYYY-MM")).then(({ status, data }) => {
+ if (status) {
+ if (!data.status) {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ });
+ return;
+ }
+ if (this.state.progress !== 100) {
+ this.setState({
+ progress: (Number(data.progress).toFixed(2)) * 100
+ });
+ } else {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ }, () => {
+ message.success("核算成功");
+ this.handleClose();
+ this.getCommonList({
+ ...this.state.tableParams,
+ current: this.state.current
+ });
+ this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "", saveData);
+ });
+ }
} else {
clearInterval(this.timer);
this.setState({
progressVisible: false,
progress: 0
- }, () => {
- message.success("核算成功");
- this.handleClose();
- this.getCommonList({
- ...this.state.tableParams,
- current: this.state.current
- });
- this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "", data);
});
}
- }, 1000);
- });
+ }).catch(() => {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ });
+ });
+ }, 600);
});
};
@@ -400,11 +429,7 @@ export default class StandingBook extends React.Component {
_.filter(tableStore.columns, (it) => it.hide && it.hide === "false"),
(item) => ({ ...item, width: item.oldWidth })
);
- if (!hasRight && !loading) {
- // 无权限处理
- return renderNoright();
- }
-
+ if (!hasRight && !loading) return renderNoright();
const rightBtns = [
// 右键菜单
];
- const rightMenu = [
- // 右键菜单
- // {
- // key: "BTN_COLUMN",
- // icon: ,
- // content: "显示列定制",
- // onClick: this.showColumn,
- // },
- ];
- const collectParams = {
- // 收藏功能配置
- favname: "社保福利台账",
- favouritetype: 1,
- objid: 0,
- link: "wui/index.html#/ns_demo03/index",
- importantlevel: 1
+ const pagination = {
+ ...this.pageInfo,
+ total: total,
+ showTotal: (total) => `共 ${total} 条`,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ showSizeChanger: true,
+ showQuickJumper: true,
+ onShowSizeChange: (current, pageSize) => {
+ this.pageInfo = { ...this.pageInfo, current, pageSize };
+ this.handleShowSizeChange(this.pageInfo);
+ },
+ onChange: (current) => {
+ this.pageInfo = { ...this.pageInfo, current };
+ this.handleShowSizeChange(this.pageInfo);
+ }
};
return (
-
} // 左侧图标
+ iconBgcolor="#F14A2D" // 左侧图标背景色
+ buttons={showOperateBtn ? rightBtns : []}
>
-
} // 左侧图标
- iconBgcolor="#F14A2D" // 左侧图标背景色
- buttons={showOperateBtn ? rightBtns : []}
- >
-
-
账单月份:
-
{
- return current && endTime && current.getTime() > new Date(endTime).getTime();
- }}
- onChange={(val) => this.handleChangeMonth("startTime", val)}
- />
- 至
- {
- return current && startTime && current.getTime() < new Date(startTime).getTime();
- }}
- onChange={(val) => this.handleChangeMonth("endTime", val)}
- />
-
-
it.dataIndex !== "id").map(item => {
- item.width = "150px";
- if (item.dataIndex === "billMonth") item.fixed = "left";
- if (item.dataIndex === "action") return { ...item };
- return {
- ...item,
- render: (text) => {
- return {text};
+
+
账单月份:
+
{
+ return current && endTime && current.getTime() > new Date(endTime).getTime();
+ }}
+ onChange={(val) => this.handleChangeMonth("startTime", val)}
+ />
+ 至
+ {
+ return current && startTime && current.getTime() < new Date(startTime).getTime();
+ }}
+ onChange={(val) => this.handleChangeMonth("endTime", val)}
+ />
+
+
+
+ it.dataIndex !== "id").map(item => {
+ if (item.dataIndex !== "operate" && item.dataIndex !== "billStatus") {
+ return {
+ ...item,
+ width: 150,
+ render: (text) => {
+ return {text};
+ }
+ };
}
- };
- })}
- dataSource={list}
- total={total}
- current={this.state.current}
- pageSize={this.pageInfo.pageSize}
+ if (item.dataIndex === "billStatus") {
+ return {
+ ...item,
+ render: (_, record) => {
+ return {record.billStatus === "1" ? getLabel(18800, "已归档") : getLabel(17999, "未归档")};
+ }
+ };
+ }
+ return { ...item };
+ })}
+ dataSource={list}
+ pagination={pagination}
+ xWidth={columns.length * 120}
+ />
+
+
+
+ {dialogProps.visible && (
+ this.handleClose()}
+ onOk={this.handleOk}
+ loading={loading}
+ />
+ )}
+ {/*核算进度条*/}
+ {
+ this.state.progressVisible &&
+ {
+ this.setState({ progressVisible: false, progress: 0 });
+ }}
+ progress={this.state.progress}
+ />
+ }
+ {drawerProps.visible && (
+ {
+ this.setState({
+ drawerProps: {
+ ...this.state.drawerProps,
+ title: "",
+ visible: false
+ }
+ });
+ }}
+ columns={abnormalColumns}
+ dataSource={this.state.dbnormalTableData.list}
+ total={this.state.dbnormalTableData.total}
onPageChange={(value) => {
this.handlePageChange(value);
}}
- onShowSizeChange={(current, pageSize) => {
- this.pageInfo = { current, pageSize };
- this.handleShowSizeChange(this.pageInfo);
- }}
- scroll={{ x: 2300 }}
+ // onOk={this.handleOk}
+ loading={inspectLoading}
/>
-
- {dialogProps.visible && (
- this.handleClose()}
- onOk={this.handleOk}
- loading={loading}
- />
- )}
- {/*核算进度条*/}
- {
- this.state.progressVisible &&
- {
- this.setState({ progressVisible: false, progress: 0 });
- }}
- progress={this.state.progress}
- />
- }
- {drawerProps.visible && (
- {
- this.setState({
- drawerProps: {
- ...this.state.drawerProps,
- title: "",
- visible: false
- }
- });
- }}
- columns={abnormalColumns}
- dataSource={this.state.dbnormalTableData.list}
- total={this.state.dbnormalTableData.total}
- onPageChange={(value) => {
- this.handlePageChange(value);
- }}
- // onOk={this.handleOk}
- loading={inspectLoading}
- />
- )}
-
-
+ )}
+
);
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less
index 035f6441..e36a4664 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less
@@ -1,22 +1,34 @@
.standingbookWrapper {
.wea-new-top-content {
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+
+ .tableWrapper {
+ flex: 1;
+ overflow: hidden;
+ }
+
.wea-new-table {
.ant-table-row:hover {
.more {
display: inline-block;
}
}
+
.linkTo {
text-decoration: none;
color: #4d7ad8;
}
+
.more {
margin-left: 8px;
cursor: pointer;
color: #4d7ad8;
// display: none;
}
- .tdEllipsis{
+
+ .tdEllipsis {
display: inline-block;
width: 100%;
overflow: hidden;
@@ -25,11 +37,13 @@
}
}
}
+
.billDateWrapper {
display: flex;
align-items: center;
height: 46px;
padding: 0 16px;
+
.to {
padding: 0 8px;
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/abnormalList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/abnormalList.js
index aad88508..4d386d06 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/abnormalList.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/abnormalList.js
@@ -47,8 +47,7 @@ export default class AbnormalListIndex extends Component {
handleSearch(value) {
const { billMonth } = this.props;
- const { current } = this.state;
- this.getChangeList({ billMonth, current, userName: value });
+ this.getChangeList({ billMonth, current: 1, userName: value });
}
render() {
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js
new file mode 100644
index 00000000..ceafe065
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js
@@ -0,0 +1,465 @@
+/*
+ * Author: 黎永顺
+ * name: 调差列表
+ * Description:
+ * Date: 2022/12/5
+ */
+import React, { Component } from "react";
+import { WeaHelpfulTip, WeaInputNumber, WeaSelect, WeaTableEdit } from "ecCom";
+import { message, Modal } from "antd";
+import {
+ compensationBack,
+ compensationCategoryType,
+ compensationSave,
+ getCompensationComTotal,
+ getCompensationList,
+ getEmployeeListToCompensation
+} from "../../../../apis/standingBook";
+import { getQueryString } from "../../../../util/url";
+import "./index.less";
+
+class AdjustTable extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: {
+ query: false
+ },
+ dataSource: [],
+ columns: [],
+ selectedRowKeys: [],
+ targetOptions: []
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible) {
+ nextProps.visible && this.getCompensationList().then(r => {
+ });
+ }
+ }
+
+ getCompensationList = async () => {
+ const { pageInfo, loading } = this.state;
+ const billMonth = getQueryString("billMonth");
+ const paymentOrganization = getQueryString("paymentOrganization");
+ const [adjustmentObjEnum] = await Promise.all([this.getEmployeeListToCompensation()]);
+ const { status, data: list } = adjustmentObjEnum;
+ this.setState({ targetOptions: list });
+ const targetOptions = status ? _.map(list, it => ({
+ key: it.employeeId.toString(),
+ showname: it.username
+ })) : [];
+ const payload = {
+ paymentOrganization,
+ billMonth,
+ ...pageInfo
+ };
+ this.setState({ loading: { ...loading, query: true } });
+ getCompensationList(payload).then(({ status, data }) => {
+ this.setState({ loading: { ...loading, query: false } });
+ if (status) {
+ const { columns, data: dataSource } = data;
+ this.setState({
+ dataSource: _.map(dataSource, it => {
+ return {
+ ...it,
+ welfareType: it.welfareType.toString(),
+ target: it.employeeId.toString(),
+ adjustTo: it.adjustTo.toString(),
+ adjustToOptions: _.map(it.categoryTypeOptions, child => ({ key: child.id, showname: child.content })),
+ categoryTypeOptions: _.map(it.categoryTypeOptions, child => ({ key: child.id, showname: child.content })),
+ targetOptions: _.map([it.targetOptions], child => ({ key: child.id, showname: child.name }))
+ };
+ }),
+ columns: _.map(columns, item => {
+ const { dataIndex } = item;
+ switch (dataIndex) {
+ case "target":
+ item.com = [
+ {
+ type: "custom",
+ key: "target",
+ width: 220,
+ render: (text, record, index, onEdit) => {
+ return (
+ this.handleChangeTableItem("target", v, index)}
+ />
+ );
+ }
+ }
+ ];
+ break;
+ case "welfareType":
+ item.com = [
+ {
+ width: 220,
+ type: "custom",
+ key: "welfareType",
+ render: (text, record, index, onEdit) => (
+ this.handleChangeTableItem("welfareType", v, index)}
+ />
+ )
+ }
+ ];
+ break;
+ case "categoryType":
+ item.com = [
+ {
+ width: 220,
+ type: "custom",
+ key: "categoryType",
+ render: (text, record, index, onEdit) => (
+ this.handleChangeTableItem("categoryType", v, index)}
+ />
+ )
+ }
+ ];
+ break;
+ case "countryTotal":
+ item.com = [
+ {
+ width: 220,
+ type: "custom",
+ key: "countryTotal",
+ render: (text, record, index, onEdit) => (
+ this.handleChangeTableItem("countryTotal", v, index)}
+ />
+ )
+ }
+ ];
+ break;
+ case "companyTotal":
+ item.com = [
+ {
+ width: 220,
+ type: "custom",
+ key: "companyTotal",
+ render: (text, record, index, onEdit) => (
+ this.handleChangeTableItem("companyTotal", v, index)}
+ />
+ )
+ }
+ ];
+ break;
+ case "adjustmentTotal":
+ item.title =
+ {item.title}
+
+ ;
+ item.com = [
+ {
+ width: 220,
+ type: "custom",
+ key: "adjustmentTotal",
+ render: (text, record, index, onEdit) => (
+ this.handleChangeTableItem("adjustmentTotal", v, index)}
+ />
+ )
+ }
+ ];
+ break;
+ case "adjustTo":
+ item.com = [
+ {
+ width: 220,
+ type: "custom",
+ key: "adjustTo",
+ render: (text, record, index, onEdit) => {
+ return (
+ this.handleChangeTableItem("adjustTo", v, index)}
+ />
+ );
+ }
+ }
+ ];
+ break;
+ default:
+ break;
+ }
+ return { ...item, display: true, width: "20%" };
+ })
+ });
+ }
+ }).catch(() => {
+ this.setState({ loading: { ...loading, query: false } });
+ });
+ };
+ compensationCategoryType = (id, index) => {
+ const { dataSource } = this.state;
+ compensationCategoryType({ id }).then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ dataSource: _.map(dataSource, (item, idx) => {
+ if (index === idx) {
+ return {
+ ...item,
+ adjustTo: "",
+ adjustToOptions: [],
+ categoryType: "",
+ categoryTypeOptions: _.map(data, child => ({ key: child.id, showname: child.content }))
+ };
+ } else {
+ return { ...item };
+ }
+ })
+ });
+ }
+ });
+ };
+ getEmployeeListToCompensation = () => {
+ const billMonth = getQueryString("billMonth");
+ const paymentOrganization = getQueryString("paymentOrganization");
+ const payload = {
+ billMonth, paymentOrganization,
+ pageNum: 1, pageSize: 100
+ };
+ return getEmployeeListToCompensation(payload);
+ };
+ getCompensationComTotal = (payload, index, categoryType) => {
+ const { dataSource } = this.state;
+ getCompensationComTotal(payload).then(({ status, data }) => {
+ if (status && !_.isEmpty(data)) {
+ this.setState({
+ dataSource: _.map(dataSource, (item, idx) => {
+ if (index === idx) {
+ return {
+ ...item,
+ companyTotal: data[0].totalNum,
+ adjustToOptions: categoryType ? _.map(categoryType.split(","), tmpV => {
+ return _.find(item.categoryTypeOptions, tmpJ => tmpJ.key === tmpV);
+ }) : []
+ };
+ } else {
+ return { ...item };
+ }
+ })
+ });
+ }
+ }
+ );
+ };
+ handleChangeCom = (dataSource) => {
+ this.setState({
+ dataSource: _.map(dataSource, (item, index) => {
+ return {
+ ...item,
+ uuid: new Date().getTime() + index
+ };
+ })
+ });
+ };
+ handleChangeTableItem = (filedItemkey, value, index) => {
+ const { dataSource, targetOptions } = this.state;
+ this.setState({
+ dataSource: _.map(dataSource, (item, idx) => {
+ if (index === idx) {
+ return { ...item, [filedItemkey]: value };
+ } else {
+ return { ...item };
+ }
+ })
+ }, () => {
+ const paymentOrganization = getQueryString("paymentOrganization");
+ if (filedItemkey === "target") {
+ this.compensationCategoryType(_.find(targetOptions, it => it.employeeId == value).target, index);
+ } else if (filedItemkey === "categoryType") {
+ _.map(this.state.dataSource, (it, itdx) => {
+ const bool = it.target && it.categoryType;
+ if (bool && itdx === index) {
+ const payload = {
+ paymentOrganization,
+ target: _.find(targetOptions, child => child.employeeId == it.target).target,
+ employeeId: it.target,
+ categoryType: it.categoryType
+ };
+ this.getCompensationComTotal([payload], itdx, it.categoryType);
+ }
+ });
+ } else if (filedItemkey === "countryTotal") {
+ this.setState({
+ dataSource: _.map(this.state.dataSource, (child, childidx) => {
+ if (index === childidx) {
+ return {
+ ...child,
+ adjustmentTotal: (Number(!_.isNil(child.countryTotal) ? child.countryTotal : 0) - Number(child.companyTotal)).toFixed(2)
+ };
+ } else {
+ return { ...child };
+ }
+ })
+ });
+ }
+ });
+ };
+
+ handleClick = (record) => {
+ const { status, id, paymentOrganization, billMonth } = record;
+ const { targetOptions } = this.state;
+ if (status) {
+ Modal.confirm({
+ title: "信息确认",
+ content: "确定撤回吗?撤回后该笔调差将失效!",
+ onOk: () => {
+ const payload = { id, paymentOrganization, billMonth };
+ compensationBack(payload).then(({ status, data, errormsg }) => {
+ if (status) {
+ message.success(data || "撤回成功");
+ this.setState({
+ dataSource: _.map(this.state.dataSource, (it, idx) => {
+ if (id === it.id) {
+ return {
+ ...it,
+ status: false,
+ uuid: new Date().getTime() + idx
+ };
+ }
+ return { ...it, uuid: new Date().getTime() + idx };
+ })
+ });
+ } else {
+ message.error(errormsg || "撤回失败");
+ }
+ });
+ },
+ onCancel: () => {
+ }
+ });
+ } else {
+ Modal.confirm({
+ title: "信息确认",
+ content: "确定保存吗?保存后数据将即时更新到台账!",
+ onOk: () => {
+ const {
+ adjustToOptions, categoryTypeOptions, key, target, status,
+ originId, targetOptions: targetOption, billMonth,
+ ...extraParams
+ } = record;
+ const month = getQueryString("billMonth");
+ const paymentOrg = getQueryString("paymentOrganization");
+ const tmpObj = { ...extraParams, target };
+ for (let i in tmpObj) {
+ if (tmpObj[i]) {
+ Object.assign(tmpObj, { [i]: tmpObj[i].toString() });
+ }
+ }
+ const bool = _.every(Object.keys({ ...extraParams, target }), child => {
+ return !!tmpObj[child];
+ });
+ if (!bool) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ const payload = {
+ ...extraParams,
+ employeeId: target,
+ target: _.find(targetOptions, child => child.employeeId == target).target,
+ billMonth: month,
+ paymentOrganization: paymentOrg
+ };
+ compensationSave([payload]).then(({ status, data, errormsg }) => {
+ if (status) {
+ const { data: dataMsg, errorMessage = [], successIds = [] } = data;
+ const msg = dataMsg + errorMessage.join(",");
+ !_.isEmpty(errorMessage) ? message.error(msg) : message.success(msg || "保存成功");
+ if (_.isEmpty(errorMessage)) {
+ this.setState({
+ dataSource: _.map(this.state.dataSource, it => {
+ if (record.target === it.target && record.uuid === it.uuid) {
+ return { ...it, status: true, id: successIds[0] };
+ }
+ return { ...it };
+ })
+ });
+ }
+ } else {
+ message.error(errormsg || "保存失败");
+ }
+ });
+ },
+ onCancel: () => {
+ }
+ });
+ }
+ };
+ getRowSelection = (rowSelection) => {
+ let sel = { ...rowSelection };
+ sel.getCheckboxProps = (record) => {
+ return { disabled: record.status };
+ };
+ return sel;
+ };
+
+ render() {
+ const { dataSource, columns, selectedRowKeys } = this.state;
+
+ return (
+ {
+ const { status } = record;
+ return this.handleClick(record)}>{status ? "撤回" : "保存"};
+ }
+ }
+ ]
+ }
+ datas={dataSource}
+ onChange={this.handleChangeCom}
+ selectedRowKeys={selectedRowKeys}
+ getRowSelection={this.getRowSelection}
+ tableProps={{ x: 800 }}
+ />
+ );
+ }
+}
+
+export default AdjustTable;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js
new file mode 100644
index 00000000..5651926e
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js
@@ -0,0 +1,126 @@
+/*
+ * Author: 黎永顺
+ * name: 默认调差弹框
+ * Description:
+ * Date: 2022/12/27
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { Alert, message } from "antd";
+import { WeaSlideModal, WeaTable } from "ecCom";
+import SlideModalTitle from "../../../../components/slideModalTitle";
+import { compensationConfigSave } from "../../../../apis/standingBook";
+import "./index.less";
+
+@inject("taxAgentStore")
+@observer
+class AdjustmentDefaultSlide extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false
+ };
+ }
+
+ handleSaveDefAdjustment = () => {
+ const { dataSource } = this.props;
+ const payload = _.map(dataSource, it => {
+ return {
+ paymentOrganization: it.paymentOrganization,
+ categoryType: it.categoryType,
+ welfareType: it.welfareType,
+ target: it.targetOptions[0].key,
+ adjustTo: it.adjustTo,
+ employeeId: it.employeeId
+ };
+ });
+ this.setState({ loading: true });
+ compensationConfigSave(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success("保存成功");
+ } else {
+ message.error(errormsg || "保存失败");
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+
+ render() {
+ const { visible, onCancel, taxAgentStore: { showOperateBtn }, dataSource } = this.props;
+ const { loading } = this.state;
+ const columns = [
+ {
+ dataIndex: "target", title: "调差对象",
+ render: (text, record) => {
+ return (
+ {_.map(record.targetOptions, it => it.showname).join(",")}
+ );
+ }
+ },
+ {
+ dataIndex: "welfareType", title: "统计调差福利",
+ render: (text, record) => {
+ return (
+ 社保
+ );
+ }
+ },
+ {
+ dataIndex: "categoryType", title: "统计调差福利类型(单位)",
+ render: (text, record) => {
+ return (
+ {_.map(record.categoryTypeOptions, it => it.showname).join(",")}
+ );
+ }
+ },
+ {
+ dataIndex: "adjustTo", title: "调差到(单位)",
+ render: (text, record) => {
+ return (
+ {_.find(record.adjustToOptions, it => it.key === record.adjustTo).showname}
+ );
+ }
+ }
+ ];
+ return (
+
+ }
+ content={
+
+ }
+ onClose={onCancel}
+ />
+ );
+ }
+}
+
+export default AdjustmentDefaultSlide;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js
new file mode 100644
index 00000000..90fe32b1
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js
@@ -0,0 +1,146 @@
+/*
+ * Author: 黎永顺
+ * name: 调差
+ * Description:
+ * Date: 2022/12/5
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaSlideModal } from "ecCom";
+import { Button, message, Modal } from "antd";
+import SlideModalTitle from "../../../../components/slideModalTitle";
+import AdjustTable from "./adjustTable";
+import { getQueryString } from "../../../../util/url";
+import { compensationSave } from "../../../../apis/standingBook";
+import AdjustmentDefaultSlide from "./adjustmentDefaultSlide";
+import "./index.less";
+
+
+@inject("taxAgentStore")
+@observer
+class AdjustmentSlide extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ current: 0,
+ loading: false,
+ taxAgentId: "",
+ adjustDefSlide: {
+ visible: false,
+ dataSource: []
+ }
+ };
+ this.adjustTableRef = null;
+ }
+
+ handleSave = () => {
+ const requireKeys = ["adjustTo", "adjustmentTotal", "categoryType", "companyTotal", "countryTotal", "target", "welfareType"];
+ let { dataSource, targetOptions } = this.adjustTableRef.state;
+ dataSource = _.filter(dataSource, it => (!it.id || !it.status));
+ const billMonth = getQueryString("billMonth");
+ const paymentOrganization = getQueryString("paymentOrganization");
+ let bool = true;
+ _.map(dataSource, item => {
+ bool = _.every(requireKeys, child => !!item[child]);
+ });
+ if (_.isEmpty(dataSource)) {
+ Modal.warning({
+ title: "信息确认",
+ content: "请添加调差项!"
+ });
+ return;
+ } else if (!bool) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ const payload = _.map(dataSource, item => {
+ const { adjustToOptions, categoryTypeOptions, target, targetOptions: targetOpts, ...extraParams } = item;
+ return {
+ ...extraParams,
+ employeeId: target,
+ target: _.find(targetOptions, child => child.employeeId == target).target,
+ billMonth,
+ paymentOrganization
+ };
+ });
+ this.setState({ loading: true });
+ compensationSave(payload).then(({ status, data, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ const { data: dataMsg, errorMessage = [] } = data;
+ const msg = dataMsg + errorMessage.join(",");
+ !_.isEmpty(errorMessage) ? message.error(msg) : message.success(msg || "保存成功");
+ _.isEmpty(errorMessage) &&
+ this.adjustTableRef.getCompensationList().then(r => {
+ });
+ } else {
+ message.error(errormsg || "保存失败");
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+ handleSetasDefault = () => {
+ const { adjustDefSlide } = this.state;
+ this.setState({
+ adjustDefSlide: {
+ ...adjustDefSlide,
+ visible: true,
+ dataSource: _.filter(this.adjustTableRef.state.dataSource, it => it.status)
+ }
+ })
+ ;
+ };
+ renderCustomOperate = () => {
+ return [
+ 保存全部,
+ 设为默认
+ ];
+ };
+
+ render() {
+ const { title, visible, onCancel, taxAgentStore: { showOperateBtn } } = this.props;
+ const { loading, adjustDefSlide } = this.state;
+ return (
+
+
+ }
+ content={
this.adjustTableRef = dom} visible={visible}/>}
+ onClose={onCancel}
+ />
+ {
+ this.setState({
+ adjustDefSlide: {
+ ...adjustDefSlide,
+ visible: false,
+ dataSource: []
+ }
+ });
+ }}
+ />
+
+ );
+ }
+}
+
+export default AdjustmentSlide;
+
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/businessAccounting.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/businessAccounting.js
new file mode 100644
index 00000000..d3f9f281
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/businessAccounting.js
@@ -0,0 +1,64 @@
+/*
+ * Author: 黎永顺
+ * name: 按补缴人员的历史月份核算基数和当前档案方案核算
+ * Description:
+ * Date: 2023/1/3
+ */
+import React, { Component } from "react";
+import { WeaInputNumber, WeaSearchGroup } from "ecCom";
+import "./index.less";
+
+class BusinessAccounting extends Component {
+ renderBaseItem = (dataSource = [], type) => {
+ return ;
+ };
+ handleChangeBaseItem = (item, value, type) => {
+ const { onChangeBaseItem, socialSecurityBase, fundBase, otherBase } = this.props;
+ _.map(this.props[type], it => {
+ if (item.insuranceId === it.insuranceId) {
+ it.insuranceBase = value;
+ }
+ });
+ onChangeBaseItem(socialSecurityBase, fundBase, otherBase);
+ };
+
+ render() {
+ const { socialSecurityBase, fundBase, otherBase } = this.props;
+ return (
+
+ {
+ !_.isEmpty(socialSecurityBase) &&
+ {this.renderBaseItem(socialSecurityBase, "socialSecurityBase")}
+ }
+ {
+ !_.isEmpty(fundBase) &&
+ {this.renderBaseItem(fundBase, "fundBase")}
+ }
+ {
+ !_.isEmpty(otherBase) &&
+ {this.renderBaseItem(otherBase, "otherBase")}
+ }
+
+ );
+ }
+}
+
+export default BusinessAccounting;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
index 8fec2dbd..9ed9d668 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
@@ -1,48 +1,86 @@
-.normalWapper {
- .topContent {
- padding: 8px 20px;
+.standingBookDetailWapper {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+
+ .normalWapper {
+ flex: 1;
display: flex;
- align-items: center;
+ flex-direction: column;
+ overflow: hidden;
- .month {
- margin-right: 26px;
+ .tableWrapper {
+ flex: 1;
+ overflow: hidden;
- span:first-child {
- margin-right: 8px;
- }
-
- i {
- color: #666;
- margin-left: 8px;
+ .ant-spin-nested-loading, .ant-spin-container {
+ height: 100%;
}
}
- }
- .tabOption {
- display: flex;
- align-items: center;
- padding: 8px 20px;
- justify-content: flex-end;
+ .topContent {
+ padding: 8px 20px;
+ display: flex;
+ align-items: center;
- i, button {
- cursor: pointer;
- margin-right: 10px;
+ .month {
+ margin-right: 26px;
+
+ span:first-child {
+ margin-right: 8px;
+ }
+
+ i {
+ color: #666;
+ margin-left: 8px;
+ }
+ }
}
- .anticon-search {
- margin-right: 0px;
+ .tabOption {
+ display: flex;
+ align-items: center;
+ padding: 8px 20px;
+ justify-content: flex-end;
+
+ i.icon-coms-Batch-delete, i.icon-coms-Add-to, button {
+ cursor: pointer;
+ margin-right: 10px;
+ }
+
+ .anticon-search {
+ margin-right: 0px;
+ }
+
+ .wea-input-focus-btn {
+ margin-right: 0px;
+ }
}
- .wea-input-focus-btn {
- margin-right: 0px;
+ .tdEllipsis {
+ display: inline-block;
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
}
}
-//退差
-.regressionWrapper {
- height: calc(100vh - 47px);
- overflow: auto;
+//退差;补差
+.regressionWrapper, .differenceWrapper {
+ flex: 1;
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+
+ .tableWrapper {
+ flex: 1;
+ overflow: hidden;
+ .ant-spin-nested-loading, .ant-spin-container {
+ height: 100%;
+ }
+ }
.tdEllipsis {
display: inline-block;
@@ -93,3 +131,83 @@
}
}
}
+
+//退差人员选择框
+.regSelectWrapper {
+}
+
+//调差抽屉
+.adjustmentWrapper, .adjustDefSlideWrapper, .supplementarySlideWrapper {
+ .wea-slide-modal-title {
+ height: initial;
+ line-height: initial;
+ text-align: left;
+ }
+
+ .wea-slide-modal-title + div {
+ padding-bottom: 70px !important;
+ }
+
+ .rodal-close {
+ z-index: 99;
+ top: 10px !important;
+ }
+
+ .wea-table-edit table {
+ table-layout: fixed;
+
+ .text-elli {
+ display: inline-block;
+ width: 100%;
+ }
+ }
+
+ .rodal-dialog > div:nth-child(2) {
+ padding-bottom: 72px !important;
+ }
+}
+
+@media (min-width: 1260px) {
+ .adjustmentWrapper, .adjustDefSlideWrapper, .supplementarySlideWrapper {
+ .reqTopWrapper .wea-new-top-req-title > div:first-child > div {
+ max-width: 100% !important;
+ }
+ }
+}
+
+@media screen and (min-width: 1060px) and (max-width: 1260px) {
+ .adjustmentWrapper, .adjustDefSlideWrapper, .supplementarySlideWrapper {
+ .reqTopWrapper .wea-new-top-req-title > div:first-child > div {
+ max-width: calc(100% - 96px) !important;
+ }
+ }
+}
+
+//补缴新增
+.baseFieldItemWrapper {
+ border: 1px solid #e5e5e5;
+ border-bottom: none;
+
+ & > li {
+ border-bottom: 1px solid #e5e5e5;
+ padding: 5px 16px;
+ display: flex;
+ align-items: center;
+
+ & > div:first-child {
+ width: 25%;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ color: #666;
+ }
+
+ & > div:last-child {
+ flex: 1;
+
+ .wea-input-number {
+ width: 20% !important;
+ }
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js
new file mode 100644
index 00000000..ea62431c
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js
@@ -0,0 +1,82 @@
+/*
+ * Author: 黎永顺
+ * name: 手动输入补缴金额
+ * Description:
+ * Date: 2023/1/3
+ */
+import React, { Component } from "react";
+import { WeaInputNumber, WeaSearchGroup, WeaTable } from "ecCom";
+
+class InputPaymentAmount extends Component {
+
+ renderInputItem = (dataSource = [], type) => {
+ const columns = [
+ {
+ dataIndex: "insuranceName", title: "福利项"
+ },
+ {
+ dataIndex: "per", title: "个人缴纳金额",
+ render: (text, record) => {
+ return (
+ this.handleChangeBaseItem(record, val, type, "per")}
+ />
+ );
+ }
+ },
+ {
+ dataIndex: "com", title: "单位缴纳金额",
+ render: (text, record) => {
+ return (
+ this.handleChangeBaseItem(record, val, type, "com")}
+ />
+ );
+ }
+ }
+ ];
+ return ;
+ };
+ handleChangeBaseItem = (item, value, type, paymentType) => {
+ const { onChangeInputItem, socialPayment, fundPayment, otherPayment } = this.props;
+ _.map(this.props[type], it => {
+ const key = `${it.insuranceId}_${paymentType}`;
+ if (item.insuranceId === it.insuranceId) {
+ _.assign(it, { [key]: value });
+ }
+ });
+ onChangeInputItem(socialPayment, fundPayment, otherPayment);
+ };
+
+ render() {
+ const { socialPayment, fundPayment, otherPayment } = this.props;
+ return (
+
+ {
+ !_.isEmpty(socialPayment) &&
+ {this.renderInputItem(socialPayment, "socialPayment")}
+ }
+ {
+ !_.isEmpty(fundPayment) &&
+ {this.renderInputItem(fundPayment, "fundPayment")}
+ }
+ {
+ !_.isEmpty(otherPayment) &&
+ {this.renderInputItem(otherPayment, "otherPayment")}
+ }
+
+ );
+ }
+}
+
+export default InputPaymentAmount;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
new file mode 100644
index 00000000..c616f946
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
@@ -0,0 +1,146 @@
+/*
+ * Author: 黎永顺
+ * name: 补差
+ * Description:
+ * Date: 2022/12/16
+ */
+import React, { Component } from "react";
+import RegTop from "./regTop";
+import { message, Modal } from "antd";
+import { WeaNewScroll } from "ecCom";
+import { getQueryString } from "../../../../util/url";
+import * as API from "../../../../apis/standingBook";
+import { calcPageNo } from "../../../../util";
+import RegList from "./regList";
+import RegEditDetial from "./regEditDetial";
+import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
+import "./index.less";
+
+class MakeupDifference extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ selectKey: [],
+ fieldData: {},
+ returnEditPersonSlide: {
+ title: "",
+ editId: "",
+ visible: false
+ },
+ importDiffModal: {
+ visible: false
+ },
+ loading: { save: false }
+ };
+ this.diffListRef = null;
+ this.regTopRef = null;
+ }
+
+ delBalance = () => {
+ const { selectKey: ids } = this.state;
+ const billMonth = getQueryString("billMonth");
+ const paymentOrganization = getQueryString("paymentOrganization");
+ const payload = { ids, billMonth, paymentOrganization };
+ API.delBalance(payload).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("删除成功");
+ const current = calcPageNo(this.diffListRef.state.pageInfo.total, this.diffListRef.state.pageInfo.current, 10, ids.length);
+ this.diffListRef.recessionList({ current });
+ this.diffListRef.handleResetSelectRowKeys([]);
+ this.setState({ selectKey: [] });
+ } else {
+ message.error(errormsg || "删除失败");
+ }
+ });
+ };
+ handleChangeOpt = (key) => {
+ const { importDiffModal } = this.state;
+ const name = this.regTopRef.state.name;
+ const workcode = this.regTopRef.state.workcode;
+ const billMonth = getQueryString("billMonth");
+ const paymentOrganization = getQueryString("paymentOrganization");
+ switch (key) {
+ case "delete":
+ Modal.confirm({
+ title: "信息确认",
+ content: "确定删除数据吗?",
+ onOk: () => this.delBalance()
+ });
+ break;
+ case "import":
+ this.setState({ importDiffModal: { ...importDiffModal, visible: true } });
+ break;
+ case "export":
+ const url = `${window.location.origin}/api/bs/hrmsalary/welfare/balance/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
+ window.open(url, "_self");
+ break;
+ case "search":
+ this.diffListRef.recessionList({ userName: name, workcode, current: 1 });
+ break;
+ default:
+ break;
+ }
+ };
+ handleEdit = (record) => {
+ const { userName, id: editId } = record;
+ const { returnEditPersonSlide } = this.state;
+ this.setState({
+ returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId }
+ });
+ };
+ handleCloseModal = (refreshList = false) => {
+ const { returnEditPersonSlide } = this.state;
+ this.setState({
+ returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
+ }, () => {
+ refreshList && this.diffListRef.recessionList();
+ });
+ };
+
+ render() {
+ const billMonth = getQueryString("billMonth");
+ const { selectKey, importDiffModal, fieldData, returnEditPersonSlide } = this.state;
+ return (
+
+
this.regTopRef = dom}
+ billMonth={billMonth}
+ onChange={this.handleChangeOpt}
+ selectKey={selectKey}
+ />
+
+
+ this.diffListRef = dom}
+ onChangeRowkey={(selectKey) => this.setState({ selectKey })}
+ onEdit={this.handleEdit}
+ />
+ {/*编辑弹框*/}
+
+ {/*导入补差*/}
+ {
+ importDiffModal.visible &&
+ this.setState({ fieldData })}
+ onCancel={() => {
+ this.setState({ importDiffModal: { ...importDiffModal, visible: false }, fieldData: {} }, () => {
+ const name = this.regTopRef.state.name;
+ this.diffListRef.recessionList({ userName: name });
+ });
+ }}
+ isStandingBook
+ standingBookType="difference"
+ />
+ }
+
+
+
+ );
+ }
+}
+
+export default MakeupDifference;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
index 67abafe6..4a2b5783 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
@@ -7,12 +7,15 @@
import React, { Component } from "react";
import { Button, Icon, message, Modal, Spin, Tooltip } from "antd";
import { inject, observer } from "mobx-react";
-import { toJS } from "mobx";
-import { WeaDialog, WeaInputSearch, WeaTable } from "ecCom";
-import { calcPageNo, getSearchs } from "../../../../util";
+import { WeaFormItem, WeaInput, WeaSearchGroup, WeaTab } from "ecCom";
+import { calcPageNo } from "../../../../util";
import { getQueryString } from "../../../../util/url";
import ProgressModal from "../../../../components/progressModal";
import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
+import AdjustmentSlide from "./adjustmentSlide";
+import { getCalculateProgress } from "../../../../apis/calculate";
+import RegEditDetial from "./regEditDetial";
+import SupplementarySlide from "./supplementarySlide";
import _ from "lodash";
import "./index.less";
@@ -30,20 +33,34 @@ export default class NormalIndex extends Component {
title: "",
visible: false
},
+ adjustSlide: {
+ title: "调差",
+ visible: false
+ },
tableData: {
list: [],
columns: [],
total: 0
},
searchValue: "",
+ workcode: "",
progressVisible: false,
progress: 0,
fieldData: {}, //选中的表单头信息
importParams: { //导入信息的弹框表示
visible: false
- }
+ },
+ returnEditPersonSlide: {
+ title: "",
+ editId: "",
+ visible: false
+ },
+ showSum: false,
+ siaccountSum: {},
+ showSearchAd: false
};
this.timer = null;
+ this.timerDelete = null;
}
componentDidMount() {
@@ -54,50 +71,93 @@ export default class NormalIndex extends Component {
selectedKey === "1"
? this.getNormalList({ billMonth, current, paymentOrganization })
: this.getSupplementaryList({ billMonth, current, paymentOrganization });
+ window.addEventListener("message", this.handleReceive, false);
}
+ handleReceive = async ({ data }) => {
+ const { type, payload: { id, params } = {} } = data;
+ if (type === "init") {
+ this.postMessageToChild();
+ } else if (type === "turn") {
+ if (id === "PAGEINFO") {
+ const { pageNum: current, size: pageSize } = params;
+ this.setState({ current, pageSize }, () => {
+ const { billMonth, paymentOrganization, selectedKey } = this.props;
+ const { current, pageSize } = this.state;
+ selectedKey === "1" ?
+ this.getNormalList({
+ billMonth, current, pageSize, paymentOrganization
+ }) :
+ this.getSupplementaryList({
+ billMonth, current, pageSize, paymentOrganization
+ });
+ });
+ } else if (id === "ROWSELECT") {
+ const { selectedRowKeys } = params;
+ this.setState({ selectedRowKeys });
+ } else if (id === "EDIT") {
+ this.handleEditNormalStandingBook(params);
+ }
+ }
+ };
+
componentWillUnmount() {
- // 清除轮询
if (this.timer) {
clearInterval(this.timer);
}
+ if (this.timerDelete) {
+ clearInterval(this.timerDelete);
+ }
+ window.removeEventListener("message", this.handleReceive, false);
}
componentWillReceiveProps(nextProps) {
if (nextProps.selectedKey != this.props.selectedKey) {
const { billMonth, paymentOrganization } = nextProps;
this.setState({
- current: 1
+ current: 1, selectedRowKeys: []
}, () => {
const { current } = this.state;
nextProps.selectedKey === "1"
? this.getNormalList({ billMonth, current, paymentOrganization })
- : this.getSupplementaryList({
- billMonth,
- current,
- paymentOrganization
- });
+ : this.getSupplementaryList({ billMonth, current, paymentOrganization });
});
}
}
- handleSearch(value) {
+ postMessageToChild = () => {
+ const billMonth = getQueryString("billMonth");
+ const paymentOrganization = getQueryString("paymentOrganization");
+ const childFrameObj = document.getElementById("atdTable");
+ const { current, pageSize, tableData, selectedRowKeys, showSum, siaccountSum, searchValue: userName } = this.state;
+ const { list: dataSource, total, columns } = tableData;
+ const pageInfo = { current, pageSize, total };
+ childFrameObj.contentWindow.postMessage(JSON.stringify({
+ dataSource, columns, pageInfo,
+ selectedRowKeys, selectedKey: this.props.selectedKey,
+ sumpayload: { billMonth, paymentOrganization, userName },
+ showOperates: !getQueryString("type")
+ }), "*");
+ };
+
+ handleSearch = () => {
const { billMonth, selectedKey, paymentOrganization } = this.props;
- const { current } = this.state;
selectedKey === "1"
? this.getNormalList({
billMonth,
current: 1,
paymentOrganization,
- userName: value
+ userName: this.state.searchValue,
+ workcode: this.state.workcode
})
: this.getSupplementaryList({
billMonth,
current: 1,
paymentOrganization,
- userName: value
+ userName: this.state.searchValue,
+ workcode: this.state.workcode
});
- }
+ };
handleSave = () => {
const {
@@ -173,78 +233,22 @@ export default class NormalIndex extends Component {
});
}
};
-
- getNormalList = (payload = {}) => {
+ getNormalList = async (payload = {}) => {
const { getNormalList } = this.props.standingBookStore;
getNormalList({ ...payload }).then(({ list, columns = [], total }) => {
- columns = _.map(_.filter(columns, it => it.dataIndex !== "id"), it => {
- if (it.dataIndex === "employeeId") {
- it = {
- ...it,
- width: 150,
- fixed: "left",
-
- render: (text, r) => {
- const { userName, employeeId } = r;
- return (
-
- {userName}
-
- );
- }
- };
- it.title = "姓名";
- }
- return {
- ...it,
- title: ,
- width: 150
- };
- });
this.setState({
- tableData: {
- list,
- columns,
- total
- }
- });
+ tableData: { list, total, columns }
+ }, () => this.postMessageToChild());
});
};
- getSupplementaryList = (payload = {}) => {
+ getSupplementaryList = async (payload = {}) => {
const { getSupplementaryList } = this.props.standingBookStore;
getSupplementaryList({
...payload
}).then(({ list, columns = [], total }) => {
- columns = _.map(_.filter(columns, it => it.dataIndex !== "id"), it => {
- if (it.dataIndex === "employeeId") {
- it = {
- ...it,
- width: 150,
- fixed: "left",
- render: (text, r) => {
- const { userName, employeeId } = r;
- return (
-
- {userName}
-
- );
- }
- };
- it.title = "姓名";
- }
- return {
- ...it,
- title: ,
- width: 150
- };
- });
this.setState({
- tableData: {
- list,
- columns,
- total
- }
- });
+ tableData: { list, columns, total }
+ }, () => this.postMessageToChild());
});
};
onSelectChange = selectedRowKeys => {
@@ -270,14 +274,46 @@ export default class NormalIndex extends Component {
title: "确认信息",
content: "确认删除勾选的数据吗?",
onOk: () => {
+ this.setState({
+ progressVisible: true
+ }, () => {
+ this.timerDelete = setInterval(() => {
+ if (this.state.progress !== 100) {
+ this.setState({
+ progress: this.state.progress + 10
+ });
+ } else {
+ clearInterval(this.timerDelete);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ }, () => {
+ message.success("删除成功");
+ selectedKey === "1"
+ ? this.getNormalList({
+ billMonth,
+ paymentOrganization,
+ current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length)
+ })
+ : this.getSupplementaryList({
+ billMonth,
+ current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length),
+ paymentOrganization
+ });
+ });
+ }
+ }, 800);
+ });
+
siaccountCommonDelete({
billMonth,
includes,
ids,
paymentOrganization
}).then(() => {
+ clearInterval(this.timerDelete);
message.success("删除成功");
- this.setState({ selectedRowKeys: [] });
+ this.setState({ selectedRowKeys: [], progressVisible: false, progress: 0 });
selectedKey === "1"
? this.getNormalList({
billMonth,
@@ -290,6 +326,7 @@ export default class NormalIndex extends Component {
paymentOrganization
});
});
+
},
onCancel: () => {
}
@@ -297,16 +334,6 @@ export default class NormalIndex extends Component {
}
};
handleAdd = () => {
- const {
- siaccountCommonForm,
- querySupplementaryForm
- } = this.props.standingBookStore;
- const { billMonth, selectedKey } = this.props;
- if (selectedKey === "1") {
- siaccountCommonForm();
- } else {
- querySupplementaryForm();
- }
this.setState({
addProps: {
...this.state.addProps,
@@ -316,46 +343,65 @@ export default class NormalIndex extends Component {
});
};
- // 核算按钮点击
- handleCommonAccountClick() {
+ handleCommonAccountClick = () => {
const { billMonth, selectedKey, paymentOrganization } = this.props;
const { commonAccount } = this.props.standingBookStore;
- commonAccount({
- billMonth,
- paymentOrganization,
- includes: []
- }).then(() => {
- this.setState({
- progressVisible: true
- }, () => {
- this.timer = setInterval(() => {
- if (this.state.progress !== 100) {
- this.setState({
- progress: this.state.progress + 20
- });
+ commonAccount({ billMonth, paymentOrganization, includes: [] });
+ this.setState({
+ progressVisible: true
+ }, () => {
+ this.timer = setInterval(() => {
+ getCalculateProgress(billMonth).then(({ status, data }) => {
+ if (status) {
+ if (!data.status) {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ });
+ message.error(data.message);
+ }
+ if (this.state.progress !== 100) {
+ this.setState({
+ progress: (Number(data.progress).toFixed(2)) * 100
+ });
+ } else {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ }, () => {
+ message.success("核算成功");
+ selectedKey === "1"
+ ? this.getNormalList({
+ billMonth,
+ paymentOrganization,
+ current: this.state.current
+ })
+ : this.getSupplementaryList({
+ billMonth,
+ paymentOrganization,
+ current: this.state.current
+ });
+ });
+ }
} else {
clearInterval(this.timer);
- message.success("核算成功");
this.setState({
progressVisible: false,
progress: 0
});
- selectedKey === "1"
- ? this.getNormalList({
- billMonth,
- paymentOrganization,
- current: this.state.current
- })
- : this.getSupplementaryList({
- billMonth,
- paymentOrganization,
- current: this.state.current
- });
}
- }, 800);
- });
+ }).catch(() => {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ });
+ });
+ }, 600);
});
- }
+ };
handleExport = () => {
const { billMonth, selectedKey, paymentOrganization } = this.props;
@@ -367,57 +413,81 @@ export default class NormalIndex extends Component {
.origin}${urlObj[selectedKey]}?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
window.open(url, "_self");
};
-
- render() {
- const { remarks, billMonth, selectedKey, paymentOrganization } = this.props;
- const { selectedRowKeys, addProps, date, importParams } = this.state;
- const {
- loading,
- form,
- condition,
- saveLoading
- } = this.props.standingBookStore;
- let { list, columns, total } = this.state.tableData;
- const rowSelection = {
- selectedRowKeys,
- onChange: this.onSelectChange
- };
- const pagination = {
- total,
- current: this.state.current,
- showTotal: total => `共 ${total} 条`,
- showSizeChanger: true,
- showQuickJumper: true,
- pageSizeOptions: ["10", "20", "50", "100"],
- onShowSizeChange: (current, pageSize) => {
- this.setState({ current, pageSize });
- selectedKey === "1"
- ? this.getNormalList({ billMonth, current, pageSize, paymentOrganization })
- : this.getSupplementaryList({
- billMonth,
- current,
- pageSize,
- paymentOrganization
- });
- },
- onChange: current => {
- this.setState({ current });
+ handleEditNormalStandingBook = (record) => {
+ const { userName, id: editId } = record;
+ const { returnEditPersonSlide } = this.state;
+ this.setState({
+ returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId }
+ });
+ };
+ handleCloseNormalStandingBookModal = (refreshList = false) => {
+ const { returnEditPersonSlide } = this.state;
+ this.setState({
+ returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
+ }, () => {
+ if (refreshList) {
+ const { current } = this.state;
+ const { billMonth, selectedKey, paymentOrganization } = this.props;
selectedKey === "1"
? this.getNormalList({
- billMonth, current,
- pageSize: this.state.pageSize, paymentOrganization
+ billMonth,
+ paymentOrganization,
+ current
})
: this.getSupplementaryList({
billMonth,
- current,
- pageSize: this.state.pageSize,
- paymentOrganization
+ paymentOrganization,
+ current
});
}
- };
+ });
+ };
+ getSearchs = () => {
+ return
+
+ this.setState({ workcode: v })}
+ />
+
+ ;
+ };
+
+ render() {
+ const { remarks, billMonth, selectedKey, paymentOrganization, standingBookStore } = this.props;
+ const { addProps, adjustSlide, importParams, returnEditPersonSlide, showSearchAd } = this.state;
+ const { loading } = standingBookStore;
+ const btn1 = [
+ 批量删除,
+ 添加缴纳人员
+ ];
+ const btn2 = [
+ 核算,
+ this.setState({ adjustSlide: { ...adjustSlide, visible: true } })}>调差
+ ];
+ const btn3 = [
+ {
+ window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/sbofflineComparison?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`);
+ }}>线下对比
+ ];
+ const btn4 = [
+ this.setState({ importParams: { ...importParams, visible: true } })}>导入数据
+ ];
+ const btn5 = [
+ 导出全部
+ ];
+ let btn = [];
+ (this.props.type !== "detail" && this.props.selectedKey == "3") && (btn = [...btn, ...btn1]);
+ (selectedKey === "1" && this.props.type !== "detail") && (btn = [...btn, ...btn2]);
+ selectedKey === "1" && (btn = [...btn, ...btn3]);
+ this.props.type !== "detail" && (btn = [...btn, ...btn4]);
+ btn = [...btn, ...btn5];
return (
- {selectedKey === "1" &&
+ {
+ selectedKey === "1" &&
@@ -436,143 +506,90 @@ export default class NormalIndex extends Component {
{remarks}
-
}
-
- {this.props.type !== "detail" && this.props.selectedKey == "3"
- ?
-
-
-
-
-
-
-
- :
}
-
- {addProps.visible &&
-
- this.setState({
- addProps: {
- ...addProps,
- title: "",
- visible: false
- }
- })}
- buttons={[
-
- 保存
- ,
- form.resetForm()}>重置
- ]}>
- {getSearchs(form, toJS(condition), 1)}
- }
- {/* {selectedKey === "3" && (
-
-
-
- )}
-
-
- */}
- {
- selectedKey === "1" && this.props.type !== "detail" &&
-
- {
- this.handleCommonAccountClick();
- }}>核算
-
- }
- {
- selectedKey === "1" &&
-
- {
- window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/sbofflineComparison?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`);
- }}>线下对比
-
- }
- {/*核算进度条*/}
-
+ }
+ this.setState({ showSearchAd: bool })}
+ onSearchChange={searchValue => this.setState({ searchValue })}
+ buttons={btn} onSearch={this.handleSearch} onAdSearch={this.handleSearch}
+ onAdReset={() => this.setState({ workcode: "" })} searchsBasePlaceHolder="请输入员工姓名"
+ />
+ {
+ this.setState({
+ addProps: {
+ ...addProps,
+ visible: false
+ }
+ }, () => {
+ isRefresh && this.getSupplementaryList({
+ billMonth,
+ current: this.state.current,
+ paymentOrganization
+ });
+ });
+ }}
+ />
+ {/*核算进度条*/}
+ {
+ this.setState({ progressVisible: false, progress: 0 });
+ }}
+ progress={this.state.progress}
+ />
+ {/*导入弹框*/}
+ {
+ importParams.visible &&
+ {
+ this.setState({
+ fieldData
+ });
+ }}
onCancel={() => {
- this.setState({ progressVisible: false, progress: 0 });
+ this.setState({ importParams: { ...importParams, visible: false }, fieldData: {} }, () => {
+ const { billMonth, selectedKey, paymentOrganization } = this.props;
+ const { current } = this.state;
+ selectedKey === "1"
+ ? this.getNormalList({ billMonth, current, paymentOrganization })
+ : this.getSupplementaryList({ billMonth, current, paymentOrganization });
+ });
}}
- progress={this.state.progress}
+ isStandingBook
+ standingBookTabKey={selectedKey}
/>
- {
- this.props.type !== "detail" &&
-
- this.setState({ importParams: { ...importParams, visible: true } })}
- />
-
- }
- {/*导入弹框*/}
- {
- importParams.visible &&
- {
- this.setState({
- fieldData
- });
- }}
- onCancel={() => {
- this.setState({ importParams: { ...importParams, visible: false }, fieldData: {} }, () => {
- const { billMonth, selectedKey, paymentOrganization } = this.props;
- const { current } = this.state;
- selectedKey === "1"
- ? this.getNormalList({ billMonth, current, paymentOrganization })
- : this.getSupplementaryList({ billMonth, current, paymentOrganization });
- });
- }}
- isStandingBook
- standingBookTabKey={selectedKey}
- />
- }
-
-
-
-
- {
- this.setState({ searchValue: value });
- }}
- placeholder={"请输入姓名"}
- onSearch={value => {
- this.handleSearch(value);
- }}
- />
-
+ }
{/* table */}
-
+
-
+ {/*编辑弹框*/}
+
+ {
+ this.setState({
+ adjustSlide: {
+ ...adjustSlide,
+ visible: false
+ }
+ });
+ }}
+ />
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js
index 3ddebce6..015156ac 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js
@@ -7,7 +7,7 @@
import React, { Component } from "react";
import { Button, Icon, Spin, Tooltip } from "antd";
import { inject, observer } from "mobx-react";
-import { WeaTable } from "ecCom";
+import { WeaNewScroll, WeaTable } from "ecCom";
import "./index.less";
@inject("standingBookStore")
@@ -116,17 +116,19 @@ export default class OverViewIndex extends Component {
导出全部
{/* table */}
-
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js
index 82cad6e9..c311d035 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js
@@ -7,7 +7,7 @@
import React, { Component } from "react";
import { WeaDatePicker, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom";
import { Button, Modal } from "antd";
-import { Select } from "../../../ruleConfig";
+import RegSelect from "./regSelect";
import * as API from "../../../../apis/standingBook";
class RegAddEmployee extends Component {
@@ -30,33 +30,6 @@ class RegAddEmployee extends Component {
};
}
- componentDidMount() {
- this.getEmployeeListByTaxAgent();
- }
-
- getEmployeeListByTaxAgent = () => {
- const { returnPersonInfo, selectPersonInfo } = this.state;
- const payload = {
- pageNum: 1,
- pageSize: 10000,
- name: null
- };
- API.getEmployeeListByTaxAgent(payload).then(({ status, data }) => {
- if (status) {
- const { list } = data;
- this.setState({
- returnPersonInfo: {
- ...returnPersonInfo,
- employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username }))
- },
- selectPersonInfo: {
- ...selectPersonInfo,
- employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username }))
- }
- });
- }
- });
- };
handleReset = () => {
this.setState({
baseInfo: {
@@ -77,12 +50,6 @@ class RegAddEmployee extends Component {
handleSave = () => {
const { baseInfo, returnPersonInfo, selectPersonInfo } = this.state;
const { onSave } = this.props;
- const payload = {
- recessionMonthList: baseInfo.billMonth.split(","),
- projects: baseInfo.itemsAll ? ["0"] : baseInfo.items.split(","),
- includes: returnPersonInfo.employee.split(","),
- excludes: selectPersonInfo.employee.split(",")
- };
if (_.isEmpty(baseInfo.billMonth) || _.isEmpty(baseInfo.items) || _.isEmpty(returnPersonInfo.employee)) {
Modal.warning({
title: "信息确认",
@@ -90,6 +57,12 @@ class RegAddEmployee extends Component {
});
return;
}
+ const payload = {
+ recessionMonthList: baseInfo.billMonth.split(","),
+ projects: baseInfo.itemsAll ? ["0"] : baseInfo.items.split(","),
+ includes: returnPersonInfo.employee,
+ excludes: selectPersonInfo.employee
+ };
onSave(payload);
};
@@ -143,38 +116,26 @@ class RegAddEmployee extends Component {
];
const returnPersonItems = [
{
- com: Select({
- multiple: true,
- label: "对象",
- viewAttr: 3,
- showSearch: true,
- options: returnPersonInfo.employeeOptions,
- value: returnPersonInfo.employee,
- onChange: ({ selected }) => {
- this.setState({ returnPersonInfo: { ...returnPersonInfo, employee: selected } });
- }
- })
+ com: this.setState({ returnPersonInfo: { ...returnPersonInfo, employee: selected } })}
+ />
}
];
const selectPersonItems = [
{
- com: Select({
- multiple: true,
- label: "选择人员",
- viewAttr: 2,
- showSearch: true,
- options: selectPersonInfo.employeeOptions,
- value: selectPersonInfo.employee,
- onChange: ({ selected }) => {
- this.setState({ selectPersonInfo: { ...selectPersonInfo, employee: selected } });
- }
- })
+ com: this.setState({ selectPersonInfo: { ...selectPersonInfo, employee: selected } })}
+ />
}
];
return (
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js
index 2993e6fd..e904adb9 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js
@@ -28,6 +28,7 @@ class RegEditDetial extends Component {
render: (text, record) => {
return (
this.handleChange("social", item.dataIndex, v, record)}
@@ -50,6 +51,7 @@ class RegEditDetial extends Component {
render: (text, record) => {
return (
this.handleChange("fund", item.dataIndex, v, record)}
@@ -73,6 +75,7 @@ class RegEditDetial extends Component {
return (
this.handleChange("other", item.dataIndex, v, record)}
/>
@@ -107,16 +110,28 @@ class RegEditDetial extends Component {
otherComJson: {}
};
_.forEach(socialData.dataSource, item => {
- payload["socialPerJson"][item["insuranceId"]] = item.personalPaymentAmount || "0";
- payload["socialComJson"][item["insuranceId"]] = item.companyPaymentAmount || "0";
+ if (item.personalPaymentAmount) {
+ payload["socialPerJson"][item["insuranceId"]] = item.personalPaymentAmount;
+ }
+ if (item.companyPaymentAmount) {
+ payload["socialComJson"][item["insuranceId"]] = item.companyPaymentAmount;
+ }
});
_.forEach(foundData.dataSource, item => {
- payload["fundPerJson"][item["insuranceId"]] = item.personalPaymentAmount || "0";
- payload["fundComJson"][item["insuranceId"]] = item.companyPaymentAmount || "0";
+ if (item.personalPaymentAmount) {
+ payload["fundPerJson"][item["insuranceId"]] = item.personalPaymentAmount;
+ }
+ if (item.companyPaymentAmount) {
+ payload["fundComJson"][item["insuranceId"]] = item.companyPaymentAmount;
+ }
});
_.forEach(otherData.dataSource, item => {
- payload["otherPerJson"][item["insuranceId"]] = item.personalPaymentAmount || "0";
- payload["otherComJson"][item["insuranceId"]] = item.companyPaymentAmount || "0";
+ if (item.personalPaymentAmount) {
+ payload["otherPerJson"][item["insuranceId"]] = item.personalPaymentAmount;
+ }
+ if (item.companyPaymentAmount) {
+ payload["otherComJson"][item["insuranceId"]] = item.companyPaymentAmount;
+ }
});
_.forEach(Object.keys(payload), item => {
payload[item] = JSON.stringify(payload[item]);
@@ -126,7 +141,7 @@ class RegEditDetial extends Component {
this.setState({ loading: false });
if (status) {
message.success("保存成功");
- onCancel();
+ onCancel(true);
} else {
message.error(errormsg || "保存成功");
}
@@ -139,7 +154,7 @@ class RegEditDetial extends Component {
case "social":
const sociallist = _.map(socialData.dataSource, item => {
if (item.insuranceId === record.insuranceId) {
- return { ...item, [dataIndex]: !_.isNil(value) ? String(value): "0" };
+ return { ...item, [dataIndex]: !_.isNil(value) ? String(value) : "0" };
}
return { ...item };
});
@@ -150,7 +165,7 @@ class RegEditDetial extends Component {
case "fund":
const fundlist = _.map(foundData.dataSource, item => {
if (item.insuranceId === record.insuranceId) {
- return { ...item, [dataIndex]: !_.isNil(value) ? String(value): "0" };
+ return { ...item, [dataIndex]: !_.isNil(value) ? String(value) : "0" };
}
return { ...item };
});
@@ -161,7 +176,7 @@ class RegEditDetial extends Component {
case "other":
const otherlist = _.map(otherData.dataSource, item => {
if (item.insuranceId === record.insuranceId) {
- return { ...item, [dataIndex]: !_.isNil(value) ? String(value): "0" };
+ return { ...item, [dataIndex]: !_.isNil(value) ? String(value) : "0" };
}
return { ...item };
});
@@ -255,7 +270,7 @@ class RegEditDetial extends Component {
}
}
- onClose={onCancel}
+ onClose={() => onCancel()}
showMask={true}
/>
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js
index 94d6ebad..849cb407 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js
@@ -5,11 +5,16 @@
* Date: 2022/11/23
*/
import React, { Component } from "react";
-import { WeaTable } from "ecCom";
+import { Spin } from "antd";
import { getQueryString } from "../../../../util/url";
import * as API from "../../../../apis/standingBook";
import "./index.less";
+const APIFox = {
+ "regression": API.recessionList,
+ "difference": API.balanceList
+};
+
class RegList extends Component {
constructor(props) {
super(props);
@@ -20,6 +25,7 @@ class RegList extends Component {
loading: {
query: false
},
+ datalistPayload: {},
pageInfo: {
current: 1,
pageSize: 10,
@@ -30,23 +36,62 @@ class RegList extends Component {
componentDidMount() {
this.recessionList();
+ window.addEventListener("message", this.handleReceive, false);
}
+ handleReceive = async ({ data }) => {
+ const { onEdit, onChangeRowkey } = this.props;
+ const { type, payload: { id, params } = {} } = data;
+ if (type === "init") {
+ this.postMessageToChild();
+ } else if (type === "turn") {
+ if (id === "PAGEINFO") {
+ const { pageNum: current, size: pageSize } = params;
+ this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList());
+ } else if (id === "ROWSELECT") {
+ const { selectedRowKeys } = params;
+ this.setState({ selectedRowKeys });
+ onChangeRowkey(selectedRowKeys);
+ } else if (id === "EDIT") {
+ onEdit(params);
+ }
+ }
+ };
+ postMessageToChild = () => {
+ const paymentStatus = this.props.type === "difference" ? "4" : "3";
+ const creator = Number(getQueryString("creator"));
+ const billMonth = getQueryString("billMonth");
+ const paymentOrganization = getQueryString("paymentOrganization");
+ const childFrameObj = document.getElementById("atdTable");
+ const { pageInfo, dataSource, columns, selectedRowKeys, datalistPayload } = this.state;
+ childFrameObj.contentWindow.postMessage(JSON.stringify({
+ dataSource, columns, pageInfo,
+ selectedRowKeys, selectedKey: this.props.type,
+ sumpayload: { billMonth, paymentOrganization, creator, paymentStatus, ...datalistPayload },
+ showOperates: !getQueryString("type")
+ }), "*");
+ };
+
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible) {
this.recessionList();
}
}
+ componentWillUnmount() {
+ window.removeEventListener("message", this.handleReceive, false);
+ }
+
handleResetSelectRowKeys = (selectedRowKeys) => {
this.setState({ selectedRowKeys });
};
- recessionList = (module = {}) => {
+ recessionList = (module) => {
+ const { type } = this.props;
const { loading, pageInfo } = this.state;
const billMonth = getQueryString("billMonth");
const paymentOrganization = getQueryString("paymentOrganization");
const creator = Number(getQueryString("creator"));
- const paymentStatus = "3";
+ const paymentStatus = type === "difference" ? "4" : "3";
const payload = {
billMonth, paymentStatus,
creator, paymentOrganization,
@@ -54,7 +99,7 @@ class RegList extends Component {
...module
};
this.setState({ loading: { ...loading, query: true } });
- API.recessionList(payload).then(({ status, data }) => {
+ APIFox[type](payload).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
const { pageInfo: list } = data;
@@ -62,95 +107,26 @@ class RegList extends Component {
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource,
- columns: _.map(_.filter(columns, it => it.dataIndex !== "id"), items => {
- if (items.dataIndex === "employeeId") {
- return {
- ...items,
- width: 110,
- title: "姓名",
- fixed: "left",
- render: (text, r) => {
- const { userName } = r;
- return (
- {userName}
- );
- }
- };
- }
- return {
- ...items,
- title: ,
- width: 120,
- render: (text) => {
- return {text};
- }
- };
- })
- });
+ columns,
+ datalistPayload: module
+ }, () => this.postMessageToChild());
}
}).catch(() => {
this.setState({ loading: { ...loading, query: false } });
});
};
- handleChangeRow = (selectedRowKeys) => {
- const { onChangeRowkey } = this.props;
- this.setState({ selectedRowKeys });
- onChangeRowkey(selectedRowKeys);
- };
render() {
- const { loading, pageInfo, selectedRowKeys, dataSource, columns } = this.state;
- const { onEdit } = this.props;
- const pagination = {
- ...pageInfo,
- showTotal: total => `共 ${total} 条`,
- showQuickJumper: true,
- showSizeChanger: true,
- pageSizeOptions: ["10", "20", "50", "100"],
- onShowSizeChange: (current, pageSize) => {
- this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => {
- this.recessionList();
- });
- },
- onChange: (current) => {
- this.setState({ pageInfo: { ...pageInfo, current } }, () => {
- this.recessionList();
- });
- }
- };
- const rowSelection = {
- selectedRowKeys,
- onChange: this.handleChangeRow
- };
+ const { loading } = this.state;
return (
- {
- return (
-
- );
- }
- }
- ]}
- dataSource={dataSource}
- loading={loading.query}
- pagination={pagination}
- rowSelection={rowSelection}
- scroll={{ x: 900 }}
- />
+
+
+
);
}
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js
new file mode 100644
index 00000000..7155f9b4
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js
@@ -0,0 +1,162 @@
+/*
+ * Author: 黎永顺
+ * name: 退差人员选择弹框
+ * Description:
+ * Date: 2022/11/25
+ */
+import React, { Component } from "react";
+import { Button, Tag } from "antd";
+import { WeaDialog, WeaFormItem, WeaInputSearch, WeaTable } from "ecCom";
+import * as API from "../../../../apis/standingBook";
+import "./index.less";
+
+class RegSelect extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ userName: "",
+ visible: false,
+ loading: false,
+ selectedRowKeys: [],
+ selectedRow: [],
+ dataSource: [],
+ pageInfo: {
+ pageNum: 1,
+ pageSize: 10,
+ total: 0
+ }
+ };
+ }
+
+ getEmployeeListByTaxAgent = (params = {}) => {
+ const { pageInfo } = this.state;
+ const payload = {
+ ...pageInfo,
+ ...params
+ };
+ this.setState({ loading: true });
+ API.getEmployeeListByTaxAgent(payload).then(({ status, data }) => {
+ this.setState({ loading: false });
+ if (status) {
+ const { list: dataSource, pageNum, pageSize, total } = data;
+ this.setState({
+ dataSource,
+ pageInfo: { ...pageInfo, pageNum, pageSize, total }
+ });
+ }
+ });
+ };
+ handleSave = () => {
+ const { onChange } = this.props;
+ this.setState({
+ visible: false
+ }, () => {
+ const { selectedRowKeys } = this.state;
+ onChange({ selected: selectedRowKeys });
+ });
+ };
+ handleClose = (key) => {
+ const { onChange } = this.props;
+ const { selectedRow } = this.state;
+ this.setState({
+ selectedRow: _.filter(selectedRow, it => it.employeeId !== key)
+ }, () => {
+ const { selectedRow } = this.state;
+ this.setState({
+ selectedRowKeys: _.map(selectedRow, it => it.employeeId)
+ });
+ onChange({ selected: _.map(selectedRow, it => it.employeeId) });
+ });
+ };
+
+ render() {
+ const { visible, loading, dataSource, pageInfo, selectedRowKeys, selectedRow, userName } = this.state;
+ const { label, viewAttr } = this.props;
+ const pagination = {
+ current: pageInfo.pageNum,
+ pageSize: pageInfo.pageSize,
+ total: pageInfo.total,
+ showTotal: total => `共 ${total} 条`,
+ showQuickJumper: true,
+ onChange: (current) => {
+ this.setState({ pageInfo: { ...pageInfo, pageNum: current } }, () => {
+ this.getEmployeeListByTaxAgent();
+ });
+ }
+ };
+ const rowSelection = {
+ selectedRowKeys: selectedRowKeys,
+ onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }),
+ onSelect: (record, selected) => {
+ if (selected) {
+ this.setState({ selectedRow: [...selectedRow, record] });
+ } else {
+ this.setState({ selectedRow: _.xorWith(selectedRow, [record], _.isEqual) });
+ }
+ },
+ onSelectAll: (selected, selectedRows, changeRows) => {
+ this.setState({ selectedRow: _.xorWith(selectedRow, changeRows, _.isEqual) });
+ }
+ };
+ const buttons = [
+ 保存,
+ this.setState({ visible: false })}>取消
+ ];
+ return (
+
+
+ {selectedRow.map(tag =>
+ this.handleClose(tag.employeeId)}>
+ {tag.username}
+
+ )}
+ this.setState({ visible: true }, () => this.getEmployeeListByTaxAgent())}
+ >添加人员
+ {
+ _.isEmpty(selectedRow) && viewAttr === 3 &&
+
+
+
+ }
+
+
this.setState({ visible: false })}
+ title="人员"
+ visible={visible}
+ loading={loading}
+ style={{ width: 680, height: 500 }}
+ hasScroll
+ buttons={buttons}
+ >
+
+ this.setState({ userName })}
+ onSearch={() => this.getEmployeeListByTaxAgent({ userName })}
+ />
+
+
+
+
+ );
+ }
+}
+
+export default RegSelect;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js
index 96107ed0..8971946d 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js
@@ -1,19 +1,21 @@
import React, { Component } from "react";
import { Button } from "antd";
-import { WeaHelpfulTip, WeaInputSearch, WeaTop } from "ecCom";
+import { WeaFormItem, WeaHelpfulTip, WeaInput, WeaSearchGroup, WeaTab } from "ecCom";
import { getQueryString } from "../../../../util/url";
class RegTop extends Component {
constructor(props) {
super(props);
this.state = {
- name: ""
+ name: "",
+ workcode: "",
+ showSearchAd: false
};
}
renderTopBtns = () => {
const { name } = this.state;
- const { onChange, selectKey } = this.props;
+ const { onChange, selectKey, type: regtopType } = this.props;
const type = getQueryString("type");
let dom = [
,
- onChange("export")}>
-
- ,
- this.setState({ name })}
- onSearch={() => onChange("search")}
- />
+ onChange("export")}>导出全部
];
if (!type) {
const [dom1, ...extra] = dom;
+ const domBtn = regtopType === "regression" ?
+ onChange("add")}>添加 :
+ onChange("import")}>导入;
dom = [
dom1,
- onChange("delete")}>
-
- ,
- onChange("add")}>
-
- ,
- ...extra
+ onChange("delete")}>
+ 删除
+ , domBtn, ...extra
];
}
return dom;
};
+ getSearchs = () => {
+ return
+
+ this.setState({ workcode: v })}
+ />
+
+ ;
+ };
render() {
- const { billMonth } = this.props;
+ const { showSearchAd } = this.state;
+ const { billMonth, onChange } = this.props;
return (
- 账单月份{billMonth}}
- buttons={this.renderTopBtns()}
+ this.setState({ showSearchAd: bool })}
+ onSearchChange={name => this.setState({ name })}
+ buttons={this.renderTopBtns()} onSearch={() => onChange("search")} onAdSearch={() => onChange("search")}
+ onAdReset={() => this.setState({ workcode: "" })} searchsBasePlaceHolder="请输入员工姓名"
/>
+ // 账单月份{billMonth}}
+ // buttons={this.renderTopBtns()}
+ // />
);
}
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js
index ac795562..4b4e790d 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js
@@ -6,6 +6,7 @@
*/
import React, { Component } from "react";
import { message, Modal } from "antd";
+import { WeaNewScroll } from "ecCom";
import RegTop from "./regTop";
import RegList from "./regList";
import RegAddEmployee from "./regAddEmployee";
@@ -73,6 +74,7 @@ class Regression extends Component {
handleChangeOpt = (key) => {
const { returnPersonModal } = this.state;
const name = this.regTopRef.state.name;
+ const workcode = this.regTopRef.state.workcode;
const billMonth = getQueryString("billMonth");
const creator = Number(getQueryString("creator"));
const paymentOrganization = getQueryString("paymentOrganization");
@@ -96,19 +98,20 @@ class Regression extends Component {
window.open(url, "_self");
break;
case "search":
- this.regListRef.recessionList({ userName: name });
+ this.regListRef.recessionList({ userName: name, workcode, current: 1 });
break;
default:
break;
}
};
- handleCloseModal = () => {
+ handleCloseModal = (refreshList = false) => {
const { returnPersonModal, returnEditPersonSlide } = this.state;
this.setState({
returnPersonModal: { ...returnPersonModal, visible: false, title: "添加退差人员" },
returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
}, () => {
this.regEmmployeeRef.handleReset();
+ refreshList && this.regListRef.recessionList();
});
};
handleEdit = (record) => {
@@ -125,27 +128,33 @@ class Regression extends Component {
return (
this.regTopRef = dom}
billMonth={billMonth}
onChange={this.handleChangeOpt}
selectKey={selectKey}
/>
- this.regListRef = dom}
- visible={returnPersonModal.visible}
- onChangeRowkey={(selectKey) => this.setState({ selectKey })}
- onEdit={this.handleEdit}
- />
- {/*编辑弹框*/}
-
- {/* 弹框 */}
- this.regEmmployeeRef = dom}
- {...returnPersonModal}
- loading={loading}
- onCancel={this.handleCloseModal}
- onSave={this.handleSave}
- />
+
+ {/**/}
+ this.regListRef = dom}
+ visible={returnPersonModal.visible}
+ onChangeRowkey={(selectKey) => this.setState({ selectKey })}
+ onEdit={this.handleEdit}
+ />
+ {/*编辑弹框*/}
+
+ {/* 弹框 */}
+ this.regEmmployeeRef = dom}
+ {...returnPersonModal}
+ loading={loading}
+ onCancel={this.handleCloseModal}
+ onSave={this.handleSave}
+ />
+ {/**/}
+
);
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js
new file mode 100644
index 00000000..4beb586f
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js
@@ -0,0 +1,433 @@
+/*
+ * Author: 黎永顺
+ * name: 添加补缴
+ * Description:
+ * Date: 2022/12/30
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { message, Modal } from "antd";
+import { WeaFormItem, WeaSearchGroup, WeaSelect, WeaSlideModal } from "ecCom";
+import SlideModalTitle from "../../../../components/slideModalTitle";
+import { Picker, SelectWithAll } from "./regAddEmployee";
+import { Browser } from "../../../dataAcquisition/addItems";
+import { getPaymentGroup, getSupplementPaymentForm, siaccountSupplementarySave } from "../../../../apis/standingBook";
+import "./index.less";
+import BusinessAccounting from "./businessAccounting";
+import InputPaymentAmount from "./inputPaymentAmount";
+
+@inject("taxAgentStore")
+@observer
+class SupplementarySlide extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false,
+ baseInfo: {
+ includes: "",
+ includeNames: "",
+ supplementType: "1",
+ projectsAll: "",
+ projects: "",
+ billMonthList: "",
+ historyMonth: ""
+ },
+ businessAccounting: {
+ socialSecurityBase: [],
+ fundBase: [],
+ otherBase: []
+ },
+ inputPaymentAmount: {
+ socialPayment: [],
+ fundPayment: [],
+ otherPayment: []
+ }
+ };
+ }
+
+ /*
+ * Author: 黎永顺
+ * Description: 按补缴人员的历史月份核算基数和当前档案方案核算 数据转换
+ * Params: socialSecurityBase fundBase otherBase
+ * Date: 2023/1/3
+ */
+ convertBusinessAccounting = () => {
+ let payload = { socialPaymentBaseString: {}, fundPaymentBaseString: {}, otherPaymentBaseString: {} };
+ const { businessAccounting } = this.state;
+ _.map(Object.keys(businessAccounting), item => {
+ _.map(businessAccounting[item], child => {
+ const key = child.insuranceId, value = child.insuranceBase;
+ _.assign(
+ payload[item === "socialSecurityBase" ? "socialPaymentBaseString" : item === "fundBase" ? "fundPaymentBaseString" : "otherPaymentBaseString"],
+ { [key]: value ? value.toString() : "0" }
+ );
+ });
+ });
+ for (let i in payload) {
+ _.assign(payload, { [i]: JSON.stringify(payload[i]) });
+ }
+ return payload;
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 动输入补缴金额数据整改
+ * Params:
+ * Date: 2023/1/3
+ */
+ convertInputPaymentAmount = () => {
+ let payload = {
+ socialPaymentPerString: {},
+ socialPaymentComString: {},
+ fundPaymentPerString: {},
+ fundPaymentComString: {},
+ otherPaymentPerString: {},
+ otherPaymentComString: {}
+ };
+ const { inputPaymentAmount } = this.state;
+ _.map(Object.keys(inputPaymentAmount), item => {
+ _.map(inputPaymentAmount[item], child => {
+ const key = child.insuranceId, valuePer = child[`${child.insuranceId}_per`],
+ valueCom = child[`${child.insuranceId}_com`];
+ _.assign(payload[`${item}PerString`], { [key]: valuePer ? valuePer.toString() : "0" });
+ _.assign(payload[`${item}ComString`], { [key]: valueCom ? valueCom.toString() : "0" });
+ });
+ });
+ for (let i in payload) {
+ _.assign(payload, { [i]: JSON.stringify(payload[i]) });
+ }
+ return payload;
+ };
+ convertData = (dataSource) => {
+ let endList = [];
+ _.values(_.groupBy(dataSource, "insuranceName")).forEach((itemList) => {
+ let data = {};
+ itemList.forEach(d => {
+ const perKey = `${d.insuranceId}_per`, comKey = `${d.insuranceId}_com`;
+ data = _.assign(data, {
+ ...d,
+ [perKey]: "",
+ [comKey]: ""
+ });
+ });
+ return endList.push(data);
+ });
+ return endList;
+ };
+ handleSaveSupplementSalary = () => {
+ const { billMonth, paymentOrganization, onCancel } = this.props;
+ const { baseInfo } = this.state;
+ const { supplementType, projects, projectsAll, billMonthList, includes, historyMonth } = baseInfo;
+ if (!projects || !billMonthList || !includes) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ if (supplementType === "2" && !historyMonth) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ const payload = {
+ supplementType,
+ projects: projectsAll.split(",").concat(projects.split(",")),
+ billMonth,
+ paymentOrganization,
+ billMonthList: billMonthList.split(","),
+ includes: includes.split(","),
+ ...this.convertBusinessAccounting(),
+ ...this.convertInputPaymentAmount()
+ };
+ this.setState({ loading: true });
+ siaccountSupplementarySave(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ onCancel(true);
+ this.handleResetForm();
+ } else {
+ message.error(errormsg || "接口调用失败!");
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+ handleResetForm = () => {
+ this.setState({
+ baseInfo: {
+ includes: "",
+ includeNames: "",
+ supplementType: "1",
+ projectsAll: "",
+ projects: "",
+ billMonthList: ""
+ },
+ businessAccounting: {
+ socialSecurityBase: [],
+ fundBase: [],
+ otherBase: []
+ }
+ });
+ };
+ handleChangeItem = () => {
+ const { paymentOrganization } = this.props;
+ const { baseInfo } = this.state;
+ const { supplementType, includes, projects, projectsAll, historyMonth } = baseInfo;
+ if (supplementType === "2") {
+ if (includes && (projects || projectsAll) && historyMonth) {
+ const payload = {
+ billMonth: historyMonth,
+ paymentOrganization: Number(paymentOrganization),
+ employeeId: Number(includes),
+ projects: projectsAll ? projectsAll.split(",").concat(projects.split(",")) : projects.split(",")
+ };
+ getSupplementPaymentForm(payload).then(({ status, data, errormsg }) => {
+ if (status) {
+ this.setState({
+ businessAccounting: {
+ socialSecurityBase: _.filter(data, it => it.title === "社保"),
+ fundBase: _.filter(data, it => it.title === "公积金"),
+ otherBase: _.filter(data, it => it.title === "企业年金及其它福利")
+ }
+ });
+ } else {
+ message.error(errormsg || "");
+ this.setState({
+ baseInfo: { ...baseInfo, historyMonth: "" },
+ businessAccounting: {
+ socialSecurityBase: [],
+ fundBase: [],
+ otherBase: []
+ }
+ });
+ }
+ });
+ }
+ } else if (supplementType === "3") {
+ if (includes && (projects || projectsAll)) {
+ const payload = {
+ paymentOrganization: Number(paymentOrganization),
+ employeeId: Number(includes),
+ projects: projectsAll ? projectsAll.split(",").concat(projects.split(",")) : projects.split(",")
+ };
+ getPaymentGroup(payload).then(({ status, data, errormsg }) => {
+ if (status) {
+ this.setState({
+ inputPaymentAmount: {
+ socialPayment: this.convertData(_.filter(data, it => it.title === "社保")),
+ fundPayment: this.convertData(_.filter(data, it => it.title === "公积金")),
+ otherPayment: this.convertData(_.filter(data, it => it.title === "企业年金及其它福利"))
+ }
+ });
+ } else {
+ message.error(errormsg || "");
+ this.setState({
+ inputPaymentAmount: {
+ socialPayment: [],
+ fundPayment: [],
+ otherPayment: []
+ }
+ });
+ }
+ });
+ }
+ }
+ };
+ handleChangeBaseFieldItem = (socialSecurityBase, fundBase, otherBase) => {
+ this.setState({
+ businessAccounting: { socialSecurityBase, fundBase, otherBase }
+ });
+ };
+ handleChangeInputItem = (socialPayment, fundPayment, otherPayment) => {
+ this.setState({
+ inputPaymentAmount: { socialPayment, fundPayment, otherPayment }
+ });
+ };
+
+ render() {
+ const { title, visible, onCancel, taxAgentStore: { showOperateBtn } } = this.props;
+ const { baseInfo, loading, businessAccounting, inputPaymentAmount } = this.state;
+ const baseItems = [
+ {
+ com: Browser({
+ label: "对象",
+ viewAttr: 3,
+ value: baseInfo.includes,
+ valueSpan: baseInfo.includeNames,
+ onChange: ({ ids, names }) => {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ includes: ids,
+ includeNames: names
+ }
+ }, () => this.handleChangeItem());
+ }
+ })
+ },
+ {
+ com: Picker({
+ label: "补缴月份",
+ value: baseInfo.billMonthList,
+ onChange: (billMonthList) => {
+ this.setState({ baseInfo: { ...baseInfo, billMonthList } });
+ }
+ })
+ },
+ {
+ com: SelectWithAll({
+ label: "补缴项目",
+ options: [
+ { key: "1", showname: "社保" },
+ { key: "2", showname: "公积金" },
+ { key: "3", showname: "企业年金及其他福利" },
+ { key: "4", showname: "养老保险" },
+ { key: "5", showname: "医疗保险" }
+ ],
+ detailtype: 2,
+ valueAll: baseInfo.projectsAll,
+ value: baseInfo.projects,
+ onChangeAll: ({ selected }) => {
+ if (selected) {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ projectsAll: selected,
+ projects: "1,2,3,4,5"
+ }
+ }, () => this.handleChangeItem());
+ } else {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ projectsAll: selected,
+ projects: ""
+ }
+ }, () => this.handleChangeItem());
+ }
+ },
+ onChange: ({ selected }) => {
+ const bool1 = selected.split(",").includes("1");
+ const bool2 = selected.split(",").includes("2");
+ const bool3 = selected.split(",").includes("3");
+ const bool4 = selected.split(",").includes("4");
+ const bool5 = selected.split(",").includes("5");
+ if (bool1 && bool2 && bool3 && bool4 && bool5) {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ projectsAll: "0",
+ projects: selected
+ }
+ }, () => this.handleChangeItem());
+ } else {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ projectsAll: "",
+ projects: selected
+ }
+ }, () => this.handleChangeItem());
+ }
+ }
+ })
+ },
+ {
+ com: SelectDetailType({
+ label: "补缴金额核算方式",
+ options: [
+ { key: "1", showname: "按补缴人员当前档案基数及方案核算" },
+ { key: "2", showname: "按补缴人员的历史月份核算基数和当前档案方案核算" },
+ { key: "3", showname: "手动输入补缴金额" }
+ ],
+ detailtype: 3,
+ value: baseInfo.supplementType,
+ onChange: ({ selected: supplementType }) => {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ supplementType,
+ historyMonth: ""
+ }
+ }, () => this.handleChangeItem());
+ }
+ })
+ }
+ ];
+ const baseExtraItems = [
+ {
+ com: Picker({
+ label: "补缴基数参考月份",
+ value: baseInfo.historyMonth,
+ onChange: (historyMonth) => {
+ this.setState({ baseInfo: { ...baseInfo, historyMonth } }, () => this.handleChangeItem());
+ }
+ })
+ }
+ ];
+ return (
+
+ }
+ content={
+
+
+ {/* 按补缴人员的历史月份核算基数和当前档案方案核算 */}
+ {
+ baseInfo.supplementType === "2" &&
+
+ }
+ {/* 动输入补缴金额 */}
+ {
+ baseInfo.supplementType === "3" &&
+
+ }
+
+ }
+ onClose={() => {
+ onCancel();
+ this.handleResetForm();
+ }}
+ />
+ );
+ }
+}
+
+export default SupplementarySlide;
+
+export const SelectDetailType = payload => {
+ const { label, onChange, value, options = [], viewAttr = 3, detailtype = 1 } = payload;
+ return (
+
+ onChange({ type: label, selected, showName })}
+ style={{ width: "60%" }}
+ />
+
+ );
+};
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js
index 75b41a1b..a5ae1a93 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js
@@ -11,6 +11,7 @@ import NormalIndex from "./components/normal";
import OverViewIndex from "./components/overView";
import AbnormalListIndex from "./components/abnormalList";
import Regression from "./components/regression";
+import MakeupDifference from "./components/makeupDifference";
@inject("standingBookStore")
@observer
@@ -39,7 +40,7 @@ class StandingBookDetail extends Component {
getTabList({ billMonth, paymentOrganization: this.paymentOrganization }).then(({ data }) => {
const { tabList, remarks, billMonth } = data;
let newTabList = tabList.filter(item => item.id != "2");
- newTabList[newTabList.length - 2] = newTabList.splice(newTabList.length - 1, 1, newTabList[newTabList.length - 2])[0]
+ newTabList.push(newTabList.splice(_.findIndex(newTabList, it => it.id === "4"), 1)[0]);
this.setState({
selectedKey: newTabList[0].id,
tabList: _.map(newTabList, it => ({ title: it.content, viewcondition: it.id })),
@@ -74,7 +75,10 @@ class StandingBookDetail extends Component {
}
{
- selectedKey === "5" &&
+ selectedKey === "5" &&
+ }
+ {
+ selectedKey === "6" &&
}
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookOfflineComparison/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookOfflineComparison/index.js
index 00e6d513..f6d366d1 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookOfflineComparison/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookOfflineComparison/index.js
@@ -59,12 +59,13 @@ class StandingBookOfflineComparison extends Component {
width: 150,
fixed: idx < 2 ? "left" : false,
render: (text, record) => {
+ const { acctResultValue, excelResultValue } = record[it.dataIndex] || {};
if (Object.prototype.toString.call(text) === "[object Object]") {
return
- 系统值:{record[it.dataIndex].acctResultValue || 0}
- 线下值:{record[it.dataIndex].excelResultValue || 0}
+ 系统值:{acctResultValue}
+ 线下值:{excelResultValue}
- 差值:{calculateCompares(record[it.dataIndex].acctResultValue, record[it.dataIndex].excelResultValue)}
+ 差值:{calculateCompares(acctResultValue, excelResultValue)}
;
}
@@ -77,13 +78,13 @@ class StandingBookOfflineComparison extends Component {
}
});
};
- handleExport= ()=> {
+ handleExport = () => {
const billMonth = getQueryString("billMonth");
const paymentOrganization = getQueryString("paymentOrganization");
const { onlyDiffEmployee } = this.state;
- let url= `/api/bs/hrmsalary/siaccount/comparisonresult/export?paymentStatus=0&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}&onlyDiffEmployee=${onlyDiffEmployee === "1"}`;
- window.open(`${window.location.origin}${url}`)
- }
+ let url = `/api/bs/hrmsalary/siaccount/comparisonresult/export?paymentStatus=0&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}&onlyDiffEmployee=${onlyDiffEmployee === "1"}`;
+ window.open(`${window.location.origin}${url}`);
+ };
render() {
const { onlyDiffEmployee, showSearchAd, pageInfo, dataSource, columns, loading, importVisible } = this.state;
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/columns.js b/pc4mobx/hrmSalary/pages/taxAgent/columns.js
index 41d53435..c9326873 100644
--- a/pc4mobx/hrmSalary/pages/taxAgent/columns.js
+++ b/pc4mobx/hrmSalary/pages/taxAgent/columns.js
@@ -1,25 +1,52 @@
export const columns = [
- {
- title: "序号",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "个税扣缴义务人",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "备注",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "操作",
- dataIndex: 'title',
- key: 'title',
- }
-]
+ {
+ title: "序号",
+ dataIndex: "title",
+ key: "title"
+ },
+ {
+ title: "个税扣缴义务人",
+ dataIndex: "title",
+ key: "title"
+ },
+ {
+ title: "备注",
+ dataIndex: "title",
+ key: "title"
+ },
+ {
+ title: "操作",
+ dataIndex: "title",
+ key: "title"
+ }
+];
+export const importEmployColumns = [
+ {
+ title: "姓名",
+ dataIndex: "username",
+ key: "username"
+ },
+ {
+ title: "部门",
+ dataIndex: "departmentName",
+ key: "departmentName"
+ },
+ {
+ title: "工号",
+ dataIndex: "jobNum",
+ key: "jobNum"
+ },
+ {
+ title: "手机号",
+ dataIndex: "mobile",
+ key: "mobile"
+ },
+ {
+ title: "员工状态",
+ dataIndex: "employeeStatus",
+ key: "employeeStatus"
+ },
+];
export const dataSource = [];
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/editConditions.js b/pc4mobx/hrmSalary/pages/taxAgent/editConditions.js
index 661859ab..2f10ce9b 100644
--- a/pc4mobx/hrmSalary/pages/taxAgent/editConditions.js
+++ b/pc4mobx/hrmSalary/pages/taxAgent/editConditions.js
@@ -49,6 +49,16 @@ export const editConditions = [
labelcol: 6,
viewAttr: 3,
},
+ {
+ colSpan: 1,
+ conditionType: "INPUTNUMBER",
+ domkey: ["sortedIndex"],
+ fieldcol: 14,
+ label: "显示顺序",
+ labelcol: 6,
+ value: "",
+ viewAttr: 2,
+ },
{
colSpan: 1,
conditionType: "TEXTAREA",
@@ -77,6 +87,16 @@ export const decentralizationConditions = [
value: "",
viewAttr: 3,
},
+ {
+ colSpan: 1,
+ conditionType: "INPUTNUMBER",
+ domkey: ["sortedIndex"],
+ fieldcol: 14,
+ label: "显示顺序",
+ labelcol: 6,
+ value: "",
+ viewAttr: 2,
+ },
{
colSpan: 1,
conditionType: "TEXTAREA",
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/editModal.js b/pc4mobx/hrmSalary/pages/taxAgent/editModal.js
index 3b46493e..478776d9 100644
--- a/pc4mobx/hrmSalary/pages/taxAgent/editModal.js
+++ b/pc4mobx/hrmSalary/pages/taxAgent/editModal.js
@@ -65,6 +65,7 @@ export default class EditModal extends React.Component {
labelCol={{ span: `${field.labelcol}` }}
error={devolutionStatus === 1 ? form.getError(field) : formDecentralization.getError(field)}
tipPosition="bottom"
+ underline
wrapperCol={{ span: `${field.fieldcol}` }}>
this.setState({ name })}
- onSearch={() => getTaxAgentList({name})}
+ onSearch={() => getTaxAgentList({ name, current: 1 })}
/>
];
const renderTipsLabel = () => {
@@ -356,22 +357,11 @@ export default class TaxAgent extends React.Component {
onClick={() => this.showEditModal(record.id)}>
编辑
- {/**/}
- {/* */}
- {/* this.deleteTaxAgent(record.id)}>*/}
- {/* 删除*/}
- {/* */}
- {/* */}
- {/* */}
- {/* }>*/}
- {/* */}
- {/* */}
- {/* */}
- {/**/}
+ this.deleteTaxAgent(record.id)}>
+ 删除
+
}
],
@@ -398,60 +388,58 @@ export default class TaxAgent extends React.Component {
);
return (
-