产品-薪资账套个税申报字段对应

This commit is contained in:
黎永顺 2023-08-17 16:52:53 +08:00
parent acc4654e76
commit abdc35e134
5 changed files with 85 additions and 50 deletions

View File

@ -342,6 +342,10 @@ export const addupruleGetForm = params => {
export const taxreportruleSave = params => {
return postFetch("/api/bs/hrmsalary/salarysob/taxreportrule/save", params);
};
//保存薪资账套下的累计字段对应关系
export const addupruleSave = params => {
return postFetch("/api/bs/hrmsalary/salarysob/adduprule/save", params);
};
//保存回算薪资项目详情
export const salarysobBackitemSave = params => {
return postFetch("/api/bs/hrmsalary/salarysob/backitem/save", params);

View File

@ -27,7 +27,7 @@ class CumulativeFields extends Component {
taxreportruleGetForm = () => {
const { editId, saveSalarySobId } = this.props;
addupruleGetForm({ id: saveSalarySobId || editId }).then(({ status, data }) => {
addupruleGetForm({ id: editId || saveSalarySobId }).then(({ status, data }) => {
if (status && !_.isEmpty(data)) {
this.setState({
tabs: _.map(data, it => ({ viewcondition: it.incomeCategoryId, title: it.incomeCategoryName })),
@ -103,7 +103,7 @@ class CumulativeFields extends Component {
width: "50%",
dataIndex: "salaryItem",
render: (_, record) => (
<LedgerFieldsItemPopver salarySobId={saveSalarySobId || editId} record={record}
<LedgerFieldsItemPopver salarySobId={editId || saveSalarySobId} record={record}
onChangeSwitch={this.handleChangeSwitch}
onChange={this.handleChangeAddupruleFieldsItem}
/>

View File

@ -27,7 +27,7 @@ class IncomeTaxFields extends Component {
taxreportruleGetForm = () => {
const { editId, saveSalarySobId } = this.props;
taxreportruleGetForm({ id: saveSalarySobId || editId }).then(({ status, data }) => {
taxreportruleGetForm({ id: editId || saveSalarySobId }).then(({ status, data }) => {
if (status && !_.isEmpty(data)) {
this.setState({
tabs: _.map(data, it => ({ viewcondition: it.incomeCategoryId, title: it.incomeCategoryName })),
@ -120,7 +120,7 @@ class IncomeTaxFields extends Component {
width: "50%",
dataIndex: "salaryItem",
render: (_, record) => (
<LedgerFieldsItemPopver salarySobId={saveSalarySobId || editId} record={record}
<LedgerFieldsItemPopver salarySobId={editId || saveSalarySobId} record={record}
onChangeSwitch={this.handleChangeSwitch}
onChange={this.handleChangeIncomeFieldsItem}
/>

View File

@ -81,7 +81,7 @@ class LedgerBaseSetting extends Component {
description: "",
canEdit: "true"
}
});
}, () => this.props.onTaxableItemsChange(this.state.settingBaseInfo.taxableItems));
};
getLedgerBasicForm = (id) => {
getLedgerBasicForm({ id }).then(({ status, data }) => {
@ -99,6 +99,7 @@ class LedgerBaseSetting extends Component {
}
}, () => {
this.props.onSaveParams(this.state.settingBaseInfo);
this.props.onTaxableItemsChange(this.state.settingBaseInfo.taxableItems);
});
}
});
@ -153,6 +154,7 @@ class LedgerBaseSetting extends Component {
}
}, () => {
onSaveParams(this.state.settingBaseInfo);
this.props.onTaxableItemsChange(this.state.settingBaseInfo.taxableItems);
});
};

View File

@ -21,15 +21,6 @@ import "./index.less";
const { getLabel } = WeaLocaleProvider;
const Step = WeaSteps.Step;
const tabs = [
{ key: 0, title: "基础设置" },
{ key: 1, title: "关联人员" },
{ key: 2, title: "薪资项目" },
{ key: 3, title: "回算薪资项目" },
{ key: 4, title: "累计字段对应" },
{ key: 5, title: "个税申报字段对应" },
{ key: 6, title: "调薪计薪规则" }
];
@inject("taxAgentStore")
@observer
@ -42,7 +33,8 @@ class LedgerSlide extends Component {
baseSettingInfo: {},
adjustRules: [],
empFields: [], itemGroups: [],
saveSalarySobId: ""
saveSalarySobId: "",
taxableItems: "" //薪资类型 1||489 对应显示个税设置-累计字段对应
};
}
@ -154,7 +146,11 @@ class LedgerSlide extends Component {
* Date: 2023/8/16
*/
taxreportruleSave = () => {
const { taxableItems } = this.state;
const { editId, saveSalarySobId } = this.props;
if ((!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489")) {
this.saveLedgerAdjustRule();
} else {
const { incomeTaxFields, selectedKey } = this.incomeRef.state;
const payload = {
salarySobId: saveSalarySobId || editId,
@ -185,6 +181,24 @@ class LedgerSlide extends Component {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
}).catch(() => this.setState({ loading: false }));
}
};
/*
* Author: 黎永顺
* Description:保存薪资账套下的累计字段对应关系
* Params:
* Date: 2023/8/17
*/
addupruleSave = () => {
const { taxableItems } = this.state;
const { editId, saveSalarySobId } = this.props;
if ((!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489")) {
console.log(this.cumulativeRef);
console.log(11111);
} else {
console.log(this.cumulativeRef);
console.log(2222);
}
};
handleChangeSlideTab = (current) => {
this.setState({ current: Number(current) });
@ -211,11 +225,15 @@ class LedgerSlide extends Component {
this.setState({ empFields, itemGroups });
};
renderChildren = () => {
const { current, saveSalarySobId } = this.state;
const { editId } = this.props;
const { current, saveSalarySobId, taxableItems } = this.state;
let CurrentDom = null;
switch (current) {
case 0:
CurrentDom = <LedgerBaseSetting {...this.props} onSaveParams={this.handleChangeSaveParams}/>;
CurrentDom = <LedgerBaseSetting
{...this.props} onSaveParams={this.handleChangeSaveParams}
onTaxableItemsChange={(val) => this.setState({ taxableItems: val })}
/>;
break;
case 1:
CurrentDom = <LedgerAssociatedPersonnel {...this.props} saveSalarySobId={saveSalarySobId}/>;
@ -228,11 +246,14 @@ class LedgerSlide extends Component {
CurrentDom = <LedgerBackCalculatedSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}/>;
break;
case 4:
CurrentDom =
CurrentDom = (!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ?
<IncomeTaxFields ref={dom => this.incomeRef = dom} {...this.props} saveSalarySobId={saveSalarySobId}/> :
<CumulativeFields ref={dom => this.cumulativeRef = dom} {...this.props} saveSalarySobId={saveSalarySobId}/>;
break;
case 5:
CurrentDom =
CurrentDom = (!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ?
<LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId}
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/> :
<IncomeTaxFields ref={dom => this.incomeRef = dom} {...this.props} saveSalarySobId={saveSalarySobId}/>;
break;
case 6:
@ -303,13 +324,11 @@ class LedgerSlide extends Component {
type="primary"
loading={loading}
onClick={() => {
this.setState({ current: current + 1 }, () => {
console.log("累计字段对应");
});
this.setState({ current: current + 1 }, () => this.addupruleSave());
}}
>保存并进入下一步</Button>
] : [
<Button type="primary" loading={loading} onClick={() => console.log("累计字段对应")}>保存</Button>
<Button type="primary" loading={loading} onClick={this.addupruleSave}>保存</Button>
];
break;
case 5:
@ -345,8 +364,18 @@ class LedgerSlide extends Component {
};
render() {
let tabs = [
{ key: 0, title: getLabel(82751, "基础设置") },
{ key: 1, title: getLabel(543467, "关联人员") },
{ key: 2, title: getLabel(542362, "薪资项目") },
{ key: 3, title: getLabel(543468, "回算薪资项目") },
{ key: 4, title: getLabel(111, "累计字段对应") },
{ key: 5, title: getLabel(111, "个税申报字段对应") },
{ key: 6, title: getLabel(543469, "调薪计薪规则") }
];
const { title, visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
const { current } = this.state;
const { current, taxableItems } = this.state;
(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && (tabs = _.filter(tabs, o => o.key !== 4));
return (
<WeaSlideModal
className="slideOuterWrapper"