release/2.18.2.2412.02-release/2.18.2.2412.02-个税
This commit is contained in:
parent
e0b387503b
commit
420104e131
|
|
@ -85,3 +85,7 @@ export const deleteAllData = (params) => {
|
|||
export const extendToLastMonth = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/otherDeduction/extendToLastMonth", params);
|
||||
};
|
||||
//免税收入保存
|
||||
export const saveFreeIncome = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/otherDeduction/saveFreeIncome", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@ import { WeaSwitch } from "comsMobx";
|
|||
export default class FormInfo extends Component {
|
||||
renderForm = () => {
|
||||
const {
|
||||
formFields, form, colCount, itemRender, onSelectedChangeHandle,
|
||||
showLabel, multiColumn, custLabelCol, childrenComponents
|
||||
formFields, form, colCount, itemRender, onSelectedChangeHandle, showLabel, multiColumn, custLabelCol,
|
||||
childrenComponents
|
||||
} = this.props;
|
||||
|
||||
let groupArr = [];
|
||||
const formParams = form.getFormParams();
|
||||
const labelVisible = showLabel == null || showLabel == true;
|
||||
const col = colCount ? colCount : 1;
|
||||
const labelCol = labelVisible ? (custLabelCol || `${window.HrmEngineLabelCol}`) : 0;
|
||||
const labelCol = labelVisible ? (custLabelCol || 6) : 0;
|
||||
const itemProps = {
|
||||
ratio1to2: labelVisible && custLabelCol == null,
|
||||
// ratio1to2: labelVisible && custLabelCol == null,
|
||||
style: { marginLeft: 0 },
|
||||
tipPosition: "bottom",
|
||||
labelCol: { span: labelCol },
|
||||
|
|
@ -61,7 +61,6 @@ export default class FormInfo extends Component {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
coms != null && formItems.push({
|
||||
com: (<WeaFormItem {...itemProps}>{coms}</WeaFormItem>),
|
||||
col
|
||||
|
|
|
|||
|
|
@ -139,6 +139,46 @@ export const dataCollectCondition = [
|
|||
col: 2
|
||||
}
|
||||
];
|
||||
export const taxDetailSettingsConditions = {
|
||||
freeIncome: [{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["freeItem"],
|
||||
fieldcol: 14,
|
||||
label: "免税事项",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["freeProperty"],
|
||||
fieldcol: 14,
|
||||
label: "免税性质",
|
||||
labelcol: 4,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["freeAmount"],
|
||||
fieldcol: 14,
|
||||
label: "免税金额",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true,
|
||||
col: 1
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,22 +8,66 @@
|
|||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import FormInfo from "../../../components/FormInfo";
|
||||
import { taxDetailSettingsConditions } from "./columns";
|
||||
import * as API from "../../../apis/otherDeduct";
|
||||
import { Button, message } from "antd";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("otherDeductStore")
|
||||
@observer
|
||||
class DetailSettingsDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.props.otherDeductStore.settingsForm.initFormFields(taxDetailSettingsConditions[nextProps.dataType]);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.props.otherDeductStore.settingsForm.resetForm();
|
||||
}
|
||||
}
|
||||
|
||||
save = () => {
|
||||
const { otherDeductStore: { settingsForm }, mainId } = this.props;
|
||||
settingsForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = settingsForm.getFormParams();
|
||||
this.setState({ loading: true });
|
||||
API.saveFreeIncome({ ...payload, mainId }).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: true });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.props.onCancel(this.props.onSuccess());
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { otherDeductStore: { settingsForm }, dataType } = this.props, { loading } = this.state;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 174 }} initLoadCss
|
||||
{...this.props} style={{ width: 480, height: 174 }} initLoadCss title={getLabel(111, "明细设置")}
|
||||
buttons={[
|
||||
<Button type="primary">{getLabel(111, "确定")}</Button>,
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "确定")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取消")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout"></div>
|
||||
<FormInfo className="form-dialog-layout" center={false}
|
||||
form={settingsForm} formFields={taxDetailSettingsConditions[dataType] || []}/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,13 +20,15 @@ class TaxSetDialog extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
selectedRowKeys: [], detailSettingsDialog: { visible: false }
|
||||
selectedRowKeys: [], detailSettingsDialog: { visible: false, dataType: "", mainId: "", id: "" }
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.getList(nextProps);
|
||||
this.setState({
|
||||
detailSettingsDialog: { ...this.state.detailSettingsDialog, dataType: nextProps.dataType, mainId: nextProps.id }
|
||||
}, () => this.getList(nextProps));
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.setState({
|
||||
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
|
|
@ -94,7 +96,7 @@ class TaxSetDialog extends Component {
|
|||
scroll={{ y: this.taxSetRef ? this.taxSetRef.state.height - 112 : 600 }}/>
|
||||
<DetailSettingsDialog {...detailSettingsDialog} onCancel={() => this.setState({
|
||||
detailSettingsDialog: { ...detailSettingsDialog, visible: false }
|
||||
})}/>
|
||||
})} onSuccess={this.getList}/>
|
||||
</Spin>
|
||||
</div>
|
||||
</WeaDialog>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ export class OtherDeductStore {
|
|||
@observable form = new WeaForm(); // new 一个form
|
||||
@observable addForm = new WeaForm(); // 新增form
|
||||
@action initAddForm = () => this.addForm = new WeaForm();
|
||||
@observable settingsForm = new WeaForm(); // 其他个税申报明细form
|
||||
@observable condition = []; // 存储后台得到的form数据
|
||||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
|
|
|
|||
Loading…
Reference in New Issue