Merge branch 'release/2.10.1.2401.02' into feature/2.10.1.2401.01-页面操作日志添加

This commit is contained in:
黎永顺 2024-02-21 10:50:36 +08:00
commit 949b907e89
23 changed files with 1927 additions and 42 deletions

View File

@ -5,7 +5,8 @@ import HistoricalPayroll from "./pages/historicalPayroll";
import SalaryAdjustmentRecords from "./pages/salaryAdjustmentRecords";
import MySalaryMobile from "./pages/mySalaryMobile";
import MySalary from "./pages/mySalaryBenefits";
import Programme from "./pages/socialSecurityBenefits/programme";
import Programme from "./pages/socialSecurityBenefits/welfarePlan";
import Programme_old from "./pages/socialSecurityBenefits/programme";
// import Archivess from "./pages/socialSecurityBenefits/archives";
import Archives from "./pages/socialSecurityBenefits/welfareArchive"; //社保福利档案重构页面
import StandingBookDemo from "./pages/socialSecurityBenefits/standingBook";
@ -129,6 +130,7 @@ const Routes = (
path="socialSecurityBenefits"
component={SocialSecurityBenefits}>
<Route key="programme" path="programme" component={Programme}/>
<Route key="programme_old" path="programme_old" component={Programme_old}/>
<Route key="archives" path="archives" component={Archives}/>
{/*<Route key="archives_demo" path="archives_demo" component={Archivess}/>*/}
<Route key="standingBook_demo" path="standingBook_demo" component={StandingBookDemo}/>

View File

@ -201,7 +201,7 @@ export default class MobilePayroll extends React.Component {
</div>;
const {
salaryTemplate, salaryGroups, employeeInformation,
sendTime, confirmStatus
sendTime, confirmStatus, showAck, showFeedback
} = toJS(this.props.mySalaryStore.mySalaryBill);
const salaryProps = {
theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime,
@ -215,13 +215,11 @@ export default class MobilePayroll extends React.Component {
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
store={this.props.mySalaryStore}>
<MobileTemplate {...salaryProps} title={getLabel(111, "工资单查看")}>
{
(_.isNil(confirmStatus) || confirmStatus === "0") &&
<ConfirmBtns
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
}
<ConfirmBtns
showAck={showAck} showFeedback={showFeedback}
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
</MobileTemplate>
</Authority>
:
@ -229,13 +227,11 @@ export default class MobilePayroll extends React.Component {
store={this.props.mySalaryStore}>
<div className="weapp-salary-my-salary-view-payroll">
<Content {...salaryProps}>
{
(_.isNil(confirmStatus) || confirmStatus === "0") &&
<ConfirmBtns
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
}
<ConfirmBtns
showAck={showAck} showFeedback={showFeedback}
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
</Content>
</div>
</Authority>

View File

@ -96,13 +96,11 @@ class MySalaryView extends Component {
store={this.props.mySalaryStore}>
<div className="weapp-salary-my-salary-view-payroll">
<Content {...salaryProps}>
{
(_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0") &&
<ConfirmBtns
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
}
<ConfirmBtns
showAck={mySalaryStore.showAck} showFeedback={mySalaryStore.showFeedback}
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
</Content>
</div>
</Authority>
@ -120,7 +118,13 @@ export default MySalaryView;
export const ConfirmBtns = (props) => {
return <div className="space">
<Button type="primary" onClick={props.confirmSalaryBill}>{getLabel(111, "确认")}</Button>
<Button type="ghost" onClick={props.goFeedback}>{getLabel(111, "反馈")}</Button>
{
props.showAck === "1" &&
<Button type="primary" onClick={props.confirmSalaryBill}>{getLabel(111, "确认")}</Button>
}
{
props.showFeedback === "1" &&
<Button type="ghost" onClick={props.goFeedback}>{getLabel(111, "反馈")}</Button>
}
</div>;
};

View File

@ -34,6 +34,7 @@ class TemplateBaseSettings extends Component {
},
ackFeedbackSetting: {
ackStatus: "0",
feedbackStatus: "0",
autoAckDays: 7,
feedBackUrl: "",
mobileFeedbackUrl: ""
@ -97,7 +98,7 @@ class TemplateBaseSettings extends Component {
render() {
const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state;
const { ackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
const { ackStatus, feedbackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
const { limitMonth = 0 } = salaryBillViewingLimitSetting;
return (
<React.Fragment>
@ -156,9 +157,22 @@ class TemplateBaseSettings extends Component {
})}/>
<WeaHelpfulTip
title={getLabel(111, "开启后,还需在计划任务中配置定时任务,执行自动确认任务;邮箱端查看工资单暂不支持确认及反馈;")}
style={{ marginLeft: 10 }}
style={{ marginLeft: 5 }}
placement="top" width={200}/>
</WeaFormItem>
</React.Fragment>
}
<WeaFormItem label={getLabel(111, "启用工资单反馈")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
<WeaCheckbox value={feedbackStatus} display="switch"
onChange={feedbackStatus => this.setState({
ackFeedbackSetting: {
...ackFeedbackSetting, feedbackStatus
}
})}/>
</WeaFormItem>
{
feedbackStatus === "1" &&
<React.Fragment>
<WeaFormItem label={getLabel(111, "PC端反馈流程地址")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
<WeaInput
value={feedBackUrl} viewAttr={3}

View File

@ -212,7 +212,7 @@ class Index extends Component {
{...adjLogRecordDialog}
onCancel={() => this.setState({
adjLogRecordDialog: {
adjLogRecordDialog, visible: false, title: "", salaryArchiveId: ""
...adjLogRecordDialog, visible: false, title: "", salaryArchiveId: ""
}
})}
/>

View File

@ -202,6 +202,17 @@ export const tempBaseSetFbConditions = [
hide: false,
rules: "required"
},
{
colSpan: 1,
conditionType: "SWITCH",
domkey: ["feedbackStatus"],
fieldcol: 2,
label: "启用工资单反馈",
lanId: 111,
labelcol: 6,
value: "1",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "INPUT",

View File

@ -132,7 +132,7 @@ class Index extends Component {
} else if (getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") {
return {
...o,
hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"]
hide: _.isNil(fieldsEchoData["feedbackStatus"]) ? o.hide : !fieldsEchoData["feedbackStatus"]
};
}
return { ...o };
@ -171,7 +171,7 @@ class Index extends Component {
}
});
_.map(tempBaseSetFbDomkeys, it => {
if (it === "ackFeedbackStatus") {
if (it === "ackFeedbackStatus" || it === "feedbackStatus") {
payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" });
} else {
payrollTempFeedbackForm.updateFields({ [it]: !_.isNil(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" });
@ -292,18 +292,23 @@ class Index extends Component {
handleFbChange = (params) => {
const { payrollStore: { payrollTempFeedbackForm, setHasBeenModify } } = this.props;
const key = _.keys(params)[0];
if (key === "ackFeedbackStatus") {
if (key === "ackFeedbackStatus" || key === "feedbackStatus") {
this.setState({
fbConditions: _.map(this.state.fbConditions, it => {
if (it.title === getLabel(544092, "工资单确认反馈设置")) {
return {
...it, items: _.map(it.items, o => {
if (getKey(o) === "autoAckDays" || getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") {
if (getKey(o) === "autoAckDays" && key === "ackFeedbackStatus") {
return {
...o, hide: params[key].value === "0"
...o, hide: params["ackFeedbackStatus"].value === "0"
};
} else if (key === "feedbackStatus" && (getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl")) {
return {
...o, hide: params["feedbackStatus"].value === "0"
};
} else {
return { ...o };
}
return { ...o };
})
};
}
@ -312,8 +317,11 @@ class Index extends Component {
}, () => {
payrollTempFeedbackForm.initFormFields(this.state.fbConditions);
const ackFeedbackStatus = payrollTempFeedbackForm.getFormParams().ackFeedbackStatus;
const feedbackStatus = payrollTempFeedbackForm.getFormParams().feedbackStatus;
if (ackFeedbackStatus === "0") payrollTempFeedbackForm.updateFields({
autoAckDays: "7",
autoAckDays: "7"
});
if (feedbackStatus === "0") payrollTempFeedbackForm.updateFields({
feedbackUrl: "/",
mobileFeedbackUrl: "/"
});

View File

@ -51,11 +51,12 @@ class Index extends Component {
const {
replenishRule, autoSendStatus, emailStatus, msgStatus, smsStatus, ...extraBs
} = payrollTempForm.getFormParams(),
{ ackFeedbackStatus, autoAckDays, ...extraFb } = payrollTempFeedbackForm.getFormParams(),
{ ackFeedbackStatus, feedbackStatus, autoAckDays, ...extraFb } = payrollTempFeedbackForm.getFormParams(),
{ formData, smsSettingDialog } = this.tmpBaseSetRef.state;
const payload = {
...toJS(tmplDataSource), ...extraFb, ...formData, ...extraBs,
ackFeedbackStatus: ackFeedbackStatus === "1",
feedbackStatus: feedbackStatus === "1",
autoSendStatus: autoSendStatus === "1",
emailStatus: emailStatus === "1",
msgStatus: msgStatus === "1",

View File

@ -61,7 +61,9 @@ class PaymentPeriodModal extends Component {
const { monthList, allSelect } = this.state;
const buttons = [
<Button type="primary" onClick={onCancel}>保存</Button>,
<Button type="ghost" onClick={() => this.setState({ monthList: [], allSelect: false })}>重置</Button>
<Button type="ghost" onClick={() => this.setState({
monthList: [], allSelect: false
}, () => this.props.onSetPaymentPeriod(this.state.monthList))}>重置</Button>
];
const options = [
{ label: "一月", value: "1" },

View File

@ -5,13 +5,14 @@
* Date: 2023/10/31
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { WeaLocaleProvider, WeaTools } 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;
const getKey = WeaTools.getKey;
@inject("archivesStore")
@observer
@ -27,7 +28,36 @@ class WelfareAdvanceSearchPannel extends Component {
getSaCondition().then(({ status, data }) => {
if (status) {
this.setState({
searchConditions: data.condition
searchConditions: _.map(data.condition, item => ({
...item, items: _.map(item.items, o => {
if (getKey(o) === "departmentIdsStr" || getKey(o) === "positionsStr" || getKey(o) === "subcompanyIdsStr") {
return {
...o, browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: false,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
icon: "icon-coms-hrm",
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: getKey(o) === "departmentIdsStr" ? "57" : getKey(o) === "positionsStr" ? "278" : "194",
viewAttr: 2
}
};
}
return { ...o };
})
}))
}, () => {
const { archivesStore: { welfareForm } } = this.props;
welfareForm.initFormFields(this.state.searchConditions);

View File

@ -0,0 +1,33 @@
/*
* Author: 黎永顺
* name:社保福利方案页面重构-高级搜索
* Description:
* Date: 2024/2/2
*/
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("programmeStore")
@observer
class Index extends Component {
render() {
const { programmeStore: { planSearchForm } } = this.props;
return (
<div className="achrive-advance-search">
<WeaInputSearch value={planSearchForm.getFormParams().schemeName}
onChange={v => planSearchForm.updateFields({ schemeName: v })}
onSearch={this.props.onAdvanceSearch}
/>
<Button type="ghost" className="wea-advanced-search text-elli"
onClick={this.props.onOpenAdvanceSearch}>{getLabel(545754, "高级搜索")}</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

@ -0,0 +1,51 @@
/*
* Author: 黎永顺
* name:社保福利方案页面重构-高级搜索面板
* Description:
* Date: 2024/2/2
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { Button } from "antd";
import { inject, observer } from "mobx-react";
import { getSearchs } from "../../../../../util";
import { searchConditons } from "../../config";
const getLabel = WeaLocaleProvider.getLabel;
@inject("programmeStore")
@observer
class WelfarePlanAdvanceSearchPannel extends Component {
componentDidMount() {
const { programmeStore: { planSearchForm } } = this.props;
planSearchForm.initFormFields(searchConditons);
}
render() {
const { programmeStore: { planSearchForm } } = this.props;
return (
<React.Fragment>
<div className="wea-advanced-searchsAd">
{getSearchs(planSearchForm, searchConditons, 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={() => planSearchForm.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 WelfarePlanAdvanceSearchPannel;

View File

@ -0,0 +1,68 @@
/*
* Author: 黎永顺
* name: 社保福利方案重构-复制
* Description:
* Date: 2024/2/4
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider } from "ecCom";
import { Button, message } from "antd";
import * as API from "../../../../../apis/welfareScheme";
import { getSearchs } from "../../../../../util";
const getLabel = WeaLocaleProvider.getLabel;
@inject("programmeStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.programmeStore.initPlanCopyForm();
}
save = () => {
const { programmeStore: { planCopyForm }, copyId: id, selectedKey } = this.props;
planCopyForm.validateForm().then(f => {
if (f.isValid) {
this.setState({ loading: true });
API.copyScheme({ id, schemeName: planCopyForm.getFormDatas()[`${selectedKey}_schemeName`].value })
.then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.props.onCancel(true);
} else {
message.error(errormsg);
}
});
} else {
f.showErrors();
}
}).catch(() => this.setState({ loading: false }));
};
render() {
const { loading } = this.state;
const { programmeStore: { planCopyForm }, conditions } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 480, height: 46 }} initLoadCss
buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
]}
>
<div className="form-dialog-layout">{getSearchs(planCopyForm, conditions, 1, false)}</div>
</WeaDialog>
);
}
}
export default Index;

View File

@ -0,0 +1,102 @@
/*
* Author: 黎永顺
* name: 社保福利方案-自定义福利新建编辑
* Description:
* Date: 2024/2/4
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
import { Button, message } from "antd";
import * as API from "../../../../../apis/welfareScheme";
import { getConditionDomkeys, getSearchs } from "../../../../../util";
import { customPlanConditons } from "../../config";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("programmeStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, conditions: []
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getCustomCategoryForm(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.programmeStore.initPlanCustomForm();
}
getCustomCategoryForm = (props) => {
API.getCustomCategoryForm({ id: props.customId }).then(({ status, data }) => {
if (status) {
const { form } = data;
this.setState({
conditions: _.map(customPlanConditons, item => ({
...item, items: _.map(item.items, o => {
if (getKey(o) === "welfareType" && props.customId) {
return { ...o, viewAttr: 1 };
} else {
return { ...o, viewAttr: props.showOperateBtn ? o.viewAttr : 1 };
}
})
}))
}, () => {
const { programmeStore: { planCustomForm } } = props;
planCustomForm.initFormFields(this.state.conditions);
_.forEach(getConditionDomkeys(this.state.conditions), k => {
if (k === "paymentScope" && props.customId && form[k]) {
planCustomForm.updateFields({ [k]: { value: form[k].join(",") } });
} else {
planCustomForm.updateFields({ [k]: { value: form[k] || "" } });
}
});
});
}
});
};
save = () => {
const { programmeStore: { planCustomForm }, customId: id, selectedKey } = this.props;
planCustomForm.validateForm().then(f => {
if (f.isValid) {
this.setState({ loading: true });
const payload = {
id, ...planCustomForm.getFormParams(),
paymentScope: planCustomForm.getFormParams().paymentScope.split(",")
};
API[!id ? "createSICategory" : "updateCustomCategory"](payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.props.onCancel(true);
} else {
message.error(errormsg);
}
});
} else {
f.showErrors();
}
}).catch(() => this.setState({ loading: false }));
};
render() {
const { loading, conditions } = this.state;
const { programmeStore: { planCustomForm }, showOperateBtn } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 480, height: 174 }} initLoadCss
buttons={showOperateBtn ? [
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
] : []}
>
<div className="form-dialog-layout">{getSearchs(planCustomForm, conditions, 1, false)}</div>
</WeaDialog>
);
}
}
export default Index;

View File

@ -0,0 +1,209 @@
/*
* Author: 黎永顺
* name:社保方案页面重构-社保方案编辑与查看
* Description:
* Date: 2024/2/5
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTab, WeaTools } from "ecCom";
import PlanSetTable from "./planSetTable";
import { Button, message, Modal } from "antd";
import * as API from "../../../../../apis/welfareScheme";
import { getTaxAgentSelectListAsAdmin } from "../../../../../apis/taxAgent";
import { getConditionDomkeys, getSearchs } from "../../../../../util";
import { planConditons } from "../../config";
import cs from "classnames";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("programmeStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, conditions: [], selectedKey: "2", planDatas: []
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
document.querySelector(".salary-welfare-plan-wrapper").classList.add("zIndex0-welfare-plan");
const promise = this.getForm(nextProps);
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
document.querySelector(".salary-welfare-plan-wrapper").classList.remove("zIndex0-welfare-plan");
nextProps.programmeStore.initPlanForm();
this.setState({ loading: false, conditions: [], selectedKey: "2", planDatas: [] });
}
}
getForm = async (props) => {
const { data: result } = await getTaxAgentSelectListAsAdmin();
const { id, welfareTypeEnum, programmeStore: { planForm }, showOperateBtn } = props;
API.getForm(id ? _.assign({ welfareTypeEnum }, { id }) : { welfareTypeEnum }).then(({ status, data }) => {
if (status) {
const { form: { schemeBatch, schemeDetailList } } = data;
this.setState({
planDatas: schemeDetailList,
conditions: _.map(planConditons, item => ({
...item, items: _.map(item.items, o => {
if (getKey(o) === "taxAgentIds") {
return {
...o, hide: schemeBatch["sharedType"] === "0" || _.isNil(schemeBatch["sharedType"]),
viewAttr: (schemeBatch["sharedType"] === "1" && showOperateBtn) ? 3 : showOperateBtn ? o.viewAttr : 1,
options: _.map(result, k => ({ key: k.id, showname: k.content }))
};
}
return { ...o, viewAttr: showOperateBtn ? o.viewAttr : 1 };
})
}))
}, () => {
planForm.initFormFields(this.state.conditions);
_.map(getConditionDomkeys(this.state.conditions), k => {
if (k === "sharedType") {
planForm.updateFields({ [k]: schemeBatch[k] || "0" });
} else {
planForm.updateFields({ [k]: schemeBatch[k] || "" });
}
});
});
}
});
};
save = async () => {
const { programmeStore: { planForm, setHasBeenModify }, welfareTypeEnum, id } = this.props;
planForm.validateForm().then(f => {
if (f.isValid) {
if (planForm.getFormParams().sharedType === "1" && _.isEmpty(planForm.getFormParams().taxAgentIds)) {
planForm.showError("taxAgentIds", getLabel(111, "\"可见范围\"未填写"));
} else {
const { planDatas } = this.state;
const payload = {
insuranceScheme: {
...planForm.getFormParams(), welfareType: welfareTypeEnum, id,
paymentArea: planForm.getFormParams().paymentType
},
insuranceSchemeDetailList: planDatas
};
this.setState({ loading: true });
API[id ? "updateScheme" : "createScheme"](payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功!"));
setHasBeenModify(false);
this.props.onClose(true);
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
}
} else {
f.showErrors();
}
});
};
renderTitle = () => {
const { loading } = this.state, { title, showOperateBtn } = this.props;
return <div className="titleDialog">
<div className="titleCol titleLeftBox">
<div className="titleIcon"><i className="icon-coms-fa"/></div>
<div className="title">{title}</div>
</div>
<div className="titleCol titleRightBox">
{
showOperateBtn &&
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
}
</div>
</div>;
};
handleClose = (visible = false) => {
const { programmeStore: { hasBeenModify, setHasBeenModify }, onClose } = this.props;
if (hasBeenModify) {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(545770, "确定放弃填写吗?放弃后数据将不会被保存!"),
onOk: () => {
onClose(visible);
setHasBeenModify(false);
}
});
} else {
onClose(visible);
setHasBeenModify(false);
}
};
onChange = (params) => {
const { programmeStore: { planForm, setHasBeenModify } } = this.props;
const key = _.keys(params)[0];
if (key === "sharedType") {
this.setState({
conditions: _.map(this.state.conditions, it => ({
...it, items: _.map(it.items, o => {
if (getKey(o) === "taxAgentIds") {
return {
...o, hide: params[key].value === "0",
rules: params[key].value === "1" ? "required|string" : "",
viewAttr: params[key].value === "1" ? 3 : 2
};
}
return { ...o };
})
}))
}, () => {
planForm.updateFields({ taxAgentIds: "" });
});
}
setHasBeenModify(true);
};
renderTab = () => {
const { selectedKey } = this.state;
return <WeaTab
keyParam="viewcondition" selectedKey={selectedKey}
datas={[
{ title: getLabel(500201, "个人"), viewcondition: "2" },
{ title: getLabel(1851, "公司"), viewcondition: "1" }
]} onChange={v => this.setState({ selectedKey: v })}
/>;
};
handleSetPlanDatas = (datas) => {
const { programmeStore: { setHasBeenModify } } = this.props;
const { planDatas } = this.state;
//先统一上下限值
let dataSource = _.reduce(planDatas, (pre, cur) => {
const curData = _.find(datas, o => o.insuranceId === cur.insuranceId);
if (_.isEmpty(curData)) return [...pre, cur];
return [...pre, { ...cur, lowerLimit: curData.lowerLimit, upperLimit: curData.upperLimit }];
}, []);
//再赋值修改值
dataSource = _.reduce(dataSource, (pre, cur) => {
const curData = _.find(datas, o => o.id === cur.id);
return [...pre, { ...cur, ...curData }];
}, []);
this.setState({ planDatas: dataSource }, () => setHasBeenModify(true));
};
render() {
const { conditions, planDatas, selectedKey } = this.state;
const { programmeStore: { planForm }, showOperateBtn } = this.props;
return (
<WeaSlideModal
className={cs("welfare-plan-edit-layout", { "nopermission-welfare-plan-edit-layout": !showOperateBtn })}
top={0} width={1000} height={100} measureT="%" measureX="px" measureY="%"{...this.props}
direction={"right"} title={this.renderTitle()} onClose={() => this.handleClose(false)}
content={<div className="welfare-plan-edit-area">
{getSearchs(planForm, conditions, 1, false, this.onChange)}
<WeaSearchGroup showGroup needTigger title={this.renderTab()}>
<PlanSetTable dataSource={planDatas} selectedKey={selectedKey} showOperateBtn={showOperateBtn}
onPlanSet={this.handleSetPlanDatas}/>
</WeaSearchGroup>
</div>}
/>
);
}
}
export default Index;

View File

@ -0,0 +1,337 @@
/*
* Author: 黎永顺
* name: 社保方案重构-方案设置列表
* Description:
* Date: 2024/2/5
*/
import React, { Component } from "react";
import { WeaCheckbox, WeaHelpfulTip, WeaInputNumber, WeaLocaleProvider, WeaSelect, WeaTableEdit } from "ecCom";
import PaymentPeriodModal from "../../../programme/paymentPeriodModal";
const getLabel = WeaLocaleProvider.getLabel;
class PlanSetTable extends Component {
constructor(props) {
super(props);
this.state = {
datas: [], paymentPeriodModal: {
visible: false, record: {}, cycleSetting: "000000000000"
}
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.selectedKey !== this.props.selectedKey || nextProps.dataSource !== this.props.dataSource) {
this.setState({ datas: _.filter(nextProps.dataSource, o => String(o.paymentScopeValue) === nextProps.selectedKey) });
}
}
/*
* Author: 黎永顺
* Description: 缴纳周期-自定义设置
* Params:
* Date: 2024/2/6
*/
handleSetPaymentPeriod = (cycleSetting) => {
const { datas, paymentPeriodModal } = this.state;
const { record: { id } } = paymentPeriodModal;
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({
datas: _.map(datas, o => {
if (id === o.id) {
return { ...o, cycleSetting: tmpVStr };
} else {
return o;
}
})
}, () => this.props.onPlanSet(this.state.datas));
};
render() {
const { datas, paymentPeriodModal } = this.state;
const { showOperateBtn } = this.props;
const columns = [
{
title: getLabel(15795, "类型名称"),
dataIndex: "insuranceName",
key: "insuranceName",
width: 120, fixed: "left",
com: [{
type: "custom",
key: "custom",
render: text => (<span>{text}</span>)
}]
},
{
title: getLabel(543168, "是否缴费"),
dataIndex: "isPayment",
key: "isPayment",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaCheckbox value={(!_.isNil(text) && text) ? "1" : "0"} display="switch" viewAttr={showOperateBtn ? 2 : 1}
onChange={isPayment => onEdit({
record: { ...record, isPayment: isPayment === "1" },
index, key: "custom"
})}/>
)
}]
},
{
title: getLabel(543169, "缴纳对象"),
dataIndex: "paymentScope",
key: "paymentScope",
width: 120,
com: [{
type: "custom",
key: "custom",
render: text => (<span>{text}</span>)
}]
},
{
title: <PaymentCycleTitle/>,
dataIndex: "paymentCycle",
key: "paymentCycle",
width: 200,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (<div className="flex-center">
<WeaSelect value={text} options={[
{ key: "0", showname: getLabel(543159, "月缴") },
{ key: "1", showname: getLabel(111, "自定义") }
]} viewAttr={showOperateBtn ? 2 : 1}
onChange={paymentCycle => onEdit({
record: { ...record, paymentCycle, accountType: paymentCycle },
index, key: "custom"
})}/>
{
showOperateBtn && text === "1" &&
<a href="javascript:void(0);" onClick={() => this.setState({
paymentPeriodModal: {
record: record, visible: true,
cycleSetting: record.cycleSetting || "000000000000"
}
})}>{getLabel(30747, "设置")}</a>
}
</div>)
}]
},
{
title: getLabel(543170, "核算方式"),
dataIndex: "accountType",
key: "accountType",
width: 200,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaSelect viewAttr={(record.paymentCycle === "1" && showOperateBtn) ? 2 : 1} value={text} options={[
{ key: "0", showname: getLabel(543160, "基数*比例+固定费用"), disabled: record.paymentCycle === "1" },
{ key: "1", showname: getLabel(543161, "∑基数*比例+∑固定费用") },
{ key: "2", showname: getLabel(543162, "∑(基数*比例+固定费用)") }
]} onChange={accountType => onEdit({
record: { ...record, accountType },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543171, "基数下限"),
dataIndex: "lowerLimit",
key: "lowerLimit",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaInputNumber value={text} min={0} max={record.upperLimit || 99999999999} precision={2}
viewAttr={showOperateBtn ? 2 : 1}
onChange={lowerLimit => onEdit({
record: { ...record, lowerLimit },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543172, "基数上限"),
dataIndex: "upperLimit",
key: "upperLimit",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaInputNumber value={text} min={record.lowerLimit || 0} precision={2} viewAttr={showOperateBtn ? 2 : 1}
onChange={upperLimit => onEdit({
record: { ...record, upperLimit },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543173, "缴纳比例%"),
dataIndex: "paymentProportion",
key: "paymentProportion",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaInputNumber value={text} min={0} precision={4} viewAttr={showOperateBtn ? 2 : 1}
onChange={paymentProportion => onEdit({
record: { ...record, paymentProportion },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543174, "固定费用"),
dataIndex: "fixedCost",
key: "fixedCost",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaInputNumber value={text} min={0} precision={2} viewAttr={showOperateBtn ? 2 : 1}
onChange={fixedCost => onEdit({
record: { ...record, fixedCost },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543175, "有效小数位"),
dataIndex: "validNum",
key: "validNum",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaSelect value={_.isNil(text) ? "2" : String(text)} options={[
{ key: "0", showname: "0" },
{ key: "1", showname: "1" },
{ key: "2", showname: "2" },
{ key: "3", showname: "3" },
{ key: "4", showname: "4" },
{ key: "5", showname: "5" },
{ key: "6", showname: "6" },
{ key: "7", showname: "7" },
{ key: "8", showname: "8" }
]} viewAttr={showOperateBtn ? 2 : 1}
onChange={validNum => onEdit({
record: { ...record, validNum },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543176, "进位规则"),
dataIndex: "rententionRule",
key: "rententionRule",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaSelect value={_.isNil(text) ? "2" : text} viewAttr={showOperateBtn ? 2 : 1}
options={[
{ key: "1", showname: getLabel(19766, "原始数据") },
{ key: "2", showname: getLabel(389654, "四舍五入") },
{ key: "3", showname: getLabel(542722, "向上舍入") },
{ key: "4", showname: getLabel(542723, "向下舍入") },
{ key: "5", showname: getLabel(542724, "见分进角") },
{ key: "6", showname: getLabel(543157, "向上取偶") }
]} onChange={rententionRule => onEdit({
record: { ...record, rententionRule },
index, key: "custom"
})}/>)
}]
}
];
return (
<React.Fragment>
<WeaTableEdit
columns={columns} datas={datas}
showDelete={false} showAdd={false} showCopy={false} showTitle={false}
tableProps={{ scroll: { x: 800 }, bordered: true }}
onChange={datas => this.setState({ datas }, () => this.props.onPlanSet(this.state.datas))}
/>
<PaymentPeriodModal
{...paymentPeriodModal}
onCancel={() => this.setState({
paymentPeriodModal: {
visible: false, record: {}, cycleSetting: "000000000000"
}
})}
onSetPaymentPeriod={this.handleSetPaymentPeriod}
/>
</React.Fragment>
);
}
}
export default PlanSetTable;
const PaymentCycleTitle = () => (<div>
<span>{getLabel(543158, "缴纳周期")}</span>
<WeaHelpfulTip
style={{ paddingLeft: 8 }}
width={480}
title={
<div>
<div>{getLabel(544738, "例养老保险缴纳周期选择3/6/9/12")}</div>
<br/>
<div>
{
getLabel(544739, "若:核算方式选择基数求和*比例;则数据核算逻辑为:\n" +
" 账单月1月2月时养老保险不会被核算\n" +
" 账单月3月时养老保险核算金额为养老保险月缴纳基数*3*缴纳比例+固定费用*3\n" +
" 3代表1月2月3月 3个月*3代表3个月基数相加和固定费用相加")
}
</div>
<br/>
<div>
{
getLabel(544740, "若:核算方式选择基数*比例再求和;则数据核算逻辑为:\n" +
" 账单月1月2月时养老保险不会被核算\n" +
" 账单月3月时养老保险核算金额为\n" +
" 将1~3月算出来的【养老保险月缴纳基数*缴纳比例+固定费用】求和")
}
</div>
<br/>
<div>{getLabel(544741, "若:缴纳周期选择选择月缴,则核算方式默认为【基数*比例+固定费用】,不可修改")}</div>
</div>
}
placement="topLeft"
/>
</div>);

View File

@ -0,0 +1,314 @@
/*
* Author: 黎永顺
* name: 社保福利方案重构-列表
* Description:
* Date: 2024/2/2
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaCheckbox, WeaLoadingGlobal, WeaLocaleProvider, WeaTable } from "ecCom";
import { Dropdown, Menu, message, Modal } from "antd";
import TipLabel from "../../../../../components/TipLabel";
import WelfarePlanCopyDialog from "../welfarePlanCopyDialog";
import WelfarePlanCustomDialog from "../welfarePlanCustomDialog";
import WelfarePlanEditSlide from "../welfarePlanEditSlide";
import { tabWelfarePlanList, welfarePlanCopyConditions, welfarePlanCustomTipList } from "../../config";
import * as API from "../../../../../apis/welfareScheme";
const getLabel = WeaLocaleProvider.getLabel;
const APIFOX = {
SOCIAL_SECURITY: API.getTable,
ACCUMULATION_FUND: API.getTable,
OTHER: API.getTable,
CUSTOM: API.getCustomCategoryList
};
@inject("programmeStore", "taxAgentStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: [], columns: [], loading: false,
pageInfo: { current: 1, pageSize: 10, total: 0 },
copyDialog: { visible: false, title: "", copyId: "", copyName: "", conditions: [] },
customDialog: { visible: false, title: "", customId: "" },
welfarePlanEditSlide: { visible: false, id: "", welfareTypeEnum: "", title: "" }
};
}
componentDidMount() {
this.getList(this.props);
}
componentWillReceiveProps(nextProps, nextContext) {
if ((nextProps.selectedKey !== this.props.selectedKey) || (nextProps.isQuery !== this.props.isQuery)) {
this.setState({
welfarePlanEditSlide: { visible: false, id: "", welfareTypeEnum: "", title: "" },
pageInfo: { ...this.state.pageInfo, current: 1, pageSize: 10, total: 0 }
}, () => this.getList(nextProps));
}
if ((nextProps.selectedKey !== this.props.selectedKey)) {
this.setState({
dataSource: [], columns: [], loading: false,
pageInfo: { current: 1, pageSize: 10, total: 0 },
copyDialog: { visible: false, title: "", copyId: "", copyName: "", conditions: [] }
});
}
}
getList = (props) => {
const {
programmeStore: { planSearchForm }, selectedKey: welfareTypeEnum, customQuery,
taxAgentStore: { showOperateBtn }
} = props;
const { pageInfo } = this.state;
const originPayload = { ...pageInfo, welfareTypeEnum }, customPayload = { welfareTypeEnum: customQuery },
welfarePayload = { ...planSearchForm.getFormParams() };
const payload = welfareTypeEnum === "CUSTOM" ? { ...originPayload, ...customPayload } : { ...originPayload, ...welfarePayload };
this.setState({ loading: true });
APIFOX[welfareTypeEnum](payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { list: dataSource, columns, pageNum: current, pageSize, total } = data;
this.setState({
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
columns: _.map(_.filter(columns, o => (o.dataIndex !== "id" && o.dataIndex !== "paymentArea")), g => {
const { dataIndex } = g;
let col = { ...g, width: "20%" };
switch (dataIndex) {
case "schemeName":
col = {
...col, width: 250,
render: (text, record) => (<a href="javascript:void(0);"
onClick={() => this.handleOpts("edit", record)}>{text}</a>)
};
break;
case "paymentType":
col = { ...col, width: 100 };
break;
case "paymentScope":
col = welfareTypeEnum !== "CUSTOM" ? { ...col, width: 300 } : {
...col, width: "30%",
render: (__, record) => (<span>{record[`${dataIndex}Span`]}</span>)
};
break;
case "remarks":
col = { ...col, width: 200 };
break;
case "welfareType":
col = {
...col, width: "30%",
render: (__, record) => (<span>{record[`${dataIndex}Span`]}</span>)
};
break;
case "isUse":
col = {
...col, render: (__, record) => (<WeaCheckbox
value={record[dataIndex] + ""} display="switch" viewAttr={showOperateBtn ? 2 : 1}
onChange={value => this.handleCustomBenefitsSwitch(record, value)}
/>)
};
break;
default:
break;
}
return col;
})
});
}
}).catch(() => this.setState({ loading: false }));
};
handleOpts = (key, record = {}) => {
const { selectedKey, programmeStore: { planCopyForm } } = this.props;
const { id, schemeName } = record;
switch (key) {
case "edit":
this.setState({
welfarePlanEditSlide: {
visible: true, id, welfareTypeEnum: selectedKey,
title: `${id ? getLabel(501169, "编辑") : getLabel(365, "新建")}${_.find(tabWelfarePlanList, o => o.key === selectedKey).title}${getLabel(111, "方案")}`
}
});
break;
case "delete":
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(111, "确定删除吗?删除后数据不可找回"),
onOk: () => {
API.deleteScheme({ welfareTypeEnum: selectedKey, ids: [id] })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(502230, "删除成功!"));
this.getList(this.props);
} else {
message.error(errormsg);
}
});
}
});
break;
case "custom-delete":
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(111, "确定删除吗?删除后数据不可找回"),
onOk: () => {
WeaLoadingGlobal.start();
API.deleteCustomCategory({ id }).then(({ status, errormsg }) => {
WeaLoadingGlobal.destroy();
if (status) {
message.success(getLabel(502230, "删除成功!"));
this.getList(this.props);
} else {
message.error(errormsg);
}
}).catch(() => WeaLoadingGlobal.destroy());
}
});
break;
case "custom-edit":
this.setState({
customDialog: {
visible: true, customId: id,
title: `${id ? getLabel(501169, "编辑") : getLabel(365, "新建")}${getLabel(543151, "自定义福利")}`
}
});
break;
case "copy":
this.setState({
copyDialog: {
visible: true, copyId: id, copyName: `${schemeName}-${getLabel(77, "复制")}`,
title: `${getLabel(77, "复制")}-${_.find(tabWelfarePlanList, o => o.key === selectedKey).title}`,
conditions: welfarePlanCopyConditions[selectedKey]
}
}, () => {
const { copyDialog: { conditions, copyName } } = this.state;
planCopyForm.initFormFields(conditions);
planCopyForm.updateFields({ [`${selectedKey}_schemeName`]: { value: copyName } });
});
break;
default:
break;
}
};
handleCustomBenefitsSwitch = ({ id }, isUse) => {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: isUse === "1" ? getLabel(111, "确定要启用吗?") : getLabel(111, "确定要停用吗?"),
onOk: () => {
const payload = { id, isUse };
API.updateCustomCategoryStatus(payload).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功");
this.getList(this.props);
} else {
message.error(errormsg || "操作失败");
}
});
},
onCancel: () => {
this.setState({
dataSource: _.map(this.state.dataSource, item => {
if (item.id === id) {
return {
...item, isUse: item.isUse
};
}
return { ...item };
})
});
}
});
};
render() {
const { dataSource, columns, pageInfo, loading, copyDialog, customDialog, welfarePlanEditSlide } = this.state;
const { selectedKey, taxAgentStore: { showOperateBtn } } = this.props;
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.getList(this.props));
},
onChange: current => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => this.getList(this.props));
}
};
const optCols = selectedKey !== "CUSTOM" ? {
title: getLabel(18610, "操作"),
dataIndex: "operation", width: 185,
render: (__, record) => (<div className="planOptBtns">
<a href="javascript:void(0);"
onClick={() => this.handleOpts("edit", record)}>{getLabel(501169, "编辑")}</a>
<a href="javascript:void(0);" onClick={() => this.handleOpts("copy", record)}>{getLabel(77, "复制")}</a>
<Dropdown
overlay={
<Menu>
<Menu.Item>
<a href="javascript:void(0)"
onClick={() => this.handleOpts("delete", record)}>{getLabel(535052, "删除")}</a>
</Menu.Item>
</Menu>
}>
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
</Dropdown>
</div>)
} : {
title: getLabel(18610, "操作"),
dataIndex: "operation", width: 165,
render: (__, record) => (<div className="planOptBtns">
<a href="javascript:void(0);"
onClick={() => this.handleOpts("custom-edit", record)}>{getLabel(501169, "编辑")}</a>
<a href="javascript:void(0);"
onClick={() => this.handleOpts("custom-delete", record)}>{getLabel(535052, "删除")}</a>
</div>)
};
return (
<div className="welfare-plan-adapt">
<div className="adapt-left">
<WeaTable
rowKey="id" dataSource={dataSource} pagination={pagination} loading={loading}
scroll={{ y: "calc(100vh - 182px)" }}
columns={showOperateBtn ? [...columns, optCols] : [...columns, {
title: getLabel(18610, "操作"),
dataIndex: "operation", width: 120,
render: (__, record) => (<a href="javascript:void(0);"
onClick={() => this.handleOpts(selectedKey === "CUSTOM" ? "custom-edit" : "edit", record)}>{getLabel(33564, "查看")}</a>)
}]}
/>
</div>
{
selectedKey === "CUSTOM" &&
<div className="adapt-right"><TipLabel tipList={welfarePlanCustomTipList}/></div>
}
{/*复制方案*/}
<WelfarePlanCopyDialog {...copyDialog} selectedKey={selectedKey}
onCancel={(isRefrese) => this.setState({
copyDialog: { ...copyDialog, visible: false, conditions: [] }
}, () => isRefrese && this.getList(this.props))}
/>
{/*新建编辑自定义方案*/}
<WelfarePlanCustomDialog {...customDialog} selectedKey={selectedKey} showOperateBtn={showOperateBtn}
onCancel={(isRefrese) => this.setState({
customDialog: { ...customDialog, visible: false, customId: "" }
}, () => isRefrese && this.getList(this.props))}
/>
{/*新建编辑方案*/}
<WelfarePlanEditSlide {...welfarePlanEditSlide} showOperateBtn={showOperateBtn}
onClose={(isFresh) => this.setState({
welfarePlanEditSlide: { ...welfarePlanEditSlide, visible: false }
}, () => isFresh && this.getList(this.props))}
/>
</div>
);
}
}
export default Index;

View File

@ -0,0 +1,265 @@
import React from "react";
import { WeaLocaleProvider, WeaSelect, WeaTools } from "ecCom";
import { Button } from "antd";
import AdvanceInputBtn from "./components/advanceInputBtn";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
export const tabWelfarePlanList = [
{ key: "SOCIAL_SECURITY", title: getLabel(538967, "社保") },
{ key: "ACCUMULATION_FUND", title: getLabel(538969, "公积金") },
{ key: "OTHER", title: getLabel(542717, "企业年金及其他福利") },
{ key: "CUSTOM", title: getLabel(543151, "自定义福利") }
];
export const welfarePlanCustomTipList = [
getLabel(544345, "1、可以为社保、公积金、企业年金及其他福利新增自定义的福利项残疾保险等"),
getLabel(544346, "2、新增自定义福利默认启用社保福利方案中的自定义福利项均未开启缴纳当前页面的自定义福利项才可以停用停用后再新增方案时没有该福利项"),
getLabel(544347, "3、自定义福利若要缴纳需要在方案里填写缴纳相关数据")
];
/*
* Author: 黎永顺
* Description: 社保福利方案-头部操作
* Params:
* Date: 2024/2/2
*/
export const renderDropMenuDatas = (selectedKey, showOperateBtn) => {
return [{
key: "log",
icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(545781, "操作日志")
}];
};
export const renderReqBtns = (selectedKey, onSalaryOpts, showOperateBtn, customQuery) => {
let reqBtns = [
<Button type="primary" onClick={() => onSalaryOpts("ADD")}>{getLabel(365, "新建")}</Button>,
<AdvanceInputBtn onOpenAdvanceSearch={() => onSalaryOpts("OPEN")} onAdvanceSearch={() => onSalaryOpts("SEARCH")}/>
];
switch (selectedKey) {
case "CUSTOM":
reqBtns[reqBtns.length - 1] = <WeaSelect style={{ width: 220 }} onChange={v => onSalaryOpts("SEARCH", v)}
value={customQuery}
options={[
{ key: "", showname: getLabel(111, "全部"), selected: true },
{ key: "SOCIAL_SECURITY", showname: getLabel(538967, "社保") },
{ key: "ACCUMULATION_FUND", showname: getLabel(538969, "公积金") },
{ key: "OTHER", showname: getLabel(542717, "企业年金及其他福利") }
]}
/>;
break;
default:
break;
}
!showOperateBtn && reqBtns.shift();
return reqBtns;
};
export const searchConditons = [
{
items: [
{
colSpan: 2,
conditionType: "INPUT",
domkey: ["schemeName"],
fieldcol: 16,
isQuickSearch: true,
label: getLabel(33162, "方案名称"),
labelcol: 8,
value: "",
viewAttr: 2
},
{
colSpan: 2,
conditionType: "SELECT",
domkey: ["paymentTypeEnum"],
fieldcol: 16,
isQuickSearch: true,
label: getLabel(543163, "缴纳类型"),
labelcol: 8,
value: "",
options: [
{ key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") },
{ key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") }
],
viewAttr: 2
}
],
title: getLabel(82743, "基础信息"),
defaultshow: true
}
];
export const welfarePlanCopyConditions = {
SOCIAL_SECURITY: [
{
items: [
{
conditionType: "INPUT",
domkey: ["SOCIAL_SECURITY_schemeName"],
fieldcol: 16,
label: getLabel(111, "社保名称"),
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true,
title: "",
col: 1
}
],
ACCUMULATION_FUND: [
{
items: [
{
conditionType: "INPUT",
domkey: ["ACCUMULATION_FUND_schemeName"],
fieldcol: 16,
label: getLabel(111, "公积金名称"),
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true,
title: "",
col: 1
}
],
OTHER: [
{
items: [
{
conditionType: "INPUT",
domkey: ["OTHER_schemeName"],
fieldcol: 16,
label: getLabel(111, "企业年金及其他福利名称"),
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true,
title: "",
col: 1
}
]
};
export const planConditons = [
{
items: [
{
conditionType: "SELECT",
domkey: ["paymentType"],
fieldcol: 14,
label: getLabel(543163, "缴纳类型"),
labelcol: 6,
options: [
{ key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") },
{ key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") }
],
value: "SCHEME_TOWN",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["schemeName"],
fieldcol: 14,
label: getLabel(33162, "方案名称"),
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["sharedType"],
fieldcol: 14,
label: getLabel(543164, "可见性"),
labelcol: 6,
options: [
{ key: "0", showname: getLabel(111, "公共") },
{ key: "1", showname: getLabel(111, "私有") }
],
value: "0",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["taxAgentIds"],
fieldcol: 14,
label: getLabel(543165, "可见性范围"),
labelcol: 6,
multiple: true,
options: [],
value: "",
hide: true,
viewAttr: 2
},
{
conditionType: "TEXTAREA",
domkey: ["remarks"],
fieldcol: 14,
label: getLabel(536726, "备注"),
labelcol: 6,
value: "",
viewAttr: 2
}
],
title: getLabel(82743, "基础信息"),
defaultshow: true
}
];
export const customPlanConditons = [
{
items: [
{
conditionType: "INPUT",
domkey: ["insuranceName"],
fieldcol: 14,
label: getLabel(111, "福利名称"),
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["welfareType"],
fieldcol: 14,
label: getLabel(500401, "类型"),
labelcol: 8,
options: [
{ key: "SOCIAL_SECURITY", showname: getLabel(538967, "社保") },
{ key: "ACCUMULATION_FUND", showname: getLabel(538969, "公积金") },
{ key: "OTHER", showname: getLabel(542717, "企业年金及其他福利") }
],
value: "SOCIAL_SECURITY",
detailtype: 3,
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["paymentScope"],
fieldcol: 16,
label: getLabel(543169, "缴纳对象"),
labelcol: 8,
options: [
{ key: "SCOPE_COMPANY", showname: getLabel(1851, "公司") },
{ key: "SCOPE_PERSON", showname: getLabel(500201, "个人") }
],
detailtype: 2,
rules: "required|string",
viewAttr: 3
}
],
title: "",
defaultshow: true
}
];

View File

@ -0,0 +1,94 @@
/*
* Author: 黎永顺
* name: 福利方案页面重构
* Description:
* Date: 2024/2/2
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaReqTop } from "ecCom";
import { renderDropMenuDatas, renderReqBtns, tabWelfarePlanList } from "./config";
import WelfarePlanAdvanceSearchPannel from "./components/welfarePlanAdvanceSearchPannel";
import WelfarePlanList from "./components/welfarePlanList";
import LogDialog from "../../../components/logViewModal";
import cs from "classnames";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
selectedKey: "SOCIAL_SECURITY", showSearchAd: false, isQuery: false, logDialogVisible: false,
customQuery: ""
};
this.welfarePlanListRef = null;
}
handleReqBtnsCLick = (type, value) => {
const { selectedKey } = this.state;
switch (type) {
case "ADD":
const { handleOpts } = this.welfarePlanListRef.wrappedInstance || {};
handleOpts(selectedKey === "CUSTOM" ? "custom-edit" : "edit");
break;
case "OPEN":
this.handleOpenAdvanceSearch();
break;
case "SEARCH":
this.handleAdvanceSearch(value);
break;
default:
break;
}
};
handleOpenAdvanceSearch = () => this.setState({ showSearchAd: true });
handleAdvanceSearch = (customQuery = "") => this.setState({ isQuery: !this.state.isQuery, customQuery });
onAdSearch = () => this.setState({ showSearchAd: false, isQuery: !this.state.isQuery });
onDropMenuClick = (key) => {
switch (key) {
case "log":
this.setState({ logDialogVisible: true });
break;
default:
break;
}
};
render() {
const { taxAgentStore: { showOperateBtn } } = this.props;
const { logDialogVisible, selectedKey, showSearchAd, isQuery, customQuery } = this.state;
return (
<div className="salary-welfare-plan-wrapper">
<WeaReqTop
title={getLabel(538000, "社保福利方案")} buttonSpace={10} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" showDropIcon dropMenuDatas={renderDropMenuDatas(selectedKey, showOperateBtn)}
onDropMenuClick={this.onDropMenuClick} tabDatas={tabWelfarePlanList} selectedKey={selectedKey}
onChange={selectedKey => this.setState({ selectedKey, showSearchAd: false, customQuery: "" })}
buttons={renderReqBtns(selectedKey, this.handleReqBtnsCLick, showOperateBtn, customQuery)}
>
<div className="salary-welfare-plan-content">
<div
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
<WelfarePlanAdvanceSearchPannel
onCancel={() => this.setState({ showSearchAd: false })}
onAdSearch={this.onAdSearch}
/>
</div>
{/*列表*/}
<WelfarePlanList ref={dom => this.welfarePlanListRef = dom} customQuery={customQuery}
selectedKey={selectedKey} isQuery={isQuery}/>
</div>
{/*操作日志*/}
<LogDialog visible={logDialogVisible} logFunction={selectedKey === "CUSTOM" ? "siCategory" : "siScheme"}
onCancel={() => this.setState({ logDialogVisible: false })}/>
</WeaReqTop>
</div>
);
}
}
export default Index;

View File

@ -0,0 +1,270 @@
//社保福利方案页面重构
.salary-welfare-plan-wrapper {
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-plan-content {
padding: 8px 16px;
display: flex;
flex-direction: column;
width: 100%;
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: 125px;
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
}
}
}
}
.welfare-plan-adapt {
width: 100%;
flex: 1;
.adapt-left {
width: 100%;
.wea-new-table {
background: #FFF;
}
.planOptBtns {
display: flex;
align-items: center;
a {
margin-right: 10px;
}
a:last-child {
margin-right: 0;
}
}
}
.adapt-right {
width: 100%;
margin-top: 16px;
.tipContentWrapper {
background: #FFF !important;
}
}
}
}
}
.welfare-plan-edit-layout {
.flex-center {
display: flex;
align-items: center;
.wea-select {
flex: 1;
margin-right: 4px;
}
}
.ant-table-fixed-left {
.ant-table-tbody > tr {
height: 41px !important;
}
}
.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;
button:last-child {
margin-left: 10px;
}
}
}
.wea-slide-modal-title {
border-bottom: 1px solid #e5e5e5 !important;
}
.wea-slide-modal-content {
height: 100%;
.welfare-plan-edit-area {
background: #f6f6f6;
height: 100%;
overflow-y: auto;
padding: 16px;
.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;
.wea-form-cell:not(:last-child) {
border-bottom: 1px solid #e5e5e5;
}
}
.wea-select, .ant-select, .ant-select-selection {
width: 100%;
}
.wea-select .wea-select-input .arrow {
position: absolute;
right: 4px;
top: 8px;
color: #666;
}
.wea-select .wdb {
word-break: break-all !important;
word-wrap: break-word !important;
}
.wea-select .wea-select-input {
height: 30px;
white-space: nowrap;
min-width: 100px;
max-width: 426.16px;
width: 100%;
display: inline-block;
padding: 4px 17px 4px 4px;
position: relative;
min-height: 30px;
border: 1px solid #d9d9d9;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
}
.nopermission-welfare-plan-edit-layout {
.ant-table-fixed-left {
.ant-table-tbody > tr {
height: 37.38px !important
}
}
}
.zIndex0-welfare-plan {
.wea-new-top-req {
z-index: 0 !important;
}
}
@media screen and (min-width: 1440px) {
.salary-welfare-plan-content {
.welfare-plan-adapt {
display: flex;
.adapt-left {
width: calc(100% - 390px);
}
.adapt-right {
width: 380px !important;
max-width: 380px !important;
margin-top: 0 !important;
margin-left: 16px;
}
}
}
}

View File

@ -10,6 +10,14 @@ const { TableStore } = WeaTableNew;
export class ProgrammeStore {
//lys-表单初始化(方案查询表单)
@observable planSearchForm = new WeaForm();
@observable planForm = new WeaForm(); //方案-新增编辑Form
@action initPlanForm = () => this.planForm = new WeaForm();//方案-初始化新增编辑Form
@observable planCopyForm = new WeaForm(); //方案-复制Form
@action initPlanCopyForm = () => this.planCopyForm = new WeaForm();//方案-初始化复制Form
@observable planCustomForm = new WeaForm(); //方案-新建编辑自定义方案Form
@action initPlanCustomForm = () => this.planCustomForm = new WeaForm();//方案-初始化新建编辑自定义方案Form
@observable hasBeenModify = false; //社保福利方案-员工薪资档数据-是否修改过
@action setHasBeenModify = (v) => this.hasBeenModify = v;//设置社保福利方案-员工薪资档数据
@observable tableStore = new TableStore(); // new table

View File

@ -6,7 +6,7 @@
height: 100%;
text-align: center;
>div {
> div {
position: absolute;
top: 50%;
margin-top: -10px;
@ -31,6 +31,43 @@
}
.ant-checkbox-wrapper+.ant-checkbox-wrapper {
.ant-checkbox-wrapper + .ant-checkbox-wrapper {
margin-left: 0 !important;
}
}
//公共彈框表单样式
.form-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;
}
}
}
}