hotfix/2.14.2.2406.02

This commit is contained in:
黎永顺 2024-06-17 16:17:16 +08:00
parent f4cbacd591
commit add6a70abd
6 changed files with 139 additions and 148 deletions

View File

@ -0,0 +1,17 @@
import React, { Component } from "react";
import { WeaLocaleProvider, WeaReqTop } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
render() {
return (
<WeaReqTop
title={getLabel(111, "编辑账套")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
showDropIcon={false} tabDatas={this.props.tabDatas} {...this.props}
/>
);
}
}
export default Index;

View File

@ -0,0 +1,15 @@
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTop } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
render() {
return (
<WeaTop title={getLabel(111, "新建账套")} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" {...this.props}/>
);
}
}
export default Index;

View File

@ -5,9 +5,11 @@
* Date: 2023/9/5
*/
import React, { Component } from "react";
import { WeaTable } from "ecCom";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import { postFetch } from "../../../util/request";
const { getLabel } = WeaLocaleProvider;
class ImpStep2 extends Component {
constructor(props) {
super(props);
@ -41,9 +43,15 @@ class ImpStep2 extends Component {
render() {
const { dataSource, columns, loading } = this.state;
const { scrollHeight } = this.props;
const pagination = {
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
total: dataSource.length,
showSizeChanger: true
};
return (
<WeaTable
dataSource={dataSource} columns={columns} loading={loading} scroll={{ x: 800, y: `${scrollHeight}px` }}
pagination={pagination}
/>
);
}

View File

@ -9,7 +9,19 @@
}
}
.ledgerSlideContent {
.ledgerSlideLayout {
.wea-new-top {
.ant-col-10 {
padding-right: 45px !important;
}
}
.wea-new-top-req-wapper .wea-new-top-req-title > div:last-child {
right: 45px !important;
}
.ledgerSlideContent {
}
}
.copyWrapper {

View File

@ -6,25 +6,20 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaSlideModal, WeaSteps } from "ecCom";
import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom";
import { Button, message, Modal } from "antd";
import SlideModalTitle from "../../../components/slideModalTitle";
import LedgerBaseSetting from "./ledgerBaseSetting";
import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
import LedgerSalaryItem from "./ledgerSalaryItem";
import WeaTopTitle from "../../../components/custom-title/weaTopTitle";
import WeaReqTitle from "../../../components/custom-title/weaReqTitle";
import { saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
const Step = WeaSteps.Step;
const tabs = [
{ key: 0, title: "基础设置" },
{ key: 1, title: "关联人员" },
{ key: 2, title: "薪资项目" },
{ key: 3, title: "回算薪资项目" },
{ key: 4, title: "调薪计薪规则" }
];
@inject("taxAgentStore", "ledgerStore")
@observer
@ -32,12 +27,8 @@ class LedgerSlide extends Component {
constructor(props) {
super(props);
this.state = {
current: 0,
loading: false,
baseSettingInfo: {},
adjustRules: [],
empFields: [], itemGroups: [],
saveSalarySobId: ""
current: 0, loading: false, baseSettingInfo: {}, adjustRules: [],
empFields: [], itemGroups: [], saveSalarySobId: ""
};
}
@ -142,128 +133,96 @@ class LedgerSlide extends Component {
}
}).catch(() => this.setState({ loading: false }));
};
handleChangeSlideTab = (current) => {
this.setState({ current: Number(current) });
};
handleClose = () => {
this.setState({ current: 0 }, () => this.props.onCancel());
};
handleClose = () => this.setState({ current: 0, baseSettingInfo: {} }, () => this.props.onCancel());
/*
* Author: 黎永顺
* Description: 基础信息字段切换
* Params:
* Date: 2022/12/9
*/
handleChangeSaveParams = (baseSettingInfo) => {
this.setState({ baseSettingInfo });
};
handleChangeSaveParams = (baseSettingInfo) => this.setState({ baseSettingInfo });
/*
* Author: 黎永顺
* Description: 薪资项目保存数据
* Params:
* Date: 2022/12/14
*/
handleSaveSalaryItemParams = (empFields, itemGroups) => {
this.setState({ empFields, itemGroups });
};
renderChildren = () => {
const { current, saveSalarySobId } = this.state;
let CurrentDom = null;
switch (current) {
case 0:
CurrentDom = <LedgerBaseSetting {...this.props} onSaveParams={this.handleChangeSaveParams}/>;
break;
case 1:
CurrentDom = <LedgerAssociatedPersonnel {...this.props} saveSalarySobId={saveSalarySobId}/>;
break;
case 2:
CurrentDom = <LedgerSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}
onSaveSalaryItem={this.handleSaveSalaryItemParams}/>;
break;
case 3:
CurrentDom = <LedgerBackCalculatedSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}/>;
break;
case 4:
CurrentDom =
<LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId}
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>;
break;
default:
CurrentDom = null;
break;
}
return CurrentDom;
};
renderCustomOperate = () => {
const { taxAgentStore: { showOperateBtn }, editId } = this.props;
const { current, loading } = this.state;
let CurrentDom = [];
//管理员操作权限
if (showOperateBtn) {
switch (current) {
case 0:
CurrentDom = [
<Button
type="primary"
loading={loading}
onClick={this.saveLedgerBasic}
>{editId ? "保存" : "保存并进入下一步"}</Button>
];
break;
case 1:
CurrentDom = !editId ? [
<Button type="ghost" onClick={this.handleClose}>完成跳过所有步骤</Button>,
<Button type="primary" onClick={() => this.setState({ current: current + 1 })}>下一步</Button>
] : [];
break;
case 2:
CurrentDom = !editId ?
[
<Button type="ghost" onClick={this.handleClose}>完成跳过所有步骤</Button>,
<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>,
<Button
type="primary"
loading={loading}
onClick={() => {
this.setState({ current: current + 1 }, () => {
this.saveLedgerItem();
});
}}
>保存并进入下一步</Button>
] : [
<Button type="primary" loading={loading} onClick={this.saveLedgerItem}>保存</Button>
];
break;
case 3:
CurrentDom = !editId ?
[
<Button type="ghost" onClick={this.handleClose}>完成跳过所有步骤</Button>,
<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>,
<Button type="primary" onClick={() => this.setState({ current: current + 1 })}>下一步</Button>
] : [];
break;
case 4:
CurrentDom = !editId ?
[
<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>,
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>完成</Button>
] : [
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>保存</Button>
];
break;
default:
break;
}
}
return CurrentDom;
};
handleSaveSalaryItemParams = (empFields, itemGroups) => this.setState({ empFields, itemGroups });
render() {
const { title, visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
const { current } = this.state;
const { visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
const { current, saveSalarySobId, loading } = this.state;
let tabs = [
{
key: 0, title: getLabel(82751, "基础设置"),
createBtns: [
<Button type="primary" loading={loading}
onClick={this.saveLedgerBasic}>{getLabel(111, "保存并进入下一步")}</Button>
],
editBtns: [
<Button type="primary" loading={loading} onClick={this.saveLedgerBasic}>{getLabel(111, "保存")}</Button>
],
children: <LedgerBaseSetting
{...this.props} onSaveParams={this.handleChangeSaveParams}
onTaxableItemsChange={(val) => this.setState({ taxableItems: val })}
/>
},
{
key: 1, title: getLabel(543467, "关联人员"),
createBtns: [
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
<Button type="primary"
onClick={() => this.setState({ current: current + 1 })}>{getLabel(111, "下一步")}</Button>
],
editBtns: [],
children: <LedgerAssociatedPersonnel {...this.props} saveSalarySobId={saveSalarySobId}/>
},
{
key: 2, title: getLabel(542362, "薪资项目"),
createBtns: [
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
<Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
<Button type="primary" loading={loading} onClick={() => {
this.setState({ current: current + 1 }, () => this.saveLedgerItem());
}}>{getLabel(111, "保存并进入下一步")}</Button>
],
editBtns: [
<Button type="primary" loading={loading} onClick={this.saveLedgerItem}>{getLabel(111, "保存")}</Button>
],
children: <LedgerSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}
onSaveSalaryItem={this.handleSaveSalaryItemParams}/>
},
{
key: 3, title: getLabel(543468, "回算薪资项目"),
createBtns: [
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
<Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
<Button type="primary"
onClick={() => this.setState({ current: current + 1 })}>{getLabel(111, "下一步")}</Button>
],
editBtns: [],
children: <LedgerBackCalculatedSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}/>
},
{
key: 4, title: getLabel(543469, "调薪计薪规则"),
createBtns: [
<Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>{getLabel(111, "完成")}</Button>
],
editBtns: [
<Button type="primary" loading={loading}
onClick={this.saveLedgerAdjustRule}>{getLabel(111, "保存")}</Button>
],
children: <LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId}
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>
}
];
return (
<WeaSlideModal
className="slideOuterWrapper"
className="ledgerSlideLayout slideOuterWrapper"
visible={visible}
top={0}
width={100}
@ -271,18 +230,10 @@ class LedgerSlide extends Component {
direction="right"
measure="%"
title={
<SlideModalTitle
subtitle={title}
tabs={editId ? tabs : []}
loading={false}
showOperateBtn={showOperateBtn}
editable={false}
onSave={() => {
}}
selectedTab={current}
customOperate={this.renderCustomOperate()}
subItemChange={this.handleChangeSlideTab}
/>
!editId ? <WeaTopTitle buttons={_.find(tabs, o => current === o.key).createBtns}/> :
<WeaReqTitle buttons={showOperateBtn ? _.find(tabs, o => current === o.key).editBtns : []}
tabDatas={tabs} selectedKey={String(current)}
onChange={cur => this.setState({ current: parseInt(cur) })}/>
}
content={
<div className="ledgerSlideContent">
@ -297,9 +248,7 @@ class LedgerSlide extends Component {
}
</WeaSteps>
}
{
this.renderChildren()
}
{_.find(tabs, o => current === o.key).children}
</div>
}
onClose={this.handleClose}

View File

@ -1,13 +1,3 @@
.ledgerOuter {
.wea-new-top {
.ant-col-10 {
& > span:nth-child(2) {
margin-top: -6px;
}
}
}
}
.ledgerWrapper {
height: 100%;