Merge branch 'release/2.9.10.2312.02' into custom/陕西万众-薪资账套薪资核算配置

# Conflicts:
#	pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js
This commit is contained in:
黎永顺 2024-01-10 14:46:15 +08:00
commit 29f8606b2f
41 changed files with 2743 additions and 209 deletions

View File

@ -5,6 +5,10 @@ import { postFetch } from "../util/request";
export const getArchiveList = params => {
return postFetch("/api/bs/hrmsalary/salaryArchive/list", params);
};
//薪资档案的高级搜索
export const getSaCondition = params => {
return WeaTools.callApi("/api/bs/hrmsalary/archives/getSearchCondition", "get", params);
};
//薪资档案-获取薪资档案详情表单
export const getArchiveForm = params => {
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getForm", "get", params);
@ -100,7 +104,3 @@ export const getSingleSalaryItemInfo = (params) => {
export const editSingleSalaryItem = (params) => {
return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem", params);
};
// 基数调整记录列表
export const getAdjustHistoryList = (params) => {
return postFetch("/api/bs/hrmsalary/archives/getAdjustHistoryList", params);
};

View File

@ -105,5 +105,8 @@ export const exportArchives = (ids) => {
window.URL.revokeObjectURL(url);
}));
};
// 基数调整记录列表
export const getAdjustHistoryList = (params) => {
return postFetch("/api/bs/hrmsalary/archives/getAdjustHistoryList", params);
};

View File

@ -25,10 +25,10 @@ class Index extends Component {
<div className="bill-info-header">
<div className="title">{theme || ""}</div>
<div className="time">{moment().format("YYYY-MM-DD HH:mm:ss")}</div>
{
background &&
<div className="img"><img src={`${background}`} alt="logo"/></div>
}
{/*{*/}
{/* background &&*/}
{/* <div className="img"><img src={`${background}`} alt="logo"/></div>*/}
{/*}*/}
</div>
{
!onlyOneGrup && tipPosi === "1" && tip &&

View File

@ -17,10 +17,10 @@ class Content extends Component {
<div className="header-salary-date-time">{moment(sendTime).format("YYYY-MM-DD HH:mm:ss")}</div>
</div>
<div className="body">
{
background &&
<div className="comp-img"><img src={`${background}`} alt="logo"/></div>
}
{/*{*/}
{/* background &&*/}
{/* <div className="comp-img"><img src={`${background}`} alt="logo"/></div>*/}
{/*}*/}
{
!onlyOneGrup && tipPosi.toString() === "1" && tip &&
<div className="corporate-culture-text" title={tip}>{tip}</div>

View File

@ -4,7 +4,8 @@ import { WeaLocaleProvider } from "ecCom";
import MySalaryMobile from "./pages/mySalaryMobile";
import MySalary from "./pages/mySalaryBenefits";
import Programme from "./pages/socialSecurityBenefits/programme";
import Archives from "./pages/socialSecurityBenefits/archives";
import Archivess from "./pages/socialSecurityBenefits/archives";
import Archives from "./pages/socialSecurityBenefits/welfareArchive"; //社保福利档案重构页面
import StandingBook from "./pages/socialSecurityBenefits/standingBook";
import StandingBookDetail from "./pages/socialSecurityBenefits/standingBookDetail";
import StandingBookOfflineComparison from "./pages/socialSecurityBenefits/standingBookOfflineComparison";
@ -22,7 +23,8 @@ import Calculate from "./pages/calculate/calculate"; //重构的薪资核算页
import Payroll from "./pages/payrollRelease"; //重构的工资单发放页面
import PayrollGrant from "./pages/payroll/payrollGrant";
import PayrollDetail from "./pages/payroll/payrollDetail";
import Declare from "./pages/declare";
// import Declare from "./pages/declare";
import Declare from "./pages/declare/declare"; //重构的个税申报表
import TaxRate from "./pages/taxRate";
import TaxAgent from "./pages/taxAgent";
import CalculateDetail from "./pages/calculateDetail";
@ -46,6 +48,7 @@ import MySalaryView from "./pages/mySalary/mySalaryView";
import WatermarkPreview from "./pages/payroll/watermarkPreview";
import ExternalPersonManage from "./pages/externalPersonManage";
import AdjustSalaryManage from "./pages/adjustSalaryManage";
import TopologyMap from "./pages/topologyMap";
import stores from "./stores";
import "./style/index";
@ -117,6 +120,7 @@ const Routes = (
component={SocialSecurityBenefits}>
<Route key="programme" path="programme" component={Programme}/>
<Route key="archives" path="archives" component={Archives}/>
<Route key="archives_demo" path="archives_demo" component={Archivess}/>
<Route key="standingBook" path="standingBook" component={StandingBook}/>
<Route
key="standingBookDetail"
@ -173,6 +177,7 @@ const Routes = (
<Route key="analysisOfSalaryStatisticsId" path="analysisOfSalaryStatistics/:employeeId" component={EmployeeList}/>
<Route key="reportView" path="reportView" component={ReportView}/>
<Route key="externalPersonManage" path="externalPersonManage" component={ExternalPersonManage}/>
<Route key="topologyView" path="topologyView/:salarySobId/:salaryItemId" component={TopologyMap}/>
</Route>
);

View File

@ -70,13 +70,23 @@ class EditCalcTable extends Component {
salaryCalcSlide: { visible: true, id: salaryCalcId }
});
break;
case "DIAGRAM":
const { salarySobId } = this.props;
const { salaryItemId: itemid, acctEmpId } = params;
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${itemid}?acctEmpId=${acctEmpId}`, "_blank");
break;
default:
break;
}
}
};
updateLockStatus = (payload) => {
const { lockStatus } = payload;
const { salarySobId } = this.props;
const { lockStatus, salaryItemId } = payload;
if (lockStatus === "DIAGRAM") {
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}`, "_blank");
return;
}
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: <div>
@ -169,7 +179,8 @@ class EditCalcTable extends Component {
"当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"),
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
"总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
"批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新")
"批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"),
"查看拓扑图": getLabel(111, "查看拓扑图")
};
this.setState({ originPayloadData: { ...payload, i18n } });
const childFrameObj = document.getElementById("atdTable");

View File

@ -150,6 +150,7 @@ class Index extends Component {
/>
</div>
<EditCalcTable ref={dom => this.calcTableRef = dom} selectedKey={selectedKey}
salarySobId={salarySobCycle.salarySobId}
{...this.props} showTotalCell={showTotalCell}
onShowFormulaTd={this.handleShowFormulaTa}/>
{/*陕西万众项目-创建薪资核算模板弹框*/}

View File

@ -1,37 +0,0 @@
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: 'cz',
key: 'cz',
}
]

View File

@ -0,0 +1,43 @@
export const declareConditions = [
{
items: [
{
colSpan: 1,
conditionType: "MONTHPICKER",
domkey: ["salaryMonthStr"],
fieldcol: 14,
label: "薪资所属月",
lanId: 542604,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
colSpan: 1,
conditionType: "SELECT",
domkey: ["taxAgentId"],
fieldcol: 14,
label: "个税扣缴义务人",
lanId: 537996,
labelcol: 6,
options: [],
rules: "required|string",
viewAttr: 3,
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["description"],
fieldcol: 14,
label: "备注",
lanId: 536726,
labelcol: 6,
value: "",
viewAttr: 2
}
],
defaultshow: true,
title: ""
}
];

View File

@ -0,0 +1,92 @@
/*
* Author: 黎永顺
* name: 个税申报重构- 申报
* Description:
* Date: 2023/10/12
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
import { Button, message } from "antd";
import { getSearchs } from "../../../../util";
import { getTaxAgentSelectListAsAdmin } from "../../../../apis/taxAgent";
import { saveDeclare } from "../../../../apis/declare";
import { declareConditions } from "./condition";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("declareStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
conditions: [], loading: false
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentSelectListAsAdmin(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.declareStore.initDeclareForm();
}
getTaxAgentSelectListAsAdmin = (props) => {
const { declareStore: { declareForm } } = props;
getTaxAgentSelectListAsAdmin().then(({ status, data }) => {
if (status) {
this.setState({
conditions: _.map(declareConditions, item => ({
...item,
items: _.map(item.items, o => {
if (getKey(o) === "taxAgentId") {
return {
...o, options: _.map(data, g => ({ key: g.id, showname: g.content }))
// helpfulTitle: getLabel(563420, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;")
};
}
return { ...o };
})
}))
}, () => declareForm.initFormFields(this.state.conditions));
}
});
};
save = () => {
const { declareStore: { declareForm } } = this.props;
declareForm.validateForm().then(f => {
if (f.isValid) {
const payload = declareForm.getFormParams();
this.setState({ loading: true });
saveDeclare({ ...payload }).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功"));
this.props.onCancel("refresh");
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
} else {
f.showErrors();
}
});
};
render() {
const { conditions, loading } = this.state;
const { declareStore: { declareForm } } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 500 }} initLoadCss
buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(543618, "生成申报表")}</Button>
]}
>
<div className="declare-dialog-layout">{getSearchs(declareForm, conditions, 1, false)}</div>
</WeaDialog>
);
}
}
export default Index;

View File

@ -0,0 +1,34 @@
/*
* Author: 黎永顺
* name: 个税申报表重构-查询
* Description:
* Date: 2023/10/12
*/
import React, { Component } from "react";
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
import { MonthRangePicker } from "../../../reportView/components/statisticalMicroSettingsSlide";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
render() {
const { queryParams } = this.props;
const { dateRange, name } = queryParams;
return (
<div className="salary-btn-flex">
<div className="mounth-range">
<span className="label">{getLabel(543549, "薪资所属月:")}</span>
<MonthRangePicker dateRange={dateRange} viewAttr={2}
onChange={v => this.props.onChange({ dateRange: v })}/>
</div>
<WeaInputSearch value={name}
placeholder={getLabel(111, "请输入个税扣缴义务人")}
onChange={v => this.props.onChange({ taxAgentName: v })}
onSearch={this.props.onSearch}
/>
</div>
);
}
}
export default Index;

View File

