Merge branch 'feature/2.9.10.2312.02-社保档案个人和公司基数设置' into release/2.9.10.2312.02
This commit is contained in:
commit
da7194d6b1
|
|
@ -1,9 +1,14 @@
|
||||||
import { WeaTools } from "ecCom";
|
import { WeaTools } from "ecCom";
|
||||||
|
import { postFetch } from "../util/request";
|
||||||
|
|
||||||
//薪资档案-薪资档案列表
|
//薪资档案-薪资档案列表
|
||||||
export const getArchiveList = params => {
|
export const getArchiveList = params => {
|
||||||
return postFetch("/api/bs/hrmsalary/salaryArchive/list", params);
|
return postFetch("/api/bs/hrmsalary/salaryArchive/list", params);
|
||||||
};
|
};
|
||||||
|
//薪资档案的高级搜索
|
||||||
|
export const getSaCondition = params => {
|
||||||
|
return WeaTools.callApi("/api/bs/hrmsalary/archives/getSearchCondition", "get", params);
|
||||||
|
};
|
||||||
//薪资档案-获取薪资档案详情表单
|
//薪资档案-获取薪资档案详情表单
|
||||||
export const getArchiveForm = params => {
|
export const getArchiveForm = params => {
|
||||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getForm", "get", params);
|
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getForm", "get", params);
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ export default class Index extends Component {
|
||||||
confValue: "0",
|
confValue: "0",
|
||||||
withDrawTaxDeclaration: "0",
|
withDrawTaxDeclaration: "0",
|
||||||
extEmpsWitch: "0",
|
extEmpsWitch: "0",
|
||||||
salaryAcctFixedColumns: 0
|
salaryAcctFixedColumns: 0,
|
||||||
|
welBaseDiffByPerAndCom: "0",
|
||||||
},
|
},
|
||||||
showEncryptOperationButton: "",
|
showEncryptOperationButton: "",
|
||||||
progressVisible: false,
|
progressVisible: false,
|
||||||
|
|
@ -66,7 +67,8 @@ export default class Index extends Component {
|
||||||
ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "",
|
ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "",
|
||||||
taxDeclarationFunction: operateTaxDeclaration = "1", salaryArchiveDelete: confValue,
|
taxDeclarationFunction: operateTaxDeclaration = "1", salaryArchiveDelete: confValue,
|
||||||
salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0",
|
salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0",
|
||||||
OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0", salaryAcctFixedColumns = "0"
|
OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0", salaryAcctFixedColumns = "0",
|
||||||
|
welBaseDiffByPerAndCom = "0",
|
||||||
}
|
}
|
||||||
} = sysInfo;
|
} = sysInfo;
|
||||||
// const { data: { ascOrDesc, orderRule } } = orderRules;
|
// const { data: { ascOrDesc, orderRule } } = orderRules;
|
||||||
|
|
@ -87,7 +89,8 @@ export default class Index extends Component {
|
||||||
saveParams: {
|
saveParams: {
|
||||||
...saveParams,
|
...saveParams,
|
||||||
ascOrDesc, orderRule, rule, enctry, matchRule, confValue, withDrawTaxDeclaration, salaryAcctFixedColumns,
|
ascOrDesc, orderRule, rule, enctry, matchRule, confValue, withDrawTaxDeclaration, salaryAcctFixedColumns,
|
||||||
extEmpsWitch, operateTaxDeclaration: (operateTaxDeclaration && operateTaxDeclaration !== "0") ? "1" : "0"
|
extEmpsWitch, operateTaxDeclaration: (operateTaxDeclaration && operateTaxDeclaration !== "0") ? "1" : "0",
|
||||||
|
welBaseDiffByPerAndCom
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -307,6 +310,13 @@ export default class Index extends Component {
|
||||||
confValue: !_.isNil(val) ? val.toString() : "0"
|
confValue: !_.isNil(val) ? val.toString() : "0"
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "welBaseDiffByPerAndCom":
|
||||||
|
this.saveSysOperate({
|
||||||
|
title: getLabel(111, "福利档案基数区分个人和公司"),
|
||||||
|
module: "basic", confKey: key,
|
||||||
|
confValue: val
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -342,7 +352,8 @@ export default class Index extends Component {
|
||||||
confValue,
|
confValue,
|
||||||
withDrawTaxDeclaration,
|
withDrawTaxDeclaration,
|
||||||
extEmpsWitch,
|
extEmpsWitch,
|
||||||
salaryAcctFixedColumns
|
salaryAcctFixedColumns,
|
||||||
|
welBaseDiffByPerAndCom
|
||||||
} = saveParams;
|
} = saveParams;
|
||||||
return (
|
return (
|
||||||
<div className="ruleWrapper">
|
<div className="ruleWrapper">
|
||||||
|
|
@ -398,6 +409,12 @@ export default class Index extends Component {
|
||||||
onChange={val => this.handleChange("confValue", val)}/>
|
onChange={val => this.handleChange("confValue", val)}/>
|
||||||
</WeaFormItem>
|
</WeaFormItem>
|
||||||
</WeaSearchGroup>
|
</WeaSearchGroup>
|
||||||
|
<WeaSearchGroup title={getLabel(111, "福利档案基数")} showGroup center>
|
||||||
|
<WeaFormItem label={getLabel(111, "区分个人和公司")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||||
|
<WeaCheckbox display="switch" value={welBaseDiffByPerAndCom}
|
||||||
|
onChange={val => this.handleChange("welBaseDiffByPerAndCom", val)}/>
|
||||||
|
</WeaFormItem>
|
||||||
|
</WeaSearchGroup>
|
||||||
<WeaSearchGroup title={getLabel(111, "薪资核算人员匹配规则")} showGroup center>
|
<WeaSearchGroup title={getLabel(111, "薪资核算人员匹配规则")} showGroup center>
|
||||||
<WeaFormItem label={getLabel(111, "匹配规则")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
<WeaFormItem label={getLabel(111, "匹配规则")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||||
<WeaSelect options={matchRuleOptions} value={matchRule}
|
<WeaSelect options={matchRuleOptions} value={matchRule}
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,39 @@ class Index extends Component {
|
||||||
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses,
|
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses,
|
||||||
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData
|
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData
|
||||||
} = props;
|
} = props;
|
||||||
|
let socialComData = {}, fundComData = {}, otherComData = {};
|
||||||
|
if (!_.isNil(socialBase.comItems) && !_.isNil(socialBase.comData)) {
|
||||||
|
_.forEach(getConditionDomkeys(socialBase.comItems), o => {
|
||||||
|
socialComData = {
|
||||||
|
...socialComData,
|
||||||
|
[`${o}_com`]: socialBase.comData[o]
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!_.isNil(fundBase.comItems) && !_.isNil(fundBase.comData)) {
|
||||||
|
_.forEach(getConditionDomkeys(fundBase.comItems), o => {
|
||||||
|
fundComData = {
|
||||||
|
...fundComData,
|
||||||
|
[`${o}_com`]: fundBase.comData[o]
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!_.isNil(otherBase.comItems) && !_.isNil(otherBase.comData)) {
|
||||||
|
_.forEach(getConditionDomkeys(otherBase.comItems), o => {
|
||||||
|
otherComData = {
|
||||||
|
...otherComData,
|
||||||
|
[`${o}_com`]: otherBase.comData[o]
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
const payload = { employeeId, paymentOrganization, welfareTypeEnum: "" };
|
const payload = { employeeId, paymentOrganization, welfareTypeEnum: "" };
|
||||||
API.getBaseForm(payload).then(({ status, data }) => {
|
API.getBaseForm(payload).then(({ status, data }) => {
|
||||||
if (status) {
|
if (status) {
|
||||||
const { data: result } = data;
|
const { data: result } = data;
|
||||||
const formData = {
|
const formData = {
|
||||||
...result, ...socialBaseData, ...fundBaseData, ...othersBaseData,
|
...result, ...socialBaseData, ...fundBaseData, ...othersBaseData,
|
||||||
...socialBase.data, ...fundBase.data, ...otherBase.data
|
...socialBase.data, ...fundBase.data, ...otherBase.data,
|
||||||
|
...socialComData, ...fundComData, ...otherComData
|
||||||
};
|
};
|
||||||
this.setState({
|
this.setState({
|
||||||
formData,
|
formData,
|
||||||
|
|
@ -120,7 +146,7 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
covertPayload = (welfareType, underTakeType, paymentForm) => {
|
covertPayload = (welfareType, underTakeType, paymentForm, paymentComForm) => {
|
||||||
const { archivesStore: { welfareProfileForm } } = this.props;
|
const { archivesStore: { welfareProfileForm } } = this.props;
|
||||||
const welfareData = welfareProfileForm.getFormParams();
|
const welfareData = welfareProfileForm.getFormParams();
|
||||||
const { formData } = this.state;
|
const { formData } = this.state;
|
||||||
|
|
@ -136,13 +162,20 @@ class Index extends Component {
|
||||||
if (formData[cur] || formData[cur] === 0) return { ...pre, [cur]: toDecimal_n(formData[cur], 2).toString() };
|
if (formData[cur] || formData[cur] === 0) return { ...pre, [cur]: toDecimal_n(formData[cur], 2).toString() };
|
||||||
return { ...pre, [cur]: "0" };
|
return { ...pre, [cur]: "0" };
|
||||||
}, {})) : "",
|
}, {})) : "",
|
||||||
|
paymentComForm: !_.isEmpty(paymentComForm) ? JSON.stringify(_.reduce(paymentComForm, (pre, cur) => {
|
||||||
|
if (formData[`${cur}_com`] || formData[`${cur}_com`] === 0) return {
|
||||||
|
...pre,
|
||||||
|
[cur]: toDecimal_n(formData[`${cur}_com`], 2).toString()
|
||||||
|
};
|
||||||
|
return { ...pre, [cur]: "0" };
|
||||||
|
}, {})) : "",
|
||||||
welfareType, validate: welfareData[`${underTakeType}SchemeId`] ? !!welfareData[`${underTakeType}StartTime`] : true
|
welfareType, validate: welfareData[`${underTakeType}SchemeId`] ? !!welfareData[`${underTakeType}StartTime`] : true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
save = async () => {
|
save = async () => {
|
||||||
const socailPayload = this.covertPayload("SOCIAL_SECURITY", "social", getConditionDomkeys(this.props.socialBase.items)),
|
const socailPayload = this.covertPayload("SOCIAL_SECURITY", "social", getConditionDomkeys(this.props.socialBase.items), getConditionDomkeys(this.props.socialBase.comItems || [])),
|
||||||
fundPayload = this.covertPayload("ACCUMULATION_FUND", "fund", getConditionDomkeys(this.props.fundBase.items)),
|
fundPayload = this.covertPayload("ACCUMULATION_FUND", "fund", getConditionDomkeys(this.props.fundBase.items), getConditionDomkeys(this.props.fundBase.comItems || [])),
|
||||||
otherPayload = this.covertPayload("OTHER", "other", getConditionDomkeys(this.props.otherBase.items));
|
otherPayload = this.covertPayload("OTHER", "other", getConditionDomkeys(this.props.otherBase.items), getConditionDomkeys(this.props.otherBase.comItems || []));
|
||||||
if (!(socailPayload.validate && fundPayload.validate && otherPayload.validate)) {
|
if (!(socailPayload.validate && fundPayload.validate && otherPayload.validate)) {
|
||||||
message.warning(getLabel(111, "请维护起始缴纳月!"));
|
message.warning(getLabel(111, "请维护起始缴纳月!"));
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -240,11 +240,11 @@ class Index extends Component {
|
||||||
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum[type], schemeId })
|
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum[type], schemeId })
|
||||||
.then(({ status, data }) => {
|
.then(({ status, data }) => {
|
||||||
if (status) {
|
if (status) {
|
||||||
const { data: defVal, items } = data;
|
const { data: defVal, items, comData, comItems } = data;
|
||||||
this.setState({
|
this.setState({
|
||||||
welfareEditSlide: { ...this.state.welfareEditSlide, [`${type}Base`]: data }
|
welfareEditSlide: { ...this.state.welfareEditSlide, [`${type}Base`]: data }
|
||||||
}, () => {
|
}, () => {
|
||||||
this.archiveSlideRef.wrappedInstance.updateFormData(_.reduce(getConditionDomkeys(items), (pre, cur) => {
|
const perData = _.reduce(getConditionDomkeys(items), (pre, cur) => {
|
||||||
const minNum = !_.isNil(getConditionFields(items)[cur].min) ? Number(getConditionFields(items)[cur].min) : undefined,
|
const minNum = !_.isNil(getConditionFields(items)[cur].min) ? Number(getConditionFields(items)[cur].min) : undefined,
|
||||||
maxNum = !_.isNil(getConditionFields(items)[cur].max) ? Number(getConditionFields(items)[cur].max) : undefined;
|
maxNum = !_.isNil(getConditionFields(items)[cur].max) ? Number(getConditionFields(items)[cur].max) : undefined;
|
||||||
const val = !_.isNil(defVal) ? Number(defVal[cur]) : 0;
|
const val = !_.isNil(defVal) ? Number(defVal[cur]) : 0;
|
||||||
|
|
@ -252,7 +252,21 @@ class Index extends Component {
|
||||||
...pre,
|
...pre,
|
||||||
[cur]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
|
[cur]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
|
||||||
};
|
};
|
||||||
}, {}));
|
}, {});
|
||||||
|
if (!_.isNil(comItems)) {
|
||||||
|
const comDataTmpv = _.reduce(getConditionDomkeys(comItems), (pre, cur) => {
|
||||||
|
const minNum = !_.isNil(getConditionFields(comItems)[cur].min) ? Number(getConditionFields(comItems)[cur].min) : undefined,
|
||||||
|
maxNum = !_.isNil(getConditionFields(comItems)[cur].max) ? Number(getConditionFields(comItems)[cur].max) : undefined;
|
||||||
|
const val = !_.isNil(comData) ? Number(comData[cur]) : 0;
|
||||||
|
return {
|
||||||
|
...pre,
|
||||||
|
[`${cur}_com`]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
|
||||||
|
};
|
||||||
|
}, {});
|
||||||
|
this.archiveSlideRef.wrappedInstance.updateFormData({ ...perData, ...comDataTmpv });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.archiveSlideRef.wrappedInstance.updateFormData({ ...perData });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -694,17 +694,62 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
|
||||||
});
|
});
|
||||||
return _.reduce(group, (pre, cur) => {
|
return _.reduce(group, (pre, cur) => {
|
||||||
if (cur.props.title === getLabel(543194, "社保基础信息") && _.every(socialBase.items, o => o.items.length > 0)) {
|
if (cur.props.title === getLabel(543194, "社保基础信息") && _.every(socialBase.items, o => o.items.length > 0)) {
|
||||||
return [...pre, cur,
|
if (!_.isNil(socialBase.comItems) && _.every(socialBase.comItems, o => o.items.length > 0)) {
|
||||||
<BenefitBaseComponent dataSource={socialBase.items} value={payload} onChange={onExtraChange}
|
return [
|
||||||
onSameChange={onSameChange} runStatuses={runStatuses}/>];
|
...pre, cur,
|
||||||
|
<BenefitBaseComponent
|
||||||
|
dataSource={_.map(socialBase.items, o => ({ ...o, title: `${o.title}(${getLabel(500201, "个人")})` }))}
|
||||||
|
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
|
||||||
|
<BenefitBaseComponent
|
||||||
|
dataSource={_.map(socialBase.comItems, o => ({
|
||||||
|
...o, title: `${o.title}(${getLabel(1851, "公司")})`,
|
||||||
|
items: _.map(o.items, g => ({ ...g, domkey: [`${getKey(g)}_com`] }))
|
||||||
|
}))}
|
||||||
|
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [...pre, cur,
|
||||||
|
<BenefitBaseComponent dataSource={socialBase.items} value={payload}
|
||||||
|
onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>];
|
||||||
|
}
|
||||||
} else if (cur.props.title === getLabel(543197, "公积金基础信息") && _.every(fundBase.items, o => o.items.length > 0)) {
|
} else if (cur.props.title === getLabel(543197, "公积金基础信息") && _.every(fundBase.items, o => o.items.length > 0)) {
|
||||||
return [...pre, cur,
|
if (!_.isNil(fundBase.comItems) && _.every(fundBase.comItems, o => o.items.length > 0)) {
|
||||||
<BenefitBaseComponent dataSource={fundBase.items} value={payload} onChange={onExtraChange}
|
return [
|
||||||
onSameChange={onSameChange} runStatuses={runStatuses}/>];
|
...pre, cur,
|
||||||
|
<BenefitBaseComponent
|
||||||
|
dataSource={_.map(fundBase.items, o => ({ ...o, title: `${o.title}(${getLabel(500201, "个人")})` }))}
|
||||||
|
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
|
||||||
|
<BenefitBaseComponent
|
||||||
|
dataSource={_.map(fundBase.comItems, o => ({
|
||||||
|
...o, title: `${o.title}(${getLabel(1851, "公司")})`,
|
||||||
|
items: _.map(o.items, g => ({ ...g, domkey: [`${getKey(g)}_com`] }))
|
||||||
|
}))}
|
||||||
|
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [...pre, cur,
|
||||||
|
<BenefitBaseComponent dataSource={fundBase.items} value={payload} onChange={onExtraChange}
|
||||||
|
onSameChange={onSameChange} runStatuses={runStatuses}/>];
|
||||||
|
}
|
||||||
} else if (cur.props.title === getLabel(543198, "其他福利基础信息") && _.every(otherBase.items, o => o.items.length > 0)) {
|
} else if (cur.props.title === getLabel(543198, "其他福利基础信息") && _.every(otherBase.items, o => o.items.length > 0)) {
|
||||||
return [...pre, cur,
|
if (!_.isNil(otherBase.comItems) && _.every(otherBase.comItems, o => o.items.length > 0)) {
|
||||||
<BenefitBaseComponent dataSource={otherBase.items} value={payload} onChange={onExtraChange}
|
return [
|
||||||
onSameChange={onSameChange} runStatuses={runStatuses}/>];
|
...pre, cur,
|
||||||
|
<BenefitBaseComponent
|
||||||
|
dataSource={_.map(otherBase.items, o => ({ ...o, title: `${o.title}(${getLabel(500201, "个人")})` }))}
|
||||||
|
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
|
||||||
|
<BenefitBaseComponent
|
||||||
|
dataSource={_.map(otherBase.comItems, o => ({
|
||||||
|
...o, title: `${o.title}(${getLabel(1851, "公司")})`,
|
||||||
|
items: _.map(o.items, g => ({ ...g, domkey: [`${getKey(g)}_com`] }))
|
||||||
|
}))}
|
||||||
|
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [...pre, cur,
|
||||||
|
<BenefitBaseComponent dataSource={otherBase.items} value={payload} onChange={onExtraChange}
|
||||||
|
onSameChange={onSameChange} runStatuses={runStatuses}/>];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return [...pre, cur];
|
return [...pre, cur];
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue