}
placement="topLeft"
/>,
{
this.query();
this.setState({ selectedRowKeys: [] });
}}/>
}>
,
}>
];
} else if (selectedKey === "suspend" && showOperateBtn) {
return [
{
this.query();
this.setState({ selectedRowKeys: [] });
}}
/>
}>
,
,
it.id !== "salaryItemAdjust")}
refreshList={() => {
this.query();
this.setState({ selectedRowKeys: [] });
}}/>
}>
,
}>
];
} else if (selectedKey === "stop" && showOperateBtn) {
return [
{
this.query();
this.setState({ selectedRowKeys: [] });
}}
/>
}>
,
}>
];
}
return [];
};
getColumns = () => {
const { pageInfo, selectedKey } = this.state;
const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props;
let columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true");
return _.map([{
title: "序号",
dataIndex: "index",
align: "left",
oldWidth: 60,
render: (text, record, index) => {
const { current, pageSize } = pageInfo;
return (current - 1) * pageSize + index + 1;
}
}, ...columns], (item, index) => {
if (index === 0) {
return { ...item, width: item.oldWidth, fixed: "left" };
}
if (item.dataIndex === "operate") {
return {
...item, fixed: "right",
width: 150,
render: (text, record) => {
if(!showOperateBtn){
return ;
}else{
if (selectedKey === "pending") {
return ;
} else if (selectedKey === "fixed") {
return this.handleEdit(record)}>调薪;
} else if (selectedKey === "suspend") {
return ;
} else {
return ;
}
}
}
};
}
return { ...item, width: item.oldWidth };
});
};
handleEdit = (record) => {
const { selectedKey } = this.state;
this.setState({
slideParams: {
...this.state.slideParams,
visible: true,
id: record.id
}
}, () => selectedKey === "fixed" && this.salaryAdjustmentInfo());
};
//列表操作
handleMenuClick = (e, id) => {
const { key } = e;
if (key === "payroll") {
//设为定薪员工
API.gotoFixed([id]).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功!");
this.query();
} else {
message.error(errormsg || "操作失败!");
}
});
} else if (key === "stopSalary") {
//停薪
API.gotoStop([id]).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功!");
this.query();
} else {
message.error(errormsg || "操作失败!");
}
});
} else if (key === "deletePendingTodo") {
this.deletePendingTodo([id]);
} else if (key === "deleteSuspendTodo") {
this.deleteSuspendTodo([id]);
} else if (key === "view") {
this.handleEdit(id);
}
};
// 查看 Slide 头部操作按钮
renderEditSlideOperate = () => {
const { taxAgentStore: { showOperateBtn } } = this.props;
const { slideParams: { id }, salaryAdjustmentInfo, selectedKey } = this.state;
const { isShow, url } = salaryAdjustmentInfo;
let arrList = [];
if (showOperateBtn && isShow === "true" && selectedKey === "fixed") {
arrList.push();
}
if (showOperateBtn && selectedKey === "fixed") {
arrList.push();
}
selectedKey !== "stop" && arrList.push();
return arrList;
};
//切换tab
handleChangeTab = (selectedKey) => {
const { slideParams, pageInfo } = this.state;
this.setState({
slideParams: { ...slideParams, visible: false, id: "" },
selectedKey,
pageInfo: {
...pageInfo,
current: 1,
pageSize: 10
}
}, () => this.query());
};
//编辑保存
handleSave = () => {
const { paysetParams, selectedKey } = this.state;
const { salaryFileStore: { adjustSalaryItems, detailForm } } = this.props;
if ((selectedKey === "pending" && _.isEmpty(paysetParams.payStartDate)) || (selectedKey !== "pending" && _.isEmpty(paysetParams.payEndDate))) {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
return;
}
const payload = {
...paysetParams,
salaryArchiveId: detailForm.id,
salaryArchiveItems: _.map(toJS(adjustSalaryItems), it => ({
salaryItemId: it.id,
adjustValue: String(it.value || "")
})),
status: _.upperCase(selectedKey)
};
API.savePaySet(payload).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功!");
this.query();
} else {
message.error(errormsg || "保存失败!");
}
});
};
//发薪设置
handleSetpay = (params) => {
const { type, date } = params;
const { paysetParams } = this.state;
if (type === "起始发薪日期") {
this.setState({ paysetParams: { ...paysetParams, payStartDate: date } });
} else if (type === "最后发薪日期") {
this.setState({ paysetParams: { ...paysetParams, payEndDate: date } });
}
};
query = () => {
const { selectedKey } = this.state;
switch (selectedKey) {
case "pending":
this.queryList("/api/bs/hrmsalary/salaryArchive/pendingList");
break;
case "fixed":
this.queryList("/api/bs/hrmsalary/salaryArchive/fixedList");
break;
case "suspend":
this.queryList("/api/bs/hrmsalary/salaryArchive/suspendList");
break;
default:
this.queryList("/api/bs/hrmsalary/salaryArchive/stopList");
break;
}
};
render() {
const {
tabCount,
selectedKey,
loading,
dataSource,
pageInfo,
showSearchAd,
selectedRowKeys,
slideParams,
changeSalaryVisible,
paysetParams
} = this.state;
const { payrollFilesStore: { tableStore } } = this.props;
const pagination = {
current: pageInfo.current,
pageSize: pageInfo.pageSize,
total: pageInfo.total,
showTotal: total => `共 ${total} 条`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => {
this.query();
});
},
onChange: current => {
this.setState({ pageInfo: { ...pageInfo, current } }, () => {
this.query();
});
}
};
const renderSearch = () => {
const searchItems = [
{ com: this.Input("姓名", "username") },
{ com: this.Browser("分部", "subcompanyIds") },
{ com: this.Browser("部门", "departmentIds") },
{ com: this.Browser("岗位", "positionIds") },
{ com: this.Select("人员状态", "userstatus") },
// { com: this.Select("档案状态", "archiveStatus") },
{ com: this.Select("个税扣缴义务人", "taxAgentId") }
];
return ;
};
const adBtn = [
// 高级搜索内部按钮
,
,
];
const rightMenu = [
// 右键菜单
{
key: "BTN_COLUMN",
icon: ,
content: "显示列定制",
onClick: () => {
tableStore.setColSetVisible(true);
tableStore.tableColSet(true);
}
}
];
const rowSelection = {
selectedRowKeys,
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
};
return (
} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
>
this.setState({ showSearchAd: bool })} //高级搜索面板受控
searchsAd={renderSearch()} // 高级搜索内部数据g1etSearchs(form, toJS(condition), 2)
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={this.query} // 点搜索按钮时的回调this.handleSearch()
searchsBasePlaceHolder={"请输入姓名"}
onSearchChange={(v) => this.setState({
searchItemsValue: {
...this.state.searchItemsValue,
username: v
}
})} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值form.updateFields({ username: v })
searchsBaseValue={this.state.searchItemsValue.username}
/>
record.archiveStatus === "ARCHIVE" ? "archiveRow" : ""}
rowSelection={rowSelection}
scroll={{ x: 1200 }}
/>
{slideParams.visible && (
}
content={
{
this.setState({
paysetParams: {
...paysetParams,
...res
}
});
}}
/>
}
onClose={() => {
this.setState({
paysetParams: { payStartDate: "", payEndDate: "" },
slideParams: { ...slideParams, visible: false, id: "" }
});
}}
showMask={true}
closeMaskOnClick={() => {
this.setState({
paysetParams: { payStartDate: "", payEndDate: "" },
slideParams: { ...slideParams, visible: false, id: "" }
});
}}
/>
)}
{changeSalaryVisible && (
{
this.setState({ changeSalaryVisible: false });
}}
/>
)}
);
}
}
export default Index;
const HelpfulDiv = () => {
return
导入按钮使用场景说明:
1.档案初始化:
a.初次使用薪酬模块,全量导入员工的薪资档案数据;
b.员工入职,导入新入职的员工的薪资档案数据(若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入);
c.返聘人员使用调薪功能调整薪资档案值或使用调整个税扣缴;
2.调薪:档案中已存在的人员批量调整薪资项目值(包括返聘人员的情况);
3.调整个税扣缴义务人:档案中已存在的人员批量调整个税扣缴义务人(包括返聘人员的情况);
;
};