feature/2.12.1.2404.02-薪资账套配置流程审批

This commit is contained in:
黎永顺 2024-04-29 16:44:46 +08:00
parent e58f5e73e0
commit 9476ffb62a
2 changed files with 16 additions and 11 deletions

View File

@ -78,6 +78,7 @@ class Index extends Component {
renderTabBtns = () => {
const { selectedKey, selectedRowKeys } = this.state;
const { calcDetail } = this.props;
let tabBtns = [];
switch (selectedKey) {
case "range":
@ -92,6 +93,7 @@ class Index extends Component {
</WeaBrowser>,
<Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button>
];
calcDetail && tabBtns.splice(0, 2);
break;
case "add":
case "sub":
@ -182,7 +184,7 @@ class Index extends Component {
};
render() {
const { calculateStore: { PCSearchForm } } = this.props;
const { calculateStore: { PCSearchForm }, calcDetail } = this.props;
const {
selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys,
columns, dataSource
@ -252,8 +254,8 @@ class Index extends Component {
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
/>
<WeaTable
dataSource={dataSource} loading={loading} rowSelection={rowSelection} pagination={pagination}
scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
dataSource={dataSource} loading={loading} rowSelection={calcDetail ? null : rowSelection}
pagination={pagination} scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
columns={[..._.map(columns, item => {
let width = "";
const { dataIndex } = item;
@ -272,9 +274,10 @@ class Index extends Component {
dataIndex: "operate",
title: getLabel(30585, "操作"),
width: 120,
render: (_, record) => (
<a href="javascript:void(0);"
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>
render: (_, record) => (<React.Fragment>
{calcDetail ? null : <a href="javascript:void(0);"
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>}
</React.Fragment>
)
}
]}

View File

@ -144,7 +144,7 @@ class Index extends Component {
renderReqBtns = () => {
const { routeParams: { salaryAcctRecordId } } = this.props;
const { selectedKey, accountExceptInfo, approvalInfo } = this.state;
const { isOpenApproval, approvalWorkflowUrl } = approvalInfo;
const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo;
let reqBtns = [];
switch (selectedKey) {
case "calc":
@ -155,7 +155,7 @@ class Index extends Component {
);
const moreMenu = (
<Menu onClick={this.handleMoreMenuClick}>
<Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>
{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>
@ -169,6 +169,7 @@ class Index extends Component {
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calc.openAdvanceSearch()}
onAdvanceSearch={() => this.calc.onAdSearch(false)}/>
];
!canEdit && reqBtns.splice(0, 1);
isOpenApproval && reqBtns.unshift(<Button type="ghost" onClick={() => {
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
}}>{getLabel(111, "发起审批")}</Button>);
@ -190,14 +191,15 @@ class Index extends Component {
element.click();
};
renderContent = () => {
const { selectedKey } = this.state;
const { selectedKey, approvalInfo } = this.state;
const { canEdit } = approvalInfo;
let dom = null;
switch (selectedKey) {
case "person":
dom = <SalaryCalcPersonConfirm {...this.props}/>;
dom = <SalaryCalcPersonConfirm calcDetail={!canEdit} {...this.props}/>;
break;
case "calc":
dom = <SalaryEditCalc {...this.props} ref={dom => this.calc = dom}/>;
dom = <SalaryEditCalc {...this.props} calcDetail={!canEdit} ref={dom => this.calc = dom}/>;
break;
default:
break;