产品-个税对接
This commit is contained in:
parent
d41687c3fb
commit
bc91806e37
|
|
@ -27,6 +27,7 @@ class TaxAgentSlide extends Component {
|
||||||
this.state = {
|
this.state = {
|
||||||
current: 0,
|
current: 0,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
verifyLoading: false,
|
||||||
taxAgentId: ""
|
taxAgentId: ""
|
||||||
};
|
};
|
||||||
this.taxInfoRef = null;
|
this.taxInfoRef = null;
|
||||||
|
|
@ -121,10 +122,10 @@ class TaxAgentSlide extends Component {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
handleSaveAndVerify = () => {
|
handleSaveAndVerify = (jumpAll = false) => {
|
||||||
const { taxAgentId } = this.state;
|
const { taxAgentId } = this.state;
|
||||||
const { fieldForm, fieldItem } = this.taxInfoRef.state;
|
const { fieldForm, fieldItem } = this.taxInfoRef.state;
|
||||||
const { city: cityVal, ...extra } = fieldForm;
|
const { city: cityVal, netPassword, realNamePassword, ...extra } = fieldForm;
|
||||||
const boolean = _.every(_.filter(fieldItem, item => item.viewAttr === 3), it => fieldForm[it.key]);
|
const boolean = _.every(_.filter(fieldItem, item => item.viewAttr === 3), it => fieldForm[it.key]);
|
||||||
if (!boolean) {
|
if (!boolean) {
|
||||||
Modal.warning({
|
Modal.warning({
|
||||||
|
|
@ -137,9 +138,18 @@ class TaxAgentSlide extends Component {
|
||||||
// requestType: 1:保存并验证 2:保存
|
// requestType: 1:保存并验证 2:保存
|
||||||
const payload = {
|
const payload = {
|
||||||
...extra, nation, province, city,
|
...extra, nation, province, city,
|
||||||
taxAgentId, requestType: 1
|
taxAgentId, requestType: 1, password: netPassword || realNamePassword
|
||||||
};
|
};
|
||||||
console.log(_.omitBy(payload, val => _.isNil(val)));
|
this.setState({ verifyLoading: true });
|
||||||
|
API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, errormsg }) => {
|
||||||
|
this.setState({ verifyLoading: false });
|
||||||
|
if (status) {
|
||||||
|
message.error(errormsg || getLabel(22619, "保存成功!"));
|
||||||
|
jumpAll ? this.props.onCancel(true) : this.props.onOk();
|
||||||
|
} else {
|
||||||
|
message.error(errormsg || getLabel(22620, "保存失败!"));
|
||||||
|
}
|
||||||
|
}).catch(() => this.setState({ verifyLoading: false }));
|
||||||
};
|
};
|
||||||
renderChildren = () => {
|
renderChildren = () => {
|
||||||
const { current, taxAgentId } = this.state;
|
const { current, taxAgentId } = this.state;
|
||||||
|
|
@ -162,8 +172,8 @@ class TaxAgentSlide extends Component {
|
||||||
return CurrentDom;
|
return CurrentDom;
|
||||||
};
|
};
|
||||||
renderCustomOperate = () => {
|
renderCustomOperate = () => {
|
||||||
const { isChief, isEdit } = this.props;
|
const { isChief, isEdit, salaryOn } = this.props;
|
||||||
const { current, loading } = this.state;
|
const { current, loading, verifyLoading } = this.state;
|
||||||
let CurrentDom = [];
|
let CurrentDom = [];
|
||||||
//总管理员权限
|
//总管理员权限
|
||||||
if (isChief) {
|
if (isChief) {
|
||||||
|
|
@ -175,17 +185,18 @@ class TaxAgentSlide extends Component {
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
const tmpV = [<Button type="primary"
|
const tmpV = [<Button type="primary" loading={verifyLoading}
|
||||||
onClick={this.handleSaveAndVerify}>{getLabel(111, "保存并验证")}</Button>];
|
onClick={this.handleSaveAndVerify}>{getLabel(544343, "保存并验证")}</Button>];
|
||||||
const tmpJ = [
|
const tmpJ = [
|
||||||
<Button type="ghost">{getLabel(543470, "完成,跳过所有步骤")}</Button>,
|
<Button type="ghost"
|
||||||
|
onClick={() => this.handleSaveAndVerify(true)}>{getLabel(543470, "完成,跳过所有步骤")}</Button>,
|
||||||
<Button type="ghost"
|
<Button type="ghost"
|
||||||
onClick={() => this.setState({ current: current + 1 })}>{getLabel(1402, "下一步")}</Button>
|
onClick={() => this.setState({ current: current + 1 })}>{getLabel(1402, "下一步")}</Button>
|
||||||
];
|
];
|
||||||
CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ];
|
CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ];
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
CurrentDom = (!isEdit && false) ?
|
CurrentDom = (!isEdit && salaryOn) ?
|
||||||
[<Button type="ghost"
|
[<Button type="ghost"
|
||||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>]
|
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>]
|
||||||
: [];
|
: [];
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@ class TaxDeclarationInfo extends Component {
|
||||||
name: "",
|
name: "",
|
||||||
taxCode: "",
|
taxCode: "",
|
||||||
city: "",
|
city: "",
|
||||||
areaCode: "",
|
areaCode: null,
|
||||||
passwordType: "TAX_NET_PASSWORD",
|
passwordType: "TAX_NET_PASSWORD",
|
||||||
account: "",
|
account: "",
|
||||||
realNamePassword: "",
|
realNamePassword: "",
|
||||||
netPassword: "",
|
netPassword: null,
|
||||||
registrationNo: "",
|
registrationNo: "",
|
||||||
departmentCode: "",
|
departmentCode: "",
|
||||||
taxInforVerifiyStatus: ""
|
taxInforVerifiyStatus: ""
|
||||||
|
|
@ -70,12 +70,12 @@ class TaxDeclarationInfo extends Component {
|
||||||
if (key === "passwordType" && this.state.fieldForm.passwordType === "REAL_NAME_PASSWORD") {
|
if (key === "passwordType" && this.state.fieldForm.passwordType === "REAL_NAME_PASSWORD") {
|
||||||
this.setState({
|
this.setState({
|
||||||
fieldItem: _.filter(fieldList, it => it.key !== "netPassword"),
|
fieldItem: _.filter(fieldList, it => it.key !== "netPassword"),
|
||||||
fieldForm: { ...this.state.fieldForm, realNameAccount: "", realNameAccountPassword: "" }
|
fieldForm: { ...this.state.fieldForm, account: null, realNamePassword: null, netPassword: null }
|
||||||
});
|
});
|
||||||
} else if (key === "passwordType" && this.state.fieldForm.passwordType === "TAX_NET_PASSWORD") {
|
} else if (key === "passwordType" && this.state.fieldForm.passwordType === "TAX_NET_PASSWORD") {
|
||||||
this.setState({
|
this.setState({
|
||||||
fieldItem: _.filter(fieldList, it => it.key !== "account" && it.key !== "realNamePassword"),
|
fieldItem: _.filter(fieldList, it => it.key !== "account" && it.key !== "realNamePassword"),
|
||||||
fieldForm: { ...this.state.fieldForm, taxOnlinePassword: "" }
|
fieldForm: { ...this.state.fieldForm, netPassword: null, account: null, realNamePassword: null }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue