Merge branch 'hotfix/2.9.42308.02' into release/2.9.42308.02-个税

# Conflicts:
#	pc4mobx/hrmSalary/util/index.js
This commit is contained in:
黎永顺 2023-09-06 16:30:21 +08:00
commit 2d148b9fb5
15 changed files with 600 additions and 244 deletions

View File

@ -133,7 +133,7 @@ export default class PayrollDetail extends React.Component {
<Button type="ghost" onClick={() => setDetailListShowSearchAd(false)}>取消</Button> <Button type="ghost" onClick={() => setDetailListShowSearchAd(false)}>取消</Button>
]; ];
return ( return (
<div className="payrollGrant"> <div className="payrollDetail">
<WeaTab <WeaTab
searchType={["base", "advanced"]} searchsBasePlaceHolder="请输入姓名" searchType={["base", "advanced"]} searchsBasePlaceHolder="请输入姓名"
buttons={[<Button type="primary" onClick={this.handleExportAll}>导出全部</Button>]} buttons={[<Button type="primary" onClick={this.handleExportAll}>导出全部</Button>]}

View File

@ -1,12 +1,17 @@
.payrollGrant { .payrollDetail {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
background: #f6f6f6;
.wea-tab .wea-tab-right, .wea-input-focus {
background: #f6f6f6;
}
.titleBar { .titleBar {
height: 47px; height: 47px;
line-height: 47px; line-height: 47px;
padding: 0 10px; padding: 0 16px;
.titleBarLeft { .titleBarLeft {
float: left; float: left;
@ -19,6 +24,7 @@
.tableWrapper { .tableWrapper {
flex: 1; flex: 1;
padding: 0 16px;
.ant-spin-nested-loading, .ant-spin-container { .ant-spin-nested-loading, .ant-spin-container {
height: 100%; height: 100%;

View File

@ -595,6 +595,7 @@ export default class PayrollGrant extends React.Component {
this.pageInfo = { current, pageSize }; this.pageInfo = { current, pageSize };
this.handleShowSizeChange(this.pageInfo); this.handleShowSizeChange(this.pageInfo);
}} }}
scroll={{ y: `calc(100vh - 236px)` }}
/> : renderLoading() /> : renderLoading()
} }
</div> </div>

View File

@ -1,8 +1,15 @@
.payrollGrant_new { .payrollGrant_new {
background: #f6f6f6;
height: 100%;
.wea-tab .wea-tab-right, .wea-input-focus {
background: #f6f6f6;
}
.titleBar { .titleBar {
height: 47px; height: 47px;
line-height: 47px; line-height: 47px;
padding: 0 10px; padding: 0 16px;
.titleBarLeft { .titleBarLeft {
float: left; float: left;
@ -14,8 +21,11 @@
} }
.tableWrapper { .tableWrapper {
height: calc(100vh - 180.22px); padding: 0 16px;
overflow: auto;
.wea-new-table {
background: #FFF;
}
} }
} }

View File

@ -86,9 +86,11 @@ class SalaryItemSettings extends Component {
} }
}); });
this.setState({ this.setState({
dataList: resultSalaryItemSet dataList: resultSalaryItemSet,
itemShowNamesetting: _.filter(this.state.itemShowNamesetting, it => it.salaryItemId !== item.id)
}, () => { }, () => {
this.props.onChangeSalaryItem(resultSalaryItemSet); this.props.onChangeSalaryItem(resultSalaryItemSet);
this.props.onChangeSalaryItemShowNamesetting(this.state.itemShowNamesetting);
}); });
}; };
handleCloseModal = () => { handleCloseModal = () => {

View File

@ -30,8 +30,8 @@ import AllWithoutPay from "./components/allWithoutPay";
import BatchSuspendsPay from "./components/batchSuspendsPay"; import BatchSuspendsPay from "./components/batchSuspendsPay";
import SlideModalTitle from "../../components/slideModalTitle"; import SlideModalTitle from "../../components/slideModalTitle";
import SalaryFileViewSlide from "../salaryFile/saralyFileViewSlide"; import SalaryFileViewSlide from "../salaryFile/saralyFileViewSlide";
import ChangeSalaryModal from "../salaryFile/changeSalaryModal";
import { sysinfo } from "../../apis/ruleconfig"; import { sysinfo } from "../../apis/ruleconfig";
import SalaryArchiveEditAdjLogRecord from "../salaryFile/salaryArchiveEditAdjLogRecord";
import "./index.less"; import "./index.less";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@ -77,7 +77,9 @@ class Index extends Component {
subcompanyIds: "" subcompanyIds: ""
}, },
salaryAdjustmentInfo: {}, salaryAdjustmentInfo: {},
changeSalaryVisible: false, adjLogRecordDialog: {
visible: false, title: "", id: "", salaryArchiveId: ""
},
noPayDate: "", noPayDate: "",
slideParams: { slideParams: {
visible: false, visible: false,
@ -624,7 +626,12 @@ class Index extends Component {
} }
if (showOperateBtn && (selectedKey === "fixed" || selectedKey === "ext")) { if (showOperateBtn && (selectedKey === "fixed" || selectedKey === "ext")) {
arrList.push(<Button type="primary" onClick={() => { arrList.push(<Button type="primary" onClick={() => {
this.setState({ changeSalaryVisible: true }); this.setState({
adjLogRecordDialog: {
...this.state.adjLogRecordDialog,
visible: true, title: getLabel(542686, "调薪"), salaryArchiveId: this.state.slideParams.id
}
});
}}>调薪</Button>); }}>调薪</Button>);
} }
selectedKey !== "stop" && arrList.push(<Button type="primary" onClick={this.handleSave}>保存</Button>); selectedKey !== "stop" && arrList.push(<Button type="primary" onClick={this.handleSave}>保存</Button>);
@ -719,7 +726,7 @@ class Index extends Component {
pageInfo, pageInfo,
showSearchAd, showSearchAd,
slideParams, slideParams,
changeSalaryVisible, adjLogRecordDialog,
paysetParams, paysetParams,
extEmpsWitch extEmpsWitch
} = this.state; } = this.state;
@ -884,15 +891,14 @@ class Index extends Component {
}} }}
/> />
)} )}
{changeSalaryVisible && ( <SalaryArchiveEditAdjLogRecord
<ChangeSalaryModal {...adjLogRecordDialog}
currentId={slideParams.id} onCancel={() => this.setState({
visible={changeSalaryVisible} adjLogRecordDialog: {
onCancel={() => { adjLogRecordDialog, visible: false, title: "", id: "", salaryArchiveId: ""
this.setState({ changeSalaryVisible: false }); }
}} })}
/> />
)}
</div> </div>
); );
} }

