From b932d4dd19005251950fbe0b22f07879aece6f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 11:09:29 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salaryItem/customSalaryItemSlide.js | 54 +++++----- pc4mobx/hrmSalary/pages/salaryItem/index.js | 100 +++++++++++------- .../pages/salaryItem/salaryItemsTable.js | 2 +- 3 files changed, 92 insertions(+), 64 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 9e407f56..0abbad77 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -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 ( -
- - {formalModalVisible && - { - this.handleSaveFormal(data); - }} - onCancel={() => - this.setState({ - formalModalVisible: false, - salaryItemName: "" - })} - />} -
+ return ( + }/> + + //
+ // + // {formalModalVisible && + // { + // this.handleSaveFormal(data); + // }} + // onCancel={() => + // this.setState({ + // formalModalVisible: false, + // salaryItemName: "" + // })} + // />} + //
); } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index c6729999..519e555a 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -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" ? [ + , + + ] : [ + , + + ]; + 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 = ( - - {getLabel(111, "新增系统薪资项")} + + {getLabel(111, "新增系统薪资项")} ); let buttons = [ handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}, + onClick={() => this.onDropMenuClick("customAdd")}>{getLabel(111, "新增自定义薪资项")}, , this.setState({ name: val })} placeholder={getLabel(111, "请输入名称")} onSearch={() => this.setState({ isQuery: !isQuery })}/> @@ -355,39 +372,44 @@ export default class SalaryItem extends React.Component { }} /> } - { - editSlideVisible && - - } - content={ - { - handleSaveSlideChange(value); - }}/> - } - onClose={() => setEditSlideVisible(false)} - /> - } + {/*新增编辑自定义薪资项目*/} + this.setState({ isQuery: !isQuery })} + onClose={callback => this.setState({ + customItemDialog: { ...customItemDialog, visible: false } + }, () => callback && callback())}/> + {/*{*/} + {/* editSlideVisible &&*/} + {/* */} + {/* }*/} + {/* content={*/} + {/* {*/} + {/* handleSaveSlideChange(value);*/} + {/* }}/>*/} + {/* }*/} + {/* onClose={() => setEditSlideVisible(false)}*/} + {/* />*/} + {/*}*/} ); } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js index e0639540..eee77555 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js @@ -106,7 +106,7 @@ class SalaryItemsTable extends Component { ...columns, { dataIndex: "opt", title: getLabel(111, "操作"), width: 140, render: (__, record) => ( - onDropMenuClick("edit", record)} href="javascript:void(0);">{(showOperateBtn || showSalaryItemBtn) ? getLabel(111, "编辑") : getLabel(111, "查看")} { (showOperateBtn || showSalaryItemBtn) && record.canDelete &&