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

This commit is contained in:
lys 2025-07-02 18:35:08 +08:00
commit f8684ce32d
4 changed files with 110 additions and 21 deletions

View File

@ -149,6 +149,17 @@ export const dataCollectCondition = [
export const taxDetailSettingsConditions = {
freeIncome: [{
items: [
{
conditionType: "SELECT",
domkey: ["incomeCategory"],
fieldcol: 14,
label: "所得项目",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["freeItem"],
@ -190,6 +201,17 @@ export const taxDetailSettingsConditions = {
}],
healthInsurance: [{
items: [
{
conditionType: "SELECT",
domkey: ["incomeCategory"],
fieldcol: 14,
label: "所得项目",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["identificationNumber"],
@ -265,6 +287,17 @@ export const taxDetailSettingsConditions = {
}],
endowmentInsurance: [{
items: [
{
conditionType: "SELECT",
domkey: ["incomeCategory"],
fieldcol: 14,
label: "所得项目",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "MONTHPICKER",
domkey: ["deductionMonth"],
@ -347,6 +380,17 @@ export const taxDetailSettingsConditions = {
}],
grantDonation: [{
items: [
{
conditionType: "SELECT",
domkey: ["incomeCategory"],
fieldcol: 14,
label: "所得项目",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["recipientName"],
@ -446,6 +490,17 @@ export const taxDetailSettingsConditions = {
}],
derateDeduction: [{
items: [
{
conditionType: "SELECT",
domkey: ["incomeCategory"],
fieldcol: 14,
label: "所得项目",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["derateItem"],
@ -487,6 +542,17 @@ export const taxDetailSettingsConditions = {
}],
otherDerateDeduction: [{
items: [
{
conditionType: "SELECT",
domkey: ["incomeCategory"],
fieldcol: 14,
label: "所得项目",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["otherDeduction"],
@ -519,6 +585,17 @@ export const taxDetailSettingsConditions = {
}],
personalPension: [{
items: [
{
conditionType: "SELECT",
domkey: ["incomeCategory"],
fieldcol: 14,
label: "所得项目",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["voucherTypeName"],
@ -559,8 +636,3 @@ export const taxDetailSettingsConditions = {
col: 1
}]
};

View File

@ -16,6 +16,8 @@ import { taxDetailSettingsConditions } from "./columns";
import { Button, message } from "antd";
import { getDomkes, toDecimal_n } from "../../../util";
import { postFetch } from "../../../util/request";
import { getIncomeCategoryList } from "../../../apis/ledger"; //获取薪资类型
import cs from "classnames";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@ -30,19 +32,30 @@ class DetailSettingsDialog extends Component {
};
}
componentWillReceiveProps(nextProps, nextContext) {
async componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { data } = await getIncomeCategoryList();
this.setState({
conditions: _.map(taxDetailSettingsConditions[nextProps.dataType], item => ({
...item, items: _.map(item.items, o => ({
...o, options: getKey(o) === "voucherTypeName" ?
[{ key: "MONTH", showname: "月度" }, { key: "YEAR", showname: "年度" }] : []
[{ key: "MONTH", showname: "月度" }, { key: "YEAR", showname: "年度" }] :
getKey(o) === "incomeCategory" ? _.map(data, it => ({
key: it.value.toString(),
showname: <div className="reportTypeName-box">
<span>{it.defaultLabel}</span>
<span
className={cs("reportTypeName", { "danger": it.reportTypeName === getLabel(111, "非居民所得") })}>
{it.reportTypeName}
</span>
</div>
})) : []
}))
}))
}, () => {
this.props.otherDeductStore.settingsForm.initFormFields(this.state.conditions);
if (nextProps.id) _.map(getDomkes(this.state.conditions), domkey => {
this.props.otherDeductStore.settingsForm.updateFields({ [domkey]: { value: nextProps.record[domkey] } });
this.props.otherDeductStore.settingsForm.updateFields({ [domkey]: { value: nextProps.record[domkey].toString() } });
});
});
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
@ -54,19 +67,21 @@ class DetailSettingsDialog extends Component {
const { otherDeductStore: { settingsForm }, mainId, id, dataType } = this.props;
settingsForm.validateForm().then(f => {
if (f.isValid) {
let { deductionMonth, ...payload } = settingsForm.getFormParams();
let { deductionMonth, incomeCategory, ...payload } = settingsForm.getFormParams();
deductionMonth && (payload = { ...payload, deductionMonth: deductionMonth + "-01" });
this.setState({ loading: true });
postFetch(`/api/bs/hrmsalary/otherDeduction/save${_.upperFirst(dataType)}`, { ...payload, mainId, id })
.then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess);
} else {
message.error(errormsg);
}
});
postFetch(`/api/bs/hrmsalary/otherDeduction/save${_.upperFirst(dataType)}`, {
...payload, mainId, id,
incomeCategory: Number(incomeCategory)
}).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess);
} else {
message.error(errormsg);
}
});
} else {
f.showErrors();
}
@ -146,6 +161,7 @@ class DetailSettingsDialog extends Component {
onBlur={(v) => v && form.updateFields({ payAmount: { value: toDecimal_n(v, 2) } })}/>);
}
};
if (_.reduce(conditions, (pre, cur) => (pre += cur.items.length), 0) * 47 + 33 === 33) return null;
return (
<WeaDialog
{...this.props} initLoadCss title={getLabel(111, "明细设置")}

View File

@ -66,12 +66,12 @@ class TaxSetDialog extends Component {
});
};
handleDelete = (ids = []) => {
const { selectedRowKeys } = this.state, { dataType } = this.props;
const { selectedRowKeys } = this.state, { dataType, id: mainId } = this.props;
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(388758, "确认要删除吗?"),
onOk: () => {
postFetch(`/api/bs/hrmsalary/otherDeduction/delete${_.upperFirst(dataType)}`, { ids })
postFetch(`/api/bs/hrmsalary/otherDeduction/delete${_.upperFirst(dataType)}`, { ids, mainId })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(502230, "删除成功!"));

View File

@ -151,6 +151,7 @@
background-color: #fff5db;
border-radius: 2px;
height: 24px;
min-width: 66px;
}
.danger {