feature/3.0.0.2502.01-合并业务线-社保福利台账增减人员
This commit is contained in:
parent
5c6ecef51a
commit
bc79bfe16e
|
|
@ -205,3 +205,11 @@ export const cacheWelfareListField = (params) => {
|
|||
export const cacheBalanceWelfareList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/siaccount/cacheBalanceWelfareList", params);
|
||||
};
|
||||
// 社保福利台账正常缴纳-增加人员并核算
|
||||
export const addSocialAcctEmp = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/siaccount/addSocialAcctEmp", params);
|
||||
};
|
||||
// 社保福利台账正常缴纳-增加人员并核算
|
||||
export const deleteSocialAcctEmp = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/siaccount/deleteSocialAcctEmp", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ import AdjustmentSlide from "./adjustmentSlide";
|
|||
import { getCalculateProgress } from "../../../../apis/calculate";
|
||||
import RegEditDetial from "./regEditDetial";
|
||||
import SupplementarySlide from "./supplementarySlide";
|
||||
import _ from "lodash";
|
||||
import "./index.less";
|
||||
import { addSocialAcctEmp, deleteSocialAcctEmp } from "../../../../apis/standingBook";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
@inject("standingBookStore")
|
||||
|
|
@ -61,7 +61,8 @@ export default class NormalIndex extends Component {
|
|||
},
|
||||
showSum: false,
|
||||
siaccountSum: {},
|
||||
showSearchAd: false
|
||||
showSearchAd: false,
|
||||
normalPayer: ""
|
||||
};
|
||||
this.timer = null;
|
||||
this.timerDelete = null;
|
||||
|
|
@ -167,85 +168,11 @@ export default class NormalIndex extends Component {
|
|||
});
|
||||
};
|
||||
|
||||
handleSave = () => {
|
||||
const {
|
||||
siaccountCommonSave,
|
||||
siaccountSupplementarySave,
|
||||
form
|
||||
} = this.props.standingBookStore;
|
||||
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
||||
if (selectedKey === "1") {
|
||||
const { includes, excludes } = form.getFormParams();
|
||||
const payload = {
|
||||
billMonth,
|
||||
includes: includes.split(","),
|
||||
excludes: _.isEmpty(excludes) ? excludes.split(",") : []
|
||||
};
|
||||
siaccountCommonSave(payload).then(() => {
|
||||
message.success("添加成功");
|
||||
this.getNormalList({
|
||||
billMonth,
|
||||
paymentOrganization,
|
||||
current: this.state.current
|
||||
});
|
||||
this.setState({
|
||||
addProps: {
|
||||
...this.state.addProps,
|
||||
title: "",
|
||||
visible: false
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
const paymentOrganization = getQueryString("paymentOrganization");
|
||||
form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const {
|
||||
includes,
|
||||
billMonth: billMonthList,
|
||||
excludes,
|
||||
projects
|
||||
} = form.getFormParams();
|
||||
const payload = {
|
||||
billMonth,
|
||||
billMonthList: billMonthList.split(","),
|
||||
includes: includes.split(","),
|
||||
// excludes: excludes.split(","),
|
||||
projects: projects.split(","),
|
||||
paymentOrganization
|
||||
};
|
||||
siaccountSupplementarySave(payload).then(() => {
|
||||
message.success("添加成功");
|
||||
this.getSupplementaryList({
|
||||
billMonth,
|
||||
current: this.state.current,
|
||||
paymentOrganization
|
||||
});
|
||||
this.setState(
|
||||
{
|
||||
addProps: {
|
||||
...this.state.addProps,
|
||||
title: "",
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
() => {
|
||||
form.resetForm();
|
||||
}
|
||||
);
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setState({ date: new Date() }); // 改变一个state的变量,强制页面刷新
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
getNormalList = async (payload = {}) => {
|
||||
const { getNormalList } = this.props.standingBookStore;
|
||||
getNormalList({ ...payload, pageSize: this.state.pageSize }).then(({ list, columns = [], total }) => {
|
||||
this.setState({
|
||||
tableData: { list, total, columns }
|
||||
tableData: { list, total, columns }, normalPayer: ""
|
||||
}, () => this.postMessageToChild());
|
||||
});
|
||||
};
|
||||
|
|
@ -341,16 +268,7 @@ export default class NormalIndex extends Component {
|
|||
});
|
||||
}
|
||||
};
|
||||
handleAdd = () => {
|
||||
this.setState({
|
||||
addProps: {
|
||||
...this.state.addProps,
|
||||
title: "添加缴纳人员",
|
||||
visible: true
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
handleAdd = () => this.setState({ addProps: { ...this.state.addProps, title: "添加缴纳人员", visible: true } });
|
||||
handleCommonAccountClick = () => {
|
||||
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
||||
const { commonAccount } = this.props.standingBookStore;
|
||||
|
|
@ -410,7 +328,43 @@ export default class NormalIndex extends Component {
|
|||
}, 600);
|
||||
});
|
||||
};
|
||||
handleAddSocialAcctEmp = () => {
|
||||
const { billMonth, paymentOrganization } = this.props, { normalPayer } = this.state;
|
||||
addSocialAcctEmp({ billMonth, paymentOrganization, includes: normalPayer.split(",") })
|
||||
.then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功"));
|
||||
this.getNormalList({
|
||||
billMonth, paymentOrganization,
|
||||
current: calcPageNo(this.state.tableData.total, this.state.current, 10, normalPayer.split(",").length)
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
handleDeleteNormalPayer = () => {
|
||||
Modal.confirm({
|
||||
title: getLabel(111, "确认信息"),
|
||||
content: getLabel(111, "确认删除勾选的数据吗?"),
|
||||
onOk: () => {
|
||||
const { billMonth, paymentOrganization } = this.props, { selectedRowKeys: ids } = this.state;
|
||||
deleteSocialAcctEmp({ billMonth, paymentOrganization, ids }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.getNormalList({
|
||||
billMonth,
|
||||
paymentOrganization,
|
||||
current: calcPageNo(this.state.tableData.total, this.state.current, 10, ids.length)
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
handleExport = () => {
|
||||
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
||||
const urlObj = {
|
||||
|
|
@ -485,8 +439,12 @@ export default class NormalIndex extends Component {
|
|||
];
|
||||
const btn2 = [
|
||||
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "删除")} disabled={_.isEmpty(selectedRowKeys)}
|
||||
/>,
|
||||
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}/>,
|
||||
onClick={this.handleDeleteNormalPayer}/>,
|
||||
<WeaBrowser type={17} title={getLabel(383694, "添加人员")} isSingle={false} customized
|
||||
onChange={ids => this.setState({ normalPayer: ids }, () => this.handleAddSocialAcctEmp())}
|
||||
>
|
||||
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}/>
|
||||
</WeaBrowser>,
|
||||
<Button type="primary" onClick={this.handleCommonAccountClick}>核算</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ adjustSlide: { ...adjustSlide, visible: true } })}>调差</Button>
|
||||
|
|
|
|||
Loading…
Reference in New Issue