feature/2.19.1.2501.01-薪酬批量操作

This commit is contained in:
lys 2025-06-11 10:32:52 +08:00
parent 12947067c0
commit 89c3231871
3 changed files with 39 additions and 17 deletions

View File

@ -13,10 +13,11 @@ import FormInfo from "../../../../components/FormInfo";
import * as API from "../../../../apis/declare";
import { WeaForm } from "comsMobx";
import { Button, message } from "antd";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
const form = new WeaForm();
const baseInforFields = ["username", "departmentName", "mobile", "jobNum", "idNo"];
const baseInforFields = ["username", "cardType", "cardNum", "jobNum"];
class DeclareDetailEditSlide extends Component {
constructor(props) {
@ -27,6 +28,7 @@ class DeclareDetailEditSlide extends Component {
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
this.getFormData(nextProps);
document.title = nextProps.record.username;
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
form.resetForm();
this.setState({ conditions: [], loading: false });
@ -34,11 +36,10 @@ class DeclareDetailEditSlide extends Component {
}
getFormData = (props) => {
const { record } = props || this.props, { id: taxDeclarationIdStr, employeeId } = record;
const { record, taxDeclarationIdStr } = props || this.props, { employeeId } = record;
API.getFormData({ taxDeclarationIdStr, employeeId }).then(({ status, data }) => {
if (status) {
const { columns, data: result } = data;
return;
const { column, data: result } = data;
this.setState({
conditions: [{
defaultshow: true,
@ -47,19 +48,19 @@ class DeclareDetailEditSlide extends Component {
conditionType: "INPUT",
domkey: [o],
fieldcol: 14,
label: _.find(columns, k => k.column === o).text,
label: _.find(column, k => k.dataIndex === o).title,
labelcol: 8,
value: result[o] || "",
viewAttr: 1
})),
..._.map(_.filter(columns, o => !baseInforFields.includes(o.column)), k => ({
..._.map(_.filter(column, o => !baseInforFields.includes(o.dataIndex)), k => ({
conditionType: "INPUT",
domkey: [k.column],
domkey: [k.dataIndex],
fieldcol: 14,
rules: "",
label: k.text,
label: k.title,
labelcol: 8,
value: result[k.column] || "",
value: result[k.dataIndex] || "",
viewAttr: 2
}))
]
@ -71,11 +72,11 @@ class DeclareDetailEditSlide extends Component {
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 } };
const { record, taxDeclarationIdStr } = this.props, { employeeId } = record;
const { username, cardType, cardNum, ...formData } = form.getFormParams();
const payload = { taxDeclarationIdStr, employeeId, valueMap: { ...formData } };
this.setState({ loading: true });
editAttendQuoteData(payload).then(({ status, errormsg }) => {
API.editFormData(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功"));
@ -97,7 +98,7 @@ class DeclareDetailEditSlide extends Component {
<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}
return (<WeaSlideModal {...this.props} className="declareSlide" 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}/>}

View File

@ -0,0 +1,21 @@
.declareSlide {
.wea-slide-modal-content {
height: 100%;
background: #f6f6f6;
}
.wea-slide-modal-title {
height: initial;
line-height: initial;
text-align: left;
.wea-new-top > div:last-child {
padding-right: 50px !important;
}
}
.rodal-close {
z-index: 99;
top: 10px !important;
}
}

View File

@ -112,12 +112,12 @@ export default class GenerateDeclarationDetail extends React.Component {
<Spin spinning={loading}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
src="http://localhost:7607/#/unitTable"
// src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
// src="http://localhost:7607/#/unitTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
id="declareTable"
/>
</Spin>
<DeclareDetailEditSlide {...declareSlide}
<DeclareDetailEditSlide {...declareSlide} taxDeclarationIdStr={getQueryString("id")}
onSuccess={this.getDetailList}
onClose={() => this.setState({
declareSlide: { ...declareSlide, visible: false }