From 10c7280b4388296384b314ad13f3beaca22bd746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 19 Sep 2023 17:24:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=88=86=E4=BA=AB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/statistics.js | 28 +++ .../pages/reportView/components/condition.js | 181 ++++++++++++++++- .../pages/reportView/components/index.less | 131 ++++++++++++ .../salaryStatisticsDetailShareDialog.js | 139 +++++++++++++ .../salaryStatisticsDetailShareLogDialog.js | 189 ++++++++++++++++++ ...salaryStatisticsDetailSharePersonDialog.js | 74 +++++++ .../salaryStatisticsDetailShareRecord.js | 132 ++++++++++++ .../pages/reportView/components/topBtns.js | 54 +++++ pc4mobx/hrmSalary/pages/reportView/index.js | 12 +- pc4mobx/hrmSalary/stores/attendanceStore.js | 13 +- 10 files changed, 945 insertions(+), 8 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareDialog.js create mode 100644 pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js create mode 100644 pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js create mode 100644 pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js create mode 100644 pc4mobx/hrmSalary/pages/reportView/components/topBtns.js diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js index f5f4aff6..6297dfa8 100644 --- a/pc4mobx/hrmSalary/apis/statistics.js +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -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); +}; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition.js b/pc4mobx/hrmSalary/pages/reportView/components/condition.js index 103793c3..816dec2d 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/condition.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/condition.js @@ -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 } ] }); diff --git a/pc4mobx/hrmSalary/pages/reportView/components/index.less b/pc4mobx/hrmSalary/pages/reportView/components/index.less index 322df827..d77aab7f 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/index.less +++ b/pc4mobx/hrmSalary/pages/reportView/components/index.less @@ -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; + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareDialog.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareDialog.js new file mode 100644 index 00000000..32f40c66 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareDialog.js @@ -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 ( + {getLabel(111, "确认分享")} + ]} + className="shareDialogWrapper" + style={{ + width: 750, + height: 275.6, + minHeight: 200, + minWidth: 380, + maxHeight: "60%", + maxWidth: "60%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ {getSearchs(shareForm, conditions, 1, false)} +
+
+ ); + } +} + +export default SalaryStatisticsDetailShareDialog; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js new file mode 100644 index 00000000..1632940f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js @@ -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
+
+ {getLabel(111, "被分享人")} + +
+
+ this.setState({ + sharePerDialog: { + ...this.state.sharePerDialog, + visible: true, id: this.props.id + } + })}/> + this.setState({ userNameSearch: v })} + onSearch={() => this.salaryStatisticsPushGetDetail(this.props)} + /> +
+
; + }; + 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 ( + +
+ {getSearchs(shareLogForm, conditions, 1, false)} + + + {getLabel(30585, "操作")} + +

{getLabel(111, "1、分享状态为成功且撤回状态为空时,可操作撤回;")}

+

{getLabel(111, "2、撤回后不可重新分享;")}

+

{getLabel(111, "3、分享状态为失败,可操作重新分享;")}

+

{getLabel(111, "4、重新分享:以当前分享记录的分享报表、有效时间、渠道和说明重新分享,分享后自动刷新分享时间和分享状态")}

+
+ } + /> + , + render: (__, record) => (_.isEmpty(record.rebackStatus) ? + this.salaryStatisticsPushcancel(record.id)}>{getLabel(32025, "撤回")} : null) + } + ]} + /> + this.setState({ sharePerDialog: { ...sharePerDialog, visible: false, id: "" } })} + onGetTable={() => { + this.salaryStatisticsPushGetDetail(this.props); + this.props.onGetTable(); + }} + /> + + +
+ ); + } +} + +export default SalaryStatisticsDetailShareLogDialog; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js new file mode 100644 index 00000000..b0f8073e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js @@ -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 ( + {getLabel(111, "保存并分享")} + ]} + style={{ width: 600, height: 100 }} + > + {getSearchs(sharePerForm, sharePersonCondition, 1, false)} + + ); + } +} + +export default SalaryStatisticsDetailSharePersonDialog; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js new file mode 100644 index 00000000..3e35f626 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js @@ -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 ( + +
+
+
+
{getLabel(111, "分享记录")}
+
+
+
+ } + content={( + ( + + this.setState({ + shareLogDialog: { visible: true, id: record.id } + })}>{getLabel(111, "查询详情")} + this.handleWithdrawAll(record.id)}>{getLabel(111, "全部撤回")} + this.salaryStatisticsPushGetTable()} + onCancel={() => this.setState({ + shareLogDialog: { visible: false, id: "" } + })} + /> + + ) + } + ]} + /> + )}/> + ); + } +} + +export default SalaryStatisticsDetailShareRecord; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/topBtns.js b/pc4mobx/hrmSalary/pages/reportView/components/topBtns.js new file mode 100644 index 00000000..a2a7b0ae --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/topBtns.js @@ -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 [ + , + , + this.setState({ + shareDialog: { visible: false } + })} + />, + this.setState({ + shareRecordDialog: { visible: false } + })} + /> + ]; + } +} + +export default TopBtns; diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index c315ae53..4e0829a3 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -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 ( } - iconBgcolor="#F14A2D" - showDropIcon={false} - className="reportViewWrapper" + title={getLabel(111, "报表查看")} icon={} + iconBgcolor="#F14A2D" className="reportViewWrapper" + buttons={showOperateBtn ? [] : []} > this.shareForm = new WeaForm(); + @action("报表查看-查看分享记录详情表单初始化") + initShareLogForm = () => this.shareLogForm = new WeaForm(); + @action("报表查看-追加被分享人表单初始化") + initSharePerForm = () => this.sharePerForm = new WeaForm(); } From 6ac979e9e7afbb4b818cc59228e1a4ae594131b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 20 Sep 2023 09:25:10 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=88=86=E4=BA=AB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/reportView/components/condition.js | 22 +++- .../reportView/components/reportContent.js | 21 +-- .../reportView/components/rightOptions.js | 9 +- .../salaryStatisticsDetailShareDialog.js | 2 +- .../statisticalMicroSettingsSlide.js | 120 +++++++++++------- pc4mobx/hrmSalary/pages/reportView/index.js | 15 +-- 6 files changed, 114 insertions(+), 75 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition.js b/pc4mobx/hrmSalary/pages/reportView/components/condition.js index 816dec2d..9d141953 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/condition.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/condition.js @@ -215,16 +215,26 @@ export const shareCondition = [ viewAttr: 3 }, { - colSpan: 1, - conditionType: "RANGEPICKER", - domkey: ["startTime", "endTime"], + colSpan: 2, + conditionType: "DATEPICKER", + domkey: ["startTime"], fieldcol: 12, - label: "报表查看有效时间", + label: "报表查看有效开始时间", lanId: 111, labelcol: 6, value: "", - rules: "required", - viewAttr: 3 + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "DATEPICKER", + domkey: ["endTime"], + fieldcol: 12, + label: "报表查看有效结束时间", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 }, { colSpan: 1, diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index e87e1eed..9ddc8380 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -43,7 +43,7 @@ class ReportContent extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.report !== this.props.report && nextProps.report.dimensionId) { - this.reportStatisticsReportGetData(nextProps.report.id, nextProps.report.dimensionId); + this.reportStatisticsReportGetData(nextProps.report.id, nextProps.report.dimensionId, nextProps.report.isShare); this.setState({ viewType: "dataView", chartsInfo: {} }); } } @@ -64,7 +64,8 @@ class ReportContent extends Component { //数据透视弹框 if (id === "PIVOTCHART") { const { record } = params; - const { dimension: dimensionValue } = record; + const { dimension: dimensionValue, isShare } = record; + if (isShare) return; const { id: pivotId, dimensionId } = this.props.report; this.setState({ povitView: { @@ -81,8 +82,8 @@ class ReportContent extends Component { dataSource, columns, showSum, countResult }), "*"); }; - reportStatisticsReportGetData = (id, dimensionId) => { - const payload = { id, dimensionId }; + reportStatisticsReportGetData = (id, dimensionId, isShare) => { + const payload = { id, dimensionId, isShare }; this.setState({ loading: true }); reportStatisticsReportGetData(payload).then(({ status, data }) => { this.setState({ loading: false }); @@ -191,13 +192,13 @@ class ReportContent extends Component { handleChangeChartOpts = (chartsType, viewType) => { this.setState({ chartsInfo: {} }); if (this.refs.chart && viewType !== "setting" && viewType !== "dataView" && !this.state.rangSet.visible) this.refs.chart.clear(); - const { report: { id: reportId, dimensionId } } = this.props; + const { report: { id: reportId, dimensionId, isShare } } = this.props; const { rangSet } = this.state; viewType !== "setting" && this.setState({ chartsType, viewType }, () => { const { viewType, chartsType } = this.state; viewType !== "dataView" ? this.queryRangeSetting({ reportId, chartsType }, true) : - this.reportStatisticsReportGetData(reportId, dimensionId); + this.reportStatisticsReportGetData(reportId, dimensionId, isShare); }); viewType === "setting" && this.setState({ rangSet: { ...rangSet, visible: true, reportId } }, () => { this.queryRangeSetting({ reportId, chartsType }); @@ -213,8 +214,8 @@ class ReportContent extends Component { }; handleGetData = () => { const { report } = this.props; - const { id, dimensionId } = report; - this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId)); + const { id, dimensionId, isShare } = report; + this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId, isShare)); }; renderCharts = () => { const { chartsInfo, viewType } = this.state; @@ -229,6 +230,8 @@ class ReportContent extends Component { render() { const { loading, viewType, rangSet, columns, povitView } = this.state; + const { report } = this.props; + const { isShare } = report; return (
@@ -245,7 +248,7 @@ class ReportContent extends Component {
{/*侧边栏*/} - + {/* 图表范围数据设置框 */} @@ -32,8 +32,11 @@ class RightOptions extends Component { onClick={() => onChange("1", "bar")}/> onChange("2", "line")}/> onChange("0", "pie")}/> - onChange("1", "setting")}/> + { + !isShare && + onChange("1", "setting")}/> + }
{ - return { - ...item, - items: _.map(item.items, child => { - if (child.domkey[0] === "taxAgent") { - return { - ...child, - options: toJS(nextProps.taxAgentAdminOption) - }; - } - return { ...child }; - }) - }; - }); - this.setState({ conditions }); - nextProps.form.initFormFields(condition); - } + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentSelectList(nextProps); if (nextProps.id !== this.props.id && !_.isEmpty(nextProps.id)) { - this.reportStatisticsGetSearchCondition(nextProps.id); this.statisticsItemList(nextProps.id).then(r => { }); } @@ -82,6 +66,31 @@ class StatisticalMicroSettingsSlide extends Component { } } + getTaxAgentSelectList = (props) => { + getTaxAgentSelectList().then(({ status, data }) => { + if (status) { + const conditions = _.map(condition, item => { + return { + ...item, + items: _.map(item.items, child => { + if (getKey(child) === "taxAgent") { + return { + ...child, viewAttr: props.isShare ? 1 : child.viewAttr, + options: _.map(data, o => ({ key: o.id, showname: o.content })) + }; + } + return { ...child, viewAttr: props.isShare ? 1 : child.viewAttr }; + }) + }; + }); + this.setState({ conditions }, () => { + props.form.initFormFields(this.state.conditions); + props.id && this.reportStatisticsGetSearchCondition(props.id); + }); + + } + }); + }; reportStatisticsGetSearchCondition = (id) => { const { conditions } = this.state; const { form } = this.props; @@ -189,7 +198,7 @@ class StatisticalMicroSettingsSlide extends Component { }; renderProjectTitle = () => { const { selectedRowKeys } = this.state; - const { id, dimension } = this.props; + const { id, dimension, isShare } = this.props; return
{getLabel(111, "统计项目")} @@ -198,19 +207,25 @@ class StatisticalMicroSettingsSlide extends Component { />
- - this.setState({ - statisticalItemPayload: { - visible: true, id, dimension, - statisticsItemId: "" - } - })} - /> + { + !isShare && + + } + { + !isShare && + this.setState({ + statisticalItemPayload: { + visible: true, id, dimension, + statisticsItemId: "" + } + })} + /> + }
; }; @@ -220,16 +235,19 @@ class StatisticalMicroSettingsSlide extends Component { salaryMonth, conditions, selectedRowKeys, loading, statisticalItemPayload, dataSource, unitTypeList } = this.state; - const { id, dimension } = this.props; + const { id, dimension, isShare } = this.props; const columns = [ { title: "统计项名称", dataIndex: "itemName", render: (txt, record) => { return ( - this.setState({ - statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id } - })}>{txt} + { + if (isShare) return; + this.setState({ + statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id } + }); + }}>{txt} ); } }, @@ -238,7 +256,7 @@ class StatisticalMicroSettingsSlide extends Component { dataIndex: "unitType", render: (txt, record) => { return this.customStatisticsItemsRef.reportStatisticsItemSave({ id: record.id, unitType })} />; } @@ -248,7 +266,10 @@ class StatisticalMicroSettingsSlide extends Component { selectedRowKeys, onChange: (selectedRowKeys) => { this.setState({ selectedRowKeys }); - } + }, + getCheckboxProps: record => ({ + disabled: isShare + }) }; return ( } + title={} content={ - this.setState({ salaryMonth: v })}/> @@ -319,16 +340,19 @@ const TitleDialog = (props) => {
- + { + !props.isShare && + + }
; }; export const MonthRangePicker = (props) => { - const { dateRange, onChange, viewAttr } = props; + const { dateRange, onChange, viewAttr, disabled = false } = props; const [startDate, endDate] = dateRange || []; return
{ return current && endDate && current.getTime() > new Date(endDate).getTime(); }} @@ -338,7 +362,7 @@ export const MonthRangePicker = (props) => { /> { return current && startDate && current.getTime() < new Date(startDate).getTime(); }} diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index 4e0829a3..2db97c5c 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -33,9 +33,7 @@ class Index extends Component { } componentDidMount() { - const { taxAgentStore: { fetchTaxAgentOption } } = this.props; this.reportGetForm(); - fetchTaxAgentOption(); } reportGetForm = () => { @@ -94,18 +92,19 @@ class Index extends Component { */ exportData = () => { const { report } = this.state; - const { id, dimensionId } = report; - window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}`, "_self"); + const { id, dimensionId, isShare } = report; + window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}&isShare=${isShare}`, "_self"); }; render() { const { report, dimensionList, statisticalPayload } = this.state; + const { isShare } = report; const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption, showOperateBtn } } = this.props; return ( } iconBgcolor="#F14A2D" className="reportViewWrapper" - buttons={showOperateBtn ? [] : []} + buttons={(showOperateBtn && !isShare) ? [] : []} >
{getLabel(111, "统计维度")}: - this.handleChangeDimension(key, showname)}/>
@@ -150,10 +149,10 @@ class Index extends Component { {/*统计数据范围及规则设置弹框*/} this.setState({ statisticalPayload: { visible: false, id: "", dimension: "" } - }, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId))} + }, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId, report.isShare))} />
From d7c59f543486bd874f7a8741288177cbe47596f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 20 Sep 2023 15:03:05 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=88=86=E4=BA=AB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=2020230920?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/reportList.js | 21 +++++++++++-------- .../reportView/components/reportContent.js | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js index 6510d5b1..30b8a474 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js @@ -73,7 +73,7 @@ class ReportList extends Component { { _.isEmpty(dataSource) ?
{getLabel(111, "暂无数据")}
: _.map(dataSource, it => { - const { reportName, dimension, id, dimensionId } = it; + const { reportName, dimension, id, dimensionId, isShare } = it; return this.handleGoReportView(id)}>
@@ -85,14 +85,17 @@ class ReportList extends Component {
- this.handleOptsClick(e, id, dimensionId)}> - {getLabel(111, "编辑")} - {getLabel(111, "删除")} - - }> - - + { + !isShare && + this.handleOptsClick(e, id, dimensionId)}> + {getLabel(111, "编辑")} + {getLabel(111, "删除")} + + }> + + + }
; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index 9ddc8380..c3e9d6e7 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -64,9 +64,9 @@ class ReportContent extends Component { //数据透视弹框 if (id === "PIVOTCHART") { const { record } = params; - const { dimension: dimensionValue, isShare } = record; + const { dimension: dimensionValue } = record; + const { id: pivotId, dimensionId, isShare } = this.props.report; if (isShare) return; - const { id: pivotId, dimensionId } = this.props.report; this.setState({ povitView: { visible: true, id: pivotId, dimensionId, dimensionValue From d664ad27691a37b2f8515a53a61d86fcbaa6243c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 20 Sep 2023 17:03:24 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=88=86=E4=BA=AB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=2020230920?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 18 +++++++----------- .../statisticalMicroSettingsSlide.js | 2 +- pc4mobx/hrmSalary/pages/reportView/index.js | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 25747f12..1b0f58d8 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { formPost, postFetch } from "../util/request"; +import { postFetch } from "../util/request"; //个税扣缴义务人列表 export const getTaxAgentList = (params) => { @@ -7,9 +7,9 @@ export const getTaxAgentList = (params) => { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //同步人员范围 @@ -18,9 +18,9 @@ export const taxAgentRangeSync = (params) => { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -108,12 +108,8 @@ export const taxAgentRangeImportData = (params) => { }; //个税扣缴义务人下拉列表 -export const getTaxAgentSelectList = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/taxAgent/selectList", - "GET", - params - ); +export const getTaxAgentSelectList = (isShare = false) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare }); }; //当前登录人个税扣缴义务人下拉列表 diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 536ad2da..65668107 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -67,7 +67,7 @@ class StatisticalMicroSettingsSlide extends Component { } getTaxAgentSelectList = (props) => { - getTaxAgentSelectList().then(({ status, data }) => { + getTaxAgentSelectList(true).then(({ status, data }) => { if (status) { const conditions = _.map(condition, item => { return { diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index 2db97c5c..ffe5a3db 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -93,7 +93,7 @@ class Index extends Component { exportData = () => { const { report } = this.state; const { id, dimensionId, isShare } = report; - window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}&isShare=${isShare}`, "_self"); + window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}&isShare=${isShare}`, "_blank"); }; render() { From 96032b5f1c9918098be7095061d194e2ea898fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 21 Sep 2023 10:17:06 +0800 Subject: [PATCH 5/5] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=88=86=E4=BA=AB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/customStatisticsItemsModal.js | 22 ++++++++++++------- .../components/povitpivotChartModal.js | 10 ++++----- .../reportView/components/reportContent.js | 8 +++---- .../statisticalMicroSettingsSlide.js | 15 +++++-------- pc4mobx/hrmSalary/pages/reportView/index.less | 12 ++++++++++ 5 files changed, 40 insertions(+), 27 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js index f87d7912..49f5a462 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js @@ -269,7 +269,7 @@ class CustomStatisticsItemsModal extends Component { render() { const { loading, columns, dataSource, formData } = this.state; const { itemName, itemValue, itemValueSpan } = formData; - const { statisticsItemId } = this.props; + const { statisticsItemId, isShare } = this.props; const cols = _.map(columns, it => { const { text, column } = it; if (column === "ruleName" || column === "ratio" || column === "m2m" || column === "y2y") { @@ -278,6 +278,7 @@ class CustomStatisticsItemsModal extends Component { ...it, title: !!child[`${key}Value`])} onChange={val => this.handleChangeColumnAllChecked(`${key}Value`, val)} /> @@ -286,6 +287,7 @@ class CustomStatisticsItemsModal extends Component { render: (txt, record) => { return this.handleChangeColumnCheckBox(`${key}Value`, val, record.id)} /> @@ -305,6 +307,7 @@ class CustomStatisticsItemsModal extends Component { , render: (txt, record) => { return !!record["m2mValue"] && this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} @@ -321,6 +324,7 @@ class CustomStatisticsItemsModal extends Component { , render: (txt, record) => { return !!record["y2yValue"] && this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} @@ -335,8 +339,10 @@ class CustomStatisticsItemsModal extends Component { title={
{statisticsItemId ? getLabel(111, "编辑自定义统计项目") : getLabel(111, "新建自定义统计项目")} - + { + !isShare && + }
} style={{ width: 900, height: 450 }} @@ -348,7 +354,7 @@ class CustomStatisticsItemsModal extends Component { ({ @@ -381,7 +387,7 @@ class CustomStatisticsItemsModal extends Component { - this.setState({ formData: { ...formData, itemName } })}/> @@ -406,11 +412,11 @@ export default CustomStatisticsItemsModal; * Date: 2023/4/23 */ const IntervalSettingsComp = (props) => { - const { LowerLimit, UpperLimit, onChange } = props; + const { LowerLimit, UpperLimit, onChange, isShare } = props; return
- onChange("min", val)}/> + onChange("min", val)} disabled={isShare}/> {`% <${getLabel(111, "增幅")}<`} - onChange("max", val)}/> + onChange("max", val)} disabled={isShare}/> %
; }; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js b/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js index 4af04328..801bb99e 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js @@ -35,8 +35,8 @@ class PovitpivotChartModal extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { id, dimensionId, dimensionValue } = nextProps; - this.getDataPerspective({ id, dimensionId, dimensionValue }); + const { id, dimensionId, dimensionValue, isShare } = nextProps; + this.getDataPerspective({ id, dimensionId, dimensionValue, isShare }); } else { this.setState({ dataSource: [], @@ -63,13 +63,11 @@ class PovitpivotChartModal extends Component { }); } else if (type === "turn") { if (id === "PAGEINFO") { - const { id, dimensionId, dimensionValue } = this.props; + const { id, dimensionId, dimensionValue, isShare } = this.props; const { pageNum: current, size: pageSize } = params; this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getDataPerspective({ - id, - dimensionId, - dimensionValue + id, dimensionId, dimensionValue, isShare })); } } diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index c3e9d6e7..70980238 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -26,7 +26,7 @@ class ReportContent extends Component { chartsType: "0", chartsInfo: {}, povitView: { - visible: false, id: "", + visible: false, id: "", isShare: false, dimensionId: "", dimensionValue: "" }, rangSet: { @@ -66,10 +66,9 @@ class ReportContent extends Component { const { record } = params; const { dimension: dimensionValue } = record; const { id: pivotId, dimensionId, isShare } = this.props.report; - if (isShare) return; this.setState({ povitView: { - visible: true, id: pivotId, dimensionId, dimensionValue + visible: true, id: pivotId, dimensionId, dimensionValue, isShare } }); } @@ -262,7 +261,8 @@ class ReportContent extends Component { {...povitView} onCancel={() => this.setState({ povitView: { - visible: false, id: "", dimensionId: "", dimensionValue: "" + visible: false, id: "", dimensionId: "", dimensionValue: "", + isShare: false } })} /> diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 65668107..32f074d1 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -49,7 +49,7 @@ class StatisticalMicroSettingsSlide extends Component { salaryMonth: [], statisticalItemPayload: { visible: false, id: "", dimension: "", - statisticsItemId: "" + statisticsItemId: "", isShare: false } }; } @@ -67,7 +67,7 @@ class StatisticalMicroSettingsSlide extends Component { } getTaxAgentSelectList = (props) => { - getTaxAgentSelectList(true).then(({ status, data }) => { + getTaxAgentSelectList(props.isShare).then(({ status, data }) => { if (status) { const conditions = _.map(condition, item => { return { @@ -221,7 +221,7 @@ class StatisticalMicroSettingsSlide extends Component { onClick={() => this.setState({ statisticalItemPayload: { visible: true, id, dimension, - statisticsItemId: "" + statisticsItemId: "", isShare } })} /> @@ -243,9 +243,8 @@ class StatisticalMicroSettingsSlide extends Component { render: (txt, record) => { return ( { - if (isShare) return; this.setState({ - statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id } + statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id, isShare } }); }}>{txt} ); @@ -315,10 +314,8 @@ class StatisticalMicroSettingsSlide extends Component { {...statisticalItemPayload} onCancel={(isRefresh) => this.setState({ statisticalItemPayload: { - visible: false, - id: "", - dimension: "", - statisticsItemId: "" + visible: false, id: "", dimension: "", + statisticsItemId: "", isShare: false } }, () => isRefresh && this.statisticsItemList(this.props.id))} /> diff --git a/pc4mobx/hrmSalary/pages/reportView/index.less b/pc4mobx/hrmSalary/pages/reportView/index.less index 99d4d917..ecf9b997 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.less +++ b/pc4mobx/hrmSalary/pages/reportView/index.less @@ -204,6 +204,18 @@ .microSlideWrapper { z-index: 999; + .wea-form-item-wrapper { + display: flex !important; + + .wea-browser { + width: 100%; + } + } + + .wea-form-item .wea-form-item-wrapper .wea-field-readonly { + white-space: pre-wrap !important; + } + .wea-slide-modal-title { height: auto !important; line-height: normal !important;