From e34dbca6f73ff701729218e2f19ceda22283a39d Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 14 Feb 2025 11:41:49 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E9=A2=86=E6=82=A6=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/components/FormInfo/index.js | 98 +++++++++++++++++++ .../ly_checkSecondaryVerifyDialog.js | 85 +++++++++++++++- .../hrmSalary/pages/mobilePayroll/index.js | 7 +- .../stores/custom-stores/lingyue/index.js | 2 + 4 files changed, 184 insertions(+), 8 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/FormInfo/index.js diff --git a/pc4mobx/hrmSalary/components/FormInfo/index.js b/pc4mobx/hrmSalary/components/FormInfo/index.js new file mode 100644 index 00000000..d6940489 --- /dev/null +++ b/pc4mobx/hrmSalary/components/FormInfo/index.js @@ -0,0 +1,98 @@ +import React, { Component } from "react"; +import { WeaCheckbox, WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { observer } from "mobx-react"; +import { WeaSwitch } from "comsMobx"; + +const getLabel = WeaLocaleProvider.getLabel; +@observer +export default class FormInfo extends Component { + renderForm = () => { + const { + formFields, form, colCount, itemRender, onSelectedChangeHandle, showLabel, multiColumn, custLabelCol, + childrenComponents + } = this.props; + + let groupArr = []; + const formParams = form.getFormParams(); + const labelVisible = showLabel == null || showLabel == true; + const col = colCount ? colCount : 1; + const labelCol = labelVisible ? (custLabelCol || 6) : 0; + const itemProps = { + // ratio1to2: labelVisible && custLabelCol == null, + style: { marginLeft: 0 }, + tipPosition: "bottom", + labelCol: { span: labelCol }, + wrapperCol: { span: 22 - labelCol } + }; + const textAreaProps = { minRows: 4, maxRows: 4 }; + + formFields.map((fields, i) => { + let formItems = []; + fields.items.map((field, j) => { + const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null; + const showCheckbox = field.checkbox || false; + let label = getLabel(field.lanId, field.label); + if (showCheckbox) + label = { + field.checkboxValue = v === "1"; + onSelectedChangeHandle && onSelectedChangeHandle(field, v); + }}/>; + let coms; + if (customerRender == null) { + coms = ; + } else { + coms = customerRender({ + ...field, helpfulTip: getLabel(field.helpfulTipLanId || "", field.helpfulTip || "") + }, textAreaProps, form, formParams); + } + Object.assign(itemProps, { label, error: form.getError(field) }); + let col = colCount ? colCount : 1; + if (multiColumn != null) {//检查有哪些字段需要一行显示多个 + const idx = _.findIndex(multiColumn, item => item.key === field.domkey[0]); + if (idx > -1) { + col = field.colSpan || 1; + if (multiColumn[idx].labelCol != null)//检查字段是否有配置标题宽度 + Object.assign(itemProps, { + labelCol: { span: multiColumn[idx].labelCol }, + wrapperCol: { span: 24 - multiColumn[idx].labelCol } + }); + } else { + Object.assign(itemProps, { + labelCol: { span: labelCol }, + wrapperCol: { span: 24 - labelCol } + }); + } + } + coms != null && formItems.push({ + com: ({coms}), + col + }); + + if (childrenComponents && childrenComponents[field.domkey[0]]) { + childrenComponents[field.domkey[0]]().map(child => formItems.push(child)); + } + }); + + groupArr.push(); + }); + return groupArr; + }; + + render() { + const { formFields, className, form } = this.props; + if (formFields == null || !form.isFormInit) return (
); + return ( +
{this.renderForm()}
+ ); + } +} diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/ly_checkSecondaryVerifyDialog.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/ly_checkSecondaryVerifyDialog.js index c3975998..47283643 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/ly_checkSecondaryVerifyDialog.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/ly_checkSecondaryVerifyDialog.js @@ -8,18 +8,93 @@ * @description: */ import React, { Component } from "react"; -import { WeaLocaleProvider } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; +import { vouchersConditions } from "./conditions"; +import { commonEnumList } from "../../../../apis/ruleconfig"; +import { convertToUrlString } from "../../../../util/url"; +import { getSearchs } from "../../../../util"; +import "../index.less"; const getLabel = WeaLocaleProvider.getLabel; +@inject("LYStore") +@observer class LyCheckSecondaryVerifyDialog extends Component { - render() { - return ( -
+ constructor(props) { + super(props); + this.state = { + loading: false, conditions: [] + }; + } -
+ componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.initLYForm(); + if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.LYStore.initSecVerifyform(); + } + + initLYForm = () => { + const { type } = this.props; + commonEnumList({ enumClass: "com.engine.salary.enums.ly.LyPZTypeEnum" }) + .then(({ status, data }) => { + type === "salarySum" && (data = data.filter(item => !["SBJTPZ", "SBFFPZ", "GJJJTPZ", "GJJFFPZ"].includes(item.enum))); + type === "socialFundSum" && (data = data.filter(item => !["XZJTPZ", "XZFFPZ", "GJJJTPZ", "GJJFFPZ"].includes(item.enum))); + type === "fundSum" && (data = data.filter(item => !["XZJTPZ", "XZFFPZ", "SBJTPZ", "SBFFPZ"].includes(item.enum))); + if (status) { + this.setState({ + conditions: _.map(vouchersConditions, item => ({ + ...item, items: _.map(item.items, o => ({ + ...o, label: getLabel(o.lanId, o.label), + options: _.map(data, item => ({ key: String(item.value), showname: item.defaultLabel })) + })) + })) + }, () => { + const { LYStore: { form } } = this.props; + form.initFormFields(this.state.conditions); + }); + } + }); + }; + save = () => { + const { LYStore: { form }, ffgsqc, salaryMonth, ffgsqcLabel } = this.props; + let payload = { ...form.getFormParams(), salaryMonth, ffgsqc }; + if (!salaryMonth) { + message.warning(getLabel(111, "薪资所属月参数不能为空")); + return; + } + if (!ffgsqc) { + message.warning(getLabel(111, `${ffgsqcLabel}参数不能为空`)); + return; + } + form.validateForm().then(f => { + if (f.isValid) { + const { ffgsqc } = payload; + _.forEach(ffgsqc.split(","), item => { + payload = { ...payload, ffgsqc: item }; + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/customPage_vouchers_lingyue?${convertToUrlString(payload)}`, "_blank"); + }); + } else { + f.showErrors(); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { conditions, loading } = this.state; + const { LYStore: { form } } = this.props; + return ( + {getLabel(111, "确定")} + ]} + > +
{getSearchs(form, conditions, 1, false)}
+
); } } export default LyCheckSecondaryVerifyDialog; + diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index b29f0c50..466a5f4c 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -49,9 +49,9 @@ export default class MobilePayroll extends React.Component { if (type !== "phone") { const { data, status } = await payrollCheckType(); if (status && data === "PWD") { - // init(false, () => this.getMySalaryBill(this.id)); + init(false, () => this.getMySalaryBill(this.id)); //领悦二开 - await this.initLY(); + // await this.initLY(); } else { this.setState({ captchaVisible: true }); } @@ -228,7 +228,8 @@ export default class MobilePayroll extends React.Component { this.setState({ pwdSetVisible: false })}/> {/*领悦二开*/} - + this.setState({ LYCheckSecVerify: false })}/> ; const { salaryTemplate, salaryGroups, employeeInformation, diff --git a/pc4mobx/hrmSalary/stores/custom-stores/lingyue/index.js b/pc4mobx/hrmSalary/stores/custom-stores/lingyue/index.js index 2e9a4718..1cbfb823 100644 --- a/pc4mobx/hrmSalary/stores/custom-stores/lingyue/index.js +++ b/pc4mobx/hrmSalary/stores/custom-stores/lingyue/index.js @@ -8,4 +8,6 @@ export class LYStore { @action initDataForm = () => this.dataForm = new WeaForm(); @observable acctBookForm = new WeaForm(); //推送核算账簿form @action initAcctBookForm = () => this.acctBookForm = new WeaForm();//重置推送核算账簿form + @observable secVerifyform = new WeaForm();//工资单查看启用二次验证弹框form + @action initSecVerifyform = () => this.secVerifyform = new WeaForm(); }