diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileImportDialog/index.js
new file mode 100644
index 00000000..c9a7d295
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileImportDialog/index.js
@@ -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 (
+
this.setState({
+ importDialog: {
+ ...importDialog, importResult: {}, imageId: "", link: ""
+ }
+ })}
+ exportDataDom={
+ {
+ 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;
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js
new file mode 100644
index 00000000..1c3f7c89
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js
@@ -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 (
+
+
+
+
+
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js
index 8695409f..cd19b405 100644
--- a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js
@@ -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 = [
- ,
-
+ ,
+ onSalaryOpts("OPEN")} onAdvanceSearch={() => onSalaryOpts("SEARCH")}
+ />
];
switch (selectedKey) {
case "pending":
- reqBtns.splice(1, 0, );
+ !showOperateBtn && reqBtns.shift();
+ showOperateBtn && reqBtns.splice(1, 0, );
+ break;
+ case "suspend":
+ !showOperateBtn && reqBtns.shift();
break;
case "fixed":
case "ext":
- reqBtns.unshift( onSalaryOpts("IMPORT", key)}>
+ {salaryImportTypes.map((item) => (
+ {item.content}
+ ))}
+
+ }>
+
+
+ );
+ showOperateBtn && reqBtns.unshift(}
/>);
break;
case "stop":
reqBtns.shift();
- reqBtns.unshift();
+ showOperateBtn && reqBtns.unshift();
break;
default:
break;
}
return reqBtns;
};
-export const renderDropMenuDatas = (selectedKey) => {
+export const renderDropMenuDatas = (selectedKey, showOperateBtn) => {
let menus = [{
key: "custom_cols",
icon: ,
@@ -85,12 +106,12 @@ export const renderDropMenuDatas = (selectedKey) => {
case "pending":
menus = [
{
- key: "batchSet",
+ key: "ADD-TO-SALARYPAYMENT",
icon: ,
content: getLabel(543305, "批量设为发薪员工")
},
{
- key: "batchDelete",
+ key: "DEL-PENDITNG-TO-DO",
icon: ,
content: getLabel(543186, "批量删除待办")
},
@@ -125,17 +146,17 @@ export const renderDropMenuDatas = (selectedKey) => {
case "suspend":
menus = [
{
- key: "allWithoutpay",
+ key: "FULL-SALARY-SUSPENSION",
icon: ,
content: getLabel(543326, "全部停薪")
},
{
- key: "batchWithoutpay",
+ key: "SALARY-SUSPENSION",
icon: ,
content: getLabel(543724, "批量停薪")
},
{
- key: "batchDelete",
+ key: "DEL-SUSPEND-TO-DO",
icon: ,
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
},
{
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js b/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js
index e1c5f76d..fdea15e6 100644
--- a/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js
@@ -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 (
}
- 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={
({ ...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 })}>
this.setState({ showSearchAd: false })}
+ onAdSearch={this.onAdSearch}
/>
+ {/*列表*/}
+ this.salaryFileListRef = dom}
+ selectedKey={selectedKey} showOperateBtn={showOperateBtn}
+ showDelSalaryFileBtn={showDelSalaryFileBtn}
+ onChangeTopTabCount={this.queryInsuranceTabTotal}
+ />
+ {/* 导入*/}
+ {
+ this.setState({
+ isQuery: isFresh ? !isQuery : isQuery,
+ salaryFileImpDialog: {
+ ...salaryFileImpDialog, visible: false,
+ importType: "", isExtEmp: false
+ }
+ });
+ }}/>