feature/2.15.1.2407.01-薪资项目以及字段管理页面改造

This commit is contained in:
黎永顺 2024-08-20 11:09:29 +08:00
parent 3cff712ae9
commit b932d4dd19
3 changed files with 92 additions and 64 deletions

View File

@ -1,8 +1,8 @@
import React from "react";
import FormalFormModal from "./formalFormModal";
import SalaryItemForm from "./salaryItemForm";
import "./index.less";
import { WeaLocaleProvider, WeaSlideModal } from "ecCom";
// import FormalFormModal from "./formalFormModal";
// import SalaryItemForm from "./salaryItemForm";
const getLabel = WeaLocaleProvider.getLabel;
export default class CustomSalaryItemSlide extends React.Component {
constructor(props) {
super(props);
@ -37,26 +37,32 @@ export default class CustomSalaryItemSlide extends React.Component {
const { request } = this.props;
const { valueType, dataType, formulaId } = request;
const { formalModalVisible, salaryItemName } = this.state;
return (
<div className="customSalaryItemSlide">
<SalaryItemForm {...this.props} onChangeFieldsItem={this.handleChange} onShowFormal={this.handleShowFormal}/>
{formalModalVisible &&
<FormalFormModal
name={salaryItemName}
formulaId={formulaId}
visible={formalModalVisible}
valueType={valueType}
dataType={dataType}
onSaveFormal={data => {
this.handleSaveFormal(data);
}}
onCancel={() =>
this.setState({
formalModalVisible: false,
salaryItemName: ""
})}
/>}
</div>
return (<WeaSlideModal
className="customSalaryItemSlide" {...this.props}
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%"
direction="right" title={this.renderTitle()} onClose={this.handleClose}
content={<div className="salary-welfare-archive-edit-area">
</div>}/>
// <div className="customSalaryItemSlide">
// <SalaryItemForm {...this.props} onChangeFieldsItem={this.handleChange} onShowFormal={this.handleShowFormal}/>
// {formalModalVisible &&
// <FormalFormModal
// name={salaryItemName}
// formulaId={formulaId}
// visible={formalModalVisible}
// valueType={valueType}
// dataType={dataType}
// onSaveFormal={data => {
// this.handleSaveFormal(data);
// }}
// onCancel={() =>
// this.setState({
// formalModalVisible: false,
// salaryItemName: ""
// })}
// />}
// </div>
);
}
}

View File

@ -1,12 +1,11 @@
import React from "react";
import { inject, observer } from "mobx-react";
import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTop } from "ecCom";
import { WeaInputSearch, WeaLocaleProvider, WeaTop } from "ecCom";
import * as API from "../../apis/item";
import SalaryItemsTable from "./salaryItemsTable";
import { toDecimal_n } from "../../util";
import SystemSalaryItemModal from "./systemSalaryItemModal";
import SlideModalTitle from "../../components/slideModalTitle";
import CustomSalaryItemSlide from "./customSalaryItemSlide";
import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog";
import "../socialSecurityBenefits/programme/index.less";
@ -21,6 +20,7 @@ export default class SalaryItem extends React.Component {
super(props);
this.state = {
name: "", isQuery: false,
customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗
value: "",
@ -199,6 +199,23 @@ export default class SalaryItem extends React.Component {
filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]"
});
break;
case "customAdd":
case "edit":
const { taxAgentStore: { showOperateBtn, showSalaryItemBtn } } = this.props;
const title = key === "edit" ? getLabel(111, "修改自定义薪资项目") : getLabel(111, "新建自定义薪资项目");
const buttons = key === "edit" ? [
<Button type="ghost">{getLabel(111, "同步到薪资账套")}</Button>,
<Button type="primary">{getLabel(111, "保存")}</Button>
] : [
<Button type="primary">{getLabel(111, "保存")}</Button>,
<Button type="ghost">{getLabel(111, "保存并继续创建")}</Button>
];
this.setState({
customItemDialog: { visible: true, title, buttons: (showSalaryItemBtn || showOperateBtn) ? buttons : [] }
});
break;
case "sysAdd":
break;
default:
break;
}
@ -211,7 +228,7 @@ export default class SalaryItem extends React.Component {
taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption }
} = this.props;
const { userStatusList } = salaryFileStore;
const { selectedRowKeys, logDialogVisible, filterConditions, name, isQuery } = this.state;
const { selectedRowKeys, logDialogVisible, filterConditions, name, isQuery, customItemDialog } = this.state;
const { loading, deleteItemRequest, getTableDatas } = salaryItemStore;
const {
tableDataSource,
@ -235,13 +252,13 @@ export default class SalaryItem extends React.Component {
};
const menu = (
<Menu onClick={handleMenuClick}>
<Menu.Item key="2">{getLabel(111, "新增系统薪资项")}</Menu.Item>
<Menu onClick={this.onDropMenuClick}>
<Menu.Item key="sysAdd">{getLabel(111, "新增系统薪资项")}</Menu.Item>
</Menu>
);
let buttons = [
<Dropdown.Button overlay={menu} type="primary"
onClick={() => handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>,
onClick={() => this.onDropMenuClick("customAdd")}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>,
<Button type="ghost" onClick={this.handleDeleteItem}>{getLabel(32136, "批量删除")}</Button>,
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })}
placeholder={getLabel(111, "请输入名称")} onSearch={() => this.setState({ isQuery: !isQuery })}/>
@ -355,39 +372,44 @@ export default class SalaryItem extends React.Component {
}}
/>
}
{
editSlideVisible &&
<WeaSlideModal
className="slideOuterWrapper"
visible={editSlideVisible}
top={0}
measureT="%"
width={800}
measureX="px"
height={100}
measureY="%"
direction={"right"}
title={
<SlideModalTitle
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
editable={false}
showOperateBtn={(showSalaryItemBtn || showOperateBtn)}
customOperate={(showSalaryItemBtn || showOperateBtn) ? renderCustomOperate() : []}
/>
}
content={
<CustomSalaryItemSlide
record={this.record} editable={this.state.editable}
isAdd={this.state.isAdd} request={request}
userStatusList={userStatusList}
taxAgentAdminOption={taxAgentOption}
onChange={(value) => {
handleSaveSlideChange(value);
}}/>
}
onClose={() => setEditSlideVisible(false)}
/>
}
{/*新增编辑自定义薪资项目*/}
<CustomSalaryItemSlide {...customItemDialog} onSearch={() => this.setState({ isQuery: !isQuery })}
onClose={callback => this.setState({
customItemDialog: { ...customItemDialog, visible: false }
}, () => callback && callback())}/>
{/*{*/}
{/* editSlideVisible &&*/}
{/* <WeaSlideModal*/}
{/* className="slideOuterWrapper"*/}
{/* visible={editSlideVisible}*/}
{/* top={0}*/}
{/* measureT="%"*/}
{/* width={800}*/}
{/* measureX="px"*/}
{/* height={100}*/}
{/* measureY="%"*/}
{/* direction={"right"}*/}
{/* title={*/}
{/* <SlideModalTitle*/}
{/* subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}*/}
{/* editable={false}*/}
{/* showOperateBtn={(showSalaryItemBtn || showOperateBtn)}*/}
{/* customOperate={(showSalaryItemBtn || showOperateBtn) ? renderCustomOperate() : []}*/}
{/* />*/}
{/* }*/}
{/* content={*/}
{/* <CustomSalaryItemSlide*/}
{/* record={this.record} editable={this.state.editable}*/}
{/* isAdd={this.state.isAdd} request={request}*/}
{/* userStatusList={userStatusList}*/}
{/* taxAgentAdminOption={taxAgentOption}*/}
{/* onChange={(value) => {*/}
{/* handleSaveSlideChange(value);*/}
{/* }}/>*/}
{/* }*/}
{/* onClose={() => setEditSlideVisible(false)}*/}
{/* />*/}
{/*}*/}
</React.Fragment>
);
}

View File

@ -106,7 +106,7 @@ class SalaryItemsTable extends Component {
...columns, {
dataIndex: "opt", title: getLabel(111, "操作"), width: 140,
render: (__, record) => (<React.Fragment>
<a style={{ marginRight: 8 }}
<a style={{ marginRight: 8 }} onClick={() => onDropMenuClick("edit", record)}
href="javascript:void(0);">{(showOperateBtn || showSalaryItemBtn) ? getLabel(111, "编辑") : getLabel(111, "查看")}</a>
{
(showOperateBtn || showSalaryItemBtn) && record.canDelete &&