@ -0,0 +1,144 @@
/*
* Author: 黎永顺
* name: 个税申报重构-列表
* Description:
* Date: 2023/10/12
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import { message, Modal } from "antd";
import { getDeclareList, withDrawTaxDeclaration } from "../../../../apis/declare";
import { sysConfCodeRule } from "../../../../apis/ruleconfig";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, columns: [], dataSource: [], showWithDrawBtn: false,
pageInfo: { current: 1, pageSize: 10, total: 0 }
};
}
componentDidMount() {
this.getDeclareList(this.props);
this.sysConfCodeRule();
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.isRefresh !== this.props.isRefresh) this.getDeclareList(nextProps);
}
sysConfCodeRule = () => {
sysConfCodeRule({ code: "WITHDRAW_TAX_DECLARATION" }).then(({ status, data }) => {
if (status && data === "1") this.setState({ showWithDrawBtn: data === "1" });
});
};
getDeclareList = (props) => {
const { pageInfo } = this.state;
const { queryParams } = props;
const { dateRange, ...extra } = queryParams;
const [fromSalaryMonthStr, endSalaryMonthStr] = dateRange || [];
const params = { fromSalaryMonthStr, endSalaryMonthStr, ...extra };
const payload = { ...pageInfo, ...params };
this.setState({ loading: true });
getDeclareList(payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { columns, list: dataSource, pageNum, pageSize, total } = data;
this.setState({
dataSource, pageInfo: { ...pageInfo, pageNum, pageSize, total },
columns: _.map(columns, o => {
const { dataIndex } = o;
let width = "";
switch (dataIndex) {
case "taxAgentName":
case "operateTime":
width = "15%";
break;
case "description":
width = "20%";
break;
default:
width = "10%";
break;
}
return { ...o, width };
})
});
}
}).catch(() => this.setState({ loading: false }));
};
taxdeclarationDelete = (taxDeclarationId) => {
withDrawTaxDeclaration({ taxDeclarationId }).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(505793, "撤回成功"));
this.getDeclareList(this.props);
} else {
message.error(errormsg);
}
});
};
render() {
const { loading, dataSource, columns, pageInfo, showWithDrawBtn } = this.state;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({
pageInfo: { ...pageInfo, current, pageSize }
}, () => this.getDeclareList(this.props));
},
onChange: current => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => this.getDeclareList(this.props));
}
};
return (
<WeaTable
rowKey="id"
dataSource={dataSource} loading={loading}
pagination={pagination} columns={[
...columns,
{
dataIndex: "operate", title: getLabel(30585, "操作"),
width: 170, render: (__, record) => {
const { id } = record;
return <React.Fragment>
<a
href={`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=${id}`}
target="_blank"
>
{getLabel(83110, "查看详情")}
</a>
{
showWithDrawBtn &&
<a
href="javascript:void(0);" style={{ marginLeft: 10 }}
onClick={() => {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(543848, "确认撤回该条数据吗?"),
onOk: () => this.taxdeclarationDelete(id)
});
}}
>
{getLabel(32025, "撤回")}
</a>
}
</React.Fragment>;
}
}
]}
/>
);
}
}
export default Index;

View File

@ -0,0 +1,81 @@
/*
* Author: 黎永顺
* name: 个税申报表-重构页面
* Description:
* Date: 2023/10/12
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaHelpfulTip, WeaLocaleProvider, WeaTop } from "ecCom";
import { Button } from "antd";
import moment from "moment";
import DeclareQuery from "./components/declareQuery";
import DeclareTablelist from "./components/declareTablelist";
import DeclareDialog from "./components/declareDialog";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore")
@observer
class Calculate extends Component {
constructor(props) {
super(props);
this.state = {
queryParams: {
taxAgentName: "",
dateRange: [
moment(new Date()).startOf("year").format("YYYY-MM"),
moment(new Date()).startOf("month").format("YYYY-MM")
]
}, isRefresh: false,
declareDaialog: { visible: false, title: "" }
};
this.handleDebounce = null;
}
renderCalculateOpts = () => {
const { taxAgentStore: { showOperateBtn } } = this.props;
const { queryParams, isRefresh } = this.state;
let calculateOpts = [
<Button type="primary" onClick={() => this.setState({
declareDaialog: {
visible: true,
title: <div style={{ display: "flex", alignItems: "center" }}>
<span style={{ marginRight: 10 }}>{getLabel(15366, "申报")}</span>
<WeaHelpfulTip
width={200} placement="topLeft"
title={getLabel(543617, "提示:一个薪资所属月下一个个税扣缴义务人的所有核算数据都归档后才可以申报")}
/>
</div>
}
})}>{getLabel(543618, "生成申报表")}</Button>,
<DeclareQuery queryParams={queryParams} onChange={v => this.setState({
isRefresh: _.keys(v)[0] === "taxAgentName" ? isRefresh : !isRefresh,
queryParams: { ...queryParams, ...v }
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/>
];
return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts;
};
render() {
const { queryParams, isRefresh, declareDaialog } = this.state;
return (
<WeaTop title={getLabel(543353, "个税申报")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
buttons={this.renderCalculateOpts()} className="declare-main-layout"
>
<div className="declare-body">
<DeclareTablelist queryParams={queryParams} isRefresh={isRefresh}/>
<DeclareDialog {...declareDaialog}
onCancel={(bool) => this.setState({
declareDaialog: { ...declareDaialog, visible: false },
isRefresh: bool === "refresh" ? !isRefresh : isRefresh
})}
/>
</div>
</WeaTop>
);
}
}
export default Calculate;

View File

@ -24,3 +24,67 @@
}
}
}
//个税申报表页面-重构
.declare-main-layout {
.wea-new-top-content {
overflow-y: hidden;
}
.declare-body {
height: 100%;
width: 100%;
padding: 16px;
overflow-y: auto;
.wea-new-table {
background: #fff;
}
.ant-table-tbody {
td {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
.declare-dialog-layout {
background: #f6f6f6;
.wea-search-group {
padding: 16px;
}
.wea-select, .ant-select-selection, .ant-select {
width: 100%;
}
.wea-select {
display: inline-block;
position: relative;
}
.ant-select-selection {
height: 30px;
border-radius: 0;
}
.wea-content {
padding: 0;
.wea-form-cell-wrapper {
background: #FFF;
border: 1px solid #e5e5e5;
border-bottom: none;
.wea-form-cell {
border-bottom: 1px solid #e5e5e5;
}
}
}
}

View File

@ -251,7 +251,13 @@ class LedgerSalaryItemTable extends Component {
{
title: "名称",
dataIndex: "name",
key: "name"
key: "name",
render: (text, record) => {
const { salarySobId, salaryItemId } = record;
return <a
href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}`}
target="_blank">{text}</a>;
}
},
{
title: <span>

View File

@ -266,7 +266,7 @@ class LedgerSlide extends Component {
className="slideOuterWrapper"
visible={visible}
top={0}
width={65}
width={100}
height={100}
direction="right"
measure="%"

View File

@ -82,7 +82,7 @@ class PassSetDialog extends Component {
return;
}
if (secondaryPwd1 !== secondaryPwd2) {
message.error(getLabel("504376", "密码确认不正确!"));
message.error(getLabel(504376, "密码确认不正确!"));
return;
}
} else {

View File

@ -105,7 +105,6 @@ export default class BaseInformForm extends React.Component {
ackFeedbackStatus, autoAckDays, feedbackUrl, autoSendStatus, autoSendDayOfMonth, autoSendTimeOfDay,
autoSendCycleType
} = request;
return (
<React.Fragment>
<WeaSearchGroup title="基础信息" items={[]} needTigger showGroup col={1} className="payrollBaseInfoWrapper">

View File

@ -38,7 +38,8 @@ export default class Index extends Component {
confValue: "0",
withDrawTaxDeclaration: "0",
extEmpsWitch: "0",
salaryAcctFixedColumns: 0
salaryAcctFixedColumns: 0,
welBaseDiffByPerAndCom: "0",
},
showEncryptOperationButton: "",
progressVisible: false,
@ -66,7 +67,8 @@ export default class Index extends Component {
ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "",
taxDeclarationFunction: operateTaxDeclaration = "1", salaryArchiveDelete: confValue,
salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0",
OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0", salaryAcctFixedColumns = "0"
OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0", salaryAcctFixedColumns = "0",
welBaseDiffByPerAndCom = "0",
}
} = sysInfo;
// const { data: { ascOrDesc, orderRule } } = orderRules;
@ -87,7 +89,8 @@ export default class Index extends Component {
saveParams: {
...saveParams,
ascOrDesc, orderRule, rule, enctry, matchRule, confValue, withDrawTaxDeclaration, salaryAcctFixedColumns,
extEmpsWitch, operateTaxDeclaration: (operateTaxDeclaration && operateTaxDeclaration !== "0") ? "1" : "0"
extEmpsWitch, operateTaxDeclaration: (operateTaxDeclaration && operateTaxDeclaration !== "0") ? "1" : "0",
welBaseDiffByPerAndCom
}
});
}
@ -307,6 +310,13 @@ export default class Index extends Component {
confValue: !_.isNil(val) ? val.toString() : "0"
});
break;
case "welBaseDiffByPerAndCom":
this.saveSysOperate({
title: getLabel(111, "福利档案基数区分个人和公司"),
module: "basic", confKey: key,
confValue: val
});
break;
default:
break;
}
@ -342,7 +352,8 @@ export default class Index extends Component {
confValue,
withDrawTaxDeclaration,
extEmpsWitch,
salaryAcctFixedColumns
salaryAcctFixedColumns,
welBaseDiffByPerAndCom
} = saveParams;
return (
<div className="ruleWrapper">
@ -398,6 +409,12 @@ export default class Index extends Component {
onChange={val => this.handleChange("confValue", val)}/>
</WeaFormItem>
</WeaSearchGroup>
<WeaSearchGroup title={getLabel(111, "福利档案基数")} showGroup center>
<WeaFormItem label={getLabel(111, "区分个人和公司")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
<WeaCheckbox display="switch" value={welBaseDiffByPerAndCom}
onChange={val => this.handleChange("welBaseDiffByPerAndCom", val)}/>
</WeaFormItem>
</WeaSearchGroup>
<WeaSearchGroup title={getLabel(111, "薪资核算人员匹配规则")} showGroup center>
<WeaFormItem label={getLabel(111, "匹配规则")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaSelect options={matchRuleOptions} value={matchRule}

View File

@ -48,7 +48,11 @@ class SalaryItemForm extends Component {
return { ...item, display: dataType === "number" };
case "width":
case "sortedIndex":
return { ...item, label: getLabel(item.lanId, item.label) };
return {
...item,
label: getLabel(item.lanId, item.label),
display: ((!isLedger && key === "width") || key === "sortedIndex")
};
case "useInEmployeeSalary":
return {
...item,
@ -169,7 +173,7 @@ class SalaryItemForm extends Component {
<WeaInputNumber value={value} viewAttr={viewAttr} precision={0}
min={key === "width" ? 0 : -99999}
onChange={v => this.handleChangeSalaryFiledItems(key, v)}/>
{key === "width" &&
{key === "width" && display &&
<span style={{ paddingLeft: 10, position: "absolute", marginTop: 4 }}>px</span>}
</React.Fragment>
</WeaFormItem> : null

View File

@ -0,0 +1,22 @@
/*
* Author: 黎永顺
* name: 薪资档案拓扑图
* Description:
* Date: 2023/10/19
*/
import React, { Component } from "react";
class Index extends Component {
render() {
return (
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/salaryItemDiagram"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/salaryItemDiagram"
id="topologyDiagram"
/>
);
}
}
export default Index;

View File

@ -1,10 +1,3 @@
import { WeaSwitch } from "comsMobx";
import { Button } from "antd";
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
export const tabCondition = [
{
color: "#000000",
@ -42,97 +35,3 @@ export const tabCondition = [
viewcondition: "ext"
}
];
export const logConditions = [
{
items: [
{
colSpan: 1,
conditionType: "BROWSER",
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: "1"
},
domkey: ["employeeId"],
fieldcol: 17,
label: "对象",
lanId: 106,
labelcol: 7,
value: ""
},
{
colSpan: 1,
conditionType: "BROWSER",
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: "1"
},
domkey: ["operator"],
fieldcol: 17,
label: "操作人",
lanId: 111,
labelcol: 7,
value: ""
}
],
defaultshow: true
}
];
export const getLogSearchsForm = (form, condition, onSearch = () => void (0)) => {
const { isFormInit } = form;
const formParams = form.getFormParams();
let group = [];
isFormInit && condition && condition.map(c => {
let items = [];
c.items.map(fields => {
items.push({
com: (
<WeaFormItem
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom"
>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
{
getKey(fields) === "operator" &&
<Button type="primary" onClick={onSearch} style={{ position: "absolute", right: "-70px", top: "0" }}>{getLabel(388113, "搜索")}</Button>
}
</WeaFormItem>),
colSpan: 1
});
});
group.push(
<WeaSearchGroup col={4} needTigger={true} title={c.title} showGroup={c.defaultshow} items={items} center={false}
/>);
});
return group;
};

View File

@ -17,7 +17,7 @@ import UnifiedTable from "../../../components/UnifiedTable";
import { convertToUrlString, getURLParameters } from "../../../util/url";
import { salaryArchiveDelete } from "../../../apis/payrollFiles";
import ImportDialog from "../../../components/importDialog";
import OperateLogDialog from "./operateLogDialog";
import OperateLogDialog from "../welfareArchive/components/logDialog";
import "./index.less";
import { sysinfo } from "../../../apis/ruleconfig";

View File

@ -85,36 +85,3 @@
}
}
}
//重构-社保福利档案
.logDialog {
.wea-dialog-body {
overflow-y: hidden;
}
.logDialogContent {
background: #F6F6F6;
padding: 16px;
width: 100%;
height: 100%;
.wea-search-group {
padding: 0;
margin-bottom: 10px;
background: #FFF;
.wea-form-cell {
padding: 0;
.wea-form-item {
padding: 10px;
}
}
}
.logTable {
background: #FFFFFF;
}
}
}

View File

@ -125,7 +125,7 @@ class CustomBenefitsTable extends Component {
content: getLabel(543231, "确认删除本条数据吗?"),
onOk: () => {
message.destroy();
message.loading("正在删除中...", 0);
message.loading(getLabel(529063, "正在删除中..."), 0);
const payload = { id };
deleteCustomCategory(payload).then(({ status, errormsg }) => {
message.destroy();

View File

@ -0,0 +1,33 @@
/*
* Author: 黎永顺
* name: 社保福利档案页面重构-高级搜索
* Description:
* Date: 2023/10/31
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { Button } from "antd";
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("archivesStore")
@observer
class Index extends Component {
render() {
const { archivesStore: { welfareForm } } = this.props;
return (
<div className="achrive-advance-search">
<WeaInputSearch value={welfareForm.getFormParams().username}
onChange={v => welfareForm.updateFields({ username: v })}
onSearch={this.props.onAdvanceSearch}
/>
<Button type="ghost" className="wea-advanced-search text-elli"
onClick={this.props.onOpenAdvanceSearch}>{getLabel(111, "高级搜索")}</Button>
</div>
);
}
}
export default Index;

View File

@ -0,0 +1,29 @@
.achrive-advance-search {
display: flex;
align-items: center;
position: relative;
top: -1.5px;
.wea-advanced-search {
top: 2px;
left: -1px;
height: 28px;
line-height: 1;
border-radius: 0;
position: relative;
color: #474747;
padding: 4px 15px;
}
.wea-advanced-search:hover {
border: 1px solid #dadada;
color: #474747;
}
.text-elli {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
top: 1px;
}
}

View File

@ -1,15 +1,16 @@
/*
* Author: 黎永顺
* name: 社保福利档案-操作日志
* name:社保福利档案-操作日志
* Description:
* Date: 2023/10/23
* Date: 2023/11/6
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
import { getAdjustHistoryList } from "../../../../apis/archive";
import { getLogSearchsForm, logConditions } from "../config";
import { getAdjustHistoryList } from "../../../../../apis/welfareArchive";
import { getLogSearchsForm, logConditions } from "../../config";
import moment from "moment";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;

View File

@ -0,0 +1,31 @@
//重构-社保福利档案
.logDialog {
.wea-dialog-body {
overflow-y: hidden;
}
.logDialogContent {
background: #F6F6F6;
padding: 16px;
width: 100%;
height: 100%;
.wea-search-group {
padding: 0;
margin-bottom: 10px;
background: #FFF;
.wea-form-cell {
padding: 0;
.wea-form-item {
padding: 10px;
}
}
}
.logTable {
background: #FFFFFF;
}
}
}

View File

@ -0,0 +1,66 @@
/*
* Author: 黎永顺
* name: 社保福利档案页面重构-高级搜索面板
* Description:
* Date: 2023/10/31
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { Button } from "antd";
import { inject, observer } from "mobx-react";
import { getSaCondition } from "../../../../../apis/archive";
import { getSearchs } from "../../../../../util";
const getLabel = WeaLocaleProvider.getLabel;
@inject("archivesStore")
@observer
class WelfareAdvanceSearchPannel extends Component {
constructor(props) {
super(props);
this.state = {
searchConditions: []
};
}
componentDidMount() {
getSaCondition().then(({ status, data }) => {
if (status) {
this.setState({
searchConditions: data.condition
}, () => {
const { archivesStore: { welfareForm } } = this.props;
welfareForm.initFormFields(this.state.searchConditions);
});
}
});
}
render() {
const { searchConditions } = this.state;
const { archivesStore: { welfareForm } } = this.props;
return (
<React.Fragment>
<div className="wea-advanced-searchsAd">
{getSearchs(welfareForm, searchConditions, 2, false)}
</div>
<div className="wea-search-buttons">
<div style={{ textAlign: "center" }}>
<span style={{ marginLeft: 15 }}>
<Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button>
</span>
<span style={{ marginLeft: 15 }}>
<Button type="ghost" onClick={() => welfareForm.resetForm()}>{getLabel(2022, "重置")}</Button>
</span>
<span style={{ marginLeft: 15 }}>
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
</span>
</div>
</div>
</React.Fragment>
);
}
}
export default WelfareAdvanceSearchPannel;

View File

@ -0,0 +1,103 @@
/*
* Author: 黎永顺
* name: 社保福利档案页面重构-导入
* Description:
* Date: 2023/11/6
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaCheckbox, WeaLocaleProvider } from "ecCom";
import ImportDialog from "../../../../../components/importDialog";
import { convertToUrlString, getURLParameters } from "../../../../../util/url";
import { importBatch } from "../../../../../apis/welfareArchive";
const getLabel = WeaLocaleProvider.getLabel;
@inject("archivesStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
importDialog: {
nextloading: false, link: "", importResult: {}, imageId: "",
previewUrl: "/api/bs/hrmsalary/scheme/preview"
}
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { runStatuses, archivesStore: { welfareForm } } = nextProps;
const payload = {
[runStatuses !== "ext" ? "exportData" : "extWelArchiveList"]: "false",
runStatuses, ...welfareForm.getFormParams()
};
this.setState({
importDialog: {
...this.state.importDialog,
link: `/api/bs/hrmsalary/scheme/template/export?${convertToUrlString(payload)}`
}
});
} else {
this.setState({
importDialog: {
nextloading: false, link: "", importResult: {}, imageId: "",
previewUrl: "/api/bs/hrmsalary/scheme/preview"
}
});
}
}
handleImport = (payload) => {
const { importDialog } = this.state, { runStatuses: runStatus } = this.props;
this.setState({ importDialog: { ...importDialog, nextloading: true } });
importBatch({ ...payload, runStatus: runStatus.split(",")[0] }).then(({ data, status }) => {
this.setState({ importDialog: { ...importDialog, nextloading: false } });
if (status) {
this.setState({
importDialog: { ...importDialog, ...payload, importResult: data }
});
}
}).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
};
render() {
const { runStatuses, archivesStore: { welfareForm } } = this.props;
const { importDialog } = this.state;
const { link } = importDialog;
return (
<ImportDialog
{...this.props} {...importDialog}
onResetImportResult={() => this.setState({
importDialog: {
...importDialog, importResult: {}, imageId: "", link: ""
}
})}
exportDataDom={
<WeaCheckbox
value={getURLParameters(link)["exportData"] === "true" ? "1" : "0"}
content={getLabel(543208, "导出现有数据")}
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
onChange={val => {
let payload = {
exportData: val === "1", runStatuses, ...welfareForm.getFormParams()
};
runStatuses === "ext" && (payload = { ...payload, extWelArchiveList: true, runStatuses: "" });
this.setState({
importDialog: {
...importDialog,
link: `/api/bs/hrmsalary/scheme/template/export?${convertToUrlString(payload)}`
}
});
}}
/>
}
nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
nextUplaodCallback={imageId => this.handleImport({ imageId })}
/>
);
}
}
export default Index;

View File

@ -0,0 +1,310 @@
/*
* Author: 黎永顺
* name:社保福利档案页面重构-查看编辑弹框
* Description:
* Date: 2023/11/6
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
import * as API from "../../../../../apis/welfareArchive";
import { getTaxAgentSelectList } from "../../../../../apis/taxAgent";
import { getWelfareSearchsForm, welfareConditions } from "../../config";
import { getConditionDomkeys, toDecimal_n } from "../../../../../util";
import { Button, message, Modal } from "antd";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("archivesStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, conditions: [], formData: {}
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
document.querySelector(".salary-welfare-archive").classList.add("zIndex0-welfare-archive");
const promise = this.getBaseForm(nextProps);
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
const { archivesStore: { initWelfareProfileForm } } = nextProps;
document.querySelector(".salary-welfare-archive").classList.remove("zIndex0-welfare-archive");
initWelfareProfileForm();
}
}
getBaseForm = async (props) => {
const { data: taxAgentList } = await getTaxAgentSelectList();
const {
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses,
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData
} = props;
let socialComData = {}, fundComData = {}, otherComData = {};
if (!_.isNil(socialBase.comItems) && !_.isNil(socialBase.comData)) {
_.forEach(getConditionDomkeys(socialBase.comItems), o => {
socialComData = {
...socialComData,
[`${o}_com`]: socialBase.comData[o]
};
});
}
if (!_.isNil(fundBase.comItems) && !_.isNil(fundBase.comData)) {
_.forEach(getConditionDomkeys(fundBase.comItems), o => {
fundComData = {
...fundComData,
[`${o}_com`]: fundBase.comData[o]
};
});
}
if (!_.isNil(otherBase.comItems) && !_.isNil(otherBase.comData)) {
_.forEach(getConditionDomkeys(otherBase.comItems), o => {
otherComData = {
...otherComData,
[`${o}_com`]: otherBase.comData[o]
};
});
}
const payload = { employeeId, paymentOrganization, welfareTypeEnum: "" };
API.getBaseForm(payload).then(({ status, data }) => {
if (status) {
const { data: result } = data;
const formData = {
...result, ...socialBaseData, ...fundBaseData, ...othersBaseData,
...socialBase.data, ...fundBase.data, ...otherBase.data,
...socialComData, ...fundComData, ...otherComData
};
this.setState({
formData,
conditions: _.map(welfareConditions, o => {
if (o.title === "basic") {
return {
...o, title: getLabel(542699, "员工基本信息"),
viewAttr: runStatuses === "4,5" ? 1 : o.viewAttr,
items: _.map(o.items, g => {
return { ...g, label: getLabel(g.lanId, g.label) };
})
};
} else if (o.title === "taxAgent") {
return {
...o, title: getLabel(537996, "个税扣缴义务人"),
items: _.map(o.items, g => {
return {
...g, label: getLabel(g.lanId, g.label),
options: _.map(taxAgentList, j => ({ key: j.id, showname: j.content }))
};
})
};
} else if (o.title === "social" || o.title === "fund" || o.title === "others") {
const title = o.title === "social" ? getLabel(543194, "社保基础信息") : o.title === "fund" ? getLabel(543197, "公积金基础信息") : getLabel(543198, "其他福利基础信息");
return {
...o, title,
items: _.map(o.items, g => {
if (getKey(g) === "socialSchemeId" || getKey(g) === "fundSchemeId" || getKey(g) === "otherSchemeId" || _.lowerCase(getKey(g)).indexOf("take") !== -1) {
const key = _.lowerCase(getKey(g)).indexOf("take") !== -1 ? "underTake" : getKey(g);
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr,
options: _.find(props[`${o.title}Items`], j => j.domkey[0] === key).options
};
}
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr
};
})
};
}
return {
...o, items: _.map(o.items, g => {
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr
};
})
};
})
}, () => {
welfareProfileForm.initFormFields(this.state.conditions);
_.map(getConditionDomkeys(this.state.conditions), k => {
if (k === "paymentOrganization") {
welfareProfileForm.updateFields({ [k]: paymentOrganization.toString() });
} else if (_.lowerCase(k).indexOf("social") !== -1 || k === "schemeAccount") {
welfareProfileForm.updateFields({ [k]: formData["SOCIAL_SECURITY"][k] ? formData["SOCIAL_SECURITY"][k].toString() : "" });
} else if (_.lowerCase(k).indexOf("fund") !== -1) {
welfareProfileForm.updateFields({ [k]: formData["ACCUMULATION_FUND"][k] ? formData["ACCUMULATION_FUND"][k].toString() : "" });
} else if (_.lowerCase(k).indexOf("other") !== -1) {
welfareProfileForm.updateFields({ [k]: formData["OTHER"][k] ? formData["OTHER"][k].toString() : "" });
} else {
welfareProfileForm.updateFields({ [k]: formData[k] || "" });
}
});
});
}
});
};
covertPayload = (welfareType, underTakeType, paymentForm, paymentComForm) => {
const { archivesStore: { welfareProfileForm } } = this.props;
const welfareData = welfareProfileForm.getFormParams();
const { formData } = this.state;
return {
baseForm: JSON.stringify({
...formData[welfareType], ..._.reduce(_.keys(formData[welfareType]), (pre, cur) => {
if (welfareData[cur]) return { ...pre, [cur]: welfareData[cur] };
return { ...pre };
}, {}),
underTake: welfareData[`${underTakeType}UnderTake`]
}),
paymentForm: !_.isEmpty(paymentForm) ? JSON.stringify(_.reduce(paymentForm, (pre, cur) => {
if (formData[cur] || formData[cur] === 0) return { ...pre, [cur]: toDecimal_n(formData[cur], 2).toString() };
return { ...pre, [cur]: "0" };
}, {})) : "",
paymentComForm: !_.isEmpty(paymentComForm) ? JSON.stringify(_.reduce(paymentComForm, (pre, cur) => {
if (formData[`${cur}_com`] || formData[`${cur}_com`] === 0) return {
...pre,
[cur]: toDecimal_n(formData[`${cur}_com`], 2).toString()
};
return { ...pre, [cur]: "0" };
}, {})) : "",
welfareType, validate: welfareData[`${underTakeType}SchemeId`] ? !!welfareData[`${underTakeType}StartTime`] : true
};
};
save = async () => {
const socailPayload = this.covertPayload("SOCIAL_SECURITY", "social", getConditionDomkeys(this.props.socialBase.items), getConditionDomkeys(this.props.socialBase.comItems || [])),
fundPayload = this.covertPayload("ACCUMULATION_FUND", "fund", getConditionDomkeys(this.props.fundBase.items), getConditionDomkeys(this.props.fundBase.comItems || [])),
otherPayload = this.covertPayload("OTHER", "other", getConditionDomkeys(this.props.otherBase.items), getConditionDomkeys(this.props.otherBase.comItems || []));
if (!(socailPayload.validate && fundPayload.validate && otherPayload.validate)) {
message.warning(getLabel(111, "请维护起始缴纳月!"));
return;
}
this.setState({ loading: true });
const [{
status: socialStatus,
errormsg: socialErrorMsg = "!"
}, {
status: fundStatus,
errormsg: fundErrorMsg = "!"
}, {
status: otherStatus,
errormsg: otherErrorMsg = "!"
}] = await Promise.all([API.save(socailPayload), API.save(fundPayload), API.save(otherPayload)]);
this.setState({ loading: false });
if (socialStatus && fundStatus && otherStatus) {
message.success(getLabel(30700, "操作成功!"));
this.props.onClose(true);
} else {
message.error(socialErrorMsg + fundErrorMsg + otherErrorMsg);
}
};
updateFormData = (baseData) => this.setState({ formData: { ...this.state.formData, ...baseData } });
handleFormChange = (val) => {
const changeKey = _.keys(val)[0], changeVal = val[changeKey].value;
const { archivesStore: { setHasBeenModify }, onChangeProgramme, employeeId, paymentOrganization } = this.props;
setHasBeenModify(true);
if (changeKey === "socialSchemeId" || changeKey === "fundSchemeId" || changeKey === "otherSchemeId") {
this.setState({
conditions: _.map(this.state.conditions, o => {
if (
(o.typename === "SOCIAL_SECURITY" && changeKey === "socialSchemeId") ||
(o.typename === "ACCUMULATION_FUND" && changeKey === "fundSchemeId") ||
(o.typename === "OTHER" && changeKey === "otherSchemeId")
) {
return {
...o, items: _.map(o.items, g => {
if (getKey(g).indexOf("StartTime") !== -1) {
return {
...g, viewAttr: changeVal ? 3 : g.viewAttr
};
}
return { ...g };
})
};
}
return { ...o };
})
});
onChangeProgramme(changeKey.slice(0, changeKey.indexOf("SchemeId")), changeVal, {
employeeId,
paymentOrganization
});
}
};
handleExtraChange = (key, value) => this.setState({ formData: { ...this.state.formData, [key]: value } });
handleSameChange = (baseItems, value) => {
let newFormDatas = {}, hasCompromise = false;
baseItems.forEach((formLabel) => {
const { min, max } = formLabel;
newFormDatas[getKey(formLabel)] = toDecimal_n(value, 2) || "";
if (min !== "0.000" && value !== "" && Number(value) < Number(min)) {
hasCompromise = true;
newFormDatas[getKey(formLabel)] = toDecimal_n(Number(min), 2);
}
if (max !== "0.000" && value !== "" && Number(value) > Number(max)) {
hasCompromise = true;
newFormDatas[getKey(formLabel)] = toDecimal_n(Number(max), 2);
}
});
if (hasCompromise) {
message.warning(getLabel("111", "超出所选缴纳方案设置的基数上下限范围,将自动按基数上下限填充。"));
}
this.setState({ formData: { ...this.state.formData, ...newFormDatas } });
};
handleNoPaymentChange = (type, value) => this.setState({
formData: { ...this.state.formData, [type]: { ...this.state.formData[type], nonPayment: value } }
});
renderTitle = () => {
const { loading } = this.state;
const { runStatuses } = this.props;
return <div className="titleDialog">
<div className="titleCol titleLeftBox">
<div className="titleIcon"><i className="icon-coms-fa"/></div>
<div className="title">{getLabel(543191, "员工福利档案")}</div>
</div>
<div className="titleCol titleRightBox">
{
runStatuses !== "4,5" &&
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
}
</div>
</div>;
};
handleClose = () => {
const { archivesStore: { hasBeenModify }, onClose } = this.props;
if (hasBeenModify) {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(111, "确定放弃填写吗?放弃后数据将不会被保存!"),
onOk: () => {
onClose();
}
});
} else {
onClose();
}
};
render() {
const { archivesStore: { welfareProfileForm } } = this.props;
const { conditions, formData } = this.state;
return (
<WeaSlideModal
className="salary-welfare-archive-edit-layout" {...this.props}
top={0} width={800} height={100} measureT={"%"} measureX={"px"} measureY={"%"}
direction={"right"} title={this.renderTitle()} onClose={this.handleClose}
content={<div className="salary-welfare-archive-edit-area">
{
getWelfareSearchsForm(
welfareProfileForm, conditions, this.handleFormChange, this.handleNoPaymentChange, this.handleExtraChange,
this.handleSameChange, formData, this.props
)
}
</div>}
/>
);
}
}
export default Index;

View File

@ -0,0 +1,304 @@
/*
* Author: 黎永顺
* name:社保福利档案页面重构-列表
* Description:
* Date: 2023/10/31
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
import { message, Modal, Spin } from "antd";
import WelfareEditArchiveSlide from "../welfareEditArchiveSlide";
import * as API from "../../../../../apis/welfareArchive";
import { welfareTypeEnum } from "../../config";
import { getConditionDomkeys, getConditionFields } from "../../../../../util";
const getLabel = WeaLocaleProvider.getLabel;
const APILIST = {
runStatuses: API.queryList,
ext: API.getExtTable,
delToDo: API.updateRunStatus, //删除待办
delArchive: API.deleteArchive, //删除档案
addToPay: API.stayAddToPay, //增员
stayDelToStop: API.stayDelToStop, //减员
delToDoStay: API.cancelStayDel, //待减员-删除待办
cancelStop: API.cancelStopPayment //停缴员工-取消停缴
};
@inject("archivesStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: [], columns: [], loading: false, selectedRowKeys: [],
pageInfo: { current: 1, pageSize: 10, total: 0 },
welfareEditSlide: { visible: false, employeeId: "", welfareTypeEnum: "", paymentOrganization: "" }
};
}
componentDidMount() {
window.addEventListener("message", this.handleReceive, false);
window.addEventListener("resize", this.handleResize, false);
}
handleResize = () => {
this.forceUpdate();
};
componentWillUnmount() {
window.removeEventListener("message", this.handleReceive, false);
window.removeEventListener("resize", this.handleResize, false);
}
componentWillReceiveProps(nextProps, nextContext) {
if ((nextProps.runStatuses !== this.props.runStatuses) || (nextProps.isQuery !== this.props.isQuery)) {
this.setState({
pageInfo: { ...this.state.pageInfo, current: 1, pageSize: 10, total: 0 }
}, () => this.getWelfareList(nextProps));
}
if ((nextProps.runStatuses !== this.props.runStatuses)) {
this.setState({
dataSource: [], columns: [], loading: false, selectedRowKeys: [],
welfareEditSlide: { ...this.state.welfareEditSlide, visible: false }
});
}
}
handleReceive = async ({ data }) => {
const { type, payload: { id, params } = {} } = data;
if (type === "init") {
this.getWelfareList(this.props);
} else if (type === "turn") {
const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params;
const { runStatuses } = this.props;
switch (id) {
case "PAGEINFO":
this.setState({
pageInfo: { ...this.state.pageInfo, ...params }
}, () => this.getWelfareList(this.props));
break;
case "CHECKBOX":
const { selectedRowKeys } = params;
this.setState({ selectedRowKeys });
break;
case "EDIT":
case "VIEW":
const payload = { employeeId, paymentOrganization };
const [socialItems, fundItems, othersItems] = await Promise.all([
this.getProfileTypeForm({ ...payload, welfareTypeEnum: welfareTypeEnum["social"] }),
this.getProfileTypeForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"] }),
this.getProfileTypeForm({ ...payload, welfareTypeEnum: welfareTypeEnum["other"] })
]);
this.setState({
welfareEditSlide: {
...this.state.welfareEditSlide, employeeId, paymentOrganization, runStatuses,
socialItems: socialItems.data.items[0].items,
socialBaseData: {
SOCIAL_SECURITY: { ...socialItems.data.data, socialUnderTake: socialItems.data.data.underTake }
},
fundItems: fundItems.data.items[0].items,
fundBaseData: {
ACCUMULATION_FUND: { ...fundItems.data.data, fundUnderTake: fundItems.data.data.underTake }
},
othersItems: othersItems.data.items[0].items,
othersBaseData: { OTHER: { ...othersItems.data.data, otherUnderTake: othersItems.data.data.underTake } }
}
}, async () => {
const { socialBaseData, fundBaseData, othersBaseData } = this.state.welfareEditSlide;
const { SOCIAL_SECURITY: { socialSchemeId } } = socialBaseData,
{ ACCUMULATION_FUND: { fundSchemeId } } = fundBaseData,
{ OTHER: { otherSchemeId } } = othersBaseData;
const [socialBase, fundBase, otherBase] = await Promise.all([
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["social"], schemeId: socialSchemeId }),
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"], schemeId: fundSchemeId }),
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["other"], schemeId: otherSchemeId })
]);
this.setState({
welfareEditSlide: {
...this.state.welfareEditSlide, visible: true,
socialBase: socialBase.data, fundBase: fundBase.data, otherBase: otherBase.data
}
});
});
break;
case "ADD-TO-PAY":
case "STAY-DEL-TO-STOP":
case "CANCEL-STOP":
case "DEL-TO-DO":
case "DEL-TO-DO-STAY":
const module = (id === "ADD-TO-PAY" || id === "STAY-DEL-TO-STOP" || id === "CANCEL-STOP") ?
[baseInfo] : { ids: [baseInfo], ...interfaceParams };
this.handleWelfareOpts(_.camelCase(id), module);
break;
case "DEL-ARCHIVE":
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(388758, "确认要删除吗?"),
onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfo])
});
break;
default:
break;
}
}
};
getProfileTypeForm = async (props) => {
const { employeeId, paymentOrganization, welfareTypeEnum } = props;
const payload = { employeeId, paymentOrganization, welfareTypeEnum };
return API.getBaseForm(payload);
};
getPaymentForm = async (props) => {
return API.getPaymentForm({ ...props });
};
getWelfareList = (props) => {
const { pageInfo } = this.state;
const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props;
const params = { ...pageInfo, ...welfareForm.getFormParams() };
const payload = runStatuses === "ext" ? { ...params, extWelArchiveList: true } : {
...params,
runStatuses: runStatuses.split(",")
};
this.setState({ loading: true });
APILIST[runStatuses === "ext" ? "ext" : "runStatuses"](payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { columns, datas: dataSource, pageInfo: { pageNum: current, pageSize, total } } = data;
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
columns: _.map(columns, o => {
const { column: dataIndex, text: title, width } = o;
if (dataIndex === "employeeName") {
return {
dataIndex, title, width, fixed: "left", ellipsis: true
};
}
return {
dataIndex, title, width, ellipsis: true
};
})
}, () => {
const { pageInfo, selectedRowKeys, columns, dataSource } = this.state;
onChangeTopTabCount(runStatuses, total);
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, runStatuses,
columns, showOperateBtn
});
});
}
}).catch(() => this.setState({ loading: false }));
};
/*
* Author: 黎永顺
* Description:批量操作
* Params:
* Date: 2023/11/3
*/
handleBatchOpt = (type, payload) => {
const { selectedRowKeys } = this.state;
if (_.isEmpty(selectedRowKeys)) {
message.warning(getLabel(543303, "请选择表格数据"));
return;
}
const params = _.isNil(payload) ? selectedRowKeys : { ids: selectedRowKeys, ...payload };
this.handleWelfareOpts(type, params);
};
handleWelfareOpts = (type, payload) => {
WeaLoadingGlobal.start();
APILIST[type](payload).then(({ status, data = {}, errormsg }) => {
WeaLoadingGlobal.destroy();
if (status) {
const { msg, type } = data;
if (type === "fail") {
message.error(msg);
} else if (type === "success") {
message.success(msg);
this.getWelfareList(this.props);
this.setState({ selectedRowKeys: [] });
} else {
message.success(getLabel(30700, "操作成功!"));
this.getWelfareList(this.props);
this.setState({ selectedRowKeys: [] });
}
} else {
message.error(errormsg);
}
});
};
postMessageToChild = (payload = {}) => {
const i18n = {
"操作": getLabel(30585, "操作"), "编辑": getLabel(501169, "编辑"),
"增员": getLabel(543180, "增员"), "删除档案": getLabel(23238, "删除档案"),
"删除待办": getLabel(543181, "删除待办"), "减员": getLabel(543182, "减员"),
"查看": getLabel(33564, "查看"), "取消停缴": getLabel(543183, "取消停缴"),
"共": getLabel(18609, "共"), "条": getLabel(18256, "条")
};
const childFrameObj = document.getElementById("atdTable");
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
handleChangeProgramme = (type, schemeId, payload) => {
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum[type], schemeId })
.then(({ status, data }) => {
if (status) {
const { data: defVal, items, comData, comItems } = data;
this.setState({
welfareEditSlide: { ...this.state.welfareEditSlide, [`${type}Base`]: data }
}, () => {
const perData = _.reduce(getConditionDomkeys(items), (pre, cur) => {
const minNum = !_.isNil(getConditionFields(items)[cur].min) ? Number(getConditionFields(items)[cur].min) : undefined,
maxNum = !_.isNil(getConditionFields(items)[cur].max) ? Number(getConditionFields(items)[cur].max) : undefined;
const val = !_.isNil(defVal) ? Number(defVal[cur]) : 0;
return {
...pre,
[cur]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
};
}, {});
if (!_.isNil(comItems)) {
const comDataTmpv = _.reduce(getConditionDomkeys(comItems), (pre, cur) => {
const minNum = !_.isNil(getConditionFields(comItems)[cur].min) ? Number(getConditionFields(comItems)[cur].min) : undefined,
maxNum = !_.isNil(getConditionFields(comItems)[cur].max) ? Number(getConditionFields(comItems)[cur].max) : undefined;
const val = !_.isNil(comData) ? Number(comData[cur]) : 0;
return {
...pre,
[`${cur}_com`]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
};
}, {});
this.archiveSlideRef.wrappedInstance.updateFormData({ ...perData, ...comDataTmpv });
return;
}
this.archiveSlideRef.wrappedInstance.updateFormData({ ...perData });
});
}
});
};
render() {
const { loading, dataSource, welfareEditSlide } = this.state;
const dom = document.querySelector(".wea-new-top-req-content");
let height = 280;
if (dom && dataSource.length > 0) {
height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 39 + 113 : dataSource.length < 10 ? dataSource.length * 39 + 113 : parseFloat(dom.style.height) - 170;
}
return (
<div className="table-layout" style={{ height: height + "px" }}>
<Spin spinning={loading}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/welfareArchiveTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/welfareArchiveTable"
id="atdTable"
/>
</Spin>
{/* 编辑产看员工福利档案*/}
<WelfareEditArchiveSlide {...welfareEditSlide} ref={dom => this.archiveSlideRef = dom}
onClose={(isFresh) => this.setState({
welfareEditSlide: { ...welfareEditSlide, visible: false }
}, () => isFresh && this.getWelfareList(this.props))}
onChangeProgramme={this.handleChangeProgramme}
/>
</div>
);
}
}
export default Index;

View File

@ -0,0 +1,44 @@
/*
* Author: 黎永顺
* name:社保福利档案页面重构-小提示
* Description:
* Date: 2023/10/31
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
render() {
const { dataSource } = this.props;
return (
<div className="tip-info-area">
<div className="title">{getLabel(543177, "小提示")}</div>
<div className="tip-detail">
{
_.map(dataSource, item => (<div className="tip-item">{getLabel(item.lanId, item.title)}</div>))
}
</div>
</div>
);
}
}
export default Index;
export const HelpfulDiv = () => {
return <div className="helpWrapper">
<span>{getLabel(544362, "1、缴纳月份区间包含起始缴纳月不包含最后缴纳月;")}</span>
<span>{getLabel(544365, "2、维护的所有的最后缴纳月都大于当前月则该待办数据自动清除不显示在待减员列表")}</span>
<span>{getLabel(544366, "3、减员失败情况①有起始缴纳月却未维护最后缴纳月②员工存在未归档的核算数据")}</span>
</div>;
};
export const CancelHelpfulDiv = () => {
return <div className="helpWrapper">
<span>{getLabel(544362, "1、缴纳月份区间包含起始缴纳月不包含最后缴纳月;")}</span>
<span>{getLabel(544363, "2、若员工当前不在停缴档案的个税扣缴义务人下则不可取消停缴")}</span>
<span>{getLabel(544364, "3、若员工当前在其他个税扣缴义务人下正在缴纳也不可取消停缴")}</span>
</div>;
};

View File

@ -0,0 +1,790 @@
import React from "react";
import {
WeaCheckbox,
WeaFormItem,
WeaHelpfulTip,
WeaInputNumber,
WeaLocaleProvider,
WeaSearchGroup,
WeaTools
} from "ecCom";
import { WeaSwitch } from "comsMobx";
import { Button } from "antd";
import AdvanceInputBtn from "./components/advanceInputBtn";
import { CancelHelpfulDiv, HelpfulDiv } from "./components/welfareTip";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
//批量操作列表
export const welfareTypeEnum = {
social: "SOCIAL_SECURITY",
fund: "ACCUMULATION_FUND",
other: "OTHER"
};
export const optTypeEnum = [
//批量增员
{
key: "batchStaffIncrease",
type: "addToPay",
payload: null
},
// 待增员-批量删除待办
{
key: "batchDeleteTodolist",
type: "delToDo",
payload: { runStatus: "4" }
},
// 待减员-批量删除待办
{
key: "batchDeleteTodolistStayDel",
type: "delToDoStay",
payload: { runStatus: "3" }
},
//批量减员
{
key: "batchReduction",
type: "stayDelToStop",
payload: null
},
//批量取消停缴
{
key: "batchCancellationOfSuspended",
type: "cancelStop",
payload: null
}
];
export const tabList = [
{ viewcondition: "1", title: getLabel(542711, "待增员"), showcount: true, groupid: "stayAdd" },
{ viewcondition: "2,3", title: getLabel(542504, "在缴员工"), showcount: true, groupid: "paying" },
{ viewcondition: "3", title: getLabel(542713, "待减员"), showcount: true, groupid: "stayDel" },
{ viewcondition: "4,5", title: getLabel(542505, "停缴员工"), showcount: true, groupid: "stopPay" },
{ viewcondition: "ext", title: getLabel(542679, "非系统人员"), showcount: true, groupid: "ext" }
];
export const welfareTipList = [
{
viewcondition: "1",
list: [
{
lanId: 544349,
title: "1、个税扣缴义务人变更进入【待增员】的保留所有最新版本数据若修改了数据再增员则修改的数据作为新版本保存"
},
{
lanId: 544350,
title: "2、维护好员工的社保福利档案数据后点击【增员】数据会进入【在缴员工】"
},
{
lanId: 544351,
title: "3、若不需给该员工缴纳可点击【删除待办】进入【停缴员工】进入【停缴员工】后可以点击【取消停缴】再次进入【待增员】"
},
{
lanId: 544352,
title: "4、不管起始缴纳月维护到哪个月都可以进行增员不影响核算判断若维护了最后缴纳月且小于等于当前月则增员失败"
},
{
lanId: 544353,
title: "5、增员失败情况①终止缴纳月小于等于当前月②方案或起始缴纳月未维护"
}
]
},
{
viewcondition: "2,3",
list: [
{
lanId: 544358,
title: "1、需缴纳社保福利的员工维护在【在缴员工】"
},
{
lanId: 544359,
title: "2、可使用更新导入调整档案数据"
},
{
lanId: 544360,
title: "3、若维护了最后缴纳月且小于等于当前月则自动进入【待减员】"
},
{
lanId: 544361,
title: "4、核算人员范围为【在缴员工】中的起始缴纳月和最后缴纳月区间包含当前月的人员"
}
]
},
{
viewcondition: "3",
list: [
{
lanId: 544355,
title: "1、数据进入【待减员】规则①员工的人事状态属性从在职变成非在职且在【在缴员工】里②【在缴员工】里档案维护了缴纳终止月且小于等于当前月③个税扣缴义务人发生调整"
},
{
lanId: 544356,
title: "2、【待减员】为是否不再缴纳的待办状态数据是从【在缴员工】中复制的若不处理列表中的待办数据也不影响社保福利核算【待减员】维护的数据和【在缴员工】数据是同步的"
},
{
lanId: 544357,
title: "3、点击【减员】前先维护最后缴纳月所有有起始缴纳月的福利项的最后缴纳月都小于等于当前月且无未归档的核算数据的档案才能减员成功减员成功后数据进入【停缴员工】"
}
]
},
{
viewcondition: "4,5",
list: [
{
lanId: 544354,
title: "1、不需要缴纳社保福利的员工保存在【停缴员工】"
}
]
},
{
viewcondition: "ext",
list: []
}
];
export const renderDropMenuDatas = (selectedKey, getLabel, showOperateBtn) => {
let menus = [{
key: "log",
icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(111, "操作日志")
}];
if (showOperateBtn) {
switch (selectedKey) {
case "1":
menus = [
{
key: "fullStaffIncrease",
icon: <i className="iconfont icon-quanbu"/>,
content: getLabel(543185, "全量增员")
},
{
key: "batchStaffIncrease",
icon: <i className="iconfont icon-piliangcaozuo"/>,
content: getLabel(543187, "批量增员")
},
{
key: "batchDeleteTodolist",
icon: <i className="iconfont icon-piliangshanchu"/>,
content: getLabel(543186, "批量删除待办")
},
{
key: "exportAll",
icon: <i className="iconfont icon-daochu"/>,
content: getLabel(81272, "导出全部")
},
{
key: "exportSelected",
icon: <i className="iconfont icon-piliangdaochu"/>,
content: getLabel(512938, "导出选中")
},
...menus
];
break;
case "2,3":
menus = [
{
key: "exportAll",
icon: <i className="iconfont icon-daochu"/>,
content: getLabel(81272, "导出全部")
},
{
key: "exportSelected",
icon: <i className="iconfont icon-piliangdaochu"/>,
content: getLabel(512938, "导出选中")
},
...menus
];
break;
case "3":
menus = [
{
key: "fullReduction",
icon: <i className="iconfont icon-quanbu"/>,
content: getLabel(543189, "全量减员")
},
{
key: "batchReduction",
icon: <i className="iconfont icon-piliangcaozuo"/>,
content: getLabel(543188, "批量减员")
},
{
key: "batchDeleteTodolistStayDel",
icon: <i className="iconfont icon-piliangshanchu"/>,
content: getLabel(543186, "批量删除待办")
},
{
key: "exportAll",
icon: <i className="iconfont icon-daochu"/>,
content: getLabel(81272, "导出全部")
},
{
key: "exportSelected",
icon: <i className="iconfont icon-piliangdaochu"/>,
content: getLabel(512938, "导出选中")
},
...menus
];
break;
case "4,5":
menus = [
{
key: "batchCancellationOfSuspended",
icon: <i className="iconfont icon-piliangcaozuo"/>,
content: getLabel(543190, "批量取消停缴")
},
{
key: "exportAll",
icon: <i className="iconfont icon-daochu"/>,
content: getLabel(81272, "导出全部")
},
{
key: "exportSelected",
icon: <i className="iconfont icon-piliangdaochu"/>,
content: getLabel(512938, "导出选中")
},
...menus
];
break;
default:
break;
}
}
return menus;
};
export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdvanceSearch, onImport, showOperateBtn) => {
let reqBtns = showOperateBtn ? [
<Button type="primary" onClick={onImport}>{getLabel(32935, "导入")}</Button>,
<AdvanceInputBtn onOpenAdvanceSearch={onOpenAdvanceSearch} onAdvanceSearch={onAdvanceSearch}/>
] : [<AdvanceInputBtn onOpenAdvanceSearch={onOpenAdvanceSearch} onAdvanceSearch={onAdvanceSearch}/>];
if (showOperateBtn) {
switch (selectedKey) {
case "1":
reqBtns.unshift(<WeaHelpfulTip
width={300} placement="topLeft"
title={
<span>
{getLabel(544348, "提示:缴纳月份区间包含起始缴纳月,不包含最后缴纳月; 若员工离职时还未增员进入在缴员工,则数据会自动清除,因此若确认缴纳,请及时维护档案数据并增员操作。若清除后还需缴纳,需先在个税扣缴义务人菜单将员工按离职状态添加回来,会重新出现在待增员。")}
</span>
}
/>);
break;
case "3":
reqBtns.shift();
reqBtns.unshift(<WeaHelpfulTip
width={300} placement="topLeft"
title={HelpfulDiv}
/>);
break;
case "4,5":
reqBtns.shift();
reqBtns.unshift(<WeaHelpfulTip
width={300} placement="topLeft"
title={CancelHelpfulDiv}
/>);
break;
default:
break;
}
}
return reqBtns;
};
export const logConditions = [
{
items: [
{
colSpan: 1,
conditionType: "BROWSER",
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: "1"
},
domkey: ["employeeId"],
fieldcol: 17,
label: "对象",
lanId: 106,
labelcol: 7,
value: ""
},
{
colSpan: 1,
conditionType: "BROWSER",
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: "1"
},
domkey: ["operator"],
fieldcol: 17,
label: "操作人",
lanId: 111,
labelcol: 7,
value: ""
}
],
defaultshow: true
}
];
export const getLogSearchsForm = (form, condition, onSearch = () => void (0)) => {
const { isFormInit } = form;
const formParams = form.getFormParams();
let group = [];
isFormInit && condition && condition.map(c => {
let items = [];
c.items.map(fields => {
items.push({
com: (
<WeaFormItem
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom"
>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
{
getKey(fields) === "operator" &&
<Button type="primary" onClick={onSearch}
style={{ position: "absolute", right: "-70px", top: "0" }}>{getLabel(388113, "搜索")}</Button>
}
</WeaFormItem>),
colSpan: 1
});
});
group.push(
<WeaSearchGroup col={4} needTigger={true} title={c.title} showGroup={c.defaultshow} items={items} center={false}
/>);
});
return group;
};
export const welfareConditions = [
{
defaultshow: true,
title: "basic",
col: 3,
items: [
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["username"],
fieldcol: 14,
label: "姓名",
lanId: 25034,
labelcol: 10,
value: "",
viewAttr: 1
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["department"],
fieldcol: 14,
label: "部门",
lanId: 27511,
labelcol: 10,
value: "",
viewAttr: 1
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["position"],
fieldcol: 14,
label: "岗位",
lanId: 6086,
labelcol: 10,
value: "",
viewAttr: 1
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["telephone"],
fieldcol: 14,
label: "手机号",
lanId: 125238,
labelcol: 10,
value: "",
viewAttr: 1
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["hiredate"],
fieldcol: 14,
label: "入职日期",
lanId: 1516,
labelcol: 10,
value: "",
viewAttr: 1
}
]
},
{
defaultshow: true,
title: "taxAgent",
col: 1,
items: [
{
colSpan: 3,
conditionType: "SELECT",
domkey: ["paymentOrganization"],
fieldcol: 16,
label: "个税扣缴义务人",
lanId: 537996,
labelcol: 8,
value: "",
options: [],
viewAttr: 1
}
]
},
{
defaultshow: true,
title: "social", typename: "SOCIAL_SECURITY",
col: 2, showPaid: true,
items: [
{
colSpan: 3,
conditionType: "SELECT",
domkey: ["socialSchemeId"],
fieldcol: 14,
label: "社保方案名称",
lanId: 111,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "SELECT",
domkey: ["socialUnderTake"],
fieldcol: 14,
label: "社保个人实际承担方",
lanId: 111,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "MONTHPICKER",
domkey: ["socialStartTime"],
fieldcol: 14,
label: "社保起始缴纳月",
lanId: 542507,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["schemeAccount"],
fieldcol: 14,
label: "社保账号",
lanId: 81594,
labelcol: 10,
value: "",
viewAttr: 2
},
{
colSpan: 3,
conditionType: "MONTHPICKER",
domkey: ["socialEndTime"],
fieldcol: 14,
label: "社保最后缴纳月",
lanId: 542508,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
}
]
},
{
defaultshow: true,
title: "fund", typename: "ACCUMULATION_FUND",
col: 2, showPaid: true,
items: [
{
colSpan: 3,
conditionType: "SELECT",
domkey: ["fundSchemeId"],
fieldcol: 14,
label: "公积金方案名称",
lanId: 111,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "SELECT",
domkey: ["fundUnderTake"],
fieldcol: 14,
label: "公积金个人实际承担方",
lanId: 111,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "MONTHPICKER",
domkey: ["fundStartTime"],
fieldcol: 14,
label: "公积金起始缴纳月",
lanId: 542509,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["fundAccount"],
fieldcol: 14,
label: "公积金账号",
lanId: 542268,
labelcol: 10,
value: "",
viewAttr: 2
},
{
colSpan: 3,
conditionType: "MONTHPICKER",
domkey: ["fundEndTime"],
fieldcol: 14,
label: "公积金最后缴纳月",
lanId: 542510,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["supplementFundAccount"],
fieldcol: 14,
label: "补充公积金账号",
lanId: 542270,
labelcol: 10,
value: "",
viewAttr: 2
}
]
},
{
defaultshow: true,
title: "others", typename: "OTHER",
col: 2, showPaid: true,
items: [
{
colSpan: 3,
conditionType: "SELECT",
domkey: ["otherSchemeId"],
fieldcol: 14,
label: "其它福利名称",
lanId: 111,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "SELECT",
domkey: ["otherUnderTake"],
fieldcol: 14,
label: "其它福利个人实际承担方",
lanId: 111,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "MONTHPICKER",
domkey: ["otherStartTime"],
fieldcol: 14,
label: "其他福利起始缴纳月",
lanId: 542511,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
},
{
colSpan: 3,
conditionType: "MONTHPICKER",
domkey: ["otherEndTime"],
fieldcol: 14,
label: "其他福利最后缴纳月",
lanId: 542512,
labelcol: 10,
value: "",
options: [],
viewAttr: 2
}
]
}
];
export const getWelfareSearchsForm = (form, condition, onChange = () => void (0), onNoPaymentChange = () => void (0), onExtraChange = () => void (0), onSameChange = () => void (0), payload, extraFormField) => {
const CustomComponent = ({ type }) => {
const value = payload[type].nonPayment ? payload[type].nonPayment.toString() : "";
return <WeaCheckbox
value={value} content={getLabel(543196, "暂不缴纳")}
onChange={v => onNoPaymentChange(type, v)}
disabled={runStatuses === "4,5"}
/>;
};
const { socialBase, fundBase, otherBase, runStatuses } = extraFormField;
const { isFormInit } = form;
const formParams = form.getFormParams();
let group = [];
isFormInit && condition && condition.map(c => {
let items = [];
c.items.map(fields => {
items.push({
com: (
<WeaFormItem
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom"
>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams} onChange={onChange}/>
</WeaFormItem>),
colSpan: 1,
hide: fields.hide
});
});
!_.isEmpty(items) && group.push(
<WeaSearchGroup col={c.col} needTigger={true} showGroup={c.defaultshow} items={items} center={false}
title={c.title}
customComponent={c.showPaid ? <CustomComponent type={c.typename}/> : <span></span>}
className={c.col === 3 ? "basic-welfare-info-wrapper" : (c.col === 2 || c.items.length > 1) ? "twoColumns-welfare-info-wrapper" : ""}
/>);
});
return _.reduce(group, (pre, cur) => {
if (cur.props.title === getLabel(543194, "社保基础信息") && _.every(socialBase.items, o => o.items.length > 0)) {
if (!_.isNil(socialBase.comItems) && _.every(socialBase.comItems, o => o.items.length > 0)) {
return [
...pre, cur,
<BenefitBaseComponent
dataSource={_.map(socialBase.items, o => ({ ...o, title: `${o.title}${getLabel(500201, "个人")}` }))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
<BenefitBaseComponent
dataSource={_.map(socialBase.comItems, o => ({
...o, title: `${o.title}${getLabel(1851, "公司")}`,
items: _.map(o.items, g => ({ ...g, domkey: [`${getKey(g)}_com`] }))
}))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>
];
} else {
return [...pre, cur,
<BenefitBaseComponent dataSource={socialBase.items} value={payload}
onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>];
}
} else if (cur.props.title === getLabel(543197, "公积金基础信息") && _.every(fundBase.items, o => o.items.length > 0)) {
if (!_.isNil(fundBase.comItems) && _.every(fundBase.comItems, o => o.items.length > 0)) {
return [
...pre, cur,
<BenefitBaseComponent
dataSource={_.map(fundBase.items, o => ({ ...o, title: `${o.title}${getLabel(500201, "个人")}` }))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
<BenefitBaseComponent
dataSource={_.map(fundBase.comItems, o => ({
...o, title: `${o.title}${getLabel(1851, "公司")}`,
items: _.map(o.items, g => ({ ...g, domkey: [`${getKey(g)}_com`] }))
}))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>
];
} else {
return [...pre, cur,
<BenefitBaseComponent dataSource={fundBase.items} value={payload} onChange={onExtraChange}
onSameChange={onSameChange} runStatuses={runStatuses}/>];
}
} else if (cur.props.title === getLabel(543198, "其他福利基础信息") && _.every(otherBase.items, o => o.items.length > 0)) {
if (!_.isNil(otherBase.comItems) && _.every(otherBase.comItems, o => o.items.length > 0)) {
return [
...pre, cur,
<BenefitBaseComponent
dataSource={_.map(otherBase.items, o => ({ ...o, title: `${o.title}${getLabel(500201, "个人")}` }))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
<BenefitBaseComponent
dataSource={_.map(otherBase.comItems, o => ({
...o, title: `${o.title}${getLabel(1851, "公司")}`,
items: _.map(o.items, g => ({ ...g, domkey: [`${getKey(g)}_com`] }))
}))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>
];
} else {
return [...pre, cur,
<BenefitBaseComponent dataSource={otherBase.items} value={payload} onChange={onExtraChange}
onSameChange={onSameChange} runStatuses={runStatuses}/>];
}
}
return [...pre, cur];
}, []);
};
const BenefitBaseComponent = (props) => {
const { dataSource, value, onChange, onSameChange, runStatuses } = props;
return <React.Fragment>
{
_.map(dataSource, item => {
const { title, items } = item;
return <WeaSearchGroup
items={_.map(items, child => ({
com: <WeaFormItem label={child.label} labelCol={{ span: 10 }} wrapperCol={{ span: 14 }}>
<WeaInputNumber
value={value[getKey(child)] || (child.min !== "0.000" ? child.min : 0)} precision={2}
min={child.min !== "0.000" ? child.min : -999999999999999}
max={child.max !== "0.000" ? child.max : 999999999999999}
onChange={v => onChange(getKey(child), v)}
viewAttr={runStatuses === "4,5" ? 1 : 2}
/>
</WeaFormItem>
}))}
customComponent={<div className="welfare-same-box">
<span>{getLabel(543195, "各项福利基数一致")}</span>
<WeaInputNumber style={{ width: 100 }} onBlur={v => onSameChange(items, v)}
disabled={runStatuses === "4,5"}/>
</div>}
title={title} col={2} showGroup className="twoColumns-welfare-info-wrapper"
/>;
})
}
</React.Fragment>;
};

View File

@ -0,0 +1,185 @@
/*
* Author: 黎永顺
* name: 社保福利档案页面重构
* Description:
* Date: 2023/10/31
*/
import React, { Component } from "react";
import { WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaTab } from "ecCom";
import { message } from "antd";
import { inject, observer } from "mobx-react";
import WelfareAdvanceSearchPannel from "./components/welfareAdvanceSearchPannel";
import WelfareTableList from "./components/welfareTableList";
import WelfareArchivesImportDialog from "./components/welfareArchivesImportDialog";
import WelfareTip from "./components/welfareTip";
import LogDialog from "./components/logDialog";
import * as API from "../../../apis/welfareArchive";
import { sysinfo } from "../../../apis/ruleconfig";
import { optTypeEnum, renderDropMenuDatas, renderReqBtns, tabList, welfareTipList } from "./config";
import { convertToUrlString } from "../../../util/url";
import cs from "classnames";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
const APILIST = {
fullStaffIncrease: API.allStayAddToPay,
fullReduction: API.allStayDelToStop
};
@inject("taxAgentStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
selectedKey: "1", showSearchAd: false, isQuery: false, logDialogVisible: false,
topTabCount: { stayAdd: 0, paying: 0, stayDel: 0, stopPay: 0, ext: 0 },
welfareImpDialog: { visible: false, title: getLabel(24023, "数据导入"), runStatuses: "" },
showExtEmpsWitch: false
};
}
async componentDidMount() {
// extEmpsWitch //非系统人员开关, 1 开启, 0关闭
const [{ data: { extEmpsWitch } }] = await Promise.all([sysinfo()]);
this.setState({ showExtEmpsWitch: extEmpsWitch === "1" });
}
queryInsuranceTabTotal = (active, total) => {
API.queryInsuranceTabTotal().then(({ status, data }) => {
if (status) {
const key = _.find(tabList, o => o.viewcondition === active).groupid;
this.setState({
topTabCount: { ...this.state.topTabCount, ...data, [key]: total }
});
}
});
};
handleOpenAdvanceSearch = () => this.setState({ showSearchAd: true });
handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });
handleImport = () => {
this.setState({
welfareImpDialog: {
...this.state.welfareImpDialog, visible: true,
runStatuses: this.state.selectedKey
}
});
};
onDropMenuClick = (key) => {
switch (key) {
case "fullStaffIncrease":
case "fullReduction":
this.handleFullOptions(key);
break;
case "batchStaffIncrease":
case "batchDeleteTodolist":
case "batchReduction":
case "batchCancellationOfSuspended":
case "batchDeleteTodolistStayDel":
const type = _.find(optTypeEnum, o => o.key === key).type;
const payload = _.find(optTypeEnum, o => o.key === key).payload;
this.welfareListRef.wrappedInstance.handleBatchOpt(type, payload);
break;
case "exportAll":
case "exportSelected":
this.handleExport(key);
break;
case "log":
this.setState({ logDialogVisible: true });
break;
default:
break;
}
};
onAdSearch = () => this.setState({ showSearchAd: false, isQuery: !this.state.isQuery });
handleFullOptions = (key) => {
WeaLoadingGlobal.start();
APILIST[key]().then(({ status, data, errormsg }) => {
WeaLoadingGlobal.destroy();
if (status) {
const { type, msg } = data;
if (type === "fail") {
message.error(msg);
} else {
message.success(msg);
this.onAdSearch();
}
} else {
message.error(errormsg);
}
}).catch(() => WeaLoadingGlobal.destroy());
};
handleExport = (key) => {
const {
state: { selectedRowKeys },
props: { archivesStore: { welfareForm } }
} = this.welfareListRef.wrappedInstance,
{ selectedKey: runStatuses } = this.state;
let payload = { runStatuses };
if (key.indexOf("Selected") !== -1 && _.isEmpty(selectedRowKeys)) {
message.warning(getLabel(543303, "请选择表格数据"));
return;
}
payload = { ...payload, ids: selectedRowKeys.join(",") };
key.indexOf("Selected") === -1 && (payload = { ...payload, ids: "", ...welfareForm.getFormParams() });
window.open(`/api/bs/hrmsalary/scheme/export?${convertToUrlString(payload)}`, "_blank");
};
render() {
const {
selectedKey, topTabCount, showSearchAd, isQuery,
logDialogVisible, welfareImpDialog, showExtEmpsWitch
} = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
const tipList = _.find(welfareTipList, o => o.viewcondition === selectedKey).list;
return (
<div className="salary-welfare-archive">
<WeaReqTop
title={getLabel(538001, "社保福利档案")} buttonSpace={10} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" showDropIcon onDropMenuClick={this.onDropMenuClick}
dropMenuDatas={renderDropMenuDatas(selectedKey, getLabel, showOperateBtn)}
buttons={renderReqBtns(selectedKey, getLabel, this.handleOpenAdvanceSearch, this.handleAdvanceSearch, this.handleImport, showOperateBtn)}
replaceTab={
<WeaTab
datas={!showExtEmpsWitch ? _.dropRight(tabList) : tabList} autoCalculateWidth
keyParam="viewcondition" selectedKey={selectedKey} counts={topTabCount} countParam="groupid"
onChange={key => this.setState({ selectedKey: key })}
/>
}
>
<div className="salary-welfare-archive-content">
<div
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
<WelfareAdvanceSearchPannel
onCancel={() => this.setState({ showSearchAd: false })}
onAdSearch={this.onAdSearch}
/>
</div>
{/*列表*/}
<WelfareTableList isQuery={isQuery} ref={dom => this.welfareListRef = dom}
runStatuses={selectedKey} showOperateBtn={showOperateBtn}
onChangeTopTabCount={this.queryInsuranceTabTotal}
/>
{/*提示*/}
{!_.isEmpty(tipList) && <WelfareTip dataSource={tipList}/>}
{/*操作日志*/}
<LogDialog visible={logDialogVisible} onCancel={() => this.setState({ logDialogVisible: false })}/>
{/* 导入*/}
<WelfareArchivesImportDialog {...welfareImpDialog}
onCancel={(isFresh) => {
this.setState({
isQuery: isFresh ? !isQuery : isQuery,
welfareImpDialog: {
...this.state.welfareImpDialog, visible: false,
runStatuses: ""
}
});
}}/>
</div>
</WeaReqTop>
</div>
);
}
}
export default Index;

View File

@ -0,0 +1,216 @@
.zIndex0-welfare-archive {
.wea-new-top-req {
z-index: 0 !important;
}
}
.salary-welfare-archive {
min-width: 1000px;
overflow: auto;
width: 100%;
height: 100%;
background: #f6f6f6;
.wea-new-top-req-title > div:first-child > div > div {
padding-left: 0 !important;
.wea-tab {
border-bottom: none;
}
}
.salary-welfare-archive-content {
padding: 8px 16px;
display: flex;
flex-direction: column;
.table-layout {
.ant-spin-nested-loading, .ant-spin-container {
height: 100%;
}
}
.searchAdvanced-condition-hide {
display: none;
}
.searchAdvanced-condition-container {
background: #FFF;
margin-bottom: 10px;
border: 1px solid #e5e5e5;
.wea-search-buttons {
border-top: 1px solid #dadada;
padding: 15px 0;
}
.wea-advanced-searchsAd {
height: 320px;
overflow: hidden auto;
.formItem-delete {
position: absolute;
top: 0;
right: -40px;
}
.searchAdvanced-commonSelect {
border-top: 1px solid #ebebeb;
margin: 0 25px;
padding: 10px 0;
}
.custom-advance-largeSpacing {
padding-left: 26px;
.link {
border: none;
border-radius: 0;
padding: 12px 10px 12px 26px;
color: #2db7f5
}
}
}
}
}
.tip-info-area {
margin-top: 16px;
width: 100%;
border: 1px solid #e5e5e5;
border-radius: 4px;
overflow: hidden;
.title {
height: 40px;
line-height: 40px;
border-bottom: 1px solid #e5e5e5;
padding: 0 16px;
}
.tip-detail {
padding: 16px;
background: #fff;
.tip-item {
line-height: 24px;
font-size: 12px;
}
}
}
}
.salary-welfare-archive-edit-layout {
.titleDialog {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 46px 0 16px;
.titleCol {
flex: 1;
display: flex;
align-items: center;
}
.titleLeftBox {
.titleIcon {
color: #fff;
margin: 0;
width: 40px;
height: 40px;
line-height: 40px;
font-size: 22px;
display: flex;
align-items: center;
justify-content: center;
background: #F14A2D;
border-radius: 50%;
}
.title {
font-size: 14px;
color: #333;
padding-left: 6px;
}
}
.titleRightBox {
justify-content: flex-end;
}
}
.wea-slide-modal-title {
border-bottom: 1px solid #e5e5e5 !important;
}
.wea-slide-modal-content {
height: 100%;
.salary-welfare-archive-edit-area {
background: #f6f6f6;
height: 100%;
overflow-y: auto;
padding: 16px;
.basic-welfare-info-wrapper {
.wea-form-cell-wrapper {
& > div:nth-child(1), & > div:nth-child(2) {
border-right: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
}
& > div:nth-child(3) {
border-bottom: 1px solid #e5e5e5;
}
& > div:nth-child(4), & > div:nth-child(5) {
border-right: 1px solid #e5e5e5;
}
}
}
.twoColumns-welfare-info-wrapper {
.wea-form-cell-wrapper {
& > div:nth-child(1), & > div:nth-child(3) {
border-right: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
}
& > div:nth-child(2), & > div:nth-child(4) {
border-bottom: 1px solid #e5e5e5;
}
& > div:nth-child(5) {
border-right: 1px solid #e5e5e5;
}
}
}
.wea-search-group, .wea-form-cell {
padding: 0;
.wea-form-item {
padding: 5px 16px;
.wea-form-item-label {
color: #666;
}
}
}
.wea-form-cell-wrapper {
background: #FFF;
border: 1px solid #e5e5e5;
}
.welfare-same-box {
& > span {
margin-right: 10px;
}
}
}
}
}

