From 5fd2120f14ddf9330516a96bfe4cd60222e695a9 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, 7 Nov 2023 16:21:17 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.9.42310.01-=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=BB=B4=E5=BA=A6=E7=AE=A1=E7=90=86=E5=BC=B9=E6=A1=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BB=A5=E5=8F=8A=E6=B7=BB=E5=8A=A0=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E7=9A=84=E6=89=A9=E5=B1=95=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/statistics.js | 12 ++ .../components/conditions.js | 35 ++++- .../dimensionExtensionAttrsDialog.js | 142 ++++++++++++++++++ .../components/dimensionTable.js | 30 ++-- .../components/reportList.js | 17 ++- .../components/statisticsModal.js | 42 ++++-- .../pages/analysisOfSalaryStatistics/index.js | 4 +- .../analysisOfSalaryStatistics/index.less | 72 +++++++++ pc4mobx/hrmSalary/stores/attendanceStore.js | 3 + 9 files changed, 331 insertions(+), 26 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionExtensionAttrsDialog.js diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js index 6297dfa8..80007822 100644 --- a/pc4mobx/hrmSalary/apis/statistics.js +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -106,3 +106,15 @@ export const salaryStatisticsPushGetDetail = (params) => { export const salaryStatisticsPushAddSharedSendMsg = (params) => { return postFetch("/api/bs/salaryreport/salary/statistics/push/addSharedSendMsg", params); }; +//报表记录-扩展人员维度显示值 +export const saveExpandFieldSettings = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/dimension/saveExpandFieldSettings", params); +}; +//报表记录-查询薪酬统计维度扩展字段设置 +export const getExpandFieldSettings = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/dimension/getExpandFieldSettings", "GET", params); +}; +//报表记录-复制薪酬统计报表 +export const statisticsReportDuplicate = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/report/duplicate", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js index 7bcac916..fe2554e4 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js @@ -49,7 +49,7 @@ export const condition = [ labelcol: 6, options: [], viewAttr: 2, - helpfulTip: "", + helpfulTip: "" }, { colSpan: 1, @@ -90,10 +90,41 @@ export const reportCondition = [ options: [], rules: "required|string", viewAttr: 3, - helpfulTip: "", + helpfulTip: "" } ], title: "", defaultshow: true } ]; +export const extensionCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["pk"], + fieldcol: 14, + label: "主键", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "TEXTAREA", + domkey: ["expandSql"], + fieldcol: 14, + label: "sql", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionExtensionAttrsDialog.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionExtensionAttrsDialog.js new file mode 100644 index 00000000..700dfa73 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionExtensionAttrsDialog.js @@ -0,0 +1,142 @@ +/* + * Author: 黎永顺 + * name: 统计维度-新增扩展属性 + * Description: + * Date: 2023/11/7 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTableEdit } from "ecCom"; +import { Button, message } from "antd"; +import { getExpandFieldSettings, saveExpandFieldSettings } from "../../../apis/statistics"; +import { extensionCondition } from "./conditions"; +import { getConditionDomkeys, getSearchs } from "../../../util"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("attendanceStore") +@observer +class DimensionExtensionAttrsDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false, datas: [], extensionId: "" + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getExpandFieldSettings(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.setState({ extensionId: "", datas: [] }); + nextProps.attendanceStore.initExtensionForm(); + } + } + + getExpandFieldSettings = (props) => { + getExpandFieldSettings({ module: "dim_employee" }).then(({ status, data }) => { + if (status) { + const { id: extensionId = "", fieldSettings: datas = [] } = data || {}; + this.setState({ + extensionId, datas, + conditions: _.map(extensionCondition, o => { + return { + ...o, + items: _.map(o.items, g => { + return { ...g, label: getLabel(g.lanId, g.label) }; + }) + }; + }) + }, () => { + const { attendanceStore: { extensionForm } } = props; + extensionForm.initFormFields(this.state.conditions); + if (!_.isNil(data)) + _.map(getConditionDomkeys(this.state.conditions), o => { + extensionForm.updateFields({ [o]: data[o] || "" }); + }); + }); + } + }); + }; + save = () => { + const { attendanceStore: { extensionForm } } = this.props; + const { datas, extensionId: id } = this.state; + const { pass } = this.tableEdit.refs.edit.doRequiredCheck(); + extensionForm.validateForm().then(f => { + if (f.isValid && pass) { + const paylaod = { + fieldSettings: _.map(datas, (o, i) => ({ ...o, index: i + 1 })), + module: "dim_employee", moduleInfo: "", id, + ...extensionForm.getFormParams() + }; + this.setState({ loading: true }); + saveExpandFieldSettings(paylaod).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { attendanceStore: { extensionForm } } = this.props; + const { conditions, loading, datas } = this.state; + const columns = [ + { + title: getLabel(33439, "名称"), + dataIndex: "name", + key: "name", + com: [ + { label: "", type: "INPUT", viewAttr: 3, key: "name" } + ], + colSpan: 1, + width: "50%" + }, + { + title: getLabel(111, "字段"), + dataIndex: "field", + key: "field", + com: [ + { label: "", type: "INPUT", viewAttr: 3, key: "field" } + ], + colSpan: 1, + width: "50%" + } + ]; + return ( + {getLabel(537558, "保存")} + ]} + style={{ + width: 850, + height: 606.6, + minHeight: 200, + minWidth: 380, + maxHeight: "90%", + maxWidth: "90%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ {getSearchs(extensionForm, conditions, 1, false)} + this.tableEdit = el} showCopy={false} draggable deleteConfirm + columns={columns} datas={datas} onChange={datas => this.setState({ datas })} + /> +
+
+ ); + } +} + +export default DimensionExtensionAttrsDialog; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionTable.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionTable.js index 48eecf43..0f217371 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionTable.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionTable.js @@ -8,6 +8,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTable } from "ecCom"; import { message, Modal } from "antd"; import { dimensionDelete, dimensionList } from "../../../apis/statistics"; +import DimensionExtensionAttrsDialog from "./dimensionExtensionAttrsDialog"; import "../index.less"; const { getLabel } = WeaLocaleProvider; @@ -16,8 +17,7 @@ class DimensionTable extends Component { constructor(props) { super(props); this.state = { - loading: false, - dataSource: [], + loading: false, dataSource: [], visible: false, pageInfo: { current: 1, pageSize: 10, total: 0 } @@ -63,7 +63,7 @@ class DimensionTable extends Component { }; render() { - const { dataSource, loading, pageInfo } = this.state; + const { dataSource, loading, pageInfo, visible } = this.state; const { onEdit } = this.props; const pagination = { ...pageInfo, @@ -100,20 +100,28 @@ class DimensionTable extends Component { this.dimensionDelete([record.id])}>{getLabel(111, "删除")} } + { + record.dimName === getLabel(30042, "人员") && record.dimType === getLabel(111, "定性") && + this.setState({ visible: true })}>{getLabel(111, "扩展属性")} + } ); } } ]; return ( - + + + this.setState({ visible: false })}/> + ); } } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js index af813553..ba66eec2 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js @@ -7,7 +7,11 @@ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd"; -import { reportStatisticsReportDelete, reportStatisticsReportList } from "../../../apis/statistics"; +import { + reportStatisticsReportDelete, + reportStatisticsReportList, + statisticsReportDuplicate +} from "../../../apis/statistics"; import "../index.less"; const SubMenu = Menu.SubMenu; @@ -26,10 +30,20 @@ class ReportList extends Component { } handleOptsClick = ({ key }, id, dimensionId) => { + const { reportName = "" } = this.props; if (key === "delete") { this.reportStatisticsReportDelete(id.split(",")); } else if (key === "edit") { this.props.onEdit("addReport", id); + } else if (key === "copy") { + statisticsReportDuplicate({ id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.reportStatisticsReportList({ reportName }); + } else { + message.error(errormsg); + } + }); } }; reportStatisticsReportDelete = (payload) => { @@ -90,6 +104,7 @@ class ReportList extends Component { this.handleOptsClick(e, id, dimensionId)}> {getLabel(111, "编辑")} + {getLabel(77, "复制")} {getLabel(111, "删除")} }> diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js index c8920887..1f333b7c 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { Button, message, Modal } from "antd"; -import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { WeaDialog, WeaLocaleProvider, WeaSlideModal } from "ecCom"; import { reportStatisticsReportSave } from "../../../apis/ruleconfig"; import "../index.less"; @@ -45,6 +45,17 @@ class StatisticsModal extends Component { } }); }; + renderTitle = () => { + return
+
+
+
{getLabel(543313, "统计维度管理")}
+
+
+ +
+
; + }; render() { const { loading } = this.state; @@ -53,16 +64,25 @@ class StatisticsModal extends Component { ] : []; return ( - - {this.props.children} - + + { + typeKey === "addReport" ? + {this.props.children} + : + + } + ); } } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index 20748a27..f9a073e5 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -287,7 +287,9 @@ class Index extends Component { keyword={keyword} year={year} /> } - + { modalReq.typeKey === "dimension" && this.dimensionTableRef = dom} diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less index 5a3c335e..8f71d224 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less @@ -1,4 +1,8 @@ .xc_tj_fx_wrapper { + .wea-new-top-req { + z-index: 0 !important; + } + .search { top: -3px; margin-right: 10px; @@ -180,6 +184,45 @@ } } + .titleDialog { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 46px 0 16px; + + .titleCol { + flex: 1; + display: flex; + align-items: center; + } + + .titleLeftBox { + .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; + } + } + + .titleRightBox { + justify-content: flex-end; + } + } + } .dimensionSlideWrapper, .dimensionModalWrapper { @@ -217,3 +260,32 @@ } } } + +//重构-社保福利档案 +.extensionAttrsDialog { + .extensionAttrsDialogContent { + background: #F6F6F6; + padding: 16px; + width: 100%; + height: 100%; + + .wea-table-edit { + background: #FFF; + } + + .wea-search-group { + padding: 0; + margin-bottom: 10px; + background: #FFF; + + .wea-form-cell { + padding: 0; + + .wea-form-item { + padding: 10px; + } + } + } + + } +} diff --git a/pc4mobx/hrmSalary/stores/attendanceStore.js b/pc4mobx/hrmSalary/stores/attendanceStore.js index 451cb234..f309619e 100644 --- a/pc4mobx/hrmSalary/stores/attendanceStore.js +++ b/pc4mobx/hrmSalary/stores/attendanceStore.js @@ -14,6 +14,9 @@ export class AttendanceStore { @observable shareForm = new WeaForm(); @observable shareLogForm = new WeaForm(); @observable sharePerForm = new WeaForm(); + @observable extensionForm = new WeaForm(); //扩展属性 + @action("报表查看-扩展属性表单初始化") + initExtensionForm = () => this.extensionForm = new WeaForm(); @action("报表查看-分享报表表单初始化") initShareForm = () => this.shareForm = new WeaForm();