feature/2.12.1.2403.02-薪资核算自定义导出模板设置

This commit is contained in:
黎永顺 2024-03-29 16:15:11 +08:00
parent 8a7f3fcb7a
commit 3ab97c5a70
1 changed files with 18 additions and 9 deletions

View File

@ -31,7 +31,7 @@ class Index extends Component {
itemsCheckeds: [], showOnlyChecked: false, tempMangeDialog: { visible: false, salaryAcctRecordId: "" }, itemsCheckeds: [], showOnlyChecked: false, tempMangeDialog: { visible: false, salaryAcctRecordId: "" },
tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] }, tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] },
tempOptions: [ tempOptions: [
{ key: "", showname: "" }, { key: "NULL", showname: "" },
{ key: "system", showname: getLabel(111, "系统模板") } { key: "system", showname: getLabel(111, "系统模板") }
] ]
}; };
@ -45,7 +45,7 @@ class Index extends Component {
} else { } else {
this.setState({ this.setState({
tempOptions: [ tempOptions: [
{ key: "", showname: "" }, { key: "NULL", showname: "" },
{ key: "system", showname: getLabel(111, "系统模板") } { key: "system", showname: getLabel(111, "系统模板") }
] ]
}); });
@ -106,8 +106,8 @@ class Index extends Component {
const { data: { checkItems: checkeds } } = await getExportField({ salaryAcctRecordId }); const { data: { checkItems: checkeds } } = await getExportField({ salaryAcctRecordId });
this.setState({ itemsCheckeds: checkeds }); this.setState({ itemsCheckeds: checkeds });
break; break;
case "": case "NULL":
this.setState({ itemsCheckeds: "" }); this.setState({ itemsCheckeds: [] });
break; break;
default: default:
const { data: { checkItems } } = await getExportTemplateForm({ id }); const { data: { checkItems } } = await getExportTemplateForm({ id });
@ -134,7 +134,8 @@ class Index extends Component {
} }
const titleComp = <div className="setHeaderWrapper"> const titleComp = <div className="setHeaderWrapper">
<span>{getLabel(111, "选择字段")}</span> <span>{getLabel(111, "选择字段")}</span>
<WeaSelect options={tempOptions} style={{ width: 200 }} onChange={this.handleChangeExpTemp}/> <WeaSelect defaultValue="system" options={tempOptions} style={{ width: 200 }}
onChange={this.handleChangeExpTemp}/>
</div>; </div>;
return ( return (
<WeaDialog <WeaDialog
@ -153,11 +154,19 @@ class Index extends Component {
buttons={[ buttons={[
<Button type="primary" onClick={this.customExportClick}>{getLabel(17416, "导出")}</Button>, <Button type="primary" onClick={this.customExportClick}>{getLabel(17416, "导出")}</Button>,
<Button type="primary" onClick={() => this.setState({ <Button type="primary" onClick={() => this.setState({
tempDialog: { visible: true, salaryAcctRecordId, id: "", salaryItemIds: itemsCheckeds } tempDialog: { visible: true, salaryAcctRecordId, id: "", salaryItemIds: itemsCheckeds },
tempOptions: [
{ key: "NULL", showname: "" },
{ key: "system", showname: getLabel(111, "系统模板") }
]
})}>{getLabel(111, "存为模板")}</Button>, })}>{getLabel(111, "存为模板")}</Button>,
<Button type="primary" <Button type="primary"
onClick={() => this.setState({ onClick={() => this.setState({
tempMangeDialog: { visible: true, salaryAcctRecordId } tempMangeDialog: { visible: true, salaryAcctRecordId },
tempOptions: [
{ key: "NULL", showname: "" },
{ key: "system", showname: getLabel(111, "系统模板") }
]
})}>{getLabel(111, "模板管理")}</Button>, })}>{getLabel(111, "模板管理")}</Button>,
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button> <Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
]} ]}
@ -196,9 +205,9 @@ class Index extends Component {
}, () => this.getExportTemplateList(this.props))} }, () => this.getExportTemplateList(this.props))}
/> />
{/*模板保存*/} {/*模板保存*/}
<TempDialog {...tempDialog} onCancel={(isRefresh) => this.setState({ <TempDialog {...tempDialog} onCancel={() => this.setState({
tempDialog: { ...tempDialog, visible: false } tempDialog: { ...tempDialog, visible: false }
})}/> }, () => this.getExportTemplateList(this.props))}/>
</WeaDialog> </WeaDialog>
); );
} }