View File

@ -23,7 +23,7 @@ export default class Index extends Component {
orderRule: "", orderRule: "",
ascOrDesc: "", ascOrDesc: "",
rule: "", rule: "",
enctry: "", enctry: "1",
operateTaxDeclaration: "1", operateTaxDeclaration: "1",
matchRule: "", matchRule: "",
confValue: "0", confValue: "0",
@ -56,7 +56,7 @@ 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 = "0", extEmpsWitch = "0" OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0"
} }
} = sysInfo; } = sysInfo;
// const { data: { ascOrDesc, orderRule } } = orderRules; // const { data: { ascOrDesc, orderRule } } = orderRules;

View File

@ -1,175 +1,203 @@
export const columns = [ export const columns = [
{ {
title: "姓名", title: "姓名",
dataIndex: 'title', dataIndex: "title",
key: 'title', key: "title"
}, },
{ {
title: "个税扣缴义务人", title: "个税扣缴义务人",
dataIndex: 'title', dataIndex: "title",
key: 'title', key: "title"
}, },
{ {
title: "部门", title: "部门",
dataIndex: 'title', dataIndex: "title",
key: 'title', key: "title"
}, },
{ {
title: "手机号", title: "手机号",
dataIndex: 'title', dataIndex: "title",
key: 'title', key: "title"
}, },
{ {
title: "员工状态", title: "员工状态",
dataIndex: 'title', dataIndex: "title",
key: 'title', key: "title"
}, },
{ {
title: "基本工资", title: "基本工资",
dataIndex: 'title', dataIndex: "title",
key: 'title', key: "title"
}, },
{ {
title: "操作", title: "操作",
dataIndex: 'cz', dataIndex: "cz",
key: 'cz', key: "cz"
} }
] ];
export const changeSalaryModalColumns = [ export const adjCondition = [
{ {
title: '薪资项目', items: [
dataIndex: 'title', {
key: 'title' colSpan: 1,
}, conditionType: "DATEPICKER",
{ domkey: ["effectiveTime"],
title: '调整前', fieldcol: 18,
dataIndex: 'title', label: "生效日期",
key: 'title' lanId: 19548,
}, labelcol: 6,
{ rules: "required",
title: '调整后', value: "",
dataIndex: 'title', viewAttr: 3
key: 'title' },
} {
] colSpan: 1,
checkbox: false,
checkboxValue: false,
conditionType: "SELECT",
domkey: ["adjustReason"],
fieldcol: 18,
label: "调整原因",
lanId: 1897,
labelcol: 6,
options: [],
rules: "required",
viewAttr: 3
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["description"],
fieldcol: 18,
label: "说明",
lanId: 25734,
labelcol: 6,
value: "",
viewAttr: 2
}
],
title: "调薪信息",
defaultshow: true
}
];
export const slideSalaryItemColumns = [ export const slideSalaryItemColumns = [
{ {
title: "姓名", title: "姓名",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "员工状态", title: "员工状态",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "部门", title: "部门",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "薪资项目", title: "薪资项目",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "调整前", title: "调整前",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "调整后", title: "调整后",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "调整原因", title: "调整原因",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "生效日期", title: "生效日期",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "操作人", title: "操作人",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "操作日期", title: "操作日期",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "说明", title: "说明",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
} }
] ];
export const slieAgentColumns = [ export const slieAgentColumns = [
{ {
title: "姓名", title: "姓名",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "员工状态", title: "员工状态",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "部门", title: "部门",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "调整前", title: "调整前",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "调整后", title: "调整后",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "调整原因", title: "调整原因",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "生效日期", title: "生效日期",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "操作人", title: "操作人",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "操作日期", title: "操作日期",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
}, },
{ {
title: "说明", title: "说明",
dataIndex: 'title', dataIndex: "title",
key: 'title' key: "title"
} }
] ];
export const dataSource = [ export const dataSource = [
{ {
title: "测试" title: "测试"
} }
]; ];

