diff --git a/pc4mobx/hrmSalary/components/progressModal/index.js b/pc4mobx/hrmSalary/components/progressModal/index.js index 24889013..cf05a2aa 100644 --- a/pc4mobx/hrmSalary/components/progressModal/index.js +++ b/pc4mobx/hrmSalary/components/progressModal/index.js @@ -7,10 +7,13 @@ export default class ProgressModal extends React.Component { const { title = "正在核算请稍后" } = this.props; return (
- { - this.props.onCancel(); - }} footer={null}> + { + this.props.onCancel(); + }} footer={null}>
diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index 2d3bd189..597d3bcb 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -1,10 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; - -import { Button, DatePicker, Dropdown, Menu, Modal } from "antd"; - +import { Button, DatePicker, Dropdown, Menu, Modal, message } from "antd"; import { WeaInputSearch, WeaRightMenu, WeaTop } from "ecCom"; - import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import CustomTab from "../../components/customTab"; @@ -12,6 +9,7 @@ import { columns } from "./columns"; import moment from "moment"; import BaseFormModal from "./baseFormModal"; import CustomPaginationTable from "../../components/customPaginationTable"; +import ProgressModal from "../../components/progressModal"; const MonthPicker = DatePicker.MonthPicker; @@ -21,6 +19,8 @@ export default class Calculate extends React.Component { constructor(props) { super(props); this.state = { + progressVisible: false, + progress: 0, value: "", selectedKey: "0", searchValue: "", @@ -113,7 +113,26 @@ export default class Calculate extends React.Component { handleFile(record) { const { calculateStore: { fileSalaryAcct } } = this.props; fileSalaryAcct(record.id).then(() => { - this.handleSearch(this.state.searchValue); + this.setState({ + progressVisible: true + }, () => { + this.timer = setInterval(() => { + if (this.state.progress !== 100) { + this.setState({ + progress: this.state.progress + 10 + }); + } else { + clearInterval(this.timer); + this.setState({ + progressVisible: false, + progress: 0 + }, () => { + message.success("归档成功"); + this.handleSearch(this.state.searchValue); + }); + } + }, 800); + }); }); } @@ -378,6 +397,17 @@ export default class Calculate extends React.Component { }} /> + {/*归档进度条*/} + { + this.state.progressVisible && + { + this.setState({ progressVisible: false, progress: 0 }); + }} + progress={this.state.progress} + /> + } {this.state.baseFormVisible && { @@ -116,9 +120,27 @@ export default class SalaryDetail extends React.Component { salaryItemId, salaryAcctRecordId }; + this.setState({ + progressVisible: true + }, () => { + this.timerLock = setInterval(() => { + if (this.state.progress !== 100) { + this.setState({ + progress: this.state.progress + 10 + }); + } else { + clearInterval(this.timerLock); + this.setState({ + progressVisible: false, + progress: 0 + }, () => { + message.success("操作成功"); + }); + } + }, 800); + }); updateLockStatus(module).then(({ status, errormsg }) => { if (status) { - message.success("操作成功"); const childFrameObj = document.getElementById("atdTable"); const payload = { type: "PR", @@ -212,6 +234,17 @@ export default class SalaryDetail extends React.Component { { this.setState({ visible: false }); }}/> + {/*加锁解锁进度条*/} + { + this.state.progressVisible && + { + this.setState({ progressVisible: false, progress: 0 }); + }} + progress={this.state.progress} + /> + } { slideVisiable && */} { - paymentItems && paymentItems.map(group => ( + data.fundSchemeId && paymentItems && paymentItems.map(group => (
{ group.items && group.items.length > 0 && diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js index 81d61f61..1707897e 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js @@ -138,7 +138,7 @@ export default class OtherForm extends React.Component { { - paymentItems && paymentItems.map(group => ( + data.otherSchemeId && paymentItems && paymentItems.map(group => (
{ group.items && group.items.length > 0 && diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js index f3329fc9..2b508320 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js @@ -12,8 +12,9 @@ export default class SocialSecurityForm extends React.Component { componentWillMount() { const { archivesStore } = this.props; const { getBaseForm, getPaymentForm } = archivesStore; + const siSchemeId = this.props.record.siSchemeId; getBaseForm(this.props.employeeId, "SOCIAL_SECURITY", this.props.record.paymentOrganization); - getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", this.props.record.siSchemeId, this.props.record.paymentOrganization); + getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", siSchemeId, this.props.record.paymentOrganization); } // 表单变化 @@ -148,7 +149,7 @@ export default class SocialSecurityForm extends React.Component { { - paymentItems && paymentItems.map(group => ( + data.socialSchemeId && paymentItems && paymentItems.map(group => (
{ group.items && group.items.length > 0 && diff --git a/pc4mobx/hrmSalary/stores/calculate.js b/pc4mobx/hrmSalary/stores/calculate.js index 9845c1d4..24daf457 100644 --- a/pc4mobx/hrmSalary/stores/calculate.js +++ b/pc4mobx/hrmSalary/stores/calculate.js @@ -444,7 +444,6 @@ export class calculateStore { return new Promise((resolve, reject) => { API.fileSalaryAcct({ id }).then(res => { if (res.status) { - message.success("归档成功"); resolve(); } else { message.error(res.errormsg || "归档失败");