From c57f21dd72206558e9a1d05534ab2979fd803110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 26 Mar 2026 16:42:26 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E5=AE=81=E6=B3=A2=E7=99=BE=E5=B7=9D?= =?UTF-8?q?=E6=B8=AF=E9=80=9A=E5=9B=BD=E9=99=85=E7=89=A9=E6=B5=81=E6=9C=89?= =?UTF-8?q?=E9=99=90=E5=85=AC=E5=8F=B8(0401)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/calculate.js | 12 ++ .../hrmSalary/pages/calculate/doCalc/index.js | 193 +++++++++++------- .../components/ledgerSalaryItemTable.js | 21 +- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 7 + 4 files changed, 149 insertions(+), 84 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 009a9bd8..f1358778 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -290,5 +290,17 @@ export const getCompareSobConfig = params => { export const updateSobConfig = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/updateSobConfig", "GET", params); }; +//薪资审批-调用获取角色接口(宁波百川港通国际物流有限公司二开) +export const getSalaryacctRole = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/role", "GET", params); +}; +//薪资审批-提交审批按钮(宁波百川港通国际物流有限公司二开) +export const approvalSalaryacct = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/approval", "GET", params); +}; +//薪资审批-退回按钮(宁波百川港通国际物流有限公司二开) +export const refuseSalaryacct = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/refuse", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 4f4944c7..681107e7 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -5,15 +5,18 @@ * Date: 2023/9/13 */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaReqTop } from "ecCom"; +import { WeaLocaleProvider, WeaReqTop, WeaLoadingGlobal } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { inject, observer } from "mobx-react"; import Layout from "./layout"; import { acctresultAccounting, + getSalaryacctRole, getApprovalInfoByRecordId, getCalculateProgress, - getExportField + fileSalaryAcct, + refuseSalaryacct, + approvalSalaryacct } from "../../../apis/calculate"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm"; @@ -26,13 +29,14 @@ import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; -@inject("calculateStore") -@observer +@inject("calculateStore") @observer class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "person", progressVisible: false, progress: 0, + selectedKey: "person", + progressVisible: false, + progress: 0, customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }, salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, approvalInfo: {},//审批信息, @@ -43,13 +47,15 @@ class Index extends Component { this.timer = null; } - init = () => { + init = async () => { const { routeParams: { salaryAcctRecordId } } = this.props; + const { data } = await getSalaryacctRole({ id: salaryAcctRecordId }); getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => { - if (status) this.setState({ approvalInfo }); + if (status) this.setState({ approvalInfo: { ...approvalInfo, salaryacctRole: data } }); }); }; handleMenuClick = ({ key }) => { + const { routeParams: { salaryAcctRecordId } } = this.props; switch (key) { case "calc_selected": const { selectedRowKeys } = this.calc.calcTableRef.wrappedInstance.state; @@ -59,6 +65,42 @@ class Index extends Component { } this.doCacl(key, selectedRowKeys); break; + case "zy_refuse": + WeaLoadingGlobal.start(); + refuseSalaryacct({ id: salaryAcctRecordId }).then(({ status, errorMsg }) => { + WeaLoadingGlobal.destroy(); + if (status) { + message.success(getLabel(111, "操作成功")); + this.calc.onAdSearch(false); + } else { + message.error(errorMsg); + } + }).catch(() => WeaLoadingGlobal.destroy()); + break; + case "zy_approval": + WeaLoadingGlobal.start(); + approvalSalaryacct({ id: salaryAcctRecordId }).then(({ status, errorMsg }) => { + WeaLoadingGlobal.destroy(); + if (status) { + message.success(getLabel(111, "操作成功")); + this.calc.onAdSearch(false); + } else { + message.error(errorMsg); + } + }).catch(() => WeaLoadingGlobal.destroy()); + break; + case "zy_file": + WeaLoadingGlobal.start(); + fileSalaryAcct({ id: salaryAcctRecordId }).then(({ status, errorMsg }) => { + WeaLoadingGlobal.destroy(); + if (status) { + message.success(getLabel(111, "操作成功")); + this.calc.onAdSearch(false); + } else { + message.error(errorMsg); + } + }).catch(() => WeaLoadingGlobal.destroy()); + break; default: break; } @@ -82,8 +124,7 @@ class Index extends Component { clearInterval(this.timer); this.timer = null; this.setState({ - progressVisible: false, - accountExceptInfo: data.message + progressVisible: false, accountExceptInfo: data.message }); message.success(getLabel(542321, "核算完成")); this.calc.onAdSearch(false); @@ -91,8 +132,7 @@ class Index extends Component { clearInterval(this.timer); this.timer = null; this.setState({ - progressVisible: false, - accountExceptInfo: data.message + progressVisible: false, accountExceptInfo: data.message }); message.error(data.message); } @@ -118,8 +158,7 @@ class Index extends Component { const { checkItems, itemsByGroup } = data; this.setState({ customExpDialog: { - ...this.state.customExpDialog, visible: true, salaryAcctRecordId, - checkItems, itemsByGroup + ...this.state.customExpDialog, visible: true, salaryAcctRecordId, checkItems, itemsByGroup } }); } @@ -128,9 +167,7 @@ class Index extends Component { case "import": this.setState({ salaryImpDialog: { - ...this.state.salaryImpDialog, - salaryAcctRecordId, visible: true, - title: getLabel(111, "薪资导入") + ...this.state.salaryImpDialog, salaryAcctRecordId, visible: true, title: getLabel(111, "薪资导入") } }); break; @@ -153,34 +190,40 @@ class Index extends Component { renderReqBtns = () => { const { routeParams: { salaryAcctRecordId } } = this.props; const { selectedKey, accountExceptInfo, approvalInfo } = this.state; - const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo; + const { isOpenApproval, approvalWorkflowUrl, canEdit, salaryacctRole } = approvalInfo; let reqBtns = []; switch (selectedKey) { case "calc": - const menu = ( - - {getLabel(543546, "核算所选人员")} - - ); - const moreMenu = ( - - {canEdit && {getLabel(32935, "导入")}} - {getLabel(81272, "导出全部")} - {getLabel(544270, "自定义导出")} - {getLabel(543249, "线下对比")} - {getLabel(111, "批量锁定")} - {getLabel(111, "批量解锁")} - - ); - reqBtns = [ - this.doCacl("ALL")} overlay={menu} type="primary"> - {getLabel(543545, "核算所有人")} - , + const menu = ( + {getLabel(543546, "核算所选人员")} + ); + const moreMenu = ( + {canEdit && {getLabel(32935, "导入")}} + {getLabel(81272, "导出全部")} + {getLabel(544270, "自定义导出")} + {getLabel(543249, "线下对比")} + {getLabel(111, "批量锁定")} + {getLabel(111, "批量解锁")} + ); + reqBtns = [ this.doCacl("ALL")} overlay={menu} type="primary"> + {getLabel(543545, "核算所有人")} + , , this.calc.openAdvanceSearch()} - onAdvanceSearch={() => this.calc.onAdSearch(false)}/> - ]; + onAdvanceSearch={() => this.calc.onAdSearch(false)}/>]; !canEdit && reqBtns.splice(0, 1); + /* + * Author: 黎永顺 + * Description:(宁波百川港通国际物流有限公司二开) 结果为“jl”,显示“归档”和“退回”按钮;结果为“zy”,显示“提交审批”按钮 + * Params:salaryacctRole + * Date: 2026/3/25 + */ + salaryacctRole === "jl" && reqBtns.unshift(); + salaryacctRole === "jl" && reqBtns.unshift(); + salaryacctRole === "zy" && reqBtns.unshift(); isOpenApproval && reqBtns.unshift(); @@ -219,48 +262,42 @@ class Index extends Component { }; render() { - const tabs = [ - { key: "person", title: getLabel(543547, "人员确认") }, - { key: "calc", title: getLabel(538011, "薪资核算") } - ]; + const tabs = [{ key: "person", title: getLabel(543547, "人员确认") }, { + key: "calc", title: getLabel(538011, "薪资核算") + }]; const { calculateStore: { setOtherConditions } } = this.props; const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state; - return ( - -
- } iconBgcolor="#F14A2D" - onChange={key => this.setState({ selectedKey: key }, () => setOtherConditions([]))} - buttons={this.renderReqBtns()} - > -
{this.renderContent()}
- { - progressVisible && - { - this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer)); - }} - progress={parseFloat(progress).toFixed(2)} - /> - } - {/* 薪资核算-自定义导出*/} - { - this.setState({ - customExpDialog: { ...customExpDialog, visible: false } - }); - }}/> - {/* 薪资核算-导入*/} - { - this.setState({ - salaryImpDialog: { ...salaryImpDialog, visible: false } - }, () => isFresh && this.calc.onAdSearch(false)); - }}/> -
-
-
- ); + return ( +
+ } iconBgcolor="#F14A2D" + onChange={key => this.setState({ selectedKey: key }, () => setOtherConditions([]))} + buttons={this.renderReqBtns()} + > +
{this.renderContent()}
+ {progressVisible && { + this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer)); + }} + progress={parseFloat(progress).toFixed(2)} + />} + {/* 薪资核算-自定义导出*/} + { + this.setState({ + customExpDialog: { ...customExpDialog, visible: false } + }); + }}/> + {/* 薪资核算-导入*/} + { + this.setState({ + salaryImpDialog: { ...salaryImpDialog, visible: false } + }, () => isFresh && this.calc.onAdSearch(false)); + }}/> +
+
+
); } } diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js index 76808a84..0a30278b 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js @@ -89,7 +89,7 @@ class LedgerSalaryItemTable extends Component { handleEditSalaryItem = async (record) => { const { salarySobId, dataSource } = this.props, { salaryItemId, id } = record; const { - itemHide: hideDefault, defaultValue, + itemHide: hideDefault, defaultValue, zyHide, valueType, name, description, roundingMode, formulaId, dataType, useInEmployeeSalary, pattern, canEdit, formulaContent, originFormulaContent, originSqlContent @@ -110,7 +110,8 @@ class LedgerSalaryItemTable extends Component { formulaContent: formulaContent ? formulaContent : data.formulaContent, originFormulaContent: originFormulaContent ? originFormulaContent : data.originFormulaContent, originSqlContent: originSqlContent ? originSqlContent : data.originSqlContent, - formulaId: formulaId ? formulaId : data.formulaId + formulaId: formulaId ? formulaId : data.formulaId, + zyHide: _.isNil(zyHide) ? "0" : String(zyHide) }, record, userStatusList: _.map(userStatusList, it => ({ key: it.value.toString(), showname: it.defaultLabel })) @@ -127,6 +128,7 @@ class LedgerSalaryItemTable extends Component { canEdit, dataType, description, defaultValue, formulaContent, formulaId, name, hideDefault: _.isNil(hideDefault) ? "0" : hideDefault, + zyHide: _.isNil(zyHide) ? "0" : String(zyHide), valueType, roundingMode, pattern, useInEmployeeSalary: !_.isNil(useInEmployeeSalary) ? useInEmployeeSalary : "0", //不能改成其他空值 @@ -155,10 +157,10 @@ class LedgerSalaryItemTable extends Component { const { salaryItemId } = record; const { hideDefault, roundingMode, pattern, valueType, defaultValue, - originFormulaContent, originSqlContent, formulaId, dataType + originFormulaContent, originSqlContent, formulaId, dataType, zyHide } = request; this.handleChangeSalaryItem({ - itemHide: hideDefault.toString(), + itemHide: hideDefault.toString(), zyHide: zyHide.toString(), defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue, roundingMode, pattern, valueType, formulaContent: valueType.toString() === "2" ? originFormulaContent : originSqlContent, @@ -283,11 +285,11 @@ class LedgerSalaryItemTable extends Component { value={checkValue} onChange={value => this.handleChangeAllItem(value)} /> - 隐藏 + 核算时隐藏 , dataIndex: "itemHide", key: "itemHide", - width: 80, + width: 120, render: (text, record) => { @@ -295,6 +297,13 @@ class LedgerSalaryItemTable extends Component { }} /> }, + { + title: 专员隐藏, + dataIndex: "zyHide", + key: "zyHide", + width: 100, + render: (text, record) => {!!Number(text) ? "是" : "否"} + }, { title: "操作", dataIndex: "operate", diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index 4cc0d47a..1857c2b3 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -267,6 +267,13 @@ export const salaryItemFields = [ viewAttr: 2, tip: getLabel(111, "提示:开启后,在薪资账套中添加该项目时,默认勾选隐藏且在核算时隐藏该薪资项目,可在具体薪资账套中设置是否隐藏") }, + { + key: "zyHide", + label: "专员隐藏", + type: "SWITCH", + viewAttr: 2, + tip: "" + }, { key: "sharedType", label: "可见性",