custom/领悦
This commit is contained in:
parent
fe0cd8e541
commit
e333c34ff4
|
|
@ -1,6 +1,9 @@
|
|||
import { postExportFetch, postFetch } from "../../../util/request";
|
||||
|
||||
// 薪资项目调整记录列表
|
||||
export const generateSalaryReport = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/salaryReport/generate", params);
|
||||
};
|
||||
export const getLYSalaryReportList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/salaryReport/list", params);
|
||||
};
|
||||
|
|
@ -13,9 +16,12 @@ export const batchDeleteSalaryReport = (params) => {
|
|||
export const exportSalaryReport = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/ly/salaryReport/export", params);
|
||||
};
|
||||
export const getLYSIReportGenerateList = (params) => {
|
||||
export const generateSIReport = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/SIReport/generate", params);
|
||||
};
|
||||
export const getLYSIReportList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/SIReport/list", params);
|
||||
};
|
||||
export const getLYSIReportGenerateListSum = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/SIReport/sum", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
export const conditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["salaryMonth"],
|
||||
fieldcol: 18,
|
||||
label: "薪资所属月",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
rules: "required|string",
|
||||
value: "",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* 领悦报表生成数据弹窗
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/28
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import * as API from "../../../../apis/custom-apis/lingyue";
|
||||
import { conditions } from "./conditions";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const APIFOX = {
|
||||
"salarySum": API.generateSalaryReport,
|
||||
"socialFundSum": API.generateSIReport
|
||||
};
|
||||
|
||||
@inject("LYStore")
|
||||
@observer
|
||||
class GenerateDataDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, conditions: []
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.initLYForm();
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.LYStore.initForm();
|
||||
}
|
||||
|
||||
initLYForm = () => {
|
||||
this.setState({
|
||||
conditions: _.map(conditions, item => ({
|
||||
...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
|
||||
}))
|
||||
}, () => {
|
||||
const { LYStore: { form } } = this.props;
|
||||
form.initFormFields(this.state.conditions);
|
||||
});
|
||||
};
|
||||
|
||||
save = () => {
|
||||
const { LYStore: { form }, type, onSearch } = this.props;
|
||||
form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.setState({ loading: true });
|
||||
const payload = { ...form.getFormParams() };
|
||||
APIFOX[type](payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.props.onCancel(onSearch());
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions, loading } = this.state;
|
||||
const { LYStore: { form } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 80 }} initLoadCss title={getLabel(111, "生成数据")}
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout">{getSearchs(form, conditions, 1, false)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default GenerateDataDialog;
|
||||
|
|
@ -10,8 +10,8 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
import { getIframeParentHeight } from "../../../../util";
|
||||
import * as API from "../../../../apis/custom-apis/lingyue";
|
||||
import GenerateDataDialog from "./generateDataDialog";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const interfaceType = {
|
||||
|
|
@ -22,7 +22,7 @@ const interfaceType = {
|
|||
batchDel: API.batchDeleteSalaryReport
|
||||
},
|
||||
"socialFundSum": {
|
||||
list: API.getLYSIReportGenerateList,
|
||||
list: API.getLYSIReportList,
|
||||
sum: API.getLYSIReportGenerateListSum,
|
||||
export: API.exportSIReport,
|
||||
batchDel: API.batchDeleteSIReport
|
||||
|
|
@ -34,7 +34,7 @@ class List extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false,
|
||||
selectedRowKeys: [], sumDataSource: {}, payload: {}
|
||||
selectedRowKeys: [], sumDataSource: {}, payload: {}, visible: false
|
||||
};
|
||||
this.handleDebounce = null;
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ class List extends Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { data: { sumRow: sumDataSource } } = isSum ?
|
||||
await interfaceType[type]["sum"](payload) : { data: this.state.sumDataSource };
|
||||
await interfaceType[type]["sum"](payload) : { data: { sumRow: this.state.sumDataSource } };
|
||||
const { columns, data: result } = data;
|
||||
const { list: dataSource, pageNum: current, pageSize, total } = result;
|
||||
this.setState({
|
||||
|
|
@ -96,7 +96,7 @@ class List extends Component {
|
|||
}, () => {
|
||||
onInit();
|
||||
this.postMessageToChild({
|
||||
scrollHeight: 108, dataSource, pageInfo: this.state.pageInfo, selectedRowKeys,
|
||||
scrollHeight: 195, dataSource, pageInfo: this.state.pageInfo, selectedRowKeys,
|
||||
unitTableType: "custom_lingyue", columns: traverseCols(columns), showTotalCell: true,
|
||||
sumDataSource: this.state.sumDataSource
|
||||
});
|
||||
|
|
@ -108,6 +108,9 @@ class List extends Component {
|
|||
const { payload, selectedRowKeys } = this.state;
|
||||
const { type } = this.props;
|
||||
switch (key) {
|
||||
case "GENERATE":
|
||||
this.setState({ visible: true });
|
||||
break;
|
||||
case "EXPORTALL":
|
||||
WeaLoadingGlobal.start();
|
||||
const promise = interfaceType[type]["export"](payload);
|
||||
|
|
@ -137,10 +140,16 @@ class List extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { loading, dataSource } = this.state;
|
||||
const { loading, visible } = this.state;
|
||||
const { type } = this.props;
|
||||
const dom = document.querySelector(".wea-new-top-content");
|
||||
return (
|
||||
<div className="custom_lingyue_list"
|
||||
style={{ height: getIframeParentHeight(".wea-new-top-content", dataSource.length, 0) + 43.84 + "px" }}>
|
||||
style={{
|
||||
height: dom ? `calc(${parseFloat(dom.style.height)}px - 32px)` : 0,
|
||||
maxHeight: "678px",
|
||||
minHeight: "307.53px"
|
||||
}}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
|
|
@ -149,6 +158,8 @@ class List extends Component {
|
|||
id="unitTable"
|
||||
/>
|
||||
</Spin>
|
||||
<GenerateDataDialog type={type} visible={visible} onCancel={() => this.setState({ visible: false })}
|
||||
onSearch={this.getLYList}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,11 @@ const getLabel = WeaLocaleProvider.getLabel;
|
|||
|
||||
class Layout extends Component {
|
||||
render() {
|
||||
const { title, query, onChange, listRef } = this.props;
|
||||
const { salaryMonth, ffgsqc, isQuery } = query;
|
||||
const { title, query, onChange, listRef, isQuery } = this.props;
|
||||
const { salaryMonth, ffgsqc } = query;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={() => listRef.handleOperate("BATCHDEL")}>{getLabel(111, "批量删除")}</Button>,
|
||||
<Button type="primary" onClick={() => listRef.handleOperate("GENERATE")}>{getLabel(111, "生成数据")}</Button>,
|
||||
<Button type="ghost" onClick={() => listRef.handleOperate("BATCHDEL")}>{getLabel(111, "批量删除")}</Button>,
|
||||
<WeaDatePicker format="YYYY-MM" value={salaryMonth}
|
||||
onChange={value => onChange({ ...query, salaryMonth: value, isQuery: !isQuery })}/>,
|
||||
<WeaInputSearch value={ffgsqc} onChange={value => onChange({ ...query, ffgsqc: value })}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Index extends Component {
|
|||
const { query, isQuery } = this.state;
|
||||
return (
|
||||
<Layout title={getLabel(111, "薪资汇总表")} query={query} onChange={this.handleLayoutChange}
|
||||
listRef={this.listRef}>
|
||||
listRef={this.listRef} isQuery={isQuery}>
|
||||
<List query={query} isQuery={isQuery} type="salarySum" ref={dom => this.listRef = dom}
|
||||
onInit={() => this.forceUpdate()}/>
|
||||
</Layout>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class Index extends Component {
|
|||
const { query, isQuery } = this.state;
|
||||
return (
|
||||
<Layout title={getLabel(111, "社保公积金汇总表")} query={query} onChange={this.handleLayoutChange}
|
||||
listRef={this.listRef}>
|
||||
listRef={this.listRef} isQuery={isQuery}>
|
||||
<List query={query} isQuery={isQuery} type="socialFundSum" ref={dom => this.listRef = dom}
|
||||
onInit={() => this.forceUpdate()}/>
|
||||
</Layout>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,5 @@
|
|||
import { LYStore } from "./lingyue";
|
||||
|
||||
module.exports = {
|
||||
LYStore: new LYStore() //领悦
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
import { action, observable } from "mobx";
|
||||
import { WeaForm } from "comsMobx";
|
||||
|
||||
export class LYStore {
|
||||
@observable form = new WeaForm();
|
||||
@action initForm = () => this.form = new WeaForm();
|
||||
}
|
||||
Loading…
Reference in New Issue