release/2.18.2.2412.02-个税

This commit is contained in:
lys 2024-12-25 10:54:45 +08:00
parent 420104e131
commit e8f820058b
5 changed files with 31 additions and 7 deletions

View File

@ -21,7 +21,7 @@ export default class FormInfo extends Component {
style: { marginLeft: 0 },
tipPosition: "bottom",
labelCol: { span: labelCol },
wrapperCol: { span: 24 - labelCol }
wrapperCol: { span: 22 - labelCol }
};
const textAreaProps = { minRows: 4, maxRows: 4 };

View File

@ -157,7 +157,7 @@ export const taxDetailSettingsConditions = {
domkey: ["freeProperty"],
fieldcol: 14,
label: "免税性质",
labelcol: 4,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3

View File

@ -10,10 +10,12 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider } from "ecCom";
import { WeaSwitch } from "comsMobx";
import FormInfo from "../../../components/FormInfo";
import { taxDetailSettingsConditions } from "./columns";
import * as API from "../../../apis/otherDeduct";
import { Button, message } from "antd";
import { toDecimal_n } from "../../../util";
const getLabel = WeaLocaleProvider.getLabel;
@ -42,7 +44,7 @@ class DetailSettingsDialog extends Component {
const payload = settingsForm.getFormParams();
this.setState({ loading: true });
API.saveFreeIncome({ ...payload, mainId }).then(({ status, errormsg }) => {
this.setState({ loading: true });
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess());
@ -58,6 +60,13 @@ class DetailSettingsDialog extends Component {
render() {
const { otherDeductStore: { settingsForm }, dataType } = this.props, { loading } = this.state;
const itemRender = {
freeAmount: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ freeAmount: { value: toDecimal_n(v, 2) } })}/>);
}
};
return (
<WeaDialog
{...this.props} style={{ width: 480, height: 174 }} initLoadCss title={getLabel(111, "明细设置")}
@ -66,7 +75,7 @@ class DetailSettingsDialog extends Component {
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取消")}</Button>
]}
>
<FormInfo className="form-dialog-layout" center={false}
<FormInfo className="form-dialog-layout" center={false} itemRender={itemRender}
form={settingsForm} formFields={taxDetailSettingsConditions[dataType] || []}/>
</WeaDialog>
);

View File

@ -45,8 +45,16 @@ class TaxSetDialog extends Component {
if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({
columns,
dataSource, pageInfo: { current, pageSize, total }
dataSource, pageInfo: { current, pageSize, total },
columns: _.map(columns, o => ({
...o, width: o.dataIndex === "operate" && 120,
render: (text, record) => o.dataIndex === "operate" ?
(<div className="space_div">
<a href="javascript:void(0);">{getLabel(111, "编辑")}</a>
<a href="javascript:void(0);">{getLabel(111, "删除")}</a>
</div>) :
(<span>{text}</span>)
}))
});
}
});
@ -93,7 +101,7 @@ class TaxSetDialog extends Component {
</div>
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} bordered
rowSelection={rowSelection} loading={loading}
scroll={{ y: this.taxSetRef ? this.taxSetRef.state.height - 112 : 600 }}/>
scroll={{ y: this.taxSetRef ? this.taxSetRef.state.height - 156 : 600 }}/>
<DetailSettingsDialog {...detailSettingsDialog} onCancel={() => this.setState({
detailSettingsDialog: { ...detailSettingsDialog, visible: false }
})} onSuccess={this.getList}/>

View File

@ -152,3 +152,10 @@
}
}
//公共表格操作按钮间距
.space_div {
a:not(:last-child) {
margin-right: 8px;
}
}