salary-management-front/pc4mobx/hrmSalary/pages/salaryFile/index.js

753 lines
23 KiB
JavaScript
Raw Normal View History

2022-06-21 11:33:00 +08:00
import React, { Fragment } from "react";
2022-06-02 17:11:28 +08:00
import { inject, observer } from "mobx-react";
2022-06-13 18:08:45 +08:00
import { WeaTableNew } from "comsMobx";
2022-07-28 17:16:40 +08:00
import { Button, Dropdown, Menu, message, Modal } from "antd";
2022-06-02 17:11:28 +08:00
import {
2022-07-28 17:16:40 +08:00
WeaBrowser,
2022-06-02 17:11:28 +08:00
WeaCheckbox,
2022-09-08 17:04:36 +08:00
WeaDatePicker,
WeaError,
2022-07-28 17:16:40 +08:00
WeaFormItem,
2022-06-02 17:11:28 +08:00
WeaHelpfulTip,
2022-07-28 17:16:40 +08:00
WeaInput,
WeaRightMenu,
WeaSearchGroup,
WeaSelect,
WeaSlideModal,
WeaTab,
WeaTop
2022-06-02 17:11:28 +08:00
} from "ecCom";
2022-07-28 17:16:40 +08:00
import { renderNoright } from "../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import ChangeSalaryModal from "./changeSalaryModal";
import EditAgentModal from "./editAgentModal";
import SlideModalTitle from "../../components/slideModalTitle";
import SlideSalaryItem from "./slideSalaryItem";
import SlideAgent from "./slideAgent";
import ImportModal from "../../components/importModal";
import SalaryFileViewSlide from "./saralyFileViewSlide";
import CustomPaginationTable from "../../components/customPaginationTable";
import "./index.less";
2022-06-02 17:11:28 +08:00
2022-06-13 18:08:45 +08:00
const WeaTableComx = WeaTableNew.WeaTable;
2022-06-21 11:33:00 +08:00
@inject("salaryFileStore", "taxAgentStore")
2022-02-25 09:24:56 +08:00
@observer
export default class SalaryFile extends React.Component {
constructor(props) {
super(props);
this.state = {
value: "",
2022-03-17 17:18:42 +08:00
selectedKey: "0",
2022-03-17 17:53:35 +08:00
changeSalaryVisible: false,
2022-03-17 18:40:47 +08:00
editAgentVisible: false,
selectedTab: 0,
2022-04-01 10:24:55 +08:00
editSlideVisible: false,
importType: "",
2022-06-14 11:18:37 +08:00
isInit: false, //是否是初始化导入
2022-04-01 10:24:55 +08:00
modalVisiable: false,
2022-04-02 17:34:40 +08:00
step: 0,
recordSlideVisible: false,
2022-04-12 18:29:28 +08:00
selectedRowKeys: [],
2022-04-20 19:24:14 +08:00
showSearchBar: false,
2022-05-10 15:31:13 +08:00
importResult: {},
2022-07-28 17:16:40 +08:00
searchValue: "",
searchItemsValue: {
username: "",
departmentIds: "",
positionIds: "",
userstatus: "",
2022-09-01 17:52:00 +08:00
archiveStatus: "EFFICIENT",
taxAgentId: "",
subcompanyIds: ""
2022-09-08 17:04:36 +08:00
},
noPayDate: "" //最后停薪日期
2022-07-28 17:16:40 +08:00
};
this.pageInfo = { current: 1, pageSize: 10 };
2022-02-25 09:24:56 +08:00
}
2022-04-01 10:24:55 +08:00
2022-07-28 17:16:40 +08:00
Input = (value, key) => {
const { username } = this.state.searchItemsValue;
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaInput value={username} onChange={(val) => this.setState({
searchItemsValue: {
...this.state.searchItemsValue,
[key]: val
}
})}/>
</WeaFormItem>
);
};
Browser = (value, key) => {
2022-09-01 17:52:00 +08:00
const { positionIds, departmentIds, subcompanyIds } = this.state.searchItemsValue;
2022-07-28 17:16:40 +08:00
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaBrowser
isSingle={false}
2022-09-01 17:52:00 +08:00
value={key === "departmentIds" ? departmentIds : key === "subcompanyIds" ? subcompanyIds : positionIds}
2022-07-28 17:16:40 +08:00
tabs={key === "departmentIds" ? [
2022-08-16 10:10:59 +08:00
{
dataParams: null,
dataURL: null,
isSearch: false,
key: "2",
name: "组织结构",
selected: false,
showOrder: 0
},
2022-07-28 17:16:40 +08:00
{
dataParams: { list: "1" },
2022-08-16 10:10:59 +08:00
dataURL: null,
2022-07-28 17:16:40 +08:00
isSearch: true,
key: "1",
name: "按列表",
selected: false,
showOrder: 0
}
] : null}
2022-09-01 17:52:00 +08:00
type={key === "departmentIds" ? 57 : key === "subcompanyIds" ? 164 : 278}
2022-07-28 17:16:40 +08:00
onChange={(val) => {
this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } });
}}/>
</WeaFormItem>
);
};
Select = (value, key) => {
2022-08-25 17:54:18 +08:00
const { salaryFileStore, taxAgentStore } = this.props;
const { userstatus, archiveStatus, taxAgentId } = this.state.searchItemsValue;
2022-07-28 17:16:40 +08:00
const { archiveStatusList, userStatusList } = salaryFileStore;
2022-08-25 17:54:18 +08:00
const { taxAgentAdminOption } = taxAgentStore;
2022-07-28 17:16:40 +08:00
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaSelect
2022-08-25 17:54:18 +08:00
value={key === "userstatus" ? userstatus : key === "taxAgentId" ? taxAgentId : archiveStatus}
options={key === "userstatus" ? userStatusList : key === "taxAgentId" ? [{
key: "",
showname: ""
}, ...taxAgentAdminOption] : archiveStatusList}
2022-07-28 17:16:40 +08:00
onChange={(val) => this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/>
</WeaFormItem>
);
};
2022-04-01 10:24:55 +08:00
componentWillMount() {
2022-08-25 17:54:18 +08:00
const { salaryFileStore: { doInit }, taxAgentStore: { getTaxAgentSelectListAsAdmin } } = this.props;
2022-07-28 17:16:40 +08:00
doInit({ ...this.state.searchItemsValue });
2022-08-25 17:54:18 +08:00
getTaxAgentSelectListAsAdmin();
2022-04-01 10:24:55 +08:00
}
// 设置导入步数
setStep(step) {
2022-06-02 17:11:28 +08:00
this.setState({ step });
2022-04-01 10:24:55 +08:00
}
// 渲染导入模板附加元素
renderFormComponent() {
return (
2022-06-02 17:11:28 +08:00
<div style={{ display: "inline-block" }}>
2022-07-28 17:16:40 +08:00
<WeaCheckbox id="importData" content="导出现有数据"/>
2022-04-01 10:24:55 +08:00
<WeaHelpfulTip
2022-06-02 17:11:28 +08:00
width={200}
title="提示:建议先导出现有最新数据,修改后再导入"
placement="topLeft"
/>
2022-04-01 10:24:55 +08:00
</div>
2022-06-02 17:11:28 +08:00
);
2022-04-01 10:24:55 +08:00
}
// 导入预览
handlePreviewImport(params) {
2022-06-02 17:11:28 +08:00
const {
2022-07-28 17:16:40 +08:00
salaryFileStore: { importPreview }
2022-06-02 17:11:28 +08:00
} = this.props;
2022-04-01 10:24:55 +08:00
params.importType = this.state.importType;
2022-06-02 17:11:28 +08:00
importPreview(params);
2022-04-01 10:24:55 +08:00
}
2022-04-01 13:54:24 +08:00
// 导入档案
handleImportFile(params) {
2022-06-02 17:11:28 +08:00
const {
2022-07-28 17:16:40 +08:00
salaryFileStore: { importSalaryArchive }
2022-06-02 17:11:28 +08:00
} = this.props;
params.importType = this.state.importType;
2022-07-28 17:16:40 +08:00
importSalaryArchive(params, this.state.searchItemsValue).then((data) => {
2022-06-02 17:11:28 +08:00
data.errorData = data.errorNotice;
2022-04-20 19:24:14 +08:00
this.setState({
2022-07-28 17:16:40 +08:00
importResult: data
2022-06-02 17:11:28 +08:00
});
});
2022-04-01 13:54:24 +08:00
}
// 导入完成按钮操作
handleImportFinish() {
2022-06-02 17:11:28 +08:00
this.setState({ modalVisiable: false, step: 0 });
2022-04-01 13:54:24 +08:00
}
// 导出全部
handleExportAll=()=> {
let url = `${window.location.origin}/api/bs/hrmsalary/salaryArchive/exportList?ids=`;
const { searchItemsValue } = this.state;
const fileds= Object.keys(searchItemsValue);
_.forEach(fileds, it => {
url= `${url}&${it}=${searchItemsValue[it]}`
})
window.open(url, "_self");
2022-04-01 13:54:24 +08:00
}
2022-04-02 17:34:40 +08:00
// 定制列
getColumns() {
2022-06-02 17:11:28 +08:00
const {
2022-07-28 17:16:40 +08:00
salaryFileStore: { tableStore }
2022-06-02 17:11:28 +08:00
} = this.props;
return tableStore.columns
.filter((item) => item.display == "true")
.map((item) => {
item.width = item.oldWidth;
if (item.dataIndex == "operate") {
item.render = (text, record) => (
<a onClick={() => this.handleEdit(record)}>查看</a>
);
item.fixed = "right";
} else if (item.dataIndex == "username") {
item.fixed = "left";
}
return item;
});
2022-04-02 17:34:40 +08:00
}
// 编辑行
handleEdit(record) {
2022-06-02 17:11:28 +08:00
this.setState({ editSlideVisible: true });
const {
2022-07-28 17:16:40 +08:00
salaryFileStore: { setCurrentId }
2022-06-02 17:11:28 +08:00
} = this.props;
setCurrentId(record.id);
2022-04-02 17:34:40 +08:00
}
2022-09-08 17:04:36 +08:00
// 停薪
handleNoPay = () => {
2022-06-02 17:11:28 +08:00
const {
2022-09-08 17:04:36 +08:00
salaryFileStore: { stopSalary, getTableDatas }
2022-06-02 17:11:28 +08:00
} = this.props;
2022-09-08 17:04:36 +08:00
Modal.confirm({
title: "停薪确认",
content: <WeaFormItem
label="最后发薪日期"
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaDatePicker
value={this.state.noPayDate}
viewAttr={3}
style={{ width: "100%" }}
2022-09-08 17:04:36 +08:00
onChange={noPayDate => this.setState({ noPayDate })}
/>
</WeaFormItem>,
width: 516,
onOk: () => {
if (_.isEmpty(this.state.noPayDate)) {
message.warning("请选择最后发薪日期")
return false;
}
stopSalary(this.state.noPayDate).then(() => {
2022-09-08 17:04:36 +08:00
getTableDatas({ ...this.state.searchItemsValue });
});
2022-09-08 17:04:36 +08:00
},
onCancel: () => {
}
})
2022-09-08 17:04:36 +08:00
};
2022-04-02 17:34:40 +08:00
// 查看 Slide 头部操作按钮
2022-08-25 17:54:18 +08:00
renderEditSlideOperate = () => {
const { taxAgentStore: { showOperateBtn }, salaryFileStore: { salaryIncreaseUrl, currentId } } = this.props;
const { isShow, url } = salaryIncreaseUrl;
let arrList = [];
if (showOperateBtn && isShow === "true") {
arrList.push(<Button type="primary" onClick={() => {
window.open(`${url}&salaryArchiveId=${currentId}`);
}}>发起调薪</Button>);
}
if (showOperateBtn) {
arrList.push(<Button type="primary" onClick={() => {
this.setState({ changeSalaryVisible: true });
}}>调薪</Button>);
arrList.push(<Button type="primary" onClick={this.handleNoPay}>停薪</Button>);
}
return arrList;
2022-08-25 17:54:18 +08:00
};
2022-04-02 17:34:40 +08:00
// table选中条目
2022-06-02 17:11:28 +08:00
onSelectChange = (selectedRowKeys) => {
2022-04-02 17:34:40 +08:00
this.setState({ selectedRowKeys });
};
2022-04-12 18:29:28 +08:00
// 显示影响搜索面板
handleShowSearchBar = () => {
this.setState({
2022-07-28 17:16:40 +08:00
showSearchBar: !this.state.showSearchBar
2022-06-02 17:11:28 +08:00
});
};
2022-04-12 18:29:28 +08:00
2022-04-24 17:52:38 +08:00
// 页面跳转
handlePageChange = (value) => {
2022-07-28 17:16:40 +08:00
const { salaryFileStore: { getTableDatas, form } } = this.props;
2022-06-07 09:08:36 +08:00
this.pageInfo.current = value;
2022-07-28 17:16:40 +08:00
getTableDatas({ ...this.state.searchItemsValue, ...this.pageInfo });
};
2022-06-07 09:08:36 +08:00
handleShowSizeChange(pageInfo) {
2022-07-28 17:16:40 +08:00
const { salaryFileStore: { getTableDatas, form } } = this.props;
getTableDatas({ ...this.state.searchItemsValue, ...pageInfo });
2022-04-24 17:52:38 +08:00
}
2022-07-20 10:33:23 +08:00
2022-05-10 15:31:13 +08:00
// 搜索
handleSearch(value) {
2022-06-02 17:11:28 +08:00
const {
2022-07-28 17:16:40 +08:00
salaryFileStore: { getTableDatas, form }
2022-06-02 17:11:28 +08:00
} = this.props;
getTableDatas({ username: value });
2022-05-10 15:31:13 +08:00
}
2022-04-24 17:52:38 +08:00
2022-05-12 17:04:33 +08:00
// 初始化导入参数
handleInitModal() {
2022-06-02 17:11:28 +08:00
const {
2022-07-28 17:16:40 +08:00
salaryFileStore: { setPreviewDataSource }
2022-06-02 17:11:28 +08:00
} = this.props;
setPreviewDataSource([]);
2022-05-12 17:04:33 +08:00
this.setState({
2022-07-28 17:16:40 +08:00
importResult: {}
2022-06-02 17:11:28 +08:00
});
2022-05-12 17:04:33 +08:00
}
2022-06-13 18:08:45 +08:00
showColumn = () => {
const { salaryFileStore: { tableStore } } = this.props;
2022-07-28 17:16:40 +08:00
// console.log("showColumn:", tableStore.setColSetVisible(true));
2022-06-13 18:08:45 +08:00
tableStore.setColSetVisible(true);
tableStore.tableColSet(true);
2022-07-28 17:16:40 +08:00
// console.log("showColumn:");
};
2022-06-13 18:08:45 +08:00
2022-02-25 09:24:56 +08:00
render() {
2022-06-22 17:14:53 +08:00
const { salaryFileStore, taxAgentStore: { showOperateBtn } } = this.props;
2022-06-02 17:11:28 +08:00
const {
loading,
hasRight,
form,
condition,
tableStore,
showSearchAd,
getTableDatas,
doSearch,
2022-08-25 17:54:18 +08:00
setShowSearchAd,
setSalaryIncreaseUrl
2022-06-02 17:11:28 +08:00
} = salaryFileStore;
const {
importType,
previewColumns,
previewDataSource,
dataSource,
currentId,
editAgentVisible,
setEditAgentVisible,
2022-07-28 17:16:40 +08:00
pageInfo
2022-06-02 17:11:28 +08:00
} = salaryFileStore;
2022-04-02 17:34:40 +08:00
const { selectedTab, step, selectedRowKeys } = this.state;
2022-06-02 17:11:28 +08:00
if (!hasRight && !loading) {
// 无权限处理
2022-02-25 09:24:56 +08:00
return renderNoright();
}
2022-06-02 17:11:28 +08:00
const rightMenu = [
// 右键菜单
{
key: "BTN_COLUMN",
2022-07-28 17:16:40 +08:00
icon: <i className="icon-coms-Custom"/>,
2022-06-02 17:11:28 +08:00
content: "显示列定制",
2022-07-28 17:16:40 +08:00
onClick: this.showColumn
}
2022-02-25 09:24:56 +08:00
];
2022-06-02 17:11:28 +08:00
const collectParams = {
// 收藏功能配置
favname: "薪资档案",
2022-02-25 09:24:56 +08:00
favouritetype: 1,
objid: 0,
2022-06-02 17:11:28 +08:00
link: "wui/index.html#/ns_demo03/index",
2022-07-28 17:16:40 +08:00
importantlevel: 1
2022-02-25 09:24:56 +08:00
};
2022-06-02 17:11:28 +08:00
const adBtn = [
// 高级搜索内部按钮
2022-07-28 17:16:40 +08:00
<Button type="primary" onClick={() => doSearch(this.state.searchItemsValue)}>
2022-06-02 17:11:28 +08:00
搜索
</Button>,
2022-07-28 17:16:40 +08:00
<Button type="ghost" onClick={() => this.setState({
searchItemsValue: {
username: "",
departmentIds: "",
positionIds: "",
userstatus: "",
archiveStatus: ""
}
})}>
2022-06-02 17:11:28 +08:00
重置
</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
取消
2022-07-28 17:16:40 +08:00
</Button>
2022-02-25 09:24:56 +08:00
];
2022-06-02 17:11:28 +08:00
const topTab = [];
2022-02-25 09:24:56 +08:00
2022-07-28 17:16:40 +08:00
const renderSearchOperationItem = () => {
};
2022-02-25 09:24:56 +08:00
2022-03-17 17:18:42 +08:00
const handleMenuClick = (e) => {
2022-06-02 17:11:28 +08:00
const { key } = e;
if (key === "init") {
Modal.confirm({
title: "信息确认",
content: `若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入,点击确定继续导入`,
onOk: () => {
2022-06-14 11:18:37 +08:00
this.setState({ importType: e.key, isInit: true, modalVisiable: true, step: 0 });
2022-06-02 17:11:28 +08:00
},
2022-07-28 17:16:40 +08:00
onCancel() {
}
2022-06-02 17:11:28 +08:00
});
} else {
2022-06-17 16:53:27 +08:00
this.setState({ importType: e.key, isInit: true, modalVisiable: true, step: 0 });
2022-06-02 17:11:28 +08:00
}
};
2022-03-17 17:18:42 +08:00
const handleMenuClick2 = () => {
2022-04-02 17:34:40 +08:00
const { electedRowKeys } = this.state;
2022-06-02 17:11:28 +08:00
if (selectedRowKeys.length == 0) {
message.warning("未选择条目");
return;
2022-04-02 17:34:40 +08:00
}
// const {
// salaryFileStore: { exportSalaryArchive }
// } = this.props;
// exportSalaryArchive(selectedRowKeys.join(","));
const url = `${window.location.origin}/api/bs/hrmsalary/salaryArchive/exportList?ids=${selectedRowKeys.join(",")}`;
window.open(url, "_self");
2022-06-02 17:11:28 +08:00
};
2022-03-17 17:18:42 +08:00
const menu = (
<Menu onClick={handleMenuClick}>
2022-07-20 10:33:23 +08:00
{/*暂时去掉调整个税扣缴义务人导入按钮*/}
2022-07-28 17:16:40 +08:00
{_.filter(importType, it => it.id !== "taxAgentAdjust").map((item) => (
2022-06-02 17:11:28 +08:00
<Menu.Item key={item.id}>{item.content}</Menu.Item>
))}
2022-03-17 17:18:42 +08:00
</Menu>
);
const menu2 = (
<Menu onClick={handleMenuClick2}>
2022-04-01 13:54:24 +08:00
<Menu.Item key="1">导出所选</Menu.Item>
2022-03-17 17:18:42 +08:00
</Menu>
);
const renderRightOperation = () => {
2022-06-02 17:11:28 +08:00
return (
<div
2022-07-28 17:16:40 +08:00
style={{
marginTop: 10
}}
2022-06-02 17:11:28 +08:00
className="salaryFileTabWrapper">
2022-06-21 11:33:00 +08:00
{
2022-07-20 10:33:23 +08:00
showOperateBtn &&
2022-06-21 11:33:00 +08:00
<Fragment>
<WeaHelpfulTip
style={{ marginRight: "10px" }}
width={300}
title="导入按钮使用场景说明<br/>
1.档案初始化<br/>
a.初次使用薪酬模块全量导入员工的薪资档案数据<br/>
b.员工入职导入新入职的员工的薪资档案数据若导入表格中的人员已存在在薪资档案中初始化导入会将档案中该人员的数据清除再导入<br/>
c.返聘人员使用调薪功能调整薪资档案值或使用调整个税扣缴<br/>
2.调薪档案中已存在的人员批量调整薪资项目值包括返聘人员的情况<br/>
3.调整个税扣缴义务人档案中已存在的人员批量调整个税扣缴义务人包括返聘人员的情况<br/>"
placement="topLeft"
/>
<Dropdown.Button
type="primary"
style={{ marginRight: "10px" }}
overlay={menu}>
导入
</Dropdown.Button>
<Dropdown.Button
style={{ marginRight: "10px" }}
overlay={menu2}
onClick={() => {
this.handleExportAll();
}}>
导出全部
</Dropdown.Button>
</Fragment>
}
{/*暂时隐藏*/}
{/*<Button*/}
{/* type="default"*/}
{/* style={{ marginRight: "10px" }}*/}
{/* onClick={() => {*/}
{/* this.setState({ recordSlideVisible: true });*/}
{/* }}>*/}
{/* 调薪记录*/}
{/*</Button>*/}
2022-07-28 17:16:40 +08:00
{/*<WeaInputSearch*/}
{/* value={this.state.searchValue}*/}
{/* onChange={(value) => {*/}
{/* this.setState({*/}
{/* searchValue: value*/}
{/* });*/}
{/* }}*/}
{/* onSearch={(value) => {*/}
{/* this.handleSearch(value);*/}
{/* }}*/}
{/*/>*/}
2022-06-02 17:11:28 +08:00
{/* <Button type="default" onClick={() =>{this.handleShowSearchBar()}}>高级搜索</Button> */}
</div>
);
};
2022-03-17 18:40:47 +08:00
2022-07-28 17:16:40 +08:00
const renderSearch = () => {
const searchItems = [
{ com: this.Input("姓名", "username") },
2022-09-01 17:52:00 +08:00
{ com: this.Browser("分部", "subcompanyIds") },
2022-07-28 17:16:40 +08:00
{ com: this.Browser("部门", "departmentIds") },
{ com: this.Browser("岗位", "positionIds") },
{ com: this.Select("人员状态", "userstatus") },
2022-08-25 17:54:18 +08:00
{ com: this.Select("档案状态", "archiveStatus") },
{ com: this.Select("个税扣缴义务人", "taxAgentId") }
2022-07-28 17:16:40 +08:00
];
return <WeaSearchGroup title={"基本信息"} items={searchItems} showGroup/>;
};
const handleSlideMoreMenuClick = () => {
};
2022-03-17 18:40:47 +08:00
const slideMoreMenu = (
<Menu onClick={handleSlideMoreMenuClick}>
<Menu.Item key="1">导出全部</Menu.Item>
</Menu>
);
2022-06-02 17:11:28 +08:00
2022-03-17 18:40:47 +08:00
const renderCustomOperate = () => {
return (
2022-06-02 17:11:28 +08:00
<div style={{ display: "inline-block" }}>
<Dropdown.Button type="primary" overlay={slideMoreMenu}>
导出
</Dropdown.Button>
2022-03-17 18:40:47 +08:00
<Button type="default">自定义列</Button>
</div>
2022-06-02 17:11:28 +08:00
);
};
2022-03-17 18:40:47 +08:00
2022-04-02 17:34:40 +08:00
const rowSelection = {
2022-06-02 17:11:28 +08:00
selectedRowKeys,
2022-07-28 17:16:40 +08:00
onChange: this.onSelectChange
2022-04-02 17:34:40 +08:00
};
2022-02-25 09:24:56 +08:00
return (
<div className="mySalaryBenefitsWrapper">
<WeaRightMenu
datas={rightMenu} // 右键菜单
collectParams={collectParams} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
>
<WeaTop
title="薪资档案" // 文字
icon={<i className="icon-coms-fa"/>} // 左侧图标
2022-06-02 17:11:28 +08:00
iconBgcolor="#F14A2D" // 左侧图标背景色
2022-02-25 09:24:56 +08:00
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
>
2022-07-28 17:16:40 +08:00
<WeaTab
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={(bool) => setShowSearchAd(bool)} //高级搜索面板受控
searchsAd={renderSearch()} // 高级搜索内部数据getSearchs(form, toJS(condition), 2)
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => doSearch(this.state.searchItemsValue)} // 点搜索按钮时的回调this.handleSearch()
searchsAdQuick={renderRightOperation()}
searchsBasePlaceHolder={"请输入姓名"}
2022-07-28 17:16:40 +08:00
onSearchChange={(v) =>
this.setState({
searchItemsValue: {
...this.state.searchItemsValue,
username: v
}
})} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值form.updateFields({ username: v })
searchsBaseValue={this.state.searchItemsValue.username} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username
2022-06-13 18:08:45 +08:00
/>
<WeaTableComx
2022-07-28 17:16:40 +08:00
style={{ display: "none" }}
2022-06-13 18:08:45 +08:00
comsWeaTableStore={tableStore}
needScroll={true}
/>
2022-06-07 09:08:36 +08:00
<CustomPaginationTable
2022-04-25 17:18:58 +08:00
loading={loading}
className="wea-antd-wrapper"
2022-04-02 17:34:40 +08:00
rowSelection={rowSelection}
columns={this.getColumns()}
dataSource={dataSource}
2022-06-07 09:08:36 +08:00
total={pageInfo.total}
current={pageInfo.pageNum}
pageSize={this.pageInfo.pageSize}
2022-07-28 17:16:40 +08:00
rowClassName={(record) => record.archiveStatus === "ARCHIVE" ? "archiveRow" : ""}
scroll={{ x: this.getColumns().length ? this.getColumns().length * 150 : 1200 }}
2022-06-07 09:08:36 +08:00
onPageChange={(value) => {
2022-07-28 17:16:40 +08:00
this.handlePageChange(value);
2022-06-07 09:08:36 +08:00
}}
onShowSizeChange={(current, pageSize) => {
2022-07-28 17:16:40 +08:00
this.pageInfo = { current, pageSize };
this.handleShowSizeChange(this.pageInfo);
2022-06-07 09:08:36 +08:00
}}
2022-04-02 17:34:40 +08:00
/>
2022-02-25 09:24:56 +08:00
</WeaTop>
</WeaRightMenu>
2022-04-01 10:24:55 +08:00
2022-06-02 17:11:28 +08:00
{this.state.modalVisiable && (
<ImportModal
2022-05-12 17:04:33 +08:00
init={() => {
2022-06-02 17:11:28 +08:00
this.handleInitModal();
2022-05-12 17:04:33 +08:00
}}
2022-06-14 11:18:37 +08:00
isInit={this.state.isInit}
2022-04-01 10:24:55 +08:00
params={{}}
2022-04-01 13:54:24 +08:00
columns={previewColumns}
2022-04-01 10:24:55 +08:00
step={step}
setStep={this.setStep.bind(this)}
2022-04-01 13:54:24 +08:00
slideDataSource={previewDataSource}
2022-04-20 19:24:14 +08:00
importResult={this.state.importResult}
2022-06-02 17:11:28 +08:00
onFinish={() => {
this.handleImportFinish();
}}
2022-04-01 10:24:55 +08:00
previewImport={(params) => {
2022-06-02 17:11:28 +08:00
this.handlePreviewImport(params);
}}
importFile={(params) => {
this.handleImportFile(params);
}}
templateLink={
"/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=" +
this.state.importType
}
renderFormComponent={() => {
this.renderFormComponent();
}}
visiable={this.state.modalVisiable}
onCancel={() => {
this.setState({ modalVisiable: false });
2022-04-01 10:24:55 +08:00
}}
/>
2022-06-02 17:11:28 +08:00
)}
{this.state.changeSalaryVisible && (
<ChangeSalaryModal
2022-04-07 13:39:21 +08:00
currentId={currentId}
2022-03-17 17:53:35 +08:00
visible={this.state.changeSalaryVisible}
2022-06-02 17:11:28 +08:00
onCancel={() => {
this.setState({ changeSalaryVisible: false });
}}
2022-03-17 17:53:35 +08:00
/>
2022-06-02 17:11:28 +08:00
)}
2022-03-17 17:53:35 +08:00
2022-06-02 17:11:28 +08:00
{editAgentVisible && (
<EditAgentModal
2022-04-07 13:39:21 +08:00
currentId={currentId}
visible={editAgentVisible}
2022-06-02 17:11:28 +08:00
onCancel={() => {
setEditAgentVisible(false);
}}
2022-03-17 17:53:35 +08:00
/>
2022-06-02 17:11:28 +08:00
)}
2022-03-17 18:40:47 +08:00
2022-05-18 09:21:42 +08:00
{/* 操作记录 */}
2022-06-02 17:11:28 +08:00
{this.state.recordSlideVisible && (
<WeaSlideModal
visible={this.state.recordSlideVisible}
top={0}
width={40}
height={100}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
subtitle={"操作记录"}
tabs={[
2022-07-28 17:16:40 +08:00
{ title: "薪资项目", key: 0 }
2022-07-20 10:33:23 +08:00
// { title: "个税扣缴义务人", key: 1 },
2022-06-02 17:11:28 +08:00
]}
editable={false}
2022-06-22 17:14:53 +08:00
showOperateBtn={showOperateBtn}
2022-06-02 17:11:28 +08:00
selectedTab={selectedTab}
customOperate={() => {
renderCustomOperate();
}}
subItemChange={(item) => {
this.setState({ selectedTab: item.key });
}}
/>
}
content={
<div>
2022-07-28 17:16:40 +08:00
{selectedTab == 0 && <SlideSalaryItem/>}
{selectedTab == 1 && <SlideAgent/>}
2022-06-02 17:11:28 +08:00
</div>
}
onClose={() => this.setState({ recordSlideVisible: false })}
showMask={true}
closeMaskOnClick={() =>
this.setState({ recordSlideVisible: false })
}
/>
)}
{this.state.editSlideVisible && (
<WeaSlideModal
className="slideOuterWrapper"
2022-06-02 17:11:28 +08:00
visible={this.state.editSlideVisible}
top={0}
width={40}
height={100}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
subtitle={"员工薪资档案"}
editable={false}
customOperate={this.renderEditSlideOperate()}
/>
}
2022-07-28 17:16:40 +08:00
content={<SalaryFileViewSlide id={currentId}/>}
2022-08-25 17:54:18 +08:00
onClose={() => {
this.setState({ editSlideVisible: false });
setSalaryIncreaseUrl({});
}}
2022-06-02 17:11:28 +08:00
showMask={true}
2022-08-25 17:54:18 +08:00
closeMaskOnClick={() => {
setSalaryIncreaseUrl({});
this.setState({ editSlideVisible: false });
}}
2022-06-02 17:11:28 +08:00
/>
)}
2022-02-25 09:24:56 +08:00
</div>
2022-06-02 17:11:28 +08:00
);
2022-02-25 09:24:56 +08:00
}
}