Merge branch 'feature/2.15.2.2411.01业务线' into custom/领悦业务线

# Conflicts:
#	pc4mobx/hrmSalary/index.js
This commit is contained in:
lys 2024-12-03 11:36:07 +08:00
commit ef218c277f
81 changed files with 1842 additions and 1191 deletions

View File

@ -277,6 +277,10 @@ export const deleteExportTemplate = (params) => {
export const getExportTemplateForm = (params) => { export const getExportTemplateForm = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params); return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params);
}; };
//薪资审批-薪资核算页面获取审批信息
export const getApprovalInfoByRecordId = params => {
return WeaTools.callApi("/api/bs/hrmsalary/salarysob/salaryApproval/getApprovalInfoByRecordId", "GET", params);
};
//薪资核算-薪资项目改变否 //薪资核算-薪资项目改变否
export const getCompareSobConfig = params => { export const getCompareSobConfig = params => {
return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/compareSobConfig", "GET", params); return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/compareSobConfig", "GET", params);

View File

@ -57,6 +57,10 @@ export const deleteLedgerPersonExtRange = params => {
export const saveLedgerPersonRange = params => { export const saveLedgerPersonRange = params => {
return postFetch("/api/bs/hrmsalary/salarysob/range/save", params); return postFetch("/api/bs/hrmsalary/salarysob/range/save", params);
}; };
//编辑薪资帐套人员范围
export const editLedgerPersonRange = params => {
return postFetch("/api/bs/hrmsalary/salarysob/range/edit", params);
};
//删除薪资帐套人员范围 //删除薪资帐套人员范围
export const deleteLedgerPersonRange = params => { export const deleteLedgerPersonRange = params => {
@ -155,3 +159,15 @@ export const salarysobRangeImportData = params => {
export const getSalaryItemForm = params => { export const getSalaryItemForm = params => {
return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params); return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params);
}; };
//薪资核算规则配置-获取薪资审批规则表单
export const getSalaryApprovalForm = params => {
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/getForm", params);
};
//薪资核算规则配置-保存薪资审批规则表单
export const salaryApprovalSaveForm = params => {
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/saveForm", params);
};
//薪资核算规则配置-获取能够添加的项目
export const getListSalaryItem = params => {
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/listSalaryItem", params);
};

View File

@ -52,5 +52,5 @@ export const saveSecondaryPwd = params => {
return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params); return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params);
}; };
export const salaryBillGetToken = params => { export const salaryBillGetToken = params => {
return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/getToken", "GET", params); return postFetch("/api/bs/hrmsalary/salaryBill/getToken", params);
}; };

View File

