diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantDetail.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantDetail.js
deleted file mode 100644
index abe3003f..00000000
--- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantDetail.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import React from 'react'
-import { payrollGrantDetailColumns, dataSource} from '../columns'
-
-export default class PayrollGrantDeatail extends React.Component {
-
-
- render() {
- const handleMenuClick = () => {
-
- }
- const menu = (
-
- );
- const renderRightOperation = () => {
- return (
-
- 导出全部
-
-
- )
- }
- return (
-
-
-
-
- 薪资所属月:2021-11
-
- 工资单模板:上海泛微工资单1
-
-
-
- 已发放:111/1111
- 未确认:111
-
-
-
-
-
- )
- }
-}
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantModal.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantModal.js
deleted file mode 100644
index afb49d94..00000000
--- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantModal.js
+++ /dev/null
@@ -1,248 +0,0 @@
-import React from "react";
-import { WeaDialog, WeaHelpfulTip, WeaInputSearch, WeaTable } from "ecCom";
-import { Dropdown, Menu, message } from "antd";
-import { inject, observer } from "mobx-react";
-import "./index.less";
-
-@inject("payrollStore")
-@observer
-export default class payrollGrantModal extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- selectedRowKeys: [],
- current: 1,
- searchValue: ""
- };
- }
-
- // 撤回
- handleWithdraw(record) {
- const { payrollStore } = this.props;
- const { withdrawPayroll, batchSendInfoList } = payrollStore;
- withdrawPayroll({
- ids: [record.id],
- salarySendId: this.props.sendId
- }).then(() => {
- batchSendInfoList({ salarySendId: this.props.sendId });
- });
- }
-
- // 发送
- handleGrant(record) {
- const { payrollStore } = this.props;
- const { grantPayroll, batchSendInfoList } = payrollStore;
- grantPayroll({
- ids: [record.id],
- salarySendId: this.props.sendId
- }).then(() => {
- batchSendInfoList({ salarySendId: this.props.sendId });
- });
- }
-
- componentWillMount() {
- const { payrollStore: { batchSendInfoList } } = this.props;
- batchSendInfoList({ salarySendId: this.props.sendId });
- }
-
- getColumns() {
- const { payrollStore } = this.props;
- const { canGrantColumns } = payrollStore;
- return [
- ...canGrantColumns,
- { title: "操作", key: "operation", dataIndex: "operation" }
- ].map(item => {
- if (item.key == "operation") {
- item.render = (text, record) => {
- if (record.sendStatus == "已发放") {
- return (
-
{
- this.handleWithdraw(record);
- }}>
- 撤回
-
- );
- } else {
- return (
-
{
- this.handleGrant(record);
- }}>
- 发送
-
- );
- }
- };
- }
- return item;
- });
- }
-
- onSelectChange = value => {
- this.setState({
- selectedRowKeys: value
- });
- };
-
- // 发放
- fetchGrantPayRoll(payload) {
- const { payrollStore: { grantPayroll } } = this.props;
- grantPayroll(payload).then(() => {
- const { payrollStore: { getInfoList } } = this.props;
- getInfoList({
- salarySendId: this.props.sendId
- });
- this.props.onCancel && this.props.onCancel();
- });
- }
-
- handleMenuClick(e) {
- const { selectedRowKeys } = this.state;
- const { payrollStore: { grantPayroll } } = this.props;
- if (selectedRowKeys.length == 0) {
- message.warning("未选择条目");
- return;
- }
- this.fetchGrantPayRoll({
- ids: selectedRowKeys,
- salarySendId: this.props.sendId
- });
- }
-
- handleGrantAll() {
- this.fetchGrantPayRoll({ salarySendId: this.props.sendId });
- }
-
- handleSearch(value) {
- const { payrollStore: { batchSendInfoList } } = this.props;
- batchSendInfoList({
- salarySendId: this.props.sendId,
- keyword: value,
- current: this.state.current
- });
- }
-
- // 分页
- handleDataPageChange(value) {
- this.setState({ current: value });
- const { payrollStore: { batchSendInfoList } } = this.props;
- batchSendInfoList({ salarySendId: this.props.sendId, current: value });
- }
-
- render() {
- const menu = (
-
- );
-
- const { payrollStore } = this.props;
- const {
- salarySendDetailBaseInfo,
- canGrantDataSource,
- canGrantPageInfo
- } = payrollStore;
- const { selectedRowKeys } = this.state;
-
- const rowSelection = {
- selectedRowKeys,
- onChange: this.onSelectChange.bind(this)
- };
-
- return (
-
{
- this.handleGrantAll();
- }}>
- 全部发放
-
- ]}
- onCancel={() => {
- this.props.onCancel();
- }}>
-
-
-
-
- 薪资所属月:{salarySendDetailBaseInfo.salaryMonth &&
- salarySendDetailBaseInfo.salaryMonth
- .year}-{salarySendDetailBaseInfo.salaryMonth &&
- salarySendDetailBaseInfo.salaryMonth.monthValue}
-
-
-
- 工资单模板:{salarySendDetailBaseInfo.template}
-
-
-
{
- this.setState({ searchValue: value });
- }}
- placeholder="请输入姓名"
- onSearch={value => {
- this.handleSearch(value);
- }}
- />
-
-
- {
- this.handleDataPageChange(value);
- },
- total: canGrantPageInfo.total,
- current: canGrantPageInfo.pageNum,
- showTotal: total => `共 ${total} 条`
- }}
- />
-
-
-
- );
- }
-}
diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollWithdrawModal.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollWithdrawModal.js
deleted file mode 100644
index 5553b78a..00000000
--- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollWithdrawModal.js
+++ /dev/null
@@ -1,247 +0,0 @@
-import React from "react";
-import { WeaDialog, WeaHelpfulTip, WeaInputSearch, WeaTable } from "ecCom";
-import { Dropdown, Menu } from "antd";
-import { inject, observer } from "mobx-react";
-
-@inject("payrollStore")
-@observer
-export default class PayrollWithdrawModal extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- selectedRowKeys: [],
- current: 1
- };
- }
-
- componentWillMount() {
- const { payrollStore } = this.props;
- const { batchWithdrawInfoList } = payrollStore;
- batchWithdrawInfoList({ salarySendId: this.props.sendId });
- }
-
- // 撤回
- handleWithdraw(record) {
- const { payrollStore } = this.props;
- const { withdrawPayroll, batchWithdrawInfoList } = payrollStore;
- withdrawPayroll({
- ids: [record.id],
- salarySendId: this.props.sendId
- }).then(() => {
- batchWithdrawInfoList({ salarySendId: this.props.sendId });
- });
- }
-
- // 发送
- handleGrant(record) {
- const { payrollStore } = this.props;
- const { grantPayroll, batchWithdrawInfoList } = payrollStore;
- grantPayroll({
- ids: [record.id],
- salarySendId: this.props.sendId
- }).then(() => {
- batchWithdrawInfoList({ salarySendId: this.props.sendId });
- });
- }
-
- getColumns() {
- const { payrollStore } = this.props;
- const { canWidthdrawColumns } = payrollStore;
- return [
- ...canWidthdrawColumns,
- { title: "操作", key: "operation", dataIndex: "operation" }
- ].map(item => {
- if (item.key == "operation") {
- item.render = (text, record) => {
- if (record.sendStatus == "已发放") {
- return (
-
{
- this.handleWithdraw(record);
- }}>
- 撤回
-
- );
- } else {
- return (
-
{
- this.handleGrant(record);
- }}>
- 发送
-
- );
- }
- };
- }
- return item;
- });
- }
-
- onSelectChange = value => {
- this.setState({
- selectedRowKeys: value
- });
- };
-
- // 撤回
- fetchWithdrawPayroll(payload) {
- const { payrollStore: { grantPayroll, withdrawPayroll } } = this.props;
- withdrawPayroll(payload).then(() => {
- const { payrollStore: { getInfoList } } = this.props;
- getInfoList({
- salarySendId: this.props.sendId
- });
- this.props.onCancel && this.props.onCancel();
- });
- }
-
- handleMenuClick(e) {
- const { selectedRowKeys } = this.state;
- const { payrollStore: { grantPayroll } } = this.props;
- if (selectedRowKeys.length == 0) {
- message.warning("未选择条目");
- return;
- }
- this.fetchWithdrawPayroll({
- ids: selectedRowKeys,
- salarySendId: this.props.sendId
- });
- }
-
- handleWithdrawAll() {
- this.fetchWithdrawPayroll({ salarySendId: this.props.sendId });
- }
-
- // 分页
- handleDataPageChange(value) {
- this.setState({ current: value });
- const { payrollStore } = this.props;
- const { batchWithdrawInfoList } = payrollStore;
- batchWithdrawInfoList({ salarySendId: this.props.sendId, current: value });
- }
-
- handleSearch(value) {
- const { payrollStore: { batchWithdrawInfoList } } = this.props;
- batchWithdrawInfoList({
- salarySendId: this.props.sendId,
- keyword: value,
- current: this.state.current
- });
- }
-
- render() {
- const menu = (
-
- );
- const { payrollStore } = this.props;
- const {
- salarySendDetailBaseInfo,
- canWidthdrawColumns,
- canWithdrawDataSource,
- canWithdrawPageInfo
- } = payrollStore;
- const { selectedRowKeys } = this.state;
- const rowSelection = {
- selectedRowKeys,
- onChange: this.onSelectChange.bind(this)
- };
-
- return (
-
{
- this.handleWithdrawAll();
- }}>
- 全部撤回
-
- ]}
- onCancel={() => {
- this.props.onCancel();
- }}>
-
-
-
-
- 薪资所属月:{salarySendDetailBaseInfo.salaryMonth &&
- salarySendDetailBaseInfo.salaryMonth
- .year}-{salarySendDetailBaseInfo.salaryMonth &&
- salarySendDetailBaseInfo.salaryMonth.monthValue}
-
-
-
- 工资单模板:{salarySendDetailBaseInfo.template}
-
-
-
{
- this.setState({ searchValue: value });
- }}
- onSearch={value => {
- this.handleSearch(value);
- }}
- />
-
-
-
- {
- this.handleDataPageChange(value);
- },
- total: canWithdrawPageInfo.total,
- current: canWithdrawPageInfo.pageNum,
- showTotal: total => `共 ${total} 条`
- }}
- />
-
-
- );
- }
-}
From 41c400c329f075a1f77664f2e6a46221105c4959 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 2 Dec 2022 16:42:58 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../pages/payroll/payrollGrant/index.js | 38 +++-
.../pages/payroll/payrollGrant/index.less | 46 ++++-
.../payroll/payrollGrant/payrollPartModal.js | 191 ++++++++++++++++++
.../payroll/payrollGrant/payrollPartTable.js | 44 ++++
4 files changed, 311 insertions(+), 8 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollPartModal.js
create mode 100644 pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollPartTable.js
diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js
index 1a6092ca..00e7e9cd 100644
--- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js
+++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js
@@ -7,6 +7,7 @@ import "./index.less";
import { getQueryString } from "../../../util/url";
import { getSearchs } from "../../../util";
import CustomPaginationTable from "../../../components/customPaginationTable";
+import PayrollPartTable from "./payrollPartTable";
const { ButtonSelect } = WeaDropdown;
@@ -18,7 +19,11 @@ export default class PayrollGrant extends React.Component {
this.state = {
selectedRowKeys: [],
currentId: "",
- selectedKey: "0"
+ selectedKey: "0",
+ payrollPartModalParams: {
+ visible: false,
+ title: "工资单发放"
+ }
};
this.pageInfo = { current: 1, pageSize: 10 };
}
@@ -77,7 +82,7 @@ export default class PayrollGrant extends React.Component {
* Date: 2022/12/2
*/
sendPayroll = (key) => {
- const { selectedRowKeys, currentId } = this.state;
+ const { selectedRowKeys, currentId, payrollPartModalParams } = this.state;
switch (key) {
case "ALL":
this.handleGrantAll();
@@ -93,6 +98,12 @@ export default class PayrollGrant extends React.Component {
});
break;
case "PART":
+ this.setState({
+ payrollPartModalParams: {
+ ...payrollPartModalParams,
+ visible: true
+ }
+ });
break;
default:
break;
@@ -105,7 +116,7 @@ export default class PayrollGrant extends React.Component {
* Date: 2022/12/2
*/
withdrawalPayroll = (key) => {
- const { selectedRowKeys, currentId } = this.state;
+ const { selectedRowKeys, currentId, payrollPartModalParams } = this.state;
switch (key) {
case "withdrawAll":
this.handleWithdrawAll();
@@ -121,6 +132,13 @@ export default class PayrollGrant extends React.Component {
});
break;
case "partialWithdrawal":
+ this.setState({
+ payrollPartModalParams: {
+ ...payrollPartModalParams,
+ visible: true,
+ title: "工资单撤回"
+ }
+ });
break;
default:
break;
@@ -331,6 +349,17 @@ export default class PayrollGrant extends React.Component {
});
};
+ handleClose = () => {
+ const { payrollPartModalParams } = this.state;
+ this.setState({
+ payrollPartModalParams: {
+ ...payrollPartModalParams,
+ visible: false,
+ title: "工资单发放"
+ }
+ });
+ };
+
render() {
const { payrollStore } = this.props;
const {
@@ -343,7 +372,7 @@ export default class PayrollGrant extends React.Component {
salaryGrantPageInfo,
getInfoList
} = payrollStore;
- const { selectedRowKeys, selectedKey, currentId } = this.state;
+ const { selectedRowKeys, selectedKey, currentId, payrollPartModalParams } = this.state;
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange
@@ -449,6 +478,7 @@ export default class PayrollGrant extends React.Component {
}}
/>
+