diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js index a4d16bbc..9f2aa6d4 100644 --- a/pc4mobx/hrmSalary/apis/statistics.js +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -142,6 +142,10 @@ export const savePageListSetting = (params) => { export const savePageListTemplate = (params) => { return postFetch("/api/bs/hrmsalary/common/pageList/template/save", params); }; +// 薪酬统计报表-导出模板示例下载 +export const downloadPageListTemplate = (params) => { + return postExportFetch("/api/bs/hrmsalary/common/pageList/template/file/download", params); +}; //薪酬统计报表-获取页面模板 export const getPageListTemplatelist = (params) => { return postFetch("/api/bs/hrmsalary/common/pageList/template/list", params); diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js index 924662b3..63108170 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js @@ -232,6 +232,25 @@ export const tempCondition = [ rules: "required|string", viewAttr: 3 }, + { + conditionType: "UPLOAD", + domkey: ["fileId"], + fieldcol: 14, + label: "导出模板", + lanId: 111, + labelcol: 6, + value: "", + datas: [], + multiSelection: false, + showClearAll: false, + showListBottom: true, + showListTop: true, + maxFilesNumber: 1, + limitType: "xlsx", + uploadUrl: "/api/doc/upload/uploadFile", + category: "111", + viewAttr: 2 + }, { conditionType: "SELECT", domkey: ["sharedType"], diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index 657c4dfb..e791e76e 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -32,7 +32,8 @@ class SalaryDetails extends Component { this.state = { loading: false, dataSource: [], columns: [], selectedRowKeys: [], tempPageList: [], sumRow: {}, pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "", tempManageQuery: false, - showTotalCell: false, updateSum: true, tempDialog: { visible: false, setting: [], id: "", template: {} }, + showTotalCell: false, updateSum: true, + tempDialog: { visible: false, setting: [], heads: [], id: "", template: {} }, transferDialog: { visible: false, searchParamsKey: "name", saveLoading: false, dataParams: { page: "salary_details_report" }, @@ -200,9 +201,14 @@ class SalaryDetails extends Component { }; handelAddTemp = (templateId = "") => { const { tempDialog, tempPageList } = this.state; + if (_.isEmpty(this.transferRef.state.rightDatas)) { + message.warning(getLabel(111, "请选择设置!")); + return; + } this.setState({ tempDialog: { - ...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id) + ...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id), + heads: _.map(this.transferRef.state.rightDatas, o => o.name) // template: _.find(tempPageList, o => o.key === templateId) } }); @@ -303,7 +309,7 @@ class SalaryDetails extends Component { {/*薪资明细模板设置*/} this.setState({ - tempDialog: { ...tempDialog, visible: false, setting: [] } + tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] } }, () => callback && callback())} onSuccess={this.getPageListTemplatelist}/> {/*薪资明细自定义列模板管理*/} diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js index 5fc57e80..8c971aae 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js @@ -9,10 +9,11 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { WeaDialog, WeaLoadingGlobal, WeaLocaleProvider, WeaTools } from "ecCom"; import { tempCondition } from "./conditions"; import { getTaxAgentSelectList } from "../../../apis/taxAgent"; import * as API from "../../../apis/statistics"; +import { downloadPageListTemplate } from "../../../apis/statistics"; import { Button, message } from "antd"; import { getSearchs } from "../../../util"; @@ -57,6 +58,13 @@ class SalaryDetailTempDialog extends Component { value: id ? template["limitIds"].join(",") : "", options: _.map(data, o => ({ key: o.id, showname: o.content })) }; + } else if (getKey(o) === "fileId") { + return { + ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "", + datas: id && template[getKey(o)] ? [ + { fileid: template[getKey(o)], filename: template["fileName"], showDelete: true } + ] : [], labelExtra: getLabel(111, "下载示例"), labelType: "download" + }; } return { ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "" }; }) @@ -73,12 +81,13 @@ class SalaryDetailTempDialog extends Component { tempForm.validateForm().then(f => { if (f.isValid) { this.setState({ loading: true }); - const { limitIds, ...formVal } = tempForm.getFormParams(); + const { limitIds, fileId, ...formVal } = tempForm.getFormParams(); const payload = { page: "salary_details_report", setting, id, ...formVal, limitIds: !_.isEmpty(limitIds) ? limitIds.split(",") : [] }; - API.savePageListTemplate(payload).then(({ status, errormsg }) => { + API.savePageListTemplate(_.assign(payload, fileId ? { fileId } : {})).then(({ status, errormsg }) => { + this.setState({ loading: false }); if (status) { message.success(getLabel(111, "操作成功!")); this.props.onCancel(this.props.onSuccess()); @@ -92,6 +101,12 @@ class SalaryDetailTempDialog extends Component { }).catch(() => this.setState({ loading: false })); }; formFieldChange = (field) => { + if (field === "download") { + const { setting, heads } = this.props; + WeaLoadingGlobal.start(); + const promise = downloadPageListTemplate({ setting, heads }); + return; + } const key = Object.keys(field)[0], value = field[key].value; this.setState({ conditions: _.map(this.state.conditions, item => ({ @@ -101,6 +116,12 @@ class SalaryDetailTempDialog extends Component { ...o, hide: value !== "0", viewAttr: value === "0" ? 3 : 1, rules: value === "0" ? "required|string" : "" }; + } else if (key === "fileId" && getKey(o) === "fileId") { + return { + ...o, value, datas: value ? _.map(field[key].valueSpan, o => ({ + fileid: o.fileid, filename: o.filename, showDelete: true + })) : [] + }; } return { ...o }; }) @@ -118,7 +139,8 @@ class SalaryDetailTempDialog extends Component { {getLabel(537558, "保存")}]}> -
{getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}
+
{getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}
); } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempAdminDialog.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempAdminDialog.js index 0006cac0..8eecb1ab 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempAdminDialog.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempAdminDialog.js @@ -40,6 +40,11 @@ class SalaryTempAdminDialog extends Component { render() { const { dataSource, selectedKeys } = this.state, { dataParams } = this.props; + const heads = _.reduce(selectedKeys, (pre, cur) => { + const item = dataSource.find(data => data.id === cur); + if (item) pre.push(item.name); + return pre; + }, []); return ( this.dialog = dom} title={getLabel(111, "模板管理")} className="temp_admin_dialog" style={{ @@ -47,7 +52,7 @@ class SalaryTempAdminDialog extends Component { maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" }} buttons={[ , + onClick={() => this.props.onAddTemp(dataParams.id, selectedKeys, heads)}>{getLabel(111, "确 定")}, ]}> this.setState({ selectedKeys: v })} diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js index 4f5696c9..9b309e4d 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js @@ -20,7 +20,7 @@ class SalaryTempMangerDialog extends Component { super(props); this.state = { selectedRowKeys: [], tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } }, - tempDialog: { visible: false, setting: [], id: "", template: {} } + tempDialog: { visible: false, setting: [], heads: [], id: "", template: {} } }; } @@ -31,10 +31,10 @@ class SalaryTempMangerDialog extends Component { handleTempAdminCols = (params = {}) => this.setState({ tempAdminDialog: { visible: true, dataParams: { ...this.state.tempAdminDialog.dataParams, ...params } } }); - handelAddTemp = (id = "", setting = []) => { + handelAddTemp = (id = "", setting = [], heads = []) => { this.setState({ tempDialog: { - visible: true, setting, id, template: _.find(this.tempManageRef.state.listDatas, o => o.id === id) + visible: true, setting, heads, id, template: _.find(this.tempManageRef.state.listDatas, o => o.id === id) } }); }; @@ -76,7 +76,7 @@ class SalaryTempMangerDialog extends Component { {/*薪资明细模板设置*/} this.setState({ - tempDialog: { ...tempDialog, visible: false, setting: [] } + tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] } }, () => callback && callback())} onSuccess={() => this.setState({ tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less index 40c137f0..7d481333 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less @@ -382,3 +382,17 @@ } } + +.tempDialog { + .wea-form-item-label { + min-height: 50px; + } + + .wea-form-item-label-extra { + position: absolute; + left: 0; + bottom: 0; + cursor: pointer; + color: #4d7ad8; + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js index 2380cfae..1e6eaac0 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js @@ -46,7 +46,8 @@ class EditSalaryBaseInfo extends Component { default: break; } - return this.props.onChange(_.map(this.props.baseInfo, it => { if (fieldCode === it.fieldCode) { return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } }; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/calcAnchorList.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/calcAnchorList.js new file mode 100644 index 00000000..a8cecca3 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/calcAnchorList.js @@ -0,0 +1,110 @@ +/* + * 核算编辑 + * 数据查看锚点 + * @Author: 黎永顺 + * @Date: 2025/2/10 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import classnames from "classnames"; + +const getLabel = WeaLocaleProvider.getLabel; + +class CalcAnchorList extends Component { + constructor(props) { + super(props); + this.state = { + collapsed: false, currentIndex: 0 + }; + this.isClickRef = null; + this.timerRef = null; + } + + componentDidMount() { + document.getElementById("salary_anchor_area").addEventListener("scroll", this.handlerScroll); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + collapsed: false, + currentIndex: 0 + }); + } + + componentWillUnmount() { + document.getElementById("salary_anchor_area").removeEventListener("scroll", this.handlerScroll); + } + + handlerScroll = () => { + // 点击锚点时,不执行滚动函数 + if (this.isClickRef) return; + // 获取滚动容器的滚动高度(这里相对于#salary_anchor_area滚动的) + const scrollTop = document.getElementById("salary_anchor_area").scrollTop; + // 获取所有wea-search-group anchor_开头的元素集合 + const contentList = document.querySelectorAll("[class^='wea-search-group anchor_']"); + const offsetTopArr = []; + contentList.forEach((item) => { + // 获取每个wea-search-group anchor_开头的元素的offsetTop + offsetTopArr.push(item.offsetTop); + }); + for (let i = 0; i < offsetTopArr.length; i++) { + // 当滚动条高度达到对应wea-search-group anchor_开头的元素的滚动高度、则将锚点设置为高亮状态 + if (scrollTop + 190 >= offsetTopArr[i]) this.setState({ currentIndex: i }); + } + }; + onClickAnchor = (item, index) => { + const anchorElement = document.getElementById("salary_anchor_area"); + const el = document.querySelector(`.anchor_${item.salarySobItemGroupId}`); + if (el) { + anchorElement.scroll({ top: el.offsetTop, behavior: "smooth" }); + } + this.setState({ currentIndex: index }); + // 点击时设置为true,为了防止同时执行滚动事件 + this.isClickRef = true; + // 清除定时器,防止滚动事件触发、出现走马灯闪烁问题 + if (this.timerRef) clearTimeout(this.timerRef); + this.timerRef = setTimeout(() => { + this.isClickRef = false; + }, 1000); + }; + + render() { + const { collapsed, currentIndex } = this.state, { datas } = this.props; + return ( +
+
+ { + collapsed ? +
+ this.setState({ collapsed: !collapsed })}/> +
: + +
+ this.setState({ collapsed: !collapsed })}/> +
+
+
+ +
+ {_.map(datas, (o, i) => ( +
this.onClickAnchor(o, i)}> + {o.salarySobItemGroupName} +
) + )} +
+
+ } +
+
+ ); + } +} + +export default CalcAnchorList; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index aa6baf65..986bb1bb 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -30,7 +30,7 @@ class EditCalcTable extends Component { this.state = { loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], progressVisible: false, progress: 0, - salaryCalcSlide: { visible: false, id: "" }, originPayloadData: {}, + salaryCalcSlide: { visible: false, id: "", viewAttr: 2 }, originPayloadData: {}, batchUpdateDialog: { visible: false, salaryAcctRecordId: "", idList: [], salaryItemId: "", conditions: [], pattern: 0, dataType: "" @@ -73,9 +73,9 @@ class EditCalcTable extends Component { this.updateEmpLockStatus({ ...params }); break; case "EDIT": - const { id: salaryCalcId } = params; + const { id: salaryCalcId, showSee } = params; this.setState({ - salaryCalcSlide: { visible: true, id: salaryCalcId } + salaryCalcSlide: { visible: true, id: salaryCalcId, viewAttr: showSee ? 1 : 2 } }); break; case "DIAGRAM": @@ -238,7 +238,7 @@ class EditCalcTable extends Component { "总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"), "批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"), "查看拓扑图": getLabel(111, "查看拓扑图"), "锁定": getLabel(111, "锁定"), - "解锁": getLabel(111, "解锁") + "解锁": getLabel(111, "解锁"), "查看": getLabel(111, "查看") }; this.setState({ originPayloadData: { ...payload, i18n } }); const childFrameObj = document.getElementById("atdTable"); @@ -269,7 +269,7 @@ class EditCalcTable extends Component { const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : ""; this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload, - calcDetail, + calcDetail, showSee: calcDetail, columns: _.every(traverse(columns, calcDetail), (it, idx) => !it.fixed) ? _.map(traverse(columns, calcDetail), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false @@ -304,10 +304,7 @@ class EditCalcTable extends Component { /> this.setState({ - salaryCalcSlide: { - visible: false, - id: "" - } + salaryCalcSlide: { visible: false, id: "", viewAttr: 2 } }, () => isFresh === "true" && this.queryCalcResultList())}/> { progressVisible && diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js index 235bac13..9da20706 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js @@ -12,9 +12,9 @@ import PayrollItemsTable from "../../../../calculateDetail/payrollItemsTable"; import IssuedAndReissueTable from "../../../../calculateDetail/issuedAndReissueTable"; import { acctresultDetail, saveAcctResult } from "../../../../../apis/calculate"; import { toDecimal_n } from "../../../../../util"; +import CalcAnchorList from "./calcAnchorList"; import "./index.less"; - const getLabel = WeaLocaleProvider.getLabel; class EditSalaryCalcSlide extends Component { @@ -29,7 +29,7 @@ class EditSalaryCalcSlide extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) this.acctresultDetail(nextProps.id); - if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedKey: "0" }); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedKey: "0" }, () => document.getElementById("salary_anchor_area").scrollTop = 0); } acctresultDetail = (id) => { @@ -43,14 +43,17 @@ class EditSalaryCalcSlide extends Component { }); }; renderTitle = () => { - const { loading } = this.state; + const { loading } = this.state, { viewAttr } = this.props; return
-
{getLabel(543559, "编辑薪资")}
+
{viewAttr === 2 ? getLabel(543559, "编辑薪资") : getLabel(111, "查看薪资")}
- + { + viewAttr === 2 && + + }
; }; @@ -139,7 +142,9 @@ class EditSalaryCalcSlide extends Component { className="salary-calculate-esf-layout" {...this.props} top={0} width={60} height={100} measure={"%"} direction={"right"} title={this.renderTitle()} - content={
+ content={
+ {/*锚点*/} + this.setState({ baseInfo })}/> { selectedKey === "0" && _.map(itemsByGroup, item => { - return ; + return ; }) } { selectedKey === "1" && diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less index e2d8ce9b..4e3fb3b4 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less @@ -142,6 +142,7 @@ height: 100%; .salary-calculate-esf-area { + position: relative; background: #f6f6f6; height: 100%; overflow-y: auto; @@ -191,6 +192,109 @@ .wea-search-group { padding: 0; } + + //锚点按钮 + .anchor-list-collapsed { + padding: 0 !important; + } + + .anchor-list-wrapper { + position: absolute; + right: 0; + margin: 10px 15px 20px; + padding: 8px 10px; + overflow: auto; + background-color: #fff; + box-shadow: 0 3px 12px 0 rgba(0, 0, 0, .12); + border-radius: 3px; + cursor: pointer; + + .anchor-list-collapsed-btn { + opacity: .5; + background: #000; + color: #fff; + border-radius: 3px; + width: 30px; + height: 30px; + display: flex; + align-items: center; + justify-content: center; + font-size: 16px; + } + + .anchor-list-header { + display: flex; + align-items: center; + justify-content: flex-end; + min-width: 130px; + padding: 5px; + } + + .anchor-list { + padding: 0 10px; + position: relative; + margin-top: 10px; + transition: margin-top .3s; + + .anchor-list-ink { + position: absolute; + top: 0; + left: 5px; + height: 100%; + + .anchor-list-ink-ball.visible { + display: inline-block; + } + + .anchor-list-ink-ball { + position: absolute; + left: 50%; + display: none; + width: 3px; + height: 8px; + background-color: #5d9cec; + border: 1.5px solid #5d9cec; + border-radius: 8px; + transform: translateX(-50%); + transition: top .3s ease-in-out; + } + } + + .anchor-list-ink:before { + position: relative; + display: block; + width: 1px; + height: 100%; + margin: 0 auto; + background-color: #f0f0f0; + content: " "; + } + + .anchor-list-link { + padding: 7px 0 7px 10px; + line-height: 1.143; + + .anchor-list-link-title { + position: relative; + display: block; + overflow: hidden; + color: #666; + white-space: nowrap; + text-overflow: ellipsis; + transition: all .3s; + cursor: pointer; + outline: none; + text-decoration: none; + background-color: transparent; + } + } + + .anchor-list-link-active > .anchor-list-link-title { + color: #5d9cec; + } + } + } + } } } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js index bf1c1286..65189b7e 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js @@ -29,10 +29,11 @@ class IssuedAndReissueTable extends Component { /> , render: (text, record) => { - const { canEdit, pattern } = record; + const { canEdit, pattern } = record, { viewAttr } = this.props; return onChangeIssueReissueValue(record.salaryItemName, value, "issuedAndReissueItems")} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js index 9d2ddfce..9f196d5f 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js @@ -37,8 +37,9 @@ class PayrollItemsTable extends Component { , width: "20%", render: (text, record) => { - const { canEdit, dataType, pattern } = record; + const { canEdit, dataType, pattern } = record, { viewAttr } = this.props; return dataType === "number" ? : onChangeIssueReissueValue(record.salaryItemId, value, "itemsByGroup", salarySobItemGroupId)} />; } @@ -66,7 +68,7 @@ class PayrollItemsTable extends Component { } ]; return ( - + { + getTaxAgentSelectListAsAdmin = async (props) => { + const { data: sysinfo } = await API.sysinfo(); const { declareStore: { declareForm } } = props; postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }) .then(({ status, data }) => { @@ -46,6 +48,11 @@ class Index extends Component { options: _.map(data, g => ({ key: String(g.id), showname: g.name })) // helpfulTitle: getLabel(563420, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;") }; + } else if (getKey(o) === "salaryMonthStr") { + return { + ...o, + label: sysinfo["TAX_DECLARATION_DATE_TYPE"] === "1" ? getLabel(111, "税款所属期") : getLabel(111, "薪资所属月") + }; } return { ...o, label: getLabel(o.lanId, o.label) }; }) @@ -60,7 +67,9 @@ class Index extends Component { if (f.isValid) { const payload = declareForm.getFormParams(); this.setState({ loading: true }); - saveDeclare({ ...payload }).then(({ status, errormsg }) => { + saveDeclare({ + ...payload, taxCycle: `${payload.salaryMonthStr}-01`, salaryDate: `${payload.salaryMonthStr}-01` + }).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { message.success(getLabel(30700, "操作成功")); diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index 5813e659..e13f2d02 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -222,6 +222,16 @@ export const conditions = [ lanId: 111, labelcol: 8, viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["TAX_DECLARATION_DATE_TYPE"], + fieldcol: 10, + label: "申报日期类型", + lanId: 111, + labelcol: 8, + options: [], + viewAttr: 2 } ], title: "算税规则", diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js index ab502d5c..3131f9ac 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js @@ -73,6 +73,13 @@ class RuleConfig extends Component { ...o, hide: sysinfo["SALARY_APPROVAL_STATUS"] === "0" || _.isNil(sysinfo["SALARY_APPROVAL_STATUS"]) }; + } else if (getKey(o) === "TAX_DECLARATION_DATE_TYPE") { + return { + ...o, options: [ + { key: "0", showname: getLabel(111, "薪资所属月"), selected: true }, + { key: "1", showname: getLabel(111, "税款所属期"), selected: false } + ] + }; } return { ...o }; }) @@ -154,6 +161,7 @@ class RuleConfig extends Component { case "APPROVAL_CAN_RE_CALC_STATUS": case "APPROVAL_CAN_EDIT_RESULT_STATUS": case "ATTENDANCE_SERIAL_COLLECTION_BTN": + case "TAX_DECLARATION_DATE_TYPE": case "SHOT_EMP_BTN": if (!this.handleDebounce) { this.handleDebounce = _.debounce(() => { @@ -173,7 +181,8 @@ class RuleConfig extends Component { APPROVAL_CAN_RE_CALC_STATUS: getLabel(111, "开启审批的核算记录允许重新核算"), APPROVAL_CAN_EDIT_RESULT_STATUS: getLabel(111, "审批流程发起后允许修改核算数据"), ATTENDANCE_SERIAL_COLLECTION_BTN: getLabel(111, "考勤引用是否采集班次数据"), - SHOT_EMP_BTN: getLabel(111, "启用组织快照") + TAX_DECLARATION_DATE_TYPE: getLabel(111, "申报日期类型"), + SHOT_EMP_BTN: getLabel(111, "启用组织快照"), }; this.unifiedSettings(key, confTitle[key]); this.handleDebounce = null; diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index ca93a24d..11be8705 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -38,7 +38,13 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void items.push({ com: ( + {`${fields.label}`} + { + fields.labelExtra && onChange(fields.labelType)}>{fields.labelExtra} + } + } // label 标签的文本 labelCol={{ span: `${fields.labelcol}` }} // label标签占一行比例 wrapperCol={{ span: `${fields.fieldcol}` }} // 右侧控件占一行比例 error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验