产品-个税对接
This commit is contained in:
parent
d41687c3fb
commit
bc91806e37
|
|
@ -27,6 +27,7 @@ class TaxAgentSlide extends Component {
|
|||
this.state = {
|
||||
current: 0,
|
||||
loading: false,
|
||||
verifyLoading: false,
|
||||
taxAgentId: ""
|
||||
};
|
||||
this.taxInfoRef = null;
|
||||
|
|
@ -121,10 +122,10 @@ class TaxAgentSlide extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
handleSaveAndVerify = () => {
|
||||
handleSaveAndVerify = (jumpAll = false) => {
|
||||
const { taxAgentId } = this.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]);
|
||||
if (!boolean) {
|
||||
Modal.warning({
|
||||
|
|
@ -137,9 +138,18 @@ class TaxAgentSlide extends Component {
|
|||
// requestType: 1:保存并验证 2:保存
|
||||
const payload = {
|
||||
...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 = () => {
|
||||
const { current, taxAgentId } = this.state;
|
||||
|
|
@ -162,8 +172,8 @@ class TaxAgentSlide extends Component {
|
|||
return CurrentDom;
|
||||
};
|
||||
renderCustomOperate = () => {
|
||||
const { isChief, isEdit } = this.props;
|
||||
const { current, loading } = this.state;
|
||||
const { isChief, isEdit, salaryOn } = this.props;
|
||||
const { current, loading, verifyLoading } = this.state;
|
||||
let CurrentDom = [];
|
||||
//总管理员权限
|
||||
if (isChief) {
|
||||
|
|
@ -175,17 +185,18 @@ class TaxAgentSlide extends Component {
|
|||
];
|
||||
break;
|
||||
case 1:
|
||||
const tmpV = [<Button type="primary"
|
||||
onClick={this.handleSaveAndVerify}>{getLabel(111, "保存并验证")}</Button>];
|
||||
const tmpV = [<Button type="primary" loading={verifyLoading}
|
||||
onClick={this.handleSaveAndVerify}>{getLabel(544343, "保存并验证")}</Button>];
|
||||
const tmpJ = [
|
||||
<Button type="ghost">{getLabel(543470, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.handleSaveAndVerify(true)}>{getLabel(543470, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current + 1 })}>{getLabel(1402, "下一步")}</Button>
|
||||
];
|
||||
CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ];
|
||||
break;
|
||||
case 2:
|
||||
CurrentDom = (!isEdit && false) ?
|
||||
CurrentDom = (!isEdit && salaryOn) ?
|
||||
[<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>]
|
||||
: [];
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ class TaxDeclarationInfo extends Component {
|
|||
name: "",
|
||||
taxCode: "",
|
||||
city: "",
|
||||
areaCode: "",
|
||||
areaCode: null,
|
||||
passwordType: "TAX_NET_PASSWORD",
|
||||
account: "",
|
||||
realNamePassword: "",
|
||||
netPassword: "",
|
||||
netPassword: null,
|
||||
registrationNo: "",
|
||||
departmentCode: "",
|
||||
taxInforVerifiyStatus: ""
|
||||
|
|
@ -70,12 +70,12 @@ class TaxDeclarationInfo extends Component {
|
|||
if (key === "passwordType" && this.state.fieldForm.passwordType === "REAL_NAME_PASSWORD") {
|
||||
this.setState({
|
||||
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") {
|
||||
this.setState({
|
||||
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