@ -138,3 +138,15 @@ export const exportSalaryList = (params) => {
export const savePageListSetting = (params) => { export const savePageListSetting = (params) => {
return postFetch("/api/bs/hrmsalary/common/pageList/save/setting", params); return postFetch("/api/bs/hrmsalary/common/pageList/save/setting", params);
}; };
//薪酬统计报表-保存页面模板
export const savePageListTemplate = (params) => {
return postFetch("/api/bs/hrmsalary/common/pageList/template/save", params);
};
//薪酬统计报表-获取页面模板
export const getPageListTemplatelist = (params) => {
return postFetch("/api/bs/hrmsalary/common/pageList/template/list", params);
};
//薪酬统计报表-切换个体页面模板
export const changePageListTemplate = (params) => {
return postFetch("/api/bs/hrmsalary/common/pageList/template/change", params);
};

View File

@ -48,6 +48,10 @@ export const deleteTaxAgent = (params) => {
export const taxAgentRangeSave = (params) => { export const taxAgentRangeSave = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params); return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params);
}; };
//编辑人员范围
export const taxAgentRangeEdit = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/edit", params);
};
//非系统人员范围查询 //非系统人员范围查询
export const taxAgentRangelistExt = (params) => { export const taxAgentRangelistExt = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/listExt", params); return postFetch("/api/bs/hrmsalary/taxAgent/range/listExt", params);

View File

@ -66,6 +66,26 @@ class CustomBrowserMutiRight extends Component {
clearTimeout(timeout); clearTimeout(timeout);
this.props.onDoubleClick && this.props.onDoubleClick(key); this.props.onDoubleClick && this.props.onDoubleClick(key);
}; };
onDragStart = (obj) => {
clearTimeout(timeout);
this.props.checkedCb && this.props.checkedCb([]);
};
onDrop = (obj) => {
const dragNodes = obj.dragNodesKeys;
const targetNode = obj.node.props.eventKey;
const result = [];
this.nodeIds.filter((item) => {
return dragNodes.indexOf(item) === -1;
}).forEach((id) => {
if (id === targetNode) {
dragNodes.forEach((drag) => {
result.push(this.nodeObj[drag]);
});
}
result.push(this.nodeObj[id]);
});
this.props.onDrag && this.props.onDrag(result);
};
render() { render() {
const { height, checkedKeys } = this.props; const { height, checkedKeys } = this.props;
@ -76,9 +96,8 @@ class CustomBrowserMutiRight extends Component {
<div> <div>
<WeaNewScroll height={height || 400}> <WeaNewScroll height={height || 400}>
<Tree className="transfer-tree" draggable multiple={true} async={true} selectable={true} <Tree className="transfer-tree" draggable multiple={true} async={true} selectable={true}
onSelect={this.checkHandler} onSelect={this.checkHandler} onDoubleClick={this.onDoubleClick} selectedKeys={checkedKeys}
onDoubleClick={this.onDoubleClick} onDragStart={this.onDragStart} onDrop={this.onDrop}>
selectedKeys={checkedKeys}>
{this.generateTreeNodes()} {this.generateTreeNodes()}
</Tree> </Tree>
</WeaNewScroll> </WeaNewScroll>

View File

@ -34,7 +34,7 @@ class CustomTransferDialog extends Component {
componentWillReceiveProps(nextProps, nextContext) { componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) { if (nextProps.visible !== this.props.visible && nextProps.visible) {
this.getData(true); this.getData(true, nextProps);
if (nextProps.datas) { if (nextProps.datas) {
this.setState({ this.setState({
leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas) leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas)
@ -49,9 +49,9 @@ class CustomTransferDialog extends Component {
} }
} }
getData = (init = false) => { getData = (init = false, props) => {
const { query } = this.state; const { query } = this.state;
const { completeURL, convertDatasource, dataParams = {} } = this.props; const { completeURL, convertDatasource, dataParams = {} } = props || this.props;
let payload = { ...dataParams, ...query }; let payload = { ...dataParams, ...query };
this.setState({ loading: true }); this.setState({ loading: true });
postFetch(completeURL, payload).then(({ status, data }) => { postFetch(completeURL, payload).then(({ status, data }) => {
@ -188,6 +188,7 @@ class CustomTransferDialog extends Component {
data={rightDatas} checkedKeys={rightCheckedKeys} data={rightDatas} checkedKeys={rightCheckedKeys}
checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })} checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })}
onDoubleClick={this.onRightDoubleClick} onDoubleClick={this.onRightDoubleClick}
onDrag={(data) => {this.setState({rightDatas: data})}}
/> />
</div> </div>
</div> </div>

View File

@ -39,47 +39,33 @@ class PersonalScopeModal extends Component {
} }
componentDidMount() { componentDidMount() {
const { isTaxgent = true } = this.props;
if (isTaxgent) { }
this.getTaxAgentRangeForm();
} else { componentWillReceiveProps(nextProps, nextContext) {
this.commonEnumList(); if (nextProps.visible !== this.props.visible && nextProps.visible) {
// const employeeStatus = [ const { isTaxgent = true } = nextProps;
// { key: "TRIAL", showname: "试用" }, if (isTaxgent) {
// { key: "FORMAL", showname: "正式" }, this.getTaxAgentRangeForm();
// { key: "TEMPORARY", showname: "临时" }, } else {
// { key: "DELAY", showname: "试用延期" }, this.commonEnumList(nextProps);
// { key: "FIRE", showname: "解雇" }, }
// { key: "DEPARTURE", showname: "离职" }, if (!_.isEmpty(nextProps.record)) {
// { key: "RETIRED", showname: "退休" } this.setState({
// ]; targetType: nextProps.record.targetType,
// const targetTypeList = [ targetTypeIds: String(nextProps.record.targetId),
// { targetTypeIdsNames: nextProps.record.targetName,
// key: "EMPLOYEE", status: nextProps.record.status,
// showname: "人员", statusAll: ""
// selected: false });
// }, } else {
// { this.handleReset();
// key: "SUBCOMPANY", }
// showname: "分部",
// selected: false
// },
// {
// key: "DEPT",
// showname: "部门",
// selected: false
// },
// {
// key: "POSITION",
// showname: "岗位",
// selected: false
// }
// ];
// this.setState({ targetTypeList, employeeStatus });
} }
} }
commonEnumList = () => { commonEnumList = (props) => {
const { record } = props;
commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }).then(({ status, data }) => { commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }).then(({ status, data }) => {
if (status) { if (status) {
const targetTypeList = [ const targetTypeList = [
@ -112,6 +98,11 @@ class PersonalScopeModal extends Component {
this.setState({ this.setState({
targetTypeList, targetTypeList,
employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({ key: it.enum, showname: it.defaultLabel })) employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({ key: it.enum, showname: it.defaultLabel }))
}, () => {
if (!_.isEmpty(record)) {
const bool = _.every(_.map(this.state.employeeStatus, it => it.key), item => record.status.split(",").includes(item));
this.setState({ statusAll: bool ? "0" : "" });
}
}); });
} }
}); });
@ -129,7 +120,7 @@ class PersonalScopeModal extends Component {
}; };
handleSubmit = () => { handleSubmit = () => {
const { status, targetTypeIds, targetType } = this.state; const { status, targetTypeIds, targetType } = this.state;
const { includeType, saveKeyVal, onSuccess, onCancel, APISaveFox } = this.props; const { includeType, saveKeyVal, onSuccess, onCancel, APISaveFox, record } = this.props;
if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) {
Modal.warning({ Modal.warning({
title: "信息确认", title: "信息确认",
@ -139,14 +130,14 @@ class PersonalScopeModal extends Component {
} }
const payload = { const payload = {
employeeStatus: status.split(","), employeeStatus: status.split(","),
includeType, includeType, id: record.id,
targetParams: targetType !== "SQL" ? targetParams: targetType !== "SQL" ?
_.map(targetTypeIds.split(","), it => ({ targetType, targetId: it, target: "" })) : _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it, target: "" })) :
[{ targetType, targetId: "0", target: targetTypeIds }], [{ targetType, targetId: "0", target: targetTypeIds }],
[saveKeyVal["key"]]: saveKeyVal["value"] [saveKeyVal["key"]]: saveKeyVal["value"]
}; };
this.setState({ loading: true }); this.setState({ loading: true });
APISaveFox["save"](payload).then(({ status, errormsg }) => { APISaveFox[_.isEmpty(record) ? "save" : "edit"](payload).then(({ status, errormsg }) => {
this.setState({ loading: false }); this.setState({ loading: false });
if (status) { if (status) {
message.success("保存成功"); message.success("保存成功");
@ -159,6 +150,7 @@ class PersonalScopeModal extends Component {
}).catch(() => this.setState({ loading: true })); }).catch(() => this.setState({ loading: true }));
}; };
renderBrowser = () => { renderBrowser = () => {
const { record } = this.props;
const { targetType, targetTypeIds, targetTypeIdsNames } = this.state; const { targetType, targetTypeIds, targetTypeIdsNames } = this.state;
let browserType = {}; let browserType = {};
switch (targetType) { switch (targetType) {
@ -186,9 +178,9 @@ class PersonalScopeModal extends Component {
return <WeaBrowser return <WeaBrowser
{...browserType} {...browserType}
viewAttr={3} viewAttr={3}
isSingle={false} isSingle={!_.isEmpty(record)}
value={targetTypeIds} value={targetTypeIds}
valueSpan={targetTypeIdsNames} replaceDatas={[{ id: targetTypeIds, name: targetTypeIdsNames }]}
inputStyle={{ width: 200 }} inputStyle={{ width: 200 }}
onChange={(targetTypeIds, targetTypeIdsNames) => { onChange={(targetTypeIds, targetTypeIdsNames) => {
this.setState({ targetTypeIds, targetTypeIdsNames }); this.setState({ targetTypeIds, targetTypeIdsNames });
@ -197,7 +189,7 @@ class PersonalScopeModal extends Component {
}; };
handleReset = () => { handleReset = () => {
this.setState({ this.setState({
targetType: "EMPLOYEE", targetType: !_.isEmpty(this.props.record) ? this.props.record.targetType : "EMPLOYEE",
targetTypeIds: "", targetTypeIds: "",
status: "", status: "",
statusAll: "" statusAll: ""
@ -205,7 +197,7 @@ class PersonalScopeModal extends Component {
}; };
render() { render() {
const { onCancel, title, visible } = this.props; const { onCancel, title, visible, record } = this.props;
const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state; const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state;
const buttons = [ const buttons = [
<Button type="primary" onClick={this.handleSubmit} loading={loading}>确定</Button>, <Button type="primary" onClick={this.handleSubmit} loading={loading}>确定</Button>,
@ -233,6 +225,7 @@ class PersonalScopeModal extends Component {
<div style={{ display: "flex", alignItems: "center" }}> <div style={{ display: "flex", alignItems: "center" }}>
<WeaSelect <WeaSelect
style={{ width: 60, marginRight: 12 }} style={{ width: 60, marginRight: 12 }}
disabled={!_.isEmpty(record)}
value={targetType} value={targetType}
options={targetTypeList} options={targetTypeList}
onChange={(targetType) => this.setState({ targetType })} onChange={(targetType) => this.setState({ targetType })}

View File

@ -59,7 +59,10 @@ class PersonalScopeTable extends Component {
columns: _.map(columns, item => { columns: _.map(columns, item => {
return { return {
...item, ...item,
render: (text) => { render: (text, record) => {
if (item.dataIndex === "targetName") {
return <a href="javascript:void(0);" onClick={() => this.props.onEditScope(record)}>{text}</a>;
}
return <span className="tdEllipsis" title={text}>{text}</span>; return <span className="tdEllipsis" title={text}>{text}</span>;
} }
}; };

View File

@ -40,7 +40,7 @@ class Index extends Component {
this.setState({ this.setState({
dataSource: [], columns: [], pageInfo: { current: 0, pageSize: 10, total: 0 }, dataSource: [], columns: [], pageInfo: { current: 0, pageSize: 10, total: 0 },
loading: false loading: false
}); }, () => this.props.baseFormStore.form.resetForm());
} }
} }

View File

@ -59,10 +59,8 @@ import Layout from "./layout";
import CustomRoutes from "./pages/custom-pages"; import CustomRoutes from "./pages/custom-pages";
import stores from "./stores"; import stores from "./stores";
import "./style/index"; import "./style/index";
// 读取系统多语言配置 // 读取系统多语言配置
let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, "hrmSalary"); let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, "hrmSalary");
// 不需要读取系统多语言 // 不需要读取系统多语言
getLocaleLabel = function (nextState, replace, callback) { getLocaleLabel = function (nextState, replace, callback) {
callback(); callback();

View File

@ -1,4 +1,3 @@
import React from "react";
import { WeaLocaleProvider } from "ecCom"; import { WeaLocaleProvider } from "ecCom";
const { getLabel } = WeaLocaleProvider; const { getLabel } = WeaLocaleProvider;
@ -219,3 +218,47 @@ export const salaryDetailSearchConditions = [
col: 2 col: 2
} }
]; ];
export const tempCondition = [
{
items: [
{
conditionType: "INPUT",
domkey: ["name"],
fieldcol: 14,
label: "模板名称",
lanId: 111,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["sharedType"],
fieldcol: 14,
label: "可见性",
lanId: 111,
labelcol: 6,
options: [],
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["limitIds"],
fieldcol: 14,
label: "可见性范围",
lanId: 111,
labelcol: 6,
options: [],
detailtype: 3,
multiple: true,
rules: "",
viewAttr: 1,
hide: true
}
],
title: "",
defaultshow: true
}
];

View File

@ -108,7 +108,7 @@ class EmployeeDetails extends Component {
pagination={pagination} pagination={pagination}
loading={loading} loading={loading}
columns={columns} columns={columns}
scroll={{ y: `calc(100vh - 174px)` }} scroll={{ y: `calc(100vh - 182px)` }}
/> />
); );
} }

View File

@ -5,7 +5,7 @@
* Date: 2023/4/17 * Date: 2023/4/17
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom"; import { WeaAlertPage, WeaLocaleProvider } from "ecCom";
import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd"; import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd";
import { import {
reportStatisticsReportDelete, reportStatisticsReportDelete,
@ -14,7 +14,6 @@ import {
} from "../../../apis/statistics"; } from "../../../apis/statistics";
import "../index.less"; import "../index.less";
const SubMenu = Menu.SubMenu;
const { getLabel } = WeaLocaleProvider; const { getLabel } = WeaLocaleProvider;
class ReportList extends Component { class ReportList extends Component {
@ -87,7 +86,9 @@ class ReportList extends Component {
return ( return (
<Row gutter={16} className="reportRow"> <Row gutter={16} className="reportRow">
{ {
_.isEmpty(dataSource) ? <div className="empty">{getLabel(111, "暂无数据")}</div> : _.isEmpty(dataSource) ? <WeaAlertPage icon="icon-coms-blank" iconSize={100}>
<div>暂无数据</div>
</WeaAlertPage> :
_.map(dataSource, it => { _.map(dataSource, it => {
const { reportName, dimension, id, dimensionId, isShare } = it; const { reportName, dimension, id, dimensionId, isShare } = it;
return <Col className="gutter-row" span={6} onClick={() => this.handleGoReportView(id)}> return <Col className="gutter-row" span={6} onClick={() => this.handleGoReportView(id)}>

View File

@ -5,15 +5,20 @@
* Date: 2024/3/26 * Date: 2024/3/26
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { toJS } from "mobx";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { WeaTableNew } from "comsMobx"; import { WeaTableNew } from "comsMobx";
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import { WeaLoadingGlobal, WeaLocaleProvider, WeaSelect } from "ecCom";
import { message, Spin } from "antd"; import { message, Spin } from "antd";
import { toJS } from "mobx";
import { getIframeParentHeight } from "../../../util"; import { getIframeParentHeight } from "../../../util";
import { sysConfCodeRule } from "../../../apis/ruleconfig"; import { sysConfCodeRule } from "../../../apis/ruleconfig";
import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog"; import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog";
import SalaryDetailsTempDialog from "./salaryDetailsTempDialog";
import { MonthRangePicker } from "../../reportView/components/statisticalMicroSettingsSlide";
import AdvanceInputBtn from "../components/advanceInputBtn";
import SearchPannel from "../components/searchPannel";
import * as API from "../../../apis/statistics"; import * as API from "../../../apis/statistics";
import cs from "classnames";
import "../index.less"; import "../index.less";
const WeaTableComx = WeaTableNew.WeaTable; const WeaTableComx = WeaTableNew.WeaTable;
@ -25,24 +30,32 @@ class SalaryDetails extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
loading: false, dataSource: [], columns: [], selectedRowKeys: [], loading: false, dataSource: [], columns: [], selectedRowKeys: [], tempPageList: [], sumRow: {},
pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "",
showTotalCell: false, updateSum: true, showTotalCell: false, updateSum: true, tempDialog: { visible: false, setting: [], id: "", template: {} },
transferDialog: { transferDialog: {
visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, saveLoading: false, visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, saveLoading: false,
completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", convertDatasource: datas => { completeURL: "", convertDatasource: datas => {
return { return {
listDatas: _.map(datas.setting, o => ({ id: o.id, name: o.name })), listDatas: _.map(datas.setting, o => ({ id: o.id || o.column, name: o.name || o.text })),
checked: this.converCheckedCol(datas) checked: this.converCheckedCol(datas)
}; };
} },
type: "default"
} }
}; };
} }
componentDidMount() { async componentDidMount() {
this.getSalaryList(this.props); const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]);
this.setState({
showTotalCell: confCode === "1"
}, () => {
this.getSalaryList(this.props);
this.getPageListTemplatelist();
});
window.addEventListener("message", this.handleReceive, false); window.addEventListener("message", this.handleReceive, false);
window.addEventListener("resize", () => this.forceUpdate(), false);
} }
componentWillReceiveProps(nextProps, nextContext) { componentWillReceiveProps(nextProps, nextContext) {
@ -53,9 +66,21 @@ class SalaryDetails extends Component {
componentWillUnmount() { componentWillUnmount() {
window.removeEventListener("message", this.handleReceive, false); window.removeEventListener("message", this.handleReceive, false);
window.removeEventListener("message", () => this.forceUpdate(), false);
this.setState(({ selectedRowKeys: [] })); this.setState(({ selectedRowKeys: [] }));
} }
getPageListTemplatelist = () => {
API.getPageListTemplatelist({ page: "salary_details_report" }).then(({ status, data }) => {
if (status) {
this.setState({
tempPageList: _.map(data, o => ({ ...o, key: String(o.id), showname: o.name })),
templateId: !_.isEmpty(_.find(data, o => !!o.checked)) ? String(_.find(data, o => !!o.checked).id) : "",
transferDialog: { ...this.state.transferDialog, visible: false, type: "default" }
});
}
});
};
handleReceive = ({ data }) => { handleReceive = ({ data }) => {
const { type, payload: { id, params } = {} } = data; const { type, payload: { id, params } = {} } = data;
const { pageInfo } = this.state; const { pageInfo } = this.state;
@ -86,7 +111,7 @@ class SalaryDetails extends Component {
const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props || this.props; const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props || this.props;
const [startDateStr, endDateStr] = dateRange; const [startDateStr, endDateStr] = dateRange;
const { taxAgentIds, subcompanyIds, departmentIds, ...extra } = salaryDetailSearchForm.getFormParams(); const { taxAgentIds, subcompanyIds, departmentIds, ...extra } = salaryDetailSearchForm.getFormParams();
const { pageInfo, transferDialog } = this.state; const { pageInfo, transferDialog, updateSum } = this.state;
const payload = { const payload = {
taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [], taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [],
departmentIds: departmentIds ? departmentIds.split(",") : [], departmentIds: departmentIds ? departmentIds.split(",") : [],
@ -94,45 +119,50 @@ class SalaryDetails extends Component {
...extra, ...pageInfo, startDateStr, endDateStr ...extra, ...pageInfo, startDateStr, endDateStr
}; };
this.setState({ loading: true }); this.setState({ loading: true });
API.getSalaryList(payload).then(async ({ status, data }) => { API.getSalaryList(payload).then(({ status, data }) => {
// API.getSalaryListSum(payload), if (updateSum) this.getSalaryListSum(payload);
const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]);
this.setState({ loading: false }); this.setState({ loading: false });
if (status) { if (status) {
const { dataKey, pageInfo: pageparams } = data; const { columns, dataKey, pageInfo: pageparams } = data;
const { list: dataSource, pageNum: current, total, pageSize } = pageparams; const { list: dataSource, pageNum: current, total, pageSize } = pageparams;
this.setState({ this.setState({
dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload, columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload
showTotalCell: confCode === "1", transferDialog: { ...transferDialog, cancel: false }
}, () => tableStore.getDatas(dataKey.datas)); }, () => tableStore.getDatas(dataKey.datas));
} }
}).catch(() => this.setState({ loading: false })); }).catch(() => this.setState({ loading: false }));
}; };
getSalaryListSum = (payload) => {
API.getSalaryListSum(payload).then(({ status, data }) => {
if (status) this.setState({ sumRow: data.sumRow });
});
};
handleExportSalaryList = (key) => { handleExportSalaryList = (key) => {
const { attendanceStore: { tableStore } } = this.props; const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
let { selectedRowKeys, payload } = this.state; 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;
if (key === "SELECTED" && selectedRowKeys.length === 0) { if (key === "SELECTED" && selectedRowKeys.length === 0) {
message.warning(getLabel(543345, "请选择需要导出的数据!")); message.warning(getLabel(543345, "请选择需要导出的数据!"));
return; return;
} }
WeaLoadingGlobal.start(); WeaLoadingGlobal.start();
const promise = API.exportSalaryList({ const promise = API.exportSalaryList({
...payload, ids: key === "SELECTED" ? selectedRowKeys : [], ...payload, ids: key === "SELECTED" ? selectedRowKeys : [], columns: _.map(columns, o => o.column || o.dataIndex)
columns: _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"), o => o.dataIndex)
}); });
}; };
getColumns = () => { getColumns = () => {
const { attendanceStore: { tableStore } } = this.props; const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum, transferDialog } = this.state; const {
const columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRow, transferDialog
const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : ""; } = this.state;
if (!_.isEmpty(columns) && !transferDialog.visible && !transferDialog.cancel) { const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
if (!_.isEmpty(columns)) {
this.postMessageToChild({ this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRow,
sumRowlistUrl, payload: { ...payload, updateSum },
columns: _.map(columns, (it, idx) => ({ columns: _.map(columns, (it, idx) => ({
...it, dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true,
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.oldWidth, width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : (it.width || it.oldWidth),
fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "", fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
ellipsis: true ellipsis: true
})) }))
@ -140,15 +170,27 @@ class SalaryDetails extends Component {
} }
return []; return [];
}; };
handleSetDefCols = () => this.setState({ transferDialog: { ...this.state.transferDialog, visible: true } }); handleSetDefCols = () => this.setState({
transferDialog: {
...this.state.transferDialog, completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", visible: true,
dataParams: { page: "salary_details_report" }
}
});
converCheckedCol = (data) => { converCheckedCol = (data) => {
return _.reduce(data.checked, (pre, cur) => { return _.reduce(data.checked || [], (pre, cur) => {
const item = _.find(data.setting, k => k.id === cur); const item = _.find(data.setting, k => (k.id === cur) || (k.column === cur.column));
if (!_.isEmpty(item)) return [...pre, item]; if (!_.isEmpty(item)) return [...pre, { ...item, id: item.id || item.column, name: item.name || item.text }];
return pre; return pre;
}, []); }, []);
}; };
savePageListSetting = (values) => { savePageListSetting = (values) => {
const { transferDialog, tempDialog } = this.state, { type } = transferDialog;
if (type === "temp") {
this.setState({
tempDialog: { ...tempDialog, visible: true, setting: _.map(values, o => o.id) }
});
return;
}
const payload = { const payload = {
page: "salary_details_report", page: "salary_details_report",
setting: _.map(values, o => o.id) setting: _.map(values, o => o.id)
@ -158,39 +200,99 @@ class SalaryDetails extends Component {
this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: false } }); this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: false } });
if (status) { if (status) {
message.success(getLabel(111, "操作成功!")); message.success(getLabel(111, "操作成功!"));
this.setState({ transferDialog: { ...this.state.transferDialog, visible: false } }, () => this.getSalaryList()); this.setState({
transferDialog: { ...this.state.transferDialog, visible: false, type: "default" }
}, () => this.getSalaryList());
} else { } else {
message.error(errormsg); message.error(errormsg);
} }
}); });
}; };
handelAddTemp = (templateId) => {
const { transferDialog, tempDialog, tempPageList } = this.state;
this.setState({
transferDialog: {
...transferDialog, visible: true, type: "temp",
dataParams: { ...transferDialog.dataParams, id: templateId },
completeURL: "/api/bs/hrmsalary/common/pageList/template/get"
},
tempDialog: { ...tempDialog, id: templateId, template: _.find(tempPageList, o => o.key === templateId) }
});
};
changePageListTemplate = (templateId) => {
this.setState({ templateId }, () => {
API.changePageListTemplate({ page: "salary_details_report", templateId }).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.getSalaryList();
} else {
message.error(errormsg);
}
});
});
};
render() { render() {
const { loading, dataSource, transferDialog } = this.state; const { loading, dataSource, transferDialog, tempDialog, tempPageList, templateId } = this.state;
const { attendanceStore: { tableStore } } = this.props; const { attendanceStore: { tableStore }, dateRange, showSearchAd, salaryDetailShowType } = this.props;
return ( return (<React.Fragment>
<div className="table-layout" <div className="query-div">
style={{ height: getIframeParentHeight(".wea-new-top-req-content", dataSource.length, 0) + "px" }}> {
<Spin spinning={loading}> salaryDetailShowType === "1" &&
<iframe <div className="custom-select">
style={{ border: 0, width: "100%", height: "100%" }} <WeaSelect style={{ width: 200 }} hasAddBtn options={tempPageList} addOnClick={this.handelAddTemp}
// src="http://localhost:7607/#/calcTable" showSearch optionFilterProp="children" value={templateId}
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable" onChange={this.changePageListTemplate}/>
id="atdTable" {
templateId &&
<span className="custom-select-edit" title={getLabel(111, "编辑模板")}
onClick={() => this.handelAddTemp(templateId)}>
<i className="icon-coms-BatchEditing-Hot"></i>
</span>
}
</div>
}
<MonthRangePicker dateRange={dateRange} viewAttr={2} onChange={this.props.onChange}/>
<AdvanceInputBtn onOpenAdvanceSearch={this.props.handleOpenAdvanceSearch}
onAdvanceSearch={this.props.handleAdvanceSearch}/>
</div>
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
<SearchPannel onCancel={this.props.onCancel} onAdSearch={this.props.onAdSearch}/>
</div>
<div className="table-layout"
style={{ height: getIframeParentHeight(".wea-new-top-req-content", dataSource.length, 70) + "px" }}>
<Spin spinning={loading}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/calcTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable"
id="atdTable"
/>
</Spin>
<WeaTableComx
style={{ display: "none" }}
comsWeaTableStore={tableStore}
needScroll={true}
columns={this.getColumns()}
/> />
</Spin> {/*默认显示列,薪资模板列表*/}
<WeaTableComx <CustomTransferDialog {...transferDialog} onChange={this.savePageListSetting}
style={{ display: "none" }} onCancel={() => this.setState({
comsWeaTableStore={tableStore} transferDialog: {
needScroll={true} ...transferDialog, completeURL: "", visible: false, type: "default"
columns={this.getColumns()} }
/> })}/>
{/*默认显示列*/} {/*薪资明细模板设置*/}
<CustomTransferDialog {...transferDialog} onChange={this.savePageListSetting} <SalaryDetailsTempDialog {...tempDialog}
onCancel={() => this.setState({ onCancel={callback => this.setState({
transferDialog: { ...transferDialog, visible: false, cancel: true } tempDialog: { ...tempDialog, visible: false, setting: [] }
})}/> }, () => callback && callback())}
</div> onSuccess={() => {
this.getPageListTemplatelist();
this.getSalaryList();
}}/>
</div>
</React.Fragment>
); );
} }
} }

View File

@ -0,0 +1,127 @@
/*
* 薪酬统计分析-薪资明细
* 列表模板设置
* @Author: 黎永顺
* @Date: 2024/11/7
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
import { tempCondition } from "./conditions";
import { getTaxAgentSelectList } from "../../../apis/taxAgent";
import * as API from "../../../apis/statistics";
import { Button, message } from "antd";
import { getSearchs } from "../../../util";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("attendanceStore")
@observer
class SalaryDetailTempDialog extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, conditions: []
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTempForm(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
this.setState({ loading: false, conditions: [] }, () => nextProps.attendanceStore.initTempForm());
}
}
getTempForm = (props) => {
getTaxAgentSelectList().then(({ status, data }) => {
if (status) {
const { id, template } = props;
this.setState({
conditions: _.map(tempCondition, item => ({
...item, items: _.map(item.items, o => {
if (getKey(o) === "sharedType") {
return {
...o, label: getLabel(o.lanId, o.label), value: id ? String(template["sharedType"]) : "0",
options: [
{ key: "0", showname: getLabel(111, "公共") },
{ key: "1", showname: getLabel(111, "私有") }
]
};
} else if (getKey(o) === "limitIds") {
return {
...o, label: getLabel(o.lanId, o.label), hide: !id || (id && template["sharedType"] === 0),
value: id ? template["limitIds"].join(",") : "",
options: _.map(data, o => ({ key: o.id, showname: o.content }))
};
}
return { ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "" };
})
}))
}, () => {
const { attendanceStore: { tempForm } } = props;
tempForm.initFormFields(this.state.conditions);
});
}
});
};
save = () => {
const { attendanceStore: { tempForm }, setting, id } = this.props;
tempForm.validateForm().then(f => {
if (f.isValid) {
this.setState({ loading: true });
const { limitIds, ...formVal } = tempForm.getFormParams();
const payload = {
page: "salary_details_report", setting, id, ...formVal,
limitIds: !_.isEmpty(limitIds) ? limitIds.split(",") : []
};
API.savePageListTemplate(payload).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess());
} else {
message.error(errormsg);
}
});
} else {
f.showErrors();
}
}).catch(() => this.setState({ loading: false }));
};
formFieldChange = (field) => {
const key = Object.keys(field)[0], value = field[key].value;
this.setState({
conditions: _.map(this.state.conditions, item => ({
...item, items: _.map(item.items, o => {
if (key === "sharedType" && getKey(o) === "limitIds") {
return {
...o, hide: value !== "1", viewAttr: value === "1" ? 3 : 1,
rules: value === "1" ? "required|string" : ""
};
}
return { ...o };
})
}))
}, () => {
const { attendanceStore: { tempForm } } = this.props;
tempForm.initFormFields(this.state.conditions);
});
};
render() {
const { loading, conditions } = this.state;
const { attendanceStore: { tempForm } } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 480, height: 127 }} initLoadCss title={getLabel(111, "模板保存")}
buttons={[<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>]}>
<div className="form-dialog-layout">{getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}</div>
</WeaDialog>
);
}
}
export default SalaryDetailTempDialog;

View File

@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react";
import { WeaDatePicker, WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom"; import { WeaDatePicker, WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom";
import { Button, Dropdown, Menu } from "antd"; import { Button, Dropdown, Menu } from "antd";
import { condition, reportCondition } from "./components/conditions"; import { condition, reportCondition } from "./components/conditions";
import { commonEnumList, reportGetForm } from "../../apis/ruleconfig"; import { commonEnumList, reportGetForm, sysinfo } from "../../apis/ruleconfig";
import { dimensionGetForm } from "../../apis/statistics"; import { dimensionGetForm } from "../../apis/statistics";
import EmployeeDetails from "./components/employeeDetails"; import EmployeeDetails from "./components/employeeDetails";
import SalaryDetails from "./components/salaryDetails"; import SalaryDetails from "./components/salaryDetails";
@ -19,11 +19,7 @@ import DimensionTable from "./components/dimensionTable";
import ReportList from "./components/reportList"; import ReportList from "./components/reportList";
import ReportForm from "./components/reportForm"; import ReportForm from "./components/reportForm";
import LogDialog from "../../components/logViewModal"; import LogDialog from "../../components/logViewModal";
import { MonthRangePicker } from "../reportView/components/statisticalMicroSettingsSlide";
import AdvanceInputBtn from "./components/advanceInputBtn";
import SearchPannel from "./components/searchPannel";
import moment from "moment"; import moment from "moment";
import cs from "classnames";
import "./index.less"; import "./index.less";
const { getLabel } = WeaLocaleProvider; const { getLabel } = WeaLocaleProvider;
@ -54,12 +50,16 @@ class Index extends Component {
title: "", visible: false, title: "", visible: false,
typeKey: "", id: "" typeKey: "", id: ""
}, },
logDialogVisible: false, filterConditions: "[]" logDialogVisible: false, filterConditions: "[]",
salaryDetailShowType: "0" //薪资明细列表显示方式
}; };
} }
componentDidMount() { componentDidMount() {
this.initReportFormCondition(); this.initReportFormCondition();
sysinfo().then(({ status, data }) => {
if (status) this.setState({ salaryDetailShowType: data.SALARY_DETAILS_REPORT_SHOW_TYPE });
});
} }
initReportFormCondition = (payload = {}) => { initReportFormCondition = (payload = {}) => {
@ -281,7 +281,7 @@ class Index extends Component {
const { const {
selectedKey, modalReq, slideReq, conditions, reportConditions, selectedKey, modalReq, slideReq, conditions, reportConditions,
reportName, keyword, year, logDialogVisible, filterConditions, reportName, keyword, year, logDialogVisible, filterConditions,
dateRange, showSearchAd, isQuery dateRange, showSearchAd, isQuery, salaryDetailShowType
} = this.state; } = this.state;
const statisticsReportBtn = PageAndOptAuth.opts.includes("admin"); const statisticsReportBtn = PageAndOptAuth.opts.includes("admin");
const buttons = selectedKey === "statistics" ? [ const buttons = selectedKey === "statistics" ? [
@ -308,11 +308,7 @@ class Index extends Component {
onClick={({ key }) => this.handleExportSalaryList(key)}> onClick={({ key }) => this.handleExportSalaryList(key)}>
<Menu.Item <Menu.Item
key="SELECTED">{getLabel(543715, "导出所选")}</Menu.Item> key="SELECTED">{getLabel(543715, "导出所选")}</Menu.Item>
</Menu>}>{getLabel(81272, "")}</Dropdown.Button>, </Menu>}>{getLabel(81272, "")}</Dropdown.Button>
<MonthRangePicker dateRange={dateRange} viewAttr={2}
onChange={v => this.setState({ dateRange: v }, () => this.handleAdvanceSearch())}/>,
<AdvanceInputBtn onOpenAdvanceSearch={this.handleOpenAdvanceSearch}
onAdvanceSearch={this.handleAdvanceSearch}/>
]; ];
let dropMenuDatas = [ let dropMenuDatas = [
{ {
@ -345,11 +341,8 @@ class Index extends Component {
iconBgcolor="#F14A2D" tabDatas={tabs} className="xc_tj_fx_wrapper" iconBgcolor="#F14A2D" tabDatas={tabs} className="xc_tj_fx_wrapper"
buttons={(!statisticsReportBtn && selectedKey === "statistics") ? buttons.slice(-1) : buttons} buttonSpace={10} buttons={(!statisticsReportBtn && selectedKey === "statistics") ? buttons.slice(-1) : buttons} buttonSpace={10}
onChange={selectedKey => this.setState({ selectedKey }, () => this.state.selectedKey === "statistics" && this.initReportFormCondition())} onChange={selectedKey => this.setState({ selectedKey }, () => this.state.selectedKey === "statistics" && this.initReportFormCondition())}
showDropIcon={selectedKey !== "detail"} onDropMenuClick={this.onDropMenuClick} showDropIcon={(selectedKey === "statistics") || (selectedKey === "salaryDetail" && salaryDetailShowType !== "1")}
dropMenuDatas={dropMenuDatas}> onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}>
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
<SearchPannel onCancel={() => this.setState({ showSearchAd: false })} onAdSearch={this.onAdSearch}/>
</div>
{ {
selectedKey === "statistics" ? selectedKey === "statistics" ?
<ReportList <ReportList
@ -361,7 +354,12 @@ class Index extends Component {
ref={dom => this.employeeListRef = dom} ref={dom => this.employeeListRef = dom}
keyword={keyword} year={year} keyword={keyword} year={year}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)} onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
/> : <SalaryDetails ref={dom => this.salaryRef = dom} dateRange={dateRange} isQuery={isQuery}/> /> : <SalaryDetails ref={dom => this.salaryRef = dom} dateRange={dateRange} isQuery={isQuery}
salaryDetailShowType={salaryDetailShowType}
showSearchAd={showSearchAd} handleOpenAdvanceSearch={this.handleOpenAdvanceSearch}
handleAdvanceSearch={this.handleAdvanceSearch} onAdSearch={this.onAdSearch}
onCancel={() => this.setState({ showSearchAd: false })}
onChange={v => this.setState({ dateRange: v }, () => this.handleAdvanceSearch())}/>
} }
<StatisticsModal {...modalReq} onCancel={this.handleCancel} form={reportForm} onClose={this.handleCancel} <StatisticsModal {...modalReq} onCancel={this.handleCancel} form={reportForm} onClose={this.handleCancel}
onAddDimension={this.handleAddDimension} onAddDimension={this.handleAddDimension}

View File

@ -5,6 +5,10 @@
width: 220px; width: 220px;
} }
.ant-btn-group {
margin-right: 10px;
}
.employeeYearWrapper { .employeeYearWrapper {
display: flex; display: flex;
align-items: center; align-items: center;
@ -15,7 +19,7 @@
} }
.wea-new-top-req-content { .wea-new-top-req-content {
padding: 16px; padding: 8px 16px;
.wea-new-table { .wea-new-table {
background: #FFF; background: #FFF;
@ -158,11 +162,8 @@
} }
} }
.empty { .wea-alert-page-con {
font-size: 16px; padding-top: 100px;
width: 100%;
text-align: center;
margin-top: 26px;
} }
} }
@ -210,6 +211,42 @@
} }
} }
.query-div {
display: flex;
align-items: center;
justify-content: flex-end;
height: 46px;
background: #FFF;
margin-bottom: 8px;
padding: 0 8px;
.custom-select {
display: flex;
align-content: center;
position: relative;
.custom-select-edit {
position: absolute;
right: -56px;
cursor: pointer;
display: inline-block;
vertical-align: middle;
background-color: #f4f4f4;
color: #b2b2b2;
border: 1px solid #d9d9d9;
border-left: none;
width: 28px;
height: 30px;
line-height: 28px;
text-align: center;
}
}
.rangePickerBox {
margin: 0 10px 0 68px;
}
}
.table-layout { .table-layout {
.ant-spin-nested-loading, .ant-spin-container { .ant-spin-nested-loading, .ant-spin-container {
height: 100%; height: 100%;

View File

@ -79,6 +79,7 @@ class Index extends Component {
renderTabBtns = () => { renderTabBtns = () => {
const { selectedKey, selectedRowKeys } = this.state; const { selectedKey, selectedRowKeys } = this.state;
const { calcDetail } = this.props;
let tabBtns = []; let tabBtns = [];
switch (selectedKey) { switch (selectedKey) {
case "range": case "range":
@ -95,6 +96,7 @@ class Index extends Component {
className="icon-coms-Refresh"/></span>, className="icon-coms-Refresh"/></span>,
<Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button> <Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button>
]; ];
calcDetail && tabBtns.splice(0, 2);
break; break;
case "add": case "add":
case "sub": case "sub":
@ -202,7 +204,7 @@ class Index extends Component {
}; };
render() { render() {
const { calculateStore: { PCSearchForm } } = this.props; const { calculateStore: { PCSearchForm }, calcDetail } = this.props;
const { const {
selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys, selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys,
columns, dataSource columns, dataSource
@ -280,8 +282,8 @@ class Index extends Component {
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
/> />
<WeaTable <WeaTable
dataSource={dataSource} loading={loading} rowSelection={rowSelection} pagination={pagination} dataSource={dataSource} loading={loading} rowSelection={calcDetail ? null : rowSelection}
scroll={{ y: `calc(100vh - 365px)` }} rowKey="id" pagination={pagination} scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
columns={[..._.map(columns, item => { columns={[..._.map(columns, item => {
let width = ""; let width = "";
const { dataIndex } = item; const { dataIndex } = item;
@ -300,9 +302,10 @@ class Index extends Component {
dataIndex: "operate", dataIndex: "operate",
title: getLabel(30585, "操作"), title: getLabel(30585, "操作"),
width: 120, width: 120,
render: (_, record) => ( render: (_, record) => (<React.Fragment>
<a href="javascript:void(0);" {calcDetail ? null : <a href="javascript:void(0);"
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a> onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>}
</React.Fragment>
) )
} }
]} ]}

View File

@ -332,7 +332,7 @@ const traverse = (arr, calcDetail) => {
return _.map(arr, item => { return _.map(arr, item => {
if (!_.isEmpty(item.children)) { if (!_.isEmpty(item.children)) {
return { return {
title: item.text, width: item.width + "px", ellipsis: true, title: item.text, width: item.width + "px", ellipsis: true, calcDetail,
dataIndex: item.column, children: traverse(item.children, calcDetail), dataIndex: item.column, children: traverse(item.children, calcDetail),
fixed: item.fixed || false, dataType: item.dataType, align: "center" fixed: item.fixed || false, dataType: item.dataType, align: "center"
}; };

View File

@ -12,7 +12,7 @@ const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component { class Index extends Component {
render() { render() {
const { attendCycle, salaryCycle, salaryMonth, socialSecurityCycle } = this.props; const { attendCycle, salaryCycle, taxCycle, salaryMonth, socialSecurityCycle } = this.props;
const { fromDate: attendFromDate, endDate: attendEndDate } = attendCycle, const { fromDate: attendFromDate, endDate: attendEndDate } = attendCycle,
{ fromDate: salaryFromDate, endDate: salaryEndDate } = salaryCycle; { fromDate: salaryFromDate, endDate: salaryEndDate } = salaryCycle;
return ( return (
@ -23,7 +23,7 @@ class Index extends Component {
</div> </div>
<div className="line"> <div className="line">
<div className="lable">{getLabel(542240, "税款所属期")}</div> <div className="lable">{getLabel(542240, "税款所属期")}</div>
<div className="value">{salaryMonth}</div> <div className="value">{taxCycle || salaryMonth}</div>
</div> </div>
<div className="line"> <div className="line">
<div className="lable">{getLabel(543475, "考勤取值周期")}</div> <div className="lable">{getLabel(543475, "考勤取值周期")}</div>

View File

@ -9,7 +9,12 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom";
import { Button, Dropdown, Menu, message, Modal } from "antd"; import { Button, Dropdown, Menu, message, Modal } from "antd";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import Layout from "./layout"; import Layout from "./layout";
import { acctresultAccounting, getCalculateProgress, getExportField } from "../../../apis/calculate"; import {
acctresultAccounting,
getApprovalInfoByRecordId,
getCalculateProgress,
getExportField
} from "../../../apis/calculate";
import AdvanceInputBtn from "./components/advanceInputBtn"; import AdvanceInputBtn from "./components/advanceInputBtn";
import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm"; import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm";
import SalaryEditCalc from "./components/salaryEditCalc"; import SalaryEditCalc from "./components/salaryEditCalc";
@ -30,6 +35,7 @@ class Index extends Component {
selectedKey: "person", progressVisible: false, progress: 0, selectedKey: "person", progressVisible: false, progress: 0,
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }, customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" },
approvalInfo: {},//审批信息,
accountExceptInfo: "" //核算报错信息, accountExceptInfo: "" //核算报错信息,
}; };
@ -37,6 +43,12 @@ class Index extends Component {
this.timer = null; this.timer = null;
} }
init = () => {
const { routeParams: { salaryAcctRecordId } } = this.props;
getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => {
if (status) this.setState({ approvalInfo });
});
};
handleMenuClick = ({ key }) => { handleMenuClick = ({ key }) => {
switch (key) { switch (key) {
case "calc_selected": case "calc_selected":
@ -139,7 +151,9 @@ class Index extends Component {
} }
}; };
renderReqBtns = () => { renderReqBtns = () => {
const { selectedKey, accountExceptInfo } = this.state; const { routeParams: { salaryAcctRecordId } } = this.props;
const { selectedKey, accountExceptInfo, approvalInfo } = this.state;
const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo;
let reqBtns = []; let reqBtns = [];
switch (selectedKey) { switch (selectedKey) {
case "calc": case "calc":
@ -150,7 +164,7 @@ class Index extends Component {
); );
const moreMenu = ( const moreMenu = (
<Menu onClick={this.handleMoreMenuClick}> <Menu onClick={this.handleMoreMenuClick}>
<Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item> {canEdit && <Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>}
<Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item> <Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item>
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item> <Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
<Menu.Item key="offlineCompare">{getLabel(543249, "线下对比")}</Menu.Item> <Menu.Item key="offlineCompare">{getLabel(543249, "线下对比")}</Menu.Item>
@ -166,6 +180,10 @@ class Index extends Component {
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calc.openAdvanceSearch()} <AdvanceInputBtn onOpenAdvanceSearch={() => this.calc.openAdvanceSearch()}
onAdvanceSearch={() => this.calc.onAdSearch(false)}/> onAdvanceSearch={() => this.calc.onAdSearch(false)}/>
]; ];
!canEdit && reqBtns.splice(0, 1);
isOpenApproval && reqBtns.unshift(<Button type="ghost" onClick={() => {
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
}}>{getLabel(111, "发起审批")}</Button>);
accountExceptInfo && reqBtns.unshift(<i className="iconfont icon-jinggao" accountExceptInfo && reqBtns.unshift(<i className="iconfont icon-jinggao"
title={getLabel(111, "存在异常信息,点击下载!")} title={getLabel(111, "存在异常信息,点击下载!")}
onClick={() => this.downloadTxtfile(accountExceptInfo)}/>); onClick={() => this.downloadTxtfile(accountExceptInfo)}/>);
@ -184,14 +202,15 @@ class Index extends Component {
element.click(); element.click();
}; };
renderContent = () => { renderContent = () => {
const { selectedKey } = this.state; const { selectedKey, approvalInfo } = this.state;
const { canEdit } = approvalInfo;
let dom = null; let dom = null;
switch (selectedKey) { switch (selectedKey) {
case "person": case "person":
dom = <SalaryCalcPersonConfirm {...this.props}/>; dom = <SalaryCalcPersonConfirm calcDetail={!canEdit} {...this.props}/>;
break; break;
case "calc": case "calc":
dom = <SalaryEditCalc {...this.props} ref={dom => this.calc = dom}/>; dom = <SalaryEditCalc {...this.props} calcDetail={!canEdit} ref={dom => this.calc = dom}/>;
break; break;
default: default:
break; break;
@ -207,7 +226,7 @@ class Index extends Component {
const { calculateStore: { setOtherConditions } } = this.props; const { calculateStore: { setOtherConditions } } = this.props;
const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state; const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state;
return ( return (
<Layout {...this.props}> <Layout {...this.props} init={this.init}>
<div className="salary-calculate-do-calc"> <div className="salary-calculate-do-calc">
<WeaReqTop <WeaReqTop
title={getLabel(538011, "薪资核算")} tabDatas={tabs} selectedKey={selectedKey} title={getLabel(538011, "薪资核算")} tabDatas={tabs} selectedKey={selectedKey}

View File

@ -61,8 +61,8 @@ class AddItems extends Component {
render() { render() {
const { form, condition = [] } = this.props; const { form, condition = [] } = this.props;
return ( return (
<div className="addItemsWrapper"> <div className="addItemsWrapper form-dialog-layout">
{getSearchs(form, condition)} {getSearchs(form, condition, 2, false)}
<Tips><span>若此员工数据已存在在同期列表中则当前数据保存后会覆盖列表数据</span></Tips> <Tips><span>若此员工数据已存在在同期列表中则当前数据保存后会覆盖列表数据</span></Tips>
</div> </div>
); );

View File

@ -4,7 +4,15 @@
flex-direction: column; flex-direction: column;
.wea-form-item { .wea-form-item {
padding: 8px 16px 0 16px; height: 46px;
line-height: 46px;
background: #FFF;
margin: 8px 16px 0 16px;
.wea-form-item-label {
line-height: 46px !important;
padding-left: 8px !important;
}
.to { .to {
padding: 0 10px padding: 0 10px
@ -15,7 +23,7 @@
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
background: #FFF; background: #FFF;
margin: 16px; margin: 8px 16px;
} }
.linkWapper { .linkWapper {

View File

@ -1,13 +1,41 @@
.tableRecordWrapper { .tableRecordWrapper {
padding: 0 16px;
.form-dialog-layout {
padding: 0 !important;
.wea-search-group {
padding: 16px 0 !important;
}
}
.wea-form-cell-wrapper {
& > div:first-child {
height: 47px !important;
line-height: 47px;
}
& > div:last-child {
.wea-form-item-wrapper {
display: flex !important;
align-items: center;
.to {
padding: 0 10px;
}
}
}
}
.accumulated { .accumulated {
.wea-form-cell-wrapper { .wea-form-cell-wrapper {
& > div:first-child { & > div:first-child {
height: 46px !important; height: 47px !important;
line-height: 46px; line-height: 47px;
} }
& > div:nth-child(2) { & > div:nth-child(2) {
//width: 40% !important;
.wea-form-item-wrapper { .wea-form-item-wrapper {
display: flex !important; display: flex !important;
@ -18,10 +46,6 @@
} }
} }
} }
& > div:last-child {
//width: 40% !important;
}
} }
} }
} }

View File

@ -5,8 +5,7 @@
* Date: 2023/2/20 * Date: 2023/2/20
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { WeaSearchGroup } from "ecCom"; import { WeaSearchGroup, WeaTable } from "ecCom";
import UnifiedTable from "../../../components/UnifiedTable";
import { getTableRecordDate } from "../../../apis/cumDeduct"; import { getTableRecordDate } from "../../../apis/cumDeduct";
import { DataCollectionDateRangePick, DataCollectionSelect, Input } from "../cumDeduct"; import { DataCollectionDateRangePick, DataCollectionSelect, Input } from "../cumDeduct";
import "./index.less"; import "./index.less";
@ -87,9 +86,22 @@ class TableRecord extends Component {
if (status) { if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data; const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({ this.setState({
pageInfo: { ...pageInfo, current, pageSize, total }, pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
dataSource, columns: _.map(columns, (o, i) => {
columns let col = {
...o, width: 110,
render: text => (<span className="dataAc-ellipsis" title={text}>{text}</span>)
};
switch (o.dataIndex) {
case "taxAgentName":
col = { ...col, width: 180 };
break;
default:
col = { ...col };
break;
}
return i === 0 ? { ...col, fixed: "left" } : col;
})
}); });
} }
}).catch(() => this.setState({ loading: { ...loading, query: false } })); }).catch(() => this.setState({ loading: { ...loading, query: false } }));
@ -161,14 +173,6 @@ class TableRecord extends Component {
{ {
com: Input({ value: record.username }) com: Input({ value: record.username })
}, },
{
com: DataCollectionDateRangePick({
label: "税款所属期",
range: recordPayload[screenParams[screenParams.length - 1]] || [],
onChange: this.handleTablerecordScreen,
key: screenParams[screenParams.length - 1]
})
},
{ {
com: DataCollectionSelect({ com: DataCollectionSelect({
label: "个税扣缴义务人", label: "个税扣缴义务人",
@ -177,28 +181,26 @@ class TableRecord extends Component {
onChange: this.handleTablerecordScreen, onChange: this.handleTablerecordScreen,
key: "taxAgentId" key: "taxAgentId"
}) })
},
{
com: DataCollectionDateRangePick({
label: "税款所属期",
range: recordPayload[screenParams[screenParams.length - 1]] || [],
onChange: this.handleTablerecordScreen,
key: screenParams[screenParams.length - 1]
})
} }
]; ];
return ( return (
<div className="tableRecordWrapper"> <div className="tableRecordWrapper">
{ {
!_.isEmpty(screenParams) && !_.isEmpty(screenParams) &&
<WeaSearchGroup className={className} showGroup needTigger={false} items={items} col={width > 1280 ? 3 : 2}/> <div className="form-dialog-layout">
<WeaSearchGroup className={className} showGroup needTigger={false} items={items} col={2}/>
</div>
} }
<UnifiedTable <WeaTable rowKey="id" rowSelection={rowSelection} bordered dataSource={dataSource} pagination={pagination}
rowKey="id" loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 310px)` }} columns={columns}/>
rowSelection={rowSelection}
columns={_.map(columns, item => ({
...item,
render: (text) => {
return <span className="ellipsis" title={text}> {text} </span>;
}
}))}
dataSource={dataSource}
pagination={pagination}
loading={loading.query}
xWidth={columns.length * 180}
/>
</div> </div>
); );
} }

View File

@ -1,400 +1,3 @@
export const columns = [
{
title: "姓名",
dataIndex: "title",
key: "title"
},
{
title: "个税扣缴义务人",
dataIndex: "title",
key: "title"
},
{
title: "部门",
dataIndex: "title",
key: "title"
},
{
title: "手机号",
dataIndex: "title",
key: "title"
},
{
title: "工号",
dataIndex: "title",
key: "title"
},
{
title: "证件号码",
dataIndex: "title",
key: "title"
},
{
title: "入职日期",
dataIndex: "title",
key: "title"
},
{
title: "累计子女教育",
dataIndex: "title",
key: "title"
},
{
title: "累计继续教育",
dataIndex: "title",
key: "title"
},
{
title: "累计住房贷款利息",
dataIndex: "title",
key: "title"
},
{
title: "累计住房租金",
dataIndex: "title",
key: "title"
},
{
title: "累计赡养老人",
dataIndex: "title",
key: "title"
},
{
title: "操作",
dataIndex: "title",
key: "title"
}
];
export const modalColumns = [
{
title: "姓名",
dataIndex: "username",
key: "username"
},
{
title: "个税扣缴义务人",
dataIndex: "taxAgentName",
key: "taxAgentName"
},
{
title: "部门",
dataIndex: "departmentName",
key: "departmentName"
},
{
title: "手机号",
dataIndex: "mobile",
key: "mobile"
},
{
title: "工号",
dataIndex: "jobNum",
key: "jobNum"
},
{
title: "证件号码",
dataIndex: "idNo",
key: "idNo"
},
{
title: "入职日期",
dataIndex: "hiredate",
key: "hiredate"
},
{
title: "累计子女教育",
dataIndex: "addUpChildEducation",
key: "addUpChildEducation"
},
{
title: "累计继续教育",
dataIndex: "addUpContinuingEducation",
key: "addUpContinuingEducation"
},
{
title: "累计住房贷款利息",
dataIndex: "addUpHousingLoanInterest",
key: "addUpHousingLoanInterest"
},
{
title: "累计住房租金",
dataIndex: "addUpHousingRent",
key: "addUpHousingRent"
},
{
title: "累计赡养老人",
dataIndex: "addUpSupportElderly",
key: "addUpSupportElderly"
},
{
title: "累计婴幼儿照护",
dataIndex: "addUpInfantCare",
key: "addUpInfantCare"
},
{
title: "累计大病医疗",
dataIndex: "addUpIllnessMedical",
key: "addUpIllnessMedical"
}
];
export const specialModalColumns = [
{
title: "姓名",
dataIndex: "username",
key: "username"
},
{
title: "个税扣缴义务人",
dataIndex: "taxAgentName",
key: "taxAgentName"
},
{
title: "部门",
dataIndex: "departmentName",
key: "departmentName"
},
{
title: "手机号",
dataIndex: "mobile",
key: "mobile"
},
{
title: "工号",
dataIndex: "jobNum",
key: "jobNum"
},
{
title: "证件号码",
dataIndex: "idNo",
key: "idNo"
},
{
title: "入职日期",
dataIndex: "hiredate",
key: "hiredate"
},
{
title: "子女教育",
dataIndex: "childrenEducation",
key: "childrenEducation"
},
{
title: "继续教育",
dataIndex: "continuingEducation",
key: "continuingEducation"
},
{
title: "住房贷款利息",
dataIndex: "housingLoanInterest",
key: "housingLoanInterest"
},
{
title: "住房租金",
dataIndex: "housingRent",
key: "housingRent"
},
{
title: "赡养老人",
dataIndex: "supportingElder",
key: "supportingElder"
},
{
title: "婴幼儿照护",
dataIndex: "infantCare",
key: "infantCare"
},
{
title: "大病医疗",
dataIndex: "seriousIllnessTreatment",
key: "seriousIllnessTreatment"
}
];
export const otherModalColumns = [
{
title: "姓名",
dataIndex: "username",
key: "username"
},
{
title: "个税扣缴义务人",
dataIndex: "taxAgentName",
key: "taxAgentName"
},
{
title: "部门",
dataIndex: "departmentName",
key: "departmentName"
},
{
title: "手机号",
dataIndex: "mobile",
key: "mobile"
},
{
title: "工号",
dataIndex: "jobNum",
key: "jobNum"
},
{
title: "证件号码",
dataIndex: "idNo",
key: "idNo"
},
{
title: "入职日期",
dataIndex: "hiredate",
key: "hiredate"
},
{
title: "商业健康保险",
dataIndex: "businessHealthyInsurance",
key: "businessHealthyInsurance"
},
{
title: "税延养老保险",
dataIndex: "taxDelayEndowmentInsurance",
key: "taxDelayEndowmentInsurance"
},
{
title: "其他",
dataIndex: "otherDeduction",
key: "otherDeduction"
},
{
title: "准予扣除的捐赠额",
dataIndex: "deductionAllowedDonation",
key: "deductionAllowedDonation"
}
];
export const situationModalColumns = [
{
title: "姓名",
dataIndex: "username",
key: "username"
},
{
title: "个税扣缴义务人",
dataIndex: "taxAgentName",
key: "taxAgentName"
},
{
title: "部门",
dataIndex: "departmentName",
key: "departmentName"
},
{
title: "手机号",
dataIndex: "mobile",
key: "mobile"
},
{
title: "工号",
dataIndex: "jobNum",
key: "jobNum"
},
{
title: "证件号码",
dataIndex: "idNo",
key: "idNo"
},
{
title: "入职日期",
dataIndex: "hiredate",
key: "hiredate"
},
{
title: "累计收入额",
dataIndex: "addUpIncome",
key: "addUpIncome"
},
{
title: "累计减除费用",
dataIndex: "addUpSubtraction",
key: "addUpSubtraction"
},
{
title: "累计社保个人合计",
dataIndex: "addUpSocialSecurityTotal",
key: "addUpSocialSecurityTotal"
},
{
title: "累计公积金个人合计",
dataIndex: "addUpAccumulationFundTotal",
key: "addUpAccumulationFundTotal"
},
{
title: "累计子女教育",
dataIndex: "addUpChildEducation",
key: "addUpChildEducation"
},
{
title: "累计继续教育",
dataIndex: "addUpContinuingEducation",
key: "addUpContinuingEducation"
},
{
title: "累计住房贷款利息",
dataIndex: "addUpHousingLoanInterest",
key: "addUpHousingLoanInterest"
},
{
title: "累计住房租金",
dataIndex: "addUpHousingRent",
key: "addUpHousingRent"
},
{
title: "累计赡养老人",
dataIndex: "addUpSupportElderly",
key: "addUpSupportElderly"
},
{
title: "累计企业(职业)年金及其他福利",
dataIndex: "addUpEnterpriseAndOther",
key: "addUpEnterpriseAndOther"
},
{
title: "累计其他免税扣除",
dataIndex: "addUpOtherDeduction",
key: "addUpOtherDeduction"
},
{
title: "累计免税收入",
dataIndex: "addUpTaxExemptIncome",
key: "addUpTaxExemptIncome"
},
{
title: "累计准予扣除的捐赠额",
dataIndex: "addUpAllowedDonation",
key: "addUpAllowedDonation"
},
{
title: "累计减免税额",
dataIndex: "addUpTaxSavings",
key: "addUpTaxSavings"
},
{
title: "累计已预扣预缴税额",
dataIndex: "addUpAdvanceTax",
key: "addUpAdvanceTax"
},
{
title: "累计婴幼儿照护",
dataIndex: "addUpInfantCare",
key: "addUpInfantCare"
},
{
title: "累计大病医疗",
dataIndex: "addUpIllnessMedical",
key: "addUpIllnessMedical"
}
];
export const dataSource = [];
export const dataCollectCondition = [ export const dataCollectCondition = [
{ {
items: [ items: [
@ -404,7 +7,7 @@ export const dataCollectCondition = [
fieldcol: 12, fieldcol: 12,
label: "税款所属期", label: "税款所属期",
lanId: 542240, lanId: 542240,
labelcol: 4, labelcol: 8,
value: "", value: "",
rules: "required|string", rules: "required|string",
viewAttr: 3 viewAttr: 3
@ -414,7 +17,7 @@ export const dataCollectCondition = [
domkey: ["taxAgentId"], domkey: ["taxAgentId"],
fieldcol: 12, fieldcol: 12,
label: "个税扣缴义务人", label: "个税扣缴义务人",
labelcol: 4, labelcol: 8,
lanId: 537996, lanId: 537996,
value: "", value: "",
options: [], options: [],
@ -448,7 +51,7 @@ export const dataCollectCondition = [
isQuickSearch: false, isQuickSearch: false,
label: "人员", label: "人员",
lanId: 30042, lanId: 30042,
labelcol: 4, labelcol: 8,
rules: "required", rules: "required",
viewAttr: 3 viewAttr: 3
} }

View File

@ -340,7 +340,7 @@ class Index extends Component {
...slidePayload, ...slidePayload,
visible: false, visible: false,
title: "", title: "",
chidren: null, children: null,
data: {} data: {}
} }
}); });

View File

@ -1,70 +1,3 @@
export const columns = [
{
title: "姓名",
dataIndex: "title",
key: "title"
},
{
title: "个税扣缴义务人",
dataIndex: "title",
key: "title"
},
{
title: "部门",
dataIndex: "title",
key: "title"
},
{
title: "手机号",
dataIndex: "title",
key: "title"
},
{
title: "工号",
dataIndex: "title",
key: "title"
},
{
title: "证件号码",
dataIndex: "title",
key: "title"
},
{
title: "入职日期",
dataIndex: "title",
key: "title"
},
{
title: "累计子女教育",
dataIndex: "title",
key: "title"
},
{
title: "累计继续教育",
dataIndex: "title",
key: "title"
},
{
title: "累计住房贷款利息",
dataIndex: "title",
key: "title"
},
{
title: "累计住房租金",
dataIndex: "title",
key: "title"
},
{
title: "累计赡养老人",
dataIndex: "title",
key: "title"
},
{
title: "操作",
dataIndex: "title",
key: "title"
}
];
export const dataCollectCondition = [ export const dataCollectCondition = [
{ {
items: [ items: [
@ -74,7 +7,7 @@ export const dataCollectCondition = [
fieldcol: 12, fieldcol: 12,
label: "税款所属期", label: "税款所属期",
lanId: 542240, lanId: 542240,
labelcol: 4, labelcol: 8,
value: "", value: "",
rules: "required|string", rules: "required|string",
viewAttr: 3 viewAttr: 3
@ -84,7 +17,7 @@ export const dataCollectCondition = [
domkey: ["taxAgentId"], domkey: ["taxAgentId"],
fieldcol: 12, fieldcol: 12,
label: "个税扣缴义务人", label: "个税扣缴义务人",
labelcol: 4, labelcol: 8,
lanId: 537996, lanId: 537996,
value: "", value: "",
options: [], options: [],
@ -133,7 +66,7 @@ export const dataCollectCondition = [
isQuickSearch: false, isQuickSearch: false,
label: "人员", label: "人员",
lanId: 30042, lanId: 30042,
labelcol: 4, labelcol: 8,
rules: "required", rules: "required",
viewAttr: 3 viewAttr: 3
} }

View File

@ -385,7 +385,7 @@ class Index extends Component {
...slidePayload, ...slidePayload,
visible: false, visible: false,
title: "", title: "",
chidren: null, children: null,
data: {} data: {}
} }
}); });

View File

@ -5,9 +5,8 @@
* Date: 2023/2/17 * Date: 2023/2/17
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import UnifiedTable from "../../components/UnifiedTable";
import { getTableDate } from "../../apis/cumDeduct"; import { getTableDate } from "../../apis/cumDeduct";
import { Menu, Popover, Spin } from "antd"; import { Spin } from "antd";
import { WeaLocaleProvider } from "ecCom"; import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@ -16,25 +15,53 @@ class DataTables extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
loading: { loading: { query: false }, dataSource: [], columns: [], selectedRowKeys: [],
query: false pageInfo: { current: 1, pageSize: 10, total: 0 }
},
dataSource: [],
columns: [],
selectedRowKeys: [],
pageInfo: {
current: 1, pageSize: 10, total: 0
}
}; };
} }
componentDidMount() { componentDidMount() {
this.getTableDate(); window.addEventListener("message", this.handleReceive, false);
} }
componentWillUnmount() {
window.removeEventListener("message", this.handleReceive, false);
}
handleReceive = async ({ data }) => {
const { type, payload: { id, params } = {} } = data;
if (type === "init") {
this.getTableDate();
} else if (type === "turn") {
switch (id) {
case "PAGEINFO":
this.setState({ pageInfo: { ...this.state.pageInfo, ...params } }, () => this.getTableDate());
break;
case "CHECKBOX":
const { selectedRowKeys } = params;
this.setState({ selectedRowKeys });
break;
case "DEL":
this.props.onTableOperate({ key: "deleteSelectAddUpDeduction" }, params);
break;
case "EDIT":
this.props.onTableOperate({ key: "handleAddData" }, params);
break;
case "VIEW":
this.props.onViewDetails(params);
break;
case "log":
this.props.onTableOperate({ key: "log" }, params);
break;
default:
break;
}
}
};
getTableDate = (extraPayload = {}) => { getTableDate = (extraPayload = {}) => {
const { loading, pageInfo } = this.state; const { loading, pageInfo, selectedRowKeys } = this.state;
const { url, payload } = this.props; const { url, payload, isSpecial } = this.props;
const module = { const module = {
...pageInfo, url, ...payload, ...extraPayload, ...pageInfo, url, ...payload, ...extraPayload,
departmentIds: extraPayload.departmentIds ? extraPayload.departmentIds.split(",") : [] departmentIds: extraPayload.departmentIds ? extraPayload.departmentIds.split(",") : []
@ -45,10 +72,12 @@ class DataTables extends Component {
if (status) { if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data; const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({ this.setState({
pageInfo: { ...pageInfo, current, pageSize, total }, pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns
dataSource, }, () => this.postMessageToChild({
columns dataSource: this.state.dataSource, scrollHeight: 103, selectedRowKeys, isSpecial,
}); pageInfo: this.state.pageInfo, unitTableType: "dataAcquisition",
columns: this.state.columns
}));
} }
}).catch(() => this.setState({ loading: { ...loading, query: false } })); }).catch(() => this.setState({ loading: { ...loading, query: false } }));
}; };
@ -59,120 +88,34 @@ class DataTables extends Component {
* Date: 2023/2/20 * Date: 2023/2/20
*/ */
handleClearRows = () => this.setState({ selectedRowKeys: [] }); handleClearRows = () => this.setState({ selectedRowKeys: [] });
postMessageToChild = (payload = {}) => {
const i18n = {
"操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"),
"条": getLabel(18256, "条"), "删除": getLabel(111, "删除"), "查看明细": getLabel(111, "查看明细"),
"操作日志": getLabel(545781, "操作日志")
};
const childFrameObj = document.getElementById("unitTable");
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
render() { render() {
const { columns, dataSource, loading, selectedRowKeys, pageInfo } = this.state; const { dataSource, loading } = this.state;
const { onTableOperate, onViewDetails, isSpecial = false, form } = this.props; const dom = document.querySelector(".dataContent");
const rowSelection = { let height = 280;
selectedRowKeys, if (dataSource.length > 0 && dom) {
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) const tableHeight = dataSource.length * 46 + 124;
}; height = dom.offsetHeight > tableHeight ? tableHeight : dom.offsetHeight;
const pagination = { }
...pageInfo, return (<div style={{ height: height + "px" }}>
showTotal: (total) => `${total}`, <Spin spinning={loading.query}>
pageSizeOptions: ["10", "20", "50", "100"], <iframe
showSizeChanger: true, style={{ border: 0, width: "100%", height: "100%" }}
showQuickJumper: true, // src="http://localhost:7607/#/unitTable"
onShowSizeChange: (current, pageSize) => { src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
this.setState({ id="unitTable"
pageInfo: { ...pageInfo, current, pageSize } />
}, () => { </Spin>
this.getTableDate({ ...form.getFormParams() }); </div>);
});
},
onChange: (current) => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => {
this.getTableDate({ ...form.getFormParams() });
});
}
};
const getColumns = _.map(columns, item => {
const { dataIndex } = item;
if (dataIndex === "username") {
return {
...item,
render: (text, record) => {
return <a
className="ellipsis"
href={`javaScript:openhrm(${record.employeeId});`}
onClick={e => window.pointerXY(e)}
title={text}
>
{text}
</a>;
}
};
} else if (dataIndex === "operate" || dataIndex === "opts") {
return {
...item,
width: 150,
render: (text, record) => (
<div className="linkWapper">
{
!isSpecial &&
<React.Fragment>
{
record.opts.includes("admin") &&
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
}
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
onClick={() => onViewDetails(record)}>查看明细</a>
<Popover
overlayClassName="moreIconWrapper"
placement="bottomRight"
content={<Menu onClick={(e) => onTableOperate(e, record)}>
{
record.opts.includes("admin") &&
<Menu.Item key="deleteSelectAddUpDeduction">{getLabel(111, "删除")}</Menu.Item>
}
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
</Menu>} title="">
<i className="icon-coms-more"/>
</Popover>
</React.Fragment>
}
{
isSpecial &&
<React.Fragment>
{
record.opts.includes("admin") &&
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>{getLabel(111, "编辑")}</a>
}
{
record.opts.includes("admin") &&
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
onClick={() => onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>{getLabel(111, "删除")}</a>
}
<Popover
overlayClassName="moreIconWrapper"
placement="bottomRight"
content={<Menu onClick={(e) => onTableOperate(e, record)}>
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
</Menu>} title="">
<i className="icon-coms-more"/>
</Popover>
</React.Fragment>
}
</div>
)
};
} else {
return {
...item,
render: (text) => {
return <span className="ellipsis" title={text}> {text} </span>;
}
};
}
});
return (<Spin spinning={loading.query}>
<UnifiedTable rowKey="id" rowSelection={rowSelection} columns={getColumns}
dataSource={dataSource} pagination={pagination} loading={loading.query}
xWidth={getColumns.length * 160}/> </Spin>);
} }
} }

View File

@ -23,33 +23,17 @@
} }
.addItemsWrapper { .addItemsWrapper {
padding-bottom: 8px;
.baseForm { .baseForm {
.wea-form-cell { .wea-form-cell {
padding-right: 20% !important; padding-right: 20% !important;
} }
} }
.wea-search-group { .tipWrapper {
.wea-form-cell-wrapper { background: #FFF;
border: 1px solid #e5e5e5; margin: 0 16px;
& > div:last-child {
border-bottom: none
}
.wea-form-cell {
padding: 4px 16px;
border-bottom: 1px solid #e5e5e5;
.wea-form-item-wrapper {
line-height: 30px;
}
.wea-form-item {
padding: 0;
}
}
}
} }
} }
@ -57,6 +41,15 @@
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: #F6F6F6;
.wea-new-top-wapper, .wea-tab {
background: #FFF;
}
.wea-tab {
margin: 8px 16px;
}
.wea-tab-left { .wea-tab-left {
min-width: 600px !important; min-width: 600px !important;
@ -114,6 +107,68 @@
.dataContent { .dataContent {
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
padding: 0 16px;
.wea-new-table {
background: #FFF;
.dataAc-ellipsis {
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.wea-slide-modal .wea-slide-modal-content {
background: #f6f6f6;
height: 100%;
}
.ant-spin-nested-loading, .ant-spin-container {
height: 100% !important;
}
.titleDialog {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 46px 8px 16px;
background: #fff;
.titleCol {
flex: 1;
display: flex;
align-items: center;
}
.titleLeftBox {
.titleIcon {
color: #fff;
margin: 0;
width: 40px;
height: 40px;
line-height: 40px;
font-size: 22px;
display: flex;
align-items: center;
justify-content: center;
background: #F14A2D;
border-radius: 50%;
}
.title {
font-size: 14px;
color: #333;
padding-left: 6px;
}
}
.titleRightBox {
justify-content: flex-end;
}
}
} }
} }

View File

@ -7,10 +7,10 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { toJS } from "mobx"; import { toJS } from "mobx";
import { WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom"; import { WeaLocaleProvider, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
import { Button } from "antd";
import ImportModal from "./importDialog"; import ImportModal from "./importDialog";
import LogDialog from "../../components/logViewModal"; import LogDialog from "../../components/logViewModal";
import SlideModalTitle from "../../components/slideModalTitle";
import { getSearchs } from "../../util"; import { getSearchs } from "../../util";
import "./index.less"; import "./index.less";
@ -71,15 +71,29 @@ class Layout extends Component {
break; break;
} }
}; };
renderTitle = () => {
const { slidePayload, slideLoading, detailOptBtns, onSave } = this.props;
const { title } = slidePayload;
return <div className="titleDialog">
<div className="titleCol titleLeftBox">
<div className="titleIcon"><i className="icon-coms-fa"/></div>
<div className="title">{title}</div>
</div>
<div className="titleCol titleRightBox">
{(slidePayload.children && slidePayload.children.props.className) ? [...detailOptBtns] :
<Button type="primary" loading={slideLoading} onClick={onSave}>{getLabel(537558, "保存")}</Button>}
</div>
</div>;
};
render() { render() {
const { showSearchAd, logDialogVisible, filterConditions } = this.state; const { showSearchAd, logDialogVisible, filterConditions } = this.state;
const { const {
title, btns, leftComp, children, taxAgentStore: { PageAndOptAuth }, title, btns, leftComp, children, taxAgentStore: { PageAndOptAuth },
slidePayload, onClose, onSave, slideLoading, form, condition, onImportFile, slidePayload, onClose, form, condition, onImportFile,
onAdSearch, onCancel, importPayload, detailOptBtns, logFunction, onClearTargrtid onAdSearch, onCancel, importPayload, logFunction, onClearTargrtid
} = this.props; } = this.props;
const { visible, title: subtitle, children: slideChildren } = slidePayload; const { visible, children: slideChildren } = slidePayload;
const { const {
visible: importVisiable, importFormComponent, importOpts, visible: importVisiable, importFormComponent, importOpts,
importResult, templateLink, previewUrl importResult, templateLink, previewUrl
@ -98,6 +112,7 @@ class Layout extends Component {
]} ]}
/> />
<WeaTab <WeaTab
advanceHeight={162}
searchType={["base", "advanced"]} searchType={["base", "advanced"]}
replaceLeft={leftComp} replaceLeft={leftComp}
searchsAd={getSearchs(form, toJS(condition), 2)} searchsAd={getSearchs(form, toJS(condition), 2)}
@ -110,7 +125,7 @@ class Layout extends Component {
searchsBaseValue={form.getFormParams().username} searchsBaseValue={form.getFormParams().username}
/> />
<div className="dataContent"> <div className="dataContent">
<WeaNewScroll height="100%">{children}</WeaNewScroll> {children}
{/*导入弹框*/} {/*导入弹框*/}
<ImportModal <ImportModal
visible={importVisiable} onCancel={onCancel} importParams={importFormComponent} visible={importVisiable} onCancel={onCancel} importParams={importFormComponent}
@ -123,21 +138,12 @@ class Layout extends Component {
visible={visible} visible={visible}
top={0} top={0}
measureT="%" measureT="%"
width={80} width={850}
measureX="%" measureX="px"
height={100} height={100}
measureY="%" measureY="%"
direction="right" direction="right"
title={ title={this.renderTitle()}
<SlideModalTitle
subtitle={subtitle}
loading={slideLoading}
onSave={onSave}
editable={subtitle.length <= 2}
showOperateBtn={showOperateBtn}
customOperate={subtitle.length <= 2 ? [] : detailOptBtns}
/>
}
content={slideChildren} content={slideChildren}
onClose={onClose} onClose={onClose}
/> />

View File

@ -1,70 +1,3 @@
export const columns = [
{
title: "姓名",
dataIndex: "title",
key: "title"
},
{
title: "个税扣缴义务人",
dataIndex: "title",
key: "title"
},
{
title: "部门",
dataIndex: "title",
key: "title"
},
{
title: "手机号",
dataIndex: "title",
key: "title"
},
{
title: "工号",
dataIndex: "title",
key: "title"
},
{
title: "证件号码",
dataIndex: "title",
key: "title"
},
{
title: "入职日期",
dataIndex: "title",
key: "title"
},
{
title: "累计子女教育",
dataIndex: "title",
key: "title"
},
{
title: "累计继续教育",
dataIndex: "title",
key: "title"
},
{
title: "累计住房贷款利息",
dataIndex: "title",
key: "title"
},
{
title: "累计住房租金",
dataIndex: "title",
key: "title"
},
{
title: "累计赡养老人",
dataIndex: "title",
key: "title"
},
{
title: "操作",
dataIndex: "title",
key: "title"
}
];
export const dataCollectCondition = [ export const dataCollectCondition = [
{ {
items: [ items: [
@ -74,7 +7,7 @@ export const dataCollectCondition = [
fieldcol: 12, fieldcol: 12,
label: "税款所属期", label: "税款所属期",
lanId: 542240, lanId: 542240,
labelcol: 4, labelcol: 8,
value: "", value: "",
rules: "required|string", rules: "required|string",
viewAttr: 3 viewAttr: 3
@ -84,7 +17,7 @@ export const dataCollectCondition = [
domkey: ["taxAgentId"], domkey: ["taxAgentId"],
fieldcol: 12, fieldcol: 12,
label: "个税扣缴义务人", label: "个税扣缴义务人",
labelcol: 4, labelcol: 8,
lanId: 537996, lanId: 537996,
value: "", value: "",
options: [], options: [],
@ -118,7 +51,7 @@ export const dataCollectCondition = [
isQuickSearch: false, isQuickSearch: false,
label: "人员", label: "人员",
lanId: 30042, lanId: 30042,
labelcol: 4, labelcol: 8,
rules: "required", rules: "required",
viewAttr: 3 viewAttr: 3
} }

View File

@ -400,7 +400,7 @@ class Index extends Component {
...slidePayload, ...slidePayload,
visible: false, visible: false,
title: "", title: "",
chidren: null, children: null,
data: {} data: {}
} }
}); });

View File

@ -7,7 +7,7 @@ export const condition = [
fieldcol: 12, fieldcol: 12,
label: "个税扣缴义务人", label: "个税扣缴义务人",
lanId: 537996, lanId: 537996,
labelcol: 4, labelcol: 8,
value: "", value: "",
options: [], options: [],
rules: "required|string", rules: "required|string",
@ -40,7 +40,7 @@ export const condition = [
isQuickSearch: false, isQuickSearch: false,
label: "人员", label: "人员",
lanId: 30042, lanId: 30042,
labelcol: 4, labelcol: 8,
rules: "required", rules: "required",
viewAttr: 3 viewAttr: 3
} }

View File

@ -338,7 +338,7 @@ class Index extends Component {
...slidePayload, ...slidePayload,
visible: false, visible: false,
title: "", title: "",
chidren: null, children: null,
data: {} data: {}
} }
}); });

View File

@ -22,6 +22,7 @@ import SlideModalTitle from "../../../components/slideModalTitle";
import { getSalaryFieldForm, saveSalaryField } from "../../../apis/fieldManage"; import { getSalaryFieldForm, saveSalaryField } from "../../../apis/fieldManage";
import { commonEnumList } from "../../../apis/payrollFiles"; import { commonEnumList } from "../../../apis/payrollFiles";
import { dataTypeOptions, patternOptions, roundingModeOptions } from "../../salaryItem/options"; import { dataTypeOptions, patternOptions, roundingModeOptions } from "../../salaryItem/options";
import { postFetch } from "../../../util/request";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@ -44,15 +45,17 @@ class FieldSlide extends Component {
pattern: "2", pattern: "2",
sortedIndex: "", sortedIndex: "",
width: "", width: "",
description: "" description: "",
taxAgentOption: []
}; };
} }
componentDidMount() { componentDidMount() {
const { taxAgentStore } = this.props;
this.commonEnumList(); this.commonEnumList();
const { fetchTaxAgentOption } = taxAgentStore; postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" })
fetchTaxAgentOption(); .then(({ status, data }) => {
if (status) this.setState({ taxAgentOption: _.map(data, o => ({ key: String(o.id), showname: o.name })) });
});
} }
componentWillReceiveProps(nextProps, nextContext) { componentWillReceiveProps(nextProps, nextContext) {
@ -203,13 +206,8 @@ class FieldSlide extends Component {
}; };
render() { render() {
const { const { title, visible, record: { id: editId }, onCancel, taxAgentStore: { PageAndOptAuth } } = this.props;
title, const admin = PageAndOptAuth.opts.includes("admin");
visible,
record: { id: editId },
taxAgentStore: { taxAgentOption, showSalaryItemBtn, showOperateBtn },
onCancel
} = this.props;
const { const {
loading, loading,
name, name,
@ -224,7 +222,8 @@ class FieldSlide extends Component {
pattern, pattern,
sortedIndex, sortedIndex,
width, width,
description description,
taxAgentOption
} = this.state; } = this.state;
return ( return (
<WeaSlideModal <WeaSlideModal
@ -241,7 +240,7 @@ class FieldSlide extends Component {
tabs={[]} tabs={[]}
loading={loading} loading={loading}
showOperateBtn={true} showOperateBtn={true}
editable={(showSalaryItemBtn || showOperateBtn)} editable={admin}
onSave={this.saveFieldInfo} onSave={this.saveFieldInfo}
/> />
} }

View File

@ -57,7 +57,8 @@ class FieldTable extends Component {
getColumns = () => { getColumns = () => {
const { columns } = this.state; const { columns } = this.state;
const { taxAgentStore, onEditLedger, onDeleteLedger } = this.props; const { taxAgentStore, onEditLedger, onDeleteLedger } = this.props;
const { showSalaryItemBtn, showOperateBtn } = taxAgentStore; const { PageAndOptAuth } = taxAgentStore;
const admin = PageAndOptAuth.opts.includes("admin");
return _.map([...columns, { return _.map([...columns, {
dataIndex: "operate", dataIndex: "operate",
display: true, display: true,
@ -72,9 +73,9 @@ class FieldTable extends Component {
item.render = (text, record) => { item.render = (text, record) => {
return <div className="optWrapper"> return <div className="optWrapper">
<a href="javascript:void(0);" className="mr10" <a href="javascript:void(0);" className="mr10"
onClick={() => onEditLedger(record)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"}</a> onClick={() => onEditLedger(record)}>{admin ? "编辑" : "查看"}</a>
{ {
record.canDelete && (showSalaryItemBtn || showOperateBtn) && record.canDelete && admin &&
<a href="javascript:void(0);" className="mr10" onClick={() => onDeleteLedger(record)}>删除</a> <a href="javascript:void(0);" className="mr10" onClick={() => onDeleteLedger(record)}>删除</a>
} }
<Dropdown <Dropdown

View File

@ -85,7 +85,8 @@ class FieldManagement extends Component {
render() { render() {
const { searchVal, doSearch, slideparams, logDialogVisible, filterConditions } = this.state; const { searchVal, doSearch, slideparams, logDialogVisible, filterConditions } = this.state;
const { taxAgentStore } = this.props; const { taxAgentStore } = this.props;
const { showSalaryItemBtn, showOperateBtn } = taxAgentStore; const { PageAndOptAuth } = taxAgentStore;
const admin = PageAndOptAuth.opts.includes("admin");
const btns = [ const btns = [
<Button <Button
type="primary" type="primary"
@ -100,7 +101,7 @@ class FieldManagement extends Component {
return ( return (
<WeaTop <WeaTop
title="字段管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" className="fieldManageWrapper" title="字段管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" className="fieldManageWrapper"
buttons={(showSalaryItemBtn || showOperateBtn) ? btns : btns.slice(-1)} buttons={admin ? btns : btns.slice(-1)}
showDropIcon onDropMenuClick={this.onDropMenuClick} showDropIcon onDropMenuClick={this.onDropMenuClick}
dropMenuDatas={[ dropMenuDatas={[
{ {

View File

@ -249,7 +249,7 @@
padding: 0; padding: 0;
background: transparent; background: transparent;
border: none; border: none;
font-size: 20px; font-size: 20px!important;
line-height: 20px; line-height: 20px;
} }

View File

@ -0,0 +1,162 @@
/*
* Author: 黎永顺
* name: 薪资核算规则配置
* Description:
* Date: 2024/4/24
*/
import React, { Component } from "react";
import { WeaSwitch } from "comsMobx";
import { inject, observer } from "mobx-react";
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import LedgerAccountSalaryItemsSet from "./ledgerAccountSalaryItemsSet";
import * as API from "../../../apis/ledger";
import { acctApprRulesConditions } from "../config";
const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey;
@inject("ledgerStore")
@observer
class LedgerAccountApprRule extends Component {
constructor(props) {
super(props);
this.state = {
conditions: [], approvalId: "", approvalItemGroup: []
};
}
componentDidMount() {
this.init();
}
init = () => {
const { saveSalarySobId, editId } = this.props;
API.getSalaryApprovalForm({ salarySobId: editId || saveSalarySobId }).then(({ status, data }) => {
if (status) {
this.setState({
approvalId: data.id,
approvalItemGroup: _.map(data.approvalItemGroup, item => ({
...item, id: String(item.sorted),
approvalItems: _.map(item.approvalItems, o => ({ ...o, id: `${String(item.sorted)}-${String(o.sorted)}` }))
})),
conditions: _.map(acctApprRulesConditions, item => ({
...item, items: _.map(item.items, o => ({
...o, value: getKey(o) === "isOpenApproval" ? (data[getKey(o)] ? "1" : "0") : data[getKey(o)],
viewAttr: getKey(o) === "approvalWorkflowUrl" ? (data["isOpenApproval"] ? 3 : 2) : o.viewAttr,
hide: getKey(o) !== "isOpenApproval" ? !data["isOpenApproval"] : false,
label: getLabel(o.lanId, o.label)
}))
}))
}, () => {
const { ledgerStore: { AARForm } } = this.props;
AARForm.initFormFields(this.state.conditions);
});
}
});
};
componentWillUnmount() {
const { ledgerStore: { initAARForm } } = this.props;
initAARForm();
}
renderForm = (form, conditions) => {
const { saveSalarySobId, editId } = this.props;
const { approvalItemGroup } = this.state;
const { isFormInit } = form;
const formParams = form.getFormParams();
let group = [];
isFormInit && conditions && conditions.map(c => {
let items = [];
c.items.map(fields => {
if (getKey(fields) !== "approvalItemGroup") {
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={this.handleFormItemChange}/>
</WeaFormItem>),
hide: fields.hide
});
} else {
items.push({
com: (
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom"
>
<LedgerAccountSalaryItemsSet datas={approvalItemGroup} salarySobId={editId || saveSalarySobId}
onAddItems={(groupId, items) => this.setState({
approvalItemGroup: _.map(approvalItemGroup, o => ({
...o,
approvalItems: (groupId === o.id && !_.isEmpty(items)) ? [...o.approvalItems, ..._.map(items, (k, ki) => ({
salaryItemId: k.id, salaryItemName: k.name,
id: `${String(o.sorted)}-${String(o.approvalItems.length + ki)}`
}))] : o.approvalItems
}))
}, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
onEdit={(groupName, groupId) => this.setState({
approvalItemGroup: groupId ? _.map(approvalItemGroup, o => ({
...o, groupName: groupId === o.id ? groupName : o.groupName
})) : [{
approvalItems: [], groupName, id: String(approvalItemGroup.length)
}, ...approvalItemGroup]
}, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
onDelete={(group, item) => this.setState({
approvalItemGroup: _.isEmpty(item) ? _.filter(approvalItemGroup, o => o.id !== group.id) :
_.map(approvalItemGroup, o => ({
...o,
approvalItems: _.filter(o.approvalItems, oo => oo.id !== item.id)
}))
}, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
onChange={datas => this.setState({
approvalItemGroup: datas
}, () => form.updateFields({ approvalItemGroup: { value: datas } }))}/>
</WeaFormItem>),
hide: fields.hide
});
}
});
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
});
return group;
};
convertFormItemViewAttr = (viewAttr) => {
const { ledgerStore: { AARForm } } = this.props;
const { isOpenApproval } = AARForm.getFormParams();
this.setState({
conditions: _.map(this.state.conditions, item => ({
...item, items: _.map(item.items, o => {
if (getKey(o) === "approvalWorkflowUrl") {
return { ...o, viewAttr, hide: isOpenApproval === "0" };
} else if (getKey(o) === "approvalItemGroup") {
return { ...o, viewAttr, hide: isOpenApproval === "0" };
}
return { ...o };
})
}))
});
};
handleFormItemChange = (value) => {
const { ledgerStore: { AARForm } } = this.props;
const { isOpenApproval } = AARForm.getFormParams();
if (_.keys(value)[0] === "isOpenApproval") {
this.convertFormItemViewAttr(isOpenApproval === "1" ? 3 : 2);
}
};
render() {
const { conditions } = this.state;
const { ledgerStore: { AARForm } } = this.props;
return (
<div className="form-dialog-layout" style={{ background: "#FFF" }}>
{this.renderForm(AARForm, conditions)}
</div>
);
}
}
export default LedgerAccountApprRule;

View File

@ -0,0 +1,70 @@
/*
* Author: 黎永顺
* name:审批规则分类编辑
* Description:
* Date: 2024/4/25
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
import { Button } from "antd";
import { getSearchs } from "../../../util";
import { classifyConditions } from "../config";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("ledgerStore")
@observer
class LedgerAccountApprRuleClassifyNameEditDialog extends Component {
constructor(props) {
super(props);
this.state = { conditions: [] };
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.init(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.ledgerStore.initAARClassifyForm();
}
init = (props) => {
const { ledgerStore: { AARClassifyForm }, groupName, groupId } = props;
this.setState({
conditions: _.map(classifyConditions, item => ({
...item,
items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
}))
}, () => {
AARClassifyForm.initFormFields(this.state.conditions);
groupId && AARClassifyForm.updateFields({ groupName });
});
};
save = () => {
const { ledgerStore: { AARClassifyForm }, groupId } = this.props;
AARClassifyForm.validateForm().then(f => {
if (f.isValid) {
this.props.onCancel();
this.props.onEdit(AARClassifyForm.getFormParams().groupName, groupId);
} else {
f.showErrors();
}
});
};
render() {
const { conditions } = this.state;
const { ledgerStore: { AARClassifyForm } } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 480, height: 80 }} initLoadCss
buttons={[
<Button type="primary" onClick={this.save}>{getLabel(537558, "保存")}</Button>
]}
>
<div className="form-dialog-layout">{getSearchs(AARClassifyForm, conditions, 1, false)}</div>
</WeaDialog>
);
}
}
export default LedgerAccountApprRuleClassifyNameEditDialog;

View File

@ -0,0 +1,147 @@
/*
* Author: 黎永顺
* name: 薪资核算规则配置-审批薪资项目
* Description:
* Date: 2024/4/24
*/
import React, { Component } from "react";
import { WeaButtonIcon, WeaLocaleProvider, WeaSortable, WeaTransfer } from "ecCom";
import LedgerAccountApprRuleClassifyNameEditDialog from "./ledgerAccountApprRuleClassifyNameEditDialog";
import * as API from "../../../apis/ledger";
import { Icon, Modal } from "antd";
import cs from "classnames";
import SalaryItemModal from "../../payroll/stepForm/salaryItemModal";
const getLabel = WeaLocaleProvider.getLabel;
class LedgerAccountSalaryItemsSet extends Component {
constructor(props) {
super(props);
this.state = {
editDialog: { visible: false, groupName: "", groupId: "", title: "" },
salaryItemDialog: { visible: false, title: getLabel(111, "薪资项目项"), options: [], groupId: "" }
};
}
handleDeleteClick = (group, item = {}) => {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(543231, "确认删除本条数据吗?"),
onOk: () => this.props.onDelete(group, item)
});
};
handleAddSalaryItems = (group) => {
const { salaryItemDialog } = this.state;
const { salarySobId, datas } = this.props;
const payload = {
salarySobId, excludeIds: _.reduce(datas, (pre, cur) => {
return pre.concat(_.map(cur.approvalItems, o => o.salaryItemId));
}, [])
};
API.getListSalaryItem(payload).then(({ status, data }) => {
if (status) this.setState({
salaryItemDialog: {
...salaryItemDialog, visible: true, options: data, groupId: group.id
}
});
});
};
handleConfirm = () => {
const { salaryItemDialog } = this.state;
this.setState({
salaryItemDialog: { ...salaryItemDialog, visible: false }
}, () => this.props.onAddItems(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem)));
};
render() {
const { editDialog, salaryItemDialog } = this.state;
const { datas } = this.props;
return (
<div>
<div style={{ textAlign: "right", padding: "10px 0" }}>
<WeaButtonIcon buttonType="add" type="primary"
onClick={() => this.setState({
editDialog: { visible: true, title: getLabel(111, "添加分类") }
})}/>
</div>
<div className={cs("salaryItemSettingWrapper", { required: _.isEmpty(datas) })}>
<WeaSortable
datas={datas}
onChange={list => this.props.onChange(list)}
renderNodeItem={(item) => {
return <div className="salaryItemWrapper">
<div className="salaryItemHeader">
<span className="titleWrapper">
<span className="salaryClassTitle">{item.groupName}</span>
<span className="iconWrapper">
<i className="icon-coms-edit" onClick={() => this.setState({
editDialog: {
visible: true, groupName: item.groupName, groupId: item.id, title: getLabel(111, "分类名称编辑")
}
})}/>
<i className="icon-coms-Delete" onClick={() => this.handleDeleteClick(item)}/>
</span>
</span>
<i className="icon-coms-Add-to" onClick={() => this.handleAddSalaryItems(item)}/>
</div>
<div className="salaryItemContent">
{
!_.isEmpty(item.approvalItems) ?
<WeaSortable
datas={item.approvalItems}
onChange={(items) => this.props.onChange(
_.map(datas, child => {
if (child.id === item.id) {
return { ...child, approvalItems: items };
}
return { ...child };
})
)}
renderNodeItem={(filed) => {
return <div className="salaryItemList">
<div className="salaryItem" title={filed.salaryItemName}>
<div className="salaryItemName">{filed.salaryItemName}</div>
<Icon type="cross" onClick={() => this.handleDeleteClick(item, filed)}/>
</div>
</div>;
}}
className="wea-sortable-salary-item"
/> :
<div className="empty">暂无数据</div>
}
</div>
</div>;
}}
className="wea-sortable-salary-item"
/>
<LedgerAccountApprRuleClassifyNameEditDialog {...editDialog} {...this.props}
onCancel={() => this.setState({
editDialog: { ...editDialog, visible: false }
})}/>
<SalaryItemModal {...salaryItemDialog}
onCancel={() => this.setState({
salaryItemDialog: { ...salaryItemDialog, visible: false }
})} onConfirm={this.handleConfirm}>
<div className="modalContent">
<WeaTransfer
data={salaryItemDialog.options}
selectedKeys={_.map(_.filter(salaryItemDialog.options, g => g.checkedSalaryItem), o => o.id)}
onChange={v => {
this.setState({
salaryItemDialog: {
...salaryItemDialog,
options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) }))
}
});
}}
/>
</div>
</SalaryItemModal>
</div>
</div>
);
}
}
export default LedgerAccountSalaryItemsSet;

View File

@ -12,6 +12,7 @@ import PersonalScopeModal from "../../../components/PersonalScopeModal";
import { import {
deleteLedgerPersonExtRange, deleteLedgerPersonExtRange,
deleteLedgerPersonRange, deleteLedgerPersonRange,
editLedgerPersonRange,
getLedgerPersonRangeExclude, getLedgerPersonRangeExclude,
getLedgerPersonRangeExtList, getLedgerPersonRangeExtList,
getLedgerPersonRangeInclude, getLedgerPersonRangeInclude,
@ -31,7 +32,8 @@ const APIFox = {
externalList: getLedgerPersonRangeExtList externalList: getLedgerPersonRangeExtList
}; };
const APISaveFox = { const APISaveFox = {
save: saveLedgerPersonRange save: saveLedgerPersonRange,
edit: editLedgerPersonRange
}; };
class LedgerAssociatedPersonnel extends Component { class LedgerAssociatedPersonnel extends Component {
@ -52,7 +54,8 @@ class LedgerAssociatedPersonnel extends Component {
personalAddModal: { personalAddModal: {
visible: false, visible: false,
title: "关联人员", title: "关联人员",
includeType: "" includeType: "",
record: {}
}, },
extEmpsWitch: "1" //非系统人员开关, 1 开启, 0关闭 extEmpsWitch: "1" //非系统人员开关, 1 开启, 0关闭
}; };
@ -154,7 +157,7 @@ class LedgerAssociatedPersonnel extends Component {
* Params: * Params:
* Date: 2022/11/30 * Date: 2022/11/30
*/ */
handleAddPersonal = () => { handleAddPersonal = (record = {}) => {
const { personalAddModal, selectedKey } = this.state; const { personalAddModal, selectedKey } = this.state;
if (selectedKey === "externalList") { if (selectedKey === "externalList") {
this.setState({ externalPersonModalVisible: true }); this.setState({ externalPersonModalVisible: true });
@ -162,7 +165,7 @@ class LedgerAssociatedPersonnel extends Component {
this.setState({ this.setState({
personalAddModal: { personalAddModal: {
...personalAddModal, ...personalAddModal,
visible: true, visible: true, record,
includeType: selectedKey === "listInclude" ? 1 : 0 includeType: selectedKey === "listInclude" ? 1 : 0
} }
}); });
@ -254,7 +257,7 @@ class LedgerAssociatedPersonnel extends Component {
disabled={_.isEmpty(rowKeys)} disabled={_.isEmpty(rowKeys)}
onClick={this.taxAgentRangeDelete} onClick={this.taxAgentRangeDelete}
/>, />,
<WeaButtonIcon buttonType="add" type="primary" onClick={this.handleAddPersonal}/>, <WeaButtonIcon buttonType="add" type="primary" onClick={() => this.handleAddPersonal()}/>,
<WeaInputSearch <WeaInputSearch
style={{ width: 220 }} style={{ width: 220 }}
value={searchValue} value={searchValue}
@ -285,6 +288,7 @@ class LedgerAssociatedPersonnel extends Component {
tabActive={selectedKey} tabActive={selectedKey}
searchValue={searchValue} searchValue={searchValue}
onChangeSelectKey={rowKeys => this.setState({ rowKeys })} onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
onEditScope={this.handleAddPersonal}
/> />
{/*关联人员范围导入*/} {/*关联人员范围导入*/}
{importParams.visible && ( {importParams.visible && (
@ -334,9 +338,7 @@ class LedgerAssociatedPersonnel extends Component {
onCancel={() => onCancel={() =>
this.setState({ this.setState({
personalAddModal: { personalAddModal: {
...personalAddModal, ...personalAddModal, record: {}, includeType: "", visible: false
visible: false,
includeType: ""
} }
}) })
} }

View File

@ -157,7 +157,7 @@ class LedgerBaseSetting extends Component {
}; };
render() { render() {
const { editId, record } = this.props; const { editId, record, PageAndOptAuth } = this.props;
const { baseForm, settingBaseInfo } = this.state; const { baseForm, settingBaseInfo } = this.state;
const { canEdit, taxAgentId } = settingBaseInfo; const { canEdit, taxAgentId } = settingBaseInfo;
let taxAgentIdDisabled = false, taxableItemsDisabled = false; let taxAgentIdDisabled = false, taxableItemsDisabled = false;
@ -169,8 +169,7 @@ class LedgerBaseSetting extends Component {
{ {
_.map(baseForm, item => { _.map(baseForm, item => {
const { key, label, type, options = [], children = [], multiple = false } = item; const { key, label, type, options = [], children = [], multiple = false } = item;
taxAgentIdDisabled = false; taxAgentIdDisabled = key === "taxAgentId" && editId && !PageAndOptAuth.isChief;
// taxAgentIdDisabled = key === "taxAgentId" && editId && taxAgentId;
taxableItemsDisabled = key === "taxableItems" && editId; taxableItemsDisabled = key === "taxableItems" && editId;
return <WeaFormItem return <WeaFormItem
key={key} label={label} key={key} label={label}
@ -191,8 +190,8 @@ class LedgerBaseSetting extends Component {
</React.Fragment> : </React.Fragment> :
type === "SELECT" ? type === "SELECT" ?
<WeaSelect value={settingBaseInfo[key]} <WeaSelect value={settingBaseInfo[key]}
options={options} viewAttr={3} multiple={multiple} options={options} viewAttr={taxAgentIdDisabled ? 1 : 3} multiple={multiple}
disabled={!admin || taxAgentIdDisabled || taxableItemsDisabled} disabled={!admin || taxableItemsDisabled}
onChange={(v) => this.handleChangeField(key, v)}/> : onChange={(v) => this.handleChangeField(key, v)}/> :
type === "CUSTOM" ? type === "CUSTOM" ?
<CustomSelect list={children} baseInfo={settingBaseInfo} inputStr={key} admin={admin} <CustomSelect list={children} baseInfo={settingBaseInfo} inputStr={key} admin={admin}

View File

@ -173,7 +173,7 @@ class LedgerSalaryItemTable extends Component {
this.setState({ this.setState({
editFormulModal: { editFormulModal: {
...editFormulModal, visible: true, valueType, dataType, name: salaryItemName, ...editFormulModal, visible: true, valueType, dataType, name: salaryItemName,
formulaId: ((valueType.toString() === "2" && (originFormulaContent || originFormulaContent !== " ")) || valueType.toString() === "3" && (originSqlContent || originSqlContent === " ")) ? formulaId : "" formulaId: ((valueType.toString() === "2" && (originFormulaContent || originFormulaContent !== " ")) || valueType.toString() === "3" && (originSqlContent || originSqlContent !== " ")) ? formulaId : ""
} }
}); });
}; };

View File

@ -13,9 +13,11 @@ import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules"; import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem"; import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
import LedgerSalaryItem from "./ledgerSalaryItem"; import LedgerSalaryItem from "./ledgerSalaryItem";
import LedgerAccountApprRule from "./ledgerAccountApprRule";
import WeaTopTitle from "../../../components/custom-title/weaTopTitle"; import WeaTopTitle from "../../../components/custom-title/weaTopTitle";
import WeaReqTitle from "../../../components/custom-title/weaReqTitle"; import WeaReqTitle from "../../../components/custom-title/weaReqTitle";
import { saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger"; import { salaryApprovalSaveForm, saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
import { sysConfCodeRule } from "../../../apis/ruleconfig";
import "./index.less"; import "./index.less";
const { getLabel } = WeaLocaleProvider; const { getLabel } = WeaLocaleProvider;
@ -28,10 +30,18 @@ class LedgerSlide extends Component {
super(props); super(props);
this.state = { this.state = {
current: 0, loading: false, baseSettingInfo: {}, adjustRules: [], current: 0, loading: false, baseSettingInfo: {}, adjustRules: [],
empFields: [], itemGroups: [], saveSalarySobId: "" empFields: [], itemGroups: [], saveSalarySobId: "",
salaryApprovalStatus: false
}; };
} }
async componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { data } = await sysConfCodeRule({ code: "SALARY_APPROVAL_STATUS" });
this.setState({ salaryApprovalStatus: data === "1" });
}
}
componentWillUnmount() { componentWillUnmount() {
this.setState({ this.setState({
saveSalarySobId: "" saveSalarySobId: ""
@ -87,7 +97,6 @@ class LedgerSlide extends Component {
this.setState({ loading: false }); this.setState({ loading: false });
if (status) { if (status) {
message.success("保存成功"); message.success("保存成功");
this.handleClose();
} else { } else {
message.success(errormsg || "保存失败"); message.success(errormsg || "保存失败");
} }
@ -152,9 +161,45 @@ class LedgerSlide extends Component {
*/ */
handleSaveSalaryItemParams = (empFields, itemGroups) => this.setState({ empFields, itemGroups }); handleSaveSalaryItemParams = (empFields, itemGroups) => this.setState({ empFields, itemGroups });
handleDefaultSave = () => {
const { saveSalarySobId } = this.state;
const { state: { approvalId } } = this.approRef.wrappedInstance;
const { ledgerStore: { AARForm } } = this.props;
const { approvalItemGroup, isOpenApproval, ...extra } = AARForm.getFormParams();
const group = _.map(approvalItemGroup, (item, index) => ({
groupName: item.groupName, sorted: index,
approvalItems: _.map(item.approvalItems, (o, oi) => ({
salaryItemId: o.salaryItemId, sorted: oi,
salaryItemName: o.salaryItemName
}))
}));
if (isOpenApproval === "1" && _.isEmpty(extra.approvalWorkflowUrl)) {
AARForm.showError("approvalWorkflowUrl", getLabel(111, "\"审批流程地址\"未填写"));
return;
} else if (isOpenApproval === "1" && _.isEmpty(group)) {
AARForm.showError("approvalItemGroup", getLabel(111, "\"审批薪资项目\"未填写"));
return;
}
const payload = {
...extra, isOpenApproval: isOpenApproval === "1", id: approvalId,
salarySobId: this.props.editId || saveSalarySobId,
approvalItemGroup: group
};
this.setState({ loading: true });
salaryApprovalSaveForm(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "保存成功!"));
saveSalarySobId && this.handleClose();
} else {
message.error(errormsg);
}
});
};
render() { render() {
const { visible, editId, record } = this.props; const { visible, editId, record } = this.props;
const { current, saveSalarySobId, loading } = this.state; const { current, saveSalarySobId, loading, salaryApprovalStatus } = this.state;
let tabs = [ let tabs = [
{ {
key: 0, title: getLabel(82751, "基础设置"), key: 0, title: getLabel(82751, "基础设置"),
@ -211,9 +256,11 @@ class LedgerSlide extends Component {
{ {
key: 4, title: getLabel(543469, "调薪计薪规则"), key: 4, title: getLabel(543469, "调薪计薪规则"),
createBtns: [ createBtns: [
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
<Button type="ghost" <Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>, onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>{getLabel(111, "完成")}</Button> <Button type="primary"
onClick={() => this.setState({ current: current + 1 }, () => this.saveLedgerAdjustRule())}>{getLabel(111, "保存并进入下一步")}</Button>
], ],
editBtns: [ editBtns: [
<Button type="primary" loading={loading} <Button type="primary" loading={loading}
@ -221,8 +268,23 @@ class LedgerSlide extends Component {
], ],
children: <LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId} children: <LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId}
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/> onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>
},
{
key: 5, title: getLabel(111, "核算审批规则"),
createBtns: [
<Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
<Button type="primary" loading={loading} onClick={this.handleDefaultSave}>{getLabel(111, "完成")}</Button>
],
editBtns: [
<Button type="primary" loading={loading}
onClick={this.handleDefaultSave}>{getLabel(111, "保存")}</Button>
],
children: <LedgerAccountApprRule {...this.props} ref={dom => this.approRef = dom}
saveSalarySobId={saveSalarySobId}/>
} }
]; ];
!salaryApprovalStatus && tabs.pop();
return ( return (
<WeaSlideModal <WeaSlideModal
className="ledgerSlideLayout slideOuterWrapper" className="ledgerSlideLayout slideOuterWrapper"

View File

@ -805,3 +805,57 @@ export const keepDecimalPlaces = [
showname: "5" showname: "5"
} }
]; ];
export const acctApprRulesConditions = [
{
items: [
{
conditionType: "SWITCH",
domkey: ["isOpenApproval"],
fieldcol: 20,
label: "是否开启审批",
lanId: 111,
labelcol: 4,
viewAttr: 2
},
{
conditionType: "INPUT",
domkey: ["approvalWorkflowUrl"],
fieldcol: 20,
label: "审批流程地址",
lanId: 111,
labelcol: 4,
value: "",
viewAttr: 2
},
{
conditionType: "CUSTOM",
domkey: ["approvalItemGroup"],
fieldcol: 20,
label: "审批薪资项目",
lanId: 111,
labelcol: 4,
value: "",
viewAttr: 2
}
],
defaultshow: true
}
];
export const classifyConditions = [
{
items: [
{
conditionType: "INPUT",
domkey: ["groupName"],
fieldcol: 18,
label: "分类名称",
lanId: 111,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true
}
];

View File

@ -7,7 +7,7 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTop } from "ecCom"; import { WeaLocaleProvider, WeaTop } from "ecCom";
import { Button } from "antd"; import { Button, Modal } from "antd";
import LedgerTable from "./components/ledgerTable"; import LedgerTable from "./components/ledgerTable";
import LedgerSlide from "./components/ledgerSlide"; import LedgerSlide from "./components/ledgerSlide";
import LedgerSearchComp from "./components/ledgerSearchComp"; import LedgerSearchComp from "./components/ledgerSearchComp";
@ -50,6 +50,19 @@ class Index extends Component {
break; break;
} }
}; };
handleNewBuild = () => {
const { taxAgentStore } = this.props;
const { PageAndOptAuth } = taxAgentStore;
if (!PageAndOptAuth.isAdminEnable && !PageAndOptAuth.isChief) {
Modal.info({
title: getLabel(111, "提示"),
content: getLabel(111, "业务线人员新建账套后,需联系总管理员,将该账套加入所属业务线。"),
onOk: () => this.setState({ slideparams: { ...this.state.slideparams, visible: true } })
});
} else {
this.setState({ slideparams: { ...this.state.slideparams, visible: true } });
}
};
render() { render() {
const { logDialogVisible, filterConditions, doSearch, slideparams } = this.state; const { logDialogVisible, filterConditions, doSearch, slideparams } = this.state;
@ -57,9 +70,7 @@ class Index extends Component {
const { PageAndOptAuth } = taxAgentStore; const { PageAndOptAuth } = taxAgentStore;
const admin = PageAndOptAuth.opts.includes("admin"); const admin = PageAndOptAuth.opts.includes("admin");
const btns = [ const btns = [
<Button type="primary" onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })}> <Button type="primary" onClick={this.handleNewBuild}>{getLabel(111, "新建")}</Button>,
{getLabel(111, "新建")}
</Button>,
<LedgerSearchComp onSearch={() => this.setState({ doSearch: !doSearch })}/> <LedgerSearchComp onSearch={() => this.setState({ doSearch: !doSearch })}/>
]; ];
return ( return (
@ -78,7 +89,7 @@ class Index extends Component {
<LedgerTable doSearch={doSearch} onEditLedger={this.handleEditLedger} <LedgerTable doSearch={doSearch} onEditLedger={this.handleEditLedger}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/> onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>
<LedgerSlide <LedgerSlide
{...slideparams} {...slideparams} PageAndOptAuth={PageAndOptAuth}
onCancel={this.handleResetLedger} onCancel={this.handleResetLedger}
onRefreshList={() => this.setState({ doSearch: !doSearch })} onRefreshList={() => this.setState({ doSearch: !doSearch })}
/> />

View File

@ -73,7 +73,11 @@ export default class MobilePayroll extends React.Component {
}); });
} else { } else {
const params = this.getUrlkey(); const params = this.getUrlkey();
const { data } = await salaryBillGetToken({ uid: _.pick(params, ["recipient"]).recipient }); const { data } = await salaryBillGetToken({
id: _.pick(params, ["id"]).id,
recipient: _.pick(params, ["recipient"]).recipient,
salaryCode: _.pick(params, ["salaryCode"]).salaryCode
});
this.setState({ salaryBillToken: data }, () => { this.setState({ salaryBillToken: data }, () => {
API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
.then(({ status, isNeedSecondAuth }) => { .then(({ status, isNeedSecondAuth }) => {

View File

@ -46,7 +46,7 @@ class Index extends Component {
if (it.column === "salaryYearMonth" || it.column === "sendTime") { if (it.column === "salaryYearMonth" || it.column === "sendTime") {
return { return {
dataIndex: it.column, title: it.text, width: it.width, dataIndex: it.column, title: it.text, width: it.width,
render: (__, record) => (<span>{moment(record[it["column"]]).format("YYYY-MM")}</span>) render: (__, record) => (<span>{record[it["column"]]}</span>)
}; };
} }
return { return {

View File

@ -26,6 +26,11 @@
padding: 5px 16px; padding: 5px 16px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
.wea-select {
width: 120px !important;
margin-left: 10px;
}
.wea-input-number { .wea-input-number {
width: 80px !important; width: 80px !important;
margin: 0 10px; margin: 0 10px;

View File

@ -96,6 +96,10 @@
& > ul { & > ul {
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
.sortable-handle {
display: none;
}
.wea-sortable-salary-item { .wea-sortable-salary-item {
padding: 0; padding: 0;
margin: 0; margin: 0;

View File

@ -106,7 +106,7 @@ class TemplateBaseSettings extends Component {
render() { render() {
const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state; const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state;
const { ackStatus, feedbackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting; const { ackStatus, feedbackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
const { limitMonth, burningAfterReadingMin } = salaryBillViewingLimitSetting; const { monthType = "SALARY_DATE", limitMonth, burningAfterReadingMin } = salaryBillViewingLimitSetting;
return ( return (
<React.Fragment> <React.Fragment>
<WeaSearchGroup title={getLabel(111, "水印设置")} showGroup needTigger className="waterMarkWrapper"> <WeaSearchGroup title={getLabel(111, "水印设置")} showGroup needTigger className="waterMarkWrapper">
@ -204,6 +204,14 @@ class TemplateBaseSettings extends Component {
<WeaSearchGroup title={getLabel(111, "工资单时效设置")} showGroup needTigger className="waterMarkWrapper"> <WeaSearchGroup title={getLabel(111, "工资单时效设置")} showGroup needTigger className="waterMarkWrapper">
<div className="agingBox"> <div className="agingBox">
<span>{getLabel(111, "仅可查看")}</span> <span>{getLabel(111, "仅可查看")}</span>
<WeaSelect
value={monthType} onChange={monthType => this.setState({
salaryBillViewingLimitSetting: { ...salaryBillViewingLimitSetting, monthType }
})}
options={[
{ key: "SALARY_DATE", showname: getLabel(111, "薪资所属月"), selected: true },
{ key: "SEND_DATE", showname: getLabel(111, "发放日期") }
]}/>
<WeaInputNumber min={0} value={limitMonth} <WeaInputNumber min={0} value={limitMonth}
onChange={limitMonth => this.setState({ onChange={limitMonth => this.setState({
salaryBillViewingLimitSetting: { salaryBillViewingLimitSetting: {

View File

@ -37,7 +37,8 @@ class TmpPreview extends Component {
} }
const data = JSON.parse(dataStr); const data = JSON.parse(dataStr);
let theme = data.theme || ""; let theme = data.theme || "";
theme = theme.replaceAll("${salaryMonth}", moment().format("YYYY-MM")); theme = theme.replaceAll("${salaryMonth}", moment().format("YYYY年MM月"));
theme = theme.replaceAll("${salaryYear}", moment().format("YYYY年"));
this.setState({ this.setState({
theme, tip: data.textContent || "", theme, tip: data.textContent || "",
background: data.background || "", background: data.background || "",

View File

@ -11,7 +11,7 @@ import { inject, observer } from "mobx-react";
import { getSearchs } from "../../../../util"; import { getSearchs } from "../../../../util";
import * as API from "../../../../apis/payrollFiles"; import * as API from "../../../../apis/payrollFiles";
import { salaryFileSearchConditions } from "../../config"; import { salaryFileSearchConditions } from "../../config";
import { getTaxAgentSelectList } from "../../../../apis/taxAgent"; import { postFetch } from "../../../../util/request";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey; const getKey = WeaTools.getKey;
@ -29,7 +29,7 @@ class salaryFileAdvanceSearchPannel extends Component {
async componentDidMount() { async componentDidMount() {
const [{ data: userStatusList }, { data: taxAgentList }] = await Promise.all([ const [{ data: userStatusList }, { data: taxAgentList }] = await Promise.all([
API.commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }), API.commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }),
getTaxAgentSelectList() postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" })
]); ]);
this.setState({ this.setState({
searchConditions: _.map(salaryFileSearchConditions, item => { searchConditions: _.map(salaryFileSearchConditions, item => {
@ -44,7 +44,7 @@ class salaryFileAdvanceSearchPannel extends Component {
} else if (getKey(child) === "taxAgentIds") { } else if (getKey(child) === "taxAgentIds") {
return { return {
...child, ...child,
options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content })) options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name }))
}; };
} }
return { ...child }; return { ...child };

View File

@ -358,6 +358,15 @@ export const salaryFileSearchConditions = [
labelcol: 8, labelcol: 8,
value: "", value: "",
viewAttr: 2 viewAttr: 2
},
{
conditionType: "RANGEPICKER",
domkey: ["adjustSalaryStartDate", "adjustSalaryEndDate"],
fieldcol: 16,
label: getLabel(111, "调薪日期"),
labelcol: 8,
value: "",
viewAttr: 2
} }
], ],
defaultshow: true, defaultshow: true,

View File

@ -253,7 +253,7 @@ export const tempNormalSetConditions = [
colSpan: 1, colSpan: 1,
conditionType: "INPUT", conditionType: "INPUT",
domkey: ["theme"], domkey: ["theme"],
fieldcol: 10, fieldcol: 8,
label: "工资单标题", label: "工资单标题",
lanId: 543588, lanId: 543588,
labelcol: 6, labelcol: 6,

View File

@ -56,7 +56,7 @@ class Index extends Component {
}); });
}; };
getPayrollBaseForm = (props) => { getPayrollBaseForm = (props) => {
const { tmplId: id, payrollStore: { payrollTempForm, payrollTempFeedbackForm, tmplDataSource } } = props; const { detail, tmplId: id, payrollStore: { payrollTempForm, payrollTempFeedbackForm, tmplDataSource } } = props;
getPayrollBaseForm({ id }).then(async ({ status, data }) => { getPayrollBaseForm({ id }).then(async ({ status, data }) => {
if (status) { if (status) {
const { salaryTemplateBaseSet: { salarySobOptions, data: result } } = data; const { salaryTemplateBaseSet: { salarySobOptions, data: result } } = data;
@ -84,7 +84,7 @@ class Index extends Component {
}; };
} else if (getKey(o) === "reissueRule") { } else if (getKey(o) === "reissueRule") {
return { return {
...o, options: [ ...o, viewAttr: !detail ? o.viewAttr : 1, options: [
{ key: "0", showname: getLabel(332, "全部") }, { key: "0", showname: getLabel(332, "全部") },
{ key: "1", showname: getLabel(542696, "按规则") } { key: "1", showname: getLabel(542696, "按规则") }
] ]
@ -92,10 +92,11 @@ class Index extends Component {
} else if (getKey(o) === "replenishRule") { } else if (getKey(o) === "replenishRule") {
return { return {
...o, hide: (_.isNil(fieldsEchoData["reissueRule"]) || fieldsEchoData["reissueRule"] === "0"), ...o, hide: (_.isNil(fieldsEchoData["reissueRule"]) || fieldsEchoData["reissueRule"] === "0"),
options: _.map(replenishRuleOptions, t => ({ key: t.id, showname: t.content })) options: _.map(replenishRuleOptions, t => ({ key: t.id, showname: t.content })),
viewAttr: !detail ? o.viewAttr : 1
}; };
} }
return { ...o }; return { ...o, viewAttr: !detail ? o.viewAttr : 1 };
}) })
}; };
} else if (it.title === "sendSet") { } else if (it.title === "sendSet") {
@ -104,16 +105,16 @@ class Index extends Component {
items: _.map(it.items, o => { items: _.map(it.items, o => {
if (getKey(o) === "autoSendStatus") { if (getKey(o) === "autoSendStatus") {
return { return {
...o, ...o, viewAttr: !detail ? o.viewAttr : 1,
helpfulTitle: getLabel(544272, "开启后,还需在计划任务中配置定时任务,执行工资单定时发送任务;") helpfulTitle: getLabel(544272, "开启后,还需在计划任务中配置定时任务,执行工资单定时发送任务;")
}; };
} else if (getKey(o) === "smsSetting") { } else if (getKey(o) === "smsSetting") {
return { return {
...o, ...o, viewAttr: !detail ? o.viewAttr : 1,
hide: _.isNil(fieldsEchoData["smsStatus"]) || !fieldsEchoData["smsStatus"] || (!_.isNil(fieldsEchoData["smsStatus"]) && (fieldsEchoData["smsStatus"].toString() === "0")) hide: _.isNil(fieldsEchoData["smsStatus"]) || !fieldsEchoData["smsStatus"] || (!_.isNil(fieldsEchoData["smsStatus"]) && (fieldsEchoData["smsStatus"].toString() === "0"))
}; };
} }
return { ...o }; return { ...o, viewAttr: !detail ? o.viewAttr : 1 };
}) })
}; };
} }
@ -125,17 +126,17 @@ class Index extends Component {
items: _.map(it.items, o => { items: _.map(it.items, o => {
if (getKey(o) === "autoAckDays") { if (getKey(o) === "autoAckDays") {
return { return {
...o, ...o, viewAttr: !detail ? o.viewAttr : 1,
hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"], hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"],
helpfulTitle: getLabel(544273, "开启后,还需在计划任务中配置定时任务,执行自动确认任务;邮箱端查看工资单暂不支持确认及反馈;") helpfulTitle: getLabel(544273, "开启后,还需在计划任务中配置定时任务,执行自动确认任务;邮箱端查看工资单暂不支持确认及反馈;")
}; };
} else if (getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") { } else if (getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") {
return { return {
...o, ...o, viewAttr: !detail ? o.viewAttr : 1,
hide: _.isNil(fieldsEchoData["feedbackStatus"]) ? o.hide : !fieldsEchoData["feedbackStatus"] hide: _.isNil(fieldsEchoData["feedbackStatus"]) ? o.hide : !fieldsEchoData["feedbackStatus"]
}; };
} }
return { ...o }; return { ...o, viewAttr: !detail ? o.viewAttr : 1 };
}) })
}; };
} }

View File

@ -1,4 +1,4 @@
import React, { Component } from "react"; import React from "react";
import { WeaSwitch } from "comsMobx"; import { WeaSwitch } from "comsMobx";
import { WeaButtonIcon, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { WeaButtonIcon, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
@ -41,11 +41,13 @@ export const payrollTempNormalSetForm = (form, condition, background, onChange =
/> />
} }
{ {
getKey(fields) === "theme" && getKey(fields) === "theme" && c.viewAttr === 3 &&
<div className="sft-variables"> <div className="sft-variables">
<span className="sftv-tip">{getLabel(500143, "插入变量")}</span> <span className="sftv-tip">{getLabel(500143, "插入变量")}</span>
<a className="sftv-item" <a className="sftv-item"
onClick={() => insertVar("theme", "${companyName}")}>{getLabel(1976, "公司名称")}</a> onClick={() => insertVar("theme", "${companyName}")}>{getLabel(1976, "公司名称")}</a>
<a className="sftv-item"
onClick={() => insertVar("theme", "${salaryYear}")}>{getLabel(111, "薪资所属年")}</a>
<a className="sftv-item" <a className="sftv-item"
onClick={() => insertVar("theme", "${salaryMonth}")}>{getLabel(542604, "薪资所属月")}</a> onClick={() => insertVar("theme", "${salaryMonth}")}>{getLabel(542604, "薪资所属月")}</a>
</div> </div>

View File

@ -12,6 +12,7 @@ import { getPayrollItemList, getPayrollShowForm } from "../../../../apis/payroll
import { tempNormalSetConditions } from "../conditions"; import { tempNormalSetConditions } from "../conditions";
import { payrollTempNormalSetForm } from "./formRender"; import { payrollTempNormalSetForm } from "./formRender";
import SalaryItemSettings from "../../../payroll/stepForm/salaryItemSettings"; import SalaryItemSettings from "../../../payroll/stepForm/salaryItemSettings";
import SalaryItems from "./salaryItems";
const getKey = WeaTools.getKey; const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@ -36,7 +37,9 @@ class Index extends Component {
} }
getPayrollShowForm = () => { getPayrollShowForm = () => {
const { tmplId: id, payrollStore: { payrollTempNormalForm, tmplDataSource, setTmplDataSource } } = this.props; const {
detail, tmplId: id, payrollStore: { payrollTempNormalForm, tmplDataSource, setTmplDataSource }
} = this.props;
getPayrollShowForm({ id }).then(async ({ status, data }) => { getPayrollShowForm({ id }).then(async ({ status, data }) => {
if (status) { if (status) {
const { salaryTemplateShowSet, salaryTemplateSalaryItemSet: salaryItemSet, salaryBillItemNameSet } = data; const { salaryTemplateShowSet, salaryTemplateSalaryItemSet: salaryItemSet, salaryBillItemNameSet } = data;
@ -69,7 +72,7 @@ class Index extends Component {
items: _.map(it.items, o => { items: _.map(it.items, o => {
if (getKey(o) === "textContentPosition") { if (getKey(o) === "textContentPosition") {
return { return {
...o, label: getLabel(o.lanId, o.label), ...o, label: getLabel(o.lanId, o.label), viewAttr: !detail ? o.viewAttr : 1,
options: [ options: [
{ key: "1", showname: getLabel(542697, "薪资项目前") }, { key: "1", showname: getLabel(542697, "薪资项目前") },
{ key: "2", showname: getLabel(542698, "薪资项目后") } { key: "2", showname: getLabel(542698, "薪资项目后") }
@ -77,10 +80,10 @@ class Index extends Component {
}; };
} else if (getKey(o) === "background") { } else if (getKey(o) === "background") {
return { return {
...o, title: getLabel(20001, "上传图片") ...o, viewAttr: !detail ? o.viewAttr : 1, title: getLabel(20001, "上传图片")
}; };
} }
return { ...o, label: getLabel(o.lanId, o.label) }; return { ...o, viewAttr: !detail ? o.viewAttr : 1, label: getLabel(o.lanId, o.label) };
}) })
}; };
} }
@ -150,7 +153,7 @@ class Index extends Component {
render() { render() {
const { conditions, salaryBillItemNameSet, salaryItemSet } = this.state; const { conditions, salaryBillItemNameSet, salaryItemSet } = this.state;
const { payrollStore: { payrollTempNormalForm, tmplDataSource } } = this.props; const { detail, payrollStore: { payrollTempNormalForm, tmplDataSource } } = this.props;
return ( return (
<React.Fragment> <React.Fragment>
{!_.isEmpty(conditions) && payrollTempNormalSetForm(payrollTempNormalForm, conditions, toJS(tmplDataSource).background, this.handleChange, this.handleInsertVar)} {!_.isEmpty(conditions) && payrollTempNormalSetForm(payrollTempNormalForm, conditions, toJS(tmplDataSource).background, this.handleChange, this.handleInsertVar)}
@ -158,20 +161,22 @@ class Index extends Component {
title={ title={
<div className="salarySetTitle"> <div className="salarySetTitle">
<span>{getLabel(543593, "薪资项目设置")}</span> <span>{getLabel(543593, "薪资项目设置")}</span>
<WeaButtonIcon buttonType="add" type="primary" <WeaButtonIcon buttonType="add" type="primary" disabled={detail}
onClick={() => this.salaryItemSettingsRef.handleOpenModal(toJS(tmplDataSource).salarySob, getLabel(543594, "添加分类"))}/> onClick={() => this.salaryItemSettingsRef.handleOpenModal(toJS(tmplDataSource).salarySob, getLabel(543594, "添加分类"))}/>
</div> </div>
} }
items={[]} needTigger showGroup items={[]} needTigger showGroup
> >
<SalaryItemSettings {
ref={dom => this.salaryItemSettingsRef = dom} detail ? <SalaryItems dataSource={salaryItemSet}/> : <SalaryItemSettings
dataSource={salaryItemSet} salaryTemplateId={this.props.tmplId || ""} ref={dom => this.salaryItemSettingsRef = dom}
onChangeSalaryItem={this.handleChangeSalaryItem} dataSource={salaryItemSet} salaryTemplateId={this.props.tmplId || ""}
onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting} onChangeSalaryItem={this.handleChangeSalaryItem}
salarySobId={toJS(tmplDataSource).salarySob} onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting}
isReplenish={false} salaryBillItemNameSet={salaryBillItemNameSet} salarySobId={toJS(tmplDataSource).salarySob}
/> isReplenish={false} salaryBillItemNameSet={salaryBillItemNameSet}
/>
}
</WeaSearchGroup> </WeaSearchGroup>
</React.Fragment> </React.Fragment>
); );

View File

@ -0,0 +1,57 @@
/*
* 工资单模板设置
* 薪资项目查看
* @Author: 黎永顺
* @Date: 2024/11/12
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { toJS } from "mobx";
import { WeaLocaleProvider, WeaSortable } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
class SalaryItems extends Component {
render() {
const { dataSource } = this.props;
const dataList = _.map(toJS(dataSource), item => ({ ...item, id: item.groupId }));
return (
<div className="salaryItemSettingWrapper">
<WeaSortable datas={dataList} draggableType="icon"
renderNodeItem={(item) => {
return <div className="salaryItemWrapper">
<div className="salaryItemHeader">
<span className="titleWrapper">
<span className="salaryClassTitle">{item.groupName}</span>
<span className="iconWrapper"/>
</span>
</div>
<div className="salaryItemContent">
{
!_.isEmpty(item.items) ?
<WeaSortable
datas={item.items} draggableType="icon"
renderNodeItem={(filed) => {
return <div className="salaryItemList">
<div className="salaryItem" title={filed.name}>
<div className="salaryItemName"> {filed.name} </div>
</div>
</div>;
}}
className="wea-sortable-salary-item"
/> :
<div className="empty">暂无数据</div>
}
</div>
</div>;
}}
className="wea-sortable-salary-item"
/>
</div>
);
}
}
export default SalaryItems;

View File

@ -8,6 +8,7 @@ import React, { Component } from "react";
import { toJS } from "mobx"; import { toJS } from "mobx";
import { WeaButtonIcon, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; import { WeaButtonIcon, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
import SalaryItemSettings from "../../../payroll/stepForm/salaryItemSettings"; import SalaryItemSettings from "../../../payroll/stepForm/salaryItemSettings";
import SalaryItems from "../payrollTempNormalSet/salaryItems";
import { getReplenishForm } from "../../../../apis/payroll"; import { getReplenishForm } from "../../../../apis/payroll";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@ -68,27 +69,30 @@ class Index extends Component {
}; };
render() { render() {
const { payrollStore: { tmplDataSource } } = this.props; const { payrollStore: { tmplDataSource }, detail } = this.props;
const { replenishSalaryTemplateSalaryItemSet, salaryBillItemNameSet } = this.state; const { replenishSalaryTemplateSalaryItemSet, salaryBillItemNameSet } = this.state;
return ( return (
<WeaSearchGroup <WeaSearchGroup
title={ title={
<div className="salarySetTitle"> <div className="salarySetTitle">
<span>{getLabel(543593, "薪资项目设置")}</span> <span>{getLabel(543593, "薪资项目设置")}</span>
<WeaButtonIcon buttonType="add" type="primary" <WeaButtonIcon buttonType="add" type="primary" disabled={detail}
onClick={() => this.salaryItemSettingsRef.handleOpenModal(toJS(tmplDataSource).salarySob, getLabel(543594, "添加分类"))}/> onClick={() => this.salaryItemSettingsRef.handleOpenModal(toJS(tmplDataSource).salarySob, getLabel(543594, "添加分类"))}/>
</div> </div>
} }
items={[]} needTigger showGroup> items={[]} needTigger showGroup>
<SalaryItemSettings {
ref={dom => this.salaryItemSettingsRef = dom} detail ? <SalaryItems dataSource={replenishSalaryTemplateSalaryItemSet}/> :
dataSource={replenishSalaryTemplateSalaryItemSet} <SalaryItemSettings
onChangeSalaryItem={this.handleChangeSalaryItem} ref={dom => this.salaryItemSettingsRef = dom}
onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting} dataSource={replenishSalaryTemplateSalaryItemSet}
salarySobId={toJS(tmplDataSource).salarySob} onChangeSalaryItem={this.handleChangeSalaryItem}
salaryTemplateId={this.props.tmplId || ""} onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting}
isReplenish={true} salaryBillItemNameSet={salaryBillItemNameSet} salarySobId={toJS(tmplDataSource).salarySob}
/> salaryTemplateId={this.props.tmplId || ""}
isReplenish={true} salaryBillItemNameSet={salaryBillItemNameSet}
/>
}
</WeaSearchGroup> </WeaSearchGroup>
); );
} }

View File

@ -22,7 +22,7 @@ class Index extends Component {
copyDialog: { visible: false, title: "", copyId: "", salarySobId: "" }, copyDialog: { visible: false, title: "", copyId: "", salarySobId: "" },
tmplSlide: { tmplSlide: {
visible: false, tmplId: "", top: 0, width: 792, height: 100, visible: false, tmplId: "", top: 0, width: 792, height: 100,
measureT: "%", measureX: "px", measureY: "%" measureT: "%", measureX: "px", measureY: "%", detail: false
} }
}; };
} }
@ -79,9 +79,10 @@ class Index extends Component {
const { copyDialog, tmplSlide, selectedRowKeys } = this.state; const { copyDialog, tmplSlide, selectedRowKeys } = this.state;
const { id, salarySobId } = record; const { id, salarySobId } = record;
switch (key) { switch (key) {
case "view":
case "edit": case "edit":
this.setState({ this.setState({
tmplSlide: { ...tmplSlide, visible: true, tmplId: id } tmplSlide: { ...tmplSlide, visible: true, tmplId: id, detail: key === "view" }
}); });
break; break;
case "copy": case "copy":
@ -171,7 +172,8 @@ class Index extends Component {
> >
<a href="javascript:void(0);"><i className="icon-coms-more"/></a> <a href="javascript:void(0);"><i className="icon-coms-more"/></a>
</Dropdown> </Dropdown>
</React.Fragment> : <a href="javascript:void(0);">{getLabel(83110, "")}</a>; </React.Fragment> : <a href="javascript:void(0);"
onClick={() => this.handleOpts({ key: "view" }, record)}>{getLabel(83110, "查看详情")}</a>;
} }
} }
]} ]}

View File

@ -123,7 +123,7 @@ class Index extends Component {
}).catch(() => this.setState({ loading: false })); }).catch(() => this.setState({ loading: false }));
}; };
renderTitle = () => { renderTitle = () => {
const { tmplId } = this.props, { current, loading } = this.state; const { tmplId, detail } = this.props, { current, loading } = this.state;
const { payrollStore: { payrollTempNormalForm, setTmplDataSource, tmplDataSource } } = this.props; const { payrollStore: { payrollTempNormalForm, setTmplDataSource, tmplDataSource } } = this.props;
return <div className="payroll-title-flex titleDialog"> return <div className="payroll-title-flex titleDialog">
<div className="titleCol titleLeftBox"> <div className="titleCol titleLeftBox">
@ -156,7 +156,11 @@ class Index extends Component {
<React.Fragment> <React.Fragment>
<Button type="ghost" <Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button> onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>
<Button type="primary" loading={loading} onClick={this.savePayroll}>{getLabel(537558, "保存")}</Button> {
!detail &&
<Button type="primary" loading={loading}
onClick={this.savePayroll}>{getLabel(537558, "保存")}</Button>
}
</React.Fragment> </React.Fragment>
} }
</div> </div>
@ -185,8 +189,29 @@ class Index extends Component {
payrollStore: { payrollStore: {
initPayrollTempForm, initPayrollTempFeedbackForm, setSalaryBillItemNameSetting, initPayrollTempForm, initPayrollTempFeedbackForm, setSalaryBillItemNameSetting,
initPayrollTempNormalForm, setTmplDataSource, hasBeenModify initPayrollTempNormalForm, setTmplDataSource, hasBeenModify
}, onClose }, onClose, detail
} = this.props; } = this.props;
if (detail) {
initPayrollTempForm();
initPayrollTempFeedbackForm();
initPayrollTempNormalForm();
setTmplDataSource({});
setSalaryBillItemNameSetting([
{
salaryTemplateId: "",
salaryBillType: 0,
itemShowNameSetting: []
},
{
salaryTemplateId: "",
salaryBillType: 1,
itemShowNameSetting: []
}
]);
this.setState({ current: 0 });
onClose(type);
return;
}
if (hasBeenModify) { if (hasBeenModify) {
Modal.confirm({ Modal.confirm({
title: getLabel(131329, "信息确认"), title: getLabel(131329, "信息确认"),

View File

@ -27,6 +27,7 @@
.salary-payroll-content { .salary-payroll-content {
padding: 8px 16px; padding: 8px 16px;
height: 100%; height: 100%;
overflow-y: auto;
& > .wea-search-group { & > .wea-search-group {
background: #FFF; background: #FFF;
@ -157,7 +158,7 @@
margin-left: 10px; margin-left: 10px;
position: absolute; position: absolute;
top: 25%; top: 25%;
right: -208px; right: -262px;
margin-top: -2px; margin-top: -2px;
.sftv-item { .sftv-item {

View File

@ -59,6 +59,24 @@ export const conditions = [
lanId: 543358, lanId: 543358,
defaultshow: true defaultshow: true
}, },
{
items: [
{
conditionType: "SWITCH",
domkey: ["openSecondaryAccount"],
fieldcol: 10,
label: "启用主次账号",
tip: "启用后,若有次账号相关档案,则此功能不能关闭。",
tipLanId: 111,
lanId: 111,
labelcol: 8,
viewAttr: 2
}
],
title: "主次身份",
lanId: 111,
defaultshow: true
},
{ {
items: [ items: [
{ {
@ -196,6 +214,16 @@ export const conditions = [
options: [], options: [],
labelcol: 8, labelcol: 8,
viewAttr: 2 viewAttr: 2
},
{
conditionType: "SELECT",
domkey: ["SALARY_DETAILS_REPORT_SHOW_TYPE"],
fieldcol: 10,
label: "薪资明细显示模式",
lanId: 111,
options: [],
labelcol: 8,
viewAttr: 2
} }
], ],
title: "薪资报表", title: "薪资报表",
@ -219,6 +247,51 @@ export const conditions = [
// defaultshow: true // defaultshow: true
// }, // },
]; ];
export const salaryApprovalConditions = [
{
items: [
{
conditionType: "SWITCH",
domkey: ["SALARY_APPROVAL_STATUS"],
fieldcol: 10,
label: "薪资审批",
lanId: 111,
labelcol: 8,
viewAttr: 2
},
{
conditionType: "SWITCH",
domkey: ["APPROVAL_CAN_MANUAL_FILE_STATUS"],
fieldcol: 10,
label: "开启审批的核算记录允许手动归档",
lanId: 111,
labelcol: 8,
viewAttr: 2
},
{
conditionType: "SWITCH",
domkey: ["APPROVAL_CAN_RE_CALC_STATUS"],
fieldcol: 10,
label: "开启审批的核算记录允许重新核算",
lanId: 111,
labelcol: 8,
viewAttr: 2
},
{
conditionType: "SWITCH",
domkey: ["APPROVAL_CAN_EDIT_RESULT_STATUS"],
fieldcol: 10,
label: "审批流程发起后允许修改核算数据",
lanId: 111,
labelcol: 8,
viewAttr: 2
}
],
title: "薪资审批设置",
lanId: 111,
defaultshow: true
}
];
export const payloadList = [ export const payloadList = [
{ enumClass: "com.engine.salary.sys.enums.SalaryAcctEmployeeRuleEnum" }, { enumClass: "com.engine.salary.sys.enums.SalaryAcctEmployeeRuleEnum" },
{ enumClass: "com.engine.salary.sys.enums.OrderRuleEnum" }, { enumClass: "com.engine.salary.sys.enums.OrderRuleEnum" },

View File

@ -1,8 +1,9 @@
import React from "react"; import React from "react";
import { WeaFormItem, WeaSearchGroup, WeaTools } from "ecCom"; import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import { WeaSwitch } from "comsMobx"; import { WeaSwitch } from "comsMobx";
const getKey = WeaTools.getKey; const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
export const renderRuleForm = (form, condition, onChange) => { export const renderRuleForm = (form, condition, onChange) => {
const { isFormInit } = form; const { isFormInit } = form;
@ -14,7 +15,12 @@ export const renderRuleForm = (form, condition, onChange) => {
items.push({ items.push({
com: ( com: (
<WeaFormItem <WeaFormItem
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }} label={<div className="customFormLabel">
<span>{fields.label}</span>
{fields.tip && <WeaHelpfulTip width={200} title={getLabel(fields.tipLanId, fields.tip)}
placement="topLeft"/>}
</div>}
labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom"> tipPosition="bottom">
<WeaSwitch <WeaSwitch

View File

@ -8,6 +8,19 @@
height: 100%; height: 100%;
overflow: hidden auto; overflow: hidden auto;
.wea-form-item .wea-form-item-label.colon:after {
display: none;
}
.customFormLabel {
display: flex;
align-items: center;
& > span {
margin-right: 4px;
}
}
.wea-search-group { .wea-search-group {
background: #fff; background: #fff;
margin-bottom: 16px; margin-bottom: 16px;

View File

@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom"; import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom";
import { message, Modal } from "antd"; import { message, Modal } from "antd";
import * as API from "../../apis/ruleconfig"; import * as API from "../../apis/ruleconfig";
import { conditions, payloadList } from "./conditions"; import { conditions, payloadList, salaryApprovalConditions } from "./conditions";
import ProgressModal from "../../components/progressModal"; import ProgressModal from "../../components/progressModal";
import { renderRuleForm } from "./form"; import { renderRuleForm } from "./form";
import { getConditionDomkeys } from "../../util"; import { getConditionDomkeys } from "../../util";
@ -33,12 +33,13 @@ class RuleConfig extends Component {
} }
init = async () => { init = async () => {
const { data: sysinfo } = await API.sysinfo(); const [{ data: sysinfo }, { data: confCode }] = await Promise.all([API.sysinfo(), API.sysConfCodeRule({ code: "SHOW_SALARY_ACCT_APPROVAL" })]);
const [{ data: matchRule }, { data: orderRule }, { data: ascOrDesc }, { data: rule }] = const [{ data: matchRule }, { data: orderRule }, { data: ascOrDesc }, { data: rule }] =
await Promise.all(_.map(payloadList, it => API.commonEnumList(it))); await Promise.all(_.map(payloadList, it => API.commonEnumList(it)));
const optionsList = { matchRule, orderRule, ascOrDesc, rule }; const optionsList = { matchRule, orderRule, ascOrDesc, rule };
const conditonsSlice = confCode === "1" ? [...conditions, ...salaryApprovalConditions] : conditions;
this.setState({ this.setState({
sysinfo, conditions: _.map(conditions, item => ({ sysinfo, conditions: _.map(conditonsSlice, item => ({
...item, title: getLabel(item.lanId, item.title), ...item, title: getLabel(item.lanId, item.title),
items: _.map(item.items, o => { items: _.map(item.items, o => {
o = { ...o, label: getLabel(o.lanId, o.label) }; o = { ...o, label: getLabel(o.lanId, o.label) };
@ -51,6 +52,13 @@ class RuleConfig extends Component {
{ key: "1", showname: getLabel(111, "实时组织信息"), selected: false } { key: "1", showname: getLabel(111, "实时组织信息"), selected: false }
] ]
}; };
} else if (getKey(o) === "SALARY_DETAILS_REPORT_SHOW_TYPE") {
return {
...o, options: [
{ key: "0", showname: getLabel(111, "定制列"), selected: true },
{ key: "1", showname: getLabel(111, "模板"), selected: false }
]
};
} else if (getKey(o) === "OPEN_APPLICATION_ENCRYPT") { } else if (getKey(o) === "OPEN_APPLICATION_ENCRYPT") {
return { ...o, viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 }; return { ...o, viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 };
} else if (getKey(o) === "taxDeclarationFunction") { } else if (getKey(o) === "taxDeclarationFunction") {
@ -58,6 +66,13 @@ class RuleConfig extends Component {
...o, ...o,
viewAttr: (_.isNil(sysinfo.taxDeclarationFunction) || sysinfo.taxDeclarationFunction !== "0") ? 2 : 1 viewAttr: (_.isNil(sysinfo.taxDeclarationFunction) || sysinfo.taxDeclarationFunction !== "0") ? 2 : 1
}; };
} else if (
getKey(o) === "APPROVAL_CAN_MANUAL_FILE_STATUS" || getKey(o) === "APPROVAL_CAN_RE_CALC_STATUS" || getKey(o) === "APPROVAL_CAN_EDIT_RESULT_STATUS"
) {
return {
...o,
hide: sysinfo["SALARY_APPROVAL_STATUS"] === "0" || _.isNil(sysinfo["SALARY_APPROVAL_STATUS"])
};
} }
return { ...o }; return { ...o };
}) })
@ -78,12 +93,16 @@ class RuleConfig extends Component {
form.updateFields({ [item]: { value: sysinfo["salaryAcctEmployeeRule"] || "" } }); form.updateFields({ [item]: { value: sysinfo["salaryAcctEmployeeRule"] || "" } });
} else if (item === "taxDeclarationFunction") { } else if (item === "taxDeclarationFunction") {
form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "1") } }); form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "1") } });
} else if (item === "REPORT_ORGANIZATIN_TYPE") { } else if (item === "REPORT_ORGANIZATIN_TYPE" || item === "SALARY_DETAILS_REPORT_SHOW_TYPE") {
form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "0") } }); form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "0") } });
} else if (item === "taxAgentShowStatus" || item === "salaryShowStatus" || item === "adjustShowStatus") { } else if (item === "taxAgentShowStatus" || item === "salaryShowStatus" || item === "adjustShowStatus") {
form.updateFields({ [item]: { value: sysinfo[item] || "1" } }); form.updateFields({ [item]: { value: sysinfo[item] || "1" } });
} else if (item === "OPEN_APPLICATION_ENCRYPT") { } else if (item === "OPEN_APPLICATION_ENCRYPT") {
form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "") } }); form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "") } });
} else if (
item === "APPROVAL_CAN_MANUAL_FILE_STATUS" || item === "APPROVAL_CAN_RE_CALC_STATUS" || item === "APPROVAL_CAN_EDIT_RESULT_STATUS"
) {
form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "0") } });
} else { } else {
form.updateFields({ [item]: { value: sysinfo[item] || "" } }); form.updateFields({ [item]: { value: sysinfo[item] || "" } });
} }
@ -128,6 +147,12 @@ class RuleConfig extends Component {
case "salaryShowStatus": case "salaryShowStatus":
case "adjustShowStatus": case "adjustShowStatus":
case "REPORT_ORGANIZATIN_TYPE": case "REPORT_ORGANIZATIN_TYPE":
case "SALARY_DETAILS_REPORT_SHOW_TYPE":
case "openSecondaryAccount":
case "SALARY_APPROVAL_STATUS":
case "APPROVAL_CAN_MANUAL_FILE_STATUS":
case "APPROVAL_CAN_RE_CALC_STATUS":
case "APPROVAL_CAN_EDIT_RESULT_STATUS":
if (!this.handleDebounce) { if (!this.handleDebounce) {
this.handleDebounce = _.debounce(() => { this.handleDebounce = _.debounce(() => {
const confTitle = { const confTitle = {
@ -138,7 +163,13 @@ class RuleConfig extends Component {
taxAgentShowStatus: getLabel(111, "显示【个税扣缴义务人】信息"), taxAgentShowStatus: getLabel(111, "显示【个税扣缴义务人】信息"),
salaryShowStatus: getLabel(111, "显示工资单页签"), salaryShowStatus: getLabel(111, "显示工资单页签"),
adjustShowStatus: getLabel(111, "显示调薪记录页签"), adjustShowStatus: getLabel(111, "显示调薪记录页签"),
REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息") REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息"),
SALARY_DETAILS_REPORT_SHOW_TYPE: getLabel(111, "薪资明细显示模式"),
openSecondaryAccount: getLabel(111, "启用主次身份"),
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, "审批流程发起后允许修改核算数据")
}; };
this.unifiedSettings(key, confTitle[key]); this.unifiedSettings(key, confTitle[key]);
this.handleDebounce = null; this.handleDebounce = null;
@ -311,6 +342,20 @@ class RuleConfig extends Component {
API.saveSysOperate(payload).then(({ status, errormsg }) => { API.saveSysOperate(payload).then(({ status, errormsg }) => {
if (status) { if (status) {
message.success(getLabel(22619, "保存成功!")); message.success(getLabel(22619, "保存成功!"));
if (confKey === "SALARY_APPROVAL_STATUS") {
this.setState({
conditions: _.map(this.state.conditions, item => ({
...item, items: _.map(item.items, o => {
if (
getKey(o) === "APPROVAL_CAN_MANUAL_FILE_STATUS" || getKey(o) === "APPROVAL_CAN_RE_CALC_STATUS" || getKey(o) === "APPROVAL_CAN_EDIT_RESULT_STATUS"
) {
return { ...o, hide: form.getFormParams()[confKey] === "0" };
}
return { ...o };
})
}))
});
}
} else { } else {
message.error(errormsg || getLabel(22620, "保存失败!")); message.error(errormsg || getLabel(22620, "保存失败!"));
} }

View File

@ -30,7 +30,9 @@ class PersonalScope extends Component {
this.state = { this.state = {
searchValue: "", selectedKey: "listInclude", rowKeys: [], loading: false, searchValue: "", selectedKey: "listInclude", rowKeys: [], loading: false,
extEmpsWitch: "1", //非系统人员开关, 1 开启, 0关闭 extEmpsWitch: "1", //非系统人员开关, 1 开启, 0关闭
personalAddModal: { visible: false, externalVisible: false, title: getLabel(111, "关联人员"), includeType: "" }, personalAddModal: {
visible: false, externalVisible: false, title: getLabel(111, "关联人员"), includeType: "", record: {}
},
importParams: { importParams: {
visible: false, title: getLabel(111, "数据导入"), nextloading: false, importResult: {}, imageId: "", visible: false, title: getLabel(111, "数据导入"), nextloading: false, importResult: {}, imageId: "",
link: `/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${props.taxAgentId}`, link: `/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${props.taxAgentId}`,
@ -89,11 +91,11 @@ class PersonalScope extends Component {
* Params: * Params:
* Date: 2022/11/30 * Date: 2022/11/30
*/ */
handleAddPersonal = () => { handleAddPersonal = (record = {}) => {
const { personalAddModal, selectedKey } = this.state; const { personalAddModal, selectedKey } = this.state;
this.setState({ this.setState({
personalAddModal: { personalAddModal: {
...personalAddModal, ...personalAddModal, record,
visible: selectedKey !== "listExt", visible: selectedKey !== "listExt",
externalVisible: selectedKey === "listExt", externalVisible: selectedKey === "listExt",
includeType: selectedKey === "listInclude" ? 1 : 0 includeType: selectedKey === "listInclude" ? 1 : 0
@ -166,7 +168,7 @@ class PersonalScope extends Component {
disabled={_.isEmpty(rowKeys)} disabled={_.isEmpty(rowKeys)}
onClick={this.taxAgentRangeDelete} onClick={this.taxAgentRangeDelete}
/>, />,
<WeaButtonIcon buttonType="add" type="primary" onClick={this.handleAddPersonal}/>, <WeaButtonIcon buttonType="add" type="primary" onClick={() => this.handleAddPersonal()}/>,
<WeaInputSearch <WeaInputSearch
style={{ width: 220 }} style={{ width: 220 }}
value={searchValue} value={searchValue}
@ -197,6 +199,7 @@ class PersonalScope extends Component {
tabActive={selectedKey} tabActive={selectedKey}
searchValue={searchValue} searchValue={searchValue}
onChangeSelectKey={rowKeys => this.setState({ rowKeys })} onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
onEditScope={this.handleAddPersonal}
/> />
{/*非系统人员添加*/} {/*非系统人员添加*/}
<ExternalPersonModal <ExternalPersonModal
@ -210,7 +213,7 @@ class PersonalScope extends Component {
onSuccess={() => this.personalScopeTableRef.getPersonalScopeList()} onSuccess={() => this.personalScopeTableRef.getPersonalScopeList()}
onCancel={(callback) => onCancel={(callback) =>
this.setState({ this.setState({
personalAddModal: { ...personalAddModal, visible: false, includeType: "" } personalAddModal: { ...personalAddModal, visible: false, includeType: "", record: {} }
}, () => callback && callback()) }, () => callback && callback())
} }
/> />

View File

@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react";
import { WeaSwitch } from "comsMobx"; import { WeaSwitch } from "comsMobx";
import { WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import { Button, message } from "antd"; import { Button, message } from "antd";
import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; import { getTaxAgentRangeForm, taxAgentRangeEdit, taxAgentRangeSave } from "../../../apis/taxAgent";
import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; import { personScopeConditions, scopeSelectLinkageDatas } from "./constants";
const getKey = WeaTools.getKey; const getKey = WeaTools.getKey;
@ -26,11 +26,12 @@ class PersonalScopeModal extends Component {
} }
componentWillReceiveProps(nextProps, nextContext) { componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(); if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initPersonScopeForm(); if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initPersonScopeForm();
} }
getTaxAgentRangeForm = () => { getTaxAgentRangeForm = (props) => {
const { record } = props;
getTaxAgentRangeForm().then(({ status, data }) => { getTaxAgentRangeForm().then(({ status, data }) => {
if (status) { if (status) {
const { employeeStatus, targetTypeList } = data; const { employeeStatus, targetTypeList } = data;
@ -39,16 +40,39 @@ class PersonalScopeModal extends Component {
...item, items: _.map(item.items, o => { ...item, items: _.map(item.items, o => {
if (getKey(o) === "employeeStatus") { if (getKey(o) === "employeeStatus") {
return { return {
...o, label: getLabel(o.lanId, o.label), ...o, label: getLabel(o.lanId, o.label), value: !_.isEmpty(record) ? record.status : "",
options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name }))
}; };
} }
return { return {
...o, label: getLabel(o.lanId, o.label), ...o, label: getLabel(o.lanId, o.label), viewAttr: !_.isEmpty(record) ? 1 : 3,
options: _.map(targetTypeList, it => ({ options: _.map(targetTypeList, it => ({
key: it.id, showname: it.name, selected: it.id === "EMPLOYEE" key: it.id, showname: it.name,
selected: !_.isEmpty(record) ? it.id === record.targetType : it.id === "EMPLOYEE"
})), })),
selectLinkageDatas: { ...scopeSelectLinkageDatas } selectLinkageDatas: {
..._.reduce(_.keys(scopeSelectLinkageDatas), (pre, cur) => {
if (cur !== "SQL") {
return {
...pre,
[cur]: {
...scopeSelectLinkageDatas[cur],
browserConditionParam: {
...scopeSelectLinkageDatas[cur].browserConditionParam,
isSingle: true,
replaceDatas: !_.isEmpty(record) ? [{
id: String(record.targetId),
name: record.targetName
}] : []
}
}
};
}
return {
...pre, [cur]: { ...scopeSelectLinkageDatas[cur], value: !_.isEmpty(record) ? record.target : "" }
};
}, {})
}
}; };
}) })
})) }))
@ -57,20 +81,21 @@ class PersonalScopeModal extends Component {
}); });
}; };
taxAgentRangeSave = () => { taxAgentRangeSave = () => {
const { taxAgentStore: { personScopeForm } } = this.props; const { taxAgentStore: { personScopeForm }, record = {} } = this.props;
personScopeForm.validateForm().then(f => { personScopeForm.validateForm().then(f => {
if (f.isValid) { if (f.isValid) {
const { employeeStatus, targetType, target } = personScopeForm.getFormParams(); const { employeeStatus, targetType, target } = personScopeForm.getFormParams();
const { includeType, taxAgentId } = this.props; const { includeType, taxAgentId } = this.props;
const payload = { const payload = {
includeType, taxAgentId, employeeStatus: employeeStatus.split(","), includeType, taxAgentId, employeeStatus: employeeStatus.split(","), id: record.id,
targetParams: _.map(target.split(","), it => ({ targetParams: _.map(target.split(","), it => ({
targetType, targetId: targetType === "SQL" ? "0" : it, targetType, targetId: targetType === "SQL" ? "0" : it,
target: targetType === "SQL" ? target : "" target: targetType === "SQL" ? target : ""
})) }))
}; };
this.setState({ loading: true }); this.setState({ loading: true });
taxAgentRangeSave(payload).then(({ status, errormsg }) => { const API = !_.isEmpty(record) ? taxAgentRangeEdit : taxAgentRangeSave;
API(payload).then(({ status, errormsg }) => {
this.setState({ loading: false }); this.setState({ loading: false });
if (status) { if (status) {
message.success(getLabel(111, "操作成功!")); message.success(getLabel(111, "操作成功!"));

View File

@ -64,7 +64,10 @@ class PersonalScopeTable extends Component {
columns: _.map(columns, item => { columns: _.map(columns, item => {
return { return {
...item, ...item,
render: (text) => { render: (text, record) => {
if (item.dataIndex === "targetName") {
return <a href="javascript:void(0);" onClick={() => this.props.onEditScope(record)}>{text}</a>;
}
return <span className="tdEllipsis" title={text}>{text}</span>; return <span className="tdEllipsis" title={text}>{text}</span>;
} }
}; };

View File

@ -22,7 +22,7 @@ export default class SalaryItem extends React.Component {
name: "", isQuery: false, loading: false, sysVisible: false, name: "", isQuery: false, loading: false, sysVisible: false,
customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗 customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗
syncSalarySetDialog: { visible: false, id: "" }, // 同步到薪资账套弹窗 syncSalarySetDialog: { visible: false, id: "" }, // 同步到薪资账套弹窗
logDialogVisible: false, filterConditions: "[]", logDialogVisible: false, filterConditions: "[]", selectedRowKeys: [],
salaryItemImpDialog: { visible: false, title: getLabel(24023, "数据导入") } salaryItemImpDialog: { visible: false, title: getLabel(24023, "数据导入") }
}; };
} }

View File

@ -62,7 +62,6 @@ class RegEditDetial extends Component {
otherComJson: {} otherComJson: {}
}; };
_.forEach(socialData.dataSource, item => { _.forEach(socialData.dataSource, item => {
console.log(item)
if (item.personalPaymentAmount) { if (item.personalPaymentAmount) {
payload["socialPerJson"][item["insuranceId"]] = toDecimal_n(item.personalPaymentAmount, item.personalPaymentAmountValidNum || 2); payload["socialPerJson"][item["insuranceId"]] = toDecimal_n(item.personalPaymentAmount, item.personalPaymentAmountValidNum || 2);
} }
@ -164,7 +163,6 @@ class RegEditDetial extends Component {
const social = this.combinedData(socialSecurity, result); const social = this.combinedData(socialSecurity, result);
const fund = this.combinedData(accumulationFund, result); const fund = this.combinedData(accumulationFund, result);
const other = this.combinedData(otherBenefits, result); const other = this.combinedData(otherBenefits, result);
console.log(social)
this.setState({ this.setState({
listMap: [ listMap: [
{ {

View File

@ -21,10 +21,30 @@ export default class AddTaxAgentModal extends React.Component {
selectedKey: "EMPLOYEE", selectedKey: "EMPLOYEE",
checkboxValue: "", checkboxValue: "",
checkAll: "0", checkAll: "0",
ids: "" ids: "",
idsName: ""
}; };
} }
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
if (!_.isEmpty(nextProps.scopeRecord)) {
const { employeeStatus } = nextProps;
const checked = _.map(employeeStatus, it => it.id);
const bool = _.every(checked, it => nextProps.scopeRecord.status.indexOf(it) !== -1);
this.setState({
selectedKey: nextProps.scopeRecord.targetType,
checkboxValue: nextProps.scopeRecord.status,
checkAll: bool ? "1" : "0",
ids: nextProps.scopeRecord.targetType === "SQL" ? nextProps.scopeRecord.target : String(nextProps.scopeRecord.targetId),
idsName: nextProps.scopeRecord.targetName
});
} else {
this.handleReset();
}
}
}
onCheckboxChange = (checkboxValue) => { onCheckboxChange = (checkboxValue) => {
const { employeeStatus } = this.props; const { employeeStatus } = this.props;
const checked = _.map(employeeStatus, it => it.id); const checked = _.map(employeeStatus, it => it.id);
@ -45,7 +65,7 @@ export default class AddTaxAgentModal extends React.Component {
// 保存 // 保存
handleSave = () => { handleSave = () => {
const { onTaxAgentSave } = this.props; const { onTaxAgentSave, scopeRecord } = this.props;
const { checkboxValue, ids, selectedKey } = this.state; const { checkboxValue, ids, selectedKey } = this.state;
const payload = { const payload = {
employeeStatus: checkboxValue.split(","), employeeStatus: checkboxValue.split(","),
@ -67,21 +87,22 @@ export default class AddTaxAgentModal extends React.Component {
this.refs.weaError1.showError(); this.refs.weaError1.showError();
return; return;
} }
onTaxAgentSave && onTaxAgentSave(payload); onTaxAgentSave && onTaxAgentSave({ ...payload, id: scopeRecord.id });
}; };
// 重置 // 重置
handleReset = () => { handleReset = () => {
this.setState({ this.setState({
selectedKey: "EMPLOYEE", selectedKey: !_.isEmpty(this.props.scopeRecord) ? this.props.scopeRecord.targetType : "EMPLOYEE",
checkboxValue: "", checkboxValue: "",
checkAll: "0", checkAll: "0",
ids: "" ids: "",
idsName: ""
}); });
}; };
render() { render() {
const { employeeStatus, targetTypeList, visible, onCancel, loading } = this.props; const { employeeStatus, targetTypeList, visible, onCancel, loading, scopeRecord } = this.props;
return ( return (
<WeaDialog <WeaDialog
visible={visible} visible={visible}
@ -107,7 +128,7 @@ export default class AddTaxAgentModal extends React.Component {
<Col span={16}> <Col span={16}>
<div style={{ display: "inline-block", marginRight: 12 }}> <div style={{ display: "inline-block", marginRight: 12 }}>
<WeaSelect <WeaSelect
style={{ height: "30px" }} style={{ height: "30px" }} disabled={!_.isEmpty(scopeRecord)}
options={_.map(targetTypeList, (it) => ({ options={_.map(targetTypeList, (it) => ({
...it, ...it,
key: it.id, key: it.id,
@ -130,11 +151,12 @@ export default class AddTaxAgentModal extends React.Component {
type={17} type={17}
viewAttr={3} viewAttr={3}
value={this.state.ids} value={this.state.ids}
replaceDatas={[{ id: this.state.ids, name: this.state.idsName }]}
title={"人员选择"} title={"人员选择"}
isSingle={false} isSingle={!_.isEmpty(scopeRecord)}
inputStyle={{ width: 200 }} inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => { onChange={(ids, names, datas) => {
this.setState({ ids }); this.setState({ ids, idsName: names });
}} }}
/> />
</WeaError> </WeaError>
@ -148,11 +170,12 @@ export default class AddTaxAgentModal extends React.Component {
type={57} type={57}
viewAttr={3} viewAttr={3}
title="部门选择" title="部门选择"
isSingle={false} isSingle={!_.isEmpty(scopeRecord)}
inputStyle={{ width: 200 }} inputStyle={{ width: 200 }}
value={this.state.ids} value={this.state.ids}
replaceDatas={[{ id: this.state.ids, name: this.state.idsName }]}
onChange={(ids, names, datas) => { onChange={(ids, names, datas) => {
this.setState({ ids }); this.setState({ ids, idsName: names });
}} }}
/> />
</WeaError> </WeaError>
@ -166,11 +189,12 @@ export default class AddTaxAgentModal extends React.Component {
type={164} type={164}
viewAttr={3} viewAttr={3}
title={"分部选择"} title={"分部选择"}
isSingle={false} isSingle={!_.isEmpty(scopeRecord)}
inputStyle={{ width: 200 }} inputStyle={{ width: 200 }}
value={this.state.ids} value={this.state.ids}
replaceDatas={[{ id: this.state.ids, name: this.state.idsName }]}
onChange={(ids, names, datas) => { onChange={(ids, names, datas) => {
this.setState({ ids }); this.setState({ ids, idsName: names });
}} }}
/> />
</WeaError> </WeaError>
@ -184,11 +208,12 @@ export default class AddTaxAgentModal extends React.Component {
type={278} type={278}
viewAttr={3} viewAttr={3}
title={"岗位选择"} title={"岗位选择"}
isSingle={false} isSingle={!_.isEmpty(scopeRecord)}
value={this.state.ids} value={this.state.ids}
replaceDatas={[{ id: this.state.ids, name: this.state.idsName }]}
inputStyle={{ width: 200 }} inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => { onChange={(ids, names, datas) => {
this.setState({ ids }); this.setState({ ids, idsName: names });
}} }}
/> />
</WeaError> </WeaError>

View File

@ -8,6 +8,7 @@ import React, { Component } from "react";
import { message, Modal } from "antd"; import { message, Modal } from "antd";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import SlideTaxagentUser from "./slideTaxagentUser"; import SlideTaxagentUser from "./slideTaxagentUser";
import { taxAgentRangeEdit } from "../../apis/taxAgent";
import "./index.less"; import "./index.less";
const personScopeWarrper = {}; const personScopeWarrper = {};
@ -199,7 +200,7 @@ export default class PersonalScope extends Component {
taxAgentRangeSave = (module) => { taxAgentRangeSave = (module) => {
const { taxAgentId } = this.props; const { taxAgentId } = this.props;
const { pageObj } = this.state; const { pageObj } = this.state;
const { includeType } = module; const { includeType, id } = module;
const { taxAgentRangeSave, taxAgentRangeExtSave } = this.props.taxAgentStore; const { taxAgentRangeSave, taxAgentRangeExtSave } = this.props.taxAgentStore;
this.setState({ submitLoading: true }); this.setState({ submitLoading: true });
if (includeType === "2") { if (includeType === "2") {
@ -214,26 +215,25 @@ export default class PersonalScope extends Component {
} }
}); });
} else { } else {
taxAgentRangeSave({ ...module, taxAgentId }).then( const API= id ? taxAgentRangeEdit : taxAgentRangeSave;
({ status, errormsg }) => { API({ ...module, taxAgentId }).then(({ status, errormsg }) => {
this.setState({ submitLoading: false }); this.setState({ submitLoading: false });
if (status) { if (status) {
this.tagAgentRef.closeModal(); this.tagAgentRef.closeModal();
message.success("新增成功"); message.success("操作成功");
includeType == "1" includeType == "1"
? this.getTaxAgentRangeListInclude({ ? this.getTaxAgentRangeListInclude({
current: pageObj.current, current: pageObj.current,
pageSize: pageObj.pageSize pageSize: pageObj.pageSize
}) })
: this.getTaxAgentRangeListExclude({ : this.getTaxAgentRangeListExclude({
current: pageObj.current, current: pageObj.current,
pageSize: pageObj.pageSize pageSize: pageObj.pageSize
}); });
} else { } else {
message.error(errormsg || "新增失败"); message.error(errormsg);
}
} }
); });
} }
}; };
@ -285,7 +285,7 @@ export default class PersonalScope extends Component {
onTaxAngetSearch={({ targetName, targetWorkcode, tab }) => { onTaxAngetSearch={({ targetName, targetWorkcode, tab }) => {
tab == "1" tab == "1"
? this.getTaxAgentRangeListInclude({ targetName, targetWorkcode }) ? this.getTaxAgentRangeListInclude({ targetName, targetWorkcode })
: tab == "0" ? this.getTaxAgentRangeListExclude({ targetName, targetWorkcode }): : tab == "0" ? this.getTaxAgentRangeListExclude({ targetName, targetWorkcode }) :
this.taxAgentRangelistExt({ targetName, targetWorkcode }); this.taxAgentRangelistExt({ targetName, targetWorkcode });
}} }}
onChangeTab={(tab) => { onChangeTab={(tab) => {

View File

@ -15,6 +15,7 @@ export default class SlideTaxagentUser extends React.Component {
showSearchAd: false, showSearchAd: false,
externalPersonModalVisible: false, //外部人员关联弹框 externalPersonModalVisible: false, //外部人员关联弹框
addTaxagentModalVisible: false, addTaxagentModalVisible: false,
scopeRecord: {},
includeType: "1", includeType: "1",
selectedRowKeys: [], selectedRowKeys: [],
searchValue: "", searchValue: "",
@ -72,7 +73,8 @@ export default class SlideTaxagentUser extends React.Component {
closeModal = () => { closeModal = () => {
this.setState({ this.setState({
addTaxagentModalVisible: false, addTaxagentModalVisible: false,
externalPersonModalVisible: false externalPersonModalVisible: false,
scopeRecord: {}
}, () => { }, () => {
this.addTaxRef && this.addTaxRef.handleReset(); this.addTaxRef && this.addTaxRef.handleReset();
}); });
@ -131,7 +133,8 @@ export default class SlideTaxagentUser extends React.Component {
externalPersonModalVisible, externalPersonModalVisible,
importParams, importParams,
previewDataSource, previewDataSource,
showSearchAd, extEmpsWitch showSearchAd, extEmpsWitch,
scopeRecord
} = this.state; } = this.state;
const { const {
submitLoading, submitLoading,
@ -224,106 +227,33 @@ export default class SlideTaxagentUser extends React.Component {
onSearchChange={searchValue => this.setState({ searchValue })} onSearchChange={searchValue => this.setState({ searchValue })}
onChange={v => this.setState({ includeType: v }, () => onChangeTab && onChangeTab(this.state.includeType))} onChange={v => this.setState({ includeType: v }, () => onChangeTab && onChangeTab(this.state.includeType))}
/> />
{/*<div*/}
{/* style={{*/}
{/* height: "47px",*/}
{/* lineHeight: "47px",*/}
{/* paddingLeft: "10px",*/}
{/* paddingRight: "10px",*/}
{/* display: "flex",*/}
{/* justifyContent: "space-between"*/}
{/* }}>*/}
{/* <div*/}
{/* style={{*/}
{/* display: "inlineBlock",*/}
{/* color: "#666"*/}
{/* }}>*/}
{/* <span*/}
{/* style={{*/}
{/* cursor: "pointer",*/}
{/* color: includeType == 1 ? "#4ba9f2" : "#000"*/}
{/* }}*/}
{/* onClick={() => {*/}
{/* this.handleTabClick(1);*/}
{/* }}>*/}
{/* 人员范围*/}
{/* </span>|<span*/}
{/* style={{*/}
{/* cursor: "pointer",*/}
{/* color: includeType == 0 ? "#4ba9f2" : "#000"*/}
{/* }}*/}
{/* onClick={() => {*/}
{/* this.handleTabClick(0);*/}
{/* }}>*/}
{/* 从范围中排除*/}
{/* </span>*/}
{/* </div>*/}
{/* <div>*/}
{/* <div*/}
{/* style={{*/}
{/* color: "#4ba9f2",*/}
{/* display: "inlineBlock",*/}
{/* float: "left"*/}
{/* }}>*/}
{/* {*/}
{/* (hideIconInTax || showSalaryItemBtn) && <div className="operateBtn">*/}
{/* {*/}
{/* includeType == "1" &&*/}
{/* <Button*/}
{/* type="primary"*/}
{/* size="small"*/}
{/* onClick={() => {*/}
{/* this.setState({ importParams: { ...importParams, visible: true, step: 0 } });*/}
{/* }}*/}
{/* ><span className="icon-coms-leading-in" title="导入"></span></Button>*/}
{/* }*/}
{/* <div className="addOrDelBtn">*/}
{/* <Button type="primary"*/}
{/* size="small"*/}
{/* onClick={() => {*/}
{/* this.handleTabDelete();*/}
{/* }}*/}
{/* ><span className="icon-coms-form-delete-hot" title="删除"></span></Button>*/}
{/* <Button type="primary"*/}
{/* size="small"*/}
{/* style={{ marginRight: 10 }}*/}
{/* onClick={() => this.setState({ addTaxagentModalVisible: true })}*/}
{/* ><span className="icon-coms-Add-to-hot" title="添加"></span></Button>*/}
{/* </div>*/}
{/* </div>*/}
{/* }*/}
{/* </div>*/}
{/* <WeaInputSearch*/}
{/* style={{ marginTop: "8px", float: "right" }}*/}
{/* value={searchValue}*/}
{/* onChange={value => {*/}
{/* this.setState({ searchValue: value });*/}
{/* }}*/}
{/* onSearch={value => {*/}
{/* this.handleSearch(value);*/}
{/* }}*/}
{/* />*/}
{/* </div>*/}
{/*</div>*/}
<div style={{ maxHeight: "500px", scrollY: "scroll" }}> <div style={{ maxHeight: "500px", scrollY: "scroll" }}>
<WeaTable <WeaTable rowKey="id" loading={queryLoading} rowSelection={rowSelection} dataSource={dataSource}
rowKey="id" pagination={pagination}
loading={queryLoading} columns={_.map(taxAgentColumns, o => {
rowSelection={rowSelection} return {
dataSource={dataSource} ...o, render: (text, record) => {
columns={taxAgentColumns} if (o.dataIndex === "targetName") {
pagination={pagination} return <a href="javascript:void(0);" onClick={() => {
/> const key = includeType === "2" ? "externalPersonModalVisible" : "addTaxagentModalVisible";
this.setState({ [key]: true, scopeRecord: record });
}}>{text}</a>;
}
return <span>{text}</span>;
}
};
})}/>
</div> </div>
<ExternalPersonModal <ExternalPersonModal
visible={externalPersonModalVisible} visible={externalPersonModalVisible}
loading={submitLoading} loading={submitLoading}
onCancel={() => this.setState({ externalPersonModalVisible: false })} onCancel={() => this.setState({ externalPersonModalVisible: false, scopeRecord: {} })}
onExternalPersonSave={val => onTaxAgentSave({ ...val, includeType: includeType })} onExternalPersonSave={val => onTaxAgentSave({ ...val, includeType: includeType })}
/> />
<AddTaxAgentModal <AddTaxAgentModal
ref={(ref) => this.addTaxRef = ref} ref={(ref) => this.addTaxRef = ref}
scopeRecord={scopeRecord}
loading={submitLoading} loading={submitLoading}
employeeStatus={employeeStatus} employeeStatus={employeeStatus}
targetTypeList={targetTypeList} targetTypeList={targetTypeList}
@ -332,7 +262,7 @@ export default class SlideTaxagentUser extends React.Component {
onTaxAgentSave({ ...val, includeType: includeType })} onTaxAgentSave({ ...val, includeType: includeType })}
visible={addTaxagentModalVisible} visible={addTaxagentModalVisible}
onCancel={() => { onCancel={() => {
this.setState({ addTaxagentModalVisible: false }); this.setState({ addTaxagentModalVisible: false, scopeRecord: {} });
}} }}
/> />
{importParams.visible && ( {importParams.visible && (

View File

@ -22,6 +22,9 @@ export class AttendanceStore {
@observable extensionForm = new WeaForm(); //扩展属性 @observable extensionForm = new WeaForm(); //扩展属性
@action("报表查看-扩展属性表单初始化") @action("报表查看-扩展属性表单初始化")
initExtensionForm = () => this.extensionForm = new WeaForm(); initExtensionForm = () => this.extensionForm = new WeaForm();
@observable tempForm = new WeaForm(); //扩展属性
@action("薪资明细-模板设置表单初始化")
initTempForm = () => this.tempForm = new WeaForm();
@action("报表查看-分享报表表单初始化") @action("报表查看-分享报表表单初始化")
initShareForm = () => this.shareForm = new WeaForm(); initShareForm = () => this.shareForm = new WeaForm();

View File

@ -1,10 +1,9 @@
import { observable, action, toJS } from "mobx"; import { action, observable } from "mobx";
import { message } from "antd"; import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx"; import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from "../apis/ledger"; // 引入API接口文件 import * as API from "../apis/ledger"; // 引入API接口文件
import { notNull } from "../util/validate"; import { notNull } from "../util/validate";
import { categoryConditions } from "../pages/ledgerPage/config";
const { TableStore } = WeaTableNew; const { TableStore } = WeaTableNew;
@ -13,6 +12,11 @@ export class LedgerStore {
@observable copyForm = new WeaForm(); // 复制form @observable copyForm = new WeaForm(); // 复制form
@observable categoryForm = new WeaForm(); // 新增分类form @observable categoryForm = new WeaForm(); // 新增分类form
@observable searchForm = new WeaForm(); // 查询form @observable searchForm = new WeaForm(); // 查询form
@observable AARForm = new WeaForm(); // 核算审批规则form
@observable AARClassifyForm = new WeaForm(); // 核算审批规则分类编辑form
@action initAARForm = (v) => this.AARForm = new WeaForm();//重置核算审批规则form
@action initAARClassifyForm = (v) => this.AARClassifyForm = new WeaForm();//重置审批规则分类编辑form
/*******************************************************/ /*******************************************************/
@ -148,14 +152,14 @@ export class LedgerStore {
setItemGroups = itemGroups => { setItemGroups = itemGroups => {
itemGroups = itemGroups ? [...itemGroups] : []; itemGroups = itemGroups ? [...itemGroups] : [];
itemGroups && itemGroups &&
itemGroups.map(item => { itemGroups.map(item => {
if (item.items) { if (item.items) {
item.items && item.items &&
item.items.map(i => { item.items.map(i => {
i.key = i.id; i.key = i.id;
}); });
} }
}); });
this.itemGroups = itemGroups; this.itemGroups = itemGroups;
}; };
@ -388,9 +392,9 @@ export class LedgerStore {
if (!this.validateBaseFrom(params)) { if (!this.validateBaseFrom(params)) {
reject("保存失败"); reject("保存失败");
} }
this.saveLoading= true; this.saveLoading = true;
API.saveLedgerBasic(params).then(res => { API.saveLedgerBasic(params).then(res => {
this.saveLoading= false; this.saveLoading = false;
if (res.status) { if (res.status) {
this.salarySobId = res.data; this.salarySobId = res.data;
resolve(); resolve();
@ -463,9 +467,9 @@ export class LedgerStore {
//薪资帐套人员范围(包含)列表 //薪资帐套人员范围(包含)列表
getLedgerPersonRangeInclude = params => { getLedgerPersonRangeInclude = params => {
this.loading= true; this.loading = true;
API.getLedgerPersonRangeInclude(params).then(res => { API.getLedgerPersonRangeInclude(params).then(res => {
this.loading= false; this.loading = false;
if (res.status) { if (res.status) {
this.setUserTableStore(res.data); this.setUserTableStore(res.data);
} else { } else {
@ -476,9 +480,9 @@ export class LedgerStore {
//薪资帐套人员范围(排除)列表 //薪资帐套人员范围(排除)列表
getLedgerPersonRangeExclude = params => { getLedgerPersonRangeExclude = params => {
this.loading= true; this.loading = true;
API.getLedgerPersonRangeExclude(params).then(res => { API.getLedgerPersonRangeExclude(params).then(res => {
this.loading= false; this.loading = false;
if (res.status) { if (res.status) {
this.setUserTableStore(res.data); this.setUserTableStore(res.data);
} else { } else {
@ -508,12 +512,12 @@ export class LedgerStore {
listSalaryItem = (searchValue = "", current = 1) => { listSalaryItem = (searchValue = "", current = 1) => {
let excludeIds = []; let excludeIds = [];
this.itemGroups && this.itemGroups &&
this.itemGroups.map(item => { this.itemGroups.map(item => {
item.items && item.items &&
item.items.map(i => { item.items.map(i => {
excludeIds.push(i.salaryItemId); excludeIds.push(i.salaryItemId);
});
}); });
});
this.loading = true; this.loading = true;
API.listSalaryItem({ name: searchValue, excludeIds, current }).then(res => { API.listSalaryItem({ name: searchValue, excludeIds, current }).then(res => {
if (res.status) { if (res.status) {
@ -562,7 +566,7 @@ export class LedgerStore {
salaryItemId: i.salaryItemId, salaryItemId: i.salaryItemId,
sortedIndex: index + 1, sortedIndex: index + 1,
formulaId: i.formulaId, formulaId: i.formulaId,
itemHide: i.itemHide || "0", itemHide: i.itemHide || "0"
})); }));
return result; return result;
} }
@ -571,14 +575,14 @@ export class LedgerStore {
let params = { let params = {
salarySobId: this.salarySobId, salarySobId: this.salarySobId,
empFields: _.map(this.userSelectedList, (it, idx) => ({...it, sortedIndex:idx })), empFields: _.map(this.userSelectedList, (it, idx) => ({ ...it, sortedIndex: idx })),
itemGroups: itemGroups.filter(item => item.id != "default"), itemGroups: itemGroups.filter(item => item.id != "default"),
items: itemGroups.filter(item => item.id == "default")[0].items items: itemGroups.filter(item => item.id == "default")[0].items
}; };
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.saveLoading= true; this.saveLoading = true;
API.saveLedgerItem(params).then(res => { API.saveLedgerItem(params).then(res => {
this.saveLoading= false; this.saveLoading = false;
if (res.status) { if (res.status) {
resolve(); resolve();
message.success("保存成功"); message.success("保存成功");
@ -626,9 +630,9 @@ export class LedgerStore {
ruleParams: this.sobItemRuleDataSource ruleParams: this.sobItemRuleDataSource
}; };
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.saveLoading= true; this.saveLoading = true;
API.saveAdjustmentRule(params).then(res => { API.saveAdjustmentRule(params).then(res => {
this.saveLoading= false; this.saveLoading = false;
if (res.status) { if (res.status) {
resolve(); resolve();
message.success("保存成功"); message.success("保存成功");