-
编辑
-
复制
-
删除
+
- )
- }
+ );
+ };
}
- })
+ });
}
// 更新模板
@@ -88,22 +91,22 @@ export default class Payroll extends React.Component {
editSlideVisible: true,
templateCurrentId: record.templateId
- })
+ });
}
// 工资单模板-新建表单变化监听
handleBaseInfoChange(request) {
- const { payrollStore: {setTemplateBaseData}} = this.props;
+ const { payrollStore: { setTemplateBaseData } } = this.props;
setTemplateBaseData(request);
}
// 新建保存
handleSave() {
const { payrollStore } = this.props;
- const { fetchSavePayroll } = payrollStore
+ const { fetchSavePayroll } = payrollStore;
fetchSavePayroll().then(() => {
- this.setState({currentStep: 0, stepSlideVisible: false})
- })
+ this.setState({ currentStep: 0, stepSlideVisible: false });
+ });
}
componentWillMount() {
@@ -114,33 +117,33 @@ export default class Payroll extends React.Component {
this.setState({
initSelected: true,
ledgerOptions: options
- })
- })
+ });
+ });
}
// 模板搜索
handleTemplateSearch() {
const { templateSearchValue, templateSelect } = this.state;
- let params = {name: templateSearchValue, salarySobId: templateSelect}
- const { payrollStore: {getPayrollTemplateList}} = this.props;
- getPayrollTemplateList(params)
+ let params = { name: templateSearchValue, salarySobId: templateSelect };
+ const { payrollStore: { getPayrollTemplateList } } = this.props;
+ getPayrollTemplateList(params);
}
// 模板选择框下拉改变事件
handleTemplateSelectChange(value) {
- this.setState({templateSelect: value})
- this.handleTemplateSearch()
+ this.setState({ templateSelect: value });
+ this.handleTemplateSearch();
}
// 模板列表编辑
handleTemplateListEdit(record) {
const { payrollStore } = this.props;
- const { getPayrollShowForm } = payrollStore
- this.recordId = record.id
- getPayrollShowForm(record.id)
- this.setState({templateCurrentId: record.id, selectedTab: 0},() => {
- this.setState({editSlideVisible: true})
- })
+ const { getPayrollShowForm } = payrollStore;
+ this.recordId = record.id;
+ getPayrollShowForm(record.id);
+ this.setState({ templateCurrentId: record.id, selectedTab: 0 }, () => {
+ this.setState({ editSlideVisible: true });
+ });
}
// 模板列表复制
@@ -150,90 +153,103 @@ export default class Payroll extends React.Component {
}, () => {
this.setState({
copyModalVisible: true
- })
- })
+ });
+ });
}
// 复制模板保存事件监听
handleCopyModalSave(value) {
const { payrollStore } = this.props;
- const { duplicatePayroll } = payrollStore
+ const { duplicatePayroll } = payrollStore;
duplicatePayroll(this.state.templateCurrentId, value).then(() => {
this.setState({
copyModalVisible: false
- })
- })
+ });
+ });
}
// 模板列表删除
handleTemplateListDelete(record) {
- const { payrollStore: { deletePayroll }} = this.props;
+ const { payrollStore: { deletePayroll } } = this.props;
Modal.confirm({
- title: '信息确认',
- content: '确认删除',
- onOk:() => {
- deletePayroll([record.id])
+ title: "信息确认",
+ content: "确认删除",
+ onOk: () => {
+ deletePayroll([record.id]);
},
onCancel: () => {
- },
+ }
});
}
-
- handleRangePickerChange(value) {
- let range = value.map(item => moment(item).format("YYYY-MM"))
+ handleRangePickerChange(type, value) {
const { payrollStore: { getPayrollList } } = this.props;
- this.salaryYearMonth = range
- getPayrollList({salaryYearMonth: range, ...this.listPageInfo})
+ this.setState({
+ [type]: value ? moment(value).format("YYYY-MM") : moment().format("YYYY-MM")
+ }, () => {
+ const { startDate, endDate } = this.state;
+ this.salaryYearMonth = [startDate, endDate];
+ getPayrollList({ salaryYearMonth: [startDate, endDate], ...this.listPageInfo });
+ });
}
// 预览
- handlePreview() {
- const { payrollStore : {templateBaseData, salaryTemplateShowSet, salaryItemSet}} = this.props;
- window.localStorage.setItem("templateBaseData", JSON.stringify(templateBaseData))
- window.localStorage.setItem("salaryTemplateShowSet", JSON.stringify(salaryTemplateShowSet))
- window.localStorage.setItem("salaryItemSet", JSON.stringify(salaryItemSet))
- window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/templatePreview")
+ handlePreview() {
+ const { payrollStore: { templateBaseData, salaryTemplateShowSet, salaryItemSet } } = this.props;
+ window.localStorage.setItem("templateBaseData", JSON.stringify(templateBaseData));
+ window.localStorage.setItem("salaryTemplateShowSet", JSON.stringify(salaryTemplateShowSet));
+ window.localStorage.setItem("salaryItemSet", JSON.stringify(salaryItemSet));
+ window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/templatePreview");
}
-
+
// 更新保存
handleUpdateSave() {
- const { payrollStore} = this.props;
+ const { payrollStore } = this.props;
const { fetchUpdatePayroll } = payrollStore;
fetchUpdatePayroll(this.recordId).then(() => {
this.setState({
editSlideVisible: false,
- selectedTab: 0
- })
- })
+ selectedTab: 0
+ });
+ });
}
// 发放页面页码跳转
handleListDataPageChange(value, pageInfo) {
- const { payrollStore: {getPayrollList} } = this.props;
- this.listPageInfo = pageInfo
- getPayrollList({salaryYearMonth: this.salaryYearMonth, ...pageInfo})
+ const { payrollStore: { getPayrollList } } = this.props;
+ this.listPageInfo = pageInfo;
+ getPayrollList({ salaryYearMonth: this.salaryYearMonth, ...pageInfo });
}
// 发放页面每页条数
handleListShowSizeChange(pageInfo) {
- const { payrollStore: {getPayrollList} } = this.props;
- this.listPageInfo = pageInfo
- getPayrollList({salaryYearMonth: this.salaryYearMonth, ...pageInfo})
+ const { payrollStore: { getPayrollList } } = this.props;
+ this.listPageInfo = pageInfo;
+ getPayrollList({ salaryYearMonth: this.salaryYearMonth, ...pageInfo });
}
render() {
const { payrollStore, taxAgentStore: { showOperateBtn } } = this.props;
- const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = payrollStore;
- const { currentStep, selectedTab, templateSearchValue, templateSelect } = this.state
+ const {
+ loading,
+ hasRight,
+ form,
+ condition,
+ tableStore,
+ showSearchAd,
+ getTableDatas,
+ doSearch,
+ setShowSearchAd
+ } = payrollStore;
+ const { currentStep, selectedTab, templateSearchValue, templateSelect, startDate, endDate } = this.state;
if (!hasRight && !loading) { // 无权限处理
return renderNoright();
}
const rightMenu = [// 右键菜单
- // {
+ // {
// key: 'BTN_COLUMN',
// icon:
,
// content: '显示列定制',
@@ -241,90 +257,116 @@ export default class Payroll extends React.Component {
// },
];
const collectParams = { // 收藏功能配置
- favname: '工资单发放',
+ favname: "工资单发放",
favouritetype: 1,
objid: 0,
- link: 'wui/index.html#/ns_demo03/index',
- importantlevel: 1,
+ link: "wui/index.html#/ns_demo03/index",
+ importantlevel: 1
};
const adBtn = [ // 高级搜索内部按钮
,
,
-
,
+
];
- const topTab = [{
+ const topTab = [{
title: "工资单发放",
viewcondition: "0"
},
- {
+ {
title: "工资单模板设置",
viewcondition: "1"
- }];
+ }];
const renderRightOperation = () => {
- if(this.state.selectedKey == "0") {
- return
+ if (this.state.selectedKey == "0") {
+ return
-
-
this.handleRangePickerChange(value)}
+
+ {
+ return current && endDate && current.getTime() > new Date(endDate).getTime();
+ }}
+ format="YYYY-MM"
+ onChange={(val) => this.handleRangePickerChange("startDate", val)}
+ />
+ 至
+ {
+ return current && startDate && current.getTime() < new Date(startDate).getTime();
+ }}
+ format="YYYY-MM"
+ onChange={(val) => this.handleRangePickerChange("endDate", val)}
/>
-
- } else if(this.state.selectedKey == "1") {
+
;
+ } else if (this.state.selectedKey == "1") {
return (
-
+
{
- showOperateBtn &&
-
+ showOperateBtn &&
+
}
{
- this.state.initSelected && {this.handleTemplateSelectChange(value)}}/>
+ this.state.initSelected && {
+ this.handleTemplateSelectChange(value);
+ }}/>
}
-
- {this.setState({templateSearchValue: value})}} onSearch={(value) => {this.handleTemplateSearch(value)}}/>
+
+ {
+ this.setState({ templateSearchValue: value });
+ }} onSearch={(value) => {
+ this.handleTemplateSearch(value);
+ }}/>
- )
+ );
}
- }
-
+ };
+
const steps = [
"基础设置",
"显示设置"
- ]
+ ];
const validateStep1 = () => {
- const { payrollStore: {templateBaseData}} = this.props;
- if(!notNull(templateBaseData.name)) {
- message.warning("工资单模板名称不能为空")
- return false
+ const { payrollStore: { templateBaseData } } = this.props;
+ if (!notNull(templateBaseData.name)) {
+ message.warning("工资单模板名称不能为空");
+ return false;
}
- if(!notNull(templateBaseData.salarySob)) {
- message.warning("薪资账套不能为空")
+ if (!notNull(templateBaseData.salarySob)) {
+ message.warning("薪资账套不能为空");
return false;
}
return true;
- }
- const nextStep = () => {
- if(!validateStep1()) {
- return
+ };
+ const nextStep = () => {
+ if (!validateStep1()) {
+ return;
}
this.setState({
currentStep: this.state.currentStep + 1
- })
- }
+ });
+ };
// 上一步
const prevStep = () => {
this.setState({
currentStep: this.state.currentStep - 1
- })
- }
+ });
+ };
return (
@@ -334,137 +376,164 @@ export default class Payroll extends React.Component {
>
} // 左侧图标
- iconBgcolor='#F14A2D' // 左侧图标背景色
+ icon={
} // 左侧图标
+ iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
>
-
{
- this.setState({selectedKey: v})
+ {
+ this.setState({ selectedKey: v });
+ }}
+ />
+ {
+ this.state.selectedKey == 0 &&
+ {
+ this.handleTemplateListEdit(record);
+ }}
+ salaryYearMonth={this.salaryYearMonth}
+ handleListDataPageChange={(value, pageInfo) => {
+ this.handleListDataPageChange(value, pageInfo);
+ }}
+ handleListShowSizeChange={(pageInfo) => {
+ this.handleListShowSizeChange(pageInfo);
}}
/>
- {
- this.state.selectedKey == 0 &&
- {
- this.handleTemplateListEdit(record)
- }}
- salaryYearMonth={this.salaryYearMonth}
- handleListDataPageChange={(value, pageInfo) => {
- this.handleListDataPageChange(value, pageInfo)
- }}
- handleListShowSizeChange={(pageInfo) => {
- this.handleListShowSizeChange(pageInfo)
- }}
- />
-
- //
- }
- {
- this.state.selectedKey == 1 &&
- {
- this.handleTemplateListEdit(record)
- }}
- onCopy={(record) => {
- this.handleTemplateListCopy(record)
- }}
- showOperateBtn={showOperateBtn}
- onDelete={(record)=> this.handleTemplateListDelete(record)}
- />
- }
+ //
+ }
+
+ {
+ this.state.selectedKey == 1 &&
+ {
+ this.handleTemplateListEdit(record);
+ }}
+ onCopy={(record) => {
+ this.handleTemplateListCopy(record);
+ }}
+ showOperateBtn={showOperateBtn}
+ onDelete={(record) => this.handleTemplateListDelete(record)}
+ />
+ }
{
- this.state.stepSlideVisible && {this.setState({stepSlideVisible: false})}}
- customOperate = {
-
+ this.state.stepSlideVisible &&
{
+ this.setState({ stepSlideVisible: false });
+ }}
+ customOperate={
+
{
- currentStep == 0 &&
+ currentStep == 0 &&
}
{
- currentStep == 1 &&
-
-
-
-
+ currentStep == 1 &&
+
+
+
+
}
-
- }
- title="新建工资单模板"
- content={
-
- {
- currentStep == 0 && {this.handleBaseInfoChange(request)}}/>
- }
- {
- currentStep == 1 &&
- }
-
-
- }
- />
- }
+
+ }
+ title="新建工资单模板"
+ content={
+
+ {
+ currentStep == 0 && {
+ this.handleBaseInfoChange(request);
+ }}/>
+ }
+ {
+ currentStep == 1 &&
+ }
+
- {
- this.state.editSlideVisible &&
-
+ }
+ />
+ }
+
+ {
+ this.state.editSlideVisible &&
+
{
- selectedTab == 0 &&
+ selectedTab == 0 &&
}
- {
- selectedTab == 1 &&
-
-
-
+ {
+ selectedTab == 1 &&
+
+
+
- }
+ }
}
- subItemChange={
- (item) => {this.setState({selectedTab: item.key})}
- }
- />
- }
- content={
- {
- selectedTab == 0 && {this.handleBaseInfoChange(request)}}/>
- }
- {
- selectedTab == 1 &&
- }
-
}
- onClose={() => this.setState({editSlideVisible: false})}
- showMask={true}
- closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
- }
- {
- this.state.copyModalVisible && this.handleCopyModalSave(value)} visible={this.state.copyModalVisible} onCancel={() => {this.setState({copyModalVisible: false})}}/>
- }
+ subItemChange={
+ (item) => {
+ this.setState({ selectedTab: item.key });
+ }
+ }
+ />
+ }
+ content={
+ {
+ selectedTab == 0 &&
+ {
+ this.handleBaseInfoChange(request);
+ }}/>
+ }
+ {
+ selectedTab == 1 &&
+ }
+
}
+ onClose={() => this.setState({ editSlideVisible: false })}
+ showMask={true}
+ closeMaskOnClick={() => this.setState({ editSlideVisible: false })}/>
+ }
+ {
+ this.state.copyModalVisible &&
+ this.handleCopyModalSave(value)} visible={this.state.copyModalVisible}
+ onCancel={() => {
+ this.setState({ copyModalVisible: false });
+ }}/>
+ }
- )
+ );
}
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
index e6326c3f..7a282517 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
@@ -117,7 +117,7 @@ export default class Archives extends React.Component {
handleImport(params) {
const { archivesStore: {importBatch, initImportParams}} = this.props;
importBatch(params)
-
+
}
// 导入完成
@@ -144,19 +144,19 @@ export default class Archives extends React.Component {
// 关闭导入框
handleImportCancel() {
const { archivesStore: {initImportParams, getTableDatas }} = this.props;
-
- initImportParams()
+
+ initImportParams()
if(this.state.step == 2) {
getTableDatas()
}
- this.setState({importVisible: false, step: 0});
+ this.setState({importVisible: false, step: 0});
}
handleSearch() {
const { archivesStore: {getTableDatas}} = this.props;
getTableDatas({...this.pageInfo, current: 1})
}
-
+
render() {
const { archivesStore, taxAgentStore: { showOperateBtn } } = this.props;
const { selectedTab, selectedRowKeys } = this.state;
@@ -169,12 +169,12 @@ export default class Archives extends React.Component {
}
const rightMenu = [// 右键菜单
- {
- key: 'BTN_COLUMN',
- icon:
,
- content: '显示列定制',
- onClick: this.showColumn
- },
+ // {
+ // key: 'BTN_COLUMN',
+ // icon:
,
+ // content: '显示列定制',
+ // onClick: this.showColumn
+ // },
];
const collectParams = { // 收藏功能配置
favname: '社保福利档案',
@@ -246,7 +246,7 @@ export default class Archives extends React.Component {
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
buttons={showOperateBtn ? btns : []}
>
-
+
*/}
-
{
- this.state.editSlideVisible &&
+ this.state.editSlideVisible &&
}
-
+
}
onClose={() => this.setState({editSlideVisible: false})}
showMask={true}
closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
}
{
- this.state.importVisible &&
{
this.handleInitModal()
}}
@@ -347,11 +347,11 @@ export default class Archives extends React.Component {
previewImport={(params) => {this.handlePreviewImport(params)}}
importFile={(params) => {this.handleImport(params);}}
templateLink={() => {this.handleTemplateLinkClick()}}
- visiable={this.state.importVisible}
+ visiable={this.state.importVisible}
onCancel={() => {
this.handleImportCancel()
-
- }}
+
+ }}
/>
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
index b798750e..7bb05678 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
@@ -1,23 +1,22 @@
import React from "react";
import { inject, observer } from "mobx-react";
-import { toJS } from "mobx";
-import { Button, Table, Dropdown, Menu, Modal, message, Spin } from "antd";
+import { Button, DatePicker, Dropdown, Menu, message, Modal } from "antd";
-import { WeaTop, WeaTab, WeaRightMenu, WeaDatePicker, WeaTable } from "ecCom";
+import { WeaRightMenu, WeaTop } from "ecCom";
-import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
-import CustomTab from "../../../components/customTab";
-import ContentWrapper from "../../../components/contentWrapper";
+import { renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
import Accountdialog from "./components/accountDialog";
import AbnormalDrawer from "./components/abnormalDrawer";
-import CustomPaginationTable from '../../../components/customPaginationTable'
+import CustomPaginationTable from "../../../components/customPaginationTable";
import moment from "moment";
import _ from "lodash";
// import { columns, dataSource } from './columns';
import "./index.less";
+const MonthPicker = DatePicker.MonthPicker;
+
@inject("standingBookStore", "taxAgentStore")
@observer
export default class StandingBook extends React.Component {
@@ -27,8 +26,8 @@ export default class StandingBook extends React.Component {
value: "",
selectedKey: "0",
tableParams: {
- startTime: moment(new Date()).subtract(5,'months').startOf('month').format('YYYY-MM'),
- endTime: moment(new Date()).startOf('month').format('YYYY-MM')
+ startTime: moment(new Date()).startOf("year").format("YYYY-MM"),
+ endTime: moment(new Date()).startOf("month").format("YYYY-MM")
},
current: 1,
dialogProps: {
@@ -39,64 +38,74 @@ export default class StandingBook extends React.Component {
},
drawerProps: {
title: "",
- visible: false,
+ visible: false
},
tableData: {
list: [],
columns: [],
- total: 0,
+ total: 0
},
dbnormalTableData: {
list: [],
- total: 0,
+ total: 0
},
adminData: {}
};
- this.payload = {}
- this.pageInfo = {current: 1, pageSize: 10}
+ this.payload = {};
+ this.pageInfo = { current: 1, pageSize: 10 };
}
componentDidMount() {
+ this.init();
+ }
+
+ init = () => {
const { current, dialogProps } = this.state;
-
- const { taxAgentStore: {getPermission, fetchTaxAgentOption}, standingBookStore: {getAdminTaxAgentList}} = this.props
- getPermission().then(({status, data}) => {
- if(status) {
- this.setState({adminData : data})
- if(data.isOpenDevolution) {
+ const {
+ taxAgentStore: { getPermission, fetchTaxAgentOption },
+ standingBookStore: { getAdminTaxAgentList }
+ } = this.props;
+ getPermission().then(({ status, data }) => {
+ if (status) {
+ this.setState({ adminData: data });
+ if (data.isOpenDevolution) {
getAdminTaxAgentList().then((data) => {
let taxAgentList = data.map(item => {
- let result = {}
- result.showname = item.name
- result.key = item.id + ""
- result.selected = false
- return result
- })
- this.setState({dialogProps: {
- ...dialogProps,
- options: taxAgentList,
- isAdmin: true
- }})
- })
- }else{
- fetchTaxAgentOption().then(({data}) => {
+ let result = {};
+ result.showname = item.name;
+ result.key = item.id + "";
+ result.selected = false;
+ return result;
+ });
+ this.setState({
+ dialogProps: {
+ ...dialogProps,
+ options: taxAgentList,
+ isAdmin: true
+ }
+ });
+ });
+ } else {
+ fetchTaxAgentOption().then(({ data }) => {
let taxAgentList = data.map(item => {
- let result = {}
- result.showname = item.content
- result.key = item.id + ""
- result.selected = false
- return result
- })
- this.setState({dialogProps: {
- ...dialogProps,
- options: taxAgentList,
- }})
- })
+ let result = {};
+ result.showname = item.content;
+ result.key = item.id + "";
+ result.selected = false;
+ return result;
+ });
+ this.setState({
+ dialogProps: {
+ ...dialogProps,
+ options: taxAgentList
+ }
+ });
+ });
}
this.getCommonList({ ...this.state.tableParams, current });
}
- })
- }
+ });
+ };
getCommonList = (payload = {}) => {
const { getCommonList } = this.props.standingBookStore;
@@ -115,7 +124,7 @@ export default class StandingBook extends React.Component {
{text}
);
- },
+ }
};
}
return { ...it };
@@ -129,18 +138,25 @@ export default class StandingBook extends React.Component {
title: "操作",
dataIndex: "action",
key: "action",
- fixed: 'right',
+ fixed: "right",
render: (text, r) => {
const { billStatus, billMonth } = r;
return (
{billStatus === "未归档" && (
this.handleGoDetail(billMonth, "", r.paymentOrganizationId)}>
- {" "}
- 核算{" "}
+ 核算
+
+ )}
+ {billStatus === "已归档" && (
+ this.socialSecurityBenefitsRecalculate({ id: r.id })}>
+ 重新核算
)}
{billStatus === "未归档" && (
@@ -156,7 +172,7 @@ export default class StandingBook extends React.Component {
{/* 操作日志 */}
}>
-
+
)}
{billStatus === "已归档" && (
@@ -164,56 +180,66 @@ export default class StandingBook extends React.Component {
overlay={
}>
-
+
)}
);
- },
- } : {},
+ }
+ } : {}
],
- total,
+ total
},
- current: pageNum,
+ current: pageNum
});
});
};
+ socialSecurityBenefitsRecalculate = (params) => {
+ const { socialSecurityBenefitsRecalculate } = this.props.standingBookStore;
+ socialSecurityBenefitsRecalculate(params).then(() => {
+ message.success("重新核算成功");
+ this.init();
+ }).catch(err => {
+ message.error(err);
+ });
+ };
+
// 异常详情列表
inspectList = (payload) => {
const { inspectList } = this.props.standingBookStore;
this.payload = payload;
- inspectList({ ...payload }).then(({list, total}) => {
+ inspectList({ ...payload }).then(({ list, total }) => {
this.setState({
dbnormalTableData: {
list,
total
}
- })
+ });
});
};
// 异常详情分页回调
handlePageChange(value) {
- const { inspectList} = this.props.standingBookStore;
- inspectList({ ...this.payload, current: value }).then(({list, total}) => {
+ const { inspectList } = this.props.standingBookStore;
+ inspectList({ ...this.payload, current: value }).then(({ list, total }) => {
this.setState({
dbnormalTableData: {
list,
total
}
- })
+ });
});
}
handleGoDetail = (billMonth, detail, paymentOrganization) => {
- if(detail) {
+ if (detail) {
window.open(
`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=${detail}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`
);
@@ -222,13 +248,13 @@ export default class StandingBook extends React.Component {
`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`
);
}
-
+
setTimeout(() => {
this.getCommonList({
...this.state.tableParams,
- current: this.state.current,
+ current: this.state.current
});
- }, 3000)
+ }, 3000);
};
handleOperate = (payload) => {
const { siaccountFile, siaccountDelete, deleteLoading } =
@@ -245,7 +271,8 @@ export default class StandingBook extends React.Component {
this.getCommonList({ ...this.state.tableParams, current });
});
},
- onCancel: () => {},
+ onCancel: () => {
+ }
});
break;
case "detail":
@@ -254,8 +281,8 @@ export default class StandingBook extends React.Component {
drawerProps: {
...this.state.drawerProps,
title: "核算异常",
- visible: true,
- },
+ visible: true
+ }
});
break;
case "delete":
@@ -268,11 +295,12 @@ export default class StandingBook extends React.Component {
message.success("删除成功");
this.getCommonList({
...this.state.tableParams,
- current: this.state.current,
+ current: this.state.current
});
});
},
- onCancel: () => {},
+ onCancel: () => {
+ }
});
break;
case "view":
@@ -288,14 +316,14 @@ export default class StandingBook extends React.Component {
console.log("extra:", extra);
const payload = {
billMonth: moment(billMonth).format("YYYY-MM"),
- ...extra,
+ ...extra
};
save(payload).then(() => {
message.success("核算成功");
this.handleClose();
this.getCommonList({
...this.state.tableParams,
- current: this.state.current,
+ current: this.state.current
});
this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "");
});
@@ -306,8 +334,8 @@ export default class StandingBook extends React.Component {
dialogProps: {
...this.state.dialogProps,
title: "",
- visible: false,
- },
+ visible: false
+ }
});
};
@@ -315,29 +343,29 @@ export default class StandingBook extends React.Component {
this.setState({
tableParams: {
...this.state.tableParams,
- [type]: val,
- },
+ [type]: val && moment(val).format("YYYY-MM")
+ }
});
this.getCommonList({
...this.state.tableParams,
- [type]: val,
- current: this.state.current,
+ [type]: val && moment(val).format("YYYY-MM"),
+ current: this.state.current
});
};
handlePageChange(value) {
- this.setState({current: value})
+ this.setState({ current: value });
this.pageInfo.current = value;
this.getCommonList({
...this.state.tableParams,
- ...this.pageInfo,
+ ...this.pageInfo
});
}
handleShowSizeChange(pageInfo) {
this.getCommonList({
...this.state.tableParams,
- ...pageInfo,
+ ...pageInfo
});
}
@@ -353,7 +381,7 @@ export default class StandingBook extends React.Component {
showSearchAd,
getTableDatas,
doSearch,
- setShowSearchAd,
+ setShowSearchAd
} = standingBookStore;
const { list, columns, total } = this.state.tableData;
const { startTime, endTime } = this.state.tableParams;
@@ -376,8 +404,8 @@ export default class StandingBook extends React.Component {
dialogProps: {
...this.state.dialogProps,
title: "核算",
- visible: true,
- },
+ visible: true
+ }
});
}}>
核算
@@ -385,12 +413,12 @@ export default class StandingBook extends React.Component {
];
const rightMenu = [
// 右键菜单
- {
- key: "BTN_COLUMN",
- icon:
,
- content: "显示列定制",
- onClick: this.showColumn,
- },
+ // {
+ // key: "BTN_COLUMN",
+ // icon:
,
+ // content: "显示列定制",
+ // onClick: this.showColumn,
+ // },
];
const collectParams = {
// 收藏功能配置
@@ -398,38 +426,7 @@ export default class StandingBook extends React.Component {
favouritetype: 1,
objid: 0,
link: "wui/index.html#/ns_demo03/index",
- importantlevel: 1,
- };
- const adBtn = [
- // 高级搜索内部按钮
-
,
-
,
-
,
- ];
-
- const topTab = [];
-
- const renderSearchOperationItem = () => {
- return
;
- };
-
- const pagination = {
- total,
- current: this.state.current,
- showTotal: (total) => `共 ${total} 条`,
- onChange: (current) => {
- this.setState({ current });
- this.getCommonList({
- ...this.state.tableParams,
- current,
- });
- },
+ importantlevel: 1
};
return (
@@ -440,7 +437,7 @@ export default class StandingBook extends React.Component {
>
} // 左侧图标
+ icon={
} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
buttons={showOperateBtn ? rightBtns : []}
// showDropIcon={true} // 是否显示下拉按钮
@@ -449,37 +446,43 @@ export default class StandingBook extends React.Component {
>
账单月份:
-
{
+ return current && endTime && current.getTime() > new Date(endTime).getTime();
+ }}
onChange={(val) => this.handleChangeMonth("startTime", val)}
/>
至
- {
+ return current && startTime && current.getTime() < new Date(startTime).getTime();
+ }}
onChange={(val) => this.handleChangeMonth("endTime", val)}
/>
-
it.dataIndex !== "id").map(item => {
- item.width = "150px"
- if(item.dataIndex ==='billMonth') item.fixed= 'left';
- return item
+ item.width = "150px";
+ if (item.dataIndex === "billMonth") item.fixed = "left";
+ return item;
})}
dataSource={list}
total={total}
current={this.state.current}
pageSize={this.pageInfo.pageSize}
onPageChange={(value) => {
- this.handlePageChange(value)
+ this.handlePageChange(value);
}}
onShowSizeChange={(current, pageSize) => {
- this.pageInfo = {current, pageSize}
- this.handleShowSizeChange(this.pageInfo)
+ this.pageInfo = { current, pageSize };
+ this.handleShowSizeChange(this.pageInfo);
}}
- scroll={{x: 2300}}
+ scroll={{ x: 2300 }}
/>
{dialogProps.visible && (
@@ -498,14 +501,16 @@ export default class StandingBook extends React.Component {
drawerProps: {
...this.state.drawerProps,
title: "",
- visible: false,
- },
+ visible: false
+ }
});
}}
columns={abnormalColumns}
dataSource={this.state.dbnormalTableData.list}
total={this.state.dbnormalTableData.total}
- onPageChange={(value) => {this.handlePageChange(value)}}
+ onPageChange={(value) => {
+ this.handlePageChange(value);
+ }}
// onOk={this.handleOk}
loading={inspectLoading}
/>
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
index 88bb497b..630b7ac7 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
@@ -11,6 +11,7 @@ import { toJS } from "mobx";
import { WeaDialog, WeaInputSearch, WeaTable } from "ecCom";
import { getSearchs } from "../../../../util";
import { getQueryString } from "../../../../util/url";
+import ProgressModal from "../../../../components/progressModal";
import _ from "lodash";
import "./index.less";
@@ -22,6 +23,7 @@ export default class NormalIndex extends Component {
this.state = {
date: "",
current: 1,
+ pageSize: 10,
selectedRowKeys: [],
addProps: {
title: "",
@@ -32,8 +34,11 @@ export default class NormalIndex extends Component {
columns: [],
total: 0
},
- searchValue: ""
+ searchValue: "",
+ progressVisible: false,
+ progress: 0
};
+ this.timer = null;
}
componentDidMount() {
@@ -44,6 +49,13 @@ export default class NormalIndex extends Component {
: this.getSupplementaryList({ billMonth, current, paymentOrganization });
}
+ componentWillUnmount() {
+ // 清除轮询
+ if (this.timer) {
+ clearInterval(this.timer);
+ }
+ }
+
componentWillReceiveProps(nextProps) {
if (nextProps.selectedKey != this.props.selectedKey) {
const { billMonth, paymentOrganization } = nextProps;
@@ -290,25 +302,42 @@ export default class NormalIndex extends Component {
// 核算按钮点击
handleCommonAccountClick() {
- const { remarks, billMonth, selectedKey, paymentOrganization } = this.props;
+ const { billMonth, selectedKey, paymentOrganization } = this.props;
const { commonAccount } = this.props.standingBookStore;
commonAccount({
billMonth,
paymentOrganization,
includes: []
}).then(() => {
- message.success("核算成功");
- selectedKey === "1"
- ? this.getNormalList({
- billMonth,
- paymentOrganization,
- current: this.state.current
- })
- : this.getSupplementaryList({
- billMonth,
- paymentOrganization,
- current: this.state.current
- });
+ this.setState({
+ progressVisible: true
+ }, () => {
+ this.timer = setInterval(() => {
+ if (this.state.progress !== 100) {
+ this.setState({
+ progress: this.state.progress + 20
+ });
+ } else {
+ clearInterval(this.timer);
+ message.success("核算成功");
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ });
+ selectedKey === "1"
+ ? this.getNormalList({
+ billMonth,
+ paymentOrganization,
+ current: this.state.current
+ })
+ : this.getSupplementaryList({
+ billMonth,
+ paymentOrganization,
+ current: this.state.current
+ });
+ }
+ }, 800);
+ });
});
}
@@ -341,13 +370,31 @@ export default class NormalIndex extends Component {
total,
current: this.state.current,
showTotal: total => `共 ${total} 条`,
- onChange: current => {
- this.setState({ current });
+ showSizeChanger: true,
+ showQuickJumper: true,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ onShowSizeChange: (current, pageSize) => {
+ this.setState({ current, pageSize });
selectedKey === "1"
- ? this.getNormalList({ billMonth, current, paymentOrganization })
+ ? this.getNormalList({ billMonth, current, pageSize, paymentOrganization })
: this.getSupplementaryList({
billMonth,
current,
+ pageSize,
+ paymentOrganization
+ });
+ },
+ onChange: current => {
+ this.setState({ current });
+ selectedKey === "1"
+ ? this.getNormalList({
+ billMonth, current,
+ pageSize: this.state.pageSize, paymentOrganization
+ })
+ : this.getSupplementaryList({
+ billMonth,
+ current,
+ pageSize: this.state.pageSize,
paymentOrganization
});
}
@@ -423,6 +470,14 @@ export default class NormalIndex extends Component {
{selectedKey === "1" && this.props.type !== "detail" && }
+ {/*核算进度条*/}
+ {
+ this.setState({ progressVisible: false, progress: 0 });
+ }}
+ progress={this.state.progress}
+ />
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js
index db56d265..657503f7 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js
@@ -17,6 +17,8 @@ export default class OverViewIndex extends Component {
super(props);
this.state = {
selectedRowKeys: [],
+ current: 1,
+ pageSize: 10,
tableData: {
list: [],
columns: [],
@@ -77,11 +79,22 @@ export default class OverViewIndex extends Component {
const pagination = {
total,
showTotal: (total) => `共 ${total} 条`,
- onShowSizeChange(current, pageSize) {
- console.log("Current: ", current, "; PageSize: ", pageSize);
+ showSizeChanger: true,
+ showQuickJumper: true,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ onShowSizeChange: (current, pageSize) => {
+ this.setState({ current, pageSize });
+ this.getOverViewList({
+ billMonth, current,
+ pageSize, paymentOrganization
+ });
},
- onChange(current) {
- console.log("Current: ", current);
+ onChange: (current) => {
+ this.setState({ current });
+ this.getOverViewList({
+ billMonth, current,
+ pageSize: this.state.pageSize, paymentOrganization
+ });
}
};
return (
diff --git a/pc4mobx/hrmSalary/stores/StandingBook.js b/pc4mobx/hrmSalary/stores/StandingBook.js
index 959874e9..0c836002 100644
--- a/pc4mobx/hrmSalary/stores/StandingBook.js
+++ b/pc4mobx/hrmSalary/stores/StandingBook.js
@@ -4,7 +4,7 @@ import { WeaForm, WeaTableNew } from "comsMobx";
import { removePropertyCondition } from "../util/response";
import _ from "lodash";
-import * as API from "../apis/standingBook"; // 引入API接口文件
+import * as API from "../apis/standingBook";
const { TableStore } = WeaTableNew;
@@ -362,7 +362,19 @@ export class StandingBookStore {
}
})
})
-
+ }
+
+ @action("社保福利台账重新核算")
+ socialSecurityBenefitsRecalculate = (params) => {
+ return new Promise((resolve, reject) => {
+ API.socialSecurityBenefitsRecalculate(params).then(res => {
+ if(res.status) {
+ resolve();
+ } else {
+ reject(res.errormsg || "接口调用失败!");
+ }
+ })
+ })
}
// 获取当前管理员下的所有个税扣缴义务人