Merge branch 'release/2.18.1.2412.01' into release/2.18.1.2412.01-个税
# Conflicts: # pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
This commit is contained in:
commit
10cad4e462
|
|
@ -254,20 +254,19 @@ class LedgerSalaryItem extends Component {
|
|||
* Params:
|
||||
* Date: 2022/12/14
|
||||
*/
|
||||
handleAddSalaryItems = (id, items) => {
|
||||
handleAddSalaryItems = (id, items, insertId) => {
|
||||
const { itemGroups } = this.state;
|
||||
this.setState({
|
||||
itemGroups: _.map(itemGroups, it => {
|
||||
if (id === it.uuid) {
|
||||
items = _.map(items, child => {
|
||||
const { id: itemsId, ...extraItems } = child;
|
||||
return { ...extraItems, salaryItemGroupId: it.uuid };
|
||||
});
|
||||
if (insertId) it.items.splice(_.findIndex(it.items, k => (k.id === insertId) || (k.key === insertId)) + 1, 0, ...items);
|
||||
return {
|
||||
...it, items: _.map([..._.map(items, child => {
|
||||
const { id: itemsId, ...extraItems } = child;
|
||||
return { ...extraItems, salaryItemGroupId: it.uuid };
|
||||
}), ...it.items], (childItem, childItemIndex) => {
|
||||
return {
|
||||
...childItem,
|
||||
sortedIndex: childItemIndex
|
||||
};
|
||||
...it, items: _.map(insertId ? it.items : [...items, ...it.items], (childItem, childItemIndex) => {
|
||||
return { ...childItem, sortedIndex: childItemIndex };
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,15 @@
|
|||
import React from "react";
|
||||
import { Button, Switch } from "antd";
|
||||
import { WeaDialog, WeaInputSearch, WeaTable } from "ecCom";
|
||||
import { Button, Spin } from "antd";
|
||||
import { WeaCheckbox, WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { listSalaryItem } from "../../../apis/ledger";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
export default class LedgerSalaryItemAddModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: {
|
||||
query: false
|
||||
},
|
||||
name: "",
|
||||
selectedRowKeys: [],
|
||||
dataSource: [],
|
||||
dataSourceCopy: [],
|
||||
columns: [],
|
||||
pageInfo: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
}
|
||||
loading: { query: false }, name: "", selectedRowKeys: [], dataSource: [],
|
||||
dataSourceCopy: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -42,12 +32,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
excludeIds.push(i.salaryItemId);
|
||||
});
|
||||
});
|
||||
const payload = {
|
||||
excludeIds,
|
||||
name,
|
||||
...pageInfo,
|
||||
...extra
|
||||
};
|
||||
const payload = { excludeIds, name, ...pageInfo, ...extra };
|
||||
this.setState({ loading: { ...loading, query: true } });
|
||||
listSalaryItem(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: { ...loading, query: false } });
|
||||
|
|
@ -56,9 +41,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
const tmpV = !_.isEmpty(dataSource) ? dataSource : [];
|
||||
this.setState({
|
||||
dataSourceCopy: [...dataSourceCopy, ...tmpV],
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource: tmpV,
|
||||
columns
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource: tmpV, columns
|
||||
});
|
||||
}
|
||||
}).catch(() => {
|
||||
|
|
@ -76,7 +59,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
case "useDefault":
|
||||
case "hideDefault":
|
||||
case "useInEmployeeSalary":
|
||||
return <Switch checked={text === 1}/>;
|
||||
return <WeaCheckbox value={String(text)} disabled display="switch"/>;
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
||||
}
|
||||
|
|
@ -85,10 +68,9 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
});
|
||||
return newColumns;
|
||||
};
|
||||
|
||||
handleAdd = () => {
|
||||
const { dataSourceCopy, selectedRowKeys } = this.state;
|
||||
const { onAddSalaryItems, id, onCancel, itemGroups } = this.props;
|
||||
const { onAddSalaryItems, id, onCancel, itemGroups, record } = this.props;
|
||||
const arrItems = _.find(itemGroups, it => it.uuid === id).items || [];
|
||||
let selectItems = [];
|
||||
_.uniqWith(dataSourceCopy, _.isEqual).map((item) => {
|
||||
|
|
@ -104,12 +86,21 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
});
|
||||
});
|
||||
onCancel();
|
||||
onAddSalaryItems(id, selectItems);
|
||||
onAddSalaryItems(id, selectItems, record.id || record.key);
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { name, pageInfo } = this.state;
|
||||
return <div className="sys-item-title">
|
||||
<span>{getLabel(111, "添加薪资项目")}</span>
|
||||
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })} style={{ width: 200 }}
|
||||
placeholder={getLabel(111, "请输入薪资项目名称")} onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.listSalaryItem())}/>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { onCancel, visible } = this.props;
|
||||
const { name, selectedRowKeys, pageInfo, dataSource, loading } = this.state;
|
||||
const { selectedRowKeys, pageInfo, dataSource, loading } = this.state;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
|
|
@ -117,49 +108,31 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.listSalaryItem());
|
||||
this.setState({ pageInfo: { ...pageInfo, current: 1, pageSize } }, () => this.listSalaryItem());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => this.listSalaryItem());
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.listSalaryItem());
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => {
|
||||
this.setState({ selectedRowKeys }, () => {
|
||||
});
|
||||
}
|
||||
selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
visible={visible} onCancel={onCancel} hasScroll
|
||||
title="添加薪资项目" style={{
|
||||
width: "80vw", height: 606.6, minHeight: 200,
|
||||
minWidth: 380, maxHeight: "80%", maxWidth: "80vw",
|
||||
overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}
|
||||
buttons={[<Button type="primary" onClick={this.handleAdd} disabled={_.isEmpty(selectedRowKeys)}>添加</Button>]}
|
||||
>
|
||||
<div style={{ display: "flex", justifyContent: "flex-end", alignItems: "center", padding: 20 }}>
|
||||
<WeaInputSearch
|
||||
placeholder="请输入薪资项目名称"
|
||||
value={name}
|
||||
onChange={(name) => this.setState({ name })}
|
||||
onSearch={() => this.listSalaryItem({ current: 1 })}
|
||||
/>
|
||||
<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.sysItemRef = dom}
|
||||
title={this.renderTitle()}
|
||||
buttons={[<Button type="primary" onClick={this.handleAdd}
|
||||
disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "添加")}</Button>]}
|
||||
style={{
|
||||
width: "60vw", height: 600, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}>
|
||||
<div className="sys-item-table-box">
|
||||
<Spin spinning={loading.query && pageInfo.total === 0}>
|
||||
<WeaTable columns={this.getSalaryItemAddColumns()} dataSource={dataSource} pagination={pagination}
|
||||
loading={loading.query} scroll={{ y: this.sysItemRef ? this.sysItemRef.state.height - 112 : 600 }}
|
||||
rowKey={record => record.id || record.key} rowSelection={rowSelection}/>
|
||||
</Spin>
|
||||
</div>
|
||||
<WeaTable
|
||||
rowKey={record => record.id || record.key}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
columns={this.getSalaryItemAddColumns()}
|
||||
/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class LedgerSalaryItemNormal extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
addCategoryItemsVisible: false,
|
||||
addCategoryItemsVisible: { visible: false, id: "", record: {} },
|
||||
categoryModal: {
|
||||
visible: false,
|
||||
title: "新增分类",
|
||||
|
|
@ -170,7 +170,11 @@ class LedgerSalaryItemNormal extends Component {
|
|||
onEditCategory={this.handleAddCategory}
|
||||
onDeleteCategory={this.handleDeleteCategory}
|
||||
onDeleteCategoryItems={this.handleDeleteCategoryItems}
|
||||
onAddCategoryItems={(id) => this.setState({ addCategoryItemsVisible: { visible: true, id } })}
|
||||
onAddCategoryItems={(id) => this.setState({
|
||||
addCategoryItemsVisible: {
|
||||
...addCategoryItemsVisible, visible: true, id
|
||||
}
|
||||
})}
|
||||
onUpgo={this.handleUpgo}
|
||||
onDowngo={this.handleDowngo}
|
||||
/>
|
||||
|
|
@ -185,6 +189,9 @@ class LedgerSalaryItemNormal extends Component {
|
|||
onHandleItemhide={(data) => onHandleItemhide(field, data)}
|
||||
onChangeSelectedRowKeys={(data) => onChangeSelectedRowKeys(field, data)}
|
||||
onMoveTo={this.handleMoveTo}
|
||||
onAddCategoryItems={(record) => this.setState({
|
||||
addCategoryItemsVisible: { visible: true, record, id: uuid }
|
||||
})}
|
||||
/>
|
||||
</WeaSearchGroup>;
|
||||
})
|
||||
|
|
@ -198,7 +205,7 @@ class LedgerSalaryItemNormal extends Component {
|
|||
<LedgerSalaryItemAddModal
|
||||
{...addCategoryItemsVisible}
|
||||
itemGroups={dataSource}
|
||||
onCancel={() => this.setState({ addCategoryItemsVisible: { visible: false, id: "" } })}
|
||||
onCancel={() => this.setState({ addCategoryItemsVisible: { visible: false, id: "", record: {} } })}
|
||||
onAddSalaryItems={onAddSalaryItems}
|
||||
/>
|
||||
<CategoryAddModal
|
||||
|
|
|
|||
|
|
@ -294,11 +294,13 @@ class LedgerSalaryItemTable extends Component {
|
|||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
key: "operate",
|
||||
width: 120,
|
||||
width: 180,
|
||||
render: (_, record) => (
|
||||
<React.Fragment>
|
||||
<a href="javascript:void(0);" onClick={() => this.handleEditSalaryItem(record)}
|
||||
style={{ marginRight: 10 }}>编辑</a>
|
||||
<a href="javascript:void(0);" onClick={() => this.props.onAddCategoryItems(record)}
|
||||
style={{ marginRight: 10 }}>{getLabel(111, "插入")}</a>
|
||||
<a href="javascript:void(0);" onClick={() => onMoveTo(record)}>移动到</a>
|
||||
</React.Fragment>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class LedgerSlide extends Component {
|
|||
* Date: 2022/12/12
|
||||
*/
|
||||
saveLedgerAdjustRule = () => {
|
||||
const { adjustRules, saveSalarySobId } = this.state;
|
||||
const { adjustRules, saveSalarySobId, salaryApprovalStatus } = this.state;
|
||||
const payload = {
|
||||
salarySobId: this.props.editId || saveSalarySobId,
|
||||
ruleParams: adjustRules
|
||||
|
|
@ -111,6 +111,7 @@ class LedgerSlide extends Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success("保存成功");
|
||||
!salaryApprovalStatus && this.handleClose();
|
||||
} else {
|
||||
message.success(errormsg || "保存失败");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,6 +152,22 @@ export const conditions = [
|
|||
lanId: 538004,
|
||||
defaultshow: true
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["ATTENDANCE_SERIAL_COLLECTION_BTN"],
|
||||
fieldcol: 10,
|
||||
label: "考勤引用是否采集班次数据",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
title: "数据采集",
|
||||
lanId: 111,
|
||||
defaultshow: true
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ class RuleConfig extends Component {
|
|||
case "APPROVAL_CAN_MANUAL_FILE_STATUS":
|
||||
case "APPROVAL_CAN_RE_CALC_STATUS":
|
||||
case "APPROVAL_CAN_EDIT_RESULT_STATUS":
|
||||
case "ATTENDANCE_SERIAL_COLLECTION_BTN":
|
||||
if (!this.handleDebounce) {
|
||||
this.handleDebounce = _.debounce(() => {
|
||||
const confTitle = {
|
||||
|
|
@ -169,7 +170,8 @@ class RuleConfig extends Component {
|
|||
SALARY_APPROVAL_STATUS: getLabel(111, "是否开启薪资审批"),
|
||||
APPROVAL_CAN_MANUAL_FILE_STATUS: getLabel(111, "开启审批的核算记录允许手动归档"),
|
||||
APPROVAL_CAN_RE_CALC_STATUS: getLabel(111, "开启审批的核算记录允许重新核算"),
|
||||
APPROVAL_CAN_EDIT_RESULT_STATUS: getLabel(111, "审批流程发起后允许修改核算数据")
|
||||
APPROVAL_CAN_EDIT_RESULT_STATUS: getLabel(111, "审批流程发起后允许修改核算数据"),
|
||||
ATTENDANCE_SERIAL_COLLECTION_BTN: getLabel(111, "考勤引用是否采集班次数据")
|
||||
};
|
||||
this.unifiedSettings(key, confTitle[key]);
|
||||
this.handleDebounce = null;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
return <div className="sys-item-title">
|
||||
<span>{getLabel(111, "添加系统薪资项目")}</span>
|
||||
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })} style={{ width: 200 }}
|
||||
placeholder={getLabel(111, "请输入薪资项目名称")} a onSearch={() => this.setState({
|
||||
placeholder={getLabel(111, "请输入薪资项目名称")} onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.getSysItemList())}/>
|
||||
</div>;
|
||||
|
|
@ -92,7 +92,7 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
<div className="sys-item-table-box">
|
||||
<Spin spinning={loading && pageInfo.total === 0}>
|
||||
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} rowSelection={rowSelection}
|
||||
loading={loading} scroll={{ y: this.importRef ? this.sysItemRef.state.height - 16 : 600 }}
|
||||
loading={loading} scroll={{ y: this.sysItemRef ? this.sysItemRef.state.height - 16 : 600 }}
|
||||
rowKey="id"/>
|
||||
</Spin>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue