diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index c72b43a1..e1fc1ff9 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -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}> + {/**/} diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 98912d8a..d53d8fc7 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -201,7 +201,7 @@ export default class MobilePayroll extends React.Component { ; 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 { - { - (_.isNil(confirmStatus) || confirmStatus === "0") && - - } + : @@ -229,13 +227,11 @@ export default class MobilePayroll extends React.Component { store={this.props.mySalaryStore}>
- { - (_.isNil(confirmStatus) || confirmStatus === "0") && - - } +
diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js index 0ddd835d..5fa76f93 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js +++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js @@ -96,13 +96,11 @@ class MySalaryView extends Component { store={this.props.mySalaryStore}>
- { - (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0") && - - } +
@@ -120,7 +118,13 @@ export default MySalaryView; export const ConfirmBtns = (props) => { return
- - + { + props.showAck === "1" && + + } + { + props.showFeedback === "1" && + + }
; }; diff --git a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js index f64ad003..d8a1eeb2 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js @@ -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 ( @@ -156,9 +157,22 @@ class TemplateBaseSettings extends Component { })}/> + + } + + this.setState({ + ackFeedbackSetting: { + ...ackFeedbackSetting, feedbackStatus + } + })}/> + + { + feedbackStatus === "1" && + this.setState({ adjLogRecordDialog: { - adjLogRecordDialog, visible: false, title: "", salaryArchiveId: "" + ...adjLogRecordDialog, visible: false, title: "", salaryArchiveId: "" } })} /> diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/conditions.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/conditions.js index dc8797e1..1bbae152 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/conditions.js @@ -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", diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js index 770c1665..904d9ca4 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js @@ -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: "/" }); diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js index d923290e..e59cf608 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js @@ -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", diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/paymentPeriodModal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/paymentPeriodModal.js index 6621acd5..a78983d5 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/paymentPeriodModal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/paymentPeriodModal.js @@ -61,7 +61,9 @@ class PaymentPeriodModal extends Component { const { monthList, allSelect } = this.state; const buttons = [ , - + ]; const options = [ { label: "一月", value: "1" }, diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareAdvanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareAdvanceSearchPannel/index.js index 11fb3505..334b851e 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareAdvanceSearchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareAdvanceSearchPannel/index.js @@ -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); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.js new file mode 100644 index 00000000..e78bba6f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.js @@ -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 ( +
+ planSearchForm.updateFields({ schemeName: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.less new file mode 100644 index 00000000..9081d39f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.less @@ -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; + } +} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanAdvanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanAdvanceSearchPannel/index.js new file mode 100644 index 00000000..0ea2dcc2 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanAdvanceSearchPannel/index.js @@ -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 ( + +
+ {getSearchs(planSearchForm, searchConditons, 2, false)} +
+
+
+ + + + + + + + + +
+
+
+ ); + } +} + +export default WelfarePlanAdvanceSearchPannel; + diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCopyDialog/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCopyDialog/index.js new file mode 100644 index 00000000..59af2d46 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCopyDialog/index.js @@ -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 ( + {getLabel(537558, "保存")} + ]} + > +
{getSearchs(planCopyForm, conditions, 1, false)}
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCustomDialog/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCustomDialog/index.js new file mode 100644 index 00000000..d8f277d3 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCustomDialog/index.js @@ -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 ( + {getLabel(537558, "保存")} + ] : []} + > +
{getSearchs(planCustomForm, conditions, 1, false)}
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js new file mode 100644 index 00000000..a70da52f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js @@ -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
+
+
+
{title}
+
+
+ { + showOperateBtn && + + } +
+
; + }; + 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 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 ( + this.handleClose(false)} + content={
+ {getSearchs(planForm, conditions, 1, false, this.onChange)} + + + +
} + /> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/planSetTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/planSetTable.js new file mode 100644 index 00000000..9447e487 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/planSetTable.js @@ -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 => ({text}) + }] + }, + { + title: getLabel(543168, "是否缴费"), + dataIndex: "isPayment", + key: "isPayment", + width: 120, + com: [{ + type: "custom", + key: "custom", + render: (text, record, index, onEdit) => ( + 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 => ({text}) + }] + }, + { + title: , + dataIndex: "paymentCycle", + key: "paymentCycle", + width: 200, + com: [{ + type: "custom", + key: "custom", + render: (text, record, index, onEdit) => (
+ onEdit({ + record: { ...record, paymentCycle, accountType: paymentCycle }, + index, key: "custom" + })}/> + { + showOperateBtn && text === "1" && + this.setState({ + paymentPeriodModal: { + record: record, visible: true, + cycleSetting: record.cycleSetting || "000000000000" + } + })}>{getLabel(30747, "设置")} + } +
) + }] + }, + { + title: getLabel(543170, "核算方式"), + dataIndex: "accountType", + key: "accountType", + width: 200, + com: [{ + type: "custom", + key: "custom", + render: (text, record, index, onEdit) => ( + 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) => ( + 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) => ( + 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) => ( + 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) => ( + 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) => ( + 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) => ( + onEdit({ + record: { ...record, rententionRule }, + index, key: "custom" + })}/>) + }] + } + ]; + return ( + + this.setState({ datas }, () => this.props.onPlanSet(this.state.datas))} + /> + this.setState({ + paymentPeriodModal: { + visible: false, record: {}, cycleSetting: "000000000000" + } + })} + onSetPaymentPeriod={this.handleSetPaymentPeriod} + /> + + ); + } +} + +export default PlanSetTable; + +const PaymentCycleTitle = () => (
+ {getLabel(543158, "缴纳周期")} + +
{getLabel(544738, "例:养老保险缴纳周期选择3/6/9/12;")}
+
+
+ { + getLabel(544739, "若:核算方式选择基数求和*比例;则数据核算逻辑为:\n" + + " 账单月1月2月时,养老保险不会被核算;\n" + + " 账单月3月时,养老保险核算金额为:养老保险月缴纳基数*3*缴纳比例+固定费用*3\n" + + " (3代表1月2月3月 3个月,*3代表3个月基数相加和固定费用相加)") + } +
+
+
+ { + getLabel(544740, "若:核算方式选择基数*比例再求和;则数据核算逻辑为:\n" + + " 账单月1月2月时,养老保险不会被核算;\n" + + " 账单月3月时,养老保险核算金额为:\n" + + " 将1~3月算出来的【养老保险月缴纳基数*缴纳比例+固定费用】求和") + } +
+
+
{getLabel(544741, "若:缴纳周期选择选择月缴,则核算方式默认为【基数*比例+固定费用】,不可修改")}
+
+ } + placement="topLeft" + /> +); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js new file mode 100644 index 00000000..af9ea9da --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js @@ -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) => ( this.handleOpts("edit", record)}>{text}) + }; + break; + case "paymentType": + col = { ...col, width: 100 }; + break; + case "paymentScope": + col = welfareTypeEnum !== "CUSTOM" ? { ...col, width: 300 } : { + ...col, width: "30%", + render: (__, record) => ({record[`${dataIndex}Span`]}) + }; + break; + case "remarks": + col = { ...col, width: 200 }; + break; + case "welfareType": + col = { + ...col, width: "30%", + render: (__, record) => ({record[`${dataIndex}Span`]}) + }; + break; + case "isUse": + col = { + ...col, render: (__, record) => ( 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) => () + } : { + title: getLabel(18610, "操作"), + dataIndex: "operation", width: 165, + render: (__, record) => () + }; + return ( +
+ + { + selectedKey === "CUSTOM" && +
+ } + {/*复制方案*/} + this.setState({ + copyDialog: { ...copyDialog, visible: false, conditions: [] } + }, () => isRefrese && this.getList(this.props))} + /> + {/*新建编辑自定义方案*/} + this.setState({ + customDialog: { ...customDialog, visible: false, customId: "" } + }, () => isRefrese && this.getList(this.props))} + /> + {/*新建编辑方案*/} + this.setState({ + welfarePlanEditSlide: { ...welfarePlanEditSlide, visible: false } + }, () => isFresh && this.getList(this.props))} + /> +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/config.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/config.js new file mode 100644 index 00000000..acff5efa --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/config.js @@ -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: , + content: getLabel(545781, "操作日志") + }]; +}; +export const renderReqBtns = (selectedKey, onSalaryOpts, showOperateBtn, customQuery) => { + let reqBtns = [ + , + onSalaryOpts("OPEN")} onAdvanceSearch={() => onSalaryOpts("SEARCH")}/> + ]; + switch (selectedKey) { + case "CUSTOM": + reqBtns[reqBtns.length - 1] = 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 + } +]; + + diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js new file mode 100644 index 00000000..67dc9751 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js @@ -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 ( +
+ } + 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)} + > +
+
+ this.setState({ showSearchAd: false })} + onAdSearch={this.onAdSearch} + /> +
+ {/*列表*/} + this.welfarePlanListRef = dom} customQuery={customQuery} + selectedKey={selectedKey} isQuery={isQuery}/> +
+ {/*操作日志*/} + this.setState({ logDialogVisible: false })}/> +
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less new file mode 100644 index 00000000..dc2ed68b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less @@ -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; + } + } + } +} + diff --git a/pc4mobx/hrmSalary/stores/programme.js b/pc4mobx/hrmSalary/stores/programme.js index 1459cc09..b8f15b5e 100644 --- a/pc4mobx/hrmSalary/stores/programme.js +++ b/pc4mobx/hrmSalary/stores/programme.js @@ -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 diff --git a/pc4mobx/hrmSalary/style/index.less b/pc4mobx/hrmSalary/style/index.less index 57689171..0d181610 100644 --- a/pc4mobx/hrmSalary/style/index.less +++ b/pc4mobx/hrmSalary/style/index.less @@ -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; -} \ No newline at end of file +} + +//公共彈框表单样式 +.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; + } + } + } +}