View File

@ -73,7 +73,6 @@
} }
} }
.salaryFileSlide { .salaryFileSlide {
padding: 10px 20px; padding: 10px 20px;
@ -125,7 +124,6 @@
} }
} }
.salaryFileTabWrapper { .salaryFileTabWrapper {
.searchPanel { .searchPanel {
position: absolute; position: absolute;
@ -169,3 +167,55 @@
} }
} }
} }
.adjustItem-layout {
.ant-table-fixed td {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.adjLogRecordDialogContent {
background: #f6f6f6;
padding: 16px;
height: 100%;
overflow-y: auto;
.empty {
text-align: center;
background: transparent;
margin-bottom: 20px;
padding: 30px 50px;
}
.wea-search-group:first-child {
margin-bottom: 16px;
}
.wea-search-group {
background: #FFF;
padding: 0;
border: 1px solid #e5e5e5;
border-bottom: none;
}
.wea-content, .wea-form-cell {
padding: 0;
}
.wea-form-item {
padding: 5px 16px;
border-bottom: 1px solid #e5e5e5;
}
.wea-select, .ant-select {
width: 100%;
}
.ant-select-selection {
width: 100%;
height: 30px;
border-radius: 0;
}
}

View File

@ -0,0 +1,221 @@
/*
* Author: 黎永顺
* name: 薪资档案-调薪
* Description:
* Date: 2023/9/4
*/
import React, { Component } from "react";
import { WeaDialog, WeaLocaleProvider, WeaSearchGroup, WeaTableEdit, WeaTools } from "ecCom";
import { Button, message, Spin } from "antd";
import {
editSingleSalaryItem,
getSalaryItemAdjustBeforeValue,
getSalaryItemForm,
getSingleSalaryItemInfo,
saveSalaryItem
} from "../../apis/archive";
import { inject, observer } from "mobx-react";
import { adjCondition } from "./columns";
import { getDomkes, getSearchs } from "../../util";
import moment from "moment";
const { getLabel } = WeaLocaleProvider;
const getKey = WeaTools.getKey;
const APIFox = {
save: saveSalaryItem,
edit: editSingleSalaryItem,
saveForm: getSalaryItemForm,
editForm: getSingleSalaryItemInfo
};
@inject("salaryFileStore")
@observer
class SalaryArchiveEditAdjLogRecordDialog extends Component {
constructor(props) {
super(props);
this.state = {
conditions: [], loading: false, saveLoading: false,
salaryArchiveItemDetail: {}, canOperator: false
};
}
componentWillReceiveProps(nextProps, nextContext) {
const { id, visible, salaryFileStore: { adjForm, initAdjForm } } = nextProps;
if (nextProps.visible !== this.props.visible && visible) {
this.getSingleSalaryItemInfo(nextProps);
} else {
adjForm.resetForm();
initAdjForm();
}
}
getSingleSalaryItemInfo = (props) => {
const { salaryFileStore: { adjForm }, id, salaryArchiveId: salaryArchiveItemId } = props;
this.setState({ loading: true });
APIFox[id ? "editForm" : "saveForm"](id ? { id } : { salaryArchiveItemId })
.then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { salaryArchiveItemForm, salaryArchiveItemDetail, canOperator } = data;
const { adjustReasonList } = salaryArchiveItemForm;
this.setState({
canOperator, salaryArchiveItemDetail,
conditions: _.map(adjCondition, item => {
return {
...item,
title: getLabel(111, "调薪信息"),
items: _.map(item.items, o => {
if (getKey(o) === "adjustReason") {
return {
...o,
options: _.map(adjustReasonList, it => ({ key: it.id, showname: it.content }))
};
}
return { ...o };
})
};
})
}, () => {
adjForm.initFormFields(this.state.conditions);
_.map(getDomkes(this.state.conditions), domkey => {
adjForm.updateFields({
[domkey]: salaryArchiveItemForm[domkey] || ""
});
});
});
}
}).catch(() => this.setState({ loading: false }));
};
getSalaryItemAdjustBeforeValue = (salaryItemId) => {
const payload = {
salaryArchiveId: this.props.salaryArchiveId,
salaryItemId
};
getSalaryItemAdjustBeforeValue(payload).then(({ status, data }) => {
if (status) {
const { salaryArchiveItemDetail } = this.state;
const { list } = salaryArchiveItemDetail;
this.setState({
salaryArchiveItemDetail: {
...salaryArchiveItemDetail,
list: _.map(list, o => {
if (o.salaryItem === salaryItemId) {
return { ...o, salaryBefore: data };
}
return { ...o };
})
}
});
}
});
};
save = () => {
const { salaryFileStore: { adjForm, fetchSingleSalaryItemList, getArchiveForm } } = this.props;
const { pass } = this.tableEdit.refs.edit.doRequiredCheck();
adjForm.validateForm().then(f => {
if (f.isValid) {
if (!pass) return;
const { salaryArchiveId, id: salaryArchiveItemId } = this.props;
const { salaryArchiveItemDetail, canOperator } = this.state;
const { list } = salaryArchiveItemDetail;
let payload = {
...adjForm.getFormParams(), salaryArchiveId,
effectiveTime: moment(new Date(adjForm.getFormParams().effectiveTime)).format("YYYY-MM-DD"),
salaryArchiveItems: _.map(list, o => ({ salaryItemId: o.salaryItem, adjustValue: o.adjustAfter }))
};
if (salaryArchiveItemId) {
payload = { ...payload, canOperator, salaryArchiveItemId };
}
this.setState({ saveLoading: true });
APIFox[salaryArchiveItemId ? "edit" : "save"](payload).then(({ status, errormsg }) => {
this.setState({ saveLoading: false });
if (status) {
message.success(getLabel(22619, "保存成功!"));
this.props.onCancel();
fetchSingleSalaryItemList({ salaryArchiveId });
getArchiveForm(salaryArchiveId);
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ saveLoading: false }));
} else {
f.showErrors();
}
});
};
render() {
const { salaryFileStore: { adjForm }, id } = this.props;
const { loading, saveLoading, salaryArchiveItemDetail, conditions } = this.state;
const { salaryItemList, list } = salaryArchiveItemDetail;
const adjColumns = [
{
title: "薪资项目",
dataIndex: "salaryItem",
key: "salaryItem",
com: [{
options: _.map(salaryItemList, o => ({ key: o.id, showname: o.content })),
type: "SELECT", viewAttr: id ? 1 : 3, key: "salaryItem",
onChange: (v) => this.getSalaryItemAdjustBeforeValue(v)
}],
colSpan: 1,
width: "40%"
},
{
title: getLabel(111, "调整前"),
dataIndex: "salaryBefore",
key: "salaryBefore",
com: [{ label: "", type: "INPUT", viewAttr: 1, key: "salaryBefore" }],
colSpan: 1,
width: "30%"
},
{
title: getLabel(111, "调整后"),
dataIndex: "adjustAfter",
key: "adjustAfter",
com: [{ label: "", type: "INPUTNUMBER", otherParams: { precision: 3 }, viewAttr: 3, key: "adjustAfter" }],
colSpan: 1,
width: "30%"
}
];
return (
<WeaDialog
{...this.props}
scalable hasScroll className="declareResultDialog" initLoadCss
style={{
width: 800,
height: 406.6,
minHeight: 200,
minWidth: 380,
maxHeight: "80%",
maxWidth: "80%",
overflow: "hidden",
transform: "translate(0px, 0px)"
}}
buttons={[<Button type="primary" onClick={this.save} loading={saveLoading}>{getLabel(537558, "保存")}</Button>]}
>
<div className="adjLogRecordDialogContent">
{
!loading ? <React.Fragment>
{getSearchs(adjForm, conditions, 1)}
<WeaSearchGroup title={getLabel(543333, "调薪明细")} showGroup needTigger={false}>
<WeaTableEdit
ref={dom => this.tableEdit = dom} deleteConfirm
columns={adjColumns} datas={list} showCopy={false}
showAdd={!id} showDelete={!id}
onChange={o => this.setState({
salaryArchiveItemDetail: {
...salaryArchiveItemDetail, list: o
}
})}
/>
</WeaSearchGroup>
</React.Fragment> : <div className="empty"><Spin/></div>
}
</div>
</WeaDialog>
);
}
}
export default SalaryArchiveEditAdjLogRecordDialog;

