Merge branch 'release/2.19.1.2501.01-个税' into release/2.19.1.2503.01-业务线个税

This commit is contained in:
lys 2025-03-27 15:30:43 +08:00
commit ae35d29e36
10 changed files with 218 additions and 31 deletions

View File

@ -296,3 +296,15 @@ 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);
};
//扣除名单确认-确认人员
export const confirmDeductionAmount = (params) => {
return postFetch("/api/bs/hrmsalary/deductionAmount/confirm", params);
};
//扣除名单确认-反馈人员
export const feedbackDeductionAmount = (params) => {
return postFetch("/api/bs/hrmsalary/deductionAmount/feedback", params);
};

View File

@ -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 (<WeaDialog {...this.props} initLoadCss title={getLabel(111, "编辑")} style={{ height }}
buttons={[<Button type="primary" loading={loading}
onClick={this.save}>{getLabel(111, "确定")}</Button>,
<Button type="ghost" onClick={() => this.props.onCancel()}>{getLabel(111, "取消")}</Button>]}>
<FormInfo className="form-dialog-layout" center={false} form={form} formFields={conditions}/>
</WeaDialog>);
}
}
export default DeductionAmountEditDialog;

View File

@ -8,9 +8,11 @@
*/
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 { Button, Col, message, Modal, Row } from "antd";
import * as API from "../../../apis/declare";
import { calcPageNo } from "../../../util";
const { getLabel } = WeaLocaleProvider, { getUrlParams } = WeaTools;
@ -19,7 +21,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: {} }, loadingBtn: { confirm: false, feedback: false }
};
}
@ -39,8 +41,18 @@ 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 => (<span>{v === 1 ? getLabel(111, "是") : getLabel(111, "否")}</span>) };
}
return { ...o };
}), {
title: getLabel(111, "操作"), dataIndex: "action",
render: (v, record) => (<a href="javascript:void(0)" onClick={() => this.setState({
editDialog: { visible: true, record }
})}>{getLabel(111, "编辑")}</a>)
}]
});
}
}).catch(() => this.setState({ loading: false }));
@ -52,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.getDeductionAmountList();
this.setState({
selectedRowKeys: [],
pageInfo: {
...pageInfo, current: calcPageNo(total, current, pageSize, this.state.selectedRowKeys.length)
}
}, () => this.getDeductionAmountList());
} else {
message.error(errormsg);
}
@ -61,9 +79,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 } = this.state;
const { loading, columns, dataSource, pageInfo, visible, selectedRowKeys, editDialog, loadingBtn } = this.state;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
@ -86,9 +132,20 @@ class DeductionListConfirmDialog extends Component {
};
const height = this.refs.employeeRef ? this.refs.employeeRef.state.height : 400;
return (
<WeaDialog {...this.props} hasScroll initLoadCss title={getLabel(111, "扣除名单确认")} ref="confirmRef"
<WeaDialog {...this.props} initLoadCss ref="confirmRef" className="confirmationDialog"
title={(<Row type="flex">
<Col span={12}>
<span className="title">{getLabel(111, "扣除名单确认")}</span>
</Col>
<Col span={12} className="title-right">
<Button type="primary" onClick={this.confirmDeductionAmount}
loading={loadingBtn.confirm}>{getLabel(111, "确认")}</Button>
<Button type="primary" onClick={this.feedbackDeductionAmount}
loading={loadingBtn.feedback}>{getLabel(111, "反馈")}</Button>
</Col>
</Row>)}
style={{
width: 1150, height: 606.6, minHeight: 200, minWidth: 380, maxHeight: "90%",
width: 1150, height: 490, minHeight: 200, minWidth: 380, maxHeight: "90%",
maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
}}>
<div className="confirmationDialogContent">
@ -100,6 +157,10 @@ class DeductionListConfirmDialog extends Component {
</div>
<WeaTable columns={columns} dataSource={dataSource} loading={loading} pagination={pagination} rowKey="id"
rowSelection={rowSelection} scroll={{ y: `calc(${height}px - 113px)` }}/>
<DeductionAmountEditDialog {...editDialog} onSuccess={this.getDeductionAmountList}
onCancel={(callback) => this.setState({
editDialog: { visible: false, record: {} }
}, () => callback && callback())}/>
<DeductionListConfirmEmployeeDialog visible={visible} onSuccess={this.getDeductionAmountList}
year={this.props.year} payload={this.props.payload}
onCancel={(callback) => this.setState({ visible: false }, () => callback && callback())}/>

View File

@ -92,14 +92,8 @@ class DeductionListConfirmEmployeeDialog extends Component {
onClick={this.save}>{getLabel(111, "确认")}</Button>,
<Button type="ghost" onClick={() => this.props.onCancel()}>{getLabel(111, "取消")}</Button>]}
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)"
}}>
<div className="confirmationDialogContent">
<WeaTable columns={columns} dataSource={dataSource} loading={loading} pagination={pagination} rowKey="id"

View File

@ -170,7 +170,6 @@ export const advanceConditions = [
defaultshow: true
}
];
export const declareConditions = [
{
items: [
@ -491,3 +490,31 @@ export const declareConditions = [
defaultshow: true
}
];
// 扣除名单确认
export const deductConditions = [
{
items: [
{
conditionType: "INPUT",
domkey: ["employeeName"],
fieldcol: 12,
label: "姓名",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
},
{
conditionType: "SWITCH",
domkey: ["deductFlag"],
fieldcol: 12,
label: "是否扣除",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
},
],
defaultshow: true
}
];

View File

@ -460,7 +460,7 @@ class Index extends Component {
{/*<Menu.Item key="2">{getLabel(111, "批量编辑")}</Menu.Item>*/}
{/*<Menu.Item key="3">{getLabel(81272, "导出全部")}</Menu.Item>*/}
{/*<Menu.Item key="4">{getLabel(543715, "导出所选")}</Menu.Item>*/}
{/*<Menu.Item key="5">{getLabel(111, "扣除名单确认")}</Menu.Item>*/}
<Menu.Item key="5">{getLabel(111, "扣除名单确认")}</Menu.Item>
</Menu>
);
const buttons = [

View File

@ -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;
}
}
}

View File

@ -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;

View File

@ -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() {

View File

@ -200,6 +200,7 @@
border: 1px solid #e5e5e5 !important;
padding: 4px 8px !important;
min-height: 70px !important;
word-wrap: break-word;
}
}
}