往期累计情况
This commit is contained in:
parent
515c7bab01
commit
ae3ee29592
|
|
@ -472,4 +472,8 @@ export const exportComparisonResult = (salaryAcctRecordId) => {
|
|||
}))
|
||||
}
|
||||
|
||||
// 核算进度条
|
||||
export const getCalculateProgress = (id) => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/progress/getRate?cacheKey=ACCT_PROGRESS_' + id, 'get', {});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
import React from 'react'
|
||||
import { Modal } from 'antd'
|
||||
import { WeaProgress } from 'ecCom'
|
||||
|
||||
export default class ProgressModal extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Modal style={{top: 20}} visible={this.props.visible} width={this.props.width ? this.props.width: 600} onCancel={() => {this.props.onCancel()}} footer={null}>
|
||||
<div>
|
||||
<WeaProgress percent={this.props.progress ? this.props.progress : 0} strokeColor={this.props.color ? this.props.color: "#B37BFA"} />
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -3,10 +3,11 @@ import UserSure from './userSure'
|
|||
import { inject, observer } from 'mobx-react';
|
||||
import CustomTab from '../../components/customTab'
|
||||
import SalaryDetail from './salaryDetail'
|
||||
import { Button, Menu, Dropdown, Modal } from 'antd'
|
||||
import { Button, Menu, Dropdown, Modal, message } from 'antd'
|
||||
import { WeaInputSearch } from "ecCom"
|
||||
import { getQueryString } from '../../util/url'
|
||||
import AcctResultImportModal from './acctResult/importModal/acctResultImportModal';
|
||||
import ProgressModal from '../../components/progressModal'
|
||||
|
||||
@inject('calculateStore')
|
||||
@observer
|
||||
|
|
@ -16,9 +17,12 @@ export default class CalculateDetail extends React.Component {
|
|||
this.state = {
|
||||
selectedKey: "0",
|
||||
fieldData: {},
|
||||
acctResultImportVisiable: false
|
||||
acctResultImportVisiable: false,
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
}
|
||||
this.id = ""
|
||||
this.timer
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
|
|
@ -33,13 +37,43 @@ export default class CalculateDetail extends React.Component {
|
|||
// 核算点击事件
|
||||
handleAccount() {
|
||||
const { calculateStore } = this.props;
|
||||
const { acctresultAccounting, acctResultList } = calculateStore;
|
||||
const { acctresultAccounting, acctResultList, getCalculateProgress } = calculateStore;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "点击核算,公式项将按照公式逻辑核算,核算结果将覆盖原数据",
|
||||
onOk: () => {
|
||||
this.setState({progress: 0})
|
||||
acctresultAccounting(this.id).then(() => {
|
||||
acctResultList(this.id)
|
||||
this.setState({
|
||||
progressVisible: true
|
||||
})
|
||||
if(this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
this.timer = setInterval(() => {
|
||||
getCalculateProgress(this.id).then(data => {
|
||||
let progress = data.progress
|
||||
console.log("progress: " + progress)
|
||||
if(progress == 1 && this.timer) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
this.setState({
|
||||
progressVisible: false
|
||||
})
|
||||
message.success("核算完成")
|
||||
acctResultList(this.id)
|
||||
} else if(!data.status) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
this.setState({
|
||||
progressVisible: false
|
||||
})
|
||||
message.success(data.message)
|
||||
}
|
||||
this.setState({progress: Number(progress) * 100})
|
||||
})
|
||||
}, 300)
|
||||
|
||||
})
|
||||
},
|
||||
onCancel() {}
|
||||
|
|
@ -74,8 +108,17 @@ export default class CalculateDetail extends React.Component {
|
|||
acctResultList(this.id, value)
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
// 清除轮询
|
||||
if(this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { selectedKey, modalParam, acctResultImportVisiable } = this.state;
|
||||
const { calculateStore } = this.props;
|
||||
const { calculateProgress } = calculateStore
|
||||
|
||||
const menu = (
|
||||
<Menu onClick={this.handleMenuClick.bind(this)}>
|
||||
|
|
@ -142,8 +185,15 @@ export default class CalculateDetail extends React.Component {
|
|||
id={this.id}
|
||||
/>
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
this.state.progressVisible && <ProgressModal
|
||||
visible={this.state.progressVisible}
|
||||
onCancel={() => {
|
||||
this.setState({progressVisible: false, progress: 0})
|
||||
}}
|
||||
progress={this.state.progress}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,11 +123,11 @@ export default class SalaryDetail extends React.Component {
|
|||
style={{marginLeft: "10px"}}
|
||||
width={200}
|
||||
title={`薪资周期\n
|
||||
${baseSalarySobCycle.salaryCycle.fromDate}至${baseSalarySobCycle.salaryCycle.endDate}\n
|
||||
${baseSalarySobCycle.salaryCycle && baseSalarySobCycle.salaryCycle.fromDate}至${baseSalarySobCycle.salaryCycle && baseSalarySobCycle.salaryCycle.endDate}\n
|
||||
税款所属期\n
|
||||
${baseSalarySobCycle.taxCycle}\n
|
||||
考勤取值周期\n
|
||||
${baseSalarySobCycle.attendCycle.fromDate}至${baseSalarySobCycle.attendCycle.endDate}\n
|
||||
${baseSalarySobCycle.attendCycle && baseSalarySobCycle.attendCycle.fromDate}至${baseSalarySobCycle.attendCycle && baseSalarySobCycle.attendCycle.endDate}\n
|
||||
福利台账月份\n
|
||||
引用${baseSalarySobCycle.socialSecurityCycle}的福利台账数据`}
|
||||
placement="topLeft"
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ export default class CumSituation extends React.Component {
|
|||
width={200}
|
||||
onChange={v => {
|
||||
this.setState({monthValue: v})
|
||||
getTableDatas({ declareMonth: [v], taxAgentId })
|
||||
getTableDatas({ taxYearMonth: [v], taxAgentId })
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -89,7 +89,7 @@ export default class CumSituation extends React.Component {
|
|||
value={taxAgentId}
|
||||
onChange={v => {
|
||||
this.setState({taxAgentId: v})
|
||||
getTableDatas({ taxAgentId: v, declareMonth: [monthValue]})
|
||||
getTableDatas({ taxAgentId: v, taxYearMonth: [monthValue]})
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ export class calculateStore {
|
|||
@observable comparisonPreviewDataSource = []; // 线下对比列表数据
|
||||
@observable comparisonImportAcctResult = {}; // 导入结果
|
||||
|
||||
// ** 核算进度 **
|
||||
@observable calculateProgress = 0;
|
||||
|
||||
|
||||
// 编辑薪资表单数据
|
||||
@action
|
||||
|
|
@ -274,7 +277,7 @@ export class calculateStore {
|
|||
return new Promise((resolve, reject) => {
|
||||
API.acctresultAccounting({salaryAcctRecordId}).then(res => {
|
||||
if(res.status) {
|
||||
message.success("核算成功")
|
||||
// message.success("核算成功")
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "核算失败")
|
||||
|
|
@ -543,4 +546,24 @@ export class calculateStore {
|
|||
exportComparisonResult = (salaryAcctRecordId) => {
|
||||
API.exportComparisonResult(salaryAcctRecordId)
|
||||
}
|
||||
|
||||
// 核算进度条
|
||||
@action
|
||||
getCalculateProgress = (id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getCalculateProgress(id).then(res => {
|
||||
if(res.status) {
|
||||
let progress = 0;
|
||||
try {
|
||||
progress = Number(res.data.progress) * 100
|
||||
} catch(err) {
|
||||
}
|
||||
resolve(res.data)
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue