feature/2.9.10.2312.02-薪资档案页面重构

This commit is contained in:
黎永顺 2024-01-15 18:18:26 +08:00
parent 12531b4ab3
commit 30c73ccf88
10 changed files with 445 additions and 50 deletions

View File

@ -78,7 +78,6 @@ class Index extends Component {
if (type === "init") {
this.getColumns();
} else if (type === "turn") {
console.log(data);
switch (id) {
case "PAGEINFO":
this.setState({
@ -101,11 +100,12 @@ class Index extends Component {
case "CHANGE-SALARY":
case "VIEW":
case "EDIT":
const { taxAgentStore: { showOperateBtn } } = this.props;
const { record: { id: salaryArchiveId } } = params;
this.setState({
salaryFilesEditSlide: {
...this.state.salaryFilesEditSlide, visible: true, salaryArchiveId,
runStatuses: this.props.selectedKey
runStatuses: this.props.selectedKey, showOperateBtn
}
});
break;
@ -198,8 +198,8 @@ class Index extends Component {
<Spin spinning={loading}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
src="http://localhost:7607/#/salaryFileTable"
// src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/salaryFileTable"
// src="http://localhost:7607/#/salaryFileTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/salaryFileTable"
id="atdTable"
/>
</Spin>
@ -212,7 +212,7 @@ class Index extends Component {
{/* 编辑查看员工薪资档案*/}
<SalaryFilesEditSlide {...salaryFilesEditSlide} ref={dom => this.SFSlideRef = dom}
onClose={(isFresh) => this.setState({
salaryFilesEditSlide: { ...salaryFilesEditSlide, visible: false }
salaryFilesEditSlide: { ...salaryFilesEditSlide, visible: isFresh }
}, () => isFresh && this.getSalaryFileList(this.props))}
/>
</div>

View File

@ -0,0 +1,42 @@
import React from "react";
import { WeaFormItem, WeaHelpfulTip, WeaSearchGroup } from "ecCom";
import { WeaSwitch } from "comsMobx";
export const renderSalaryFilesForm = (form, condition, setHasBeenModify) => {
const { isFormInit } = form;
const formParams = form.getFormParams();
let group = [];
isFormInit && condition && condition.map(c => {
let items = [];
c.items.map(fields => {
items.push({
com: (
<WeaFormItem
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom"
>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}
onChange={() => setHasBeenModify(true)}/>
</WeaFormItem>),
colSpan: 1,
hide: fields.hide
});
});
!_.isEmpty(items) && group.push(
<WeaSearchGroup col={c.col} needTigger={true} showGroup={c.defaultshow} items={items} center={false}
className={c.col === 3 ? "basic-salary-file-wrapper" : (c.col === 2 || c.col === 1) ? "twoColumns-salary-file-wrapper" : ""}
title={
<span>
<span>{c.title}</span>
{
c.titleHelpful &&
<WeaHelpfulTip width={200} title={c.titleHelpful} placement="topLeft"
style={{ marginLeft: 8 }}/>
}
</span>
}
/>);
});
return group;
};

View File

@ -6,8 +6,15 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
import { Button, Modal } from "antd";
import { WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTools } from "ecCom";
import { Button, message, Modal } from "antd";
import { renderSalaryFilesForm } from "./form";
import { salaryFilesConditions } from "../../config";
import { getConditionDomkeys, toDecimal_n } from "../../../../util";
import * as API from "../../../../apis/archive";
import { savePaySet } from "../../../../apis/payrollFiles";
import SalaryItemChangeList from "../../../salaryFile/salaryItemChangeList";
import SalaryArchiveEditAdjLogRecord from "../../../salaryFile/salaryArchiveEditAdjLogRecord";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@ -18,21 +25,118 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, conditions: [], formData: {}
loading: false, conditions: [], formData: {}, salaryAdjustmentInfo: {},
salaryArchiveItems: [], //薪资档案项目
adjLogRecordDialog: { //薪资档案-调薪
visible: false, title: "", salaryArchiveId: ""
}
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
document.querySelector(".salary-files-wrapper").classList.add("zIndex0-welfare-archive");
this.getArchiveForm(nextProps);
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
document.querySelector(".salary-files-wrapper").classList.remove("zIndex0-welfare-archive");
}
}
getArchiveForm = async (props) => {
const { payrollFilesStore: { salaryFileForm }, salaryArchiveId, runStatuses, showOperateBtn } = props;
const { data: salaryAdjustmentInfo } = (runStatuses === "fixed") ? await API.salaryAdjustmentInfo() : { data: {} };
const payload = { salaryArchiveId };
API.getArchiveForm(payload).then(({ status, data }) => {
if (status) {
const { baseInfo: { employee }, paySet: { data: paySetData }, adjustSalaryItems = [] } = data;
const adjustSalaryItemsFormData = _.reduce(adjustSalaryItems, (pre, cur) => ({
...pre, [cur["id"]]: cur["value"]
}), {});
const formData = { ...paySetData, ...employee, ...adjustSalaryItemsFormData };
this.setState({
salaryAdjustmentInfo,
salaryArchiveItems: _.map(adjustSalaryItems, o => ({
adjustValue: o.value, salaryItemId: o.id, pattern: o.pattern, dataType: o.dataType
})),
conditions: _.map(salaryFilesConditions, o => {
if (o.salaryFile) {
return {
...o, items: _.map(adjustSalaryItems, g => {
const otherParams = g.dataType === "number" ? { precision: g.pattern } : {};
return {
colSpan: 3, fieldcol: 14, label: g.name, labelcol: 10, ...otherParams,
conditionType: g.dataType === "number" ? "INPUTNUMBER" : "INPUT",
domkey: [g.id + ""], viewAttr: (runStatuses === "pending" && showOperateBtn) ? 2 : 1
};
})
};
}
return {
...o, items: _.map(o.items, g => {
if (getKey(g) === "payStartDate") {
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: ((runStatuses === "pending" || runStatuses === "ext") && showOperateBtn) ? g.viewAttr : 1
};
} else if (getKey(g) === "payEndDate") {
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: (runStatuses === "stop" || !showOperateBtn) ? 1 : (runStatuses === "suspend" && showOperateBtn) ? 3 : g.viewAttr,
rules: (runStatuses === "suspend" && showOperateBtn) ? "required|string" : ""
};
}
return {
...g, label: getLabel(g.lanId, g.label)
};
})
};
})
}, () => {
salaryFileForm.initFormFields(this.state.conditions);
_.map(getConditionDomkeys(this.state.conditions), k => {
salaryFileForm.updateFields({ [k]: formData[k] || "" });
});
});
}
});
};
save = async () => {
const { salaryArchiveItems } = this.state;
const {
payrollFilesStore: { salaryFileForm, setHasBeenModify },
salaryArchiveId, runStatuses
} = this.props;
const [salaryForm] = await Promise.all([salaryFileForm.validateForm()]);
if (salaryForm.isValid) {
const { payStartDate, payEndDate, ...extraParams } = salaryForm.getFormParams();
const payload = {
salaryArchiveId, status: _.toUpper(runStatuses),
payStartDate, payEndDate,
salaryArchiveItems: _.map(salaryArchiveItems, o => ({
salaryItemId: o.salaryItemId,
adjustValue: (o.dataType === "number" && (extraParams[o.salaryItemId] || extraParams[o.salaryItemId] === 0)) ? toDecimal_n(extraParams[o.salaryItemId], o.pattern || 2) : extraParams[o.salaryItemId]
}))
};
this.setState({ loading: true });
savePaySet(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
setHasBeenModify(false);
message.success(getLabel(30700, "操作成功!"));
this.props.onClose(true);
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
} else {
salaryForm.showErrors();
this.forceUpdate();
}
};
renderTitle = () => {
const { loading } = this.state;
const { runStatuses } = this.props;
const { loading, salaryAdjustmentInfo } = this.state, { runStatuses, showOperateBtn, salaryArchiveId } = this.props;
const { isShow, url } = salaryAdjustmentInfo;
return <div className="titleDialog">
<div className="titleCol titleLeftBox">
<div className="titleIcon"><i className="icon-coms-fa"/></div>
@ -40,40 +144,76 @@ class Index extends Component {
</div>
<div className="titleCol titleRightBox">
{
runStatuses === "fixed" &&
<Button type="ghost">{getLabel(542686, "调薪")}</Button>
runStatuses === "fixed" && showOperateBtn && isShow === "true" &&
<Button type="ghost" onClick={() => {
const linkUrl = url.indexOf("http") !== -1 ? url : `${window.location.origin}${url}`;
window.open(`${linkUrl}&salaryArchiveId=${salaryArchiveId}`, "_blank");
}}>{getLabel(543310, "发起调薪")}</Button>
}
{
runStatuses !== "stop" &&
<Button type="primary" loading={loading}>{getLabel(537558, "保存")}</Button>
runStatuses === "fixed" && showOperateBtn &&
<Button type="ghost" onClick={() => {
this.setState({
adjLogRecordDialog: {
...this.state.adjLogRecordDialog,
visible: true, title: getLabel(542686, "调薪"), salaryArchiveId
}
});
}}>{getLabel(542686, "调薪")}</Button>
}
{
runStatuses !== "stop" && showOperateBtn &&
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
}
</div>
</div>;
};
handleClose = () => {
const { payrollFilesStore: { hasBeenModify }, onClose } = this.props;
handleClose = (visible = false) => {
const { payrollFilesStore: { hasBeenModify, setHasBeenModify }, onClose } = this.props;
if (hasBeenModify) {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(545770, "确定放弃填写吗?放弃后数据将不会被保存!"),
onOk: () => {
onClose();
onClose(visible);
setHasBeenModify(false);
}
});
} else {
onClose();
onClose(visible);
setHasBeenModify(false);
}
};
render() {
const { payrollFilesStore } = this.props;
const {
payrollFilesStore: { salaryFileForm, setHasBeenModify }, runStatuses, salaryArchiveId,
showOperateBtn, visible
} = this.props;
const { conditions, adjLogRecordDialog } = this.state;
return (
<WeaSlideModal
className="salary-files-edit-layout" {...this.props}
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%"
direction={"right"} title={this.renderTitle()} onClose={this.handleClose}
direction={"right"} title={this.renderTitle()} onClose={() => this.handleClose(false)}
content={<div className="salary-files-edit-area">
{
renderSalaryFilesForm(salaryFileForm, conditions, setHasBeenModify)
}
{
runStatuses !== "pending" && visible &&
<WeaSearchGroup title={getLabel(543328, "薪资调整记录")} items={[]} needTigger showGroup>
<SalaryItemChangeList id={salaryArchiveId} selectedKey={runStatuses} showOperateBtn={showOperateBtn}/>
</WeaSearchGroup>
}
<SalaryArchiveEditAdjLogRecord
{...adjLogRecordDialog}
onCancel={() => this.setState({
adjLogRecordDialog: {
adjLogRecordDialog, visible: false, title: "", salaryArchiveId: ""
}
})}
/>
</div>}
/>
);

View File

@ -1,9 +1,8 @@
import React from "react";
import { WeaHelpfulTip, WeaLocaleProvider, WeaTools } from "ecCom";
import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom";
import { Button, Dropdown, Menu } from "antd";
import AdvanceInputBtn from "../components/advanceInputBtn";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
export const tabCondition = [
@ -321,6 +320,24 @@ export const salaryFileSearchConditions = [
labelcol: 8,
value: "",
viewAttr: 2
},
{
conditionType: "RANGEPICKER",
domkey: ["payStartDateStartDateStr", "payStartDateEndDateStr"],
fieldcol: 16,
label: getLabel(542346, "起始发薪日期"),
labelcol: 8,
value: "",
viewAttr: 2
},
{
conditionType: "RANGEPICKER",
domkey: ["payEndDateStartDateStr", "payEndDateEndDateStr"],
fieldcol: 16,
label: getLabel(542347, "最后发薪日期"),
labelcol: 8,
value: "",
viewAttr: 2
}
],
defaultshow: true,
@ -328,6 +345,115 @@ export const salaryFileSearchConditions = [
col: 2
}
];
export const salaryFilesConditions = [
{
defaultshow: true, title: getLabel(1361, "基本信息"),
col: 3,
items: [
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["username"],
fieldcol: 14,
label: "姓名",
lanId: 25034,
labelcol: 10,
value: "",
viewAttr: 1
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["department"],
fieldcol: 14,
label: "部门",
lanId: 27511,
labelcol: 10,
value: "",
viewAttr: 1
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["position"],
fieldcol: 14,
label: "岗位",
lanId: 6086,
labelcol: 10,
value: "",
viewAttr: 1
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["hiredate"],
fieldcol: 14,
label: "入职时间",
lanId: 1908,
labelcol: 10,
value: "",
viewAttr: 1
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["mobile"],
fieldcol: 14,
label: "手机号",
lanId: 125238,
labelcol: 10,
value: "",
viewAttr: 1
},
{
colSpan: 3,
conditionType: "INPUT",
domkey: ["taxAgent"],
fieldcol: 14,
label: "个税扣缴义务人",
lanId: 537996,
labelcol: 10,
value: "",
viewAttr: 1
}
]
},
{
defaultshow: true, title: getLabel(543329, "发薪设置"),
col: 1,
items: [
{
colSpan: 1,
conditionType: "DATEPICKER",
domkey: ["payStartDate"],
fieldcol: 16,
label: "起始发薪日期",
lanId: 542346,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
colSpan: 1,
conditionType: "DATEPICKER",
domkey: ["payEndDate"],
fieldcol: 16,
label: "最后发薪日期",
lanId: 542347,
labelcol: 8,
value: "",
viewAttr: 2
}
]
},
{
defaultshow: true, title: getLabel(538004, "薪资档案"),
titleHelpful: getLabel(543330, "提示:显示已生效的最新数据"),
col: 2, salaryFile: true,
items: []
}
];
const HelpfulDiv = () => {
return <div className="helpWrapper">
<span>{getLabel(544742, "导入按钮使用场景说明:")}</span>

View File

@ -243,6 +243,51 @@
overflow-y: auto;
padding: 16px;
.basic-salary-file-wrapper {
.wea-form-cell-wrapper {
.wea-field-readonly {
vertical-align: bottom;
span.child-item {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 125px;
}
}
& > div {
border-right: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
}
& > div:nth-child(3) {
border-bottom: 1px solid #e5e5e5;
}
& > div:nth-child(4), & > div:nth-child(5) {
border-right: 1px solid #e5e5e5;
}
}
}
.twoColumns-salary-file-wrapper {
.wea-form-cell-wrapper {
& > div {
border-right: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
}
& > div:nth-child(2n) {
border-right: none;
}
& > div:last-child {
border-bottom: none;
}
}
}
.wea-search-group, .wea-form-cell {
padding: 0;

View File

@ -41,7 +41,8 @@ class Index extends Component {
const { data: taxAgentList } = await getTaxAgentSelectList();
const {
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses,
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData,
showOperateBtn
} = props;
let socialComData = {}, fundComData = {}, otherComData = {};
if (!_.isNil(socialBase.comItems) && !_.isNil(socialBase.comData)) {
@ -83,7 +84,7 @@ class Index extends Component {
if (o.title === "basic") {
return {
...o, title: getLabel(542699, "员工基本信息"),
viewAttr: runStatuses === "4,5" ? 1 : o.viewAttr,
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : o.viewAttr,
items: _.map(o.items, g => {
return { ...g, label: getLabel(g.lanId, g.label) };
})
@ -107,13 +108,13 @@ class Index extends Component {
const key = _.lowerCase(getKey(g)).indexOf("take") !== -1 ? "underTake" : getKey(g);
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr,
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : g.viewAttr,
options: _.find(props[`${o.title}Items`], j => j.domkey[0] === key).options
};
}
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : g.viewAttr
};
})
};
@ -122,7 +123,7 @@ class Index extends Component {
...o, items: _.map(o.items, g => {
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : g.viewAttr
};
})
};
@ -202,7 +203,11 @@ class Index extends Component {
updateFormData = (baseData) => this.setState({ formData: { ...this.state.formData, ...baseData } });
handleFormChange = (val) => {
const changeKey = _.keys(val)[0], changeVal = val[changeKey].value;
const { archivesStore: { setHasBeenModify }, onChangeProgramme, employeeId, paymentOrganization } = this.props;
const {
archivesStore: { setHasBeenModify },
onChangeProgramme, employeeId,
paymentOrganization, showOperateBtn
} = this.props;
setHasBeenModify(true);
if (changeKey === "socialSchemeId" || changeKey === "fundSchemeId" || changeKey === "otherSchemeId") {
this.setState({
@ -216,7 +221,7 @@ class Index extends Component {
...o, items: _.map(o.items, g => {
if (getKey(g).indexOf("StartTime") !== -1) {
return {
...g, viewAttr: changeVal ? 3 : g.viewAttr
...g, viewAttr: (changeVal && showOperateBtn) ? 3 : g.viewAttr
};
}
return { ...g };
@ -257,7 +262,7 @@ class Index extends Component {
});
renderTitle = () => {
const { loading } = this.state;
const { runStatuses } = this.props;
const { runStatuses, showOperateBtn } = this.props;
return <div className="titleDialog">
<div className="titleCol titleLeftBox">
<div className="titleIcon"><i className="icon-coms-fa"/></div>
@ -265,7 +270,7 @@ class Index extends Component {
</div>
<div className="titleCol titleRightBox">
{
runStatuses !== "4,5" &&
runStatuses !== "4,5" && showOperateBtn &&
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
}
</div>
@ -287,7 +292,7 @@ class Index extends Component {
};
render() {
const { archivesStore: { welfareProfileForm } } = this.props;
const { archivesStore: { welfareProfileForm }, showOperateBtn } = this.props;
const { conditions, formData } = this.state;
return (
<WeaSlideModal
@ -298,7 +303,7 @@ class Index extends Component {
{
getWelfareSearchsForm(
welfareProfileForm, conditions, this.handleFormChange, this.handleNoPaymentChange, this.handleExtraChange,
this.handleSameChange, formData, this.props
this.handleSameChange, formData, this.props, showOperateBtn
)
}
</div>}

View File

@ -71,7 +71,7 @@ class Index extends Component {
this.getWelfareList(this.props);
} else if (type === "turn") {
const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params;
const { runStatuses } = this.props;
const { runStatuses, showOperateBtn } = this.props;
switch (id) {
case "PAGEINFO":
this.setState({
@ -116,7 +116,7 @@ class Index extends Component {
]);
this.setState({
welfareEditSlide: {
...this.state.welfareEditSlide, visible: true,
...this.state.welfareEditSlide, visible: true, showOperateBtn,
socialBase: socialBase.data, fundBase: fundBase.data, otherBase: otherBase.data
}
});

View File

@ -660,13 +660,16 @@ export const welfareConditions = [
]
}
];
export const getWelfareSearchsForm = (form, condition, onChange = () => void (0), onNoPaymentChange = () => void (0), onExtraChange = () => void (0), onSameChange = () => void (0), payload, extraFormField) => {
export const getWelfareSearchsForm = (
form, condition, onChange = () => void (0),
onNoPaymentChange = () => void (0), onExtraChange = () => void (0), onSameChange = () => void (0),
payload, extraFormField, showOperateBtn) => {
const CustomComponent = ({ type }) => {
const value = payload[type].nonPayment ? payload[type].nonPayment.toString() : "";
return <WeaCheckbox
value={value} content={getLabel(543196, "暂不缴纳")}
onChange={v => onNoPaymentChange(type, v)}
disabled={runStatuses === "4,5"}
disabled={runStatuses === "4,5" || !showOperateBtn}
/>;
};
const { socialBase, fundBase, otherBase, runStatuses } = extraFormField;
@ -703,18 +706,24 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
...pre, cur,
<BenefitBaseComponent
dataSource={_.map(socialBase.items, o => ({ ...o, title: `${o.title}${getLabel(500201, "个人")}` }))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>,
<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}/>
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>
];
} else {
return [...pre, cur,
<BenefitBaseComponent dataSource={socialBase.items} value={payload}
onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>];
onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>];
}
} else if (cur.props.title === getLabel(543197, "公积金基础信息") && _.every(fundBase.items, o => o.items.length > 0)) {
if (!_.isNil(fundBase.comItems) && _.every(fundBase.comItems, o => o.items.length > 0)) {
@ -722,18 +731,24 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
...pre, cur,
<BenefitBaseComponent
dataSource={_.map(fundBase.items, o => ({ ...o, title: `${o.title}${getLabel(500201, "个人")}` }))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>,
<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}/>
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>
];
} else {
return [...pre, cur,
<BenefitBaseComponent dataSource={fundBase.items} value={payload} onChange={onExtraChange}
onSameChange={onSameChange} runStatuses={runStatuses}/>];
onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>];
}
} else if (cur.props.title === getLabel(543198, "其他福利基础信息") && _.every(otherBase.items, o => o.items.length > 0)) {
if (!_.isNil(otherBase.comItems) && _.every(otherBase.comItems, o => o.items.length > 0)) {
@ -741,18 +756,24 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
...pre, cur,
<BenefitBaseComponent
dataSource={_.map(otherBase.items, o => ({ ...o, title: `${o.title}${getLabel(500201, "个人")}` }))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>,
<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}/>
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>
];
} else {
return [...pre, cur,
<BenefitBaseComponent dataSource={otherBase.items} value={payload} onChange={onExtraChange}
onSameChange={onSameChange} runStatuses={runStatuses}/>];
onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>];
}
}
return [...pre, cur];
@ -760,7 +781,7 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
};
const BenefitBaseComponent = (props) => {
const { dataSource, value, onChange, onSameChange, runStatuses } = props;
const { dataSource, value, onChange, onSameChange, runStatuses, showOperateBtn } = props;
return <React.Fragment>
{
_.map(dataSource, item => {
@ -773,14 +794,14 @@ const BenefitBaseComponent = (props) => {
min={child.min !== "0.000" ? child.min : -999999999999999}
max={child.max !== "0.000" ? child.max : 999999999999999}
onChange={v => onChange(getKey(child), v)}
viewAttr={runStatuses === "4,5" ? 1 : 2}
viewAttr={(runStatuses === "4,5" || !showOperateBtn) ? 1 : 2}
/>
</WeaFormItem>
}))}
customComponent={<div className="welfare-same-box">
<span>{getLabel(543195, "各项福利基数一致")}</span>
<WeaInputNumber style={{ width: 100 }} onBlur={v => onSameChange(items, v)}
disabled={runStatuses === "4,5"}/>
disabled={runStatuses === "4,5" || !showOperateBtn}/>
</div>}
title={title} col={2} showGroup className="twoColumns-welfare-info-wrapper"
/>;

View File

@ -157,6 +157,17 @@
.basic-welfare-info-wrapper {
.wea-form-cell-wrapper {
.wea-field-readonly {
vertical-align: bottom;
span.child-item {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 125px;
}
}
& > div:nth-child(1), & > div:nth-child(2) {
border-right: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;

View File

@ -14,6 +14,11 @@ export class PayrollFilesStore {
@action initAdjustForm = () => this.adjustForm = new WeaForm();//调薪记录-初始化核算form
/*薪资档案页面重构*/
@observable salaryFileQueryForm = new WeaForm(); // 薪资档案查询form
@observable salaryFileForm = new WeaForm(); // 薪资档案form
@action initSalaryFileForm = () => this.salaryFileForm = new WeaForm(); // 薪资档案form初始化
@observable hasBeenModify = false; //薪资档案-员工薪资档案-是否修改过
@action setHasBeenModify = (v) => this.hasBeenModify = v;//薪资档案-员工薪资档案数据
/*薪资档案页面重构*/
@action("薪资档案-列表查询")