diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js
index 9f49ca38..b3647225 100644
--- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js
+++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js
@@ -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 = [];
+ const tmpV = [];
const tmpJ = [
- ,
+ ,
];
CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ];
break;
case 2:
- CurrentDom = (!isEdit && false) ?
+ CurrentDom = (!isEdit && salaryOn) ?
[]
: [];
diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js
index cef52e95..708bf93a 100644
--- a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js
+++ b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js
@@ -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 }
});
}
});