Merge branch 'develop' into feature/V2-dev合并多语言
# Conflicts: # pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js # pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js # pc4mobx/hrmSalary/pages/reportView/components/reportContent.js # pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js
This commit is contained in:
commit
96b0768486
|
|
@ -12,6 +12,10 @@ export const getPayrollList = params => {
|
|||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
// 工资单发放进度条
|
||||
export const getPayrollIssuanceProgressBar = (id) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=SALARY_GRANT_PROGRESS_" + id, "get", {});
|
||||
};
|
||||
|
||||
//工资单-获取table提示信息
|
||||
export const getPayrollInfo = params => {
|
||||
|
|
|
|||
|
|
@ -74,3 +74,7 @@ export const statisticsEmployeeList = (params) => {
|
|||
export const statisticsEmployeeDetailList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/report/statistics/employee/detailList", params);
|
||||
};
|
||||
//数据透视-列表查询
|
||||
export const getDataPerspective = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/report/statistics/report/getDataPerspective", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,10 @@ import { getQueryString } from "../../../util/url";
|
|||
import { getSearchs, renderLoading } from "../../../util";
|
||||
import CustomPaginationTable from "../../../components/customPaginationTable";
|
||||
import PayrollPartTable from "./payrollPartTable";
|
||||
import { getPayrollIssuanceProgressBar } from "../../../apis/payroll";
|
||||
import ProgressModal from "../../../components/progressModal";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const { ButtonSelect } = WeaDropdown;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
@inject("payrollStore")
|
||||
|
|
@ -20,6 +23,8 @@ export default class PayrollGrant extends React.Component {
|
|||
selectedRowKeys: [],
|
||||
currentId: "",
|
||||
selectedKey: "0",
|
||||
progressVisible: false,
|
||||
progress: 0,
|
||||
payrollPartModalParams: {
|
||||
visible: false,
|
||||
title: getLabel(538012, "工资单发放"),
|
||||
|
|
@ -28,6 +33,7 @@ export default class PayrollGrant extends React.Component {
|
|||
}
|
||||
};
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
this.timer = null;
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
|
|
@ -66,6 +72,7 @@ export default class PayrollGrant extends React.Component {
|
|||
|
||||
// 发放
|
||||
handleGrant = (record) => {
|
||||
this.setState({ progress: 0 });
|
||||
const { payrollStore } = this.props;
|
||||
const { currentId, selectedKey } = this.state;
|
||||
const { grantPayroll, getInfoList } = payrollStore;
|
||||
|
|
@ -73,14 +80,39 @@ export default class PayrollGrant extends React.Component {
|
|||
...record,
|
||||
salarySendId: currentId
|
||||
}).then(() => {
|
||||
getInfoList({
|
||||
salarySendId: currentId,
|
||||
isGranted: selectedKey !== "0",
|
||||
current: this.pageInfo.current,
|
||||
pageSize: this.pageInfo.pageSize
|
||||
this.setState({ progressVisible: true });
|
||||
if (this.timer) clearInterval(this.timer);
|
||||
this.timer = setInterval(() => {
|
||||
getPayrollIssuanceProgressBar(currentId).then(({ data, status }) => {
|
||||
let progress = data.progress;
|
||||
if (progress === 1 && this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
});
|
||||
message.success(data.message);
|
||||
getInfoList({
|
||||
salarySendId: currentId,
|
||||
isGranted: selectedKey !== "0",
|
||||
current: this.pageInfo.current,
|
||||
pageSize: this.pageInfo.pageSize
|
||||
|
||||
});
|
||||
this.handleClose();
|
||||
});
|
||||
this.handleClose();
|
||||
} else if (!data.status) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
});
|
||||
message.error(data.message);
|
||||
}
|
||||
this.setState({ progress: Number(progress) * 100 });
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -159,6 +191,7 @@ export default class PayrollGrant extends React.Component {
|
|||
};
|
||||
// 全部发送
|
||||
handleGrantAll = () => {
|
||||
this.setState({ progress: 0 });
|
||||
const { payrollStore } = this.props;
|
||||
const { currentId, selectedKey } = this.state;
|
||||
const { grantPayroll, getInfoList } = payrollStore;
|
||||
|
|
@ -166,22 +199,73 @@ export default class PayrollGrant extends React.Component {
|
|||
ids: [],
|
||||
salarySendId: currentId
|
||||
}).then(() => {
|
||||
getInfoList({
|
||||
salarySendId: currentId,
|
||||
isGranted: selectedKey !== "0"
|
||||
});
|
||||
this.setState({ progressVisible: true });
|
||||
if (this.timer) clearInterval(this.timer);
|
||||
this.timer = setInterval(() => {
|
||||
getPayrollIssuanceProgressBar(currentId).then(({ data, status }) => {
|
||||
let progress = data.progress;
|
||||
if (progress === 1 && this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
});
|
||||
message.success(data.message);
|
||||
getInfoList({
|
||||
salarySendId: currentId,
|
||||
isGranted: selectedKey !== "0"
|
||||
});
|
||||
} else if (!data.status) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
});
|
||||
message.error(data.message);
|
||||
}
|
||||
this.setState({ progress: Number(progress) * 100 });
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
};
|
||||
// 发放所选
|
||||
fetchGrantPayRoll = (payload) => {
|
||||
this.setState({ progress: 0 });
|
||||
const { selectedKey, currentId } = this.state;
|
||||
const { payrollStore: { grantPayroll, getInfoList } } = this.props;
|
||||
grantPayroll(payload).then(() => {
|
||||
getInfoList({
|
||||
salarySendId: currentId,
|
||||
isGranted: selectedKey !== "0"
|
||||
});
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
this.setState({ progressVisible: true });
|
||||
if (this.timer) clearInterval(this.timer);
|
||||
this.timer = setInterval(() => {
|
||||
getPayrollIssuanceProgressBar(currentId).then(({ data, status }) => {
|
||||
let progress = data.progress;
|
||||
if (progress === 1 && this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
});
|
||||
message.success(data.message);
|
||||
getInfoList({
|
||||
salarySendId: currentId,
|
||||
isGranted: selectedKey !== "0"
|
||||
});
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
} else if (!data.status) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
});
|
||||
message.error(data.message);
|
||||
}
|
||||
this.setState({ progress: Number(progress) * 100 });
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -218,7 +302,7 @@ export default class PayrollGrant extends React.Component {
|
|||
const { payrollStore } = this.props;
|
||||
const { salaryGrantTableStore: columns, salarySendDetailBaseInfo } = payrollStore;
|
||||
const notShowGrantOrWithdraw = salarySendDetailBaseInfo.haveBackCalc === 1 && salarySendDetailBaseInfo.salaryAcctType === "0";
|
||||
return [
|
||||
return _.map([
|
||||
...toJS(columns),
|
||||
{
|
||||
title: getLabel(30585, "操作"),
|
||||
|
|
@ -226,7 +310,7 @@ export default class PayrollGrant extends React.Component {
|
|||
dataIndex: "",
|
||||
display: true,
|
||||
render: (text, record) => {
|
||||
if (record.sendStatus === getLabel(542605, "已发放") && !notShowGrantOrWithdraw) {
|
||||
if (record.sendStatus === "1" && !notShowGrantOrWithdraw) {
|
||||
return (
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
|
|
@ -245,7 +329,17 @@ export default class PayrollGrant extends React.Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
], item => {
|
||||
if (item.dataIndex === "sendStatus") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
return <span>{record.sendStatus === "0" ? getLabel(111, "未发放") : record.sendStatus === "1" ? getLabel(111, "已发放") : getLabel(111, "已撤回")}</span>;
|
||||
}
|
||||
};
|
||||
}
|
||||
return { ...item };
|
||||
});
|
||||
};
|
||||
|
||||
getSearchsAdQuick() {
|
||||
|
|
@ -505,6 +599,18 @@ export default class PayrollGrant extends React.Component {
|
|||
onWithdraw={this.handleWithdraw}
|
||||
onGrant={this.handleGrant}
|
||||
/>
|
||||
{
|
||||
this.state.progressVisible &&
|
||||
<ProgressModal
|
||||
visible={this.state.progressVisible}
|
||||
onCancel={() => {
|
||||
this.setState({ progressVisible: false, progress: 0 });
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}}
|
||||
progress={this.state.progress}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import React from "react";
|
||||
import { WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaLocaleProvider } from "ecCom";
|
||||
import { WeaCheckbox, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { getReplenishRuleSetOptions } from "../../../apis/payroll";
|
||||
import { toJS } from "mobx";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
@inject("payrollStore")
|
||||
|
|
@ -32,6 +33,7 @@ export default class BaseInformForm extends React.Component {
|
|||
}, ...toJS(data.salarySobOptions)],
|
||||
request: {
|
||||
...data.templateBaseData,
|
||||
msgStatus: !this.props.id ? "1" : data.templateBaseData.msgStatus,
|
||||
reissueRule: data.templateBaseData.replenishRule ? "1" : "0",
|
||||
...JSON.parse(templateBaseData)
|
||||
}
|
||||
|
|
@ -71,86 +73,99 @@ export default class BaseInformForm extends React.Component {
|
|||
|
||||
render() {
|
||||
const { request, options, replenishRuleOptions } = this.state;
|
||||
const { salarySob, name, description, replenishName, replenishRule, reissueRule } = request;
|
||||
const { salarySob, name, description, replenishName, replenishRule, reissueRule, msgStatus, emailStatus } = request;
|
||||
|
||||
return (
|
||||
<WeaSearchGroup title={getLabel(82743, "基础信息")} items={[]} needTigger showGroup col={1}>
|
||||
<WeaFormItem
|
||||
label={getLabel(538010, "薪资账套")}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
{
|
||||
this.state.inited &&
|
||||
<WeaSelect
|
||||
viewAttr={3}
|
||||
options={options}
|
||||
value={salarySob ? salarySob : ""}
|
||||
style={{ width: 200 }}
|
||||
onChange={value => this.hanldeChange({ salarySob: value })}/>
|
||||
}
|
||||
</WeaFormItem>
|
||||
<WeaFormItem
|
||||
label={getLabel(543584, "工资单模板名称")}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaInput
|
||||
value={name}
|
||||
viewAttr={3}
|
||||
onChange={value => this.hanldeChange({ name: value })}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem
|
||||
label={getLabel(543585, "补发工资单模板名称")}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaInput
|
||||
value={replenishName}
|
||||
viewAttr={3}
|
||||
onChange={value => this.hanldeChange({ replenishName: value })}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem
|
||||
label={getLabel(543586, "补发工资单名单生成规则")}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaSelect
|
||||
options={[{ key: "0", showname: getLabel(332, "全部") }, { key: "1", showname: getLabel(542696, "按规则") }]}
|
||||
value={reissueRule}
|
||||
detailtype={3}
|
||||
viewAttr={3}
|
||||
onChange={value => this.hanldeChange({ reissueRule: value })}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
{
|
||||
reissueRule !== "0" &&
|
||||
<React.Fragment>
|
||||
<WeaSearchGroup title="基础信息" items={[]} needTigger showGroup col={1} className="payrollBaseInfoWrapper">
|
||||
<WeaFormItem
|
||||
label={getLabel(126876, "规则设置")}
|
||||
label="薪资账套"
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
{
|
||||
this.state.inited &&
|
||||
<WeaSelect
|
||||
viewAttr={3}
|
||||
options={options}
|
||||
value={salarySob ? salarySob : ""}
|
||||
style={{ width: 200 }}
|
||||
onChange={value => this.hanldeChange({ salarySob: value })}/>
|
||||
}
|
||||
</WeaFormItem>
|
||||
<WeaFormItem
|
||||
label="工资单模板名称"
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaInput
|
||||
value={name}
|
||||
viewAttr={3}
|
||||
onChange={value => this.hanldeChange({ name: value })}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem
|
||||
label="补发工资单模板名称"
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaInput
|
||||
value={replenishName}
|
||||
viewAttr={3}
|
||||
onChange={value => this.hanldeChange({ replenishName: value })}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem
|
||||
label="补发工资单名单生成规则"
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaSelect
|
||||
options={replenishRuleOptions}
|
||||
value={replenishRule}
|
||||
options={[{ key: "0", showname: "全部" }, { key: "1", showname: "按规则" }]}
|
||||
value={reissueRule}
|
||||
detailtype={3}
|
||||
viewAttr={3}
|
||||
onChange={value => this.hanldeChange({ replenishRule: value })}
|
||||
onChange={value => this.hanldeChange({ reissueRule: value })}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
}
|
||||
<WeaFormItem
|
||||
label={getLabel(536726, "备注")}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaInput
|
||||
value={description}
|
||||
onChange={value => this.hanldeChange({ description: value })}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
{
|
||||
reissueRule !== "0" &&
|
||||
<WeaFormItem
|
||||
label="规则设置"
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaSelect
|
||||
options={replenishRuleOptions}
|
||||
value={replenishRule}
|
||||
viewAttr={3}
|
||||
onChange={value => this.hanldeChange({ replenishRule: value })}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
}
|
||||
<WeaFormItem
|
||||
label="备注"
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaInput
|
||||
value={description}
|
||||
onChange={value => this.hanldeChange({ description: value })}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
<WeaSearchGroup title={getLabel(111, "发送设置")} items={[]} needTigger showGroup col={1}
|
||||
className="payrollBaseInfoWrapper">
|
||||
<WeaFormItem label={getLabel(111, "系统消息")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaCheckbox value={msgStatus ? "1" : "0"} display="switch"
|
||||
onChange={value => this.hanldeChange({ msgStatus: value === "1" })}/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label={getLabel(111, "邮件")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaCheckbox value={emailStatus ? "1" : "0"} display="switch"
|
||||
onChange={value => this.hanldeChange({ emailStatus: value === "1" })}/>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,3 +223,15 @@
|
|||
padding: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.payrollBaseInfoWrapper {
|
||||
.wea-form-cell-wrapper {
|
||||
border: 1px solid #e5e5e5;
|
||||
border-bottom: none;
|
||||
|
||||
.wea-form-item {
|
||||
padding: 5px 16px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,3 +48,18 @@
|
|||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.pivot-wrapper {
|
||||
.wea-dialog-body {
|
||||
height: 80vh !important;
|
||||
padding: 16px;
|
||||
|
||||
.wea-new-scroll {
|
||||
height: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 数据透视弹框
|
||||
* Description:
|
||||
* Date: 2023/6/8
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import { Spin } from "antd";
|
||||
import { toJS } from "mobx";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import "./index.less";
|
||||
|
||||
const WeaTableComx = WeaTableNew.WeaTable;
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
@inject("payrollFilesStore")
|
||||
@observer
|
||||
class PovitpivotChartModal extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [],
|
||||
loading: false,
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { id, dimensionId, dimensionValue } = nextProps;
|
||||
this.getDataPerspective({ id, dimensionId, dimensionValue });
|
||||
} else {
|
||||
this.setState({
|
||||
dataSource: [],
|
||||
loading: false,
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
const { dataSource, pageInfo } = this.state;
|
||||
if (type === "init") {
|
||||
const { payrollFilesStore: { pivotTableStore } } = this.props;
|
||||
const columns = _.filter(toJS(pivotTableStore.columns), (item) => item.display === "true" && item.dataIndex !== "randomFieldId");
|
||||
this.postMessageToChild({
|
||||
dataSource, showSum: false, pageInfo, columns
|
||||
});
|
||||
} else if (type === "turn") {
|
||||
if (id === "PAGEINFO") {
|
||||
const { id, dimensionId, dimensionValue } = this.props;
|
||||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () =>
|
||||
this.getDataPerspective({
|
||||
id,
|
||||
dimensionId,
|
||||
dimensionValue
|
||||
}));
|
||||
}
|
||||
}
|
||||
};
|
||||
postMessageToChild = (payload) => {
|
||||
const childFrameObj = document.getElementById("commonTable");
|
||||
const { dataSource, showSum = false, pageInfo, columns } = payload;
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({
|
||||
dataSource, columns, showSum, pageInfo
|
||||
}), "*");
|
||||
};
|
||||
getDataPerspective = (payload) => {
|
||||
const { pageInfo } = this.state;
|
||||
const { payrollFilesStore: { getDataPerspective } } = this.props;
|
||||
this.setState({ loading: true });
|
||||
getDataPerspective({ ...payload, ...pageInfo }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { pageInfo: { list, pageNum: current, pageSize, total } } = data;
|
||||
this.setState({
|
||||
dataSource: list || [],
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getColumns = () => {
|
||||
const { dataSource, pageInfo } = this.state;
|
||||
const { payrollFilesStore: { pivotTableStore } } = this.props;
|
||||
const columns = _.filter(toJS(pivotTableStore.columns), (item) => item.display === "true" && item.dataIndex !== "randomFieldId");
|
||||
this.postMessageToChild({
|
||||
columns, dataSource,
|
||||
showSum: false, pageInfo
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading } = this.state;
|
||||
const { payrollFilesStore: { pivotTableStore } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
title={getLabel(111, "数据透视")} scalable className="pivot-wrapper" initLoadCss
|
||||
visible={this.props.visible} style={{ width: "80vw", height: "80vh" }}
|
||||
buttons={[]} onCancel={this.props.onCancel}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/commonTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/commonTable"
|
||||
id="commonTable"
|
||||
/>
|
||||
</Spin>
|
||||
<WeaTableComx
|
||||
style={{ display: "none" }}
|
||||
comsWeaTableStore={pivotTableStore}
|
||||
needScroll={true}
|
||||
columns={this.getColumns()}
|
||||
/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PovitpivotChartModal;
|
||||
|
|
@ -11,6 +11,7 @@ import RightOptions from "./rightOptions";
|
|||
import ChartsRangeSettingsModal from "./chartsRangeSettingsModal";
|
||||
import { mapBarOptions, mapLineOptions, mapPieOptions } from "./condition";
|
||||
import { queryRangeSetting, reportStatisticsReportGetData } from "../../../apis/statistics";
|
||||
import PovitpivotChartModal from "./povitpivotChartModal";
|
||||
import {i18n} from "../../calculateDetail/userSure"
|
||||
import "../index.less";
|
||||
|
||||
|
|
@ -25,6 +26,10 @@ class ReportContent extends Component {
|
|||
viewType: "dataView",
|
||||
chartsType: "0",
|
||||
chartsInfo: {},
|
||||
povitView: {
|
||||
visible: false, id: "",
|
||||
dimensionId: "", dimensionValue: ""
|
||||
},
|
||||
rangSet: {
|
||||
visible: false, reportId: "",
|
||||
rangeVal: {}
|
||||
|
|
@ -49,7 +54,7 @@ class ReportContent extends Component {
|
|||
}
|
||||
|
||||
handleReceive = ({ data }) => {
|
||||
const { type } = data;
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
const { columns, countResult, dataSource } = this.state;
|
||||
this.postMessageToChild({
|
||||
|
|
@ -57,6 +62,17 @@ class ReportContent extends Component {
|
|||
showSum: !_.isEmpty(countResult)
|
||||
});
|
||||
} else if (type === "turn") {
|
||||
//数据透视弹框
|
||||
if (id === "PIVOTCHART") {
|
||||
const { record } = params;
|
||||
const { dimension: dimensionValue } = record;
|
||||
const { id: pivotId, dimensionId } = this.props.report;
|
||||
this.setState({
|
||||
povitView: {
|
||||
visible: true, id: pivotId, dimensionId, dimensionValue
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
postMessageToChild = (payload) => {
|
||||
|
|
@ -213,7 +229,7 @@ class ReportContent extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { loading, viewType, rangSet, columns } = this.state;
|
||||
const { loading, viewType, rangSet, columns, povitView } = this.state;
|
||||
return (
|
||||
<div className="layoutContent">
|
||||
<div className="layoutBox">
|
||||
|
|
@ -239,6 +255,15 @@ class ReportContent extends Component {
|
|||
onChange={this.queryRangeSetting}
|
||||
onGetData={this.handleGetData}
|
||||
/>
|
||||
{/* 数据透视弹框*/}
|
||||
<PovitpivotChartModal
|
||||
{...povitView}
|
||||
onCancel={() => this.setState({
|
||||
povitView: {
|
||||
visible: false, id: "", dimensionId: "", dimensionValue: ""
|
||||
}
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,9 +224,8 @@ export default class SalaryItem extends React.Component {
|
|||
}
|
||||
|
||||
const handleMenuClick = (e) => {
|
||||
const { salaryItemStore: { getSysItemList, setEditSlideVisible, initRequest } } = this.props;
|
||||
const { salaryItemStore: { setEditSlideVisible, initRequest } } = this.props;
|
||||
if (e.key === "1") {
|
||||
getSysItemList({});
|
||||
setSystemItemVisible(true);
|
||||
} else if (e.key === "2") {
|
||||
this.setState({ editable: true, isAdd: true });
|
||||
|
|
|
|||
|
|
@ -71,6 +71,11 @@
|
|||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding: 16px 20px;
|
||||
|
||||
.wea-tab {
|
||||
width: 100%;
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,82 +1,118 @@
|
|||
import React from "react";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTab } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { getSysItemList, saveSysItem } from "../../apis/item";
|
||||
import UnifiedTable from "../../components/UnifiedTable";
|
||||
import "./index.less";
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("salaryItemStore")
|
||||
@observer
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
export default class SystemSalaryItemModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
searchValue: ""
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
name: "",
|
||||
loading: false,
|
||||
saveLoading: false,
|
||||
selectedRowKeys: [],
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 搜索改变事件
|
||||
handleSearchChange(value) {
|
||||
this.setState({ searchValue: value });
|
||||
componentDidMount() {
|
||||
this.getSysItemList();
|
||||
}
|
||||
|
||||
// 搜索
|
||||
handleSearch(value) {
|
||||
const { salaryItemStore } = this.props;
|
||||
const { getSysItemList } = salaryItemStore;
|
||||
getSysItemList({ name: value });
|
||||
}
|
||||
getSysItemList = () => {
|
||||
this.setState({ loading: true });
|
||||
const { pageInfo, name } = this.state;
|
||||
getSysItemList({ ...pageInfo, name }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
columns, dataSource,
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleAdd = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.info(getLabel(111, "未选择任何条目"));
|
||||
return;
|
||||
}
|
||||
this.setState({ saveLoading: true });
|
||||
saveSysItem(selectedRowKeys).then(({ status, errormsg }) => {
|
||||
this.setState({ saveLoading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "添加成功"));
|
||||
this.setState({ selectedRowKeys: [] }, () => {
|
||||
this.getSysItemList();
|
||||
this.props.onCancel();
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ saveLoading: false }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { salaryItemStore } = this.props;
|
||||
const { sysListTableStore, saveLoading } = salaryItemStore;
|
||||
const { searchValue } = this.state;
|
||||
|
||||
const handleAdd = () => {
|
||||
const { salaryItemStore: { saveSysItem } } = this.props;
|
||||
saveSysItem();
|
||||
const { selectedRowKeys, pageInfo, loading, columns, dataSource, saveLoading } = this.state;
|
||||
const pagination = {
|
||||
current: pageInfo.current,
|
||||
pageSize: pageInfo.pageSize,
|
||||
total: pageInfo.total,
|
||||
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => {
|
||||
this.getSysItemList();
|
||||
});
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => {
|
||||
this.getSysItemList();
|
||||
});
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
|
||||
return (
|
||||
<WeaDialog
|
||||
title={getLabel(543293, "添加系统薪资项目")}
|
||||
initLoadCss
|
||||
className="sys-salary-wrapper"
|
||||
visible={this.props.visible}
|
||||
onCancel={() => {
|
||||
title="添加系统薪资项目"
|
||||
initLoadCss className="sys-salary-wrapper"
|
||||
visible={this.props.visible} onCancel={() => {
|
||||
this.setState({ selectedRowKeys: [] }, () => {
|
||||
this.props.onCancel();
|
||||
}}
|
||||
style={{ width: "60vw" }}
|
||||
});
|
||||
}} style={{ width: "60vw" }} scalable
|
||||
buttons={[
|
||||
<Button
|
||||
type="primary"
|
||||
loading={saveLoading}
|
||||
onClick={() => {
|
||||
handleAdd();
|
||||
}}
|
||||
>{getLabel(384113, "添加")}</Button>
|
||||
<Button type="primary" loading={saveLoading} onClick={this.handleAdd}>添加</Button>
|
||||
]}
|
||||
>
|
||||
<div className="headerSearchWrapper">
|
||||
<WeaInputSearch
|
||||
value={searchValue}
|
||||
placeholder={getLabel(84078, "请输入名称")}
|
||||
onChange={(value) => {
|
||||
this.handleSearchChange(value);
|
||||
}}
|
||||
onSearch={(value) => {
|
||||
this.handleSearch(value);
|
||||
}}/>
|
||||
<WeaTab datas={[]} keyParam="viewcondition" //主键
|
||||
searchType={["base"]} onSearchChange={name => this.setState({ name })}
|
||||
onSearch={this.getSysItemList}
|
||||
/>
|
||||
</div>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={sysListTableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={false} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
// getColumns={this.getColumns}
|
||||
// onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
<UnifiedTable
|
||||
loading={loading}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
rowSelection={rowSelection}
|
||||
xWidth={columns.length * 120}
|
||||
/>
|
||||
</WeaDialog>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -508,17 +508,17 @@ export class payrollStore {
|
|||
@action
|
||||
grantPayroll = (params = {}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
message.destroy();
|
||||
message.loading("正在发放中...", 0);
|
||||
// message.destroy();
|
||||
// message.loading("正在发放中...", 0);
|
||||
this.btnLoading = true;
|
||||
WeaLoadingGlobal.start();
|
||||
// WeaLoadingGlobal.start();
|
||||
API.grantPayroll(params).then(res => {
|
||||
this.btnLoading = false;
|
||||
WeaLoadingGlobal.end();
|
||||
WeaLoadingGlobal.destroy();
|
||||
message.destroy();
|
||||
// WeaLoadingGlobal.end();
|
||||
// WeaLoadingGlobal.destroy();
|
||||
// message.destroy();
|
||||
if (res.status) {
|
||||
message.success("发送成功");
|
||||
// message.success("发送成功");
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "发送失败");
|
||||
|
|
@ -526,8 +526,8 @@ export class payrollStore {
|
|||
}
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
WeaLoadingGlobal.end();
|
||||
WeaLoadingGlobal.destroy();
|
||||
// WeaLoadingGlobal.end();
|
||||
// WeaLoadingGlobal.destroy();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
import { action, observable } from "mobx";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import * as API from "../apis/payrollFiles";
|
||||
import { statisticsEmployeeDetailList } from "../apis/statistics";
|
||||
import { statisticsEmployeeDetailList, getDataPerspective } from "../apis/statistics";
|
||||
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
export class PayrollFilesStore {
|
||||
@observable tableStore = new TableStore();
|
||||
@observable employeeTableStore = new TableStore();
|
||||
@observable pivotTableStore = new TableStore();
|
||||
|
||||
@action("薪资档案-列表查询")
|
||||
queryList = (payload = {}, searchItemsValue = {}, url = "") => {
|
||||
|
|
@ -48,4 +50,21 @@ export class PayrollFilesStore {
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
@action("报表查看-数据透视")
|
||||
getDataPerspective = (payload) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
getDataPerspective(payload).then(res => {
|
||||
const { data, status } = res;
|
||||
if (status) {
|
||||
const { dataKey } = data;
|
||||
const { datas } = dataKey;
|
||||
this.pivotTableStore.getDatas(datas); // table 请求数据
|
||||
}
|
||||
resolve(res);
|
||||
}).catch(() => {
|
||||
reject();
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue