feature/2.9.10.2312.02-薪资档案页面重构
This commit is contained in:
parent
c01c03f1b0
commit
252d4e0ff7
|
|
@ -12,11 +12,11 @@ import "./index.less";
|
|||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("salaryFileStore")
|
||||
@inject("payrollFilesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { salaryFileStore: { salaryFileQueryForm } } = this.props;
|
||||
const { payrollFilesStore: { salaryFileQueryForm } } = this.props;
|
||||
return (
|
||||
<div className="achrive-advance-search">
|
||||
<WeaInputSearch value={salaryFileQueryForm.getFormParams().username}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import { getTaxAgentSelectList } from "../../../../apis/taxAgent";
|
|||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("salaryFileStore")
|
||||
@inject("payrollFilesStore")
|
||||
@observer
|
||||
class salaryFileAdvanceSearchPannel extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -41,7 +41,7 @@ class salaryFileAdvanceSearchPannel extends Component {
|
|||
...child,
|
||||
options: _.map(userStatusList, o => ({ key: String(o.value), showname: o.defaultLabel }))
|
||||
};
|
||||
} else if (getKey(child) === "statuses") {
|
||||
} else if (getKey(child) === "taxAgentId") {
|
||||
return {
|
||||
...child,
|
||||
options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content }))
|
||||
|
|
@ -52,14 +52,14 @@ class salaryFileAdvanceSearchPannel extends Component {
|
|||
};
|
||||
})
|
||||
}, () => {
|
||||
const { salaryFileStore: { salaryFileQueryForm } } = this.props;
|
||||
const { payrollFilesStore: { salaryFileQueryForm } } = this.props;
|
||||
salaryFileQueryForm.initFormFields(this.state.searchConditions);
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { searchConditions } = this.state;
|
||||
const { salaryFileStore: { salaryFileQueryForm } } = this.props;
|
||||
const { payrollFilesStore: { salaryFileQueryForm } } = this.props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="wea-advanced-searchsAd">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资档案页面重构-导入弹窗
|
||||
* Description:
|
||||
* Date: 2024/1/9
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaCheckbox, WeaLocaleProvider } from "ecCom";
|
||||
import ImportDialog from "../../../.././components/importDialog";
|
||||
import { convertToUrlString, getURLParameters } from "../../../../util/url";
|
||||
import { importSalaryArchive } from "../../../../apis/payrollFiles";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("payrollFilesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
importDialog: {
|
||||
nextloading: false, link: "", importResult: {}, imageId: "",
|
||||
previewUrl: "/api/bs/hrmsalary/salaryArchive/preview",
|
||||
extraPreview: {}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { payrollFilesStore: { salaryFileQueryForm }, importType, isExtEmp } = nextProps;
|
||||
let payload = {}, extraPreview = {};
|
||||
if (importType !== "init" && importType !== "salaryItemAdjust") {
|
||||
extraPreview = {
|
||||
importType: "", listType: importType
|
||||
};
|
||||
payload = {
|
||||
importType: "", listType: importType,
|
||||
...salaryFileQueryForm.getFormParams()
|
||||
};
|
||||
} else {
|
||||
extraPreview = {
|
||||
importType: importType, listType: "FIXED"
|
||||
};
|
||||
payload = {
|
||||
importType: importType, listType: "FIXED",
|
||||
...salaryFileQueryForm.getFormParams()
|
||||
};
|
||||
}
|
||||
if (isExtEmp) payload = { ...payload, extSalaryArchiveList: true };
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...this.state.importDialog, extraPreview,
|
||||
link: `/api/bs/hrmsalary/salaryArchive/downloadTemplate?${convertToUrlString(payload)}`
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
importDialog: {
|
||||
nextloading: false, link: "", importResult: {}, imageId: "",
|
||||
previewUrl: "/api/bs/hrmsalary/salaryArchive/preview",
|
||||
extraPreview: {}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleImport = (payload) => {
|
||||
const { importDialog } = this.state, { isExtEmp } = this.props;
|
||||
const { extraPreview } = importDialog;
|
||||
this.setState({ importDialog: { ...importDialog, nextloading: true } });
|
||||
importSalaryArchive({ ...payload, ...extraPreview, isExtEmp }).then(({ data, status }) => {
|
||||
this.setState({ importDialog: { ...importDialog, nextloading: false } });
|
||||
if (status) {
|
||||
this.setState({
|
||||
importDialog: { ...importDialog, ...payload, importResult: data }
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { importDialog } = this.state;
|
||||
const { link } = importDialog;
|
||||
return (
|
||||
<ImportDialog
|
||||
{...this.props} {...importDialog}
|
||||
onResetImportResult={() => this.setState({
|
||||
importDialog: {
|
||||
...importDialog, importResult: {}, imageId: "", link: ""
|
||||
}
|
||||
})}
|
||||
exportDataDom={
|
||||
<WeaCheckbox
|
||||
value={getURLParameters(link)["hasData"] === "true" ? "1" : "0"}
|
||||
content={getLabel(543208, "导出现有数据")}
|
||||
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
|
||||
onChange={val => {
|
||||
let payload = { ...getURLParameters(link), hasData: val === "1" };
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...importDialog,
|
||||
link: `/api/bs/hrmsalary/salaryArchive/downloadTemplate?${convertToUrlString(payload)}`
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
|
||||
nextUplaodCallback={imageId => this.handleImport({ imageId })}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资档案页面重构-列表
|
||||
* Description:
|
||||
* Date: 2024/1/8
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import { toJS } from "mobx";
|
||||
import { message, Spin } from "antd";
|
||||
import * as API from "../../../../apis/payrollFiles";
|
||||
|
||||
const WeaTableComx = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const URLLIST = {
|
||||
pending: "/api/bs/hrmsalary/salaryArchive/pendingList",
|
||||
fixed: "/api/bs/hrmsalary/salaryArchive/fixedList",
|
||||
suspend: "/api/bs/hrmsalary/salaryArchive/suspendList",
|
||||
stop: "/api/bs/hrmsalary/salaryArchive/stopList",
|
||||
ext: "/api/bs/hrmsalary/salaryArchive/extList"
|
||||
};
|
||||
const APILIST = {
|
||||
addToSalarypayment: API.gotoFixed, //设为发薪员工
|
||||
delPenditngToDo: API.deletePendingTodo, //待定薪删除待办
|
||||
delSalaryFiles: API.deleteSalaryArchive, //删除薪资档案
|
||||
salarySuspension: API.gotoStop, //停薪
|
||||
delSuspendToDo: API.deleteSuspendTodo, //待停薪删除待办
|
||||
cancelSalarySuspension: API.cancelStop //取消停薪
|
||||
};
|
||||
|
||||
@inject("payrollFilesStore", "taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], loading: false, selectedRowKeys: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getSalaryFileList(this.props);
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
window.addEventListener("resize", this.handleResize, false);
|
||||
}
|
||||
|
||||
handleResize = () => {
|
||||
this.forceUpdate();
|
||||
};
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if ((nextProps.selectedKey !== this.props.selectedKey) || (nextProps.isQuery !== this.props.isQuery)) {
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current: 1, pageSize: 10, total: 0 }
|
||||
}, () => this.getSalaryFileList(nextProps));
|
||||
}
|
||||
if ((nextProps.selectedKey !== this.props.selectedKey)) {
|
||||
this.setState({
|
||||
dataSource: [], columns: [], loading: false, selectedRowKeys: [],
|
||||
welfareEditSlide: { ...this.state.welfareEditSlide, visible: false }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
window.removeEventListener("resize", this.handleResize, false);
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getColumns();
|
||||
} else if (type === "turn") {
|
||||
console.log(data);
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, ...params }
|
||||
}, () => this.getSalaryFileList(this.props));
|
||||
break;
|
||||
case "ROWSELECTION":
|
||||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
break;
|
||||
case "ADD-TO-SALARYPAYMENT":
|
||||
case "DEL-PENDITNG-TO-DO":
|
||||
case "DEL-SALARY-FILES":
|
||||
case "SALARY-SUSPENSION":
|
||||
case "DEL-SUSPEND-TO-DO":
|
||||
case "CANCEL-SALARY-SUSPENSION":
|
||||
const { interfaceParams } = params;
|
||||
this.handleSalaryOpts(_.camelCase(id), interfaceParams);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
handleSalaryOpts = (type, payload) => {
|
||||
WeaLoadingGlobal.start();
|
||||
APILIST[type](payload).then(({ status, data = {}, errormsg }) => {
|
||||
WeaLoadingGlobal.destroy();
|
||||
if (status) {
|
||||
const { msg, type } = data;
|
||||
if (type === "fail" || type === "info") {
|
||||
message.error(msg);
|
||||
} else if (type === "success") {
|
||||
message.success(msg);
|
||||
this.getSalaryFileList(this.props);
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
} else {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.getSalaryFileList(this.props);
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
}
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"操作": getLabel(30585, "操作"), "调薪": getLabel(542686, "调薪"),
|
||||
"增员": getLabel(543180, "增员"), "删除档案": getLabel(23238, "删除档案"),
|
||||
"删除待办": getLabel(543181, "删除待办"), "查看": getLabel(33564, "查看"),
|
||||
"取消停薪": getLabel(543309, "取消停薪"), "共": getLabel(18609, "共"),
|
||||
"条": getLabel(18256, "条"), "设为发薪人员": getLabel(543308, "设为发薪人员"),
|
||||
"停薪": getLabel(542692, "停薪"), "编辑": getLabel(501169, "编辑")
|
||||
};
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getSalaryFileList = (props) => {
|
||||
const { pageInfo } = this.state;
|
||||
const {
|
||||
payrollFilesStore: { salaryFileQueryForm, queryList }, selectedKey, onChangeTopTabCount
|
||||
} = props;
|
||||
this.setState({ loading: true });
|
||||
queryList(pageInfo, salaryFileQueryForm.getFormParams(), URLLIST[selectedKey]).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { pageInfo: result } = data;
|
||||
const { list: dataSource, total, pageNum: current, pageSize } = result;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
|
||||
}, () => {
|
||||
onChangeTopTabCount(selectedKey, total);
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getColumns = () => {
|
||||
const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({
|
||||
dataIndex: it.dataIndex, title: it.title, align: "left",
|
||||
width: (it.dataIndex === "taxAgentName" || it.dataIndex === "operate") ? 185 : 150,
|
||||
fixed: it.dataIndex === "username" ? "left" : it.dataIndex === "operate" ? "right" : "",
|
||||
ellipsis: true
|
||||
}));
|
||||
if (!_.isEmpty(columns)) {
|
||||
this.postMessageToChild({
|
||||
columns, showOperateBtn, selectedKey: this.props.selectedKey,
|
||||
showDelSalaryFileBtn: this.props.showDelSalaryFileBtn,
|
||||
dataSource: this.state.dataSource, selectedRowKeys: this.state.selectedRowKeys,
|
||||
showSum: false, pageInfo: this.state.pageInfo
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, dataSource } = this.state;
|
||||
const { payrollFilesStore: { tableStore } } = this.props;
|
||||
const dom = document.querySelector(".wea-new-top-req-content");
|
||||
let height = 280;
|
||||
if (dom && dataSource.length > 0) {
|
||||
height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 39 + 113 : dataSource.length < 10 ? dataSource.length * 39 + 113 : parseFloat(dom.style.height) - 16;
|
||||
}
|
||||
return (
|
||||
<div className="table-layout" style={{ height: height + "px" }}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
src="http://localhost:7607/#/salaryFileTable"
|
||||
// src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/salaryFileTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
<WeaTableComx
|
||||
style={{ display: "none" }}
|
||||
comsWeaTableStore={tableStore}
|
||||
needScroll={true}
|
||||
columns={this.getColumns()}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import { WeaHelpfulTip, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { Button, Dropdown, Menu } from "antd";
|
||||
import AdvanceInputBtn from "../components/advanceInputBtn";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
|
|
@ -44,38 +44,59 @@ export const tabCondition = [
|
|||
}
|
||||
];
|
||||
export const tabList = [
|
||||
{ viewcondition: "pending", lanId: 542689, title: "待定薪", showcount: true, groupid: "PENDING" },
|
||||
{ viewcondition: "fixed", lanId: 544638, title: "发薪员工", showcount: true, groupid: "FIXED" },
|
||||
{ viewcondition: "suspend", lanId: 542691, title: "待停薪", showcount: true, groupid: "SUSPEND" },
|
||||
{ viewcondition: "stop", lanId: 544637, title: "停薪员工", showcount: true, groupid: "STOP" },
|
||||
{ viewcondition: "ext", lanId: 542679, title: "非系统人员", showcount: true, groupid: "EXT" }
|
||||
{ viewcondition: "pending", title: getLabel(542689, "待定薪"), showcount: true, groupid: "PENDING" },
|
||||
{ viewcondition: "fixed", title: getLabel(544638, "发薪员工"), showcount: true, groupid: "FIXED" },
|
||||
{ viewcondition: "suspend", title: getLabel(542691, "待停薪"), showcount: true, groupid: "SUSPEND" },
|
||||
{ viewcondition: "stop", title: getLabel(544637, "停薪员工"), showcount: true, groupid: "STOP" },
|
||||
{ viewcondition: "ext", title: getLabel(542679, "非系统人员"), showcount: true, groupid: "EXT" }
|
||||
];
|
||||
export const renderReqBtns = (selectedKey, onOpenAdvanceSearch, onAdvanceSearch) => {
|
||||
export const renderReqBtns = (selectedKey, salaryImportTypes, onSalaryOpts, showOperateBtn) => {
|
||||
let reqBtns = [
|
||||
<Button type="primary">{getLabel(32935, "导入")}</Button>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={onOpenAdvanceSearch} onAdvanceSearch={onAdvanceSearch}/>
|
||||
<Button type="primary" onClick={() => onSalaryOpts("IMPORT")}>{getLabel(32935, "导入")}</Button>,
|
||||
<AdvanceInputBtn
|
||||
onOpenAdvanceSearch={() => onSalaryOpts("OPEN")} onAdvanceSearch={() => onSalaryOpts("SEARCH")}
|
||||
/>
|
||||
];
|
||||
switch (selectedKey) {
|
||||
case "pending":
|
||||
reqBtns.splice(1, 0, <Button type="ghost">{getLabel(543304, "全部设为发薪人员")}</Button>);
|
||||
!showOperateBtn && reqBtns.shift();
|
||||
showOperateBtn && reqBtns.splice(1, 0, <Button type="ghost" onClick={() => onSalaryOpts("ALL-GO-TO-FIXED")}>
|
||||
{getLabel(543304, "全部设为发薪人员")}
|
||||
</Button>);
|
||||
break;
|
||||
case "suspend":
|
||||
!showOperateBtn && reqBtns.shift();
|
||||
break;
|
||||
case "fixed":
|
||||
case "ext":
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
reqBtns.shift();
|
||||
showOperateBtn && reqBtns.unshift(
|
||||
<Dropdown overlay={
|
||||
<Menu className="dropdownMenuWrapper" onClick={({ key }) => onSalaryOpts("IMPORT", key)}>
|
||||
{salaryImportTypes.map((item) => (
|
||||
<Menu.Item key={item.id}>{item.content}</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
}>
|
||||
<Button type="primary">{getLabel(32935, "导入")}</Button>
|
||||
</Dropdown>
|
||||
);
|
||||
showOperateBtn && reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={<HelpfulDiv/>}
|
||||
/>);
|
||||
break;
|
||||
case "stop":
|
||||
reqBtns.shift();
|
||||
reqBtns.unshift(<Button type="primary">{getLabel(543307, "批量取消停薪")}</Button>);
|
||||
showOperateBtn && reqBtns.unshift(<Button type="primary"
|
||||
onClick={() => onSalaryOpts("CANCEL-SALARY-SUSPENSION")}>{getLabel(543307, "批量取消停薪")}</Button>);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return reqBtns;
|
||||
};
|
||||
export const renderDropMenuDatas = (selectedKey) => {
|
||||
export const renderDropMenuDatas = (selectedKey, showOperateBtn) => {
|
||||
let menus = [{
|
||||
key: "custom_cols",
|
||||
icon: <i className="icon-coms-Custom"/>,
|
||||
|
|
@ -85,12 +106,12 @@ export const renderDropMenuDatas = (selectedKey) => {
|
|||
case "pending":
|
||||
menus = [
|
||||
{
|
||||
key: "batchSet",
|
||||
key: "ADD-TO-SALARYPAYMENT",
|
||||
icon: <i className="icon-coms-BatchEditing-Hot"/>,
|
||||
content: getLabel(543305, "批量设为发薪员工")
|
||||
},
|
||||
{
|
||||
key: "batchDelete",
|
||||
key: "DEL-PENDITNG-TO-DO",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
|
|
@ -125,17 +146,17 @@ export const renderDropMenuDatas = (selectedKey) => {
|
|||
case "suspend":
|
||||
menus = [
|
||||
{
|
||||
key: "allWithoutpay",
|
||||
key: "FULL-SALARY-SUSPENSION",
|
||||
icon: <i className="icon-coms02-all"/>,
|
||||
content: getLabel(543326, "全部停薪")
|
||||
},
|
||||
{
|
||||
key: "batchWithoutpay",
|
||||
key: "SALARY-SUSPENSION",
|
||||
icon: <i className="icon-coms-BatchEditing-Hot"/>,
|
||||
content: getLabel(543724, "批量停薪")
|
||||
},
|
||||
{
|
||||
key: "batchDelete",
|
||||
key: "DEL-SUSPEND-TO-DO",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
|
|
@ -170,7 +191,7 @@ export const renderDropMenuDatas = (selectedKey) => {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return menus;
|
||||
return showOperateBtn ? menus : _.filter(menus, o => o.key === "custom_cols");
|
||||
};
|
||||
|
||||
export const salaryFileSearchConditions = [
|
||||
|
|
@ -280,6 +301,7 @@ export const salaryFileSearchConditions = [
|
|||
label: getLabel(382300, "人员状态"),
|
||||
labelcol: 8,
|
||||
options: [],
|
||||
multiple: true,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,42 +5,239 @@
|
|||
* Date: 2024/1/8
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaReqTop, WeaTab } from "ecCom";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaTab } from "ecCom";
|
||||
import { message, Modal } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { renderDropMenuDatas, renderReqBtns, tabList } from "./config";
|
||||
import SalaryFileAdvanceSearchPannel from "./components/salaryFileAdvanceSearchPannel";
|
||||
import SalaryFileImportDialog from "./components/salaryFileImportDialog";
|
||||
import SalaryFileList from "./components/salaryFileList";
|
||||
import * as API from "../../apis/payrollFiles";
|
||||
import { sysinfo } from "../../apis/ruleconfig";
|
||||
import { convertToUrlString } from "../../util/url";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("salaryFileStore", "taxAgentStore")
|
||||
@inject("payrollFilesStore", "taxAgentStore")
|
||||
@observer
|
||||
class SalaryFiles extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "pending", showSearchAd: false, isQuery: false, logDialogVisible: false,
|
||||
topTabCount: { stayAdd: 0, paying: 0, stayDel: 0, stopPay: 0, ext: 0 },
|
||||
welfareImpDialog: { visible: false, title: getLabel(24023, "数据导入"), runStatuses: "" }
|
||||
selectedKey: "pending", showSearchAd: false, isQuery: false, showDelSalaryFileBtn: false,
|
||||
topTabCount: { PENDING: 0, FIXED: 0, SUSPEND: 0, STOP: 0, EXT: 0 }, showExtEmpsWitch: false,
|
||||
salaryFileImpDialog: { visible: false, title: getLabel(24023, "数据导入"), importType: "", isExtEmp: false },
|
||||
salaryImportTypes: []
|
||||
};
|
||||
this.salaryFileListRef = null;
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
// salaryArchiveDelete, //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是,
|
||||
// extEmpsWitch //非系统人员开关, 1: 开启, 0:关闭
|
||||
const [{ data: salaryFileDelFlag }, { data: { extEmpsWitch } }, { data: salaryImportTypes }] =
|
||||
await Promise.all([API.salaryArchiveDelete(), sysinfo(), API.getImportTypes()]);
|
||||
this.setState({
|
||||
showDelSalaryFileBtn: salaryFileDelFlag === "1", showExtEmpsWitch: extEmpsWitch === "1",
|
||||
salaryImportTypes: _.filter(salaryImportTypes, it => it.id !== "taxAgentAdjust")
|
||||
});
|
||||
}
|
||||
|
||||
handleOpenAdvanceSearch = () => this.setState({ showSearchAd: true });
|
||||
handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });
|
||||
onAdSearch = () => this.setState({ showSearchAd: false, isQuery: !this.state.isQuery });
|
||||
onDropMenuClick = (key) => {
|
||||
const { state, handleSalaryOpts } = this.salaryFileListRef.wrappedInstance || {};
|
||||
switch (key) {
|
||||
case "custom_cols":
|
||||
const { payrollFilesStore: { tableStore } } = this.props;
|
||||
tableStore.setColSetVisible(true);
|
||||
tableStore.tableColSet(true);
|
||||
break;
|
||||
case "FULL-SALARY-SUSPENSION":
|
||||
this.allGotoStop();
|
||||
break;
|
||||
case "ADD-TO-SALARYPAYMENT":
|
||||
case "DEL-PENDITNG-TO-DO":
|
||||
case "SALARY-SUSPENSION":
|
||||
case "DEL-SUSPEND-TO-DO":
|
||||
const { selectedRowKeys = [] } = state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(543303, "请选择表格数据!"));
|
||||
return;
|
||||
}
|
||||
handleSalaryOpts && handleSalaryOpts(_.camelCase(key), selectedRowKeys);
|
||||
break;
|
||||
case "exportAll":
|
||||
case "exportSelected":
|
||||
this.handleExport(key);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
queryInsuranceTabTotal = (active, total) => {
|
||||
API.queryTabTotal().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const key = _.find(tabList, o => o.viewcondition === active).groupid;
|
||||
this.setState({
|
||||
topTabCount: { ...this.state.topTabCount, ...data, [key]: total }
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleReqBtnsCLick = (type, importType) => {
|
||||
const { state, handleSalaryOpts } = this.salaryFileListRef.wrappedInstance || {};
|
||||
switch (type) {
|
||||
case "OPEN":
|
||||
this.handleOpenAdvanceSearch();
|
||||
break;
|
||||
case "SEARCH":
|
||||
this.handleAdvanceSearch();
|
||||
break;
|
||||
case "IMPORT":
|
||||
this.setState({
|
||||
salaryFileImpDialog: {
|
||||
...this.state.salaryFileImpDialog, visible: true,
|
||||
importType: importType || _.upperCase(this.state.selectedKey),
|
||||
isExtEmp: this.state.selectedKey === "ext"
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "ALL-GO-TO-FIXED":
|
||||
this.allGotoFixed();
|
||||
break;
|
||||
case "CANCEL-SALARY-SUSPENSION":
|
||||
const { selectedRowKeys = [] } = state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(543303, "请选择表格数据!"));
|
||||
return;
|
||||
}
|
||||
handleSalaryOpts && handleSalaryOpts(_.camelCase(type), selectedRowKeys);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 全部设为发薪员工
|
||||
* Params:
|
||||
* Date: 2024/1/9
|
||||
*/
|
||||
allGotoFixed = () => {
|
||||
const { state } = this.salaryFileListRef.wrappedInstance || {};
|
||||
const { pageInfo } = state;
|
||||
if (pageInfo && pageInfo.total === 0) {
|
||||
message.warning(getLabel(543300, "您没有需要处理的待定薪人员!"));
|
||||
return;
|
||||
}
|
||||
Modal.warning({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: `${getLabel(543301, "确定要将所有待定薪人员")}(${getLabel(18609, "共")}${pageInfo.total}${getLabel(30690, "条数据")})${getLabel(543302, "设为发薪人员吗")}?`,
|
||||
onOk: () => {
|
||||
WeaLoadingGlobal.start();
|
||||
API.allGotoFixed({}).then(({ status, data, errormsg }) => {
|
||||
WeaLoadingGlobal.destroy();
|
||||
if (status) {
|
||||
const { msg } = data;
|
||||
message.info(msg || getLabel(30700, "操作成功!"));
|
||||
this.handleAdvanceSearch();
|
||||
} else {
|
||||
message.error(errormsg || getLabel(30651, "操作失败!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 全部停薪
|
||||
* Params:
|
||||
* Date: 2024/1/9
|
||||
*/
|
||||
allGotoStop = () => {
|
||||
const { state } = this.salaryFileListRef.wrappedInstance || {};
|
||||
const { pageInfo } = state;
|
||||
if (pageInfo && pageInfo.total === 0) {
|
||||
message.warning(getLabel(543325, "您没有需要处理的待停薪人员!"));
|
||||
return;
|
||||
}
|
||||
Modal.warning({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: `${getLabel(543723, "确定要将所有待停薪人员")}(${getLabel(18609, "共")}${pageInfo.total}${getLabel(30690, "条数据")})${getLabel(543327, "设为停薪人员吗")}?`,
|
||||
onOk: () => {
|
||||
WeaLoadingGlobal.start();
|
||||
API.allGotoStop({}).then(({ status, data, errormsg }) => {
|
||||
WeaLoadingGlobal.destroy();
|
||||
if (status) {
|
||||
const { msg } = data;
|
||||
message.info(msg || getLabel(30700, "操作成功!"));
|
||||
this.handleAdvanceSearch();
|
||||
} else {
|
||||
message.error(errormsg || getLabel(30651, "操作失败!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 导出薪资档案文件
|
||||
* Params:
|
||||
* Date: 2024/1/9
|
||||
*/
|
||||
handleExport = (type) => {
|
||||
const { payrollFilesStore: { salaryFileQueryForm } } = this.props;
|
||||
const { selectedKey } = this.state;
|
||||
let url = `${window.location.origin}/api/bs/hrmsalary/salaryArchive/exportList`;
|
||||
let payload = {}, runStatusList = _.upperCase(selectedKey);
|
||||
const { state } = this.salaryFileListRef.wrappedInstance || {};
|
||||
const { selectedRowKeys = [] } = state;
|
||||
switch (selectedKey) {
|
||||
case "pending":
|
||||
case "suspend":
|
||||
runStatusList = _.upperCase(selectedKey);
|
||||
break;
|
||||
case "fixed":
|
||||
runStatusList = "FIXED,SUSPEND";
|
||||
break;
|
||||
case "stop":
|
||||
runStatusList = "STOP_FROM_PENDING,STOP_FROM_SUSPEND";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (type === "exportAll") {
|
||||
payload = { ids: "", runStatusList, ...salaryFileQueryForm.getFormParams() };
|
||||
} else {
|
||||
if (selectedRowKeys.length === 0) {
|
||||
message.warning(getLabel(543345, "请选择需要导出的数据!"));
|
||||
return;
|
||||
}
|
||||
payload = { ids: selectedRowKeys.join(",") };
|
||||
}
|
||||
window.open(`${url}?${convertToUrlString(payload)}`, "_blank");
|
||||
};
|
||||
|
||||
render() {
|
||||
const { selectedKey, topTabCount, showSearchAd, isQuery, logDialogVisible, welfareImpDialog } = this.state;
|
||||
const {
|
||||
selectedKey, topTabCount, showSearchAd, isQuery, showDelSalaryFileBtn, showExtEmpsWitch,
|
||||
salaryFileImpDialog, salaryImportTypes
|
||||
} = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
return (
|
||||
<div className="salary-files-wrapper">
|
||||
<WeaReqTop
|
||||
title={getLabel(538004, "薪资档案")} buttonSpace={10} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" showDropIcon dropMenuDatas={renderDropMenuDatas(selectedKey)}
|
||||
buttons={renderReqBtns(selectedKey, this.handleOpenAdvanceSearch, this.handleAdvanceSearch)}
|
||||
iconBgcolor="#F14A2D" showDropIcon dropMenuDatas={renderDropMenuDatas(selectedKey, showOperateBtn)}
|
||||
onDropMenuClick={this.onDropMenuClick}
|
||||
buttons={renderReqBtns(selectedKey, salaryImportTypes, this.handleReqBtnsCLick, showOperateBtn)}
|
||||
replaceTab={
|
||||
<WeaTab
|
||||
datas={_.map(tabList, o => ({ ...o, title: getLabel(o.lanId, o.title) }))} autoCalculateWidth
|
||||
datas={!showExtEmpsWitch ? _.dropRight(tabList) : tabList} autoCalculateWidth
|
||||
keyParam="viewcondition" selectedKey={selectedKey} counts={topTabCount} countParam="groupid"
|
||||
onChange={key => this.setState({ selectedKey: key })}
|
||||
/>
|
||||
|
|
@ -51,8 +248,26 @@ class SalaryFiles extends Component {
|
|||
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<SalaryFileAdvanceSearchPannel
|
||||
onCancel={() => this.setState({ showSearchAd: false })}
|
||||
onAdSearch={this.onAdSearch}
|
||||
/>
|
||||
</div>
|
||||
{/*列表*/}
|
||||
<SalaryFileList isQuery={isQuery} ref={dom => this.salaryFileListRef = dom}
|
||||
selectedKey={selectedKey} showOperateBtn={showOperateBtn}
|
||||
showDelSalaryFileBtn={showDelSalaryFileBtn}
|
||||
onChangeTopTabCount={this.queryInsuranceTabTotal}
|
||||
/>
|
||||
{/* 导入*/}
|
||||
<SalaryFileImportDialog {...salaryFileImpDialog}
|
||||
onCancel={(isFresh) => {
|
||||
this.setState({
|
||||
isQuery: isFresh ? !isQuery : isQuery,
|
||||
salaryFileImpDialog: {
|
||||
...salaryFileImpDialog, visible: false,
|
||||
importType: "", isExtEmp: false
|
||||
}
|
||||
});
|
||||
}}/>
|
||||
</div>
|
||||
</WeaReqTop>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -54,11 +54,11 @@ export const optTypeEnum = [
|
|||
}
|
||||
];
|
||||
export const tabList = [
|
||||
{ viewcondition: "1", lanId: 542711, title: "待增员", showcount: true, groupid: "stayAdd" },
|
||||
{ viewcondition: "2,3", lanId: 542504, title: "在缴员工", showcount: true, groupid: "paying" },
|
||||
{ viewcondition: "3", lanId: 542713, title: "待减员", showcount: true, groupid: "stayDel" },
|
||||
{ viewcondition: "4,5", lanId: 542505, title: "停缴员工", showcount: true, groupid: "stopPay" },
|
||||
{ viewcondition: "ext", lanId: 542679, title: "非系统人员", showcount: true, groupid: "ext" }
|
||||
{ viewcondition: "1", title: getLabel(542711, "待增员"), showcount: true, groupid: "stayAdd" },
|
||||
{ viewcondition: "2,3", title: getLabel(542504, "在缴员工"), showcount: true, groupid: "paying" },
|
||||
{ viewcondition: "3", title: getLabel(542713, "待减员"), showcount: true, groupid: "stayDel" },
|
||||
{ viewcondition: "4,5", title: getLabel(542505, "停缴员工"), showcount: true, groupid: "stopPay" },
|
||||
{ viewcondition: "ext", title: getLabel(542679, "非系统人员"), showcount: true, groupid: "ext" }
|
||||
];
|
||||
export const welfareTipList = [
|
||||
{
|
||||
|
|
@ -138,145 +138,149 @@ export const welfareTipList = [
|
|||
list: []
|
||||
}
|
||||
];
|
||||
export const renderDropMenuDatas = (selectedKey, getLabel) => {
|
||||
export const renderDropMenuDatas = (selectedKey, getLabel, showOperateBtn) => {
|
||||
let menus = [{
|
||||
key: "log",
|
||||
icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(111, "操作日志")
|
||||
}];
|
||||
switch (selectedKey) {
|
||||
case "1":
|
||||
menus = [
|
||||
{
|
||||
key: "fullStaffIncrease",
|
||||
icon: <i className="iconfont icon-quanbu"/>,
|
||||
content: getLabel(543185, "全量增员")
|
||||
},
|
||||
{
|
||||
key: "batchStaffIncrease",
|
||||
icon: <i className="iconfont icon-piliangcaozuo"/>,
|
||||
content: getLabel(543187, "批量增员")
|
||||
},
|
||||
{
|
||||
key: "batchDeleteTodolist",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "2,3":
|
||||
menus = [
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "3":
|
||||
menus = [
|
||||
{
|
||||
key: "fullReduction",
|
||||
icon: <i className="iconfont icon-quanbu"/>,
|
||||
content: getLabel(543189, "全量减员")
|
||||
},
|
||||
{
|
||||
key: "batchReduction",
|
||||
icon: <i className="iconfont icon-piliangcaozuo"/>,
|
||||
content: getLabel(543188, "批量减员")
|
||||
},
|
||||
{
|
||||
key: "batchDeleteTodolistStayDel",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "4,5":
|
||||
menus = [
|
||||
{
|
||||
key: "batchCancellationOfSuspended",
|
||||
icon: <i className="iconfont icon-piliangcaozuo"/>,
|
||||
content: getLabel(543190, "批量取消停缴")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
if (showOperateBtn) {
|
||||
switch (selectedKey) {
|
||||
case "1":
|
||||
menus = [
|
||||
{
|
||||
key: "fullStaffIncrease",
|
||||
icon: <i className="iconfont icon-quanbu"/>,
|
||||
content: getLabel(543185, "全量增员")
|
||||
},
|
||||
{
|
||||
key: "batchStaffIncrease",
|
||||
icon: <i className="iconfont icon-piliangcaozuo"/>,
|
||||
content: getLabel(543187, "批量增员")
|
||||
},
|
||||
{
|
||||
key: "batchDeleteTodolist",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "2,3":
|
||||
menus = [
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "3":
|
||||
menus = [
|
||||
{
|
||||
key: "fullReduction",
|
||||
icon: <i className="iconfont icon-quanbu"/>,
|
||||
content: getLabel(543189, "全量减员")
|
||||
},
|
||||
{
|
||||
key: "batchReduction",
|
||||
icon: <i className="iconfont icon-piliangcaozuo"/>,
|
||||
content: getLabel(543188, "批量减员")
|
||||
},
|
||||
{
|
||||
key: "batchDeleteTodolistStayDel",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "4,5":
|
||||
menus = [
|
||||
{
|
||||
key: "batchCancellationOfSuspended",
|
||||
icon: <i className="iconfont icon-piliangcaozuo"/>,
|
||||
content: getLabel(543190, "批量取消停缴")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return menus;
|
||||
};
|
||||
export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdvanceSearch, onImport) => {
|
||||
let reqBtns = [
|
||||
export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdvanceSearch, onImport, showOperateBtn) => {
|
||||
let reqBtns = showOperateBtn ? [
|
||||
<Button type="primary" onClick={onImport}>{getLabel(32935, "导入")}</Button>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={onOpenAdvanceSearch} onAdvanceSearch={onAdvanceSearch}/>
|
||||
];
|
||||
switch (selectedKey) {
|
||||
case "1":
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={
|
||||
<span>
|
||||
{getLabel(544348, "提示:缴纳月份区间包含起始缴纳月,不包含最后缴纳月; 若员工离职时还未增员进入在缴员工,则数据会自动清除,因此若确认缴纳,请及时维护档案数据并增员操作。若清除后还需缴纳,需先在个税扣缴义务人菜单将员工按离职状态添加回来,会重新出现在待增员。")}
|
||||
</span>
|
||||
}
|
||||
/>);
|
||||
break;
|
||||
case "3":
|
||||
reqBtns.shift();
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={HelpfulDiv}
|
||||
/>);
|
||||
break;
|
||||
case "4,5":
|
||||
reqBtns.shift();
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={CancelHelpfulDiv}
|
||||
/>);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
] : [<AdvanceInputBtn onOpenAdvanceSearch={onOpenAdvanceSearch} onAdvanceSearch={onAdvanceSearch}/>];
|
||||
if (showOperateBtn) {
|
||||
switch (selectedKey) {
|
||||
case "1":
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={
|
||||
<span>
|
||||
{getLabel(544348, "提示:缴纳月份区间包含起始缴纳月,不包含最后缴纳月; 若员工离职时还未增员进入在缴员工,则数据会自动清除,因此若确认缴纳,请及时维护档案数据并增员操作。若清除后还需缴纳,需先在个税扣缴义务人菜单将员工按离职状态添加回来,会重新出现在待增员。")}
|
||||
</span>
|
||||
}
|
||||
/>);
|
||||
break;
|
||||
case "3":
|
||||
reqBtns.shift();
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={HelpfulDiv}
|
||||
/>);
|
||||
break;
|
||||
case "4,5":
|
||||
reqBtns.shift();
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={CancelHelpfulDiv}
|
||||
/>);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return reqBtns;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import WelfareArchivesImportDialog from "./components/welfareArchivesImportDialo
|
|||
import WelfareTip from "./components/welfareTip";
|
||||
import LogDialog from "./components/logDialog";
|
||||
import * as API from "../../../apis/welfareArchive";
|
||||
import { sysinfo } from "../../../apis/ruleconfig";
|
||||
import { optTypeEnum, renderDropMenuDatas, renderReqBtns, tabList, welfareTipList } from "./config";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import cs from "classnames";
|
||||
|
|
@ -33,10 +34,17 @@ class Index extends Component {
|
|||
this.state = {
|
||||
selectedKey: "1", showSearchAd: false, isQuery: false, logDialogVisible: false,
|
||||
topTabCount: { stayAdd: 0, paying: 0, stayDel: 0, stopPay: 0, ext: 0 },
|
||||
welfareImpDialog: { visible: false, title: getLabel(24023, "数据导入"), runStatuses: "" }
|
||||
welfareImpDialog: { visible: false, title: getLabel(24023, "数据导入"), runStatuses: "" },
|
||||
showExtEmpsWitch: false
|
||||
};
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
// extEmpsWitch //非系统人员开关, 1: 开启, 0:关闭
|
||||
const [{ data: { extEmpsWitch } }] = await Promise.all([sysinfo()]);
|
||||
this.setState({ showExtEmpsWitch: extEmpsWitch === "1" });
|
||||
}
|
||||
|
||||
queryInsuranceTabTotal = (active, total) => {
|
||||
API.queryInsuranceTabTotal().then(({ status, data }) => {
|
||||
if (status) {
|
||||
|
|
@ -118,7 +126,10 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { selectedKey, topTabCount, showSearchAd, isQuery, logDialogVisible, welfareImpDialog } = this.state;
|
||||
const {
|
||||
selectedKey, topTabCount, showSearchAd, isQuery,
|
||||
logDialogVisible, welfareImpDialog, showExtEmpsWitch
|
||||
} = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const tipList = _.find(welfareTipList, o => o.viewcondition === selectedKey).list;
|
||||
return (
|
||||
|
|
@ -126,11 +137,11 @@ class Index extends Component {
|
|||
<WeaReqTop
|
||||
title={getLabel(538001, "社保福利档案")} buttonSpace={10} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={renderDropMenuDatas(selectedKey, getLabel)}
|
||||
buttons={renderReqBtns(selectedKey, getLabel, this.handleOpenAdvanceSearch, this.handleAdvanceSearch, this.handleImport)}
|
||||
dropMenuDatas={renderDropMenuDatas(selectedKey, getLabel, showOperateBtn)}
|
||||
buttons={renderReqBtns(selectedKey, getLabel, this.handleOpenAdvanceSearch, this.handleAdvanceSearch, this.handleImport, showOperateBtn)}
|
||||
replaceTab={
|
||||
<WeaTab
|
||||
datas={_.map(tabList, o => ({ ...o, title: getLabel(o.lanId, o.title) }))} autoCalculateWidth
|
||||
datas={!showExtEmpsWitch ? _.dropRight(tabList) : tabList} autoCalculateWidth
|
||||
keyParam="viewcondition" selectedKey={selectedKey} counts={topTabCount} countParam="groupid"
|
||||
onChange={key => this.setState({ selectedKey: key })}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ export class PayrollFilesStore {
|
|||
@observable pivotTableStore = new TableStore();
|
||||
@observable adjustForm = new WeaForm(); //调薪记录-核算form
|
||||
@action initAdjustForm = () => this.adjustForm = new WeaForm();//调薪记录-初始化核算form
|
||||
/*薪资档案页面重构*/
|
||||
@observable salaryFileQueryForm = new WeaForm(); // 薪资档案查询form
|
||||
/*薪资档案页面重构*/
|
||||
|
||||
@action("薪资档案-列表查询")
|
||||
queryList = (payload = {}, searchItemsValue = {}, url = "") => {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@ const { TableStore } = WeaTableNew;
|
|||
|
||||
export class salaryFileStore {
|
||||
@observable adjForm = new WeaForm(); // 调薪form
|
||||
/*薪资档案页面重构*/
|
||||
@observable salaryFileQueryForm = new WeaForm(); // 薪资档案查询form
|
||||
/*薪资档案页面重构*/
|
||||
|
||||
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
|
|
|
|||
Loading…
Reference in New Issue