diff --git a/pc4mobx/hrmSalary/apis/archive.js b/pc4mobx/hrmSalary/apis/archive.js index 5ce04a25..9ea65461 100644 --- a/pc4mobx/hrmSalary/apis/archive.js +++ b/pc4mobx/hrmSalary/apis/archive.js @@ -1,4 +1,5 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; /** * 薪资档案api @@ -7,120 +8,120 @@ import { WeaTools } from 'ecCom'; //薪资档案-薪资档案列表 export const getArchiveList = params => { - return fetch('/api/bs/hrmsalary/salaryArchive/list', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/list", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资档案的高级搜索 export const getSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/getSearchCondition', 'get', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/archives/getSearchCondition", "get", params); +}; //薪资档案-导出薪资档案 export const exportArchiveList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/exportList', 'POST', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/exportList", "POST", params); +}; //薪资档案-获取导入参数 export const getImportArchiveParam = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getImportParams', 'get', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getImportParams", "get", params); +}; //薪资档案-获取薪资档案详情表单 export const getArchiveForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getForm', 'get', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getForm", "get", params); +}; //薪资档案-获取薪资项目调整表单 export const getSalaryItemForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getSalaryItemForm', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getSalaryItemForm", "GET", params); +}; //薪资档案-保存薪资项目调整 export const saveSalaryItem = params => { - return fetch('/api/bs/hrmsalary/salaryArchive/saveSalaryItem', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/saveSalaryItem", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资档案-获取个税扣缴义务人调整表单 export const getTaxAgentForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getTaxAgentForm', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getTaxAgentForm", "GET", params); +}; //薪资档案-保存个税扣缴义务人调整 export const saveTaxAgent = params => { - return fetch('/api/bs/hrmsalary/salaryArchive/saveTaxAgent', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/saveTaxAgent", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资档案-删除个税扣缴义务人调整 export const deleteTaxAgent = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/deleteTaxAgent', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/deleteTaxAgent", "GET", params); +}; //薪资档案操作记录-薪资项目操作记录列表 export const getItemAdjustList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList', 'POST', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList", "POST", params); +}; //薪资档案操作记录-薪资项目操作记录列表的高级搜索 export const getItemAdjustSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/getSalaryItemSearchCondition', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/getSalaryItemSearchCondition", "GET", params); +}; //薪资档案操作记录-导出-薪资项目操作记录列表 export const exportItemAdjust = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/exportSalaryItemList', 'POST', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/exportSalaryItemList", "POST", params); +}; //薪资档案操作记录-个税扣缴义务人操作记录列表 export const getPersonAdjustList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList', 'POST', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList", "POST", params); +}; //薪资档案操作记录-个税扣缴义务人操作记录列表的高级搜索 export const getPersonAdjustSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/getTaxAgentSearchCondition', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/getTaxAgentSearchCondition", "GET", params); +}; //薪资档案操作记录-导出-个税扣缴义务人操作记录列表 export const exportPersonAdjust = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/exportTaxAgentList', 'POST', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/exportTaxAgentList", "POST", params); +}; //薪资档案-获取设置表单 export const getSettingForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getDimissionSetForm', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getDimissionSetForm", "GET", params); +}; //薪资档案-保存离职时段设置 export const saveSetting = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/saveDimissionSet', 'POST', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/saveDimissionSet", "POST", params); +}; //薪资档案-模版下载链接(无数据) @@ -128,166 +129,170 @@ export const downloadSalaryArchiveTemplateurl = `/api/bs/hrmsalary/salaryArchive // 薪资档案- 模版下载 (有之前数据) export const downloadsalaryArchiveDetail = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/exportList', 'POST', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/exportList", "POST", params); +}; // 获取导入类型 export const getImportTypes = () => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getImportTypes', 'GET', {}); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getImportTypes", "GET", {}); +}; // 获取档案和人员状态类型 export const commonEnumList = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/common/enum/list', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/common/enum/list", "GET", params); +}; // 发起调薪地址 export const salaryAdjustmentInfo = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/process/salaryAdjustmentInfo', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/process/salaryAdjustmentInfo", "GET", params); +}; // 导入预览 export const importPreview = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/preview', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/preview", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 导入档案 export const importSalaryArchive = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/importSalaryArchive', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/importSalaryArchive", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 导出档案 export const exportSalaryArchive = (ids = "") => { - fetch('/api/bs/hrmsalary/salaryArchive/exportList?ids=' + ids).then(res => res.blob().then(blob => { - var filename=`薪资档案.xlsx` - var a = document.createElement('a'); - var url = window.URL.createObjectURL(blob); - a.href = url; - a.download = filename; - a.click(); - window.URL.revokeObjectURL(url); - })) -} + fetch("/api/bs/hrmsalary/salaryArchive/exportList?ids=" + ids).then(res => res.blob().then(blob => { + var filename = `薪资档案.xlsx`; + var a = document.createElement("a"); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })); +}; // 调整记录-个税扣缴义务人列表 export const adjustRecordTaxAgentList = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/taxAgentList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/taxAgentList", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 调整记录-薪资项目-列表 export const adjustRecordSalaryItemList = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/salaryItemList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/salaryItemList", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 调整记录-薪资项目-单个 export const singleSalaryItemList = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/singleSalaryItemList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleSalaryItemList", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 调整记录-个税扣缴义务人-单个 export const singleTaxAgentList = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/singleTaxAgentList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleTaxAgentList", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 调整-义务扣缴人-通过薪资档案的个税扣缴义务人id获取个税扣缴义务人调整表单 export const getTaxAgentFormBySalaryArchiveTaxAgentId = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getTaxAgentFormBySalaryArchiveTaxAgentId', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getTaxAgentFormBySalaryArchiveTaxAgentId", "GET", params); +}; // 调整-薪资项目-获取调整前的值 export const getSalaryItemAdjustBeforeValue = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/getSalaryItemAdjustBeforeValue', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/getSalaryItemAdjustBeforeValue", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 停薪 export const stopSalary = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/stopSalary', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/stopSalary", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 调整-薪资项目-通过薪资档案的薪资项目id获取薪资项目调整表单 export const getSalaryItemFormByItemId = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getSalaryItemFormBySalaryArchiveItemId', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getSalaryItemFormBySalaryArchiveItemId", "GET", params); +}; // 删除薪资项目调薪 export const deleteSalaryItem = (params) => { - return fetch(`/api/bs/hrmsalary/salaryArchive/deleteSalaryItem?salaryArchiveItemId=${params.salaryArchiveItemId}`, { - method: 'GET', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - }).then(res => res.json()) -} + return fetch(`/api/bs/hrmsalary/salaryArchive/deleteSalaryItem?salaryArchiveItemId=${params.salaryArchiveItemId}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + } + }).then(res => res.json()); +}; export const getSingleSalaryItemInfo = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/getSingleSalaryItemInfo', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/getSingleSalaryItemInfo", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; export const editSingleSalaryItem = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +// 基数调整记录列表 +export const getAdjustHistoryList = (params) => { + return postFetch("/api/bs/hrmsalary/archives/getAdjustHistoryList", params); +}; diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js index 6297dfa8..3b70ee59 100644 --- a/pc4mobx/hrmSalary/apis/statistics.js +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -106,3 +106,19 @@ export const salaryStatisticsPushGetDetail = (params) => { export const salaryStatisticsPushAddSharedSendMsg = (params) => { return postFetch("/api/bs/salaryreport/salary/statistics/push/addSharedSendMsg", params); }; +//薪酬统计维度-切换薪资项目 +export const statisticsItemChangetab = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/item/changeTab", "GET", 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/pages/reportView/components/customStatisticsItemsModal-统计范围设置弹框重构.js b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal-统计范围设置弹框重构.js new file mode 100644 index 00000000..49f5a462 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal-统计范围设置弹框重构.js @@ -0,0 +1,422 @@ +/* + * Author: 黎永顺 + * name: 新建自定义统计项目弹框 + * Description: + * Date: 2023/4/10 + */ +import React, { Component } from "react"; +import { Button, message, Modal } from "antd"; +import { + WeaBrowser, + WeaCheckbox, + WeaDialog, + WeaError, + WeaFormItem, + WeaHelpfulTip, + WeaInput, + WeaInputNumber, + WeaLocaleProvider, + WeaTable +} from "ecCom"; +import { reportStatisticsItemSave, statisticsItemGetform } from "../../../apis/statistics"; +import "../index.less"; + +const { getLabel } = WeaLocaleProvider; + +class CustomStatisticsItemsModal extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + columns: [], + dataSource: [], + formData: { + itemValue: "", itemValueSpan: "", + itemName: "" + } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.statisticsItemGetform({ id: nextProps.statisticsItemId }); + } else { + this.setState({ + columns: [], + dataSource: [], + formData: { + itemValue: "", itemValueSpan: "", + itemName: "" + } + }); + } + } + + handleSaveStatisticalItems = () => { + const { dataSource, formData } = this.state; + const { id: statReportId, statisticsItemId } = this.props; + const { itemValue, itemName } = formData; + const isNoRules = _.some(dataSource, it => !!it.m2mValue || !!it.ratioValue || !!it.totalValue || !!it.y2yValue); + const isChainRequired = _.some(dataSource, it => !!it.m2mValue && (!it.m2mLowerLimit || !it.m2mUpperLimit)); + const isChainValRight = _.some(dataSource, it => !!it.m2mValue && it.m2mLowerLimit !== 0 && it.m2mUpperLimit !== 0 && (Number(it.m2mLowerLimit) > Number(it.m2mUpperLimit))); + const isYoyRequired = _.some(dataSource, it => !!it.y2yValue && (!it.y2yLowerLimit || !it.y2yUpperLimit)); + const isYoyValRight = _.some(dataSource, it => !!it.y2yValue && it.y2yLowerLimit !== 0 && it.y2yUpperLimit !== 0 && (Number(it.y2yLowerLimit) > Number(it.y2yUpperLimit))); + if (!itemValue && !itemName) { + this.refs.proError.showError(); + this.refs.nameError.showError(); + return; + } + if (!itemValue) { + this.refs.proError.showError(); + return; + } + if (!itemName) { + this.refs.nameError.showError(); + return; + } + if (!isNoRules) { + message.warning(getLabel(111, "请至少设置一个统计规则")); + return; + } + if (isChainRequired) { + message.warning(getLabel(111, "请完善环比增幅正常区间设置上下限")); + return; + } + if (isChainValRight) { + message.warning(getLabel(111, "环比增幅上下限设置错误")); + return; + } + if (isYoyRequired) { + message.warning(getLabel(111, "请完善同比增幅正常区间设置上下限")); + return; + } + if (isYoyValRight) { + message.warning(getLabel(111, "同比增幅上下限设置错误")); + return; + } + let payload = { statReportId, itemValue: itemValue.split(","), itemName }; + payload = { + id: statisticsItemId, + ...payload, + ..._.reduce(dataSource, (pre, cur) => { + if (!!cur.m2mValue || !!cur.ratioValue || !!cur.totalValue || !!cur.y2yValue) { + const { y2yLowerLimit, y2yUpperLimit, m2mLowerLimit, m2mUpperLimit } = cur; + if (!!cur.m2mValue) { + return { + ...pre, + [`${cur["id"]}Rule`]: { + m2mValue: cur.m2mValue.toString(), + ratioValue: cur.ratioValue.toString(), + totalValue: cur.totalValue.toString(), + y2yValue: cur.y2yValue.toString(), + m2mLowerLimit: m2mLowerLimit.toString(), + m2mUpperLimit: m2mUpperLimit.toString() + } + }; + } + if (!!cur.m2mValue) { + return { + ...pre, + [`${cur["id"]}Rule`]: { + m2mValue: cur.m2mValue.toString(), + ratioValue: cur.ratioValue.toString(), + totalValue: cur.totalValue.toString(), + y2yValue: cur.y2yValue.toString(), + y2yLowerLimit: y2yLowerLimit.toString(), + y2yUpperLimit: y2yUpperLimit.toString() + } + }; + } + if (!!cur.y2yValue && !!cur.y2yValue) { + return { + ...pre, + [`${cur["id"]}Rule`]: { + m2mValue: cur.m2mValue.toString(), + ratioValue: cur.ratioValue.toString(), + totalValue: cur.totalValue.toString(), + y2yValue: cur.y2yValue.toString(), + m2mLowerLimit: m2mLowerLimit.toString(), + m2mUpperLimit: m2mUpperLimit.toString(), + y2yLowerLimit: y2yLowerLimit.toString(), + y2yUpperLimit: y2yUpperLimit.toString() + } + }; + } + return { + ...pre, + [`${cur["id"]}Rule`]: { + m2mValue: cur.m2mValue.toString(), + ratioValue: cur.ratioValue.toString(), + totalValue: cur.totalValue.toString(), + y2yValue: cur.y2yValue.toString() + } + }; + } + return { ...pre }; + }, {}) + }; + if (statisticsItemId) { + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, `确定要编辑统计项吗?编辑后,可能需要重新设置分析图设置。`), + onOk: () => this.reportStatisticsItemSave(payload) + }); + } else { + this.reportStatisticsItemSave(payload); + } + }; + reportStatisticsItemSave = (payload) => { + this.setState({ loading: true }); + reportStatisticsItemSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + this.setState({ + formData: { + itemValue: "", itemName: "" + } + }, () => this.props.onCancel(true)); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + }; + + + statisticsItemGetform = (payload) => { + statisticsItemGetform(payload).then(({ status, data }) => { + if (status) { + const { formData } = this.state; + const { ruleData, baseForm } = data; + const { data: dataDetail } = baseForm; + const { columns, data: dataSource } = ruleData; + this.setState({ + columns, dataSource, + formData: { + ...formData, + itemName: dataDetail ? dataDetail.itemName : "", + itemValue: dataDetail ? _.map(dataDetail.itemValue, it => it.id).join() : "", + itemValueSpan: dataDetail ? _.map(dataDetail.itemValue, it => it.name).join() : "" + } + }); + } + }); + }; + handleChangeColumnCheckBox = (key, value, id) => { + const { dataSource } = this.state; + this.setState({ + dataSource: _.map(dataSource, it => { + if (it.id === id) { + if (key !== "totalValue" && !!value && value !== "0") { + return { + ...it, + totalValue: Number(value), + [key]: Number(value) + }; + } + return { + ...it, + [key]: Number(value) + }; + } + return { ...it }; + }) + }); + }; + handleChangeColumnAllChecked = (key, val) => { + const { dataSource } = this.state; + this.setState({ + dataSource: _.map(dataSource, it => { + if (key !== "totalValue" && !!val && val !== "0") { + return { + ...it, + totalValue: Number(val), + [key]: Number(val) + }; + } + return { + ...it, + [key]: Number(val) + }; + }) + }); + }; + handleChangeColumnM2MValue = (key, value, id) => { + const { dataSource } = this.state; + this.setState({ + dataSource: _.map(dataSource, it => { + if (it.id === id) { + return { + ...it, + [key]: value + }; + } + return { ...it }; + }) + }); + }; + handleChangeStatisticalItems = (itemValue, _names, datas) => { + const { formData } = this.state; + this.setState({ + formData: { + ...formData, + itemValue, + itemValueSpan: _.map(datas, it => it.name).join(","), + itemName: datas.length === 1 ? _.map(datas, it => it.names).join(",") : "" + } + }); + }; + + render() { + const { loading, columns, dataSource, formData } = this.state; + const { itemName, itemValue, itemValueSpan } = formData; + const { statisticsItemId, isShare } = this.props; + const cols = _.map(columns, it => { + const { text, column } = it; + if (column === "ruleName" || column === "ratio" || column === "m2m" || column === "y2y") { + const key = column === "ruleName" ? "total" : column; + return { + ...it, + title: + !!child[`${key}Value`])} + onChange={val => this.handleChangeColumnAllChecked(`${key}Value`, val)} + /> + {text} + , + render: (txt, record) => { + return + this.handleChangeColumnCheckBox(`${key}Value`, val, record.id)} + /> + + {column === "ruleName" ? record["ruleName"] : text} + + ; + } + }; + } else if (column === "m2mLimit") { + return { + ...it, + title: + {text} + 10%,差值和增幅标记为红色,增幅<-10%标记为绿色")} + placement="top" width={200}/> + , + render: (txt, record) => { + return !!record["m2mValue"] && this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} + />; + } + }; + } else if (column === "y2yLimit") { + return { + ...it, + title: + {text} + 10%,差值和增幅标记为红色,增幅<-10%标记为绿色")} + placement="top" width={200}/> + , + render: (txt, record) => { + return !!record["y2yValue"] && this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} + />; + } + }; + } + }); + return ( + + {statisticsItemId ? getLabel(111, "编辑自定义统计项目") : getLabel(111, "新建自定义统计项目")} + { + !isShare && + } + + } + style={{ width: 900, height: 450 }} + className="statisticItemsWrapper" + > +
+ + + ({ + id: it, + name: itemValueSpan.split(",")[idx] + })) : []} + completeParams={{ + type: 162, + fielddbtype: "browser.salaryItemBrowser", + f_weaver_belongto_usertype: "0" + }} + conditionDataParams={{ + type: "browser.salaryItemBrowser", + fielddbtype: "browser.salaryItemBrowser", + f_weaver_belongto_usertype: "0" + }} + dataParams={{ + type: "browser.salaryItemBrowser", + f_weaver_belongto_usertype: "0" + }} + destDataParams={{ + type: "browser.salaryItemBrowser", + f_weaver_belongto_usertype: "0" + }} + isMultCheckbox + inputStyle={{ width: "100%" }} + onChange={this.handleChangeStatisticalItems} + /> + + + + + this.setState({ formData: { ...formData, itemName } })}/> + + +
+ +
+
+
+ ); + } +} + +export default CustomStatisticsItemsModal; +/* + * Author: 黎永顺 + * Description: 区间设置 + * Params: + * Date: 2023/4/23 + */ +const IntervalSettingsComp = (props) => { + const { LowerLimit, UpperLimit, onChange, isShare } = props; + return
+ onChange("min", val)} disabled={isShare}/> + {`% <${getLabel(111, "增幅")}<`} + onChange("max", val)} disabled={isShare}/> + % +
; +}; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js index 49f5a462..a94d2a07 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js @@ -18,7 +18,7 @@ import { WeaLocaleProvider, WeaTable } from "ecCom"; -import { reportStatisticsItemSave, statisticsItemGetform } from "../../../apis/statistics"; +import { reportStatisticsItemSave, statisticsItemChangetab, statisticsItemGetform } from "../../../apis/statistics"; import "../index.less"; const { getLabel } = WeaLocaleProvider; @@ -142,15 +142,24 @@ class CustomStatisticsItemsModal extends Component { } }; } - return { - ...pre, - [`${cur["id"]}Rule`]: { - m2mValue: cur.m2mValue.toString(), - ratioValue: cur.ratioValue.toString(), - totalValue: cur.totalValue.toString(), - y2yValue: cur.y2yValue.toString() - } - }; + if (_.isNil(cur.m2mValue) && _.isNil(cur.ratioValue) && _.isNil(cur.y2yValue)) { + return { + ...pre, + [`${cur["id"]}Rule`]: { + totalValue: cur.totalValue.toString() + } + }; + } else { + return { + ...pre, + [`${cur["id"]}Rule`]: { + m2mValue: cur.m2mValue.toString(), + ratioValue: cur.ratioValue.toString(), + totalValue: cur.totalValue.toString(), + y2yValue: cur.y2yValue.toString() + } + }; + } } return { ...pre }; }, {}) @@ -194,8 +203,8 @@ class CustomStatisticsItemsModal extends Component { formData: { ...formData, itemName: dataDetail ? dataDetail.itemName : "", - itemValue: dataDetail ? _.map(dataDetail.itemValue, it => it.id).join() : "", - itemValueSpan: dataDetail ? _.map(dataDetail.itemValue, it => it.name).join() : "" + itemValue: dataDetail ? dataDetail.itemValue.id : "", + itemValueSpan: dataDetail ? dataDetail.itemValue.name : "" } }); } @@ -263,6 +272,16 @@ class CustomStatisticsItemsModal extends Component { itemValueSpan: _.map(datas, it => it.name).join(","), itemName: datas.length === 1 ? _.map(datas, it => it.names).join(",") : "" } + }, () => { + statisticsItemChangetab({ itemId: itemValue }).then(({ status, data }) => { + if (status) { + const { ruleData } = data; + const { columns, data: dataSource } = ruleData; + this.setState({ + columns, dataSource + }); + } + }); }); }; @@ -352,10 +371,7 @@ class CustomStatisticsItemsModal extends Component { ({ id: it, @@ -379,7 +395,7 @@ class CustomStatisticsItemsModal extends Component { type: "browser.salaryItemBrowser", f_weaver_belongto_usertype: "0" }} - isMultCheckbox + // isMultCheckbox inputStyle={{ width: "100%" }} onChange={this.handleChangeStatisticalItems} /> diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index 70980238..37700a22 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -12,6 +12,7 @@ import ChartsRangeSettingsModal from "./chartsRangeSettingsModal"; import { mapBarOptions, mapLineOptions, mapPieOptions } from "./condition"; import { queryRangeSetting, reportStatisticsReportGetData } from "../../../apis/statistics"; import PovitpivotChartModal from "./povitpivotChartModal"; +import { getSalaryMonthValue } from "./statisticalMicroSettingsSlide"; import "../index.less"; class ReportContent extends Component { @@ -43,7 +44,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, nextProps.report.isShare); + this.reportStatisticsReportGetData(nextProps.report); this.setState({ viewType: "dataView", chartsInfo: {} }); } } @@ -81,8 +82,13 @@ class ReportContent extends Component { dataSource, columns, showSum, countResult }), "*"); }; - reportStatisticsReportGetData = (id, dimensionId, isShare) => { - const payload = { id, dimensionId, isShare }; + reportStatisticsReportGetData = (params) => { + const { id, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start } = params; + const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType); + const payload = { + id, dimensionId, isShare, + salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01" + }; this.setState({ loading: true }); reportStatisticsReportGetData(payload).then(({ status, data }) => { this.setState({ loading: false }); @@ -191,13 +197,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, isShare } } = this.props; + const { report: { id: reportId } } = 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, isShare); + this.reportStatisticsReportGetData(this.props.report); }); viewType === "setting" && this.setState({ rangSet: { ...rangSet, visible: true, reportId } }, () => { this.queryRangeSetting({ reportId, chartsType }); @@ -213,8 +219,7 @@ class ReportContent extends Component { }; handleGetData = () => { const { report } = this.props; - const { id, dimensionId, isShare } = report; - this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId, isShare)); + this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(report)); }; renderCharts = () => { const { chartsInfo, viewType } = this.state; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 32f074d1..35b36fa5 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -32,6 +32,7 @@ import { import { commonEnumList } from "../../../apis/ruleconfig"; import { getTaxAgentSelectList } from "../../../apis/taxAgent"; import { condition } from "./condition"; +import cs from "classnames"; import "../index.less"; const getKey = WeaTools.getKey; @@ -47,6 +48,7 @@ class StatisticalMicroSettingsSlide extends Component { dataSource: [], unitTypeList: [], salaryMonth: [], + timeType: 10, statisticalItemPayload: { visible: false, id: "", dimension: "", statisticsItemId: "", isShare: false @@ -96,8 +98,9 @@ class StatisticalMicroSettingsSlide extends Component { const { form } = this.props; reportStatisticsGetSearchCondition({ id }).then(({ status, data }) => { if (status && !_.isEmpty(data)) { - const { salaryEndMonth, salaryStartMonth, ...formData } = data.data; + const { salaryEndMonth, salaryStartMonth, timeType, ...formData } = data.data; this.setState({ + timeType, salaryMonth: [salaryStartMonth || moment().startOf("year").format("YYYY-MM"), salaryEndMonth || moment().format("YYYY-MM")] }); const fields = _.map(conditions[0].items, it => it.domkey[0]); @@ -118,7 +121,7 @@ class StatisticalMicroSettingsSlide extends Component { }); }; reportStatisticsSaveSearchCondition = () => { - const { salaryMonth, dataSource } = this.state; + const { salaryMonth, timeType, dataSource } = this.state; const { form, id, dimension, onClose } = this.props; const [salaryStartMonth, salaryEndMonth] = salaryMonth; const { department, employee, position, subCompany, taxAgent, ...extra } = form.getFormDatas(); @@ -128,7 +131,7 @@ class StatisticalMicroSettingsSlide extends Component { return; } const payload = { - dimension, id, + dimension, id, timeType, hiredate: extra["hiredate1__hiredate2"].value || [], department: _.map(department.valueObj, it => ({ id: it.id, name: it.name })), employee: _.map(employee.valueObj, it => ({ id: it.id, name: it.name })), @@ -233,7 +236,7 @@ class StatisticalMicroSettingsSlide extends Component { render() { const { salaryMonth, conditions, selectedRowKeys, loading, - statisticalItemPayload, dataSource, unitTypeList + statisticalItemPayload, dataSource, unitTypeList, timeType } = this.state; const { id, dimension, isShare } = this.props; const columns = [ @@ -288,8 +291,8 @@ class StatisticalMicroSettingsSlide extends Component { - this.setState({ salaryMonth: v })}/> + this.setState({ salaryMonth: v, timeType })}/> @@ -344,6 +347,69 @@ const TitleDialog = (props) => { ; }; +const StatisticalScopePicker = (props) => { + const scopeBtns = [ + { key: 1, label: getLabel(111, "上月") }, + { key: 2, label: getLabel(111, "本月") }, + { key: 3, label: getLabel(111, "一季度") }, + { key: 4, label: getLabel(111, "二季度") }, + { key: 5, label: getLabel(111, "三季度") }, + { key: 6, label: getLabel(111, "四季度") }, + { key: 7, label: getLabel(111, "上半年") }, + { key: 8, label: getLabel(111, "下半年") }, + { key: 9, label: getLabel(111, "本年") } + ]; + const { timeType, dateRange, onChange, viewAttr, disabled = false } = props; + const [startDate, endDate] = dateRange || []; + return
+
+ { + _.map(scopeBtns.slice(0, 2), o => ( + )) + } +
+
+ { + _.map(scopeBtns.slice(2, 6), o => ( + )) + } +
+
+ { + _.map(scopeBtns.slice(6), o => ( + )) + } +
+
+ onChange([], 10)}>{getLabel(111, "指定月份")} +
+ { + return current && endDate && current.getTime() > new Date(endDate).getTime(); + }} + format="YYYY-MM" + onChange={(val) => onChange([val, endDate], timeType)} + viewAttr={viewAttr} + /> + + { + return current && startDate && current.getTime() < new Date(startDate).getTime(); + }} + format="YYYY-MM" + viewAttr={viewAttr} + onChange={(val) => onChange([startDate, val], timeType)} + /> +
+
+
; +}; export const MonthRangePicker = (props) => { const { dateRange, onChange, viewAttr, disabled = false } = props; const [startDate, endDate] = dateRange || []; @@ -369,3 +435,48 @@ export const MonthRangePicker = (props) => { /> ; }; +// 获取所属月份值 +export const getSalaryMonthValue = (dateType) => { + let start = "", end = ""; + switch (dateType) { + case 1: + start = moment().add(-1, "month").startOf("month").format("YYYY-MM"); + end = moment().add(-1, "month").endOf("month").format("YYYY-MM"); + break; + case 2: + start = moment().startOf("month").format("YYYY-MM"); + end = moment().endOf("month").format("YYYY-MM"); + break; + case 3: + start = moment().year() + "-01"; + end = moment().year() + "-03"; + break; + case 4: + start = moment().year() + "-04"; + end = moment().year() + "-06"; + break; + case 5: + start = moment().year() + "-07"; + end = moment().year() + "-09"; + break; + case 6: + start = moment().year() + "-10"; + end = moment().year() + "-12"; + break; + case 7: + start = moment().startOf("year").format("YYYY-MM"); + end = moment().endOf("year").subtract(6, "month").format("YYYY-MM"); + break; + case 8: + start = moment().startOf("year").add(6, "month").format("YYYY-MM"); + end = moment().endOf("year").format("YYYY-MM"); + break; + case 9: + start = moment().startOf("year").format("YYYY-MM"); + end = moment().endOf("year").format("YYYY-MM"); + break; + default: + break; + } + return [start, end]; +}; diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index ffe5a3db..82f935e5 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -10,9 +10,10 @@ import { WeaLeftRightLayout, WeaLocaleProvider, WeaSelect, WeaTop } from "ecCom" 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 StatisticalMicroSettingsSlide, { getSalaryMonthValue } from "./components/statisticalMicroSettingsSlide"; import { reportGetForm, reportStatisticsReportSave } from "../../apis/ruleconfig"; +import { convertToUrlString } from "../../util/url"; +import TopBtns from "./components/topBtns"; import "./index.less"; @@ -92,8 +93,13 @@ 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}`, "_blank"); + const { id, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start } = report; + const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType); + const payload = { + id, dimensionId, isShare, + salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01" + }; + window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?${convertToUrlString(payload)}`, "_blank"); }; render() { @@ -113,7 +119,7 @@ class Index extends Component { ref={dom => this.leftTabRef = dom} onChangeTab={report => this.setState({ - report, + report: !_.isNil(report) ? report : this.state.report, statisticalPayload: { visible: false, id: "", dimension: "" } })} /> @@ -152,7 +158,7 @@ class Index extends Component { taxAgentAdminOption={taxAgentOption} isShare={isShare} onClose={(isRefresh) => this.setState({ statisticalPayload: { visible: false, id: "", dimension: "" } - }, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId, report.isShare))} + }, () => isRefresh && this.leftTabRef.reportStatisticsReportList())} /> diff --git a/pc4mobx/hrmSalary/pages/reportView/index.less b/pc4mobx/hrmSalary/pages/reportView/index.less index ecf9b997..e1e94313 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.less +++ b/pc4mobx/hrmSalary/pages/reportView/index.less @@ -304,6 +304,36 @@ display: flex; align-items: center; } + + .date-set-area { + .date-item { + margin-bottom: 5px; + + button { + margin-right: 10px; + } + } + + .data-picker { + display: flex; + align-items: center; + + .title { + color: #5d9cec; + cursor: pointer; + font-size: 12px; + margin-right: 10px; + } + + .show-data-picker { + display: flex; + } + + .hide-data-picker { + display: none !important; + } + } + } } //新建自定义统计项目 diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js index 84bcb6ff..e4e94622 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js @@ -1,3 +1,10 @@ +import { WeaSwitch } from "comsMobx"; +import { Button } from "antd"; +import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + export const tabCondition = [ { color: "#000000", @@ -33,5 +40,99 @@ export const tabCondition = [ showcount: true, title: "非系统人员", viewcondition: "ext" - }, + } ]; +export const logConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "BROWSER", + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + linkUrl: "/hrm/resource/HrmResource.jsp?id=", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "1" + }, + domkey: ["employeeId"], + fieldcol: 17, + label: "对象", + lanId: 106, + labelcol: 7, + value: "" + }, + { + colSpan: 1, + conditionType: "BROWSER", + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + linkUrl: "/hrm/resource/HrmResource.jsp?id=", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "1" + }, + domkey: ["operator"], + fieldcol: 17, + label: "操作人", + lanId: 111, + labelcol: 7, + value: "" + } + ], + defaultshow: true + } +]; +export const getLogSearchsForm = (form, condition, onSearch = () => void (0)) => { + const { isFormInit } = form; + const formParams = form.getFormParams(); + let group = []; + isFormInit && condition && condition.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + + { + getKey(fields) === "operator" && + + } + ), + colSpan: 1 + }); + }); + group.push( + ); + }); + return group; +}; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 66ce8099..e676e5c4 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -17,6 +17,7 @@ import UnifiedTable from "../../../components/UnifiedTable"; import { convertToUrlString, getURLParameters } from "../../../util/url"; import { salaryArchiveDelete } from "../../../apis/payrollFiles"; import ImportDialog from "../../../components/importDialog"; +import OperateLogDialog from "./operateLogDialog"; import "./index.less"; import { sysinfo } from "../../../apis/ruleconfig"; @@ -66,7 +67,8 @@ export default class Archives extends React.Component { link: "", importResult: {}, imageId: "", previewUrl: "/api/bs/hrmsalary/scheme/preview" }, - extEmpsWitch: "1" //非系统人员开关, 1: 开启, 0:关闭 + extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭 + logDialog: { visible: false } }; this.record = {}; } @@ -627,7 +629,8 @@ export default class Archives extends React.Component { tabCount, loading, importDialog, - extEmpsWitch + extEmpsWitch, + logDialog } = this.state; const { form, condition, showSearchAd, setShowSearchAd, @@ -814,10 +817,15 @@ export default class Archives extends React.Component { return (
} // 左侧图标 - iconBgcolor="#F14A2D" // 左侧图标背景色 - showDropIcon={false} // 是否显示下拉按钮 + title="社保福利档案" icon={} iconBgcolor="#F14A2D" showDropIcon={true} + dropMenuDatas={[ + { + key: "log", + icon: , + content: getLabel(111, "操作日志"), + onClick: key => this.setState({ logDialog: { ...logDialog, visible: true } }) + } + ]} >
+ {/*操作日志*/} + this.setState({ logDialog: { ...logDialog, visible: false } })} + /> { this.state.editSlideVisible && ({ + ...it, items: _.map(it.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + })) + }, () => logForm.initFormFields(this.state.conditions)); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getAdjustHistoryList(); + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.setState({ + dataSource: [], columns: [], pageInfo: { current: 0, pageSize: 10, total: 0 }, + loading: false + }); + } + } + + getAdjustHistoryList = (extra = {}) => { + const { pageInfo } = this.state; + const { archivesStore: { logForm } } = this.props; + const payload = { ...pageInfo, ...logForm.getFormParams(), ...extra }; + this.setState({ loading: true }); + getAdjustHistoryList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, columns: _.map(columns, it => { + if (it.dataIndex === "operateTime") { + return { ...it, render: (text) => ({moment(text).format("YYYY-MM-DD")}) }; + } + return { ...it }; + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { loading, dataSource, columns, pageInfo, conditions } = this.state; + const { archivesStore: { logForm } } = this.props; + 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.getAdjustHistoryList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getAdjustHistoryList()); + } + }; + const scrollHeight = this.logRef ? this.logRef.state.height - 210 : 606.6; + return ( + this.logRef = dom} className="logDialog" initLoadCss + style={{ + width: 1150, + height: 606.6, + minHeight: 200, + minWidth: 380, + maxHeight: "90%", + maxWidth: "90%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ {getLogSearchsForm(logForm, conditions, () => this.getAdjustHistoryList({ current: 1 }))} + +
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/stores/archives.js b/pc4mobx/hrmSalary/stores/archives.js index 383e585d..096a5ab7 100644 --- a/pc4mobx/hrmSalary/stores/archives.js +++ b/pc4mobx/hrmSalary/stores/archives.js @@ -8,6 +8,13 @@ import * as API from "../apis/welfareArchive"; // 引入API接口文件 const { TableStore } = WeaTableNew; export class ArchivesStore { + @observable logForm = new WeaForm(); // 社保福利档案重构-日志查询条件log + + + + + + @observable tableStore = new TableStore( // {dataHandle: (datas) => { // return dataSource; 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();