From fe0cd8e5410b6aae0469bd3a50f901bfa34708c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Wed, 28 Aug 2024 14:46:00 +0800
Subject: [PATCH] =?UTF-8?q?custom/=E9=A2=86=E6=82=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../custom-pages/lingyue/components/list.js | 32 ++++++++++++++++---
.../pages/custom-pages/lingyue/layout.js | 4 +--
.../lingyue/salarySummary/index.js | 3 +-
.../lingyue/socialFundSummary/index.js | 3 +-
4 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js
index ddc2208c..4515b509 100644
--- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js
@@ -8,8 +8,8 @@
* @description:
*/
import React, { Component } from "react";
-import { WeaLocaleProvider } from "ecCom";
-import { Spin } from "antd";
+import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
+import { message, Modal, Spin } from "antd";
import { getIframeParentHeight } from "../../../../util";
import * as API from "../../../../apis/custom-apis/lingyue";
@@ -80,7 +80,7 @@ class List extends Component {
};
getLYList = (isSum = true) => {
- const { query, type } = this.props, { pageInfo, selectedRowKeys } = this.state;
+ const { query, type, onInit } = this.props, { pageInfo, selectedRowKeys } = this.state;
const payload = { ...pageInfo, ...query };
this.setState({ loading: true });
interfaceType[type]["list"](payload).then(async ({ status, data }) => {
@@ -94,6 +94,7 @@ class List extends Component {
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource, columns, sumDataSource, payload
}, () => {
+ onInit();
this.postMessageToChild({
scrollHeight: 108, dataSource, pageInfo: this.state.pageInfo, selectedRowKeys,
unitTableType: "custom_lingyue", columns: traverseCols(columns), showTotalCell: true,
@@ -104,10 +105,31 @@ class List extends Component {
});
};
handleOperate = (key) => {
- const { payload } = this.state;
+ const { payload, selectedRowKeys } = this.state;
+ const { type } = this.props;
switch (key) {
case "EXPORTALL":
- console.log(payload);
+ WeaLoadingGlobal.start();
+ const promise = interfaceType[type]["export"](payload);
+ break;
+ case "BATCHDEL":
+ if (_.isEmpty(selectedRowKeys)) {
+ message.warning("未勾选数据!");
+ return;
+ }
+ Modal.confirm({
+ title: getLabel(111, "确认信息"), content: getLabel(388758, "确认要删除吗?"),
+ onOk: () => {
+ interfaceType[type]["batchDel"]({ ids: selectedRowKeys }).then(({ status, errormsg }) => {
+ if (status) {
+ message.success(getLabel(111, "操作成功!"));
+ this.setState({ selectedRowKeys: [] }, () => this.getLYList());
+ } else {
+ message.error(errormsg);
+ }
+ });
+ }
+ });
break;
default:
break;
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js
index 6fb96943..d02a3caa 100644
--- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js
@@ -19,7 +19,7 @@ class Layout extends Component {
const { title, query, onChange, listRef } = this.props;
const { salaryMonth, ffgsqc, isQuery } = query;
const buttons = [
- ,
+ ,
onChange({ ...query, salaryMonth: value, isQuery: !isQuery })}/>,
onChange({ ...query, ffgsqc: value })}
@@ -32,7 +32,7 @@ class Layout extends Component {
} buttons={buttons} showDropIcon={true}
iconBgcolor="#F14A2D" className="custom_salary_lingyue" dropMenuDatas={dropMenuDatas}
- onDropMenuClick={key => this.listRef.handleOperate(key)}>
+ onDropMenuClick={key => listRef.handleOperate(key)}>
{this.props.children}
);
}
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js
index df5f95bf..e9033936 100644
--- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js
@@ -32,7 +32,8 @@ class Index extends Component {
return (
- this.listRef = dom}/>
+ this.listRef = dom}
+ onInit={() => this.forceUpdate()}/>
);
}
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js
index ab14a7f1..74810651 100644
--- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js
@@ -31,7 +31,8 @@ class Index extends Component {
return (
-
+ this.listRef = dom}
+ onInit={() => this.forceUpdate()}/>
);
}