custom/宁波百川港通国际物流有限公司(0401)
This commit is contained in:
parent
f202c8d4cb
commit
c57f21dd72
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = (
|
||||
<Menu onClick={this.handleMenuClick}>
|
||||
<Menu.Item key="calc_selected">{getLabel(543546, "核算所选人员")}</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
const moreMenu = (
|
||||
<Menu onClick={this.handleMoreMenuClick}>
|
||||
{canEdit && <Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>}
|
||||
<Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item>
|
||||
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
|
||||
<Menu.Item key="offlineCompare">{getLabel(543249, "线下对比")}</Menu.Item>
|
||||
<Menu.Item key="LOCK">{getLabel(111, "批量锁定")}</Menu.Item>
|
||||
<Menu.Item key="UNLOCK">{getLabel(111, "批量解锁")}</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
reqBtns = [
|
||||
<Dropdown.Button onClick={() => this.doCacl("ALL")} overlay={menu} type="primary">
|
||||
{getLabel(543545, "核算所有人")}
|
||||
</Dropdown.Button>,
|
||||
const menu = (<Menu onClick={this.handleMenuClick}>
|
||||
<Menu.Item key="calc_selected">{getLabel(543546, "核算所选人员")}</Menu.Item>
|
||||
</Menu>);
|
||||
const moreMenu = (<Menu onClick={this.handleMoreMenuClick}>
|
||||
{canEdit && <Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>}
|
||||
<Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item>
|
||||
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
|
||||
<Menu.Item key="offlineCompare">{getLabel(543249, "线下对比")}</Menu.Item>
|
||||
<Menu.Item key="LOCK">{getLabel(111, "批量锁定")}</Menu.Item>
|
||||
<Menu.Item key="UNLOCK">{getLabel(111, "批量解锁")}</Menu.Item>
|
||||
</Menu>);
|
||||
reqBtns = [<Dropdown.Button onClick={() => this.doCacl("ALL")} overlay={menu} type="primary">
|
||||
{getLabel(543545, "核算所有人")}
|
||||
</Dropdown.Button>,
|
||||
<Dropdown overlay={moreMenu}><Button type="ghost">{getLabel(17499, "更多")}</Button></Dropdown>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={() => 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(<Button type="ghost"
|
||||
onClick={() => this.handleMenuClick({ key: "zy_file" })}>{getLabel(111, "归档")}</Button>);
|
||||
salaryacctRole === "jl" && reqBtns.unshift(<Button type="ghost"
|
||||
onClick={() => this.handleMenuClick({ key: "zy_refuse" })}>{getLabel(111, "退回")}</Button>);
|
||||
salaryacctRole === "zy" && reqBtns.unshift(<Button type="ghost"
|
||||
onClick={() => this.handleMenuClick({ key: "zy_approval" })}>{getLabel(111, "提交审批")}</Button>);
|
||||
isOpenApproval && reqBtns.unshift(<Button type="ghost" onClick={() => {
|
||||
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
|
||||
}}>{getLabel(111, "发起审批")}</Button>);
|
||||
|
|
@ -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 (
|
||||
<Layout {...this.props} init={this.init}>
|
||||
<div className="salary-calculate-do-calc">
|
||||
<WeaReqTop
|
||||
title={getLabel(538011, "薪资核算")} tabDatas={tabs} selectedKey={selectedKey}
|
||||
buttonSpace={10} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
onChange={key => this.setState({ selectedKey: key }, () => setOtherConditions([]))}
|
||||
buttons={this.renderReqBtns()}
|
||||
>
|
||||
<div className="salary-calculate-do-calc-content">{this.renderContent()}</div>
|
||||
{
|
||||
progressVisible &&
|
||||
<ProgressModal
|
||||
visible={progressVisible}
|
||||
onCancel={() => {
|
||||
this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer));
|
||||
}}
|
||||
progress={parseFloat(progress).toFixed(2)}
|
||||
/>
|
||||
}
|
||||
{/* 薪资核算-自定义导出*/}
|
||||
<CustomCalcExportDialog {...customExpDialog} onCancel={() => {
|
||||
this.setState({
|
||||
customExpDialog: { ...customExpDialog, visible: false }
|
||||
});
|
||||
}}/>
|
||||
{/* 薪资核算-导入*/}
|
||||
<SalaryEditCalcImport {...salaryImpDialog} onCancel={(isFresh) => {
|
||||
this.setState({
|
||||
salaryImpDialog: { ...salaryImpDialog, visible: false }
|
||||
}, () => isFresh && this.calc.onAdSearch(false));
|
||||
}}/>
|
||||
</WeaReqTop>
|
||||
</div>
|
||||
</Layout>
|
||||
);
|
||||
return (<Layout {...this.props} init={this.init}>
|
||||
<div className="salary-calculate-do-calc">
|
||||
<WeaReqTop
|
||||
title={getLabel(538011, "薪资核算")} tabDatas={tabs} selectedKey={selectedKey}
|
||||
buttonSpace={10} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
onChange={key => this.setState({ selectedKey: key }, () => setOtherConditions([]))}
|
||||
buttons={this.renderReqBtns()}
|
||||
>
|
||||
<div className="salary-calculate-do-calc-content">{this.renderContent()}</div>
|
||||
{progressVisible && <ProgressModal
|
||||
visible={progressVisible}
|
||||
onCancel={() => {
|
||||
this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer));
|
||||
}}
|
||||
progress={parseFloat(progress).toFixed(2)}
|
||||
/>}
|
||||
{/* 薪资核算-自定义导出*/}
|
||||
<CustomCalcExportDialog {...customExpDialog} onCancel={() => {
|
||||
this.setState({
|
||||
customExpDialog: { ...customExpDialog, visible: false }
|
||||
});
|
||||
}}/>
|
||||
{/* 薪资核算-导入*/}
|
||||
<SalaryEditCalcImport {...salaryImpDialog} onCancel={(isFresh) => {
|
||||
this.setState({
|
||||
salaryImpDialog: { ...salaryImpDialog, visible: false }
|
||||
}, () => isFresh && this.calc.onAdSearch(false));
|
||||
}}/>
|
||||
</WeaReqTop>
|
||||
</div>
|
||||
</Layout>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)}
|
||||
/>
|
||||
<span style={{ marginLeft: 8 }}>隐藏</span>
|
||||
<span style={{ marginLeft: 8 }}>核算时隐藏</span>
|
||||
</span>,
|
||||
dataIndex: "itemHide",
|
||||
key: "itemHide",
|
||||
width: 80,
|
||||
width: 120,
|
||||
render: (text, record) => <WeaCheckbox
|
||||
value={text ? String(text) : !text ? "0" : "1"}
|
||||
onChange={value => {
|
||||
|
|
@ -295,6 +297,13 @@ class LedgerSalaryItemTable extends Component {
|
|||
}}
|
||||
/>
|
||||
},
|
||||
{
|
||||
title: <span>专员隐藏</span>,
|
||||
dataIndex: "zyHide",
|
||||
key: "zyHide",
|
||||
width: 100,
|
||||
render: (text, record) => <span>{!!Number(text) ? "是" : "否"}</span>
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
|
|
|
|||
|
|
@ -267,6 +267,13 @@ export const salaryItemFields = [
|
|||
viewAttr: 2,
|
||||
tip: getLabel(111, "提示:开启后,在薪资账套中添加该项目时,默认勾选隐藏且在核算时隐藏该薪资项目,可在具体薪资账套中设置是否隐藏")
|
||||
},
|
||||
{
|
||||
key: "zyHide",
|
||||
label: "专员隐藏",
|
||||
type: "SWITCH",
|
||||
viewAttr: 2,
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: "sharedType",
|
||||
label: "可见性",
|
||||
|
|
|
|||
Loading…
Reference in New Issue