Merge branch 'feature/2.12.1.2403.02-薪资核算自定义导出模板设置' into release/2.12.1.2403.02
This commit is contained in:
commit
223142e384
|
|
@ -250,3 +250,20 @@ export const customCacheExportField = (params) => {
|
|||
export const salaryacctBatchUpdate = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/batchUpdate", params);
|
||||
};
|
||||
//薪资核算-自定义导出模板保存新建
|
||||
export const saveExportTemplate = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/saveExportTemplate", params);
|
||||
};
|
||||
//薪资核算-获取自定义导出模板列表
|
||||
export const getExportTemplateList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/exportTemplateList", params);
|
||||
};
|
||||
//薪资核算-删除自定义导出模板列表
|
||||
export const deleteExportTemplate = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/deleteExportTemplate", params);
|
||||
};
|
||||
//薪资核算-获取导出模板详细信息
|
||||
export const getExportTemplateForm = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,77 +0,0 @@
|
|||
export const logColumns = [
|
||||
{
|
||||
title: "操作时间",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "操作人",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "操作类型",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "模块",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "对象",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "修改详情",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "客户端IP",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
}
|
||||
]
|
||||
|
||||
export const testColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
},
|
||||
]
|
||||
|
||||
export const dataSource = [];
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import React from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
//薪资核算-自定义导出-模板设置
|
||||
export const tempConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["templateName"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(111, "导出模板名称"),
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: ""
|
||||
}
|
||||
];
|
||||
|
|
@ -8,10 +8,17 @@
|
|||
import React, { Component } from "react";
|
||||
import { Button, Col, message, Row } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
||||
import { customCacheExportField } from "../../../../../apis/calculate";
|
||||
import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom";
|
||||
import ExpTempManagementDialog from "../expTempManagementDialog";
|
||||
import {
|
||||
customCacheExportField,
|
||||
getExportField,
|
||||
getExportTemplateForm,
|
||||
getExportTemplateList
|
||||
} from "../../../../../apis/calculate";
|
||||
import { convertToUrlString } from "../../../../../util/url";
|
||||
import "./index.less";
|
||||
import TempDialog from "../expFieldsSetDialog/tempDialog";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
|
|
@ -21,19 +28,44 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
itemsCheckeds: [],
|
||||
showOnlyChecked: false
|
||||
itemsCheckeds: [], showOnlyChecked: false, tempMangeDialog: { visible: false, salaryAcctRecordId: "" },
|
||||
tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] },
|
||||
tempOptions: [
|
||||
{ key: "NULL", showname: "" },
|
||||
{ key: "system", selected: true, showname: getLabel(111, "系统模板") }
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
async componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.setState({
|
||||
itemsCheckeds: !_.isEmpty(nextProps.checkItems) ? nextProps.checkItems : []
|
||||
}, () => this.getExportTemplateList(nextProps));
|
||||
} else {
|
||||
this.setState({
|
||||
tempOptions: [
|
||||
{ key: "NULL", showname: "" },
|
||||
{ key: "system", selected: true, showname: getLabel(111, "系统模板") }
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getExportTemplateList = (props) => {
|
||||
const { salaryAcctRecordId } = props;
|
||||
getExportTemplateList({ salaryAcctRecordId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { pageInfo: { list } } = data;
|
||||
this.setState({
|
||||
tempOptions: [
|
||||
...this.state.tempOptions, ..._.map(list, o => ({ key: String(o.id), showname: o.templateName }))
|
||||
]
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
customExportClick = () => {
|
||||
const { calculateStore: { ECSearchForm }, salaryAcctRecordId } = this.props;
|
||||
const { itemsCheckeds } = this.state;
|
||||
|
|
@ -67,10 +99,26 @@ class Index extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
handleChangeExpTemp = async (id) => {
|
||||
switch (id) {
|
||||
case "system":
|
||||
const { salaryAcctRecordId } = this.props;
|
||||
const { data: { checkItems: checkeds } } = await getExportField({ salaryAcctRecordId });
|
||||
this.setState({ itemsCheckeds: checkeds });
|
||||
break;
|
||||
case "NULL":
|
||||
this.setState({ itemsCheckeds: [] });
|
||||
break;
|
||||
default:
|
||||
const { data: { checkItems } } = await getExportTemplateForm({ id });
|
||||
this.setState({ itemsCheckeds: _.map(checkItems, o => parseInt(o)) });
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { showOnlyChecked, itemsCheckeds } = this.state;
|
||||
const { itemsByGroup } = this.props;
|
||||
const { showOnlyChecked, itemsCheckeds, tempMangeDialog, tempDialog, tempOptions } = this.state;
|
||||
const { itemsByGroup, salaryAcctRecordId } = this.props;
|
||||
let dataSource = _.map(itemsByGroup, item => {
|
||||
return {
|
||||
...item,
|
||||
|
|
@ -84,10 +132,15 @@ class Index extends Component {
|
|||
return { ...item, salaryItems: _.filter(item.salaryItems, it => !!it.checked) };
|
||||
});
|
||||
}
|
||||
const titleComp = <div className="setHeaderWrapper">
|
||||
<span>{getLabel(111, "选择字段")}</span>
|
||||
<WeaSelect options={tempOptions} style={{ width: 200 }}
|
||||
onChange={this.handleChangeExpTemp}/>
|
||||
</div>;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} hasScroll initLoadCss className="customEpDialogLayout"
|
||||
scalable title={getLabel(111, "选择字段")}
|
||||
scalable title={titleComp}
|
||||
style={{
|
||||
width: 700,
|
||||
height: 606.6,
|
||||
|
|
@ -100,6 +153,21 @@ class Index extends Component {
|
|||
}}
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.customExportClick}>{getLabel(17416, "导出")}</Button>,
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
tempDialog: { visible: true, salaryAcctRecordId, id: "", salaryItemIds: itemsCheckeds },
|
||||
tempOptions: [
|
||||
{ key: "NULL", showname: "" },
|
||||
{ key: "system", selected: true, showname: getLabel(111, "系统模板") }
|
||||
]
|
||||
})}>{getLabel(111, "存为模板")}</Button>,
|
||||
<Button type="primary"
|
||||
onClick={() => this.setState({
|
||||
tempMangeDialog: { visible: true, salaryAcctRecordId },
|
||||
tempOptions: [
|
||||
{ key: "NULL", showname: "" },
|
||||
{ key: "system", selected: true, showname: getLabel(111, "系统模板") }
|
||||
]
|
||||
})}>{getLabel(111, "模板管理")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
|
||||
]}
|
||||
bottomLeft={<WeaCheckbox content={getLabel(543378, "只显示已选中字段")}
|
||||
|
|
@ -131,6 +199,15 @@ class Index extends Component {
|
|||
</WeaSearchGroup>;
|
||||
})
|
||||
}
|
||||
<ExpTempManagementDialog {...tempMangeDialog}
|
||||
onCancel={() => this.setState({
|
||||
tempMangeDialog: { ...tempMangeDialog, visible: false }
|
||||
}, () => this.getExportTemplateList(this.props))}
|
||||
/>
|
||||
{/*模板保存*/}
|
||||
<TempDialog {...tempDialog} onCancel={() => this.setState({
|
||||
tempDialog: { ...tempDialog, visible: false }
|
||||
}, () => this.getExportTemplateList(this.props))}/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,15 @@
|
|||
.customEpDialogLayout {
|
||||
.text-elli {
|
||||
padding-right: 16px;
|
||||
}
|
||||
|
||||
.setHeaderWrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wea-search-group {
|
||||
.wea-title {
|
||||
padding-left: 0 !important;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:自定义导出-导出字段设置
|
||||
* Description:
|
||||
* Date: 2024/3/28
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
||||
import { Button, Col, message, Row } from "antd";
|
||||
import * as API from "../../../../../apis/calculate";
|
||||
import TempDialog from "./tempDialog";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
itemsCheckeds: [], itemsByGroup: [],
|
||||
tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] }
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getExportField(nextProps);
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
|
||||
itemsCheckeds: [], itemsByGroup: []
|
||||
});
|
||||
}
|
||||
|
||||
getExportField = (props) => {
|
||||
const { salaryAcctRecordId, checkItems } = props;
|
||||
API.getExportField({ salaryAcctRecordId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { itemsByGroup } = data;
|
||||
this.setState({ itemsByGroup, itemsCheckeds: checkItems });
|
||||
}
|
||||
});
|
||||
};
|
||||
handleSelectGroupAll = (groupId, checked) => {
|
||||
const { itemsCheckeds, itemsByGroup } = this.state;
|
||||
_.map(itemsByGroup, item => {
|
||||
if (item.salarySobItemGroupId === groupId) {
|
||||
if (!!Number(checked)) {
|
||||
this.setState({
|
||||
itemsCheckeds: [...itemsCheckeds, ..._.map(item.salaryItems, child => String(child.salaryItemId))]
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
itemsCheckeds: _.differenceWith(itemsCheckeds, _.map(item.salaryItems, child => String(child.salaryItemId)), _.isEqual)
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
save = () => {
|
||||
const { itemsCheckeds } = this.state;
|
||||
const { salaryAcctRecordId, tempId: id, templateName } = this.props;
|
||||
if (!id) {
|
||||
this.setState({
|
||||
tempDialog: {
|
||||
visible: true, salaryAcctRecordId, id, salaryItemIds: itemsCheckeds
|
||||
}
|
||||
});
|
||||
} else {
|
||||
API.saveExportTemplate({ templateName, salaryAcctRecordId, id, salaryItemIds: itemsCheckeds })
|
||||
.then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.props.onCancel(true);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { itemsCheckeds, itemsByGroup, tempDialog } = this.state;
|
||||
let dataSource = _.map(itemsByGroup, item => {
|
||||
return {
|
||||
...item, salaryItems: _.map(item.salaryItems, child => {
|
||||
return { ...child, checked: itemsCheckeds.includes(String(child.salaryItemId)) };
|
||||
})
|
||||
};
|
||||
});
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} hasScroll scalable title={getLabel(111, "导出字段设置")}
|
||||
initLoadCss className="customEpDialogLayout"
|
||||
style={{
|
||||
width: 700, height: 606.6, minHeight: 200, minWidth: 380, maxHeight: "70%",
|
||||
maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}
|
||||
buttons={[<Button type="primary" onClick={this.save}>{getLabel(111, "保存")}</Button>]}
|
||||
>
|
||||
{
|
||||
_.map(dataSource, item => {
|
||||
const { salarySobItemGroupName, salaryItems, salarySobItemGroupId } = item;
|
||||
const value = _.every(salaryItems, it => !!it.checked) ? "1" : "0";
|
||||
return <WeaSearchGroup showGroup needTigger
|
||||
title={<WeaCheckbox content={salarySobItemGroupName} value={value}
|
||||
onChange={(val) => this.handleSelectGroupAll(salarySobItemGroupId, val)}
|
||||
/>}>
|
||||
<Row gutter={16}>
|
||||
{
|
||||
!_.isEmpty(salaryItems) ?
|
||||
_.map(salaryItems, it => {
|
||||
const { salaryItemId, salaryItemName, checked } = it;
|
||||
return <Col span={8} style={{ marginBottom: 16 }}>
|
||||
<WeaCheckbox content={salaryItemName} value={checked ? "1" : "0"}
|
||||
onChange={() => this.setState({ itemsCheckeds: _.xorWith(itemsCheckeds, [String(salaryItemId)], _.isEqual) })}
|
||||
/>
|
||||
</Col>;
|
||||
}) : <Col span={24} style={{
|
||||
minHeight: 20,
|
||||
padding: "5%",
|
||||
textAlign: "center"
|
||||
}}>{getLabel(83553, "暂无数据")}</Col>
|
||||
}
|
||||
</Row>
|
||||
</WeaSearchGroup>;
|
||||
})
|
||||
}
|
||||
<TempDialog {...tempDialog} onCancel={(isRefresh) => this.setState({
|
||||
tempDialog: { ...tempDialog, visible: false }
|
||||
}, () => isRefresh && this.props.onCancel(true))}/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 导出模板保存框
|
||||
* Description:
|
||||
* Date: 2024/3/29
|
||||
*/
|
||||
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 { tempConditions } from "../../../../../common/conditions";
|
||||
import * as API from "../../../../../apis/calculate";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("calculateStore")
|
||||
@observer
|
||||
class TempDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
nextProps.calculateStore.tempForm.initFormFields(tempConditions);
|
||||
} else {
|
||||
nextProps.calculateStore.initTempForm();
|
||||
}
|
||||
}
|
||||
|
||||
save = () => {
|
||||
const { calculateStore: { tempForm }, salaryAcctRecordId, id, salaryItemIds } = this.props;
|
||||
tempForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = tempForm.getFormParams();
|
||||
this.setState({ loading: true });
|
||||
API.saveExportTemplate({ ...payload, salaryAcctRecordId, id, salaryItemIds })
|
||||
.then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.props.onCancel(true);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading } = this.state;
|
||||
const { calculateStore: { tempForm } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 400, height: 80 }} initLoadCss title={getLabel(111, "存为模板")}
|
||||
buttons={[
|
||||
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(111, "保存")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout">{getSearchs(tempForm, tempConditions, 1, false)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TempDialog;
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 自定义导出-导出模板管理
|
||||
* Description:
|
||||
* Date: 2024/3/28
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaButtonIcon, WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTab, WeaTable } from "ecCom";
|
||||
import { message, Modal } from "antd";
|
||||
import ExpFieldsSetDialog from "../expFieldsSetDialog";
|
||||
import * as API from "../../../../../apis/calculate";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, dataSource: [], columns: [], loading: false,
|
||||
fieldsSetDialog: { visible: false, salaryAcctRecordId: "", tempId: "", templateName: "", checkItems: [] },
|
||||
query: { templateName: "" }, selectedRowKeys: []
|
||||
};
|
||||
this.dialogRef = null;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getExportTemplateList(nextProps);
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedRowKeys: [] });
|
||||
}
|
||||
|
||||
getExportTemplateList = (props) => {
|
||||
const { pageInfo, query } = this.state;
|
||||
const { salaryAcctRecordId } = props;
|
||||
const payload = { ...pageInfo, ...query, salaryAcctRecordId };
|
||||
this.setState({ loading: true });
|
||||
API.getExportTemplateList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { pageInfo: { columns, list: dataSource, pageNum: current, pageSize, total } } = data;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns: [...columns, {
|
||||
dataIndex: "operate", title: getLabel(111, "操作"), width: 120,
|
||||
render: (__, record) => (<React.Fragment>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.getExportTemplateForm(record)}>{getLabel(111, "编辑")}</a>
|
||||
<a href="javascript:void(0);" style={{ marginLeft: 10 }}
|
||||
onClick={() => this.deleteExportTemplate([record.id])}>{getLabel(111, "删除")}</a>
|
||||
</React.Fragment>)
|
||||
}]
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getExportTemplateForm = (record) => {
|
||||
const { id, templateName } = record;
|
||||
const { fieldsSetDialog } = this.state;
|
||||
const { salaryAcctRecordId } = this.props;
|
||||
API.getExportTemplateForm({ id }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { checkItems } = data;
|
||||
this.setState({
|
||||
fieldsSetDialog: {
|
||||
...fieldsSetDialog, tempId: id, templateName, visible: true, salaryAcctRecordId, checkItems
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
fieldsSetDialog: {
|
||||
...fieldsSetDialog, tempId: id, templateName, visible: true, salaryAcctRecordId, checkItems: []
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
deleteExportTemplate = (ids) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(111, "确定要删除吗?"),
|
||||
onOk: () => {
|
||||
API.deleteExportTemplate({ ids }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.setState({ selectedRowKeys: [] }, () => this.getExportTemplateList(this.props));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { fieldsSetDialog, query, pageInfo, selectedRowKeys, dataSource, columns } = this.state;
|
||||
const { salaryAcctRecordId } = this.props;
|
||||
const dialogBodyHeight = this.dialogRef ? this.dialogRef.state.height : 600;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.getExportTemplateList(this.props));
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => this.getExportTemplateList(this.props));
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys, onChange: selectedRowKeys => this.setState({ selectedRowKeys })
|
||||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} hasScroll scalable title={getLabel(111, "导出模板管理")}
|
||||
ref={dom => this.dialogRef = dom} initLoadCss className="tempManageDialogLayout"
|
||||
style={{
|
||||
width: 700, height: 606.6, minHeight: 200, minWidth: 380, maxHeight: "70%",
|
||||
maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}
|
||||
>
|
||||
<WeaTab datas={[]} buttons={[
|
||||
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}
|
||||
onClick={() => this.setState({
|
||||
fieldsSetDialog: {
|
||||
...fieldsSetDialog, visible: true, tempId: "", templateName: "",
|
||||
salaryAcctRecordId, checkItems: []
|
||||
}
|
||||
})}/>,
|
||||
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "删除")}
|
||||
disabled={_.isEmpty(selectedRowKeys)}
|
||||
onClick={() => this.deleteExportTemplate(selectedRowKeys)}/>,
|
||||
<WeaInputSearch value={query.templateName}
|
||||
onChange={val => this.setState({ query: { ...query, templateName: val } })}
|
||||
onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.getExportTemplateList(this.props))}/>
|
||||
]}/>
|
||||
<WeaTable dataSource={dataSource} columns={columns} pagination={pagination} rowSelection={rowSelection}
|
||||
scroll={{ y: `calc(${dialogBodyHeight}px - 148px)` }}/>
|
||||
<ExpFieldsSetDialog {...fieldsSetDialog}
|
||||
onCancel={(isRefresh) => this.setState({
|
||||
fieldsSetDialog: { ...fieldsSetDialog, visible: false, checkItems: [] }
|
||||
}, () => isRefresh && this.getExportTemplateList(this.props))}/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -14,6 +14,8 @@ export class calculateStore {
|
|||
@observable calculateForm = new WeaForm(); //薪资核算重构-核算form
|
||||
@observable batchUpdateForm = new WeaForm(); //批量更新薪资项目-批量更新form
|
||||
@action initBatchUpdateForm = () => this.batchUpdateForm = new WeaForm();
|
||||
@observable tempForm = new WeaForm(); //导出模板设置-模板form
|
||||
@action initTempForm = () => this.tempForm = new WeaForm();
|
||||
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
@observable form = new WeaForm(); // nrew 一个form
|
||||
|
|
|
|||
Loading…
Reference in New Issue