release/2.19.1.2501.01-个税
This commit is contained in:
parent
45056afe54
commit
02a86cdb3d
|
|
@ -149,6 +149,17 @@ export const dataCollectCondition = [
|
||||||
export const taxDetailSettingsConditions = {
|
export const taxDetailSettingsConditions = {
|
||||||
freeIncome: [{
|
freeIncome: [{
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "SELECT",
|
||||||
|
domkey: ["incomeCategory"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "所得项目",
|
||||||
|
lanId: 111,
|
||||||
|
labelcol: 8,
|
||||||
|
value: "",
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
{
|
{
|
||||||
conditionType: "INPUT",
|
conditionType: "INPUT",
|
||||||
domkey: ["freeItem"],
|
domkey: ["freeItem"],
|
||||||
|
|
@ -190,6 +201,17 @@ export const taxDetailSettingsConditions = {
|
||||||
}],
|
}],
|
||||||
healthInsurance: [{
|
healthInsurance: [{
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "SELECT",
|
||||||
|
domkey: ["incomeCategory"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "所得项目",
|
||||||
|
lanId: 111,
|
||||||
|
labelcol: 8,
|
||||||
|
value: "",
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
{
|
{
|
||||||
conditionType: "INPUT",
|
conditionType: "INPUT",
|
||||||
domkey: ["identificationNumber"],
|
domkey: ["identificationNumber"],
|
||||||
|
|
@ -265,6 +287,17 @@ export const taxDetailSettingsConditions = {
|
||||||
}],
|
}],
|
||||||
endowmentInsurance: [{
|
endowmentInsurance: [{
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "SELECT",
|
||||||
|
domkey: ["incomeCategory"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "所得项目",
|
||||||
|
lanId: 111,
|
||||||
|
labelcol: 8,
|
||||||
|
value: "",
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
{
|
{
|
||||||
conditionType: "MONTHPICKER",
|
conditionType: "MONTHPICKER",
|
||||||
domkey: ["deductionMonth"],
|
domkey: ["deductionMonth"],
|
||||||
|
|
@ -347,6 +380,17 @@ export const taxDetailSettingsConditions = {
|
||||||
}],
|
}],
|
||||||
grantDonation: [{
|
grantDonation: [{
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "SELECT",
|
||||||
|
domkey: ["incomeCategory"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "所得项目",
|
||||||
|
lanId: 111,
|
||||||
|
labelcol: 8,
|
||||||
|
value: "",
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
{
|
{
|
||||||
conditionType: "INPUT",
|
conditionType: "INPUT",
|
||||||
domkey: ["recipientName"],
|
domkey: ["recipientName"],
|
||||||
|
|
@ -446,6 +490,17 @@ export const taxDetailSettingsConditions = {
|
||||||
}],
|
}],
|
||||||
derateDeduction: [{
|
derateDeduction: [{
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "SELECT",
|
||||||
|
domkey: ["incomeCategory"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "所得项目",
|
||||||
|
lanId: 111,
|
||||||
|
labelcol: 8,
|
||||||
|
value: "",
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
{
|
{
|
||||||
conditionType: "INPUT",
|
conditionType: "INPUT",
|
||||||
domkey: ["derateItem"],
|
domkey: ["derateItem"],
|
||||||
|
|
@ -487,6 +542,17 @@ export const taxDetailSettingsConditions = {
|
||||||
}],
|
}],
|
||||||
otherDerateDeduction: [{
|
otherDerateDeduction: [{
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "SELECT",
|
||||||
|
domkey: ["incomeCategory"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "所得项目",
|
||||||
|
lanId: 111,
|
||||||
|
labelcol: 8,
|
||||||
|
value: "",
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
{
|
{
|
||||||
conditionType: "INPUTNUMBER",
|
conditionType: "INPUTNUMBER",
|
||||||
domkey: ["otherDeduction"],
|
domkey: ["otherDeduction"],
|
||||||
|
|
@ -519,6 +585,17 @@ export const taxDetailSettingsConditions = {
|
||||||
}],
|
}],
|
||||||
personalPension: [{
|
personalPension: [{
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "SELECT",
|
||||||
|
domkey: ["incomeCategory"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "所得项目",
|
||||||
|
lanId: 111,
|
||||||
|
labelcol: 8,
|
||||||
|
value: "",
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
{
|
{
|
||||||
conditionType: "SELECT",
|
conditionType: "SELECT",
|
||||||
domkey: ["voucherTypeName"],
|
domkey: ["voucherTypeName"],
|
||||||
|
|
@ -559,8 +636,3 @@ export const taxDetailSettingsConditions = {
|
||||||
col: 1
|
col: 1
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ import { taxDetailSettingsConditions } from "./columns";
|
||||||
import { Button, message } from "antd";
|
import { Button, message } from "antd";
|
||||||
import { getDomkes, toDecimal_n } from "../../../util";
|
import { getDomkes, toDecimal_n } from "../../../util";
|
||||||
import { postFetch } from "../../../util/request";
|
import { postFetch } from "../../../util/request";
|
||||||
|
import { getIncomeCategoryList } from "../../../apis/ledger"; //获取薪资类型
|
||||||
|
import cs from "classnames";
|
||||||
|
|
||||||
const getKey = WeaTools.getKey;
|
const getKey = WeaTools.getKey;
|
||||||
const getLabel = WeaLocaleProvider.getLabel;
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
@ -30,13 +32,24 @@ class DetailSettingsDialog extends Component {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps, nextContext) {
|
async componentWillReceiveProps(nextProps, nextContext) {
|
||||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||||
|
const { data } = await getIncomeCategoryList();
|
||||||
this.setState({
|
this.setState({
|
||||||
conditions: _.map(taxDetailSettingsConditions[nextProps.dataType], item => ({
|
conditions: _.map(taxDetailSettingsConditions[nextProps.dataType], item => ({
|
||||||
...item, items: _.map(item.items, o => ({
|
...item, items: _.map(item.items, o => ({
|
||||||
...o, options: getKey(o) === "voucherTypeName" ?
|
...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>
|
||||||
|
})) : []
|
||||||
}))
|
}))
|
||||||
}))
|
}))
|
||||||
}, () => {
|
}, () => {
|
||||||
|
|
@ -54,19 +67,21 @@ class DetailSettingsDialog extends Component {
|
||||||
const { otherDeductStore: { settingsForm }, mainId, id, dataType } = this.props;
|
const { otherDeductStore: { settingsForm }, mainId, id, dataType } = this.props;
|
||||||
settingsForm.validateForm().then(f => {
|
settingsForm.validateForm().then(f => {
|
||||||
if (f.isValid) {
|
if (f.isValid) {
|
||||||
let { deductionMonth, ...payload } = settingsForm.getFormParams();
|
let { deductionMonth, incomeCategory, ...payload } = settingsForm.getFormParams();
|
||||||
deductionMonth && (payload = { ...payload, deductionMonth: deductionMonth + "-01" });
|
deductionMonth && (payload = { ...payload, deductionMonth: deductionMonth + "-01" });
|
||||||
this.setState({ loading: true });
|
this.setState({ loading: true });
|
||||||
postFetch(`/api/bs/hrmsalary/otherDeduction/save${_.upperFirst(dataType)}`, { ...payload, mainId, id })
|
postFetch(`/api/bs/hrmsalary/otherDeduction/save${_.upperFirst(dataType)}`, {
|
||||||
.then(({ status, errormsg }) => {
|
...payload, mainId, id,
|
||||||
this.setState({ loading: false });
|
incomeCategory: Number(incomeCategory)
|
||||||
if (status) {
|
}).then(({ status, errormsg }) => {
|
||||||
message.success(getLabel(111, "操作成功!"));
|
this.setState({ loading: false });
|
||||||
this.props.onCancel(this.props.onSuccess);
|
if (status) {
|
||||||
} else {
|
message.success(getLabel(111, "操作成功!"));
|
||||||
message.error(errormsg);
|
this.props.onCancel(this.props.onSuccess);
|
||||||
}
|
} else {
|
||||||
});
|
message.error(errormsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
f.showErrors();
|
f.showErrors();
|
||||||
}
|
}
|
||||||
|
|
@ -146,6 +161,7 @@ class DetailSettingsDialog extends Component {
|
||||||
onBlur={(v) => v && form.updateFields({ payAmount: { value: toDecimal_n(v, 2) } })}/>);
|
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 (
|
return (
|
||||||
<WeaDialog
|
<WeaDialog
|
||||||
{...this.props} initLoadCss title={getLabel(111, "明细设置")}
|
{...this.props} initLoadCss title={getLabel(111, "明细设置")}
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,7 @@
|
||||||
background-color: #fff5db;
|
background-color: #fff5db;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
|
min-width: 66px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.danger {
|
.danger {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue