From e3d30694c3b99e80dfd642e782d73f19e85549a2 Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Wed, 22 Jun 2022 17:14:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=8F=9C=E5=8D=95=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=BE=97bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/itemMangeFormModal.js | 4 +- .../pages/dataAcquisition/cumDeduct/index.js | 4 +- .../dataAcquisition/cumSituation/index.js | 4 +- .../dataAcquisition/otherDeduct/index.js | 4 +- pc4mobx/hrmSalary/pages/ledger/index.js | 1 + .../hrmSalary/pages/payroll/SalarySendList.js | 12 +- pc4mobx/hrmSalary/pages/payroll/index.js | 2 +- .../pages/payroll/payrollGrant/index.js | 18 +- .../payroll/payrollGrant/payrollGrantModal.js | 411 +++++++++------ .../payrollGrant/payrollWithdrawModal.js | 411 ++++++++------- pc4mobx/hrmSalary/pages/salaryFile/index.js | 4 +- pc4mobx/hrmSalary/pages/salaryItem/index.js | 1 + .../socialSecurityBenefits/archives/index.js | 1 + .../socialSecurityBenefits/programme/index.js | 1 + pc4mobx/hrmSalary/stores/payroll.js | 493 +++++++++--------- 15 files changed, 756 insertions(+), 615 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/itemMangeFormModal.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/itemMangeFormModal.js index ca3209ad..7b65581a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/itemMangeFormModal.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/itemMangeFormModal.js @@ -31,7 +31,7 @@ export default class ItemMangeFormModal extends React.Component { this.setState({request: result}) } - convertFieldType(fileTypeStr) { + convertFieldType=(fileTypeStr)=> { if(fileTypeStr == "数值") { return "1" } else if(fileTypeStr == "文本"){ @@ -57,7 +57,7 @@ export default class ItemMangeFormModal extends React.Component { ] const { request } = this.state; const {fieldName, fieldType, enableStatus, description} = request - let fileTypeKey = convertFieldType(fieldType) + let fileTypeKey = this.convertFieldType(fieldType) const { attendanceStore : {currentItemOperate}} = this.props; return ( this.handleEditSlideSave()} diff --git a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js index 00b05a99..4572c2ad 100644 --- a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js +++ b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js @@ -7,7 +7,7 @@ import moment from "moment"; import CustomTable from "../../components/customTable"; import CustomPaginationTable from "../../components/customPaginationTable"; -@inject("payrollStore") +@inject("payrollStore", "taxAgentStore") @observer export default class SalarySendList extends React.Component { constructor(props) { @@ -52,7 +52,7 @@ export default class SalarySendList extends React.Component { getColumns() { const { payrollStore: { salarySendTableStore }, - showOperateBtn + taxAgentStore: { showOperateBtn } } = this.props; const { columns } = salarySendTableStore; if (!columns) { @@ -80,7 +80,7 @@ export default class SalarySendList extends React.Component { } }); showOperateBtn - ? result.concat([ + ? (result = result.concat([ { title: "操作", key: "operate", @@ -128,8 +128,8 @@ export default class SalarySendList extends React.Component { ); } } - ]) - : result.concat([ + ])) + : (result = result.concat([ { title: "操作", key: "operate", @@ -144,7 +144,7 @@ export default class SalarySendList extends React.Component { ); } } - ]); + ])); return result; } diff --git a/pc4mobx/hrmSalary/pages/payroll/index.js b/pc4mobx/hrmSalary/pages/payroll/index.js index b6624f3d..b7430b14 100644 --- a/pc4mobx/hrmSalary/pages/payroll/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/index.js @@ -352,7 +352,6 @@ export default class Payroll extends React.Component { { this.state.selectedKey == 0 && { this.handleTemplateListEdit(record) }} @@ -432,6 +431,7 @@ export default class Payroll extends React.Component { tabs={[{title: '基础设置', key: 0}, {title: "显示设置", key: 1}]} editable={false} selectedTab={selectedTab} + showOperateBtn={showOperateBtn} customOperate={ { selectedTab == 0 && diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js index 725ce143..c1657903 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js @@ -95,17 +95,13 @@ export default class PayrollGrant extends React.Component { getColumns() { const { payrollStore } = this.props; - const { salaryGrantTableStore } = payrollStore - const { columns } = salaryGrantTableStore; - if(!columns) { - return [] - } + const { salaryGrantTableStore: columns } = payrollStore - let result = columns.filter(item => item.hide == "false").map(item => { + let result = [...columns, {title: "操作",key: "operation",dataIndex: "operation"}].map(item => { item = {...item} if(item.dataIndex == "operation") { item.render = (text,record) => { - if(text == 'ALREADYSEND') { + if(record.sendStatus == '已发放') { return ( {this.handleWithdraw(record)}}>撤回 ) @@ -144,9 +140,9 @@ export default class PayrollGrant extends React.Component { ); return (
- - - 更多 + + + 更多
) } @@ -205,7 +201,7 @@ export default class PayrollGrant extends React.Component {
薪资所属月:{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue} { - batchSendInfoList({salarySendId: this.props.sendId}) - }) - } + 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}) - }) - } + // 发送 + 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}) - } + componentWillMount() { + const { payrollStore: { batchSendInfoList } } = this.props; + batchSendInfoList({ salarySendId: this.props.sendId }); + } - getColumns() { - const { payrollStore } = this.props; - const { canGrantColumns } = payrollStore - if(!canGrantColumns) { - return [] - } - return canGrantColumns.map(item => { - let result = {} - result.title = item.text; - result.dataIndex = item.column; - result.key = item.column; - result.width = item.width; - if(result.key == "operation") { - result.render = (text,record) => { - if(text == 'ALREADYSEND') { - return ( - {this.handleWithdraw(record)}}>撤回 - ) - } else { - return ( - {this.handleGrant(record)}}>发送 - ) - } - } - } else { - result.dataIndex = item.column; - } - return result; - }) - } - - 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 = ( - this.handleMenuClick(e)}> - 发放所选 - - ); - - const {payrollStore} = this.props; - const { salarySendDetailBaseInfo, canGrantDataSource, canGrantPageInfo } = payrollStore; - const { selectedRowKeys } = this.state; - - const rowSelection = { - selectedRowKeys, - onChange: this.onSelectChange.bind(this), + 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 ( - {this.props.onCancel()}}> -
- 批量发放 -
- {this.handleGrantAll()}}>全部发放 - {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/> -
-
-
-
- 薪资所属月:{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue} - - 工资单模板:{salarySendDetailBaseInfo.template} -
-
-
- {this.handleDataPageChange(value)}, - total: canGrantPageInfo.total, - current: canGrantPageInfo.pageNum, - showTotal: (total) => `共 ${total} 条`, - }} - /> -
-
- ) + } + 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; } -} \ No newline at end of file + 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 = ( + this.handleMenuClick(e)}> + 发放所选 + + ); + + const { payrollStore } = this.props; + const { + salarySendDetailBaseInfo, + canGrantDataSource, + canGrantPageInfo + } = payrollStore; + const { selectedRowKeys } = this.state; + + const rowSelection = { + selectedRowKeys, + onChange: this.onSelectChange.bind(this) + }; + + return ( + { + this.props.onCancel(); + }}> +
+ 批量发放 +
+ { + this.handleGrantAll(); + }}> + 全部发放 + + { + this.setState({ searchValue: value }); + }} + onSearch={value => { + this.handleSearch(value); + }} + /> +
+
+
+
+ + 薪资所属月:{salarySendDetailBaseInfo.salaryMonth && + salarySendDetailBaseInfo.salaryMonth + .year}-{salarySendDetailBaseInfo.salaryMonth && + salarySendDetailBaseInfo.salaryMonth.monthValue} + + + + 工资单模板:{salarySendDetailBaseInfo.template} + +
+
+
+ { + 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 index 7e8d8f99..7a2cba87 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollWithdrawModal.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollWithdrawModal.js @@ -1,188 +1,245 @@ -import React from 'react' -import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom" -import { payrollGrantColumns, dataSource } from "../columns" -import { Menu, Button,Table, Modal, Dropdown } from "antd" -import { inject, observer } from 'mobx-react'; +import React from "react"; +import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom"; +import { payrollGrantColumns, dataSource } from "../columns"; +import { Menu, Button, Table, Modal, Dropdown } from "antd"; +import { inject, observer } from "mobx-react"; - -@inject('payrollStore') +@inject("payrollStore") @observer export default class PayrollWithdrawModal extends React.Component { - constructor(props) { - super(props); - this.state = { - selectedRowKeys: [], - current: 1, - } - } + constructor(props) { + super(props); + this.state = { + selectedRowKeys: [], + current: 1 + }; + } - componentWillMount() { - const { payrollStore } = this.props - const { batchWithdrawInfoList } = payrollStore - batchWithdrawInfoList({salarySendId:this.props.sendId}) - } + 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}) - }) - } + // 撤回 + 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}) - }) - } + // 发送 + 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 - if(!canWidthdrawColumns) { - return [] - } - return canWidthdrawColumns.map(item => { - let result = {} - result.title = item.text; - result.key = item.column; - result.dataIndex = item.column; - result.width = item.width; - if(result.key == "operation") { - result.render = (text,record) => { - if(text == 'ALREADYSEND') { - return ( - {this.handleWithdraw(record)}}>撤回 - ) - } else { - return ( - {this.handleGrant(record)}}>发送 - ) - } - } - } else { - result.dataIndex = item.column; - } - return result; - }) - } - - 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 = ( - this.handleMenuClick(e)}> - 撤回所选 - - ); - const {payrollStore} = this.props; - const { salarySendDetailBaseInfo, canWidthdrawColumns, canWithdrawDataSource, canWithdrawPageInfo } = payrollStore; - const { selectedRowKeys } = this.state; - const rowSelection = { - selectedRowKeys, - onChange: this.onSelectChange.bind(this), + 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 + }); + }; - return ( - {this.props.onCancel()}}> -
- 批量撤回 -
- {this.handleWithdrawAll()}}>全部撤回 - {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/> -
-
-
-
- 薪资所属月:{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue} - - 工资单模板:{salarySendDetailBaseInfo.template} -
-
-
- {this.handleDataPageChange(value)}, - total: canWithdrawPageInfo.total, - current: canWithdrawPageInfo.pageNum, - showTotal: (total) => `共 ${total} 条`, - }} - /> -
-
- ) + // 撤回 + 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; } -} \ No newline at end of file + 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 = ( + this.handleMenuClick(e)}> + 撤回所选 + + ); + const { payrollStore } = this.props; + const { + salarySendDetailBaseInfo, + canWidthdrawColumns, + canWithdrawDataSource, + canWithdrawPageInfo + } = payrollStore; + const { selectedRowKeys } = this.state; + const rowSelection = { + selectedRowKeys, + onChange: this.onSelectChange.bind(this) + }; + + return ( + { + this.props.onCancel(); + }}> +
+ 批量撤回 +
+ { + this.handleWithdrawAll(); + }}> + 全部撤回 + + { + this.setState({ searchValue: value }); + }} + onSearch={value => { + this.handleSearch(value); + }} + /> +
+
+
+
+ + 薪资所属月:{salarySendDetailBaseInfo.salaryMonth && + salarySendDetailBaseInfo.salaryMonth + .year}-{salarySendDetailBaseInfo.salaryMonth && + salarySendDetailBaseInfo.salaryMonth.monthValue} + + + + 工资单模板:{salarySendDetailBaseInfo.template} + +
+
+
+ { + this.handleDataPageChange(value); + }, + total: canWithdrawPageInfo.total, + current: canWithdrawPageInfo.pageNum, + showTotal: total => `共 ${total} 条` + }} + /> +
+
+ ); + } +} diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index e653b3ed..0ca3f2ea 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.js @@ -248,7 +248,7 @@ export default class SalaryFile extends React.Component { } render() { - const { salaryFileStore } = this.props; + const { salaryFileStore, taxAgentStore: { showOperateBtn } } = this.props; const { loading, hasRight, @@ -355,7 +355,6 @@ export default class SalaryFile extends React.Component { ); const renderRightOperation = () => { - const { taxAgentStore: { showOperateBtn } } = this.props; return (
{ renderCustomOperate(); diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 9935c8fe..04d73c7e 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -352,6 +352,7 @@ export default class SalaryItem extends React.Component { {this.setState({selectedTab: item.key})} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 90b67dde..90a57c9b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -300,6 +300,7 @@ export default class Archives extends React.Component { tabs={[{title: '基础设置', key: 0}, {title: "社保", key: 1}, {title: "公积金", key: 2}, {title: '企业年金及其他福利', key: 3}]} editable={false} selectedTab={selectedTab} + showOperateBtn={showOperateBtn} customOperate={
{ diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index f4645d1f..fa82e777 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -545,6 +545,7 @@ export default class Programme extends React.Component { subtitle={this.state.customEdit ? "修改" : "新增"} subTabs={[{ title: "基础设置" }]} editable={true} + showOperateBtn={showOperateBtn} onSave={() => { handleOnSave(); }} diff --git a/pc4mobx/hrmSalary/stores/payroll.js b/pc4mobx/hrmSalary/stores/payroll.js index 571923ad..0e914a82 100644 --- a/pc4mobx/hrmSalary/stores/payroll.js +++ b/pc4mobx/hrmSalary/stores/payroll.js @@ -1,10 +1,10 @@ -import { observable, action, toJS } from 'mobx'; -import { message } from 'antd'; -import { WeaForm, WeaTableNew } from 'comsMobx'; +import { observable, action, toJS } from "mobx"; +import { message } from "antd"; +import { WeaForm, WeaTableNew } from "comsMobx"; -import * as API from '../apis/payroll'; // 引入API接口文件 -import { notNull } from '../util/validate'; -import { removePropertyCondition } from '../util/response'; +import * as API from "../apis/payroll"; // 引入API接口文件 +import { notNull } from "../util/validate"; +import { removePropertyCondition } from "../util/response"; const { TableStore } = WeaTableNew; @@ -16,20 +16,19 @@ export class payrollStore { @observable showSearchAd = false; // 高级搜索面板显示 @observable loading = true; // 数据加载状态 - // **** 模板页面 **** + // **** 模板页面 **** @observable templateStore = new TableStore(); // 模板设置列表 // 基础设置表单 - @observable templateBaseData = {} // 基础信息表单数据 - @observable salarySobOptions = [] // 账套列表 + @observable templateBaseData = {}; // 基础信息表单数据 + @observable salarySobOptions = []; // 账套列表 // 显示设置表单 - @observable salaryTemplateShowSet = {} // 显示设置基础表单 - @observable salaryItemSet = [] // 显示设置薪资项 - + @observable salaryTemplateShowSet = {}; // 显示设置基础表单 + @observable salaryItemSet = []; // 显示设置薪资项 // **** 工资单页面 **** @observable salarySendTableStore = new TableStore(); // 工资单列表 @observable salarySendDataSource = []; - @observable pageInfo = {} + @observable pageInfo = {}; // **** 工资单详情页 **** @observable salarySendDetailBaseInfo = {}; // 工资单详情基础信息 @@ -38,483 +37,503 @@ export class payrollStore { @observable detailListConditionForm = new WeaForm(); // 详情页搜索条件 @observable detailListShowSearchAd = false; // 详情页是否展开搜索面板 @observable detailListCondition = []; // 详情页搜索条件 - @observable salarySendDetailPageInfo ={} + @observable salarySendDetailPageInfo = {}; // **** 工资单发放页 **** @observable salaryGrantDataSource = []; - @observable salaryGrantPageInfo ={}; - @observable salaryGrantTableStore = new TableStore(); + @observable salaryGrantPageInfo = {}; + @observable salaryGrantTableStore = []; @observable grantListConditionForm = new WeaForm(); // 详情页搜索条件 @observable grantListShowSearchAd = false; // 详情页是否展开搜索面板 @observable grantListCondition = []; // 详情页搜索条件 @observable canGrantDataSource = []; // 可以发送的列表 - @observable canGrantColumns = []; // 可以发送的列名 + @observable canGrantColumns = []; // 可以发送的列名 @observable canGrantPageInfo = {}; // 可以发送列表分页对象 @observable canWithdrawDataSource = []; // 可以撤回的列表 @observable canWidthdrawColumns = []; // 可以撤回的列表列名 @observable canWithdrawPageInfo = {}; // 可以撤回列表分页对象 @action - setGrantListShowSearchAd = (grantListShowSearchAd) => this.grantListShowSearchAd = grantListShowSearchAd + setGrantListShowSearchAd = grantListShowSearchAd => + (this.grantListShowSearchAd = grantListShowSearchAd); // 详情页是否展开搜索面板 @action - setDetailListShowSearchAd = (detailListShowSearchAd) => this.detailListShowSearchAd = detailListShowSearchAd + setDetailListShowSearchAd = detailListShowSearchAd => + (this.detailListShowSearchAd = detailListShowSearchAd); // 基础信息表单数据 @action - setTemplateBaseData = (templateBaseData) => this.templateBaseData = templateBaseData + setTemplateBaseData = templateBaseData => + (this.templateBaseData = templateBaseData); // 显示设置基础表单 @action - setSalaryTemplateShowSet = (salaryTemplateShowSet) => this.salaryTemplateShowSet = salaryTemplateShowSet + setSalaryTemplateShowSet = salaryTemplateShowSet => + (this.salaryTemplateShowSet = salaryTemplateShowSet); @action - setSalaryItemSet = (salaryItemSet) => this.salaryItemSet = salaryItemSet + setSalaryItemSet = salaryItemSet => (this.salaryItemSet = salaryItemSet); // 初始化操作 @action doInit = () => { // this.getCondition(); // this.getTableDatas(); - } + }; // 获得高级搜索表单数据 @action getCondition = () => { - API.getCondition().then(action(res => { - if (res.api_status) { // 接口请求成功/失败处理 - let condition = removePropertyCondition(res.condition); - this.form.initFormFields(condition); // 渲染高级搜索form表单 - } else { - message.error(res.msg || '接口调用失败!') - } - })); - } + API.getCondition().then( + action(res => { + if (res.api_status) { + // 接口请求成功/失败处理 + let condition = removePropertyCondition(res.condition); + this.form.initFormFields(condition); // 渲染高级搜索form表单 + } else { + message.error(res.msg || "接口调用失败!"); + } + }) + ); + }; // 渲染table数据 @action - getTableDatas = (params) => { + getTableDatas = params => { this.loading = true; const formParams = this.form.getFormParams() || {}; params = params || formParams; - API.getTableDatas(params).then(action(res => { - if (res.api_status) { // 接口请求成功/失败处理 - this.tableStore.getDatas(res.datas); // table 请求数据 - this.hasRight = res.hasRight; - } else { - message.error(res.msg || '接口调用失败!') - } - this.loading = false; - })); - } + API.getTableDatas(params).then( + action(res => { + if (res.api_status) { + // 接口请求成功/失败处理 + this.tableStore.getDatas(res.datas); // table 请求数据 + this.hasRight = res.hasRight; + } else { + message.error(res.msg || "接口调用失败!"); + } + this.loading = false; + }) + ); + }; - @action - setShowSearchAd = bool => this.showSearchAd = bool; + @action setShowSearchAd = bool => (this.showSearchAd = bool); // 高级搜索 - 搜索 - @action doSearch = () => { + @action + doSearch = () => { this.getTableDatas(); this.showSearchAd = false; - } + }; // 工资单模板-工资单模板列表 @action getPayrollTemplateList = (params = {}) => { - this.loading = true + this.loading = true; API.getPayrollTemplateList(params).then(res => { - if(res.status) { + if (res.status) { this.templateStore.getDatas(res.data.datas); } else { message.error(res.errormsg || "获取失败"); } this.loading = false; - }) - } + }); + }; // 工资单模板-获取工资单模板基础设置表单 @action getPayrollBaseForm = (id = "") => { let params = { id - } + }; return new Promise((resolve, reject) => { API.getPayrollBaseForm(params).then(res => { - if(res.status) { - let response = res.data.salaryTemplateBaseSet - let templateBaseData = response.data - templateBaseData.salarySob = templateBaseData.salarySob != undefined ? templateBaseData.salarySob + "": null; - this.templateBaseData = templateBaseData // 基础信息表单数据 - - this.salarySobOptions = response.salarySobOptions ? - response.salarySobOptions.map(item => { - let result = {} - result.showname = item.name; - result.key = item.id + ""; - result.selected = false; - return result; - }) : [] + if (res.status) { + let response = res.data.salaryTemplateBaseSet; + let templateBaseData = response.data; + templateBaseData.salarySob = + templateBaseData.salarySob != undefined + ? templateBaseData.salarySob + "" + : null; + this.templateBaseData = templateBaseData; // 基础信息表单数据 + + this.salarySobOptions = response.salarySobOptions + ? response.salarySobOptions.map(item => { + let result = {}; + result.showname = item.name; + result.key = item.id + ""; + result.selected = false; + return result; + }) + : []; resolve({ templateBaseData: this.templateBaseData, salarySobOptions: this.salarySobOptions }); } else { message.errro(res.errormsg || "获取失败"); - reject() + reject(); } - }) - }) - } - + }); + }); + }; // 工资单模板-获取工资单模板显示设置表单 @action getPayrollShowForm = (id = "") => { let params = { id - } + }; API.getPayrollShowForm(params).then(res => { - if(res.status) { - if(id !== "") { - this.salaryItemSet = res.data.salaryTemplateSalaryItemSet + if (res.status) { + if (id !== "") { + this.salaryItemSet = res.data.salaryTemplateSalaryItemSet; } - this.salaryTemplateShowSet = res.data.salaryTemplateShowSet.data + this.salaryTemplateShowSet = res.data.salaryTemplateShowSet.data; } else { - message.error(res.errormsg || "获取失败") + message.error(res.errormsg || "获取失败"); } - }) - } + }); + }; // 工资单模板-获取薪资项目设置 @action getPayrollItemList = (salarySobId = "") => { let params = { salarySobId - } + }; API.getPayrollItemList(params).then(res => { - if(res.status) { - this.salaryItemSet = res.data + if (res.status) { + this.salaryItemSet = res.data; } else { - message.error(res.errormsg || "获取失败") + message.error(res.errormsg || "获取失败"); } - }) - } + }); + }; // 初始化显示设置表单 @action initShowSettingForm = (id = "") => { this.getPayrollShowForm(id); - if(id == "") { - this.getPayrollItemList(this.templateBaseData.salarySob) + if (id == "") { + this.getPayrollItemList(this.templateBaseData.salarySob); } - } - + }; + // 校验显示设置表单 validateSalaryTemplateShowSet = () => { - if(!notNull(this.salaryTemplateShowSet.theme)) { + if (!notNull(this.salaryTemplateShowSet.theme)) { message.warning("工资单主题不能为空"); return false; } return true; - } + }; // 拼装保存参数 convertParams = () => { - let params = {...this.templateBaseData, ...this.salaryTemplateShowSet} - params.salarySobId = params.salarySob + let params = { ...this.templateBaseData, ...this.salaryTemplateShowSet }; + params.salarySobId = params.salarySob; params.emailStatus = params.emailStatus ? params.emailStatus : false; - params.msgStatus = params.msgStatus ? params.msgStatus : false - params.salaryItemNullStatus = params.salaryItemNullStatus ? params.salaryItemNullStatus : false; - params.salaryItemZeroStatus = params.salaryItemZeroStatus ? params.salaryItemZeroStatus : false; - params.salaryItemSetting = this.salaryItemSet - return params - } - + params.msgStatus = params.msgStatus ? params.msgStatus : false; + params.salaryItemNullStatus = params.salaryItemNullStatus + ? params.salaryItemNullStatus + : false; + params.salaryItemZeroStatus = params.salaryItemZeroStatus + ? params.salaryItemZeroStatus + : false; + params.salaryItemSetting = this.salaryItemSet; + return params; + }; // 工资单模板-新建工资单模板 @action fetchSavePayroll = () => { - if(!(this.validateSalaryTemplateShowSet())) { - return false + if (!this.validateSalaryTemplateShowSet()) { + return false; } - let params = this.convertParams() + let params = this.convertParams(); return new Promise((resolve, reject) => { API.savePayroll(params).then(res => { - if(res.status) { + if (res.status) { message.success("保存成功"); this.getPayrollTemplateList(); resolve(); - } else { - message.error(res.errormsg || "保存失败") - reject() + } else { + message.error(res.errormsg || "保存失败"); + reject(); } - }) - }) - } + }); + }); + }; // 工资单模板-更新工资单模板 @action - fetchUpdatePayroll = (id) => { - if(!(this.validateSalaryTemplateShowSet())) { - return false + fetchUpdatePayroll = id => { + if (!this.validateSalaryTemplateShowSet()) { + return false; } - let params = this.convertParams() - params.id = id + let params = this.convertParams(); + params.id = id; return new Promise((resolve, reject) => { API.updatePayroll(params).then(res => { - if(res.status) { + if (res.status) { message.success("保存成功"); this.getPayrollTemplateList(); resolve(); - } else { - message.error(res.errormsg || "保存失败") - reject() + } else { + message.error(res.errormsg || "保存失败"); + reject(); } - }) - }) - } + }); + }); + }; //工资单-获取薪资账套下拉列表 @action getPayrollTemplateLedgerList = () => { return new Promise((resolve, reject) => { API.getPayrollTemplateLedgerList().then(res => { - if(res.status) { + if (res.status) { this.payrollTemplateLedgerList = res.data.map(item => { - let result = {} + let result = {}; result.showname = item.content; result.selected = false; - result.key = item.id + result.key = item.id; return result; - }) - resolve(this.payrollTemplateLedgerList) + }); + resolve(this.payrollTemplateLedgerList); } else { message.error(res.errormsg || "获取失败"); - reject() + reject(); } - }) - }) - } + }); + }); + }; // 工资单模板-工资单模板默认使用 @action changePayrollDefaultUse(id = "") { - if(id == "") { + if (id == "") { message.warning("id必填"); - return + return; } let params = { id - } + }; return new Promise((resolve, reject) => { API.changePayrollDefaultUse(params).then(res => { - if(res.status) { + if (res.status) { message.success("设置成功"); - resolve() + resolve(); } else { - message.success(res.errormsg || "设置失败") - reject() + message.success(res.errormsg || "设置失败"); + reject(); } - }) - }) + }); + }); } // 工资单模板-复制工资单模板 @action duplicatePayroll = (id, name) => { let params = { - id, name - } + id, + name + }; return new Promise((resolve, reject) => { API.duplicatePayroll(params).then(res => { - if(res.status) { - message.success("复制成功") - this.getPayrollTemplateList() - resolve() + if (res.status) { + message.success("复制成功"); + this.getPayrollTemplateList(); + resolve(); } else { - message.error(res.errormsg || "复制失败") + message.error(res.errormsg || "复制失败"); reject(); } - }) - }) - } + }); + }); + }; // 工资单模板-删除工资单模板 @action - deletePayroll = (ids) => { + deletePayroll = ids => { API.deletePayroll(ids).then(res => { - if(res.status) { + if (res.status) { message.success("删除成功"); - this.getPayrollTemplateList() + this.getPayrollTemplateList(); } else { message.error(res.errormsg || "删除失败"); } - }) - } + }); + }; // 工资单-工资单发放列表 @action - getPayrollList = (parmas = {salaryYearMonth: []}) => { - this.loading = true + getPayrollList = (parmas = { salaryYearMonth: [] }) => { + this.loading = true; API.getPayrollList(parmas).then(res => { - if(res.status) { - this.salarySendDataSource = res.data.datas - this.salarySendTableStore.getDatas(res.data.dataKey.datas) - this.pageInfo = res.data.pageInfo + if (res.status) { + this.salarySendDataSource = res.data.datas; + this.salarySendTableStore.getDatas(res.data.dataKey.datas); + this.pageInfo = res.data.pageInfo; } else { message.error(res.errormsg || "获取失败"); } - this.loading = false - }) - } - + this.loading = false; + }); + }; + // 工资单发放-工资单发放基本信息 @action - getPayrollInfo = (id) => { - API.getPayrollInfo({id}).then(res => { - if(res.status) { - this.salarySendDetailBaseInfo = res.data + getPayrollInfo = id => { + API.getPayrollInfo({ id }).then(res => { + if (res.status) { + this.salarySendDetailBaseInfo = res.data; } else { - message.error(res.errormsg || "获取失败") + message.error(res.errormsg || "获取失败"); } - }) - } + }); + }; // 工资单发放-工资单发放信息列表 @action getInfoList = (params = {}) => { let form = this.grantListConditionForm.getFormParams(); - params = {...form, ...params} + params = { ...form, ...params }; API.getInfoList(params).then(res => { - if(res.status) { - this.salaryGrantTableStore.getDatas(res.data.dataKey.datas) - this.salaryGrantDataSource = res.data.datas - this.salaryGrantPageInfo = res.data.pageInfo + if (res.status) { + this.salaryGrantTableStore = res.data.columns; + this.salaryGrantDataSource = res.data.list; + this.salaryGrantPageInfo = { + total: res.data.total, + pageNum: res.data.pageNum + }; + this.getPayrollInfo(params.salarySendId); } else { - message.error(res.errormsg || "获取失败") + message.error(res.errormsg || "获取失败"); } - }) - } + }); + }; // 工资单-工资单发放详情列表 @action - getPayrollDetailList = (params) => { - let form = this.detailListConditionForm.getFormParams() || {} - params = {...form, ...params} + getPayrollDetailList = params => { + let form = this.detailListConditionForm.getFormParams() || {}; + params = { ...form, ...params }; API.getPayrollDetailList(params).then(res => { - if(res.status) { - this.salarySendDetailTableStore.getDatas(res.data.dataKey.datas) - this.salarySendDetailDataSource = res.data.datas - this.salarySendDetailPageInfo = res.data.pageInfo + if (res.status) { + this.salarySendDetailTableStore.getDatas(res.data.dataKey.datas); + this.salarySendDetailDataSource = res.data.datas; + this.salarySendDetailPageInfo = res.data.pageInfo; } else { - message.error(res.errormsg || "获取失败") + message.error(res.errormsg || "获取失败"); } - }) - } - + }); + }; // 工资单详情页 - 获得高级搜索表单数据 @action getPayrollDetailSa = (params = {}) => { API.getPayrollDetailSa(params).then(res => { - if (res.status) { // 接口请求成功/失败处理 + if (res.status) { + // 接口请求成功/失败处理 let condition = removePropertyCondition(res.data.condition); - this.detailListCondition = condition + this.detailListCondition = condition; this.detailListConditionForm.initFormFields(condition); // 渲染高级搜索form表单 } else { - message.error(res.errormsg || '接口调用失败!') + message.error(res.errormsg || "接口调用失败!"); } }); - } + }; // 工资单发放-导出-工资单发放详情列表 @action exportDetailList = (params = {}) => { - API.exportDetailList(params) - } + API.exportDetailList(params); + }; // 工资单-获取工资单发放高级搜索 @action getPaySa = (params = {}) => { API.getPaySa(params).then(res => { - if(res.status) { - let condition = removePropertyCondition(res.data.condition) + if (res.status) { + let condition = removePropertyCondition(res.data.condition); this.grantListCondition = condition; - this.grantListConditionForm.initFormFields(condition); + this.grantListConditionForm.initFormFields(condition); } else { - message.error(res.errormsg || "接口调用失败") + message.error(res.errormsg || "接口调用失败"); } - }) - } + }); + }; // 工资单发放-工资单批量发放信息列表 @action batchSendInfoList = (params = {}) => { API.batchSendInfoList(params).then(res => { - if(res.status) { - let datas = res.data.datas || []; - datas.map(item => { - item.key = item.id - }) - this.canGrantDataSource = datas + if (res.status) { + this.canGrantDataSource = res.data.list; this.canGrantColumns = res.data.columns; - this.canGrantPageInfo = res.data.pageInfo - // alert("this.canGrantColumns:" + JSON.stringify(this.canGrantColumns)) + this.canGrantPageInfo = { + total: res.data.total, + pageNum: res.data.pageNum + }; } else { - message.error(res.errormsg || "获取失败") + message.error(res.errormsg || "获取失败"); } - }) - } + }); + }; // 工资单发放-工资单批量撤回信息列表 @action batchWithdrawInfoList = (params = {}) => { API.batchWithdrawInfoList(params).then(res => { - if(res.status) { - let datas = res.data.datas || []; + if (res.status) { + let datas = res.data.list || []; datas.map(item => { - item.key = item.id - }) - this.canWithdrawDataSource = datas - this.canWidthdrawColumns = res.data.columns - this.canWithdrawPageInfo = res.data.pageInfo + item.key = item.id; + }); + this.canWithdrawDataSource = datas; + this.canWidthdrawColumns = res.data.columns; + this.canWithdrawPageInfo = { + total: res.data.total, + pageNum: res.data.pageNum + }; } else { message.error(res.errormsg || "获取失败"); } - }) - } + }); + }; //工资单-工资单发放 @action grantPayroll = (params = {}) => { return new Promise((resolve, reject) => { API.grantPayroll(params).then(res => { - if(res.status) { + if (res.status) { message.success("发送成功"); resolve(); } else { - message.error(res.errormsg || "发送失败") + message.error(res.errormsg || "发送失败"); reject(); } - }) - }) - } + }); + }); + }; // 工资单-工资单撤回 @action withdrawPayroll = (params = {}) => { return new Promise((resolve, reject) => { API.withdrawPayroll(params).then(res => { - if(res.status) { + if (res.status) { message.success("撤回成功"); - resolve() + resolve(); } else { - message.error(res.errormsg || "撤回失败") + message.error(res.errormsg || "撤回失败"); reject(); } - }) - }) - } - - -} \ No newline at end of file + }); + }); + }; +}