feature/2.19.1.2501.01-薪酬批量操作
This commit is contained in:
parent
143490c6d1
commit
12947067c0
|
|
@ -37,5 +37,12 @@ export const exportSalaryArchive = (id = "") => {
|
|||
export const withDrawTaxDeclaration = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxdeclaration/withDrawTaxDeclaration", params);
|
||||
};
|
||||
//个税申报表-获取表单数据
|
||||
export const getFormData = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxdeclaration/detail/getFormData", params);
|
||||
};//个税申报表-编辑保存表单数据
|
||||
export const editFormData = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxdeclaration/detail/editFormData", params);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* 个税申报表编辑
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2025/6/11
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaTop } from "ecCom";
|
||||
import FormInfo from "../../../../components/FormInfo";
|
||||
import * as API from "../../../../apis/declare";
|
||||
import { WeaForm } from "comsMobx";
|
||||
import { Button, message } from "antd";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
const form = new WeaForm();
|
||||
const baseInforFields = ["username", "departmentName", "mobile", "jobNum", "idNo"];
|
||||
|
||||
class DeclareDetailEditSlide extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { conditions: [], loading: false };
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.getFormData(nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
form.resetForm();
|
||||
this.setState({ conditions: [], loading: false });
|
||||
}
|
||||
}
|
||||
|
||||
getFormData = (props) => {
|
||||
const { record } = props || this.props, { id: taxDeclarationIdStr, employeeId } = record;
|
||||
API.getFormData({ taxDeclarationIdStr, employeeId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { columns, data: result } = data;
|
||||
return;
|
||||
this.setState({
|
||||
conditions: [{
|
||||
defaultshow: true,
|
||||
items: [
|
||||
..._.map(baseInforFields, o => ({
|
||||
conditionType: "INPUT",
|
||||
domkey: [o],
|
||||
fieldcol: 14,
|
||||
label: _.find(columns, k => k.column === o).text,
|
||||
labelcol: 8,
|
||||
value: result[o] || "",
|
||||
viewAttr: 1
|
||||
})),
|
||||
..._.map(_.filter(columns, o => !baseInforFields.includes(o.column)), k => ({
|
||||
conditionType: "INPUT",
|
||||
domkey: [k.column],
|
||||
fieldcol: 14,
|
||||
rules: "",
|
||||
label: k.text,
|
||||
labelcol: 8,
|
||||
value: result[k.column] || "",
|
||||
viewAttr: 2
|
||||
}))
|
||||
]
|
||||
}]
|
||||
}, () => form.initFormFields(this.state.conditions));
|
||||
}
|
||||
});
|
||||
};
|
||||
save = () => {
|
||||
form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const { record } = this.props, { id } = record;
|
||||
const { username, departmentName, mobile, jobNum, idNo, ...formData } = form.getFormParams();
|
||||
const payload = { id, attendQuoteData: { ...formData } };
|
||||
this.setState({ loading: true });
|
||||
editAttendQuoteData(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功"));
|
||||
this.props.onClose();
|
||||
this.props.onSuccess();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { record } = this.props, { username } = record, { conditions, loading } = this.state;
|
||||
const btns = [
|
||||
<Button type="primary" disabled={_.isEmpty(conditions)} onClick={this.save}
|
||||
loading={loading}>{getLabel(111, "保存")}</Button>
|
||||
];
|
||||
return (<WeaSlideModal {...this.props} className="editAttendanceSlide" top={0} height={100} width={1000}
|
||||
measureX="px" measureT="%" measureY="%" direction="right"
|
||||
title={<WeaTop title={username} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" buttons={btns}/>}
|
||||
content={<FormInfo className="form-dialog-layout" center={false} itemRender={{}} form={form}
|
||||
formFields={conditions} colCount={2}/>
|
||||
}/>);
|
||||
}
|
||||
}
|
||||
|
||||
export default DeclareDetailEditSlide;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import DeclareDetailEditSlide from "./components/declareDetailEditSlide";
|
||||
import { getQueryString } from "../../util/url";
|
||||
import { getIframeParentHeight } from "../../util";
|
||||
import * as API from "../../apis/declare";
|
||||
|
|
@ -101,7 +102,7 @@ export default class GenerateDeclarationDetail extends React.Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { loading, dataSource } = this.state, { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { loading, dataSource, declareSlide } = this.state, { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const buttons = showOperateBtn ? [<Button type="primary"
|
||||
onClick={this.handleExport}>{getLabel(111, "导出全部")}</Button>] : [];
|
||||
return (<WeaTop title={this.renderTitle()} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
|
|
@ -116,6 +117,11 @@ export default class GenerateDeclarationDetail extends React.Component {
|
|||
id="declareTable"
|
||||
/>
|
||||
</Spin>
|
||||
<DeclareDetailEditSlide {...declareSlide}
|
||||
onSuccess={this.getDetailList}
|
||||
onClose={() => this.setState({
|
||||
declareSlide: { ...declareSlide, visible: false }
|
||||
})}/>
|
||||
</div>
|
||||
</div>
|
||||
</WeaTop>);
|
||||
|
|
|
|||
Loading…
Reference in New Issue