View File

@ -1,10 +1,11 @@
import React from "react"; import React from "react";
import { Menu, message, Modal, Popover } from "antd"; import { message, Modal } from "antd";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import ChangeSalaryModal from "./changeSalaryModal";
import { deleteSalaryItem } from "../../apis/archive"; import { deleteSalaryItem } from "../../apis/archive";
import UnifiedTable from "../../components/UnifiedTable"; import SalaryArchiveEditAdjLogRecord from "./salaryArchiveEditAdjLogRecord";
const { getLabel } = WeaLocaleProvider;
@inject("salaryFileStore") @inject("salaryFileStore")
@observer @observer
export default class SalaryItemChangeList extends React.Component { export default class SalaryItemChangeList extends React.Component {
@ -12,6 +13,9 @@ export default class SalaryItemChangeList extends React.Component {
super(props); super(props);
this.state = { this.state = {
changeSalaryVisible: false, changeSalaryVisible: false,
adjLogRecordDialog: {
visible: false, title: "", id: "", salaryArchiveId: ""
},
recordId: "" recordId: ""
}; };
this.searchParams = {}; this.searchParams = {};
@ -25,11 +29,11 @@ export default class SalaryItemChangeList extends React.Component {
handleEdit = (record) => { handleEdit = (record) => {
this.setState({ this.setState({
recordId: record.id adjLogRecordDialog: {
}, () => { ...this.state.adjLogRecordDialog,
this.setState({ visible: true, title: getLabel(542686, "调薪"), id: record.id,
changeSalaryVisible: true salaryArchiveId: this.props.id
}); }
}); });
}; };
deleteSalaryItem = (salaryArchiveItemId) => { deleteSalaryItem = (salaryArchiveItemId) => {
@ -58,22 +62,35 @@ export default class SalaryItemChangeList extends React.Component {
const { salaryFileStore: { singleSalaryItemList }, selectedKey } = this.props; const { salaryFileStore: { singleSalaryItemList }, selectedKey } = this.props;
let columns = []; let columns = [];
if (singleSalaryItemList.columns) { if (singleSalaryItemList.columns) {
columns = [...singleSalaryItemList.columns]; columns = _.map([...singleSalaryItemList.columns], o => {
const { dataIndex } = o;
if (dataIndex === "adjustItem") {
return { ...o, width: 100, fixed: "left", render: text => (<span title={text}>{text}</span>) };
}
let width = "";
switch (o) {
case "adjustBefore":
case "adjustAfter":
case "operateTime":
width = "20%";
break;
case "effectiveTime":
width = "15%";
break;
default:
width = "10%";
break;
}
return { ...o, width, render: text => (<span title={text}>{text}</span>) };
});
if (selectedKey === "fixed") { if (selectedKey === "fixed") {
columns = [...columns, { columns = [...columns, {
dataIndex: "operate", dataIndex: "operate", fixed: "right", width: 120, title: "操作",
title: "操作",
render: (text, record) => { render: (text, record) => {
return <div className="optWrapper"> return <div className="optWrapper">
<a href="javascript:void(0);" className="mr10" onClick={() => this.handleEdit(record)}>编辑</a> <a href="javascript:void(0);" className="mr10" onClick={() => this.handleEdit(record)}>编辑</a>
<Popover <a href="javascript:void(0);"
overlayClassName="moreIconWrapper" onClick={() => this.deleteSalaryItem(record.id)}>{getLabel(535052, "删除")}</a>
placement="bottomRight"
content={<Menu onClick={(e) => this.deleteSalaryItem(record.id)}>
<Menu.Item key="delete">删除</Menu.Item>
</Menu>} title="">
<i className="icon-coms-more"/>
</Popover>
</div>; </div>;
} }
}]; }];
@ -90,45 +107,29 @@ export default class SalaryItemChangeList extends React.Component {
} }
render() { render() {
const { salaryFileStore } = this.props; const { salaryFileStore } = this.props, { adjLogRecordDialog } = this.state;
const { singleSalaryItemList } = salaryFileStore; const { singleSalaryItemList } = salaryFileStore;
const pageInfo = { current: singleSalaryItemList.pageNum, pageSize: 10, total: singleSalaryItemList.total };
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
onChange: current => this.handlePageChange(current)
};
return ( return (
<div> <div>
<UnifiedTable <WeaTable
columns={ columns={this.getColumns()} dataSource={singleSalaryItemList.list ? singleSalaryItemList.list : []}
_.map(this.getColumns(), item => { pagination={pagination} scroll={{ x: 800 }} className="adjustItem-layout"
if (item.dataIndex !== "operate") { />
return { <SalaryArchiveEditAdjLogRecord
...item, {...adjLogRecordDialog}
render: (text) => { onCancel={() => this.setState({
return <span className="ellipsis" title={text}>{text}</span>; adjLogRecordDialog: {
} adjLogRecordDialog, visible: false, title: "", id: "", salaryArchiveId: ""
}; }
} })}
return { ...item };
})
}
dataSource={singleSalaryItemList.list ? singleSalaryItemList.list : []}
pagination={{
onChange: (value) => {
this.handlePageChange(value);
},
total: singleSalaryItemList.total,
showTotal: (total) => `${total}`,
current: singleSalaryItemList.pageNum
}}
xWidth={this.getColumns().length * 100}
/> />
{
this.state.changeSalaryVisible && <ChangeSalaryModal
currentId={this.props.id}
recordId={this.state.recordId}
visible={this.state.changeSalaryVisible}
onCancel={() => {
this.setState({ changeSalaryVisible: false });
}}
/>
}
</div> </div>
); );
} }

View File

@ -36,7 +36,6 @@ class SalaryItemForm extends Component {
const { key } = item; const { key } = item;
switch (key) { switch (key) {
case "useDefault": case "useDefault":
case "sortedIndex":
case "dataType": case "dataType":
case "description": case "description":
return { return {
@ -44,6 +43,8 @@ class SalaryItemForm extends Component {
viewAttr: (!isLedger && ((editable && record.canEdit) || isAdd)) ? 2 : 1, viewAttr: (!isLedger && ((editable && record.canEdit) || isAdd)) ? 2 : 1,
display: !isLedger display: !isLedger
}; };
case "sortedIndex":
return { ...item };
case "useInEmployeeSalary": case "useInEmployeeSalary":
return { return {
...item, ...item,

View File

@ -3,6 +3,7 @@ import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx"; import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from "../apis/calculate"; import * as API from "../apis/calculate";
import { toDecimal_n } from "../util";
const { TableStore } = WeaTableNew; const { TableStore } = WeaTableNew;
@ -492,7 +493,7 @@ export class calculateStore {
..._.map(cur.salaryItems, it => { ..._.map(cur.salaryItems, it => {
return { return {
salaryItemId: it.salaryItemId, salaryItemId: it.salaryItemId,
resultValue: it.resultValue resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, it.pattern || 2) : it.resultValue
}; };
}) })
]; ];
@ -501,7 +502,7 @@ export class calculateStore {
const issuedAndReissueItems = this.acctresultDetailForm.issuedAndReissueItems.map(item => { const issuedAndReissueItems = this.acctresultDetailForm.issuedAndReissueItems.map(item => {
let record = {}; let record = {};
record.salaryItemId = item.salaryItemId; record.salaryItemId = item.salaryItemId;
record.resultValue = item.resultValue; record.resultValue = (item.dataType === "number" && !!item.resultValue) ? toDecimal_n(item.resultValue, item.pattern || 2) : item.resultValue;
return record; return record;
}); });

View File

@ -9,6 +9,9 @@ import { notNull } from "../util/validate";
const { TableStore } = WeaTableNew; const { TableStore } = WeaTableNew;
export class salaryFileStore { export class salaryFileStore {
@observable adjForm = new WeaForm(); // 调薪form
@observable tableStore = new TableStore(); // new table @observable tableStore = new TableStore(); // new table
@observable form = new WeaForm(); // nrew 一个form @observable form = new WeaForm(); // nrew 一个form
@observable condition = []; // 存储后台得到的form数据 @observable condition = []; // 存储后台得到的form数据
@ -41,6 +44,8 @@ export class salaryFileStore {
setSalaryIncreaseUrl = data => (this.salaryIncreaseUrl = data); setSalaryIncreaseUrl = data => (this.salaryIncreaseUrl = data);
@action("设置薪资档案项") @action("设置薪资档案项")
setAdjustSalaryItems = data => (this.adjustSalaryItems = data); setAdjustSalaryItems = data => (this.adjustSalaryItems = data);
@action("调薪初始化form")
initAdjForm = () => (this.adjForm = new WeaForm());
// ** 设置导入参数 start ** // ** 设置导入参数 start **
@action @action
setPreviewDataSource = (previewDataSource) => { setPreviewDataSource = (previewDataSource) => {

View File

@ -122,3 +122,27 @@ export const printDom = (printParams) => {
hideDom.style.display = ""; hideDom.style.display = "";
} }
}; };
export const getDomkes = (conditions) => {
return _.map(conditions[0].items, it => it.domkey[0]);
};
export const padding0 = (num, length) => {
for (let len = ("" + num).length; len < length; len++) {
num = "0" + num;
}
return "0." + num;
};
export const toDecimal_n = (x, num) => {
if (isNaN(parseFloat(x))) return false;
let f = Math.round(x * 100) / 100;
let s = f.toString();
let rs = s.indexOf(".");
if (rs < 0) {
rs = s.length;
s += ".";
}
while (s.length <= rs + num) {
s += "0";
}
return s;
};