feature/2.12.1.2403.02-个税-外籍人员信息报送
This commit is contained in:
parent
1ce5e57d73
commit
a27beae87e
|
|
@ -5,14 +5,16 @@
|
|||
* Date: 2023/8/14
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaSlideModal } from "ecCom";
|
||||
import { Button, Col, message, Modal, Row } from "antd";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
|
||||
import { Button, Col, message, Row } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { declareConditions } from "../constants";
|
||||
import { getSearchs } from "../../../util";
|
||||
import { getQueryString } from "../../../util/url";
|
||||
import { employeedeclareGetForm, getEmployeeSave } from "../../../apis/declare";
|
||||
import { commonEnumList } from "../../../apis/archive";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
@inject("employeeDeclareStore")
|
||||
|
|
@ -33,7 +35,8 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.employeeChangeInfo = {};
|
||||
}
|
||||
|
||||
employeedeclareGetForm = (props) => {
|
||||
employeedeclareGetForm = async (props) => {
|
||||
const { data: cardTypeEnum } = await commonEnumList({ enumClass: `com.engine.salary.enums.employeedeclare.CardTypeEnum` });
|
||||
employeedeclareGetForm(_.pick(props, ["id"])).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
|
|
@ -41,7 +44,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
return {
|
||||
...it,
|
||||
items: _.map(it.items, child => {
|
||||
if (child.domkey[0] === "employmentStatus") {
|
||||
if (getKey(child) === "employmentStatus") {
|
||||
return {
|
||||
...child,
|
||||
value: _.take(props.employmentStatusList)[0].enum,
|
||||
|
|
@ -50,7 +53,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
showname: getLabel(it.labelId, it.defaultLabel)
|
||||
}))
|
||||
};
|
||||
} else if (child.domkey[0] === "employmentType") {
|
||||
} else if (getKey(child) === "employmentType") {
|
||||
return {
|
||||
...child,
|
||||
value: _.take(props.employmentTypeList)[0].enum,
|
||||
|
|
@ -59,7 +62,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
showname: getLabel(it.labelId, it.defaultLabel)
|
||||
}))
|
||||
};
|
||||
} else if (child.domkey[0] === "gender") {
|
||||
} else if (getKey(child) === "gender") {
|
||||
return {
|
||||
...child,
|
||||
value: "MALE",
|
||||
|
|
@ -68,7 +71,11 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
{ key: "FEMALE", showname: getLabel(111, "女") }
|
||||
]
|
||||
};
|
||||
} else if (child.domkey[0] === "employeeType") {
|
||||
} else if (getKey(child) === "cardType") {
|
||||
return {
|
||||
...child, options: _.map(cardTypeEnum, o => ({ key: o.enum, showname: o.defaultLabel }))
|
||||
};
|
||||
} else if (getKey(child) === "employeeType") {
|
||||
return {
|
||||
...child,
|
||||
viewAttr: props.id ? 1 : 3,
|
||||
|
|
@ -77,7 +84,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
]
|
||||
};
|
||||
}
|
||||
if (child.conditionType === "SELECT" && child.domkey[0] !== "gender" && child.domkey[0] !== "employmentStatus" && child.domkey[0] !== "employmentType") {
|
||||
if (child.conditionType === "SELECT" && getKey(child) !== "gender" && getKey(child) !== "employmentStatus" && getKey(child) !== "employmentType") {
|
||||
return {
|
||||
...child,
|
||||
options: [
|
||||
|
|
@ -93,37 +100,37 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
employeeInfo: data.data
|
||||
}, () => {
|
||||
const { data: result, columns } = data;
|
||||
const { employeeDeclareStore: { declareForm } } = this.props;
|
||||
const { employeeDeclareStore: { declareForm }, id } = props;
|
||||
declareForm.initFormFields(this.state.eConditions);
|
||||
const filedKes = _.map(columns, it => it.dataIndex);
|
||||
_.map(filedKes, item => {
|
||||
if (item === "disability" || item === "lonelyOld" || item === "martyrDependents") {
|
||||
declareForm.updateFields({ [item]: result[item] || "OFF" });
|
||||
} else if (item === "deductExpenses") {
|
||||
declareForm.updateFields({ [item]: result[item] || "ON" });
|
||||
} else if (item === "gender") {
|
||||
declareForm.updateFields({ [item]: result[item] || "MALE" });
|
||||
} else if (item === "employmentStatus") {
|
||||
declareForm.updateFields({ [item]: result[item] || _.take(props.employmentStatusList)[0].enum });
|
||||
} else if (item === "employmentType") {
|
||||
declareForm.updateFields({ [item]: result[item] || _.take(props.employmentTypeList)[0].enum });
|
||||
} else if (item === "cardType") {
|
||||
declareForm.updateFields({ [item]: "居民身份证" });
|
||||
} else if (item === "employee") {
|
||||
const [employeeData] = result[item] || [];
|
||||
!_.isEmpty(employeeData) && declareForm.updateFields({
|
||||
employeeType: {
|
||||
value: [employeeData._entityType, [employeeData.id, employeeData.name, [{
|
||||
id: employeeData.id,
|
||||
lastname: employeeData.name
|
||||
}]]],
|
||||
valueSpan: ["employeeId"]
|
||||
}
|
||||
});
|
||||
} else {
|
||||
declareForm.updateFields({ [item]: result[item] || "" });
|
||||
}
|
||||
});
|
||||
if (id) {
|
||||
const filedKes = _.map(columns, it => it.dataIndex);
|
||||
_.map(filedKes, item => {
|
||||
if (item === "disability" || item === "lonelyOld" || item === "martyrDependents") {
|
||||
declareForm.updateFields({ [item]: result[item] || "OFF" });
|
||||
} else if (item === "deductExpenses") {
|
||||
declareForm.updateFields({ [item]: result[item] || "ON" });
|
||||
} else if (item === "gender") {
|
||||
declareForm.updateFields({ [item]: result[item] || "MALE" });
|
||||
} else if (item === "employmentStatus") {
|
||||
declareForm.updateFields({ [item]: result[item] || _.take(props.employmentStatusList)[0].enum });
|
||||
} else if (item === "employmentType") {
|
||||
declareForm.updateFields({ [item]: result[item] || _.take(props.employmentTypeList)[0].enum });
|
||||
} else if (item === "employee") {
|
||||
const [employeeData] = result[item] || [];
|
||||
!_.isEmpty(employeeData) && declareForm.updateFields({
|
||||
employeeType: {
|
||||
value: [employeeData._entityType, [employeeData.id, employeeData.name, [{
|
||||
id: employeeData.id,
|
||||
lastname: employeeData.name
|
||||
}]]],
|
||||
valueSpan: ["employeeId"]
|
||||
}
|
||||
});
|
||||
} else {
|
||||
declareForm.updateFields({ [item]: result[item] || "" });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -146,7 +153,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
return {
|
||||
...it,
|
||||
items: _.map(it.items, child => {
|
||||
if (child.domkey[0] === "dismissDate") {
|
||||
if (getKey(child) === "dismissDate") {
|
||||
return {
|
||||
...child,
|
||||
viewAttr: value === "ABNORMAL" ? 3 : 2
|
||||
|
|
@ -176,7 +183,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
return {
|
||||
...it,
|
||||
items: _.map(it.items, child => {
|
||||
if (child.domkey[0] === "employmentDate") {
|
||||
if (getKey(child) === "employmentDate") {
|
||||
return {
|
||||
...child,
|
||||
viewAttr: value !== "OTHER" ? 3 : 2
|
||||
|
|
@ -200,6 +207,36 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
});
|
||||
});
|
||||
break;
|
||||
case "cardType":
|
||||
this.setState({
|
||||
eConditions: _.map(eConditions, it => {
|
||||
return {
|
||||
...it,
|
||||
items: _.map(it.items, child => {
|
||||
if (getKey(child) === "entryDate" || getKey(child) === "departureDate") {
|
||||
return {
|
||||
...child,
|
||||
viewAttr: value !== "RESIDENT_IDENTITY_CARDS" ? 3 : 2
|
||||
};
|
||||
}
|
||||
return { ...child };
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
declareForm.initFormFields(this.state.eConditions);
|
||||
const [employeeData] = this.state.employeeInfo["employee"] || this.employeeChangeInfo["employee"] || [];
|
||||
!_.isEmpty(employeeData) && declareForm.updateFields({
|
||||
employeeType: {
|
||||
value: [employeeData._entityType, [employeeData.id, employeeData.name, [{
|
||||
id: employeeData.id,
|
||||
lastname: employeeData.name
|
||||
}]]],
|
||||
valueSpan: ["employeeId"]
|
||||
}
|
||||
});
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -209,17 +246,28 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
|
|||
const { employeeDeclareStore: { declareForm: form } } = this.props;
|
||||
form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const { employmentType, employmentDate, employmentStatus, dismissDate, ...params } = form.getFormParams();
|
||||
const {
|
||||
employmentType, employmentDate, employmentStatus, dismissDate, cardType, entryDate, departureDate, ...params
|
||||
} = form.getFormParams();
|
||||
if ((employmentType !== "OTHER" && !employmentDate) || (employmentStatus === "ABNORMAL" && !dismissDate)) {
|
||||
Modal.warning({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(518702, "必要信息不完整,红色*为必填项!")
|
||||
});
|
||||
form.showError("dismissDate", getLabel(111, "\"离职日期\"未填写"));
|
||||
return;
|
||||
}
|
||||
if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !entryDate && !departureDate)) {
|
||||
form.showError("entryDate", getLabel(111, "\"首次入境时间\"未填写"));
|
||||
form.showError("departureDate", getLabel(111, "\"预计离境时间\"未填写"));
|
||||
return;
|
||||
}
|
||||
if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !entryDate)) {
|
||||
form.showError("entryDate", getLabel(111, "\"首次入境时间\"未填写"));
|
||||
return;
|
||||
}
|
||||
if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !departureDate)) {
|
||||
form.showError("departureDate", getLabel(111, "\"预计离境时间\"未填写"));
|
||||
return;
|
||||
}
|
||||
const payload = {
|
||||
...form.getFormParams(), id: this.props.id,
|
||||
cardType: "RESIDENT_IDENTITY_CARDS", //暂时写死身份证类型
|
||||
taxAgentId: getQueryString("id"),
|
||||
taxCycle: this.props.taxCycle
|
||||
};
|
||||
|
|
|
|||
|
|
@ -243,18 +243,21 @@ export const declareConditions = [
|
|||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
conditionType: "SELECT",
|
||||
domkey: ["cardType"],
|
||||
fieldcol: 12,
|
||||
label: "证件类型",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "居民身份证",
|
||||
viewAttr: 1
|
||||
value: "",
|
||||
options:[],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
|
|
@ -354,6 +357,28 @@ export const declareConditions = [
|
|||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "DATEPICKER",
|
||||
domkey: ["entryDate"],
|
||||
fieldcol: 12,
|
||||
label: "首次入境时间",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "DATEPICKER",
|
||||
domkey: ["departureDate"],
|
||||
fieldcol: 12,
|
||||
label: "预计离境时间",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "SELECT",
|
||||
|
|
|
|||
Loading…
Reference in New Issue