parent
f4adb94893
commit
4fc6d1fabd
|
|
@ -137,6 +137,10 @@ export const taxReturnGetForm = (params) => {
|
|||
export const saveAndCheck = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/saveAndCheck", params);
|
||||
};
|
||||
//个税信息-部门备案报税信息保存
|
||||
export const saveDepartmentCodeAndCheck = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/departmentCode/check", params);
|
||||
};
|
||||
//个税信息-提交报税信息
|
||||
export const registrationCheck = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/registration/check", params);
|
||||
|
|
|
|||
|
|
@ -207,6 +207,37 @@ export const taxFillCondition = [
|
|||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const deptFillCondition = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["departmentName"],
|
||||
fieldcol: 14,
|
||||
label: "部门名称",
|
||||
lanId: 536641,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["departmentCode"],
|
||||
fieldcol: 14,
|
||||
label: "部门编码",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
||||
export const taxFillColumns = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,12 +27,9 @@ class TaxAgentSlide extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
current: 0,
|
||||
loading: false,
|
||||
verifyLoading: false,
|
||||
taxAgentId: "",
|
||||
current: 0, loading: false, verifyLoading: false, taxAgentId: "",
|
||||
taxFilingInfoDialofg: {
|
||||
visible: false, title: "",
|
||||
visible: false, title: "", checkPayload: {},
|
||||
isEdit: false, jumpAll: false, loading: false,
|
||||
taxAgentTaxReturnCheckFormDTO: null
|
||||
}
|
||||
|
|
@ -164,7 +161,7 @@ class TaxAgentSlide extends Component {
|
|||
this.setState({
|
||||
taxFilingInfoDialofg: {
|
||||
...taxFilingInfoDialofg, visible: true,
|
||||
isEdit, jumpAll, title: fieldForm.name,
|
||||
isEdit, jumpAll, title: fieldForm.name, checkPayload: payload,
|
||||
taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO || data.table.list
|
||||
}
|
||||
});
|
||||
|
|
@ -320,7 +317,7 @@ class TaxAgentSlide extends Component {
|
|||
<TaxFilingInfoDialofg
|
||||
{...taxFilingInfoDialofg}
|
||||
onSubmit={this.handleSubmit}
|
||||
onCancel={() => {
|
||||
onCancel={(isRefresh) => {
|
||||
const { jumpAll } = taxFilingInfoDialofg;
|
||||
this.setState({
|
||||
current: jumpAll ? this.state.current + 1 : this.state.current,
|
||||
|
|
@ -328,7 +325,10 @@ class TaxAgentSlide extends Component {
|
|||
...taxFilingInfoDialofg, visible: false,
|
||||
taxAgentTaxReturnCheckFormDTO: null
|
||||
}
|
||||
}, () => jumpAll && this.props.onCancel(true));
|
||||
}, () => {
|
||||
isRefresh && this.taxInfoRef.taxReturnGetForm();
|
||||
jumpAll && this.props.onCancel(true);
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,9 +7,10 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { taxFillColumns, taxFillCondition } from "./constants";
|
||||
import { Button, message } from "antd";
|
||||
import { deptFillCondition, taxFillColumns, taxFillCondition } from "./constants";
|
||||
import { getSearchs } from "../../../util";
|
||||
import { saveDepartmentCodeAndCheck } from "../../../apis/taxAgent";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ class TaxFilingInfoDialofg extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedRowKeys: []
|
||||
selectedRowKeys: [], checkLoading: false
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -27,26 +28,53 @@ class TaxFilingInfoDialofg extends Component {
|
|||
if (!_.isEmpty(nextProps.taxAgentTaxReturnCheckFormDTO) &&
|
||||
Object.prototype.toString.call(nextProps.taxAgentTaxReturnCheckFormDTO) === "[object Object]"
|
||||
) {
|
||||
const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm } } = nextProps;
|
||||
const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm, deptfillInfoForm } } = nextProps;
|
||||
taxfillInfoForm.initFormFields(taxFillCondition);
|
||||
deptfillInfoForm.initFormFields(deptFillCondition);
|
||||
const fields = _.map(taxFillCondition[0].items, it => {
|
||||
return it.domkey[0];
|
||||
});
|
||||
fields.map(item => {
|
||||
taxfillInfoForm.updateFields({
|
||||
[item]: taxAgentTaxReturnCheckFormDTO[item] || ""
|
||||
[item]: item !== "divideFiling" ? (taxAgentTaxReturnCheckFormDTO[item] || "") : (taxAgentTaxReturnCheckFormDTO[item] === "ON" ? getLabel(538048, "是") : getLabel(30587, "否"))
|
||||
});
|
||||
});
|
||||
}
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
const { taxAgentStore: { setTaxfillInfoForm } } = nextProps;
|
||||
const { taxAgentStore: { setTaxfillInfoForm, initDeptfillInfoForm } } = nextProps;
|
||||
setTaxfillInfoForm();
|
||||
initDeptfillInfoForm();
|
||||
}
|
||||
}
|
||||
|
||||
handleSaveOrKnow = () => {
|
||||
const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, checkPayload } = this.props;
|
||||
if (taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是")) {
|
||||
deptfillInfoForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.setState({ checkLoading: true });
|
||||
saveDepartmentCodeAndCheck(_.omitBy({ ...checkPayload, ...deptfillInfoForm.getFormParams() }, val => _.isNil(val)))
|
||||
.then(({ status, errormsg }) => {
|
||||
this.setState({ checkLoading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.props.onCancel(true);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ checkLoading: false }));
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.props.onCancel();
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { selectedRowKeys } = this.state;
|
||||
const { taxAgentStore: { taxfillInfoForm }, taxAgentTaxReturnCheckFormDTO, loading } = this.props;
|
||||
const { selectedRowKeys, checkLoading } = this.state;
|
||||
const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, taxAgentTaxReturnCheckFormDTO, loading } = this.props;
|
||||
const rowSelection = {
|
||||
type: "radio",
|
||||
selectedRowKeys,
|
||||
|
|
@ -59,7 +87,9 @@ class TaxFilingInfoDialofg extends Component {
|
|||
buttons={
|
||||
Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ?
|
||||
[
|
||||
<Button type="primary" onClick={this.props.onCancel}>{getLabel(545147, "知道了")}</Button>
|
||||
<Button type="primary" onClick={this.handleSaveOrKnow} loading={checkLoading}>
|
||||
{taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") ? getLabel(537558, "保存") : getLabel(545147, "知道了")}
|
||||
</Button>
|
||||
] : [
|
||||
<Button loading={loading} type="primary"
|
||||
onClick={() => !_.isEmpty(selectedRowKeys) && this.props.onSubmit(selectedRowKeys[0])}>{getLabel(725, "提交")}</Button>
|
||||
|
|
@ -79,7 +109,10 @@ class TaxFilingInfoDialofg extends Component {
|
|||
<div className="taxfillingDialogContent">
|
||||
{
|
||||
Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ?
|
||||
getSearchs(taxfillInfoForm, taxFillCondition, 1) :
|
||||
<React.Fragment>
|
||||
{getSearchs(taxfillInfoForm, taxFillCondition, 1)}
|
||||
{taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") && getSearchs(deptfillInfoForm, deptFillCondition, 1)}
|
||||
</React.Fragment> :
|
||||
<WeaTable
|
||||
rowKey="index" dataSource={taxAgentTaxReturnCheckFormDTO}
|
||||
columns={_.map(taxFillColumns, o => ({
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ export class TaxAgentStore {
|
|||
@observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体
|
||||
@observable taxfillInfoForm = new WeaForm(); //报税信息查看form
|
||||
@action setTaxfillInfoForm = () => this.taxfillInfoForm = new WeaForm(); //报税信息form初始化
|
||||
@observable deptfillInfoForm = new WeaForm(); //报税信息部门备案form
|
||||
@action initDeptfillInfoForm = () => this.deptfillInfoForm = new WeaForm(); //报税信息部门备案form初始化
|
||||
|
||||
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
|
|
|
|||
Loading…
Reference in New Issue