View File

@ -0,0 +1,45 @@
/*
* Author: 黎永顺
* name: 薪资项目拓扑图-查看
* Description:
* Date: 2023/10/26
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import SalaryItemDiagram from "../salaryItemDiagram";
import { getQueryString } from "../../util/url";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
componentDidMount() {
window.addEventListener("message", this.handleReceive, false);
}
handleReceive = async ({ data }) => {
const { type } = data;
if (type === "initDiagram") this.postMessageToChild();
};
componentWillUnmount() {
window.removeEventListener("message", this.handleReceive, false);
}
postMessageToChild = () => {
const i18n = { "公式": getLabel(18125, "公式") };
const { params: payload = {} } = this.props;
const acctEmpId = getQueryString("acctEmpId");
const childFrameObj = document.getElementById("topologyDiagram");
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n, acctEmpId }), "*");
};
render() {
return (
<div style={{ width: "100%", height: "100%" }}>
<SalaryItemDiagram/>
</div>
);
}
}
export default Index;

View File

@ -9,10 +9,14 @@ const { TableStore } = WeaTableNew;
export class ArchivesStore {
@observable logForm = new WeaForm(); // 社保福利档案重构-日志查询条件log
@observable welfareForm = new WeaForm(); // 社保福利档案重构-列表查询form
@observable welfareProfileForm = new WeaForm(); // 社保福利档案重构-员工薪资档案form
@action initWelfareProfileForm = () => {
this.hasBeenModify = false;
this.welfareProfileForm = new WeaForm();
};
@observable hasBeenModify = false; //社保福利档案-员工薪资档数据-是否修改过
@action setHasBeenModify = (v) => this.hasBeenModify = v;//设置社保福利档案-员工薪资档数据
@observable tableStore = new TableStore(

View File

@ -7,13 +7,22 @@ import * as API from "../apis/declare"; // 引入API接口文件
const { TableStore } = WeaTableNew;
export class DeclareStore {
@observable declareForm = new WeaForm(); //薪资核算重构-核算form
// ** 薪资核算重构-初始化核算form **
@action
initDeclareForm = () => this.declareForm = new WeaForm();
@observable tableStore = new TableStore(); // new table
@observable form = new WeaForm(); // nrew 一个form
@observable condition = []; // 存储后台得到的form数据
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示
@observable loading = true; // 数据加载状态
// 列表
@observable listDataSource = [];
@observable listColumns = [];

View File

@ -15,6 +15,15 @@ export const getConditionDomkeys = (condition) => {
});
return domkeyList;
};
// 获取condition的field集合
export const getConditionFields = (condition) => {
return _.reduce(condition, (pre, cur) => {
return {
...pre,
..._.reduce(cur.items, (pre1, cur1) => ({ ...pre1, [cur1["domkey"][0]]: cur1 }), {})
};
}, {});
};
// 渲染form表单: 一般对form的渲染都统一使用该方法
export const getSearchs = (form, condition, col, isCenter, onChange = () => void (0), title) => {