Merge branch 'release/2.17.1.2411.01' into feature/2.15.2.2411.01业务线
# Conflicts: # pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js # pc4mobx/hrmSalary/util/index.js
This commit is contained in:
commit
64777b4129
|
|
@ -150,3 +150,7 @@ export const getPageListTemplatelist = (params) => {
|
|||
export const changePageListTemplate = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/common/pageList/template/change", params);
|
||||
};
|
||||
//薪酬统计报表-重置自定义列
|
||||
export const resetPageListSetting = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/common/pageList/reset/setting", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -75,9 +75,9 @@ class CustomBrowserMutiRight extends Component {
|
|||
const targetNode = obj.node.props.eventKey;
|
||||
const result = [];
|
||||
this.nodeIds.filter((item) => {
|
||||
return dragNodes.indexOf(item) === -1;
|
||||
return dragNodes.indexOf(String(item)) === -1;
|
||||
}).forEach((id) => {
|
||||
if (id === targetNode) {
|
||||
if (String(id) === targetNode) {
|
||||
dragNodes.forEach((drag) => {
|
||||
result.push(this.nodeObj[drag]);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -139,10 +139,11 @@ class CustomTransferDialog extends Component {
|
|||
|
||||
render() {
|
||||
const { loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys } = this.state;
|
||||
const { searchParamsKey, saveLoading } = this.props;
|
||||
const { searchParamsKey, saveLoading, btns = [] } = this.props;
|
||||
const buttons = [
|
||||
<Button type="primary" loading={saveLoading} onClick={this.handleOk}
|
||||
disabled={_.isEmpty(rightDatas)}>{getLabel(111, "确 定")}</Button>,
|
||||
...btns,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>];
|
||||
let rightActive = false, leftActive = false, rightAllActive = false;
|
||||
if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true;
|
||||
|
|
@ -188,7 +189,9 @@ class CustomTransferDialog extends Component {
|
|||
data={rightDatas} checkedKeys={rightCheckedKeys}
|
||||
checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })}
|
||||
onDoubleClick={this.onRightDoubleClick}
|
||||
onDrag={(data) => {this.setState({rightDatas: data})}}
|
||||
onDrag={(data) => {
|
||||
this.setState({ rightDatas: data });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ class PersonalScopeModal extends Component {
|
|||
break;
|
||||
case "SQL":
|
||||
return <div style={{ display: "flex", alignItems: "center" }}>
|
||||
<WeaTextarea minRows={2} viewAttr={3} style={{ width: 270 }} value={targetTypeIds}
|
||||
<WeaTextarea minRows={2} viewAttr={3} style={{ width: 270 }} value={targetTypeIdsNames}
|
||||
onChange={val => this.setState({ targetTypeIds: val, targetTypeIdsNames: val })}/>
|
||||
<WeaHelpfulTip style={{ marginLeft: 10 }} width={200} placement="topLeft" title={<SQLHelpTip/>}/>
|
||||
</div>;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,10 @@
|
|||
* Date: 2024/3/26
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { toJS } from "mobx";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaSelect } from "ecCom";
|
||||
import { message, Spin } from "antd";
|
||||
import { Button, message, Spin } from "antd";
|
||||
import { getIframeParentHeight } from "../../../util";
|
||||
import { sysConfCodeRule } from "../../../apis/ruleconfig";
|
||||
import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog";
|
||||
|
|
@ -18,6 +17,7 @@ import { MonthRangePicker } from "../../reportView/components/statisticalMicroSe
|
|||
import AdvanceInputBtn from "../components/advanceInputBtn";
|
||||
import SearchPannel from "../components/searchPannel";
|
||||
import * as API from "../../../apis/statistics";
|
||||
import { resetPageListSetting } from "../../../apis/statistics";
|
||||
import cs from "classnames";
|
||||
import "../index.less";
|
||||
|
||||
|
|
@ -34,7 +34,8 @@ class SalaryDetails extends Component {
|
|||
pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "",
|
||||
showTotalCell: false, updateSum: true, tempDialog: { visible: false, setting: [], id: "", template: {} },
|
||||
transferDialog: {
|
||||
visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, saveLoading: false,
|
||||
visible: false, searchParamsKey: "name", saveLoading: false,
|
||||
dataParams: { page: "salary_details_report", defaultSetting: "0" },
|
||||
completeURL: "", convertDatasource: datas => {
|
||||
return {
|
||||
listDatas: _.map(datas.setting, o => ({ id: o.id || o.column, name: o.name || o.text })),
|
||||
|
|
@ -48,11 +49,8 @@ class SalaryDetails extends Component {
|
|||
|
||||
async componentDidMount() {
|
||||
const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]);
|
||||
this.setState({
|
||||
showTotalCell: confCode === "1"
|
||||
}, () => {
|
||||
this.getSalaryList(this.props);
|
||||
this.getPageListTemplatelist();
|
||||
this.setState({ showTotalCell: confCode === "1" }, () => {
|
||||
this.props.salaryDetailShowType === "1" && this.getPageListTemplatelist();
|
||||
});
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
window.addEventListener("resize", () => this.forceUpdate(), false);
|
||||
|
|
@ -85,13 +83,13 @@ class SalaryDetails extends Component {
|
|||
const { type, payload: { id, params } = {} } = data;
|
||||
const { pageInfo } = this.state;
|
||||
if (type === "init") {
|
||||
this.getColumns();
|
||||
// this.getColumns();
|
||||
this.getSalaryList(this.props);
|
||||
} else if (type === "turn") {
|
||||
if (id === "PAGEINFO") {
|
||||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize },
|
||||
updateSum: false
|
||||
pageInfo: { ...pageInfo, current, pageSize }, updateSum: false
|
||||
}, () => this.getSalaryList(this.props));
|
||||
} else if (id === "CHECKBOX") {
|
||||
const { selectedRowKeys: checkBox } = params;
|
||||
|
|
@ -127,20 +125,24 @@ class SalaryDetails extends Component {
|
|||
const { list: dataSource, pageNum: current, total, pageSize } = pageparams;
|
||||
this.setState({
|
||||
columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload
|
||||
}, () => tableStore.getDatas(dataKey.datas));
|
||||
}, () => {
|
||||
// tableStore.getDatas(dataKey.datas)
|
||||
this.getColumns();
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getSalaryListSum = (payload) => {
|
||||
API.getSalaryListSum(payload).then(({ status, data }) => {
|
||||
if (status) this.setState({ sumRow: data.sumRow });
|
||||
if (status) this.setState({ sumRow: data.sumRow }, () => this.getColumns());
|
||||
});
|
||||
};
|
||||
handleExportSalaryList = (key) => {
|
||||
const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
|
||||
// const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
|
||||
let { selectedRowKeys, payload, columns: tempCols } = this.state;
|
||||
const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
|
||||
const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
|
||||
// const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
|
||||
// const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
|
||||
const columns = _.filter(tempCols, o => o.column !== "acctTimes");
|
||||
if (key === "SELECTED" && selectedRowKeys.length === 0) {
|
||||
message.warning(getLabel(543345, "请选择需要导出的数据!"));
|
||||
return;
|
||||
|
|
@ -151,12 +153,13 @@ class SalaryDetails extends Component {
|
|||
});
|
||||
};
|
||||
getColumns = () => {
|
||||
const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
|
||||
// const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
|
||||
const {
|
||||
columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRow, transferDialog
|
||||
columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRow
|
||||
} = this.state;
|
||||
const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
|
||||
const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
|
||||
// const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
|
||||
// const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
|
||||
const columns = _.filter(tempCols, o => o.column !== "acctTimes");
|
||||
if (!_.isEmpty(columns)) {
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRow,
|
||||
|
|
@ -170,15 +173,15 @@ class SalaryDetails extends Component {
|
|||
}
|
||||
return [];
|
||||
};
|
||||
handleSetDefCols = () => this.setState({
|
||||
handleSetDefCols = (params) => this.setState({
|
||||
transferDialog: {
|
||||
...this.state.transferDialog, completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", visible: true,
|
||||
dataParams: { page: "salary_details_report" }
|
||||
dataParams: { ...this.state.transferDialog.dataParams, ...params }
|
||||
}
|
||||
});
|
||||
converCheckedCol = (data) => {
|
||||
return _.reduce(data.checked || [], (pre, cur) => {
|
||||
const item = _.find(data.setting, k => (k.id === cur) || (k.column === cur.column));
|
||||
const item = _.find(data.setting, k => k.column === cur.column);
|
||||
if (!_.isEmpty(item)) return [...pre, { ...item, id: item.id || item.column, name: item.name || item.text }];
|
||||
return pre;
|
||||
}, []);
|
||||
|
|
@ -192,8 +195,7 @@ class SalaryDetails extends Component {
|
|||
return;
|
||||
}
|
||||
const payload = {
|
||||
page: "salary_details_report",
|
||||
setting: _.map(values, o => o.id)
|
||||
...transferDialog.dataParams, setting: _.map(values, o => o.id)
|
||||
};
|
||||
this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: true } });
|
||||
API.savePageListSetting(payload).then(({ status, errormsg }) => {
|
||||
|
|
@ -231,10 +233,23 @@ class SalaryDetails extends Component {
|
|||
});
|
||||
});
|
||||
};
|
||||
resetColsSetting = () => {
|
||||
resetPageListSetting({ page: "salary_details_report" }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.setState({
|
||||
transferDialog: { ...this.state.transferDialog, visible: false, type: "default" }
|
||||
}, () => this.getSalaryList());
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, dataSource, transferDialog, tempDialog, tempPageList, templateId } = this.state;
|
||||
const { attendanceStore: { tableStore }, dateRange, showSearchAd, salaryDetailShowType } = this.props;
|
||||
const { dataParams: { defaultSetting } } = transferDialog;
|
||||
return (<React.Fragment>
|
||||
<div className="query-div">
|
||||
{
|
||||
|
|
@ -269,14 +284,17 @@ class SalaryDetails extends Component {
|
|||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
<WeaTableComx
|
||||
style={{ display: "none" }}
|
||||
comsWeaTableStore={tableStore}
|
||||
needScroll={true}
|
||||
columns={this.getColumns()}
|
||||
/>
|
||||
{/*<WeaTableComx*/}
|
||||
{/* style={{ display: "none" }}*/}
|
||||
{/* comsWeaTableStore={tableStore}*/}
|
||||
{/* needScroll={true}*/}
|
||||
{/* columns={this.getColumns()}*/}
|
||||
{/*/>*/}
|
||||
{/*默认显示列,薪资模板列表*/}
|
||||
<CustomTransferDialog {...transferDialog} onChange={this.savePageListSetting}
|
||||
btns={defaultSetting === "0" ?
|
||||
[<Button type="primary"
|
||||
onClick={this.resetColsSetting}>{getLabel(111, "恢复默认显示列")}</Button>] : []}
|
||||
onCancel={() => this.setState({
|
||||
transferDialog: {
|
||||
...transferDialog, completeURL: "", visible: false, type: "default"
|
||||
|
|
|
|||
|
|
@ -320,8 +320,9 @@ class Index extends Component {
|
|||
icon: <i className="icon-coms-Custom"/>,
|
||||
content: getLabel(111, "显示列定制"),
|
||||
onClick: () => {
|
||||
tableStore.setColSetVisible(true);
|
||||
tableStore.tableColSet(true);
|
||||
this.salaryRef.wrappedInstance.handleSetDefCols({ defaultSetting: "0" });
|
||||
// tableStore.setColSetVisible(true);
|
||||
// tableStore.tableColSet(true);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
|
@ -333,7 +334,7 @@ class Index extends Component {
|
|||
dropMenuDatas = selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1);
|
||||
(PageAndOptAuth.isChief && selectedKey === "salaryDetail") && (dropMenuDatas = [...dropMenuDatas, {
|
||||
key: "DEF_COLUMN", icon: <i className="icon-coms-Custom"/>, content: getLabel(111, "默认显示列"),
|
||||
onClick: () => this.salaryRef.wrappedInstance.handleSetDefCols()
|
||||
onClick: () => this.salaryRef.wrappedInstance.handleSetDefCols({ defaultSetting: "1" })
|
||||
}]);
|
||||
return (
|
||||
<WeaReqTop
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class Index extends Component {
|
|||
}, () => {
|
||||
const { calculateStore: { PCSearchForm } } = this.props;
|
||||
PCSearchForm.initFormFields(this.state.searchConditions);
|
||||
this.queryPCList();
|
||||
this.handleRefresh(true);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -185,13 +185,13 @@ class Index extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
handleRefresh = () => {
|
||||
handleRefresh = (init = false) => {
|
||||
if (!this.handleDebounce) {
|
||||
this.handleDebounce = _.debounce(() => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
refreshAcctemployee({ salaryAcctRecordId }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
!init && message.success(getLabel(111, "操作成功!"));
|
||||
this.queryPCList();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
...pageInfo,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class Index extends Component {
|
|||
label: o.name,
|
||||
labelcol: 6,
|
||||
value: detail[`${String(o.id)}_variableItem`] || "",
|
||||
viewAttr: 2
|
||||
viewAttr: 2, dataType: o.dataType
|
||||
})),
|
||||
title: "", col: 2,
|
||||
defaultshow: true
|
||||
|
|
@ -79,8 +79,7 @@ class Index extends Component {
|
|||
if (!_.isEmpty(detail)) {
|
||||
VSSalaryFileForm.updateFields({
|
||||
employeeId: {
|
||||
value: detail["employeeId"],
|
||||
valueSpan: detail["username"],
|
||||
value: detail["employeeId"], valueSpan: detail["username"],
|
||||
valueObj: [{ id: detail["employeeId"], name: detail["username"] }]
|
||||
}
|
||||
});
|
||||
|
|
@ -131,6 +130,19 @@ class Index extends Component {
|
|||
</div>
|
||||
</div>;
|
||||
};
|
||||
handleChange = (formVal) => {
|
||||
const key = _.keys(formVal)[0], value = formVal[key].value;
|
||||
const [__, fields] = this.state.conditions, { items } = fields;
|
||||
_.forEach(items, o => {
|
||||
if (getKey(o) === key && o.dataType === "number") {
|
||||
if (_.isNaN(Number(value)) || value.indexOf(" ") !== -1) {
|
||||
const { baseTableStore: { VSSalaryFileForm } } = this.props;
|
||||
message.warning(getLabel(111, "数值类型有误!"));
|
||||
VSSalaryFileForm.updateFields({ [getKey(o)]: { value: "" } });
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions } = this.state;
|
||||
|
|
@ -138,7 +150,8 @@ class Index extends Component {
|
|||
return (<WeaSlideModal
|
||||
className="variable_salary_file_dialog" {...this.props} direction="right" onClose={() => onClose()}
|
||||
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%" title={this.renderTitle()}
|
||||
content={<div className="form-dialog-layout">{getSearchs(VSSalaryFileForm, conditions, 2, false)}</div>}
|
||||
content={<div
|
||||
className="form-dialog-layout">{getSearchs(VSSalaryFileForm, conditions, 2, false, this.handleChange)}</div>}
|
||||
/>);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue