salary-management-front/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js

93 lines
4.3 KiB
JavaScript
Raw Normal View History

2024-08-28 13:42:32 +08:00
/*
* 薪酬二开项目
* 领悦
* @Author: 黎永顺
* @Date: 2024/8/22
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
2024-08-30 14:22:23 +08:00
import { inject, observer } from "mobx-react";
2025-02-21 16:56:43 +08:00
import { WeaDatePicker, WeaFormItem, WeaLocaleProvider, WeaSelect, WeaTop } from "ecCom";
import { commonEnumList } from "../../../apis/ruleconfig";
2024-09-14 09:55:54 +08:00
import CustomSelect from "../../../components/CustomSelect";
2025-02-21 16:56:43 +08:00
import { Button, Dropdown, Menu } from "antd";
2024-08-28 13:42:32 +08:00
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
2024-08-30 14:22:23 +08:00
@inject("taxAgentStore")
@observer
2024-08-28 13:42:32 +08:00
class Layout extends Component {
2025-02-21 16:56:43 +08:00
constructor(props) {
super(props);
this.state = { options: [] };
}
componentDidMount() {
this.getOptions();
}
getOptions = () => {
commonEnumList({ enumClass: "com.engine.salary.enums.ly.LyPushStatusEnum" }).then(({ status, data }) => {
if (status) this.setState({ options: _.map(data, o => ({ key: String(o.value), showname: o.defaultLabel })) });
});
};
2024-08-28 13:42:32 +08:00
render() {
2024-09-02 14:00:22 +08:00
const {
2025-04-16 14:54:36 +08:00
title, query, onChange, listRef, isQuery, lyAuth = false, ffgsqcLabel, companyOpts, costCompanyOpts,
taxAgentStore: { salaryManager, PageAndOptAuth }, fycdgsqcLabel, queryDateLabel
2025-02-21 16:56:43 +08:00
} = this.props, { options } = this.state;
2025-04-16 14:54:36 +08:00
const { lyCanGenDel } = PageAndOptAuth;
2025-02-21 16:56:43 +08:00
const { salaryMonth, ffgsqc, fycdgsqc, jtStatus, ffStatus } = query;
2024-08-30 14:22:23 +08:00
let buttons = [
2024-08-28 16:25:15 +08:00
<Button type="primary" onClick={() => listRef.handleOperate("GENERATE")}>{getLabel(111, "生成数据")}</Button>,
2025-01-23 15:36:47 +08:00
<Dropdown.Button onClick={() => listRef.handleOperate("ALLDEL")}
overlay={<Menu onClick={({ key }) => listRef.handleOperate(key)}>
<Menu.Item key="BATCHDEL">{getLabel(111, "批量删除")}</Menu.Item>
2025-04-21 13:34:22 +08:00
</Menu>} type="ghost">{getLabel(111, "")}</Dropdown.Button>
2024-08-28 13:42:32 +08:00
];
const dropMenuDatas = [
{ key: "EXPORTALL", icon: <i className="iconfont icon-daochu"/>, content: getLabel(81272, "导出全部") }
];
2025-04-16 14:54:36 +08:00
!lyCanGenDel && (buttons = buttons.slice(2));
2024-09-23 16:18:58 +08:00
(lyAuth || salaryManager) && buttons.unshift(<Button type="primary"
onClick={() => listRef.handleOperate("GENERATEVOUCHER")}>{getLabel(111, "生成并预览凭证")}</Button>);
2024-08-28 13:42:32 +08:00
return (
<WeaTop
2024-09-02 14:00:22 +08:00
title={title} icon={<i className="icon-coms-fa"/>} buttons={buttons} showDropIcon={true}
2024-08-28 13:42:32 +08:00
iconBgcolor="#F14A2D" className="custom_salary_lingyue" dropMenuDatas={dropMenuDatas}
2024-08-28 14:46:00 +08:00
onDropMenuClick={key => listRef.handleOperate(key)}>
2024-12-25 09:00:58 +08:00
<div className="lingyue-body">
<div className="lingyue-query">
2025-03-10 09:25:16 +08:00
<WeaFormItem label={queryDateLabel} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
2024-12-25 09:00:58 +08:00
<WeaDatePicker format="YYYY-MM" value={salaryMonth}
onChange={value => onChange({ ...query, salaryMonth: value, isQuery: !isQuery })}/>
</WeaFormItem>
2025-02-21 16:56:43 +08:00
<WeaFormItem label={ffgsqcLabel} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} style={{ width: 358 }}>
2024-12-25 09:00:58 +08:00
<CustomSelect value={ffgsqc} options={companyOpts}
onChange={value => onChange({ ...query, ffgsqc: value, isQuery: !isQuery })}/>
</WeaFormItem>
2025-02-21 16:56:43 +08:00
<WeaFormItem label={fycdgsqcLabel} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} style={{ width: 358 }}>
<CustomSelect value={fycdgsqc} options={costCompanyOpts}
onChange={value => onChange({ ...query, fycdgsqc: value, isQuery: !isQuery })}/>
</WeaFormItem>
<WeaFormItem label={getLabel(111, "计提状态")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
<WeaSelect options={options} value={jtStatus} multiple
onChange={value => onChange({ ...query, jtStatus: value, isQuery: !isQuery })}/>
</WeaFormItem>
<WeaFormItem label={getLabel(111, "发放状态 ")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
<WeaSelect options={options} value={ffStatus} multiple
onChange={value => onChange({ ...query, ffStatus: value, isQuery: !isQuery })}/>
</WeaFormItem>
2024-12-25 09:00:58 +08:00
</div>
{this.props.children}
</div>
2024-08-28 13:42:32 +08:00
</WeaTop>);
}
}
export default Layout;