feature/2.9.42309.01-薪酬统计报表分享报表
This commit is contained in:
parent
f5d42d8f75
commit
10c7280b43
|
|
@ -78,3 +78,31 @@ export const statisticsEmployeeDetailList = (params) => {
|
|||
export const getDataPerspective = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/report/statistics/report/getDataPerspective", params);
|
||||
};
|
||||
//报表分享-确认分享
|
||||
export const salaryStatisticsPushSendMsg = (params) => {
|
||||
return postFetch("/api/bs/salaryreport/salary/statistics/push/sendMsg", params);
|
||||
};
|
||||
//报表分享-表单数据
|
||||
export const salaryStatisticsPushGetForm = (params) => {
|
||||
return WeaTools.callApi("/api/bs/salaryreport/salary/statistics/push/getForm", "GET", params);
|
||||
};
|
||||
//报表记录-全部撤回
|
||||
export const salaryStatisticsPushcancelAll = (params) => {
|
||||
return WeaTools.callApi("/api/bs/salaryreport/salary/statistics/push/cancelAll", "GET", params);
|
||||
};
|
||||
//报表记录-撤回单条记录
|
||||
export const salaryStatisticsPushcancel = (params) => {
|
||||
return WeaTools.callApi("/api/bs/salaryreport/salary/statistics/push/cancel", "GET", params);
|
||||
};
|
||||
//报表记录-列表数据
|
||||
export const salaryStatisticsPushGetTable = (params) => {
|
||||
return postFetch("/api/bs/salaryreport/salary/statistics/push/getTable", params);
|
||||
};
|
||||
//报表记录-查看分享记录详情
|
||||
export const salaryStatisticsPushGetDetail = (params) => {
|
||||
return postFetch("/api/bs/salaryreport/salary/statistics/push/getDetail", params);
|
||||
};
|
||||
//报表记录-追加被分享人
|
||||
export const salaryStatisticsPushAddSharedSendMsg = (params) => {
|
||||
return postFetch("/api/bs/salaryreport/salary/statistics/push/addSharedSendMsg", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -152,6 +152,185 @@ export const condition = [
|
|||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const shareCondition = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
checkbox: false,
|
||||
checkboxValue: false,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["reportIds"],
|
||||
fieldcol: 12,
|
||||
label: "分享报表",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
options: [],
|
||||
multiple: true,
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
checkbox: false,
|
||||
checkboxValue: false,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["pushTitle"],
|
||||
fieldcol: 18,
|
||||
label: "主题",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
type: "17",
|
||||
viewAttr: 3
|
||||
},
|
||||
colSpan: 1,
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["sharedBy"],
|
||||
fieldcol: 14,
|
||||
isQuickSearch: false,
|
||||
label: "被分享人",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "RANGEPICKER",
|
||||
domkey: ["startTime", "endTime"],
|
||||
fieldcol: 12,
|
||||
label: "报表查看有效时间",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
checkbox: false,
|
||||
checkboxValue: false,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["mark"],
|
||||
fieldcol: 18,
|
||||
label: "分享说明",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
viewAttr: 2
|
||||
}
|
||||
// {
|
||||
// colSpan: 1,
|
||||
// conditionType: "SWITCH",
|
||||
// domkey: ["remind"],
|
||||
// fieldcol: 12,
|
||||
// isQuickSearch: false,
|
||||
// label: "已查看提醒",
|
||||
// lanId: 111,
|
||||
// labelcol: 6,
|
||||
// viewAttr: 2
|
||||
// }
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const sharePersonCondition = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
type: "17",
|
||||
viewAttr: 3
|
||||
},
|
||||
colSpan: 1,
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["sharedBy"],
|
||||
fieldcol: 14,
|
||||
isQuickSearch: false,
|
||||
label: "被分享人",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const shareLogCondition = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["reportName"],
|
||||
fieldcol: 12,
|
||||
label: "分享报表",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["effectiveTime"],
|
||||
fieldcol: 12,
|
||||
label: "报表查看有效时间",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["remark"],
|
||||
fieldcol: 12,
|
||||
label: "分享说明",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
viewAttr: 1
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
||||
const colorList = ["#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81"];
|
||||
export const mapBarOptions = (params) => ({
|
||||
|
|
@ -292,7 +471,7 @@ export const mapBarOptions = (params) => ({
|
|||
{
|
||||
type: "slider",
|
||||
show: true,
|
||||
bottom: 20,
|
||||
bottom: 20
|
||||
}
|
||||
]
|
||||
});
|
||||
|
|
|
|||
|
|
@ -63,3 +63,134 @@
|
|||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.shareDialogWrapper {
|
||||
.wea-dialog-body {
|
||||
background: #f6f6f6;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.wea-search-group {
|
||||
border: 1px solid #e5e5e5;
|
||||
border-bottom: none;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.wea-search-group, .wea-content, .wea-form-cell {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.wea-form-item {
|
||||
padding: 8px 16px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.wea-select, .ant-select, .ant-select-selection {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wea-select .wea-select-input .arrow {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
top: 8px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.wea-select .wdb {
|
||||
word-break: break-all !important;
|
||||
word-wrap: break-word !important;
|
||||
}
|
||||
|
||||
.wea-select .wea-select-input {
|
||||
height: 30px;
|
||||
white-space: nowrap;
|
||||
min-width: 100px;
|
||||
max-width: 345px;
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
padding: 4px 17px 4px 4px;
|
||||
position: relative;
|
||||
min-height: 30px;
|
||||
border: 1px solid #d9d9d9;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.shareLogGroupWrapper {
|
||||
margin-top: 16px;
|
||||
|
||||
.logtitleHeader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shareRecordWrapper {
|
||||
z-index: 111;
|
||||
|
||||
.wea-slide-modal-title {
|
||||
height: auto !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.titleDialog {
|
||||
display: flex;
|
||||
padding: 10px 16px 10px 0;
|
||||
position: relative;
|
||||
background-color: #FFF;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
|
||||
.titleCol {
|
||||
flex: 1;
|
||||
|
||||
.titleLeftBox {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
padding-left: 16px;
|
||||
|
||||
.titleIcon {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14A2D;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-tbody {
|
||||
& > tr {
|
||||
& > td {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,139 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 分享记录
|
||||
* Description:
|
||||
* Date: 2023/9/19
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { shareCondition } from "./condition";
|
||||
import { getSearchs } from "../../../util";
|
||||
import { salaryStatisticsPushGetForm, salaryStatisticsPushSendMsg } from "../../../apis/statistics";
|
||||
import "./index.less";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
@inject("attendanceStore")
|
||||
@observer
|
||||
class SalaryStatisticsDetailShareDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
conditions: [], loading: false
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
const { attendanceStore: { initShareForm } } = nextProps;
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.salaryStatisticsPushGetForm(nextProps);
|
||||
} else {
|
||||
initShareForm();
|
||||
}
|
||||
}
|
||||
|
||||
salaryStatisticsPushGetForm = (props) => {
|
||||
const { attendanceStore: { shareForm } } = props;
|
||||
salaryStatisticsPushGetForm().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { reportOptions } = data;
|
||||
this.setState({
|
||||
conditions: _.map(shareCondition, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, o => {
|
||||
if (getKey(o) === "sharedBy") {
|
||||
return {
|
||||
...o,
|
||||
helpfulTitle: getLabel(111, "被分享人收到您分享的报表后,会默认赋予您的数据权限,但还需要有【薪酬统计分析】的菜单权限才可以查看报表。菜单权限设置路径:后台管理中心-【权限管理中心】-【角色设置】,建议创建一个仅查看报表的角色,这个角色只有薪酬管理模块的【薪酬统计分析】菜单权限。\n" +
|
||||
"为了避免所选的人同名导致选错人,可在后台管理中心-【组织架构设置】-【浏览框显示字段定义】中人员浏览框的显示字段多勾选几个能区别人员的字段")
|
||||
};
|
||||
} else if (getKey(o) === "startTime__endTime") {
|
||||
return {
|
||||
...o,
|
||||
helpfulTitle: getLabel(111, "有效时间之外,被分享人无法查看您分享的报表")
|
||||
};
|
||||
} else if (getKey(o) === "remind") {
|
||||
return {
|
||||
...o,
|
||||
helpfulTitle: getLabel(111, "开启后,被分享人查看报表时,系统自动通过系统消息提醒分享人。")
|
||||
};
|
||||
} else if (getKey(o) === "reportIds") {
|
||||
return {
|
||||
...o,
|
||||
options: _.map(reportOptions, it => ({ key: it.id, showname: it.reportName }))
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
shareForm.initFormFields(this.state.conditions);
|
||||
shareForm.updateFields({ pushTitle: data["pushTitle"] || "" });
|
||||
shareForm.updateFields({ mark: data["mark"] || "" });
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
salaryStatisticsPushSendMsg = () => {
|
||||
const { attendanceStore: { shareForm } } = this.props;
|
||||
shareForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const { sharedBy, reportIds, ...extraFormparams } = shareForm.getFormParams();
|
||||
const payload = {
|
||||
sharedBy: sharedBy.split(","),
|
||||
reportIds: reportIds.split(","),
|
||||
...extraFormparams
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
salaryStatisticsPushSendMsg(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "分享成功"));
|
||||
this.props.onCancel();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { attendanceStore: { shareForm } } = this.props;
|
||||
const { conditions, loading } = this.state;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props}
|
||||
hasScroll initLoadCss title={getLabel(111, "分享报表")}
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.salaryStatisticsPushSendMsg}
|
||||
loading={loading}>{getLabel(111, "确认分享")}</Button>
|
||||
]}
|
||||
className="shareDialogWrapper"
|
||||
style={{
|
||||
width: 750,
|
||||
height: 275.6,
|
||||
minHeight: 200,
|
||||
minWidth: 380,
|
||||
maxHeight: "60%",
|
||||
maxWidth: "60%",
|
||||
overflow: "hidden",
|
||||
transform: "translate(0px, 0px)"
|
||||
}}
|
||||
>
|
||||
<div style={{ padding: 16, overflowY: "auto" }}>
|
||||
{getSearchs(shareForm, conditions, 1, false)}
|
||||
</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryStatisticsDetailShareDialog;
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 分享记录-查看分享记录详情
|
||||
* Description:
|
||||
* Date: 2023/9/19
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import {
|
||||
WeaButtonIcon,
|
||||
WeaDialog,
|
||||
WeaHelpfulTip,
|
||||
WeaInputSearch,
|
||||
WeaLocaleProvider,
|
||||
WeaSearchGroup,
|
||||
WeaTable,
|
||||
WeaTools
|
||||
} from "ecCom";
|
||||
import { message, Modal } from "antd";
|
||||
import { shareLogCondition } from "./condition";
|
||||
import { getConditionDomkeys, getSearchs } from "../../../util";
|
||||
import { salaryStatisticsPushcancel, salaryStatisticsPushGetDetail } from "../../../apis/statistics";
|
||||
import SalaryStatisticsDetailSharePersonDialog from "./salaryStatisticsDetailSharePersonDialog";
|
||||
import "./index.less";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
@inject("attendanceStore")
|
||||
@observer
|
||||
class SalaryStatisticsDetailShareLogDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
conditions: [], loading: false, dataSource: [], columns: [],
|
||||
userNameSearch: "", sharePerDialog: { visible: false, id: "" }
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
const { attendanceStore: { initShareLogForm } } = nextProps;
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.salaryStatisticsPushGetDetail(nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
initShareLogForm();
|
||||
}
|
||||
}
|
||||
|
||||
renderShareLogTitle = () => {
|
||||
return <div className="logtitleHeader">
|
||||
<div className="titleText">
|
||||
<span style={{ marginRight: 10 }}>{getLabel(111, "被分享人")}</span>
|
||||
<WeaHelpfulTip width={200} placement="topLeft"
|
||||
title={getLabel(111, "被分享人收到您分享的报表后,会默认赋予您的数据权限,但还需要有【薪酬统计分析】的菜单权限才可以查看报表。菜单权限设置路径:后台管理中心-【权限管理中心】-【角色设置】,建议创建一个仅查看报表的角色,这个角色只有薪酬管理模块的【薪酬统计分析】菜单权限。\n" +
|
||||
"为了避免所选的人同名导致选错人,可在后台管理中心-【组织架构设置】-【浏览框显示字段定义】中人员浏览框的显示字段多勾选几个能区别人员的字段")}
|
||||
/>
|
||||
</div>
|
||||
<div className="right">
|
||||
<WeaButtonIcon buttonType="add" type="primary" style={{ marginRight: 10 }}
|
||||
onClick={() => this.setState({
|
||||
sharePerDialog: {
|
||||
...this.state.sharePerDialog,
|
||||
visible: true, id: this.props.id
|
||||
}
|
||||
})}/>
|
||||
<WeaInputSearch value={this.state.userNameSearch} onChange={v => this.setState({ userNameSearch: v })}
|
||||
onSearch={() => this.salaryStatisticsPushGetDetail(this.props)}
|
||||
/>
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
salaryStatisticsPushGetDetail = (props) => {
|
||||
const { userNameSearch } = this.state;
|
||||
const { attendanceStore: { shareLogForm }, id } = props;
|
||||
this.setState({ loading: true });
|
||||
salaryStatisticsPushGetDetail({ id, userNameSearch }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { detailForm, detailTable } = data;
|
||||
const { columns, list: dataSource } = detailTable;
|
||||
this.setState({
|
||||
columns, dataSource,
|
||||
conditions: _.map(shareLogCondition, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, o => {
|
||||
if (getKey(o) === "effectiveTime") {
|
||||
return {
|
||||
...o,
|
||||
helpfulTitle: getLabel(111, "有效时间之外,被分享人无法查看您分享的报表")
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
shareLogForm.initFormFields(this.state.conditions);
|
||||
getConditionDomkeys(this.state.conditions).map(key => {
|
||||
shareLogForm.updateFields({
|
||||
[key]: detailForm[key] || ""
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
salaryStatisticsPushcancel = (id) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(111, "确定要全部撤回吗?"),
|
||||
onOk: () => {
|
||||
salaryStatisticsPushcancel({ id }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(505793, "撤回成功!"));
|
||||
this.salaryStatisticsPushGetDetail(this.props);
|
||||
this.props.onGetTable();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { attendanceStore: { shareLogForm } } = this.props;
|
||||
const { conditions, dataSource, columns, loading, sharePerDialog } = this.state;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props}
|
||||
hasScroll initLoadCss title={getLabel(111, "查看分享记录详情")}
|
||||
className="shareDialogWrapper"
|
||||
style={{
|
||||
width: 850,
|
||||
height: 506.6,
|
||||
minHeight: 200,
|
||||
minWidth: 380,
|
||||
maxHeight: "60%",
|
||||
maxWidth: "60%",
|
||||
overflow: "hidden",
|
||||
transform: "translate(0px, 0px)"
|
||||
}}
|
||||
>
|
||||
<div style={{ padding: 16, overflowY: "auto" }}>
|
||||
{getSearchs(shareLogForm, conditions, 1, false)}
|
||||
<WeaSearchGroup title={this.renderShareLogTitle()} showGroup needTigger className="shareLogGroupWrapper">
|
||||
<WeaTable
|
||||
rowKey="id" dataSource={dataSource} pagination={false} loading={loading}
|
||||
columns={[
|
||||
...columns,
|
||||
{
|
||||
dataIndex: "operate",
|
||||
width: 120,
|
||||
title: <React.Fragment>
|
||||
<span style={{ marginRight: 10 }}>{getLabel(30585, "操作")}</span>
|
||||
<WeaHelpfulTip width={200} placement="topLeft"
|
||||
title={
|
||||
<div>
|
||||
<p>{getLabel(111, "1、分享状态为成功且撤回状态为空时,可操作撤回;")}</p>
|
||||
<p>{getLabel(111, "2、撤回后不可重新分享;")}</p>
|
||||
<p>{getLabel(111, "3、分享状态为失败,可操作重新分享;")}</p>
|
||||
<p>{getLabel(111, "4、重新分享:以当前分享记录的分享报表、有效时间、渠道和说明重新分享,分享后自动刷新分享时间和分享状态")}</p>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</React.Fragment>,
|
||||
render: (__, record) => (_.isEmpty(record.rebackStatus) ?
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.salaryStatisticsPushcancel(record.id)}>{getLabel(32025, "撤回")}</a> : null)
|
||||
}
|
||||
]}
|
||||
/>
|
||||
<SalaryStatisticsDetailSharePersonDialog
|
||||
{...sharePerDialog}
|
||||
onCancel={() => this.setState({ sharePerDialog: { ...sharePerDialog, visible: false, id: "" } })}
|
||||
onGetTable={() => {
|
||||
this.salaryStatisticsPushGetDetail(this.props);
|
||||
this.props.onGetTable();
|
||||
}}
|
||||
/>
|
||||
</WeaSearchGroup>
|
||||
</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryStatisticsDetailShareLogDialog;
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { salaryStatisticsPushAddSharedSendMsg } from "../../../apis/statistics";
|
||||
import { sharePersonCondition } from "./condition";
|
||||
import { getSearchs } from "../../../util";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
@inject("attendanceStore")
|
||||
@observer
|
||||
class SalaryStatisticsDetailSharePersonDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
conditions: [], loading: false
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
const { attendanceStore: { initSharePerForm, sharePerForm } } = nextProps;
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
sharePerForm.initFormFields(sharePersonCondition);
|
||||
} else {
|
||||
initSharePerForm();
|
||||
}
|
||||
}
|
||||
|
||||
save = () => {
|
||||
const { attendanceStore: { sharePerForm }, id } = this.props;
|
||||
sharePerForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const { sharedBy } = sharePerForm.getFormParams();
|
||||
const payload = {
|
||||
id, sharedBy: sharedBy.split(",")
|
||||
};
|
||||
salaryStatisticsPushAddSharedSendMsg(payload)
|
||||
.then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.props.onCancel();
|
||||
this.props.onGetTable();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
})
|
||||
.catch(() => this.setState({ loading: false }));
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { attendanceStore: { sharePerForm }, loading } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props}
|
||||
hasScroll initLoadCss title={getLabel(111, "追加被分享人")}
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "保存并分享")}</Button>
|
||||
]}
|
||||
style={{ width: 600, height: 100 }}
|
||||
>
|
||||
{getSearchs(sharePerForm, sharePersonCondition, 1, false)}
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryStatisticsDetailSharePersonDialog;
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 统计报表-分享记录
|
||||
* Description:
|
||||
* Date: 2023/9/19
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaTable } from "ecCom";
|
||||
import { message, Modal } from "antd";
|
||||
import { salaryStatisticsPushcancelAll, salaryStatisticsPushGetTable } from "../../../apis/statistics";
|
||||
import SalaryStatisticsDetailShareLogDialog from "./salaryStatisticsDetailShareLogDialog";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
class SalaryStatisticsDetailShareRecord extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, dataSource: [], columns: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
shareLogDialog: {
|
||||
visible: false, id: ""
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.salaryStatisticsPushGetTable();
|
||||
}
|
||||
|
||||
salaryStatisticsPushGetTable = () => {
|
||||
this.setState({ loading: true });
|
||||
salaryStatisticsPushGetTable({ ...this.state.pageInfo })
|
||||
.then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
columns, dataSource,
|
||||
pageInfo: { ...this.state.pageInfo, current, pageSize, total }
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleWithdrawAll = (id) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(111, "确定要全部撤回吗?"),
|
||||
onOk: () => {
|
||||
salaryStatisticsPushcancelAll({ id }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.salaryStatisticsPushGetTable();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, columns, loading, pageInfo, shareLogDialog } = this.state;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
showQuickJumper: true, showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => {
|
||||
this.salaryStatisticsPushGetTable();
|
||||
});
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => {
|
||||
this.salaryStatisticsPushGetTable();
|
||||
});
|
||||
}
|
||||
};
|
||||
return (
|
||||
<WeaSlideModal
|
||||
{...this.props} className="shareRecordWrapper"
|
||||
direction="right" top={0} width={800} height={100}
|
||||
measureT="%" measureX="px" measureY="%"
|
||||
title={<div className="titleDialog">
|
||||
<div className="titleCol">
|
||||
<div className="titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{getLabel(111, "分享记录")}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div></div>
|
||||
</div>}
|
||||
content={(
|
||||
<WeaTable
|
||||
rowKey="id" dataSource={dataSource} pagination={pagination} loading={loading}
|
||||
columns={[
|
||||
...columns,
|
||||
{
|
||||
dataIndex: "operate",
|
||||
width: 150,
|
||||
title: getLabel(30585, "操作"),
|
||||
render: (__, record) => (
|
||||
<React.Fragment>
|
||||
<a href="javascript:void(0);" style={{ marginRight: 10 }}
|
||||
onClick={() => this.setState({
|
||||
shareLogDialog: { visible: true, id: record.id }
|
||||
})}>{getLabel(111, "查询详情")}</a>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.handleWithdrawAll(record.id)}>{getLabel(111, "全部撤回")}</a>
|
||||
<SalaryStatisticsDetailShareLogDialog
|
||||
{...shareLogDialog}
|
||||
onGetTable={() => this.salaryStatisticsPushGetTable()}
|
||||
onCancel={() => this.setState({
|
||||
shareLogDialog: { visible: false, id: "" }
|
||||
})}
|
||||
/>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
]}
|
||||
/>
|
||||
)}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryStatisticsDetailShareRecord;
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import SalaryStatisticsDetailShareDialog from "./salaryStatisticsDetailShareDialog";
|
||||
import SalaryStatisticsDetailShareRecord from "./salaryStatisticsDetailShareRecord";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
class TopBtns extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
shareDialog: {
|
||||
visible: false
|
||||
},
|
||||
shareRecordDialog: {
|
||||
visible: false
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
handleShare = () => {
|
||||
this.setState({
|
||||
shareDialog: { visible: true }
|
||||
});
|
||||
};
|
||||
handleShareRecord = () => {
|
||||
this.setState({
|
||||
shareRecordDialog: { visible: true }
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { shareDialog, shareRecordDialog } = this.state;
|
||||
return [
|
||||
<Button type="ghost" style={{ marginRight: 10 }} onClick={this.handleShare}>{getLabel(111, "分享报表")}</Button>,
|
||||
<Button type="ghost" onClick={this.handleShareRecord}>{getLabel(111, "分享记录")}</Button>,
|
||||
<SalaryStatisticsDetailShareDialog
|
||||
{...shareDialog}
|
||||
onCancel={() => this.setState({
|
||||
shareDialog: { visible: false }
|
||||
})}
|
||||
/>,
|
||||
<SalaryStatisticsDetailShareRecord
|
||||
{...shareRecordDialog}
|
||||
onClose={() => this.setState({
|
||||
shareRecordDialog: { visible: false }
|
||||
})}
|
||||
/>
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export default TopBtns;
|
||||
|
|
@ -11,9 +11,11 @@ import { message, Modal } from "antd";
|
|||
import LeftTab from "./components/leftTab";
|
||||
import ReportContent from "./components/reportContent";
|
||||
import StatisticalMicroSettingsSlide from "./components/statisticalMicroSettingsSlide";
|
||||
import TopBtns from "./components/topBtns";
|
||||
import { reportGetForm, reportStatisticsReportSave } from "../../apis/ruleconfig";
|
||||
import "./index.less";
|
||||
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
@inject("taxAgentStore", "attendanceStore")
|
||||
|
|
@ -98,14 +100,12 @@ class Index extends Component {
|
|||
|
||||
render() {
|
||||
const { report, dimensionList, statisticalPayload } = this.state;
|
||||
const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption, showOperateBtn } } = this.props;
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(111, "报表查看")}
|
||||
icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D"
|
||||
showDropIcon={false}
|
||||
className="reportViewWrapper"
|
||||
title={getLabel(111, "报表查看")} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" className="reportViewWrapper"
|
||||
buttons={showOperateBtn ? [<TopBtns/>] : []}
|
||||
>
|
||||
<WeaLeftRightLayout
|
||||
leftWidth={210}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { observable } from "mobx";
|
||||
import { action, observable } from "mobx";
|
||||
import { WeaForm } from "comsMobx";
|
||||
|
||||
|
||||
|
|
@ -10,4 +10,15 @@ export class AttendanceStore {
|
|||
@observable reportForm = new WeaForm();
|
||||
//报表查看 统计数据范围及规则设置form
|
||||
@observable settingForm = new WeaForm();
|
||||
//报表查看 分享报表
|
||||
@observable shareForm = new WeaForm();
|
||||
@observable shareLogForm = new WeaForm();
|
||||
@observable sharePerForm = new WeaForm();
|
||||
|
||||
@action("报表查看-分享报表表单初始化")
|
||||
initShareForm = () => this.shareForm = new WeaForm();
|
||||
@action("报表查看-查看分享记录详情表单初始化")
|
||||
initShareLogForm = () => this.shareLogForm = new WeaForm();
|
||||
@action("报表查看-追加被分享人表单初始化")
|
||||
initSharePerForm = () => this.sharePerForm = new WeaForm();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue