From 461944ecedb6e1a66370afe6844467e19117b8d7 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 26 Mar 2025 16:47:59 +0800 Subject: [PATCH 1/5] =?UTF-8?q?release/2.19.1.2501.01-=E4=B8=AA=E7=A8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/deductionListConfirmDialog.js | 12 ++++++++++-- .../hrmSalary/pages/employeedeclareDetail/index.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js index 241daac2..79440338 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js @@ -39,8 +39,16 @@ class DeductionListConfirmDialog extends Component { if (status) { const { columns, list: dataSource, pageNum: current, pageSize, total } = data; this.setState({ - columns, dataSource, - pageInfo: { ...pageInfo, current, pageSize, total } + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: [..._.map(columns, o => { + if (o.dataIndex === "deductFlag") { + return { ...o, render: v => ({v === 1 ? getLabel(111, "是") : getLabel(111, "否")}) }; + } + return { ...o }; + }), { + title: getLabel(111, "操作"), dataIndex: "action", + render: (v, record) => ({getLabel(111, "编辑")}) + }] }); } }).catch(() => this.setState({ loading: false })); diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js index e29cdcf3..159567b1 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js @@ -460,7 +460,7 @@ class Index extends Component { {/*{getLabel(111, "批量编辑")}*/} {/*{getLabel(81272, "导出全部")}*/} {/*{getLabel(543715, "导出所选")}*/} - {/*{getLabel(111, "扣除名单确认")}*/} + {getLabel(111, "扣除名单确认")} ); const buttons = [ From 1549eab2eeab1ec5cc04740692e275ac02a6c5a8 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 27 Mar 2025 09:40:20 +0800 Subject: [PATCH 2/5] =?UTF-8?q?release/2.19.1.2501.01-=E4=B8=AA=E7=A8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/declare.js | 4 + .../components/deductionAmountEditDialog.js | 78 +++++++++++++++++++ .../components/deductionListConfirmDialog.js | 19 +++-- .../deductionListConfirmEmployeeDialog.js | 10 +-- .../pages/employeedeclareDetail/constants.js | 29 ++++++- 5 files changed, 125 insertions(+), 15 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionAmountEditDialog.js diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 473621c9..8243f721 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -296,3 +296,7 @@ export const addDeductionAmount = (params) => { export const deleteDeductionAmount = (params) => { return postFetch("/api/bs/hrmsalary/deductionAmount/delete", params); }; +//扣除名单确认-编辑人员 +export const editDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/edit", params); +}; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionAmountEditDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionAmountEditDialog.js new file mode 100644 index 00000000..47a97b90 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionAmountEditDialog.js @@ -0,0 +1,78 @@ +/* + * 扣除名单确认 + * 编辑是否扣除 + * @Author: 黎永顺 + * @Date: 2025/3/27 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button, message } from "antd"; +import { WeaForm } from "comsMobx"; +import FormInfo from "../../../components/FormInfo"; +import { deductConditions } from "../constants"; +import * as API from "../../../apis/declare"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; +const form = new WeaForm(); + +class DeductionAmountEditDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) form.resetForm(); + } + + initForm = (props) => { + const { record } = props; + this.setState({ + conditions: _.map(deductConditions, item => ({ + ...item, + items: _.map(item.items, o => ({ ...o, value: record[getKey(o)] + "", label: getLabel(o.lanId, o.label) })) + })) + }, () => form.initFormFields(this.state.conditions)); + }; + save = () => { + form.validateForm().then(f => { + if (f.isValid) { + const { id } = this.props.record; + const paylaod = { id, deductFlag: form.getFormParams().deductFlag }; + this.setState({ loading: true }); + API.editDeductionAmount(paylaod).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(this.props.onSuccess); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + + render() { + const { conditions, loading } = this.state; + const height = _.reduce(conditions, (pre, cur) => pre + cur.items.length, 0).length * 47; + return ({getLabel(111, "确定")}, + ]}> + + ); + } +} + +export default DeductionAmountEditDialog; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js index 79440338..70f89a0f 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js @@ -8,8 +8,9 @@ */ import React, { Component } from "react"; import { WeaButtonIcon, WeaDialog, WeaLocaleProvider, WeaTable, WeaTools } from "ecCom"; -import { message, Modal } from "antd"; import DeductionListConfirmEmployeeDialog from "./deductionListConfirmEmployeeDialog"; +import DeductionAmountEditDialog from "./deductionAmountEditDialog"; +import { message, Modal } from "antd"; import * as API from "../../../apis/declare"; const { getLabel } = WeaLocaleProvider, { getUrlParams } = WeaTools; @@ -19,7 +20,7 @@ class DeductionListConfirmDialog extends Component { super(props); this.state = { pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, columns: [], dataSource: [], visible: false, - selectedRowKeys: [] + selectedRowKeys: [], editDialog: { visible: false, record: {} } }; } @@ -47,7 +48,9 @@ class DeductionListConfirmDialog extends Component { return { ...o }; }), { title: getLabel(111, "操作"), dataIndex: "action", - render: (v, record) => ({getLabel(111, "编辑")}) + render: (v, record) => ( this.setState({ + editDialog: { visible: true, record } + })}>{getLabel(111, "编辑")}) }] }); } @@ -61,7 +64,7 @@ class DeductionListConfirmDialog extends Component { API.deleteDeductionAmount({ ids: this.state.selectedRowKeys }).then(({ status, errormsg }) => { if (status) { message.success(getLabel(111, "操作成功")); - this.getDeductionAmountList(); + this.setState({ selectedRowKeys: [] }, () => this.getDeductionAmountList()); } else { message.error(errormsg); } @@ -71,7 +74,7 @@ class DeductionListConfirmDialog extends Component { }; render() { - const { loading, columns, dataSource, pageInfo, visible, selectedRowKeys } = this.state; + const { loading, columns, dataSource, pageInfo, visible, selectedRowKeys, editDialog } = this.state; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -96,7 +99,7 @@ class DeductionListConfirmDialog extends Component { return (
@@ -108,6 +111,10 @@ class DeductionListConfirmDialog extends Component {
+ this.setState({ + editDialog: { visible: false, record: {} } + }, () => callback && callback())}/> this.setState({ visible: false }, () => callback && callback())}/> diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmEmployeeDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmEmployeeDialog.js index 66388df3..1f094b81 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmEmployeeDialog.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmEmployeeDialog.js @@ -92,14 +92,8 @@ class DeductionListConfirmEmployeeDialog extends Component { onClick={this.save}>{getLabel(111, "确认")}, ]} style={{ - width: 1150, - height: 606.6, - minHeight: 200, - minWidth: 380, - maxHeight: "90%", - maxWidth: "90%", - overflow: "hidden", - transform: "translate(0px, 0px)" + width: 1150, height: 490, minHeight: 200, minWidth: 380, maxHeight: "90%", maxWidth: "90%", + overflow: "hidden", transform: "translate(0px, 0px)" }}>
Date: Thu, 27 Mar 2025 10:41:22 +0800 Subject: [PATCH 3/5] =?UTF-8?q?release/2.19.1.2501.01-=E4=B8=AA=E7=A8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/declare.js | 8 ++++ .../components/deductionListConfirmDialog.js | 47 +++++++++++++++++-- .../pages/employeedeclareDetail/index.less | 34 +++++++++----- 3 files changed, 73 insertions(+), 16 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 8243f721..54c6959f 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -300,3 +300,11 @@ export const deleteDeductionAmount = (params) => { export const editDeductionAmount = (params) => { return postFetch("/api/bs/hrmsalary/deductionAmount/edit", params); }; +//扣除名单确认-确认人员 +export const confirmDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/confirm", params); +}; +//扣除名单确认-反馈人员 +export const feedbackDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/feedback", params); +}; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js index 70f89a0f..b13202ff 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js @@ -10,7 +10,7 @@ import React, { Component } from "react"; import { WeaButtonIcon, WeaDialog, WeaLocaleProvider, WeaTable, WeaTools } from "ecCom"; import DeductionListConfirmEmployeeDialog from "./deductionListConfirmEmployeeDialog"; import DeductionAmountEditDialog from "./deductionAmountEditDialog"; -import { message, Modal } from "antd"; +import { Button, Col, message, Modal, Row } from "antd"; import * as API from "../../../apis/declare"; const { getLabel } = WeaLocaleProvider, { getUrlParams } = WeaTools; @@ -20,7 +20,7 @@ class DeductionListConfirmDialog extends Component { super(props); this.state = { pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, columns: [], dataSource: [], visible: false, - selectedRowKeys: [], editDialog: { visible: false, record: {} } + selectedRowKeys: [], editDialog: { visible: false, record: {} }, loadingBtn: { confirm: false, feedback: false } }; } @@ -72,9 +72,37 @@ class DeductionListConfirmDialog extends Component { } }); }; + confirmDeductionAmount = () => { + const { id: taxAgentId } = getUrlParams(), { year } = this.props; + const payload = { taxAgentId, year }; + this.setState({ loadingBtn: { ...this.state.loadingBtn, confirm: true } }); + API.confirmDeductionAmount(payload).then(({ status, errormsg }) => { + this.setState({ loadingBtn: { ...this.state.loadingBtn, confirm: false } }); + if (status) { + message.success(getLabel(111, "操作成功")); + this.getDeductionAmountList(); + } else { + message.error(errormsg); + } + }); + }; + feedbackDeductionAmount = () => { + const { id: taxAgentId } = getUrlParams(), { year } = this.props; + const payload = { taxAgentId, year }; + this.setState({ loadingBtn: { ...this.state.loadingBtn, confirm: true } }); + API.feedbackDeductionAmount(payload).then(({ status, errormsg }) => { + this.setState({ loadingBtn: { ...this.state.loadingBtn, confirm: false } }); + if (status) { + message.success(getLabel(111, "操作成功")); + this.getDeductionAmountList(); + } else { + message.error(errormsg); + } + }); + }; render() { - const { loading, columns, dataSource, pageInfo, visible, selectedRowKeys, editDialog } = this.state; + const { loading, columns, dataSource, pageInfo, visible, selectedRowKeys, editDialog, loadingBtn } = this.state; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -97,7 +125,18 @@ class DeductionListConfirmDialog extends Component { }; const height = this.refs.employeeRef ? this.refs.employeeRef.state.height : 400; return ( - + + {getLabel(111, "扣除名单确认")} + + + + + + )} style={{ width: 1150, height: 490, minHeight: 200, minWidth: 380, maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.less b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.less index 655ec57d..174530b2 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.less +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.less @@ -209,20 +209,30 @@ } //扣除名单确认 -.confirmationDialogContent { - width: 100%; - height: 100%; - background: #f6f6f6; - padding: 8px 16px; +.confirmationDialog { + .title-right { + text-align: right; - .tableBtns { - display: grid; - grid-template-columns: auto auto; - justify-content: end; - gap: 10px; + button { + margin-left: 10px; + } } - .wea-new-table { - background: #FFF; + .confirmationDialogContent { + width: 100%; + height: 100%; + background: #f6f6f6; + padding: 8px 16px; + + .tableBtns { + display: grid; + grid-template-columns: auto auto; + justify-content: end; + gap: 10px; + } + + .wea-new-table { + background: #FFF; + } } } From 0d55c14f0b94fff8a0ae9f3dee48929398bbff51 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 27 Mar 2025 11:32:11 +0800 Subject: [PATCH 4/5] =?UTF-8?q?release/2.19.1.2501.01-=E4=B8=AA=E7=A8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/deductionListConfirmDialog.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js index b13202ff..5513744a 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js @@ -12,6 +12,7 @@ import DeductionListConfirmEmployeeDialog from "./deductionListConfirmEmployeeDi import DeductionAmountEditDialog from "./deductionAmountEditDialog"; import { Button, Col, message, Modal, Row } from "antd"; import * as API from "../../../apis/declare"; +import { calcPageNo } from "../../../util"; const { getLabel } = WeaLocaleProvider, { getUrlParams } = WeaTools; @@ -63,8 +64,14 @@ class DeductionListConfirmDialog extends Component { onOk: () => { API.deleteDeductionAmount({ ids: this.state.selectedRowKeys }).then(({ status, errormsg }) => { if (status) { + const { pageInfo } = this.state, { current, pageSize, total } = pageInfo; message.success(getLabel(111, "操作成功")); - this.setState({ selectedRowKeys: [] }, () => this.getDeductionAmountList()); + this.setState({ + selectedRowKeys: [], + pageInfo: { + ...pageInfo, current: calcPageNo(total, current, pageSize, this.state.selectedRowKeys.length) + } + }, () => this.getDeductionAmountList()); } else { message.error(errormsg); } @@ -125,7 +132,7 @@ class DeductionListConfirmDialog extends Component { }; const height = this.refs.employeeRef ? this.refs.employeeRef.state.height : 400; return ( - {getLabel(111, "扣除名单确认")} From bb3ded56926b6e11f50d61278f44cfb0ea03a7ec Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 27 Mar 2025 15:28:53 +0800 Subject: [PATCH 5/5] release/2.19.1.2501.01 --- pc4mobx/hrmSalary/pages/ledgerPage/components/index.less | 6 +++++- .../pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js | 2 +- pc4mobx/hrmSalary/pages/salaryItem/index.less | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less index 96d0463d..83b19a8e 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less @@ -41,6 +41,10 @@ .baseSettingWrapper { padding: 12px 12px 12px 20px; + .wea-form-item-wrapper { + display: inline-block !important; + } + .baseSettingLeft { border: 1px solid #ebedf0; padding: 0 !important; @@ -249,7 +253,7 @@ padding: 0; background: transparent; border: none; - font-size: 20px!important; + font-size: 20px !important; line-height: 20px; } diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js index e2b191ae..6db6e575 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js @@ -46,7 +46,7 @@ class LedgerSalaryItemBaseInfo extends Component { }; handleDeleteEmplist = (item) => { const { dataSource, onChangeSortableList } = this.props; - onChangeSortableList(_.xorWith(dataSource, [item], _.isEqual)); + onChangeSortableList(_.filter(dataSource, o => o.id !== item.id)); }; render() { diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index cf539484..0e752b3f 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -187,6 +187,7 @@ border: 1px solid #e5e5e5 !important; padding: 4px 8px !important; min-height: 70px !important; + word-wrap: break-word; } } }