Merge branch 'release/2.16.1.2410.01' into custom/金华交投
# Conflicts: # pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js # pc4mobx/hrmSalary/pages/ruleConfig/conditions.js # pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js
This commit is contained in:
commit
be538d4c1a
|
|
@ -95,7 +95,10 @@ export const comparisonresultList = (params) => {
|
|||
export const refreshTaxAgent = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/refreshTaxAgent", params);
|
||||
};
|
||||
|
||||
// 核算人员--刷新薪资核算人员的
|
||||
export const refreshAcctemployee = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/refresh", params);
|
||||
};
|
||||
// 薪资核算-编辑表单
|
||||
export const acctresultDetail = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/detail", "GET", params);
|
||||
|
|
@ -232,6 +235,10 @@ export const updateLockStatus = (params) => {
|
|||
export const updateLockEmpStatus = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/lockEmp", params);
|
||||
};
|
||||
// 单元格锁定
|
||||
export const updateLockEmpCellStatus = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/lock", params);
|
||||
};
|
||||
// 导入薪资核算添加表头字段缓存
|
||||
export const cacheImportField = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", params);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export const getDetailChanges = params => {
|
|||
};
|
||||
//获取薪资账套全列表
|
||||
export const getSalarysobListAll = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/listAll", params);
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/listAllByAuth", params);
|
||||
};
|
||||
//补算
|
||||
export const supplementAcctRecord = (params) => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { WeaTools } from "ecCom";
|
||||
import { postFetch } from "../util/request";
|
||||
import { postExportFetch, postFetch } from "../util/request";
|
||||
|
||||
// 薪资项目-获取列表
|
||||
export const getItemList = params => {
|
||||
|
|
@ -84,3 +84,19 @@ export const getSalarySobBySalaryItem = params => {
|
|||
export const syncSalaryItemToSalarySobItem = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryitem/syncSalaryItemToSalarySobItem", params);
|
||||
};
|
||||
|
||||
// 导出薪资项目
|
||||
export const exportSalaryitem = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/salaryitem/export", params);
|
||||
};
|
||||
// 下载模板
|
||||
export const downloadTemplate = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/salaryitem/downloadTemplate", params);
|
||||
};
|
||||
|
||||
// 导入薪资项目
|
||||
export const importSalaryitem = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryitem/import", params);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,10 @@ export const deleteLedgerPersonExtRange = params => {
|
|||
export const saveLedgerPersonRange = 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 => {
|
||||
|
|
|
|||
|
|
@ -52,5 +52,5 @@ export const saveSecondaryPwd = params => {
|
|||
return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params);
|
||||
};
|
||||
export const salaryBillGetToken = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/getToken", "GET", params);
|
||||
return postFetch("/api/bs/hrmsalary/salaryBill/getToken", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { WeaTools } from "ecCom";
|
||||
import { postFetch } from "../util/request";
|
||||
import { postExportFetch, postFetch } from "../util/request";
|
||||
import { convertToUrlString } from "../util/url";
|
||||
|
||||
//工资单-工资单发放列表
|
||||
|
|
@ -244,3 +244,12 @@ export const getSmsSalaryItemSet = (params) => {
|
|||
export const genPdfBeforeExport = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/genPdfBeforeExport", "GET", params);
|
||||
};
|
||||
//工资单预览
|
||||
export const salaryBillPreview = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryBill/preview", params);
|
||||
};
|
||||
// 工资单查看详情导出-重构
|
||||
export const exportDetailList_reconfig = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/salaryBill/send/exportDetailList", params);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { WeaTools } from "ecCom";
|
||||
import { postFetch } from "../util/request";
|
||||
import { postExportFetch, postFetch } from "../util/request";
|
||||
|
||||
//通用字典表 {enumClass:""}
|
||||
export const commonEnumList = (params) => {
|
||||
|
|
@ -75,3 +75,15 @@ export const reportGetForm = params => {
|
|||
export const saveSalarySendFeedback = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/sys/saveSalarySendFeedback", params);
|
||||
};
|
||||
// 数据分析列表导出
|
||||
export const exportDataReport = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/report/statistics/report/exportData", params);
|
||||
};
|
||||
//迁入配置
|
||||
export const uploadConfig = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/sys/uploadConfig", params);
|
||||
};
|
||||
//迁入配置
|
||||
export const downloadConfig = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/sys/downloadConfig", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -134,3 +134,19 @@ export const getSalaryListSum = (params) => {
|
|||
export const exportSalaryList = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/report/statistics/employee/exportSalaryList", params);
|
||||
};
|
||||
//薪酬统计报表-保存全局自定义列配置
|
||||
export const savePageListSetting = (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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,6 +48,10 @@ export const deleteTaxAgent = (params) => {
|
|||
export const taxAgentRangeSave = (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) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/range/listExt", params);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
import { WeaTools } from "ecCom";
|
||||
import { postExportFetch, postFetch } from "../util/request";
|
||||
|
||||
//浮动薪酬项目列表
|
||||
export const getVariableSalaryItemList = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalaryItem/listPage", params);
|
||||
};
|
||||
//删除浮动薪酬项目
|
||||
export const deleteVariableSalaryItem = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalaryItem/delete", params);
|
||||
};
|
||||
//获取浮动薪酬项目详情
|
||||
export const getVariableSalaryItemDetail = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalaryItem/getDetail", params);
|
||||
};
|
||||
//保存/更新 浮动薪酬项目
|
||||
export const saveVariableSalaryItem = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalaryItem/save", params);
|
||||
};
|
||||
|
||||
//创建浮动薪酬档案时获取项目信息
|
||||
export const getCreateForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/getCreateForm", params);
|
||||
};
|
||||
//创建浮动薪酬档案
|
||||
export const createVariableSalary = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/createData", params);
|
||||
};
|
||||
//创建浮动薪酬档案
|
||||
export const getVariableSalaryList = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/list", params);
|
||||
};
|
||||
//导入浮动薪酬档案
|
||||
export const importVariableSalary = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/importData", params);
|
||||
};
|
||||
//删除浮动薪酬档案
|
||||
export const deleteVariableSalary = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/deleteSelectData", params);
|
||||
};
|
||||
//获取浮动薪酬档案明细
|
||||
export const getVariableSalaryDetail = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/getDetail", params);
|
||||
};
|
||||
// 获取当前管理员下的所有的个税扣缴义务人
|
||||
export const getAdminTaxAgentList = () => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare: false });
|
||||
};
|
||||
// 浮动薪酬档案导出
|
||||
export const exportVariableSalary = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/variableSalary/export", params);
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 单选
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/3
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import AssociativeSearchMult from "./associativeSearchMult";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class AssociativeSearchSingle extends Component {
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<AssociativeSearchMult {...this.props}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AssociativeSearchSingle;
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 多选
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/29
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Button, Icon, Select } from "antd";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import classNames from "classnames";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const Option = Select.Option;
|
||||
|
||||
class AssociativeSearchMult extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, data: [], activeKey: "", dropdownWidth: 200
|
||||
};
|
||||
this.selectedData = {};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { dropdownWidth } = this.state;
|
||||
const w = $(this.refs.searchWrapperMui).outerWidth();
|
||||
if (dropdownWidth < w) {
|
||||
this.setState({ dropdownWidth: w });
|
||||
}
|
||||
}
|
||||
|
||||
handleSearch = (value) => {
|
||||
this.setState({ loading: true });
|
||||
this.getData(value);
|
||||
};
|
||||
getData = (name = "") => {
|
||||
const { browserConditionParam } = this.props;
|
||||
const {
|
||||
completeURL, filterByName, searchParamsKey, convertDatasource, dataParams = {}
|
||||
} = browserConditionParam;
|
||||
if (_.trim(name)) {
|
||||
let payload = { ...dataParams };
|
||||
searchParamsKey && (payload = { ...payload, [searchParamsKey]: name, current: 1, pageSize: 9999 });
|
||||
postFetch(completeURL, payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status && data.list) {
|
||||
this.setState({
|
||||
data: convertDatasource ? convertDatasource(data.list) : data.list,
|
||||
activeKey: this.getActiveKey(convertDatasource ? convertDatasource(data.list) : data.list)
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
data: filterByName ? _.filter(_.map(data, o => ({
|
||||
...o, id: String(o.id), name: o.name
|
||||
})), k => k.name.indexOf(name) !== -1) : _.map(data, o => ({ ...o, id: String(o.id), name: o.name })),
|
||||
activeKey: this.getActiveKey(data)
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({ data: [], loading: false, activeKey: "" });
|
||||
}
|
||||
};
|
||||
getActiveKey = (data) => {
|
||||
const { selectedValues = [] } = this.props;
|
||||
let v = "";
|
||||
if (data && data.length > 0) {
|
||||
let target = data.filter((d) => selectedValues.indexOf(d.id) === -1);
|
||||
if (!_.isEmpty(target)) v = String(target[0].id);
|
||||
}
|
||||
return v;
|
||||
};
|
||||
getItemById = (id) => {
|
||||
const { data } = this.state, { datas } = this.props;
|
||||
if (datas[id]) return datas[id];
|
||||
if (!_.isEmpty(data)) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (id === data[i].id) return data[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
handleChange = (values) => {
|
||||
this.selectedData = {};
|
||||
values.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
this.props.onChange && this.props.onChange(values, this.selectedData);
|
||||
this.setState({ activeKey: "" });
|
||||
};
|
||||
handleBlur = () => this.setState({ data: [], activeKey: "" });
|
||||
handleClick = (e) => {
|
||||
e && e.preventDefault();
|
||||
const { datas, selectedValues } = this.props;
|
||||
if (this.props.clickCallback) this.props.clickCallback(selectedValues, datas);
|
||||
};
|
||||
isReadOnly = () => {
|
||||
const { viewAttr } = this.props;
|
||||
return viewAttr === 1 || viewAttr === "1";
|
||||
};
|
||||
|
||||
render() {
|
||||
const { data, dropdownWidth } = this.state;
|
||||
const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {} } = this.props;
|
||||
const clsname = classNames({
|
||||
"required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues),
|
||||
"mr12": viewAttr === "3" && _.isEmpty(selectedValues),
|
||||
"wea-associative-single": (isSingle || browserConditionParam.isSingle),
|
||||
"wea-associative-search-mult": !(isSingle || browserConditionParam.isSingle)
|
||||
});
|
||||
if (this.isReadOnly()) {
|
||||
let arr = [];
|
||||
selectedValues && selectedValues.map(v => {
|
||||
let item = datas[v].name;
|
||||
if (_.isString(item)) {
|
||||
arr.push(<a className="child-item wdb">{item}</a>);
|
||||
} else {
|
||||
arr.push(<a className="child-item wdb" dangerouslySetInnerHTML={{ __html: item }}> </a>);
|
||||
}
|
||||
});
|
||||
return (
|
||||
<span className={`wea-associative-search wea-field-readonly ${clsname} `} ref="searchWrapperMui">{arr}</span>
|
||||
);
|
||||
}
|
||||
let options = data.map(d => <Option key={d.id} title={d.name}>{d.name}</Option>);
|
||||
selectedValues && selectedValues.map((v) => {
|
||||
v && options.unshift(<Option key={v} title={datas[v].name}>{datas[v].name}</Option>);
|
||||
});
|
||||
const select = <Select
|
||||
{...this.props}
|
||||
hasScroll={false}
|
||||
hideSelected={true}
|
||||
transitionName=""
|
||||
animation=""
|
||||
multiple={true}
|
||||
notFoundContent=""
|
||||
defaultActiveFirstOption={true}
|
||||
showArrow={false}
|
||||
filterOption={false}
|
||||
defaultValue={selectedValues}
|
||||
value={selectedValues}
|
||||
dropdownStyle={{ minWidth: dropdownWidth }}
|
||||
onSearch={_.debounce(this.handleSearch, 400)}
|
||||
onChange={this.handleChange}
|
||||
onBlur={this.handleBlur}
|
||||
>
|
||||
{options}
|
||||
</Select>;
|
||||
return (
|
||||
<div className={`wea-associative-search ${clsname}`} ref="searchWrapperMui">
|
||||
{select}
|
||||
<Icon type="loading" style={{ display: this.state.loading ? "block" : "none" }}/>
|
||||
<div className="ant-input-group-wrap">
|
||||
<Button type="ghost" icon="search" onClick={this.handleClick}/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AssociativeSearchMult;
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* 自定义组件
|
||||
* 下拉树选择框
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { TreeSelect } from "antd";
|
||||
import classNames from "classnames";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class AssociativeTreeMult extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
data: []
|
||||
};
|
||||
this.selectedData = {};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { treeData } = this.props;
|
||||
this.setState({ data: this.filterTree(treeData) });
|
||||
}
|
||||
|
||||
handleChange = (values) => {
|
||||
this.selectedData = {};
|
||||
values.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
this.props.onChange && this.props.onChange(values, this.selectedData);
|
||||
};
|
||||
getItemById = (id) => {
|
||||
const { data } = this.state, { datas } = this.props;
|
||||
if (datas[id]) return datas[id];
|
||||
if (!_.isEmpty(data)) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (id === data[i].id) return data[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
filterTree = (nodes) => {
|
||||
const selectableNodes = [];
|
||||
const recurse = (nodes) => {
|
||||
nodes.forEach((node) => {
|
||||
if (node.selectable) selectableNodes.push(node);
|
||||
if (node.children) recurse(node.children);
|
||||
});
|
||||
};
|
||||
recurse(nodes);
|
||||
return selectableNodes;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { viewAttr, selectedValues, datas, isSingle, treeData } = this.props;
|
||||
const clsname = classNames({
|
||||
"required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues)
|
||||
});
|
||||
const tProps = {
|
||||
treeData,
|
||||
multiple: true,
|
||||
allowClear: false,
|
||||
treeCheckable: true,
|
||||
style: { width: "100%" },
|
||||
treeDefaultExpandAll: true,
|
||||
value: selectedValues,
|
||||
onChange: this.handleChange,
|
||||
dropdownMatchSelectWidth: true,
|
||||
dropdownStyle: { minWidth: 200, maxHeight: 280, overflowY: "auto" },
|
||||
getPopupContainer: (triggerNode) => triggerNode.parentNode
|
||||
};
|
||||
return (
|
||||
<span className={`${clsname}`} ref="treeSelectWrapperMui"><TreeSelect {...tProps} /></span>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AssociativeTreeMult;
|
||||
|
|
@ -0,0 +1,299 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 弹框选择
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable, WeaTransfer } from "ecCom";
|
||||
import { Button, Col, Row, Spin } from "antd";
|
||||
import CustomBrowserMutiLeft from "./customBrowserMutiLeft";
|
||||
import CustomBrowserMutiRight from "./customBrowserMutiRight";
|
||||
import CustomBrowserOperation from "./customBrowserOperation";
|
||||
import { postFetch } from "../../../util/request";
|
||||
|
||||
const WeaTransferList = WeaTransfer.list;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class CustomBrowserDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [],
|
||||
query: { [props.searchParamsKey]: "" }, singleFilterVal: "",
|
||||
leftListSelectedKeys: [], // 左侧table选择的keys
|
||||
leftListSelectedData: [], // 左侧table选择的数据
|
||||
rightCheckedKeys: [], //右侧选择的keys
|
||||
rightDatas: [] // 右侧展示的数据
|
||||
};
|
||||
this.selectedData = {};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.getData();
|
||||
this.setState({
|
||||
selectedRowKeys: nextProps.selectedValues,
|
||||
leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas)
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, query: { [this.props.searchParamsKey]: "" },
|
||||
rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: []
|
||||
});
|
||||
this.selectedData = {};
|
||||
}
|
||||
}
|
||||
|
||||
getData = () => {
|
||||
const { pageInfo, query } = this.state;
|
||||
const { dialogType, completeURL, convertDatasource, dataParams = {} } = this.props;
|
||||
let payload = { ...dataParams, ...query };
|
||||
dialogType === "table" && (payload = { ...pageInfo, ...payload, ...query });
|
||||
this.setState({ loading: true });
|
||||
postFetch(completeURL, payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status && data.list) {
|
||||
const { pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
listDatas: convertDatasource ? convertDatasource(data.list) : data.list,
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
} else {
|
||||
this.setState({ listDatas: _.map(data, o => ({ ...o, id: String(o.id) })) });
|
||||
}
|
||||
});
|
||||
};
|
||||
handleRowClick = record => {
|
||||
if (!this.props.isSingle) return;
|
||||
const values = [record.id];
|
||||
const selectedData = { [record["id"]]: record };
|
||||
this.props.onCancel();
|
||||
this.props.onChange && this.props.onChange(values, selectedData);
|
||||
};
|
||||
handleClear = () => {
|
||||
this.props.onCancel();
|
||||
this.props.onChange && this.props.onChange([], {});
|
||||
};
|
||||
handleOk = () => {
|
||||
const { selectedRowKeys, rightDatas } = this.state, { dialogType } = this.props;
|
||||
const convertSelectedRowKeys = dialogType !== "table" ? rightDatas.map((v) => v.id) : selectedRowKeys;
|
||||
convertSelectedRowKeys.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData);
|
||||
this.props.onCancel && this.props.onCancel();
|
||||
};
|
||||
getItemById = (id) => {
|
||||
const { listDatas } = this.state;
|
||||
if (this.selectedData[id]) return this.selectedData[id];
|
||||
if (!_.isEmpty(listDatas)) {
|
||||
for (let i = 0; i < listDatas.length; i++) {
|
||||
if (String(id) === String(listDatas[i].id)) return listDatas[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
onLeftListCheck = (keys, datas) => {
|
||||
const { leftListSelectedData } = this.state;
|
||||
let targets = leftListSelectedData.concat(datas);
|
||||
targets = _.uniqBy(targets, "id");
|
||||
targets = targets.filter((t) => keys.indexOf(t["id"]) > -1);
|
||||
this.setState({ leftListSelectedKeys: keys, leftListSelectedData: targets });
|
||||
};
|
||||
onleftDoubleClick = (data) => {
|
||||
const { rightDatas } = this.state;
|
||||
this.setState({
|
||||
rightDatas: rightDatas.concat(data),
|
||||
rightCheckedKeys: [],
|
||||
leftListSelectedData: [],
|
||||
leftListSelectedKeys: []
|
||||
});
|
||||
};
|
||||
onRightDoubleClick = (key) => {
|
||||
const { rightDatas } = this.state;
|
||||
const newRightDatas = rightDatas.filter(item => String(item.id) !== key);
|
||||
this.setState({ rightDatas: newRightDatas, rightCheckedKeys: [] });
|
||||
};
|
||||
moveTo = (direction) => {
|
||||
const { rightDatas, rightCheckedKeys, listDatas, leftListSelectedData } = this.state;
|
||||
if (direction === "right") {
|
||||
this.setState({
|
||||
rightDatas: rightDatas.concat(leftListSelectedData),
|
||||
leftListSelectedData: [],
|
||||
leftListSelectedKeys: []
|
||||
});
|
||||
} else if (direction === "left") {
|
||||
this.setState({
|
||||
rightDatas: rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => String(item.id) === checkedKey)),
|
||||
rightCheckedKeys: []
|
||||
});
|
||||
} else if (direction === "allToLeft") {
|
||||
this.setState({ rightDatas: [], rightCheckedKeys: [] });
|
||||
} else if (direction === "allToRight") {
|
||||
if (this.leftListAllActive()) {
|
||||
this.setState({
|
||||
rightDatas: rightDatas.concat(listDatas),
|
||||
rightCheckedKeys: [],
|
||||
leftListSelectedData: [],
|
||||
leftListSelectedKeys: []
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
leftListAllActive = () => {
|
||||
const { rightDatas, listDatas } = this.state;
|
||||
let bool = true;
|
||||
if (_.isEmpty(listDatas)) bool = false;
|
||||
if (!_.isEmpty(listDatas) && !_.isEmpty(rightDatas)) {
|
||||
bool = listDatas.filter((l) => !rightDatas.some(r => l.id === r.id)).length !== 0;
|
||||
}
|
||||
return bool;
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { dialogType, searchParamsKey, isSingle } = this.props, {
|
||||
query, pageInfo, selectedRowKeys, singleFilterVal
|
||||
} = this.state;
|
||||
return (<div className="wea-hr-muti-dialog-title">
|
||||
<span>{getLabel(111, "数据选择")}</span>
|
||||
{
|
||||
dialogType === "table" ?
|
||||
<WeaInputSearch
|
||||
value={query[searchParamsKey]} style={{ width: 220 }}
|
||||
onChange={value => this.setState({ query: { ...query, [searchParamsKey]: value } })}
|
||||
onSearch={() => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => {
|
||||
this.getData();
|
||||
selectedRowKeys.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
});
|
||||
}}/> : isSingle ?
|
||||
<WeaInputSearch value={singleFilterVal} onChange={singleFilterVal => this.setState({ singleFilterVal })}/> :
|
||||
<div/>
|
||||
}
|
||||
</div>);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
loading, listDatas, pageInfo, selectedRowKeys, query, leftListSelectedKeys, rightDatas, rightCheckedKeys,
|
||||
singleFilterVal
|
||||
} = this.state;
|
||||
const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props;
|
||||
const sheight = this.dialog ? this.dialog.state.height - 116 : 260;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={this.handleOk}
|
||||
disabled={dialogType !== "table" && _.isEmpty(rightDatas)}>{getLabel(111, "确 定")}</Button>,
|
||||
<Button type="ghost" onClick={this.handleClear}>{getLabel(111, "清 除")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>];
|
||||
let rightActive = false, leftActive = false, rightAllActive = false;
|
||||
if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true;
|
||||
if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true;
|
||||
if (rightDatas && rightDatas.length > 0) rightAllActive = true;
|
||||
let dom = <Spin spinning={loading}>
|
||||
<div className="wea-hr-muti-dialog">
|
||||
{
|
||||
!isSingle ? <React.Fragment>
|
||||
<div className="wea-hr-muti-input-left">
|
||||
<Row style={{ height: 35 }}>
|
||||
<Col span="24">
|
||||
<WeaInputSearch value={query[searchParamsKey]} onSearch={this.getData}
|
||||
onChange={value => this.setState({ query: { ...query, [searchParamsKey]: value } })}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<div>
|
||||
<WeaNewScroll height={this.dialog ? this.dialog.state.height - 51 : 260}>
|
||||
<CustomBrowserMutiLeft
|
||||
filterData={rightDatas}
|
||||
datas={listDatas}
|
||||
onDoubleClick={this.onleftDoubleClick}
|
||||
onClick={this.onLeftListCheck}
|
||||
selectedKeys={leftListSelectedKeys}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</div>
|
||||
<div className="wea-transfer-opration">
|
||||
<CustomBrowserOperation
|
||||
rightActive={rightActive}
|
||||
leftActive={leftActive}
|
||||
leftAllActive={this.leftListAllActive()}
|
||||
rightAllActive={rightAllActive}
|
||||
moveToRight={() => this.moveTo("right")}
|
||||
moveToLeft={() => this.moveTo("left")}
|
||||
moveAllToRight={() => this.moveTo("allToRight")}
|
||||
moveAllToLeft={() => this.moveTo("allToLeft")}
|
||||
/>
|
||||
</div>
|
||||
<div className="wea-hr-muti-input-right">
|
||||
<CustomBrowserMutiRight
|
||||
height={this.dialog ? this.dialog.state.height - 51 : 260}
|
||||
data={rightDatas} checkedKeys={rightCheckedKeys}
|
||||
checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })}
|
||||
onDoubleClick={this.onRightDoubleClick}
|
||||
/>
|
||||
</div>
|
||||
</React.Fragment> :
|
||||
<WeaTransferList height={this.dialog ? this.dialog.state.height - 16 : 260} checkedKeys={[]}
|
||||
checkedCb={([id]) => this.handleRowClick(_.find(listDatas, item => item.id === id))}
|
||||
data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/>
|
||||
}
|
||||
</div>
|
||||
</Spin>;
|
||||
if (dialogType === "table") {
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => {
|
||||
this.getData();
|
||||
selectedRowKeys.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
});
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => {
|
||||
this.getData();
|
||||
selectedRowKeys.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: selectedRowKeys => this.setState({ selectedRowKeys })
|
||||
};
|
||||
dom = <div className="wea-hr-muti-input-table">
|
||||
<WeaTable dataSource={listDatas} loading={loading} pagination={pagination} scroll={{ y: sheight }}
|
||||
onRowClick={this.handleRowClick} rowSelection={!isSingle ? rowSelection : null}
|
||||
rowKey={rowKey || "id"} columns={columns}/>
|
||||
</div>;
|
||||
}
|
||||
dialogType === "table" && isSingle && buttons.splice(0, 1);
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={this.renderTitle()}
|
||||
className="custom_browser_dialog" draggable={false} style={{
|
||||
width: 784, height: 460, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}} buttons={buttons}>{dom}</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CustomBrowserDialog;
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 选择框左边
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
let timeout = null;
|
||||
|
||||
class CustomBrowserMutiLeft extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.dataObj = {};
|
||||
}
|
||||
|
||||
onClick = (data) => {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(() => {
|
||||
let { selectedKeys } = this.props;
|
||||
let keys = selectedKeys ? [...selectedKeys] : [];
|
||||
let datas = [];
|
||||
if (keys.indexOf(data.id) > -1) {
|
||||
keys = keys.filter((k) => k !== data.id);
|
||||
} else {
|
||||
keys.push(data.id);
|
||||
}
|
||||
keys.forEach((k) => this.dataObj[k] && datas.push(this.dataObj[k]));
|
||||
this.props.onClick && this.props.onClick(keys, datas);
|
||||
}, 200);
|
||||
};
|
||||
onDoubleClick = (data) => {
|
||||
clearTimeout(timeout);
|
||||
this.props.onDoubleClick && this.props.onDoubleClick([data]);
|
||||
};
|
||||
cls = (item) => {
|
||||
const { selectedKeys, filterData } = this.props;
|
||||
let cls = [];
|
||||
if (selectedKeys && selectedKeys.indexOf(item.id) > -1) {
|
||||
cls.push("selected");
|
||||
}
|
||||
if (filterData && filterData.filter((d) => d.id === item.id).length > 0) {
|
||||
cls.push("hide");
|
||||
}
|
||||
return cls.join(" ");
|
||||
};
|
||||
|
||||
render() {
|
||||
const { datas, selectedKeys } = this.props;
|
||||
const list = datas.map(item => {
|
||||
this.dataObj[item.id] = item;
|
||||
return <li className={this.cls(item)} onClick={() => this.onClick(item)}
|
||||
onDoubleClick={() => this.onDoubleClick(item)}>
|
||||
<div className="item-wrap" style={{ fontSize: 12 }}> {item.name} </div>
|
||||
<div className="icon-wrap"/>
|
||||
<i className="icon-coms-Selected"/>
|
||||
</li>;
|
||||
});
|
||||
return (
|
||||
<div className="wea-crm-list">
|
||||
<ul className="wea-crm-list-wrapper">
|
||||
{list}
|
||||
</ul>
|
||||
{
|
||||
list.length === 0 &&
|
||||
<div className="empty-tip" style={{ color: "#2f2929", paddingTop: 30, textAlign: "center" }}>
|
||||
{getLabel(111, "没有可显示的数据")}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CustomBrowserMutiLeft;
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 选择框右边
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom";
|
||||
import { Tree } from "antd";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const TreeNode = Tree.TreeNode;
|
||||
|
||||
let timeout = null;
|
||||
|
||||
class CustomBrowserMutiRight extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
key: ""
|
||||
};
|
||||
this.nodeIds = [];
|
||||
this.nodeObj = {};
|
||||
}
|
||||
|
||||
generateTreeNodes = () => {
|
||||
const { data } = this.props, { key } = this.state;
|
||||
const treeNodes = [];
|
||||
let showData = [...data];
|
||||
if (_.trim(key)) {
|
||||
showData = showData.filter((item) => {
|
||||
return item.name.indexOf(_.trim(key)) > -1;
|
||||
});
|
||||
}
|
||||
showData = _.uniqBy(showData, "id");
|
||||
this.nodeIds = [];
|
||||
this.nodeObj = {};
|
||||
showData.map((item) => {
|
||||
let title = (
|
||||
<div>
|
||||
<div className="item-wrap" style={{ whiteSpace: "normal" }}>
|
||||
<div className="item-top">
|
||||
<span style={{ marginRight: "5px" }}>{item.name}</span>
|
||||
</div>
|
||||
<div className="item-bottom"></div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
treeNodes.push(<TreeNode title={title} key={item["id"]} isLeaf={true}/>);
|
||||
this.nodeIds.push(item["id"]);
|
||||
this.nodeObj[item["id"]] = item;
|
||||
});
|
||||
return treeNodes;
|
||||
};
|
||||
handleSearchChange = (v) => this.setState({ key: v });
|
||||
checkHandler = (v) => {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(() => {
|
||||
this.props.checkedCb && this.props.checkedCb(v);
|
||||
}, 200);
|
||||
};
|
||||
onDoubleClick = (key) => {
|
||||
clearTimeout(timeout);
|
||||
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() {
|
||||
const { height, checkedKeys } = this.props;
|
||||
return (
|
||||
<div className="wea-transfer-right">
|
||||
<WeaInputSearch placeholder={getLabel(111, "请输入关键字搜索")} value={this.state.key}
|
||||
onSearchChange={_.debounce(this.handleSearchChange, 200)}/>
|
||||
<div>
|
||||
<WeaNewScroll height={height || 400}>
|
||||
<Tree className="transfer-tree" draggable multiple={true} async={true} selectable={true}
|
||||
onSelect={this.checkHandler} onDoubleClick={this.onDoubleClick} selectedKeys={checkedKeys}
|
||||
onDragStart={this.onDragStart} onDrop={this.onDrop}>
|
||||
{this.generateTreeNodes()}
|
||||
</Tree>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CustomBrowserMutiRight;
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 弹框操作栏
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class CustomBrowserOperation extends Component {
|
||||
render() {
|
||||
const {
|
||||
moveToLeft,
|
||||
moveToRight,
|
||||
leftArrowText,
|
||||
rightArrowText,
|
||||
leftActive,
|
||||
rightActive,
|
||||
className,
|
||||
leftAllActive,
|
||||
moveAllToLeft,
|
||||
rightAllActive,
|
||||
moveAllToRight
|
||||
} = this.props;
|
||||
|
||||
const moveToLeftButton = (
|
||||
<Button type="primary" size="small" disabled={!rightActive} onClick={moveToRight}>
|
||||
{<span><i className="icon-coms-Browse-box-Add-to"/></span>}
|
||||
</Button>
|
||||
);
|
||||
const moveToRightButton = (
|
||||
<Button type="primary" size="small" disabled={!leftActive} onClick={moveToLeft}>
|
||||
{<span><i className="icon-coms-Browse-box-delete"/></span>}
|
||||
</Button>
|
||||
);
|
||||
|
||||
const moveAllToLeftButton = (
|
||||
<Button type="primary" size="small" disabled={!leftAllActive} onClick={moveAllToRight}>
|
||||
{<span title={getLabel(111, "将当页数据全部添加到右侧已选列表")}><i className="icon-coms-right"/></span>}
|
||||
</Button>
|
||||
);
|
||||
const moveAllToRightButton = (
|
||||
<Button type="primary" size="small" disabled={!rightAllActive} onClick={moveAllToLeft}>
|
||||
{<span title={getLabel(111, "全部删除")}><i className="icon-coms-Browse-box-Delete-all"/></span>}
|
||||
</Button>
|
||||
);
|
||||
return (
|
||||
<div className={className}>
|
||||
{moveToLeftButton}
|
||||
{moveToRightButton}
|
||||
{moveAllToLeftButton}
|
||||
{moveAllToRightButton}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CustomBrowserOperation;
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
/*
|
||||
* 自定义穿梭框组件
|
||||
* 弹框选择
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom";
|
||||
import { Button, Col, Row, Spin } from "antd";
|
||||
import CustomBrowserMutiLeft from "./customBrowserMutiLeft";
|
||||
import CustomBrowserMutiRight from "./customBrowserMutiRight";
|
||||
import CustomBrowserOperation from "./customBrowserOperation";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import "../index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class CustomTransferDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, listDatas: [],
|
||||
query: { [props.searchParamsKey]: "" },
|
||||
leftListSelectedKeys: [], // 左侧table选择的keys
|
||||
leftListSelectedData: [], // 左侧table选择的数据
|
||||
rightCheckedKeys: [], //右侧选择的keys
|
||||
rightDatas: [] // 右侧展示的数据
|
||||
};
|
||||
this.selectedData = {};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.getData(true, nextProps);
|
||||
if (nextProps.datas) {
|
||||
this.setState({
|
||||
leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas)
|
||||
});
|
||||
}
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.setState({
|
||||
query: { [this.props.searchParamsKey]: "" },
|
||||
rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: []
|
||||
});
|
||||
this.selectedData = {};
|
||||
}
|
||||
}
|
||||
|
||||
getData = (init = false, props) => {
|
||||
const { query } = this.state;
|
||||
const { completeURL, convertDatasource, dataParams = {} } = props || this.props;
|
||||
let payload = { ...dataParams, ...query };
|
||||
this.setState({ loading: true });
|
||||
postFetch(completeURL, payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status && data.list) {
|
||||
const { pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
listDatas: convertDatasource ? convertDatasource(data.list) : data.list
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
listDatas: convertDatasource ? convertDatasource(data).listDatas : [],
|
||||
leftListSelectedData: (init && convertDatasource) ? convertDatasource(data).checked : this.state.leftListSelectedData,
|
||||
rightDatas: (init && convertDatasource) ? convertDatasource(data).checked : this.state.rightDatas
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleOk = () => {
|
||||
const { rightDatas } = this.state;
|
||||
this.props.onChange && this.props.onChange(rightDatas);
|
||||
};
|
||||
onLeftListCheck = (keys, datas) => {
|
||||
const { leftListSelectedData } = this.state;
|
||||
let targets = leftListSelectedData.concat(datas);
|
||||
targets = _.uniqBy(targets, "id");
|
||||
targets = targets.filter((t) => keys.indexOf(t["id"]) > -1);
|
||||
this.setState({ leftListSelectedKeys: keys, leftListSelectedData: targets });
|
||||
};
|
||||
onleftDoubleClick = (data) => {
|
||||
const { rightDatas } = this.state;
|
||||
this.setState({
|
||||
rightDatas: rightDatas.concat(data),
|
||||
rightCheckedKeys: [],
|
||||
leftListSelectedData: [],
|
||||
leftListSelectedKeys: []
|
||||
});
|
||||
};
|
||||
onRightDoubleClick = (key) => {
|
||||
const { rightDatas } = this.state;
|
||||
const newRightDatas = rightDatas.filter(item => String(item.id) !== key);
|
||||
this.setState({ rightDatas: newRightDatas, rightCheckedKeys: [] });
|
||||
};
|
||||
moveTo = (direction) => {
|
||||
const { rightDatas, rightCheckedKeys, listDatas, leftListSelectedData } = this.state;
|
||||
if (direction === "right") {
|
||||
this.setState({
|
||||
rightDatas: rightDatas.concat(leftListSelectedData),
|
||||
leftListSelectedData: [],
|
||||
leftListSelectedKeys: []
|
||||
});
|
||||
} else if (direction === "left") {
|
||||
this.setState({
|
||||
rightDatas: rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => String(item.id) === checkedKey)),
|
||||
rightCheckedKeys: []
|
||||
});
|
||||
} else if (direction === "allToLeft") {
|
||||
this.setState({ rightDatas: [], rightCheckedKeys: [] });
|
||||
} else if (direction === "allToRight") {
|
||||
if (this.leftListAllActive()) {
|
||||
this.setState({
|
||||
rightDatas: rightDatas.concat(listDatas),
|
||||
rightCheckedKeys: [],
|
||||
leftListSelectedData: [],
|
||||
leftListSelectedKeys: []
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
leftListAllActive = () => {
|
||||
const { rightDatas, listDatas } = this.state;
|
||||
let bool = true;
|
||||
if (_.isEmpty(listDatas)) bool = false;
|
||||
if (!_.isEmpty(listDatas) && !_.isEmpty(rightDatas)) {
|
||||
bool = listDatas.filter((l) => !rightDatas.some(r => l.id === r.id)).length !== 0;
|
||||
}
|
||||
return bool;
|
||||
};
|
||||
renderTitle = () => {
|
||||
return (<div className="wea-hr-muti-dialog-title">
|
||||
<span>{getLabel(111, "数据选择")}</span>
|
||||
<div/>
|
||||
</div>);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys } = this.state;
|
||||
const { searchParamsKey, saveLoading } = this.props;
|
||||
const buttons = [
|
||||
<Button type="primary" loading={saveLoading} onClick={this.handleOk}
|
||||
disabled={_.isEmpty(rightDatas)}>{getLabel(111, "确 定")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>];
|
||||
let rightActive = false, leftActive = false, rightAllActive = false;
|
||||
if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true;
|
||||
if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true;
|
||||
if (rightDatas && rightDatas.length > 0) rightAllActive = true;
|
||||
let dom = <Spin spinning={loading}>
|
||||
<div className="wea-hr-muti-dialog">
|
||||
<div className="wea-hr-muti-input-left">
|
||||
<Row style={{ height: 35 }}>
|
||||
<Col span="24">
|
||||
<WeaInputSearch value={query[searchParamsKey]} onSearch={() => this.getData()}
|
||||
onChange={value => this.setState({ query: { ...query, [searchParamsKey]: value } })}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<div>
|
||||
<WeaNewScroll height={this.dialog ? this.dialog.state.height - 51 : 260}>
|
||||
<CustomBrowserMutiLeft
|
||||
filterData={rightDatas}
|
||||
datas={listDatas}
|
||||
onDoubleClick={this.onleftDoubleClick}
|
||||
onClick={this.onLeftListCheck}
|
||||
selectedKeys={leftListSelectedKeys}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</div>
|
||||
<div className="wea-transfer-opration">
|
||||
<CustomBrowserOperation
|
||||
rightActive={rightActive}
|
||||
leftActive={leftActive}
|
||||
leftAllActive={this.leftListAllActive()}
|
||||
rightAllActive={rightAllActive}
|
||||
moveToRight={() => this.moveTo("right")}
|
||||
moveToLeft={() => this.moveTo("left")}
|
||||
moveAllToRight={() => this.moveTo("allToRight")}
|
||||
moveAllToLeft={() => this.moveTo("allToLeft")}
|
||||
/>
|
||||
</div>
|
||||
<div className="wea-hr-muti-input-right">
|
||||
<CustomBrowserMutiRight
|
||||
height={this.dialog ? this.dialog.state.height - 51 : 260}
|
||||
data={rightDatas} checkedKeys={rightCheckedKeys}
|
||||
checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })}
|
||||
onDoubleClick={this.onRightDoubleClick}
|
||||
onDrag={(data) => {this.setState({rightDatas: data})}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Spin>;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={this.renderTitle()}
|
||||
className="custom_browser_dialog" draggable={false} style={{
|
||||
width: 784, height: 460, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}} buttons={buttons}>{dom}</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CustomTransferDialog;
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/29
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import AssociativeTreeMult from "./components/associativeTreeMult";
|
||||
import AssociativeSearchMult from "./components/associativeSearchMult";
|
||||
import AssociativeSearchSingle from "./components/AssociativeSearchSingle";
|
||||
import CustomBrowserDialog from "./components/customBrowserDialog";
|
||||
import classNames from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
browserDialog: { visible: false },
|
||||
selectedData: {}, searchKeys: [], // 搜索按钮选择的数据和keys
|
||||
rightDatas: [] // 右侧展示的数据
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { value, fieldConfig } = this.props;
|
||||
const { value: defaultValue, browserConditionParam: { replaceDatas = [] } } = fieldConfig;
|
||||
if ((value || defaultValue) && replaceDatas.length > 0) {
|
||||
this.setState({
|
||||
searchKeys: (value || defaultValue).split(","),
|
||||
selectedData: _.reduce(replaceDatas, (pre, cur) => ({ ...pre, [cur["id"]]: cur }), {})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (
|
||||
(nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) ||
|
||||
(nextProps.fieldConfig.value !== this.props.fieldConfig.value && _.isEmpty(nextProps.fieldConfig.value))
|
||||
) {
|
||||
this.setState({ searchKeys: [], selectedData: [] });
|
||||
}
|
||||
}
|
||||
|
||||
renderSingle = () => {
|
||||
const { fieldConfig } = this.props;
|
||||
const { selectedData, searchKeys } = this.state;
|
||||
return (<div>
|
||||
<AssociativeSearchSingle
|
||||
{...fieldConfig}
|
||||
{...this.props}
|
||||
datas={selectedData}
|
||||
selectedValues={searchKeys}
|
||||
onChange={this.onBrowerChangeHandler}
|
||||
clickCallback={this.onBrowerClick}
|
||||
/>
|
||||
</div>);
|
||||
};
|
||||
renderMult = () => {
|
||||
const { fieldConfig } = this.props;
|
||||
const { browserConditionParam = {} } = fieldConfig || {};
|
||||
const { selectedData, searchKeys } = this.state;
|
||||
return (<div>
|
||||
{
|
||||
browserConditionParam.treeSelect ?
|
||||
<AssociativeTreeMult
|
||||
{...fieldConfig}
|
||||
{...this.props}
|
||||
datas={selectedData}
|
||||
selectedValues={searchKeys}
|
||||
onChange={this.onBrowerChangeHandler}
|
||||
/> :
|
||||
<AssociativeSearchMult
|
||||
{...fieldConfig}
|
||||
{...this.props}
|
||||
datas={selectedData}
|
||||
selectedValues={searchKeys}
|
||||
onChange={this.onBrowerChangeHandler}
|
||||
clickCallback={this.onBrowerClick}
|
||||
/>
|
||||
}
|
||||
</div>);
|
||||
};
|
||||
onBrowerChangeHandler = (values, datas) => {
|
||||
const { form, fieldConfig, isSingle } = this.props;
|
||||
const { browserConditionParam = {} } = fieldConfig || {};
|
||||
this.setState({
|
||||
searchKeys: (isSingle || browserConditionParam.isSingle) ? values.slice(-1) : values,
|
||||
selectedData: ((isSingle || browserConditionParam.isSingle) && !_.isEmpty(values)) ? { [_.last(values)]: datas[_.last(values)] } : datas
|
||||
}, () => {
|
||||
this.props.onChange && this.props.onChange(values.join(","));
|
||||
this.props.onCustomChange && this.props.onCustomChange(this.state.selectedData);
|
||||
if (form) {
|
||||
form.updateFields({
|
||||
[getKey(fieldConfig)]: { value: this.state.searchKeys.join(",") }
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
onBrowerClick = (keys, selectedObj) => {
|
||||
if (_.isEmpty(keys)) {
|
||||
this.setState({ searchKeys: [], selectedData: {}, rightDatas: [] });
|
||||
}
|
||||
this.setState({ browserDialog: { visible: true } });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { browserDialog, selectedData, searchKeys } = this.state;
|
||||
const { isSingle, viewAttr, fieldConfig = {} } = this.props;
|
||||
const { browserConditionParam = {} } = fieldConfig || {};
|
||||
const className = classNames({
|
||||
"wea-browser": true,
|
||||
"wea-field-readonly": viewAttr === "1" || fieldConfig.viewAttr === "1"
|
||||
});
|
||||
const browser = (isSingle || browserConditionParam.isSingle) ? this.renderSingle() : this.renderMult();
|
||||
const style = {};
|
||||
if (this.props.resize) style.visibility = "hidden";
|
||||
return (<React.Fragment>
|
||||
<div className={`${className} ${this.props.className || ""}`} style={style}>{browser}</div>
|
||||
<CustomBrowserDialog
|
||||
{...browserDialog} {...browserConditionParam} {...this.props} onChange={this.onBrowerChangeHandler}
|
||||
onCancel={() => this.setState({ browserDialog: { visible: false } })}
|
||||
datas={selectedData} selectedValues={searchKeys}/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
.custom_browser_dialog {
|
||||
.wea-hr-muti-dialog-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wea-hr-muti-input-table {
|
||||
background: #f6f6f6;
|
||||
padding: 8px 16px;
|
||||
height: 100%;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.wea-hr-muti-dialog {
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.wea-hr-muti-input-left, .wea-hr-muti-input-right {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.wea-transfer-list {
|
||||
background: #FFF;
|
||||
border: 1px solid #e9e9e9;
|
||||
}
|
||||
|
||||
.wea-input-focus {
|
||||
height: 35px !important;
|
||||
width: 100% !important;
|
||||
|
||||
input {
|
||||
height: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-transfer-list-wrapper {
|
||||
border: none !important;
|
||||
|
||||
.transfer-tree {
|
||||
padding: 0 !important;
|
||||
|
||||
& > li {
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
padding: 6px 0 6px 20px !important;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
|
||||
.ant-tree-switcher {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.tree-title {
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5,13 +5,24 @@
|
|||
* Date: 2022/11/30
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom";
|
||||
import {
|
||||
WeaBrowser,
|
||||
WeaDialog,
|
||||
WeaFormItem,
|
||||
WeaHelpfulTip,
|
||||
WeaLocaleProvider,
|
||||
WeaSearchGroup,
|
||||
WeaSelect,
|
||||
WeaTextarea
|
||||
} from "ecCom";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import { getTaxAgentRangeForm } from "../../apis/taxAgent";
|
||||
import { commonEnumList } from "../../apis/ruleconfig";
|
||||
import { SelectWithAll } from "../../pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class PersonalScopeModal extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -28,47 +39,33 @@ class PersonalScopeModal extends Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { isTaxgent = true } = this.props;
|
||||
if (isTaxgent) {
|
||||
this.getTaxAgentRangeForm();
|
||||
} else {
|
||||
this.commonEnumList();
|
||||
// const employeeStatus = [
|
||||
// { key: "TRIAL", showname: "试用" },
|
||||
// { key: "FORMAL", showname: "正式" },
|
||||
// { key: "TEMPORARY", showname: "临时" },
|
||||
// { key: "DELAY", showname: "试用延期" },
|
||||
// { key: "FIRE", showname: "解雇" },
|
||||
// { key: "DEPARTURE", showname: "离职" },
|
||||
// { key: "RETIRED", showname: "退休" }
|
||||
// ];
|
||||
// const targetTypeList = [
|
||||
// {
|
||||
// key: "EMPLOYEE",
|
||||
// showname: "人员",
|
||||
// selected: false
|
||||
// },
|
||||
// {
|
||||
// key: "SUBCOMPANY",
|
||||
// showname: "分部",
|
||||
// selected: false
|
||||
// },
|
||||
// {
|
||||
// key: "DEPT",
|
||||
// showname: "部门",
|
||||
// selected: false
|
||||
// },
|
||||
// {
|
||||
// key: "POSITION",
|
||||
// showname: "岗位",
|
||||
// selected: false
|
||||
// }
|
||||
// ];
|
||||
// this.setState({ targetTypeList, employeeStatus });
|
||||
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { isTaxgent = true } = nextProps;
|
||||
if (isTaxgent) {
|
||||
this.getTaxAgentRangeForm();
|
||||
} else {
|
||||
this.commonEnumList(nextProps);
|
||||
}
|
||||
if (!_.isEmpty(nextProps.record)) {
|
||||
this.setState({
|
||||
targetType: nextProps.record.targetType,
|
||||
targetTypeIds: String(nextProps.record.targetId),
|
||||
targetTypeIdsNames: nextProps.record.targetName,
|
||||
status: nextProps.record.status,
|
||||
statusAll: ""
|
||||
});
|
||||
} else {
|
||||
this.handleReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
commonEnumList = () => {
|
||||
commonEnumList = (props) => {
|
||||
const { record } = props;
|
||||
commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const targetTypeList = [
|
||||
|
|
@ -91,11 +88,21 @@ class PersonalScopeModal extends Component {
|
|||
key: "POSITION",
|
||||
showname: "岗位",
|
||||
selected: false
|
||||
},
|
||||
{
|
||||
key: "SQL",
|
||||
showname: "SQL",
|
||||
selected: false
|
||||
}
|
||||
];
|
||||
this.setState({
|
||||
targetTypeList,
|
||||
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" : "" });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -113,7 +120,7 @@ class PersonalScopeModal extends Component {
|
|||
};
|
||||
handleSubmit = () => {
|
||||
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)) {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
|
|
@ -123,12 +130,14 @@ class PersonalScopeModal extends Component {
|
|||
}
|
||||
const payload = {
|
||||
employeeStatus: status.split(","),
|
||||
includeType,
|
||||
targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })),
|
||||
includeType, id: record.id,
|
||||
targetParams: targetType !== "SQL" ?
|
||||
_.map(targetTypeIds.split(","), it => ({ targetType, targetId: it, target: "" })) :
|
||||
[{ targetType, targetId: "0", target: targetTypeIds }],
|
||||
[saveKeyVal["key"]]: saveKeyVal["value"]
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
APISaveFox["save"](payload).then(({ status, errormsg }) => {
|
||||
APISaveFox[_.isEmpty(record) ? "save" : "edit"](payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success("保存成功");
|
||||
|
|
@ -141,6 +150,7 @@ class PersonalScopeModal extends Component {
|
|||
}).catch(() => this.setState({ loading: true }));
|
||||
};
|
||||
renderBrowser = () => {
|
||||
const { record } = this.props;
|
||||
const { targetType, targetTypeIds, targetTypeIdsNames } = this.state;
|
||||
let browserType = {};
|
||||
switch (targetType) {
|
||||
|
|
@ -156,15 +166,21 @@ class PersonalScopeModal extends Component {
|
|||
case "POSITION":
|
||||
browserType = { ...browserType, type: 278, title: "岗位选择" };
|
||||
break;
|
||||
case "SQL":
|
||||
return <div style={{ display: "flex", alignItems: "center" }}>
|
||||
<WeaTextarea minRows={2} viewAttr={3} style={{ width: 270 }} value={targetTypeIds}
|
||||
onChange={val => this.setState({ targetTypeIds: val, targetTypeIdsNames: val })}/>
|
||||
<WeaHelpfulTip style={{ marginLeft: 10 }} width={200} placement="topLeft" title={<SQLHelpTip/>}/>
|
||||
</div>;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return <WeaBrowser
|
||||
{...browserType}
|
||||
viewAttr={3}
|
||||
isSingle={false}
|
||||
isSingle={!_.isEmpty(record)}
|
||||
value={targetTypeIds}
|
||||
valueSpan={targetTypeIdsNames}
|
||||
replaceDatas={[{ id: targetTypeIds, name: targetTypeIdsNames }]}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(targetTypeIds, targetTypeIdsNames) => {
|
||||
this.setState({ targetTypeIds, targetTypeIdsNames });
|
||||
|
|
@ -173,7 +189,7 @@ class PersonalScopeModal extends Component {
|
|||
};
|
||||
handleReset = () => {
|
||||
this.setState({
|
||||
targetType: "EMPLOYEE",
|
||||
targetType: !_.isEmpty(this.props.record) ? this.props.record.targetType : "EMPLOYEE",
|
||||
targetTypeIds: "",
|
||||
status: "",
|
||||
statusAll: ""
|
||||
|
|
@ -181,7 +197,7 @@ class PersonalScopeModal extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { onCancel, title, visible } = this.props;
|
||||
const { onCancel, title, visible, record } = this.props;
|
||||
const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={this.handleSubmit} loading={loading}>确定</Button>,
|
||||
|
|
@ -209,6 +225,7 @@ class PersonalScopeModal extends Component {
|
|||
<div style={{ display: "flex", alignItems: "center" }}>
|
||||
<WeaSelect
|
||||
style={{ width: 60, marginRight: 12 }}
|
||||
disabled={!_.isEmpty(record)}
|
||||
value={targetType}
|
||||
options={targetTypeList}
|
||||
onChange={(targetType) => this.setState({ targetType })}
|
||||
|
|
@ -259,3 +276,13 @@ class PersonalScopeModal extends Component {
|
|||
}
|
||||
|
||||
export default PersonalScopeModal;
|
||||
|
||||
export const SQLHelpTip = () => {
|
||||
return <div>
|
||||
<p>{getLabel(111, "注意事项:")}</p>
|
||||
<p>{getLabel(111, "1、sql需返回人员id")}</p>
|
||||
<p>{getLabel(111, "2、sql结尾不需要 ; go /等符号")}</p>
|
||||
<p>{getLabel(111, "使用例子:定义获取岗位是开发的人员")}</p>
|
||||
<p>{getLabel(111, "select id from hrmresource where JOBTITLE = 17")}</p>
|
||||
</div>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -59,7 +59,10 @@ class PersonalScopeTable extends Component {
|
|||
columns: _.map(columns, item => {
|
||||
return {
|
||||
...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>;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaReqTop } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
return (
|
||||
<WeaReqTop
|
||||
title={getLabel(111, "编辑账套")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
showDropIcon={false} tabDatas={this.props.tabDatas} {...this.props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
return (
|
||||
<WeaTop title={getLabel(111, "新建账套")} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" {...this.props}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -33,7 +33,8 @@ class ImpStep1 extends Component {
|
|||
multiple: false,
|
||||
action: "/api/doc/upload/uploadFile",
|
||||
fileList,
|
||||
onChange: this.handleChange
|
||||
onChange: this.handleChange,
|
||||
...this.props.customDragger
|
||||
};
|
||||
return (
|
||||
<div className="weapp-batch-impsteps-picker-content-imp-step1">
|
||||
|
|
@ -45,7 +46,7 @@ class ImpStep1 extends Component {
|
|||
{this.props.importParams}
|
||||
</div>
|
||||
}
|
||||
<div className="title">{getLabel(543202, "导入Excel")}</div>
|
||||
{_.isEmpty(this.props.customDragger) && <div className="title">{getLabel(543202, "导入Excel")}</div>}
|
||||
<p className="draggerUploadWrapper">
|
||||
<Dragger {...dragger}>
|
||||
<div>
|
||||
|
|
@ -56,36 +57,39 @@ class ImpStep1 extends Component {
|
|||
</div>
|
||||
</Dragger>
|
||||
</p>
|
||||
{
|
||||
(_.isNil(this.props.customDragger) || this.props.customDragger.showOperateDesc) &&
|
||||
<React.Fragment>
|
||||
<div className="bottom-border">
|
||||
<div>{getLabel(27577, "操作步骤")}</div>
|
||||
<p>
|
||||
<span>{`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}</span>
|
||||
{
|
||||
typeof this.props.link === "string" ?
|
||||
<a href={this.props.link} className="weapp-salary-link"
|
||||
target="_blank">{getLabel(543207, "点击这里下载模板")}</a> :
|
||||
<a className="weapp-salary-link"
|
||||
onClick={this.props.link}
|
||||
>{getLabel(543207, "点击这里下载模板")}</a>
|
||||
}
|
||||
|
||||
{this.props.exportDataDom}
|
||||
</p>
|
||||
<p>{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}</p>
|
||||
<p>{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}</p>
|
||||
<p>
|
||||
{`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="bottom-border">
|
||||
<div>{getLabel(27577, "操作步骤")}</div>
|
||||
<p>
|
||||
<span>{`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}</span>
|
||||
{
|
||||
typeof this.props.link === "string" ?
|
||||
<a href={this.props.link} className="weapp-salary-link"
|
||||
target="_blank">{getLabel(543207, "点击这里下载模板")}</a> :
|
||||
<a className="weapp-salary-link"
|
||||
onClick={this.props.link}
|
||||
>{getLabel(543207, "点击这里下载模板")}</a>
|
||||
}
|
||||
|
||||
{this.props.exportDataDom}
|
||||
</p>
|
||||
<p>{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}</p>
|
||||
<p>{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}</p>
|
||||
<p>
|
||||
{`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="description">
|
||||
<div>{getLabel(543223, "Excel文件说明")}</div>
|
||||
<p>{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}</p>
|
||||
<p>{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}</p>
|
||||
<p><span>{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}</span></p>
|
||||
</div>
|
||||
|
||||
<div className="description">
|
||||
<div>{getLabel(543223, "Excel文件说明")}</div>
|
||||
<p>{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}</p>
|
||||
<p>{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}</p>
|
||||
<p><span>{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}</span></p>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,11 @@
|
|||
* Date: 2023/9/5
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaTable } from "ecCom";
|
||||
import { WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { postFetch } from "../../../util/request";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
class ImpStep2 extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -41,9 +43,15 @@ class ImpStep2 extends Component {
|
|||
render() {
|
||||
const { dataSource, columns, loading } = this.state;
|
||||
const { scrollHeight } = this.props;
|
||||
const pagination = {
|
||||
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
|
||||
total: dataSource.length,
|
||||
showSizeChanger: true
|
||||
};
|
||||
return (
|
||||
<WeaTable
|
||||
dataSource={dataSource} columns={columns} loading={loading} scroll={{ x: 800, y: `${scrollHeight}px` }}
|
||||
pagination={pagination}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import successImg from "../../importModal/success.svg";
|
||||
import MoveInResult from "./moveInResult";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -16,32 +17,41 @@ class ImpStep3 extends Component {
|
|||
return (
|
||||
<div className="weapp-batch-impsteps-picker-content-imp-step3">
|
||||
{
|
||||
!_.isEmpty(importResult) ?
|
||||
<div className="weapp-batch-impsteps-picker-spinText">
|
||||
<p><img src={successImg} alt=""/></p>
|
||||
<p>
|
||||
<span>{getLabel(389249, "已导入")}</span>
|
||||
<span style={{ color: "green" }}> {importResult.successCount}</span>
|
||||
<span>{`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`}</span>
|
||||
<span style={{ color: "red" }}> {importResult.errorCount} </span>{getLabel(30690, "条数据")}
|
||||
</p>
|
||||
</div> :
|
||||
<div className="weapp-batch-impsteps-picker-spinText">
|
||||
<p>{getLabel(111, "导入失败")}</p>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
(!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) &&
|
||||
<WeaTable
|
||||
columns={[
|
||||
importResult.results ? <MoveInResult dataSource={importResult.results}/> :
|
||||
<React.Fragment>
|
||||
{
|
||||
title: getLabel(25700, "错误信息"),
|
||||
dataIndex: "message"
|
||||
!_.isEmpty(importResult) ?
|
||||
<div className="weapp-batch-impsteps-picker-spinText">
|
||||
<p><img src={successImg} alt=""/></p>
|
||||
{
|
||||
importResult.successCount &&
|
||||
<p>
|
||||
<span>{getLabel(389249, "已导入")}</span>
|
||||
<span style={{ color: "green" }}> {importResult.successCount}</span>
|
||||
<span>{`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`}</span>
|
||||
<span
|
||||
style={{ color: "red" }}> {importResult.errorCount} </span>{getLabel(30690, "条数据")}
|
||||
</p>
|
||||
}
|
||||
</div> :
|
||||
<div className="weapp-batch-impsteps-picker-spinText">
|
||||
<p>{getLabel(111, "导入失败")}</p>
|
||||
</div>
|
||||
}
|
||||
]}
|
||||
dataSource={importResult.errorData || importResult.errorNotice} pagination={false}
|
||||
scroll={{ y: `calc(100vh - 387px)` }}
|
||||
/>
|
||||
{
|
||||
!_.isEmpty(importResult) && (!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) &&
|
||||
<WeaTable
|
||||
columns={[
|
||||
{
|
||||
title: getLabel(25700, "错误信息"),
|
||||
dataIndex: "message"
|
||||
}
|
||||
]}
|
||||
dataSource={importResult.errorData || importResult.errorNotice} pagination={false}
|
||||
scroll={{ y: `calc(100vh - 387px)` }}
|
||||
/>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* 薪酬迁入结果展示
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/16
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class MoveInResult extends Component {
|
||||
downloadTxtfile = (value, type) => {
|
||||
if (!value) return;
|
||||
const element = document.createElement("a");
|
||||
const file = new Blob([value], { type: "text/plain" });
|
||||
element.href = URL.createObjectURL(file);
|
||||
element.download = `导入${type}信息.txt`;
|
||||
document.body.appendChild(element);
|
||||
element.click();
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dataSource } = this.props;
|
||||
return (
|
||||
<WeaTable
|
||||
columns={[
|
||||
{ title: getLabel(111, "导入信息"), dataIndex: "message" },
|
||||
{
|
||||
title: getLabel(111, "下载信息"), dataIndex: "download", width: 250,
|
||||
render: (text, record) => (<React.Fragment>
|
||||
<span
|
||||
style={{ marginRight: 16, color: "#0BB746", cursor: "pointer", display: "inline-block", minWidth: 60 }}
|
||||
onClick={() => this.downloadTxtfile(record.success.join("\n"), getLabel(111, "成功"))}>
|
||||
<i className="iconfont icon-successful"/><span
|
||||
style={{ marginLeft: 8 }}>{record.success.length}</span></span>
|
||||
<span
|
||||
style={{ marginRight: 16, color: "#E6960C", cursor: "pointer", display: "inline-block", minWidth: 60 }}
|
||||
onClick={() => this.downloadTxtfile(record.warning.join("\n"), getLabel(111, "警告"))}><i
|
||||
className="iconfont icon-warning"/><span style={{ marginLeft: 8 }}>{record.warning.length}</span></span>
|
||||
<span style={{ color: "#CF3736", cursor: "pointer", display: "inline-block", minWidth: 60 }}
|
||||
onClick={() => this.downloadTxtfile(record.error.join("\n"), getLabel(111, "错误"))}><i
|
||||
className="iconfont icon-error"/><span style={{ marginLeft: 8 }}>{record.error.length}</span></span>
|
||||
</React.Fragment>)
|
||||
}
|
||||
]}
|
||||
dataSource={dataSource} pagination={false} bordered scroll={{ y: `calc(100vh - 333px)` }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default MoveInResult;
|
||||
|
|
@ -36,13 +36,17 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
renderChildren = () => {
|
||||
const { current } = this.state, { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props;
|
||||
const { current } = this.state, {
|
||||
importParams, link, excludeKey, importResult,
|
||||
exportDataDom = null, customDragger
|
||||
} = this.props;
|
||||
const scrollHeight = this.importRef ? this.importRef.state.height - 232 : 606.6;
|
||||
let CurrentDom = null;
|
||||
switch (current) {
|
||||
case 0:
|
||||
CurrentDom = <ImpStep1 importParams={importParams} link={link} exportDataDom={exportDataDom}
|
||||
ref={dom => this.step1Ref = dom}/>;
|
||||
CurrentDom =
|
||||
<ImpStep1 importParams={importParams} customDragger={customDragger} link={link} exportDataDom={exportDataDom}
|
||||
ref={dom => this.step1Ref = dom}/>;
|
||||
break;
|
||||
case 1:
|
||||
CurrentDom = <ImpStep2 {...this.props} scrollHeight={scrollHeight}/>;
|
||||
|
|
@ -99,13 +103,16 @@ class Index extends Component {
|
|||
}
|
||||
const [file] = fileList;
|
||||
const { response } = file;
|
||||
this.setState({
|
||||
current: this.state.current + 1,
|
||||
fileid: response.data.fileid
|
||||
}, () => {
|
||||
!excludeKey && this.props.nextCallback && this.props.nextCallback(this.state.fileid);
|
||||
excludeKey && this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid);
|
||||
});
|
||||
if (!excludeKey) {
|
||||
this.setState({
|
||||
current: this.state.current + 1,
|
||||
fileid: response.data.fileid
|
||||
}, () => {
|
||||
this.props.nextCallback && this.props.nextCallback(this.state.fileid);
|
||||
});
|
||||
} else {
|
||||
this.props.nextUplaodCallback && this.props.nextUplaodCallback(response.data.fileid);
|
||||
}
|
||||
} else {
|
||||
this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class Index extends Component {
|
|||
this.setState({
|
||||
dataSource: [], columns: [], pageInfo: { current: 0, pageSize: 10, total: 0 },
|
||||
loading: false
|
||||
});
|
||||
}, () => this.props.baseFormStore.form.resetForm());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import Calculate from "./pages/calculate/calculate"; //重构的薪资核算页
|
|||
// import Payroll from "./pages/payroll";
|
||||
import Payroll from "./pages/payrollRelease"; //重构的工资单发放页面
|
||||
import PayrollGrant from "./pages/payroll/payrollGrant";
|
||||
import PayrollDetail from "./pages/payroll/payrollDetail";
|
||||
import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail";
|
||||
// import Declare from "./pages/declare";
|
||||
import Declare from "./pages/declare/declare"; //重构的个税申报表
|
||||
import TaxRate from "./pages/taxRate";
|
||||
|
|
@ -52,69 +52,20 @@ import ExternalPersonManage from "./pages/externalPersonManage";
|
|||
import AdjustSalaryManage from "./pages/adjustSalaryManage";
|
||||
import TopologyMap from "./pages/topologyMap";
|
||||
import SupplementaryCalc from "./pages/supplementaryCalc";
|
||||
|
||||
import VariableSalary from "./pages/variableSalary";
|
||||
import Layout from "./layout";
|
||||
import stores from "./stores";
|
||||
import "./style/index";
|
||||
|
||||
// 读取系统多语言配置
|
||||
let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, "hrmSalary");
|
||||
|
||||
// 不需要读取系统多语言
|
||||
getLocaleLabel = function (nextState, replace, callback) {
|
||||
callback();
|
||||
};
|
||||
|
||||
const Home = (props) => props.children;
|
||||
|
||||
const SocialSecurityBenefits = (props) => props.children;
|
||||
const DataAcquisition = (props) => props.children;
|
||||
|
||||
// historicalPayroll 历史工资单查看
|
||||
// salaryAdjustmentRecords 调薪记录查看
|
||||
|
||||
// mySalaryMobile 我的薪资福利-移动端
|
||||
// mySalaryMobile 我的薪资福利-移动端
|
||||
// mySalary 我的薪资福利
|
||||
// mySalaryView 我的薪资福利-查看工资单
|
||||
// socialSecurityBenefits 社保福利
|
||||
// programme 社保福利方案
|
||||
// archives 社保福利档案
|
||||
// standingBook 社保福利台账
|
||||
// sbofflineComparison 社保福利台账线下对比
|
||||
// salaryItem 薪资项目管理
|
||||
// salaryFile 薪资档案
|
||||
// dataAcquisition 数据采集
|
||||
// CumDeduct 累计专项附加扣除
|
||||
// otherDeduct 其他免税扣除
|
||||
// cumSituation 往期累计情况
|
||||
// attendance 考勤引用
|
||||
// specialAddDeduction 专项附件扣除
|
||||
// ledger 薪资账套
|
||||
// calculate 薪资核算
|
||||
// calculateDetail 核算详情
|
||||
// DoCalcDetail 核算详情页面-新
|
||||
// CalcView 核算查看页面-新
|
||||
// OfflineCompare 薪资核算线下对比-新
|
||||
// placeOnFileDetail 核算归档详情
|
||||
// compareDetail 线下线上对比
|
||||
// payroll 工资单发放
|
||||
// declare 个税申报表
|
||||
// generateDeclarationDetail 个税单详情
|
||||
// taxRate 个税税率表
|
||||
// taxAgent 个税扣缴义务人
|
||||
// mobilepayroll 移动端工资单
|
||||
// sysconfig 系統配置
|
||||
// sysconfig-1 规则配置
|
||||
// appconfig 应用配置
|
||||
// fieldManagement 字段管理
|
||||
// analysisOfSalaryStatistics 薪酬统计分析
|
||||
// reportView 薪酬报表查看
|
||||
// externalPersonManage 非系统人员管理
|
||||
// adjustSalaryManage 档案管理
|
||||
// supplementaryCalc 补算
|
||||
|
||||
const Routes = (
|
||||
<Route key="hrmSalary" path="hrmSalary" onEnter={getLocaleLabel} component={Home}>
|
||||
<Route key="hrmSalary" path="hrmSalary" onEnter={getLocaleLabel} component={Layout}>
|
||||
<Route key="historicalPayroll" path="historicalPayroll" component={HistoricalPayroll}/>
|
||||
<Route key="salaryAdjustmentRecords" path="salaryAdjustmentRecords" component={SalaryAdjustmentRecords}/>
|
||||
<Route key="mySalaryMobile" path="mySalaryMobile" component={MySalaryMobile}/>
|
||||
|
|
@ -124,8 +75,8 @@ const Routes = (
|
|||
<Route key="programme" path="programme" component={Programme}/>
|
||||
<Route key="archives" path="archives" component={Archives}/>
|
||||
<Route key="standingBook" path="standingBook" component={StandingBook}/>
|
||||
<Route key="standingBookDetail" path="standingBookDetail" component={StandingBookDetail} />
|
||||
<Route key="sbofflineComparison" path="sbofflineComparison" component={StandingBookOfflineComparison} />
|
||||
<Route key="standingBookDetail" path="standingBookDetail" component={StandingBookDetail}/>
|
||||
<Route key="sbofflineComparison" path="sbofflineComparison" component={StandingBookOfflineComparison}/>
|
||||
</Route>
|
||||
<Route key="salaryItem" path="salaryItem" component={SalaryItem}/>
|
||||
<Route key="salaryFile" path="salaryFile" component={SalaryFiles}/>
|
||||
|
|
@ -152,7 +103,7 @@ const Routes = (
|
|||
<Route key="templatePreview" path="templatePreview" component={TemplatePreview}/>
|
||||
<Route key="payrollinfo" path="payrollinfo" component={PayrollTemplatePreview}/>
|
||||
<Route key="declare" path="declare" component={Declare}/>
|
||||
<Route key="generateDeclarationDetail" path="generateDeclarationDetail" component={GenerateDeclarationDetail} />
|
||||
<Route key="generateDeclarationDetail" path="generateDeclarationDetail" component={GenerateDeclarationDetail}/>
|
||||
<Route key="taxRate" path="taxRate" component={TaxRate}/>
|
||||
<Route key="taxAgent" path="taxAgent" component={TaxAgent}/>
|
||||
<Route key="mobilepayroll" path="mobilepayroll" component={MobilePayroll}/>
|
||||
|
|
@ -166,6 +117,7 @@ const Routes = (
|
|||
<Route key="externalPersonManage" path="externalPersonManage" component={ExternalPersonManage}/>
|
||||
<Route key="topologyView" path="topologyView/:salarySobId/:salaryItemId" component={TopologyMap}/>
|
||||
<Route key="supplementaryCalc" path="supplementaryCalc" component={SupplementaryCalc}/>
|
||||
<Route key="variableSalary" path="variableSalary" component={VariableSalary}/>
|
||||
</Route>
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* 薪酬管理-
|
||||
* layout组件
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/15
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import stores from "./stores";
|
||||
|
||||
const { ls } = WeaTools;
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
class Layout extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) {
|
||||
if (window.location.hash.indexOf("payroll") !== -1) {
|
||||
window.localStorage.removeItem("template-basedata");
|
||||
window.localStorage.removeItem("salary-showset");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setFontSize();
|
||||
if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) {
|
||||
const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css";
|
||||
const link = document.createElement("link");
|
||||
link.setAttribute("rel", "stylesheet");
|
||||
link.setAttribute("type", "text/css");
|
||||
link.setAttribute("href", src);
|
||||
let header = document.getElementById("container");
|
||||
header.appendChild(link);
|
||||
top.$(".ant-message").remove();
|
||||
window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission();
|
||||
}
|
||||
window.addEventListener("storage", this.setFontSize);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("storage", this.setFontSize);
|
||||
}
|
||||
|
||||
setFontSize = () => {
|
||||
const { themeFontSize } = JSON.parse(localStorage.getItem("theme-themeInfo")) || { themeFontSize: "12" };
|
||||
if (window.location.href.indexOf("/spa/hrmSalary/") !== -1) {
|
||||
const href = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`;
|
||||
jQuery("#theme-font").remove();
|
||||
window.parent.jQuery("#theme-font1").remove();
|
||||
jQuery(jQuery("head")[0]).append(`<link id="theme-font" rel="stylesheet" type="text/css" href="${href}" />`);
|
||||
const link = document.createElement("link");
|
||||
link.setAttribute("rel", "stylesheet");
|
||||
link.setAttribute("type", "text/css");
|
||||
link.setAttribute("href", href);
|
||||
link.setAttribute("id", "theme-font1");
|
||||
setTimeout(() => {
|
||||
window.parent.document.head.appendChild(link);
|
||||
}, 500);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<WeaLocaleProvider>{this.props.children}</WeaLocaleProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Layout;
|
||||
|
|
@ -97,7 +97,7 @@ class Index extends Component {
|
|||
effectiveTime: effectiveTime1 ? `${effectiveTime1},${effectiveTime2}` : "",
|
||||
operateTime: operateTime1 ? `${operateTime1},${operateTime2}` : ""
|
||||
};
|
||||
window.open(`${window.location.origin}/api/bs/hrmsalary/salaryArchive/adjustRecord/exportSalaryItemList?${convertToUrlString(payload)}`, "_target");
|
||||
window.open(`${window.location.origin}/api/bs/hrmsalary/salaryArchive/adjustRecord/exportSalaryItemList?${convertToUrlString(payload)}`, "_blank");
|
||||
this.handleDebounce = null;
|
||||
}, 500);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -219,3 +218,47 @@ export const salaryDetailSearchConditions = [
|
|||
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
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class EmployeeDetails extends Component {
|
|||
pagination={pagination}
|
||||
loading={loading}
|
||||
columns={columns}
|
||||
scroll={{ y: `calc(100vh - 174px)` }}
|
||||
scroll={{ y: `calc(100vh - 182px)` }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Date: 2023/4/17
|
||||
*/
|
||||
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 {
|
||||
reportStatisticsReportDelete,
|
||||
|
|
@ -14,7 +14,6 @@ import {
|
|||
} from "../../../apis/statistics";
|
||||
import "../index.less";
|
||||
|
||||
const SubMenu = Menu.SubMenu;
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
class ReportList extends Component {
|
||||
|
|
@ -87,7 +86,9 @@ class ReportList extends Component {
|
|||
return (
|
||||
<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 => {
|
||||
const { reportName, dimension, id, dimensionId, isShare } = it;
|
||||
return <Col className="gutter-row" span={6} onClick={() => this.handleGoReportView(id)}>
|
||||
|
|
|
|||
|
|
@ -5,14 +5,20 @@
|
|||
* Date: 2024/3/26
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaSelect } from "ecCom";
|
||||
import { message, Spin } from "antd";
|
||||
import * as API from "../../../apis/statistics";
|
||||
import { getIframeParentHeight } from "../../../util";
|
||||
import { sysConfCodeRule } from "../../../apis/ruleconfig";
|
||||
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 cs from "classnames";
|
||||
import "../index.less";
|
||||
|
||||
const WeaTableComx = WeaTableNew.WeaTable;
|
||||
|
|
@ -24,28 +30,57 @@ class SalaryDetails extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, dataSource: [], columns: [], selectedRowKeys: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {},
|
||||
showTotalCell: false, updateSum: true
|
||||
loading: false, dataSource: [], columns: [], selectedRowKeys: [], tempPageList: [], sumRow: {},
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "",
|
||||
showTotalCell: false, updateSum: true, tempDialog: { visible: false, setting: [], id: "", template: {} },
|
||||
transferDialog: {
|
||||
visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, saveLoading: false,
|
||||
completeURL: "", convertDatasource: datas => {
|
||||
return {
|
||||
listDatas: _.map(datas.setting, o => ({ id: o.id || o.column, name: o.name || o.text })),
|
||||
checked: this.converCheckedCol(datas)
|
||||
};
|
||||
},
|
||||
type: "default"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getSalaryList(this.props);
|
||||
async componentDidMount() {
|
||||
const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]);
|
||||
this.setState({
|
||||
showTotalCell: confCode === "1"
|
||||
}, () => {
|
||||
this.getSalaryList(this.props);
|
||||
this.getPageListTemplatelist();
|
||||
});
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
window.addEventListener("resize", () => this.forceUpdate(), false);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.isQuery !== this.props.isQuery) this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current: 1 }
|
||||
pageInfo: { ...this.state.pageInfo, current: 1 }, updateSum: true
|
||||
}, () => this.getSalaryList(nextProps));
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
window.removeEventListener("message", () => this.forceUpdate(), false);
|
||||
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 }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
const { pageInfo } = this.state;
|
||||
|
|
@ -56,7 +91,7 @@ class SalaryDetails extends Component {
|
|||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize },
|
||||
updateSum: true
|
||||
updateSum: false
|
||||
}, () => this.getSalaryList(this.props));
|
||||
} else if (id === "CHECKBOX") {
|
||||
const { selectedRowKeys: checkBox } = params;
|
||||
|
|
@ -73,10 +108,10 @@ class SalaryDetails extends Component {
|
|||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getSalaryList = (props) => {
|
||||
const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props;
|
||||
const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props || this.props;
|
||||
const [startDateStr, endDateStr] = dateRange;
|
||||
const { taxAgentIds, subcompanyIds, departmentIds, ...extra } = salaryDetailSearchForm.getFormParams();
|
||||
const { pageInfo } = this.state;
|
||||
const { pageInfo, transferDialog, updateSum } = this.state;
|
||||
const payload = {
|
||||
taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [],
|
||||
departmentIds: departmentIds ? departmentIds.split(",") : [],
|
||||
|
|
@ -84,41 +119,50 @@ class SalaryDetails extends Component {
|
|||
...extra, ...pageInfo, startDateStr, endDateStr
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
API.getSalaryList(payload).then(async ({ status, data }) => {
|
||||
// API.getSalaryListSum(payload),
|
||||
const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]);
|
||||
API.getSalaryList(payload).then(({ status, data }) => {
|
||||
if (updateSum) this.getSalaryListSum(payload);
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { dataKey, pageInfo: pageparams } = data;
|
||||
const { columns, dataKey, pageInfo: pageparams } = data;
|
||||
const { list: dataSource, pageNum: current, total, pageSize } = pageparams;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload,
|
||||
showTotalCell: confCode === "1"
|
||||
columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload
|
||||
}, () => tableStore.getDatas(dataKey.datas));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getSalaryListSum = (payload) => {
|
||||
API.getSalaryListSum(payload).then(({ status, data }) => {
|
||||
if (status) this.setState({ sumRow: data.sumRow });
|
||||
});
|
||||
};
|
||||
handleExportSalaryList = (key) => {
|
||||
let { selectedRowKeys, payload } = this.state;
|
||||
const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
|
||||
let { selectedRowKeys, payload, columns: tempCols } = this.state;
|
||||
const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
|
||||
const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
|
||||
if (key === "SELECTED" && selectedRowKeys.length === 0) {
|
||||
message.warning(getLabel(543345, "请选择需要导出的数据!"));
|
||||
return;
|
||||
}
|
||||
WeaLoadingGlobal.start();
|
||||
const promise = API.exportSalaryList({ ...payload, ids: key === "SELECTED" ? selectedRowKeys : [] });
|
||||
const promise = API.exportSalaryList({
|
||||
...payload, ids: key === "SELECTED" ? selectedRowKeys : [], columns: _.map(columns, o => o.column || o.dataIndex)
|
||||
});
|
||||
};
|
||||
getColumns = () => {
|
||||
const { attendanceStore: { tableStore } } = this.props;
|
||||
const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum } = this.state;
|
||||
const columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
|
||||
const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : "";
|
||||
const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
|
||||
const {
|
||||
columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRow, transferDialog
|
||||
} = 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 (!_.isEmpty(columns)) {
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154,
|
||||
sumRowlistUrl, payload: { ...payload, updateSum },
|
||||
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRow,
|
||||
columns: _.map(columns, (it, idx) => ({
|
||||
...it,
|
||||
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.oldWidth,
|
||||
dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true,
|
||||
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : (it.width || it.oldWidth),
|
||||
fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
|
||||
ellipsis: true
|
||||
}))
|
||||
|
|
@ -126,28 +170,129 @@ class SalaryDetails extends Component {
|
|||
}
|
||||
return [];
|
||||
};
|
||||
handleSetDefCols = () => this.setState({
|
||||
transferDialog: {
|
||||
...this.state.transferDialog, completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", visible: true,
|
||||
dataParams: { page: "salary_details_report" }
|
||||
}
|
||||
});
|
||||
converCheckedCol = (data) => {
|
||||
return _.reduce(data.checked || [], (pre, cur) => {
|
||||
const item = _.find(data.setting, k => (k.id === cur) || (k.column === cur.column));
|
||||
if (!_.isEmpty(item)) return [...pre, { ...item, id: item.id || item.column, name: item.name || item.text }];
|
||||
return pre;
|
||||
}, []);
|
||||
};
|
||||
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 = {
|
||||
page: "salary_details_report",
|
||||
setting: _.map(values, o => o.id)
|
||||
};
|
||||
this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: true } });
|
||||
API.savePageListSetting(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: false } });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.setState({
|
||||
transferDialog: { ...this.state.transferDialog, visible: false, type: "default" }
|
||||
}, () => this.getSalaryList());
|
||||
} else {
|
||||
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() {
|
||||
const { loading, dataSource } = this.state;
|
||||
const { attendanceStore: { tableStore } } = this.props;
|
||||
return (
|
||||
<div className="table-layout"
|
||||
style={{ height: getIframeParentHeight(".wea-new-top-req-content", dataSource.length, 0) + "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"
|
||||
const { loading, dataSource, transferDialog, tempDialog, tempPageList, templateId } = this.state;
|
||||
const { attendanceStore: { tableStore }, dateRange, showSearchAd, salaryDetailShowType } = this.props;
|
||||
return (<React.Fragment>
|
||||
<div className="query-div">
|
||||
{
|
||||
salaryDetailShowType === "1" &&
|
||||
<div className="custom-select">
|
||||
<WeaSelect style={{ width: 200 }} hasAddBtn options={tempPageList} addOnClick={this.handelAddTemp}
|
||||
showSearch optionFilterProp="children" value={templateId}
|
||||
onChange={this.changePageListTemplate}/>
|
||||
{
|
||||
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
|
||||
style={{ display: "none" }}
|
||||
comsWeaTableStore={tableStore}
|
||||
needScroll={true}
|
||||
columns={this.getColumns()}
|
||||
/>
|
||||
</div>
|
||||
{/*默认显示列,薪资模板列表*/}
|
||||
<CustomTransferDialog {...transferDialog} onChange={this.savePageListSetting}
|
||||
onCancel={() => this.setState({
|
||||
transferDialog: {
|
||||
...transferDialog, completeURL: "", visible: false, type: "default"
|
||||
}
|
||||
})}/>
|
||||
{/*薪资明细模板设置*/}
|
||||
<SalaryDetailsTempDialog {...tempDialog}
|
||||
onCancel={callback => this.setState({
|
||||
tempDialog: { ...tempDialog, visible: false, setting: [] }
|
||||
}, () => callback && callback())}
|
||||
onSuccess={() => {
|
||||
this.getPageListTemplatelist();
|
||||
this.getSalaryList();
|
||||
}}/>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react";
|
|||
import { WeaDatePicker, WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom";
|
||||
import { Button, Dropdown, Menu } from "antd";
|
||||
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 EmployeeDetails from "./components/employeeDetails";
|
||||
import SalaryDetails from "./components/salaryDetails";
|
||||
|
|
@ -19,11 +19,7 @@ import DimensionTable from "./components/dimensionTable";
|
|||
import ReportList from "./components/reportList";
|
||||
import ReportForm from "./components/reportForm";
|
||||
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 cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -54,12 +50,16 @@ class Index extends Component {
|
|||
title: "", visible: false,
|
||||
typeKey: "", id: ""
|
||||
},
|
||||
logDialogVisible: false, filterConditions: "[]"
|
||||
logDialogVisible: false, filterConditions: "[]",
|
||||
salaryDetailShowType: "0" //薪资明细列表显示方式
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.initReportFormCondition();
|
||||
sysinfo().then(({ status, data }) => {
|
||||
if (status) this.setState({ salaryDetailShowType: data.SALARY_DETAILS_REPORT_SHOW_TYPE });
|
||||
});
|
||||
}
|
||||
|
||||
initReportFormCondition = (payload = {}) => {
|
||||
|
|
@ -275,13 +275,13 @@ class Index extends Component {
|
|||
|
||||
render() {
|
||||
const {
|
||||
taxAgentStore: { statisticsReportBtn },
|
||||
taxAgentStore: { statisticsReportBtn, PageAndOptAuth },
|
||||
attendanceStore: { statisticsForm, reportForm, tableStore }
|
||||
} = this.props;
|
||||
const {
|
||||
selectedKey, modalReq, slideReq, conditions, reportConditions,
|
||||
reportName, keyword, year, logDialogVisible, filterConditions,
|
||||
dateRange, showSearchAd, isQuery
|
||||
dateRange, showSearchAd, isQuery, salaryDetailShowType
|
||||
} = this.state;
|
||||
const buttons = selectedKey === "statistics" ? [
|
||||
<Button type="primary" onClick={() => this.handleReqBtnsClick("addReport")}>{getLabel(111, "新建报表")}</Button>,
|
||||
|
|
@ -307,13 +307,9 @@ class Index extends Component {
|
|||
onClick={({ key }) => this.handleExportSalaryList(key)}>
|
||||
<Menu.Item
|
||||
key="SELECTED">{getLabel(543715, "导出所选")}</Menu.Item>
|
||||
</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}/>
|
||||
</Menu>}>{getLabel(81272, "导出全部")}</Dropdown.Button>
|
||||
];
|
||||
const dropMenuDatas = [
|
||||
let dropMenuDatas = [
|
||||
{
|
||||
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(545781, "操作日志")
|
||||
|
|
@ -333,18 +329,19 @@ class Index extends Component {
|
|||
{ key: "detail", title: getLabel(111, "员工明细") },
|
||||
{ key: "salaryDetail", title: getLabel(111, "薪资明细") }
|
||||
];
|
||||
dropMenuDatas = selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1);
|
||||
(PageAndOptAuth.isChief && selectedKey === "salaryDetail") && (dropMenuDatas = [...dropMenuDatas, {
|
||||
key: "DEF_COLUMN", icon: <i className="icon-coms-Custom"/>, content: getLabel(111, "默认显示列"),
|
||||
onClick: () => this.salaryRef.wrappedInstance.handleSetDefCols()
|
||||
}]);
|
||||
return (
|
||||
<WeaReqTop
|
||||
title={getLabel(111, "薪酬统计报表")} icon={<i className="icon-coms-fa"/>} selectedKey={selectedKey}
|
||||
iconBgcolor="#F14A2D" tabDatas={tabs} className="xc_tj_fx_wrapper"
|
||||
buttons={(!statisticsReportBtn && selectedKey === "statistics") ? buttons.slice(-1) : buttons} buttonSpace={10}
|
||||
onChange={selectedKey => this.setState({ selectedKey }, () => this.state.selectedKey === "statistics" && this.initReportFormCondition())}
|
||||
showDropIcon={selectedKey !== "detail"} onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1)}
|
||||
>
|
||||
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<SearchPannel onCancel={() => this.setState({ showSearchAd: false })} onAdSearch={this.onAdSearch}/>
|
||||
</div>
|
||||
showDropIcon={(selectedKey === "statistics") || (selectedKey === "salaryDetail" && salaryDetailShowType !== "1")}
|
||||
onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}>
|
||||
{
|
||||
selectedKey === "statistics" ?
|
||||
<ReportList
|
||||
|
|
@ -356,7 +353,12 @@ class Index extends Component {
|
|||
ref={dom => this.employeeListRef = dom}
|
||||
keyword={keyword} year={year}
|
||||
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}
|
||||
onAddDimension={this.handleAddDimension}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@
|
|||
width: 220px;
|
||||
}
|
||||
|
||||
.ant-btn-group {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.employeeYearWrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -15,7 +19,7 @@
|
|||
}
|
||||
|
||||
.wea-new-top-req-content {
|
||||
padding: 16px;
|
||||
padding: 8px 16px;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
|
|
@ -158,11 +162,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
font-size: 16px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 26px;
|
||||
.wea-alert-page-con {
|
||||
padding-top: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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 {
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,17 @@
|
|||
* Date: 2022-09-27 18:17:02
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaInput, WeaSearchGroup, WeaTop } from "ecCom";
|
||||
import {
|
||||
WeaCheckbox,
|
||||
WeaDatePicker,
|
||||
WeaFormItem,
|
||||
WeaInput,
|
||||
WeaLoadingGlobal,
|
||||
WeaLocaleProvider,
|
||||
WeaSearchGroup,
|
||||
WeaTop
|
||||
} from "ecCom";
|
||||
import MoveInDialog from "./moveInDialog";
|
||||
import * as API from "../../apis/ruleconfig";
|
||||
import { Button, message } from "antd";
|
||||
import "./index.less";
|
||||
|
|
@ -18,6 +28,7 @@ const Input = (props) => {
|
|||
</WeaFormItem>
|
||||
);
|
||||
};
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class AppConfig extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -28,7 +39,8 @@ class AppConfig extends Component {
|
|||
isLog: "0",
|
||||
openFormulaForcedEditing: "0",
|
||||
version: "",
|
||||
loading: false
|
||||
loading: false,
|
||||
moveInDialog: { visible: false, title: getLabel(111, "数据迁入") }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -62,10 +74,29 @@ class AppConfig extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
handleOperate = (type) => {
|
||||
switch (type) {
|
||||
case "import":
|
||||
this.setState({ moveInDialog: { ...this.state.moveInDialog, visible: true } });
|
||||
break;
|
||||
case "export":
|
||||
WeaLoadingGlobal.start();
|
||||
const promise = API.downloadConfig();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { openAcctResultSum, displayEmpInfoReport, loading, openFormulaForcedEditing, isLog, version } = this.state;
|
||||
const btns = [<Button type="primary" loading={loading} onClick={this.appSettingSave}>保存</Button>];
|
||||
const {
|
||||
openAcctResultSum, displayEmpInfoReport, loading, openFormulaForcedEditing, isLog, version, moveInDialog
|
||||
} = this.state;
|
||||
const btns = [
|
||||
<Button type="primary" loading={loading} onClick={this.appSettingSave}>保存</Button>,
|
||||
// <Button type="ghost" onClick={() => this.handleOperate("import")}>{getLabel(111, "迁入")}</Button>,
|
||||
// <Button type="ghost" onClick={() => this.handleOperate("export")}>{getLabel(111, "迁出")}</Button>
|
||||
];
|
||||
const items = [
|
||||
{
|
||||
com: Input({
|
||||
|
|
@ -115,6 +146,8 @@ class AppConfig extends Component {
|
|||
buttons={btns}
|
||||
/>
|
||||
<WeaSearchGroup title="" showGroup center items={items}/>
|
||||
<MoveInDialog {...moveInDialog}
|
||||
onCancel={() => this.setState({ moveInDialog: { ...this.state.moveInDialog, visible: false } })}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* 数据迁入
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/12
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { message } from "antd";
|
||||
import ImportDialog from "../../components/importDialog";
|
||||
import * as API from "../../apis/ruleconfig";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class MoveInDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
importDialog: {
|
||||
nextloading: false, importResult: {}, imageId: "",
|
||||
customDragger: { showOperateDesc: false, accept: ".xml" }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...this.state.importDialog,
|
||||
importResult: {}, imageId: "",
|
||||
customDragger: { showOperateDesc: false, accept: ".xml" }
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleImport = (payload) => {
|
||||
const { importDialog } = this.state;
|
||||
this.setState({ importDialog: { ...importDialog, nextloading: true } });
|
||||
API.uploadConfig({ ...payload }).then(({ data, status, errormsg }) => {
|
||||
this.setState({ importDialog: { ...importDialog, nextloading: false } });
|
||||
if (status) {
|
||||
this.setState({
|
||||
importDialog: { ...importDialog, ...payload, importResult: data }
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { importDialog } = this.state;
|
||||
return (
|
||||
<ImportDialog
|
||||
{...this.props} {...importDialog} excludeKey={1}
|
||||
onResetImportResult={() => this.setState({
|
||||
importDialog: {
|
||||
...importDialog, importResult: {}, imageId: "", link: ""
|
||||
}
|
||||
})}
|
||||
nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
|
||||
nextUplaodCallback={imageId => this.handleImport({ imageId })}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default MoveInDialog;
|
||||
|
|
@ -14,6 +14,7 @@ import {
|
|||
addedemployeeList,
|
||||
deleteAcctemployee,
|
||||
reducedemployeeList,
|
||||
refreshAcctemployee,
|
||||
saveAcctemployee
|
||||
} from "../../../../../apis/calculate";
|
||||
import { personConfirmSearchConditions } from "./condition";
|
||||
|
|
@ -91,6 +92,8 @@ class Index extends Component {
|
|||
>
|
||||
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(1421, "新增")}/>
|
||||
</WeaBrowser>,
|
||||
<span className="icon-refresh" onClick={this.handleRefresh}><i
|
||||
className="icon-coms-Refresh"/></span>,
|
||||
<Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button>
|
||||
];
|
||||
calcDetail && tabBtns.splice(0, 2);
|
||||
|
|
@ -182,6 +185,23 @@ class Index extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
handleRefresh = () => {
|
||||
if (!this.handleDebounce) {
|
||||
this.handleDebounce = _.debounce(() => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
refreshAcctemployee({ salaryAcctRecordId }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.queryPCList();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
this.handleDebounce = null;
|
||||
}, 500);
|
||||
}
|
||||
this.handleDebounce();
|
||||
};
|
||||
|
||||
render() {
|
||||
const { calculateStore: { PCSearchForm }, calcDetail } = this.props;
|
||||
|
|
@ -244,13 +264,21 @@ class Index extends Component {
|
|||
<BaseInfo {...this.props}/>
|
||||
<WeaTab
|
||||
datas={tabDatas} keyParam="viewcondition" selectedKey={selectedKey}
|
||||
onChange={v => this.setState({ selectedKey: v }, () => this.queryPCList())}
|
||||
onChange={v => this.setState({
|
||||
selectedKey: v,
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.queryPCList())}
|
||||
onSearch={v => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.queryPCList())}
|
||||
onAdSearch={v => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.queryPCList())}
|
||||
buttons={this.renderTabBtns()} searchType={["base", "advanced"]} advanceHeight={220}
|
||||
showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })}
|
||||
searchsAd={getSearchs(PCSearchForm, searchConditions, 2, false)}
|
||||
onSearchChange={(v) => PCSearchForm.updateFields({ employeeName: v })}
|
||||
searchsBaseValue={PCSearchForm.getFormParams().employeeName}
|
||||
onSearch={this.queryPCList} onAdSearch={this.queryPCList}
|
||||
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
|
||||
/>
|
||||
<WeaTable
|
||||
|
|
|
|||
|
|
@ -6,6 +6,18 @@
|
|||
.wea-new-table {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.icon-refresh {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
color: #fff;
|
||||
background: #55a1f8;
|
||||
cursor: pointer;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.docalc-baseinfo-layout {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Date: 2023/9/25
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
||||
import { WeaBrowser, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
||||
import cs from "classnames";
|
||||
import { Col, Row } from "antd";
|
||||
import "./index.less";
|
||||
|
|
@ -13,6 +13,48 @@ import "./index.less";
|
|||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class EditSalaryBaseInfo extends Component {
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (this.props.visible !== nextProps.visible && nextProps.visible && !_.isEmpty(nextProps.baseInfo)) {
|
||||
nextProps.onChange(_.map(nextProps.baseInfo, it => {
|
||||
const { fieldValue, canEdit, fieldValueObj } = it;
|
||||
if (canEdit) {
|
||||
const { id: value, name: valueSpan } = fieldValueObj || fieldValue;
|
||||
return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } };
|
||||
}
|
||||
return { ...it };
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
renderBrowser = (item) => {
|
||||
const { fieldType, fieldValue, fieldCode } = item;
|
||||
const { id: value, name: valueSpan } = fieldValue;
|
||||
let browserType = {};
|
||||
switch (fieldType) {
|
||||
case "subcompanyBrowser":
|
||||
browserType = { ...browserType, type: 164, title: getLabel(111, "选择分部") };
|
||||
break;
|
||||
case "departmentBrowser":
|
||||
browserType = { ...browserType, type: 4, title: getLabel(111, "选择部门") };
|
||||
break;
|
||||
case "jobtitleBrowser":
|
||||
browserType = { ...browserType, type: 24, title: getLabel(111, "选择岗位") };
|
||||
break;
|
||||
case "jobcallBrowser":
|
||||
browserType = { ...browserType, type: 260, title: getLabel(111, "选择职称") };
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return <WeaBrowser {...browserType} viewAttr={3} value={value} valueSpan={valueSpan} inputStyle={{ width: 200 }}
|
||||
onChange={(value, valueSpan) => this.props.onChange(_.map(this.props.baseInfo, it => {
|
||||
if (fieldCode === it.fieldCode) {
|
||||
return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } };
|
||||
}
|
||||
return { ...it };
|
||||
}))}/>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { baseInfo } = this.props;
|
||||
return (
|
||||
|
|
@ -32,7 +74,7 @@ class EditSalaryBaseInfo extends Component {
|
|||
<Row type="flex" className="esf-form-content">
|
||||
{
|
||||
_.map(baseInfo, (item, index) => {
|
||||
const { fieldName, fieldValue } = item;
|
||||
const { fieldName, fieldType, fieldValue, fieldValueObj } = item;
|
||||
return (
|
||||
<Col span={(index === baseInfo.length - 1 && (index + 1) % 2 === 1) ? 24 : 12}>
|
||||
<Row className={cs("esf-form-item", {
|
||||
|
|
@ -43,7 +85,13 @@ class EditSalaryBaseInfo extends Component {
|
|||
<span className="label" title={fieldName}>{fieldName}</span>
|
||||
</Col>
|
||||
<Col span={(index === baseInfo.length - 1 && (index + 1) % 2 === 1) ? 21 : 18}>
|
||||
<span className="value" title={fieldValue}>{fieldValue}</span>
|
||||
<span className="value" title={fieldValue}>
|
||||
{
|
||||
fieldType.indexOf("Browser") !== -1 ?
|
||||
this.renderBrowser({ ...item, fieldValue: fieldValueObj || fieldValue }) :
|
||||
fieldValue
|
||||
}
|
||||
</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,12 @@ import React, { Component } from "react";
|
|||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { acctResultList, updateLockEmpStatus, updateLockStatus } from "../../../../../apis/calculate";
|
||||
import {
|
||||
acctResultList,
|
||||
updateLockEmpCellStatus,
|
||||
updateLockEmpStatus,
|
||||
updateLockStatus
|
||||
} from "../../../../../apis/calculate";
|
||||
import ProgressModal from "../../../../../components/progressModal";
|
||||
import BatchUpdateSalaryItemValDialog from "./batchUpdateSalaryItemValDialog";
|
||||
import EditSalaryCalcSlide from "./editSalaryCalcSlide";
|
||||
|
|
@ -135,7 +140,7 @@ class EditCalcTable extends Component {
|
|||
});
|
||||
};
|
||||
updateEmpLockStatus = (payload) => {
|
||||
const { lockStatus } = payload;
|
||||
const { lockStatus, salaryItemId } = payload;
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: <div>
|
||||
|
|
@ -166,13 +171,16 @@ class EditCalcTable extends Component {
|
|||
}, 500);
|
||||
});
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
updateLockEmpStatus({ ...payload, salaryAcctRecordId }).then(({ status, errormsg }) => {
|
||||
const params = salaryItemId ? payload : { ...payload, salaryAcctRecordId };
|
||||
const APIFunction = salaryItemId ? updateLockEmpCellStatus : updateLockEmpStatus;
|
||||
APIFunction(params).then(({ status, errormsg }) => {
|
||||
clearInterval(this.timerLock);
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
});
|
||||
if (status) {
|
||||
clearInterval(this.timerLock);
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
}, () => this.queryCalcResultList());
|
||||
this.queryCalcResultList();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
|
|
@ -224,8 +232,8 @@ class EditCalcTable extends Component {
|
|||
"点击锁定所有解锁的项目值": getLabel(543649, "点击锁定所有解锁的项目值"),
|
||||
"点击解锁所有锁定的项目值": getLabel(543648, "点击解锁所有锁定的项目值"),
|
||||
"锁定的项目值": getLabel(543647, "锁定的项目值"),
|
||||
"当前状态锁定,点击解锁": getLabel(111, "当前状态锁定,点击解锁"),
|
||||
"当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"),
|
||||
"当前状态锁定,右击解锁": getLabel(111, "当前状态锁定,右击解锁"),
|
||||
"当前状态未锁定,右击锁定": getLabel(111, "当前状态未锁定,右击锁定"),
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
|
||||
"批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"),
|
||||
|
|
@ -271,6 +279,9 @@ class EditCalcTable extends Component {
|
|||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleQuery = () => {
|
||||
this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } }, () => this.queryCalcResultList());
|
||||
};
|
||||
handleBatchEditing = () => {
|
||||
};
|
||||
|
||||
|
|
@ -321,7 +332,7 @@ const traverse = (arr, calcDetail) => {
|
|||
return _.map(arr, item => {
|
||||
if (!_.isEmpty(item.children)) {
|
||||
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),
|
||||
fixed: item.fixed || false, dataType: item.dataType, align: "center"
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Date: 2023/9/25
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { Button, message } from "antd";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaTab } from "ecCom";
|
||||
import EditSalaryBaseInfo from "./baseInfo";
|
||||
import PayrollItemsTable from "../../../../calculateDetail/payrollItemsTable";
|
||||
|
|
@ -87,9 +87,16 @@ class EditSalaryCalcSlide extends Component {
|
|||
};
|
||||
save = () => {
|
||||
const { id: salaryAcctEmpId } = this.props;
|
||||
const { issuedAndReissueItems, itemsByGroup } = this.state;
|
||||
const { issuedAndReissueItems, itemsByGroup, baseInfo } = this.state;
|
||||
if (_.every(baseInfo, it => !it.canEdit || (it.canEdit && !it.fieldValue))) {
|
||||
Modal.warning({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(518702, "必要信息不完整,红色*为必填项!")
|
||||
});
|
||||
return;
|
||||
}
|
||||
const payload = {
|
||||
salaryAcctEmpId,
|
||||
salaryAcctEmpId, employeeInfos: baseInfo,
|
||||
items: [
|
||||
..._.reduce(itemsByGroup, (pre, cur) => {
|
||||
return [
|
||||
|
|
@ -97,14 +104,14 @@ class EditSalaryCalcSlide extends Component {
|
|||
..._.map(cur.salaryItems, it => {
|
||||
return {
|
||||
salaryItemId: it.salaryItemId,
|
||||
resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, it.pattern || 2) : it.resultValue
|
||||
resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, !_.isNil(it.pattern) ? it.pattern : 2) : it.resultValue
|
||||
};
|
||||
})
|
||||
];
|
||||
}, []),
|
||||
...issuedAndReissueItems.map(item => ({
|
||||
salaryItemId: item.salaryItemId,
|
||||
resultValue: (item.dataType === "number" && !!item.resultValue) ? toDecimal_n(item.resultValue, item.pattern || 2) : item.resultValue
|
||||
resultValue: (item.dataType === "number" && !!item.resultValue) ? toDecimal_n(item.resultValue, !_.isNil(item.pattern) ? item.pattern : 2) : item.resultValue
|
||||
}))
|
||||
]
|
||||
};
|
||||
|
|
@ -133,7 +140,8 @@ class EditSalaryCalcSlide extends Component {
|
|||
top={0} width={60} height={100} measure={"%"}
|
||||
direction={"right"} title={this.renderTitle()}
|
||||
content={<div className="salary-calculate-esf-area">
|
||||
<EditSalaryBaseInfo baseInfo={baseInfo}/>
|
||||
<EditSalaryBaseInfo {...this.props} baseInfo={baseInfo}
|
||||
onChange={baseInfo => this.setState({ baseInfo })}/>
|
||||
<WeaTab keyParam="viewcondition" className="calc-esf-tab"
|
||||
selectedKey={selectedKey} onChange={v => this.setState({ selectedKey: v })}
|
||||
datas={!_.isEmpty(issuedAndReissueItems) ? topTab : topTab.slice(0, 1)}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Index extends Component {
|
|||
|
||||
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
|
||||
onAdSearch = (bool = true) => {
|
||||
this.calcTableRef.wrappedInstance.queryCalcResultList();
|
||||
this.calcTableRef.wrappedInstance.handleQuery();
|
||||
bool && this.openAdvanceSearch();
|
||||
};
|
||||
init = async () => {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,15 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
& > span:first-child {
|
||||
display: inline-block;
|
||||
min-width: 44px;
|
||||
}
|
||||
|
||||
& > span:last-child {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class Index extends Component {
|
|||
}
|
||||
}, () => {
|
||||
const { selectItems: salaryItems } = this.state.headerFieldsDialog;
|
||||
cacheImportField({ salaryItems: salaryItems ? salaryItems.split(",") : [] })
|
||||
cacheImportField({ salaryAcctRecordId, salaryItemIds: salaryItems ? salaryItems.split(",") : [] })
|
||||
.then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
const payload = {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ const getLabel = WeaLocaleProvider.getLabel;
|
|||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { attendCycle, salaryCycle, salaryMonth, socialSecurityCycle } = this.props;
|
||||
const { attendCycle, salaryCycle, taxCycle, salaryMonth, socialSecurityCycle } = this.props;
|
||||
const { fromDate: attendFromDate, endDate: attendEndDate } = attendCycle,
|
||||
{ fromDate: salaryFromDate, endDate: salaryEndDate } = salaryCycle;
|
||||
return (
|
||||
|
|
@ -23,7 +23,7 @@ class Index extends Component {
|
|||
</div>
|
||||
<div className="line">
|
||||
<div className="lable">{getLabel(542240, "税款所属期")}</div>
|
||||
<div className="value">{salaryMonth}</div>
|
||||
<div className="value">{taxCycle || salaryMonth}</div>
|
||||
</div>
|
||||
<div className="line">
|
||||
<div className="lable">{getLabel(543475, "考勤取值周期")}</div>
|
||||
|
|
|
|||
|
|
@ -139,6 +139,15 @@ class Index extends Component {
|
|||
case "offlineCompare":
|
||||
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calcOc/${salaryAcctRecordId}`, "_blank");
|
||||
break;
|
||||
case "LOCK":
|
||||
case "UNLOCK":
|
||||
const { selectedRowKeys } = this.calc.calcTableRef.wrappedInstance.state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(543303, "请选择表格数据!"));
|
||||
return;
|
||||
}
|
||||
this.calc.calcTableRef.wrappedInstance.updateEmpLockStatus({ lockStatus: key, acctEmpIds: selectedRowKeys });
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -161,6 +170,8 @@ class Index extends Component {
|
|||
<Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item>
|
||||
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
|
||||
<Menu.Item key="offlineCompare">{getLabel(543249, "线下对比")}</Menu.Item>
|
||||
<Menu.Item key="LOCK">{getLabel(111, "批量锁定")}</Menu.Item>
|
||||
<Menu.Item key="UNLOCK">{getLabel(111, "批量解锁")}</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
reqBtns = [
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@
|
|||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
|
||||
.wea-new-table {
|
||||
background: #fff;
|
||||
|
|
@ -83,7 +85,7 @@
|
|||
|
||||
.ant-table-tbody {
|
||||
.ant-table-row-indent {
|
||||
display: none!important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
td:not(.ant-table-selection-column) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class PayrollItemsTable extends Component {
|
|||
const { canEdit, dataType, pattern } = record;
|
||||
return dataType === "number" ? <WeaInputNumber
|
||||
disabled={!canEdit}
|
||||
precision={pattern || 2}
|
||||
precision={!_.isNil(pattern) ? pattern : 0}
|
||||
value={text || 0}
|
||||
onChange={(value) => onChangeIssueReissueValue(record.salaryItemId, value, "itemsByGroup", salarySobItemGroupId)}
|
||||
/> : <WeaInput
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ export const conditions = [
|
|||
isQuickSearch: false,
|
||||
label: "类型",
|
||||
labelcol: 6,
|
||||
valueList:[],
|
||||
valueList: [],
|
||||
options: [
|
||||
{
|
||||
key: "NUMBER",
|
||||
|
|
@ -185,13 +185,14 @@ export const reFrenceConditions = [
|
|||
{
|
||||
colSpan: 1,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["salarySobId"],
|
||||
domkey: ["salarySobIds"],
|
||||
fieldcol: 18,
|
||||
isQuickSearch: false,
|
||||
label: "薪资账套",
|
||||
labelcol: 6,
|
||||
valueList:[],
|
||||
valueList: [],
|
||||
options: [],
|
||||
multiple: true,
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class AttendanceDataViewSlide extends Component {
|
|||
this.viewAttendQuote({}, nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
document.querySelector(".attendanceRefWrapper").classList.remove("zIndex0-attendance");
|
||||
this.setState({ pageInfo: { current: 1, pageSize: 10, total: 0 } });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ class AttendanceDataViewSlide extends Component {
|
|||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
|
||||
// o.dataIndex === "username" ? "left" :
|
||||
columns: _.map(columns, o => ({ ...o, width: 150, fixed: null }))
|
||||
columns: _.map(columns, o => ({ ...o, width: 150, fixed: null }))
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class AttendanceRefrenceDataModal extends Component {
|
|||
...item,
|
||||
items: _.map(items, child => {
|
||||
const { domkey } = child;
|
||||
if (domkey[0] === "salarySobId") {
|
||||
if (domkey[0] === "salarySobIds") {
|
||||
return { ...child, options: _.map(data, it => ({ key: it.id, showname: it.content })) };
|
||||
}
|
||||
return { ...child };
|
||||
|
|
@ -77,19 +77,23 @@ class AttendanceRefrenceDataModal extends Component {
|
|||
refenceform.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = refenceform.getFormParams();
|
||||
const checkPayload = { salaryYearMonthStr: payload.salaryYearMonth, salarySobId: payload.salarySobId };
|
||||
const checkPayload = {
|
||||
salaryYearMonthStr: payload.salaryYearMonth,
|
||||
salarySobIds: payload.salarySobIds.split(",")
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
checkOperation(checkPayload).then(({ status, errormsg: errormessage }) => {
|
||||
if (status) {
|
||||
syncAttendanceRefer(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success("同步成功");
|
||||
onCancel(true);
|
||||
} else {
|
||||
message.error(errormsg || "同步失败");
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
syncAttendanceRefer({ ...payload, salarySobIds: payload.salarySobIds.split(",") })
|
||||
.then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success("同步成功");
|
||||
onCancel(true);
|
||||
} else {
|
||||
message.error(errormsg || "同步失败");
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
} else {
|
||||
this.setState({ loading: false });
|
||||
message.error(errormessage);
|
||||
|
|
@ -212,9 +216,9 @@ class AttendanceRefrenceDataModal extends Component {
|
|||
<Button type="ghost" onClick={this.handleHeaderSetting} loading={headerSetLoading}>表头设置</Button>
|
||||
];
|
||||
return (
|
||||
<WeaDialog {...this.props} style={{ width: 480, height: 174 }} buttons={buttons} initLoadCss>
|
||||
<WeaDialog {...this.props} style={{ width: 535, height: 174 }} buttons={buttons} initLoadCss>
|
||||
<div className="form-dialog-layout">
|
||||
{getSearchs(refenceform, condition, 1)}
|
||||
{getSearchs(refenceform, condition, 1, false, null, "", "multiple_select")}
|
||||
</div>
|
||||
{/* 表头设置 */}
|
||||
<SelectItemModal {...headerSetPayload}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
.generateDeclarationDetail {
|
||||
.tabWrapper{
|
||||
.tabWrapper {
|
||||
padding-left: 10px
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
height: calc(100vh - 48px);
|
||||
overflow: auto;
|
||||
|
|
@ -34,7 +35,8 @@
|
|||
.declare-body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
overflow-y: auto;
|
||||
|
||||
.wea-new-table {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class FieldTable extends Component {
|
|||
pagination={pagination}
|
||||
loading={loading}
|
||||
columns={this.getColumns()}
|
||||
scroll={{ y: "calc(100vh - 152px)" }}
|
||||
scroll={{ y: "calc(100vh - 175px)" }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class FieldManagement extends Component {
|
|||
];
|
||||
return (
|
||||
<WeaTop
|
||||
title="字段管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
title="字段管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" className="fieldManageWrapper"
|
||||
buttons={(showSalaryItemBtn || showOperateBtn) ? btns : btns.slice(-1)}
|
||||
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={[
|
||||
|
|
@ -109,26 +109,23 @@ class FieldManagement extends Component {
|
|||
}
|
||||
]}
|
||||
>
|
||||
<div className="fieldManageWrapper">
|
||||
<FieldTable name={searchVal} doSearch={doSearch} onEditLedger={this.handleEditField}
|
||||
onDeleteLedger={(record) => this.handleDeleteField([record.id])}
|
||||
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
|
||||
/>
|
||||
<FieldSlide
|
||||
{...slideparams}
|
||||
onChangeRecord={(record) => this.setState({
|
||||
slideparams: {
|
||||
...slideparams,
|
||||
record: { ...slideparams.record, ...record }
|
||||
}
|
||||
})}
|
||||
onCancel={this.handleResetField}
|
||||
onRefreshList={() => this.setState({ doSearch: !doSearch })}
|
||||
/>
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} logFunction="salarcfield" filterConditions={filterConditions}
|
||||
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
</div>
|
||||
<FieldTable name={searchVal} doSearch={doSearch} onEditLedger={this.handleEditField}
|
||||
onDeleteLedger={(record) => this.handleDeleteField([record.id])}
|
||||
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>
|
||||
<FieldSlide
|
||||
{...slideparams}
|
||||
onChangeRecord={(record) => this.setState({
|
||||
slideparams: {
|
||||
...slideparams,
|
||||
record: { ...slideparams.record, ...record }
|
||||
}
|
||||
})}
|
||||
onCancel={this.handleResetField}
|
||||
onRefreshList={() => this.setState({ doSearch: !doSearch })}
|
||||
/>
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} logFunction="salarcfield" filterConditions={filterConditions}
|
||||
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
</WeaTop>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,15 @@
|
|||
|
||||
.fieldManageWrapper {
|
||||
.wea-new-top-content {
|
||||
background: #F6F6F6;
|
||||
padding: 8px 16px 0 16px;
|
||||
}
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
}
|
||||
|
||||
.slideOuterWrapper {
|
||||
.wea-form-item-group {
|
||||
margin: 16px;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
.ledgerSlideContent {
|
||||
.ledgerSlideLayout {
|
||||
.wea-new-top {
|
||||
.ant-col-10 {
|
||||
padding-right: 45px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-new-top-req-wapper .wea-new-top-req-title > div:last-child {
|
||||
right: 45px !important;
|
||||
}
|
||||
|
||||
.ledgerSlideContent {
|
||||
}
|
||||
}
|
||||
|
||||
.copyWrapper {
|
||||
|
|
@ -237,7 +249,7 @@
|
|||
padding: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 20px;
|
||||
font-size: 20px!important;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import PersonalScopeModal from "../../../components/PersonalScopeModal";
|
|||
import {
|
||||
deleteLedgerPersonExtRange,
|
||||
deleteLedgerPersonRange,
|
||||
editLedgerPersonRange,
|
||||
getLedgerPersonRangeExclude,
|
||||
getLedgerPersonRangeExtList,
|
||||
getLedgerPersonRangeInclude,
|
||||
|
|
@ -32,7 +33,8 @@ const APIFox = {
|
|||
externalList: getLedgerPersonRangeExtList
|
||||
};
|
||||
const APISaveFox = {
|
||||
save: saveLedgerPersonRange
|
||||
save: saveLedgerPersonRange,
|
||||
edit: editLedgerPersonRange
|
||||
};
|
||||
|
||||
@inject("taxAgentStore")
|
||||
|
|
@ -55,7 +57,8 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
personalAddModal: {
|
||||
visible: false,
|
||||
title: "关联人员",
|
||||
includeType: ""
|
||||
includeType: "",
|
||||
record: {}
|
||||
},
|
||||
extEmpsWitch: "1" //非系统人员开关, 1: 开启, 0:关闭
|
||||
};
|
||||
|
|
@ -157,7 +160,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
* Params:
|
||||
* Date: 2022/11/30
|
||||
*/
|
||||
handleAddPersonal = () => {
|
||||
handleAddPersonal = (record = {}) => {
|
||||
const { personalAddModal, selectedKey } = this.state;
|
||||
if (selectedKey === "externalList") {
|
||||
this.setState({ externalPersonModalVisible: true });
|
||||
|
|
@ -165,7 +168,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
this.setState({
|
||||
personalAddModal: {
|
||||
...personalAddModal,
|
||||
visible: true,
|
||||
visible: true, record,
|
||||
includeType: selectedKey === "listInclude" ? 1 : 0
|
||||
}
|
||||
});
|
||||
|
|
@ -256,7 +259,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
disabled={_.isEmpty(rowKeys)}
|
||||
onClick={this.taxAgentRangeDelete}
|
||||
/>,
|
||||
<WeaButtonIcon buttonType="add" type="primary" onClick={this.handleAddPersonal}/>,
|
||||
<WeaButtonIcon buttonType="add" type="primary" onClick={() => this.handleAddPersonal()}/>,
|
||||
<WeaInputSearch
|
||||
style={{ width: 220 }}
|
||||
value={searchValue}
|
||||
|
|
@ -287,6 +290,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
tabActive={selectedKey}
|
||||
searchValue={searchValue}
|
||||
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
|
||||
onEditScope={this.handleAddPersonal}
|
||||
/>
|
||||
{/*关联人员范围导入*/}
|
||||
{importParams.visible && (
|
||||
|
|
@ -336,9 +340,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
onCancel={() =>
|
||||
this.setState({
|
||||
personalAddModal: {
|
||||
...personalAddModal,
|
||||
visible: false,
|
||||
includeType: ""
|
||||
...personalAddModal, record: {}, includeType: "", visible: false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,11 +232,11 @@ const TitleNormalComp = (props) => {
|
|||
<i className="icon-coms-Delete" title="删除" onClick={() => onDeleteCategory(uuid)}/>
|
||||
}
|
||||
{
|
||||
sortedIndex !== 0 && showOperateBtn &&
|
||||
name !== getLabel(111, "未分类") && sortedIndex !== 0 && showOperateBtn &&
|
||||
<i className="icon-coms-Reverse" title="向上移动" onClick={() => onUpgo(sortedIndex)}/>
|
||||
}
|
||||
{
|
||||
sortedIndex !== dataSourceLen - 1 && showOperateBtn &&
|
||||
name !== getLabel(111, "未分类") && sortedIndex !== dataSourceLen - 2 && showOperateBtn &&
|
||||
<i className="icon-coms-positive-sequence" title="向下移动" onClick={() => onDowngo(sortedIndex)}/>
|
||||
}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import LedgerSalaryItemEditSlide from "./ledgerSalaryItemEditSlide";
|
|||
import { getSalaryItemForm } from "../../../apis/ledger";
|
||||
import { commonEnumList } from "../../../apis/ruleconfig";
|
||||
import FormalFormModal from "../../salaryItem/formalFormModal";
|
||||
import { toDecimal_n } from "../../../util";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -88,7 +89,7 @@ class LedgerSalaryItemTable extends Component {
|
|||
handleEditSalaryItem = async (record) => {
|
||||
const { salarySobId, dataSource } = this.props, { salaryItemId, id } = record;
|
||||
const {
|
||||
itemHide: hideDefault,
|
||||
itemHide: hideDefault, defaultValue,
|
||||
valueType, name, description,
|
||||
roundingMode, formulaId, dataType, useInEmployeeSalary,
|
||||
pattern, canEdit, formulaContent, originFormulaContent, originSqlContent
|
||||
|
|
@ -123,7 +124,7 @@ class LedgerSalaryItemTable extends Component {
|
|||
...this.state.salaryItemPayload,
|
||||
visible: true,
|
||||
request: {
|
||||
canEdit, dataType, description,
|
||||
canEdit, dataType, description, defaultValue,
|
||||
formulaContent, formulaId, name,
|
||||
hideDefault: _.isNil(hideDefault) ? "0" : hideDefault,
|
||||
valueType, roundingMode, pattern,
|
||||
|
|
@ -151,11 +152,12 @@ class LedgerSalaryItemTable extends Component {
|
|||
});
|
||||
const { salaryItemId } = record;
|
||||
const {
|
||||
hideDefault, roundingMode, pattern, valueType,
|
||||
originFormulaContent, originSqlContent, formulaId
|
||||
hideDefault, roundingMode, pattern, valueType, defaultValue,
|
||||
originFormulaContent, originSqlContent, formulaId, dataType
|
||||
} = request;
|
||||
this.handleChangeSalaryItem({
|
||||
itemHide: hideDefault.toString(),
|
||||
defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue,
|
||||
roundingMode, pattern, valueType,
|
||||
formulaContent: valueType.toString() === "2" ? originFormulaContent : originSqlContent,
|
||||
formulaId: ((valueType.toString() === "3" && (!originSqlContent || originSqlContent === " ")) || (valueType.toString() === "2" && (!originFormulaContent || originFormulaContent === " ")) || valueType.toString() === "1") ? "" : formulaId,
|
||||
|
|
@ -171,7 +173,7 @@ class LedgerSalaryItemTable extends Component {
|
|||
this.setState({
|
||||
editFormulModal: {
|
||||
...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 : ""
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ import { getTaxAgentSelectList } from "../../../apis/taxAgent";
|
|||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
@inject("ledgerStore") @observer
|
||||
class LedgerSearchComp extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -36,14 +35,11 @@ class LedgerSearchComp extends Component {
|
|||
this.setState({
|
||||
conditions: _.map(searchConditions, o => {
|
||||
return {
|
||||
...o,
|
||||
items: _.map(o.items, j => {
|
||||
...o, items: _.map(o.items, j => {
|
||||
if (getKey(j) === "taxAgentId") {
|
||||
return {
|
||||
...j,
|
||||
options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({
|
||||
key: g.id,
|
||||
showname: g.content
|
||||
...j, options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({
|
||||
key: g.id, showname: g.content
|
||||
}))]
|
||||
};
|
||||
}
|
||||
|
|
@ -62,19 +58,16 @@ class LedgerSearchComp extends Component {
|
|||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
|
||||
</WeaFormItem>),
|
||||
colSpan: 2
|
||||
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={_.debounce(this.props.onSearch, 500)}/>
|
||||
</WeaFormItem>), colSpan: 2
|
||||
});
|
||||
});
|
||||
group.push(
|
||||
<WeaSearchGroup col={2} needTigger={true} title={c.title} showGroup={c.defaultshow} center={false}
|
||||
items={items}/>);
|
||||
group.push(<WeaSearchGroup col={2} needTigger={true} title={c.title} showGroup={c.defaultshow} center={false}
|
||||
items={items}/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
|
|
@ -82,12 +75,7 @@ class LedgerSearchComp extends Component {
|
|||
render() {
|
||||
const { conditions } = this.state;
|
||||
const { ledgerStore: { searchForm } } = this.props;
|
||||
return (
|
||||
<div className="ledgerSearch-Wrapper">
|
||||
{this.formRender(searchForm, conditions)}
|
||||
<Button type="primary" onClick={this.props.onSearch}>{getLabel(388113, "搜索")}</Button>
|
||||
</div>
|
||||
);
|
||||
return (<div className="ledgerSearch-Wrapper">{this.formRender(searchForm, conditions)}</div>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,10 +71,9 @@ class Index extends Component {
|
|||
const { taxAgentStore } = this.props;
|
||||
const { showOperateBtn } = taxAgentStore;
|
||||
const btns = [
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })}
|
||||
>新建</Button>,
|
||||
<Button type="primary" onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })}>
|
||||
{getLabel(111, "新建")}
|
||||
</Button>,
|
||||
<LedgerSearchComp onSearch={() => this.setState({ doSearch: !doSearch })}/>
|
||||
];
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
.ledgerOuter {
|
||||
.wea-new-top {
|
||||
.ant-col-10 {
|
||||
& > span:nth-child(2) {
|
||||
margin-top: -6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ledgerWrapper {
|
||||
height: 100%;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.tdEllipsis {
|
||||
display: inline-block;
|
||||
|
|
@ -22,8 +18,6 @@
|
|||
|
||||
.ledgerSearch-Wrapper {
|
||||
min-width: 350px;
|
||||
margin-top: 5px;
|
||||
margin-right: 70px;
|
||||
position: relative;
|
||||
|
||||
& > button {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,10 @@ export default class MobilePayroll extends React.Component {
|
|||
});
|
||||
} else {
|
||||
const params = this.getUrlkey();
|
||||
const { data } = await salaryBillGetToken({ uid: _.pick(params, ["recipient"]).recipient });
|
||||
const { data } = await salaryBillGetToken({
|
||||
recipient: _.pick(params, ["recipient"]).recipient,
|
||||
salaryCode: _.pick(params, ["salaryCode"]).salaryCode
|
||||
});
|
||||
this.setState({ salaryBillToken: data }, () => {
|
||||
API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
|
||||
.then(({ status, isNeedSecondAuth }) => {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class Index extends Component {
|
|||
if (it.column === "salaryYearMonth" || it.column === "sendTime") {
|
||||
return {
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
.mySalary_wrapper {
|
||||
.wea-new-top-req-content {
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
.wea-transfer-list-wrapper {
|
||||
border: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@
|
|||
padding: 5px 16px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
|
||||
.wea-select {
|
||||
width: 120px !important;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.wea-input-number {
|
||||
width: 80px !important;
|
||||
margin: 0 10px;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button } from "antd";
|
||||
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { payrollStore: { detailListConditionForm } } = this.props;
|
||||
return (
|
||||
<div className="advance-search">
|
||||
<WeaInputSearch value={detailListConditionForm.getFormParams().username}
|
||||
onChange={v => detailListConditionForm.updateFields({ username: v })}
|
||||
onSearch={this.props.onAdvanceSearch}
|
||||
/>
|
||||
<Button type="ghost" className="wea-advanced-search text-elli"
|
||||
onClick={this.props.onOpenAdvanceSearch}>{getLabel(111, "高级搜索")}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
.advance-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
top: -2.5px;
|
||||
|
||||
.wea-advanced-search {
|
||||
top: 2px;
|
||||
left: -1px;
|
||||
height: 28px;
|
||||
line-height: 1;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
color: #474747;
|
||||
padding: 4px 15px;
|
||||
}
|
||||
|
||||
.wea-advanced-search:hover {
|
||||
border: 1px solid #dadada;
|
||||
color: #474747;
|
||||
}
|
||||
|
||||
.text-elli {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
*
|
||||
* 查看工资单详情-列表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/7/15
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Spin } from "antd";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import * as API from "../../../../../apis/payroll";
|
||||
import { getQueryString } from "../../../../../util/url";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const WeaTableComx = WeaTableNew.WeaTable;
|
||||
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, dataSource: [], visible: false, updateSum: true, payload: {},
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.isQuery !== this.props.isQuery) this.setState({ updateSum: true }, () => this.getPayrollDetailList());
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getPayrollDetailList();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current, pageSize },
|
||||
updateSum: false
|
||||
}, () => this.getPayrollDetailList());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
getPayrollDetailList = () => {
|
||||
const { pageInfo } = this.state;
|
||||
const salarySendId = getQueryString("id");
|
||||
const { payrollStore: { detailListConditionForm: form, salaryTableStore } } = this.props;
|
||||
const payload = {
|
||||
salarySendId, ...pageInfo, ...form.getFormParams(),
|
||||
departmentIds: form.getFormParams().departmentIds ? form.getFormParams().departmentIds.split(",") : [],
|
||||
subCompanyIds: form.getFormParams().subCompanyIds ? form.getFormParams().subCompanyIds.split(",") : []
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
API.getPayrollDetailList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { dataKey, pageInfo: pageResult, datas: dataSource } = data;
|
||||
const { datas } = dataKey;
|
||||
const { pageNum: current, pageSize, total } = pageResult;
|
||||
salaryTableStore.getDatas(datas);
|
||||
this.setState({ payload, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } });
|
||||
}
|
||||
});
|
||||
};
|
||||
getColumns = () => {
|
||||
const { payrollStore: { salaryTableStore }, showTotalCell } = this.props;
|
||||
const { dataSource, pageInfo, selectedRowKeys, payload, updateSum } = this.state;
|
||||
const columns = _.filter(toJS(salaryTableStore.columns), (item) => item.display === "true");
|
||||
const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/salaryBill/send/sum" : "";
|
||||
if (!_.isEmpty(columns)) {
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true,
|
||||
tableScrollHeight: pageInfo.total === 0 ? 90 : 156,
|
||||
sumRowlistUrl, payload: { ...payload, updateSum },
|
||||
columns: _.map(columns, (it, idx) => ({
|
||||
...it, width: it.oldWidth, fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
|
||||
ellipsis: true
|
||||
}))
|
||||
});
|
||||
}
|
||||
return [];
|
||||
};
|
||||
postMessageToChild = (payload) => {
|
||||
const i18n = {
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计")
|
||||
};
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
handleSetCustomCols = () => {
|
||||
const { payrollStore: { salaryTableStore } } = this.props;
|
||||
this.setState({ updateSum: true }, () => {
|
||||
salaryTableStore.setColSetVisible(true);
|
||||
salaryTableStore.tableColSet(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
const { payrollStore: { salaryTableStore } } = this.props;
|
||||
const { loading, pageInfo } = this.state;
|
||||
const { pageSize, total } = pageInfo;
|
||||
const columnNum = total > 10 ? pageSize + 1 : total + 1;
|
||||
return (
|
||||
<div style={{
|
||||
height: `calc((39px * ${columnNum}) + 126.84px)`,
|
||||
maxHeight: "678px",
|
||||
minHeight: !total ? "270px" : "inherit"
|
||||
}}>
|
||||
<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" }} needScroll={true} columns={this.getColumns()}
|
||||
comsWeaTableStore={salaryTableStore}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { getSearchs } from "../../../../../util";
|
||||
import { Button } from "antd";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { payrollStore: { detailListConditionForm }, conditions } = this.props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="wea-advanced-searchsAd">
|
||||
{getSearchs(detailListConditionForm, conditions, 2, false)}
|
||||
</div>
|
||||
<div className="wea-search-buttons">
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={() => detailListConditionForm.resetForm()}>{getLabel(2022, "重置")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
*
|
||||
* 薪资所属月-提示框
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/7/15
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class SalaryMonthHelpfulTip extends Component {
|
||||
render() {
|
||||
const { salarySendDetailBaseInfo = {} } = this.props;
|
||||
const { salarySobCycle: { salaryCycle, taxCycle, attendCycle, socialSecurityCycle } } = salarySendDetailBaseInfo;
|
||||
const { fromDate, endDate } = salaryCycle;
|
||||
const { fromDate: aFromDate, endDate: aEndDate } = attendCycle;
|
||||
return (
|
||||
<WeaHelpfulTip width={200} placement="topLeft"
|
||||
title={<div>
|
||||
<div>{getLabel(111, "薪资周期")}</div>
|
||||
<div><span>{fromDate}</span><span>{getLabel(111, "至")}</span><span>{endDate}</span></div>
|
||||
<div>{getLabel(111, "税款所属期")}</div>
|
||||
<div>{taxCycle}</div>
|
||||
<div>{getLabel(111, "考勤取值周期")}</div>
|
||||
<div><span>{aFromDate}</span><span>{getLabel(111, "至")}</span><span>{aEndDate}</span></div>
|
||||
<div>{getLabel(111, "福利台账月份")}</div>
|
||||
<div>{`${getLabel(111, "引用")}${socialSecurityCycle}${getLabel(111, "的福利台账数据")}`}</div>
|
||||
</div>}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryMonthHelpfulTip;
|
||||
|
|
@ -31,3 +31,75 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//查看工资单详情-重构
|
||||
.salary-payroll-details-layout {
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.salary-payroll-details {
|
||||
padding: 0 16px 16px;
|
||||
|
||||
.salary-tb-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.salary-payroll-template-name {
|
||||
vertical-align: middle;
|
||||
margin-left: 40px;
|
||||
}
|
||||
|
||||
.label {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-container {
|
||||
background: #FFF;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #e5e5e5;
|
||||
|
||||
.wea-search-buttons {
|
||||
border-top: 1px solid #dadada;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
.wea-advanced-searchsAd {
|
||||
height: 246px;
|
||||
overflow: hidden auto;
|
||||
|
||||
.formItem-delete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -40px;
|
||||
}
|
||||
|
||||
.searchAdvanced-commonSelect {
|
||||
border-top: 1px solid #ebebeb;
|
||||
margin: 0 25px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.custom-advance-largeSpacing {
|
||||
padding-left: 26px;
|
||||
|
||||
.link {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 12px 10px 12px 26px;
|
||||
color: #2db7f5
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
*
|
||||
* 查看工资单详情-重构页面
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/7/15
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import SalaryMonthHelpfulTip from "./components/salaryMonthHelpfulTip";
|
||||
import SalaryDetailSearchPannel from "./components/salaryDetailSearchPannel";
|
||||
import SalaryDetailList from "./components/salaryDetailList";
|
||||
import { getQueryString } from "../../../util/url";
|
||||
import { removePropertyCondition } from "../../../util/response";
|
||||
import { sysConfCodeRule } from "../../../apis/ruleconfig";
|
||||
import * as API from "../../../apis/payroll";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore", "payrollStore")
|
||||
@observer
|
||||
class PayrollDetail extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
salarySendDetailBaseInfo: {}, showSearchAd: false, isQuery: false, conditions: [],
|
||||
showTotalCell: false
|
||||
};
|
||||
this.listRef = null;
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const id = getQueryString("id");
|
||||
const { payrollStore: { detailListConditionForm } } = this.props;
|
||||
const [{ data: salarySendDetailBaseInfo }, { data }, { data: confCode }] = await Promise.all([
|
||||
API.getPayrollInfo({ id }), API.getPayrollDetailSa(),
|
||||
sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })
|
||||
]);
|
||||
this.setState({
|
||||
salarySendDetailBaseInfo, showTotalCell: confCode === "1",
|
||||
conditions: removePropertyCondition(data.condition)
|
||||
}, () => detailListConditionForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
|
||||
handleExportAll = () => {
|
||||
const { payrollStore: { salaryTableStore } } = this.props;
|
||||
const columns = _.filter(toJS(salaryTableStore.columns), (item) => item.display === "true");
|
||||
WeaLoadingGlobal.start();
|
||||
const salarySendId = getQueryString("id");
|
||||
const promise = API.exportDetailList_reconfig({ salarySendId, columns: _.map(columns, it => it.dataIndex) });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { salarySendDetailBaseInfo, showSearchAd, conditions, isQuery, showTotalCell } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { salaryMonth, template } = salarySendDetailBaseInfo;
|
||||
const dropMenuDatas = [
|
||||
{
|
||||
key: "BTN_COLUMN",
|
||||
icon: <i className="icon-coms-Custom"/>,
|
||||
content: getLabel(111, "显示列定制"),
|
||||
onClick: () => this.listRef.wrappedInstance.handleSetCustomCols()
|
||||
}
|
||||
];
|
||||
const btns = [
|
||||
<Button type="primary" onClick={this.handleExportAll}>{getLabel(111, "导出全部")}</Button>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.setState({ showSearchAd: true })}
|
||||
onAdvanceSearch={() => this.setState({ isQuery: !isQuery })}/>
|
||||
];
|
||||
!showOperateBtn && btns.shift();
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(111, "查看工资单详情")} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" showDropIcon={true} dropMenuDatas={dropMenuDatas}
|
||||
buttons={btns} className="salary-payroll-details-layout"
|
||||
>
|
||||
<div className="salary-payroll-details">
|
||||
<div className="salary-tb-tip">
|
||||
<div>
|
||||
<span><span
|
||||
className="label">{getLabel(111, "薪资所属月")}</span>:<span>{salaryMonth}</span></span>
|
||||
{
|
||||
!_.isEmpty(salarySendDetailBaseInfo) &&
|
||||
<SalaryMonthHelpfulTip salarySendDetailBaseInfo={salarySendDetailBaseInfo}/>
|
||||
}
|
||||
<span
|
||||
className="salary-payroll-template-name"><span
|
||||
className="label">{getLabel(111, "工资单模板")}</span>:<span>{template}</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<SalaryDetailSearchPannel onCancel={() => this.setState({ showSearchAd: false })}
|
||||
onAdSearch={() => this.setState({ isQuery: !isQuery })}
|
||||
conditions={conditions}/>
|
||||
</div>
|
||||
{/*列表*/}
|
||||
<SalaryDetailList isQuery={isQuery} showTotalCell={showTotalCell} ref={dom => this.listRef = dom}/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PayrollDetail;
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
import React from 'react'
|
||||
import { payrollGrantDetailColumns, dataSource} from '../columns'
|
||||
|
||||
export default class PayrollGrantDeatail extends React.Component {
|
||||
|
||||
|
||||
render() {
|
||||
const handleMenuClick = () => {
|
||||
|
||||
}
|
||||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu}>导出全部</Dropdown.Button>
|
||||
<WeaInputSearch />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
/>
|
||||
<div className="titleBar">
|
||||
<div className="titleBarLeft">
|
||||
<span>薪资所属月:2021-11</span>
|
||||
<WeaHelpfulTip
|
||||
style={{marginLeft: '10px', marginRight: "10px"}}
|
||||
width={200}
|
||||
title="薪资周期\n
|
||||
2021-11-01至2021-11-30\n
|
||||
税款所属期\n
|
||||
2021-12\n
|
||||
考勤取值周期\n
|
||||
2021-11-01至2021-11-30\n
|
||||
福利台账月份\n
|
||||
引用2021-11的福利台账数据"
|
||||
placement="topLeft"
|
||||
/>
|
||||
<span>工资单模板:上海泛微工资单1</span>
|
||||
</div>
|
||||
|
||||
<div className="titleBarRight">
|
||||
<span>已发放:111/<span style={{color: "red"}}>1111</span></span>
|
||||
<span style={{marginLeft: "10px"}}>未确认:111</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Table dataSource={dataSource} columns={payrollGrantDetailColumns} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
.payPreBox {
|
||||
.pay-preview-layout {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
*
|
||||
* 工资单预览
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/6/17
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { salaryBillPreview } from "../../../../apis/payroll";
|
||||
import Content from "../../../../components/pcTemplate/content";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class PayrollPreviewDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
salaryBillData: { salaryTemplate: {}, salaryGroups: [], employeeInformation: {} }
|
||||
};
|
||||
this.preRef = null;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { salaryInfoId, recipient } = nextProps;
|
||||
salaryBillPreview({ salaryInfoId, recipient }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({ salaryBillData: data });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const {
|
||||
salaryTemplate, salaryGroups, employeeInformation, sendTime
|
||||
} = this.state.salaryBillData;
|
||||
const salaryProps = {
|
||||
theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime,
|
||||
background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "",
|
||||
itemTypeList: [employeeInformation, ...salaryGroups]
|
||||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} ref={dom => this.preRef = dom} scalable hasScroll className="payPreBox" initLoadCss
|
||||
style={{
|
||||
width: 998, height: window.innerHeight - 40, minHeight: 200, minWidth: 380, maxHeight: "90%",
|
||||
maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}
|
||||
>
|
||||
<div className="pay-preview-layout">{!_.isEmpty(salaryGroups) && <Content {...salaryProps}/>}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PayrollPreviewDialog;
|
||||
|
|
@ -10,6 +10,7 @@ import CustomPaginationTable from "../../../components/customPaginationTable";
|
|||
import PayrollPartTable from "./payrollPartTable";
|
||||
import { genPdfBeforeExport, getPayrollIssuanceProgressBar } from "../../../apis/payroll";
|
||||
import ProgressModal from "../../../components/progressModal";
|
||||
import PayrollPreviewDialog from "./components/payrollPreviewDialog";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const { ButtonSelect } = WeaDropdown;
|
||||
|
|
@ -31,6 +32,10 @@ export default class PayrollGrant extends React.Component {
|
|||
title: "工资单发放",
|
||||
grantType: "",
|
||||
salarySendId: ""
|
||||
},
|
||||
payrollPreviewDialog: {
|
||||
visible: false, title: getLabel(111, "工资单预览"),
|
||||
salaryInfoId: "", recipient: ""
|
||||
}
|
||||
};
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
|
|
@ -303,7 +308,7 @@ export default class PayrollGrant extends React.Component {
|
|||
};
|
||||
|
||||
getColumns = () => {
|
||||
const { selectedKey, showFeedbackColumn } = this.state;
|
||||
const { selectedKey, showFeedbackColumn, payrollPreviewDialog } = this.state;
|
||||
const { payrollStore } = this.props;
|
||||
const { salaryGrantTableStore: columns, salarySendDetailBaseInfo } = payrollStore;
|
||||
return _.map([
|
||||
|
|
@ -323,6 +328,15 @@ export default class PayrollGrant extends React.Component {
|
|||
onClick={() => this.handleWithdraw({ ids: [record.id] })}>
|
||||
撤回
|
||||
</a>
|
||||
<a href="javascript:void(0);" style={{ marginRight: 10 }}
|
||||
onClick={() => this.setState({
|
||||
payrollPreviewDialog: {
|
||||
...payrollPreviewDialog,
|
||||
visible: true, salaryInfoId: record.id, recipient: record.employeeId
|
||||
}
|
||||
})}>
|
||||
{getLabel(111, "查看")}
|
||||
</a>
|
||||
{
|
||||
salarySendDetailBaseInfo.showPdfBtn &&
|
||||
<a
|
||||
|
|
@ -367,11 +381,21 @@ export default class PayrollGrant extends React.Component {
|
|||
}
|
||||
} else if (salarySendDetailBaseInfo.canSend) {
|
||||
return (
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
onClick={() => this.handleGrant({ ids: [record.id] })}>
|
||||
发放
|
||||
</a>
|
||||
<React.Fragment>
|
||||
<a
|
||||
href="javascript:void(0);" style={{ marginRight: 10 }}
|
||||
onClick={() => this.handleGrant({ ids: [record.id] })}>
|
||||
发放
|
||||
</a>
|
||||
<a href="javascript:void(0);" onClick={() => this.setState({
|
||||
payrollPreviewDialog: {
|
||||
...payrollPreviewDialog,
|
||||
visible: true, salaryInfoId: record.id, recipient: record.employeeId
|
||||
}
|
||||
})}>
|
||||
{getLabel(111, "查看")}
|
||||
</a>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -538,9 +562,10 @@ export default class PayrollGrant extends React.Component {
|
|||
grantListCondition,
|
||||
setGrantListShowSearchAd,
|
||||
salaryGrantPageInfo,
|
||||
getInfoList
|
||||
getInfoList,
|
||||
loading
|
||||
} = payrollStore;
|
||||
const { selectedRowKeys, selectedKey, currentId, payrollPartModalParams } = this.state;
|
||||
const { selectedRowKeys, selectedKey, currentId, payrollPartModalParams, payrollPreviewDialog } = this.state;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange
|
||||
|
|
@ -569,35 +594,19 @@ export default class PayrollGrant extends React.Component {
|
|||
];
|
||||
return (
|
||||
<div className="payrollGrant_new">
|
||||
<WeaTop
|
||||
title="工资单发放" // 文字
|
||||
icon={<i className="icon-coms-meeting"/>} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
buttons={this.getSearchsAdQuick()}
|
||||
/>
|
||||
|
||||
<WeaTop title="工资单发放" icon={<i className="icon-coms-meeting"/>} iconBgcolor="#F14A2D"
|
||||
showDropIcon={true} buttons={this.getSearchsAdQuick()}/>
|
||||
<WeaTab
|
||||
datas={topTab}
|
||||
keyParam="viewcondition"
|
||||
selectedKey={selectedKey}
|
||||
onChange={v =>
|
||||
this.setState({ selectedKey: v }, () => {
|
||||
getInfoList({
|
||||
salarySendId: currentId,
|
||||
isGranted: v !== "0"
|
||||
});
|
||||
})
|
||||
}
|
||||
searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
searchsBasePlaceHolder="请输入姓名"
|
||||
showSearchAd={grantListShowSearchAd} // 是否展开高级搜索面板
|
||||
setShowSearchAd={bool => setGrantListShowSearchAd(bool)} //高级搜索面板受控
|
||||
searchsAd={getSearchs(grantListConditionForm, toJS(grantListCondition), 2)} // 高级搜索内部数据
|
||||
buttonsAd={adBtn} // 高级搜索内部按钮
|
||||
onSearch={() => this.handleSearch()} // 点搜索按钮时的回调
|
||||
onSearchChange={v => grantListConditionForm.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
|
||||
searchsBaseValue={grantListConditionForm.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
|
||||
datas={topTab} keyParam="viewcondition" selectedKey={selectedKey} searchType={["base", "advanced"]}
|
||||
onChange={v => this.setState({ selectedKey: v }, () => {
|
||||
getInfoList({ salarySendId: currentId, isGranted: v !== "0" });
|
||||
})}
|
||||
searchsBasePlaceHolder="请输入姓名" showSearchAd={grantListShowSearchAd} buttonsAd={adBtn}
|
||||
setShowSearchAd={bool => setGrantListShowSearchAd(bool)}
|
||||
searchsAd={getSearchs(grantListConditionForm, toJS(grantListCondition), 2)}
|
||||
onSearch={() => this.handleSearch()}
|
||||
onSearchChange={v => grantListConditionForm.updateFields({ username: v })}
|
||||
searchsBaseValue={grantListConditionForm.getFormParams().username}
|
||||
/>
|
||||
<div className="titleBar">
|
||||
<div className="titleBarLeft">
|
||||
|
|
@ -626,7 +635,7 @@ export default class PayrollGrant extends React.Component {
|
|||
</div>
|
||||
<div className="tableWrapper">
|
||||
{
|
||||
!_.isEmpty(this.getColumns()) ?
|
||||
!loading ?
|
||||
<CustomPaginationTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
|
|
@ -666,6 +675,14 @@ export default class PayrollGrant extends React.Component {
|
|||
progress={this.state.progress}
|
||||
/>
|
||||
}
|
||||
{/*工资单预览*/}
|
||||
<PayrollPreviewDialog {...payrollPreviewDialog}
|
||||
onCancel={() => this.setState({
|
||||
payrollPreviewDialog: {
|
||||
...payrollPreviewDialog,
|
||||
visible: false
|
||||
}
|
||||
})}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,6 +96,10 @@
|
|||
& > ul {
|
||||
border: 1px solid #e5e5e5;
|
||||
|
||||
.sortable-handle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wea-sortable-salary-item {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class TemplateBaseSettings extends Component {
|
|||
render() {
|
||||
const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state;
|
||||
const { ackStatus, feedbackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
|
||||
const { limitMonth, burningAfterReadingMin } = salaryBillViewingLimitSetting;
|
||||
const { monthType = "SALARY_DATE", limitMonth, burningAfterReadingMin } = salaryBillViewingLimitSetting;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<WeaSearchGroup title={getLabel(111, "水印设置")} showGroup needTigger className="waterMarkWrapper">
|
||||
|
|
@ -204,6 +204,14 @@ class TemplateBaseSettings extends Component {
|
|||
<WeaSearchGroup title={getLabel(111, "工资单时效设置")} showGroup needTigger className="waterMarkWrapper">
|
||||
<div className="agingBox">
|
||||
<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}
|
||||
onChange={limitMonth => this.setState({
|
||||
salaryBillViewingLimitSetting: {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ class TmpPreview extends Component {
|
|||
}
|
||||
const data = JSON.parse(dataStr);
|
||||
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({
|
||||
theme, tip: data.textContent || "",
|
||||
background: data.background || "",
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class salaryFileAdvanceSearchPannel extends Component {
|
|||
...child,
|
||||
options: _.map(userStatusList, o => ({ key: String(o.value), showname: o.defaultLabel }))
|
||||
};
|
||||
} else if (getKey(child) === "taxAgentId") {
|
||||
} else if (getKey(child) === "taxAgentIds") {
|
||||
return {
|
||||
...child,
|
||||
options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content }))
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class Index extends Component {
|
|||
"操作日志": getLabel(545781, "操作日志")
|
||||
};
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getSalaryFileList = (props, init = false) => {
|
||||
const { pageInfo } = this.state;
|
||||
|
|
|
|||
|
|
@ -324,10 +324,11 @@ export const salaryFileSearchConditions = [
|
|||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["taxAgentId"],
|
||||
domkey: ["taxAgentIds"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(537996, "个税扣缴义务人"),
|
||||
labelcol: 8,
|
||||
multiple: true,
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
|
|
@ -357,6 +358,15 @@ export const salaryFileSearchConditions = [
|
|||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "RANGEPICKER",
|
||||
domkey: ["adjustSalaryStartDate", "adjustSalaryEndDate"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(111, "调薪日期"),
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ export const tempNormalSetConditions = [
|
|||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["theme"],
|
||||
fieldcol: 10,
|
||||
fieldcol: 8,
|
||||
label: "工资单标题",
|
||||
lanId: 543588,
|
||||
labelcol: 6,
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class Index extends Component {
|
|||
});
|
||||
};
|
||||
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 }) => {
|
||||
if (status) {
|
||||
const { salaryTemplateBaseSet: { salarySobOptions, data: result } } = data;
|
||||
|
|
@ -84,7 +84,7 @@ class Index extends Component {
|
|||
};
|
||||
} else if (getKey(o) === "reissueRule") {
|
||||
return {
|
||||
...o, options: [
|
||||
...o, viewAttr: !detail ? o.viewAttr : 1, options: [
|
||||
{ key: "0", showname: getLabel(332, "全部") },
|
||||
{ key: "1", showname: getLabel(542696, "按规则") }
|
||||
]
|
||||
|
|
@ -92,10 +92,11 @@ class Index extends Component {
|
|||
} else if (getKey(o) === "replenishRule") {
|
||||
return {
|
||||
...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") {
|
||||
|
|
@ -104,16 +105,16 @@ class Index extends Component {
|
|||
items: _.map(it.items, o => {
|
||||
if (getKey(o) === "autoSendStatus") {
|
||||
return {
|
||||
...o,
|
||||
...o, viewAttr: !detail ? o.viewAttr : 1,
|
||||
helpfulTitle: getLabel(544272, "开启后,还需在计划任务中配置定时任务,执行工资单定时发送任务;")
|
||||
};
|
||||
} else if (getKey(o) === "smsSetting") {
|
||||
return {
|
||||
...o,
|
||||
...o, viewAttr: !detail ? o.viewAttr : 1,
|
||||
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 => {
|
||||
if (getKey(o) === "autoAckDays") {
|
||||
return {
|
||||
...o,
|
||||
...o, viewAttr: !detail ? o.viewAttr : 1,
|
||||
hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"],
|
||||
helpfulTitle: getLabel(544273, "开启后,还需在计划任务中配置定时任务,执行自动确认任务;邮箱端查看工资单暂不支持确认及反馈;")
|
||||
};
|
||||
} else if (getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") {
|
||||
return {
|
||||
...o,
|
||||
...o, viewAttr: !detail ? o.viewAttr : 1,
|
||||
hide: _.isNil(fieldsEchoData["feedbackStatus"]) ? o.hide : !fieldsEchoData["feedbackStatus"]
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
return { ...o, viewAttr: !detail ? o.viewAttr : 1 };
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
@ -174,7 +175,7 @@ class Index extends Component {
|
|||
if (it === "ackFeedbackStatus" || it === "feedbackStatus") {
|
||||
payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" });
|
||||
} else {
|
||||
payrollTempFeedbackForm.updateFields({ [it]: !_.isEmpty(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" });
|
||||
payrollTempFeedbackForm.updateFields({ [it]: (!_.isNil(fieldsEchoData[it]) && fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" });
|
||||
}
|
||||
});
|
||||
this.setState({
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import React from "react";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import { WeaButtonIcon, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
|
||||
|
|
@ -40,11 +41,13 @@ export const payrollTempNormalSetForm = (form, condition, background, onChange =
|
|||
/>
|
||||
}
|
||||
{
|
||||
getKey(fields) === "theme" &&
|
||||
getKey(fields) === "theme" && c.viewAttr === 3 &&
|
||||
<div className="sft-variables">
|
||||
<span className="sftv-tip">{getLabel(500143, "插入变量")}:</span>
|
||||
<a className="sftv-item"
|
||||
onClick={() => insertVar("theme", "${companyName}")}>{getLabel(1976, "公司名称")}</a>
|
||||
<a className="sftv-item"
|
||||
onClick={() => insertVar("theme", "${salaryYear}")}>{getLabel(111, "薪资所属年")}</a>
|
||||
<a className="sftv-item"
|
||||
onClick={() => insertVar("theme", "${salaryMonth}")}>{getLabel(542604, "薪资所属月")}</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { getPayrollItemList, getPayrollShowForm } from "../../../../apis/payroll
|
|||
import { tempNormalSetConditions } from "../conditions";
|
||||
import { payrollTempNormalSetForm } from "./formRender";
|
||||
import SalaryItemSettings from "../../../payroll/stepForm/salaryItemSettings";
|
||||
import SalaryItems from "./salaryItems";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -36,7 +37,9 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
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 }) => {
|
||||
if (status) {
|
||||
const { salaryTemplateShowSet, salaryTemplateSalaryItemSet: salaryItemSet, salaryBillItemNameSet } = data;
|
||||
|
|
@ -69,7 +72,7 @@ class Index extends Component {
|
|||
items: _.map(it.items, o => {
|
||||
if (getKey(o) === "textContentPosition") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
...o, label: getLabel(o.lanId, o.label), viewAttr: !detail ? o.viewAttr : 1,
|
||||
options: [
|
||||
{ key: "1", showname: getLabel(542697, "薪资项目前") },
|
||||
{ key: "2", showname: getLabel(542698, "薪资项目后") }
|
||||
|
|
@ -77,10 +80,10 @@ class Index extends Component {
|
|||
};
|
||||
} else if (getKey(o) === "background") {
|
||||
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() {
|
||||
const { conditions, salaryBillItemNameSet, salaryItemSet } = this.state;
|
||||
const { payrollStore: { payrollTempNormalForm, tmplDataSource } } = this.props;
|
||||
const { detail, payrollStore: { payrollTempNormalForm, tmplDataSource } } = this.props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
{!_.isEmpty(conditions) && payrollTempNormalSetForm(payrollTempNormalForm, conditions, toJS(tmplDataSource).background, this.handleChange, this.handleInsertVar)}
|
||||
|
|
@ -158,20 +161,22 @@ class Index extends Component {
|
|||
title={
|
||||
<div className="salarySetTitle">
|
||||
<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, "添加分类"))}/>
|
||||
</div>
|
||||
}
|
||||
items={[]} needTigger showGroup
|
||||
>
|
||||
<SalaryItemSettings
|
||||
ref={dom => this.salaryItemSettingsRef = dom}
|
||||
dataSource={salaryItemSet} salaryTemplateId={this.props.tmplId || ""}
|
||||
onChangeSalaryItem={this.handleChangeSalaryItem}
|
||||
onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting}
|
||||
salarySobId={toJS(tmplDataSource).salarySob}
|
||||
isReplenish={false} salaryBillItemNameSet={salaryBillItemNameSet}
|
||||
/>
|
||||
{
|
||||
detail ? <SalaryItems dataSource={salaryItemSet}/> : <SalaryItemSettings
|
||||
ref={dom => this.salaryItemSettingsRef = dom}
|
||||
dataSource={salaryItemSet} salaryTemplateId={this.props.tmplId || ""}
|
||||
onChangeSalaryItem={this.handleChangeSalaryItem}
|
||||
onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting}
|
||||
salarySobId={toJS(tmplDataSource).salarySob}
|
||||
isReplenish={false} salaryBillItemNameSet={salaryBillItemNameSet}
|
||||
/>
|
||||
}
|
||||
</WeaSearchGroup>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -8,6 +8,7 @@ import React, { Component } from "react";
|
|||
import { toJS } from "mobx";
|
||||
import { WeaButtonIcon, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
||||
import SalaryItemSettings from "../../../payroll/stepForm/salaryItemSettings";
|
||||
import SalaryItems from "../payrollTempNormalSet/salaryItems";
|
||||
import { getReplenishForm } from "../../../../apis/payroll";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -68,27 +69,30 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { payrollStore: { tmplDataSource } } = this.props;
|
||||
const { payrollStore: { tmplDataSource }, detail } = this.props;
|
||||
const { replenishSalaryTemplateSalaryItemSet, salaryBillItemNameSet } = this.state;
|
||||
return (
|
||||
<WeaSearchGroup
|
||||
title={
|
||||
<div className="salarySetTitle">
|
||||
<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, "添加分类"))}/>
|
||||
</div>
|
||||
}
|
||||
items={[]} needTigger showGroup>
|
||||
<SalaryItemSettings
|
||||
ref={dom => this.salaryItemSettingsRef = dom}
|
||||
dataSource={replenishSalaryTemplateSalaryItemSet}
|
||||
onChangeSalaryItem={this.handleChangeSalaryItem}
|
||||
onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting}
|
||||
salarySobId={toJS(tmplDataSource).salarySob}
|
||||
salaryTemplateId={this.props.tmplId || ""}
|
||||
isReplenish={true} salaryBillItemNameSet={salaryBillItemNameSet}
|
||||
/>
|
||||
{
|
||||
detail ? <SalaryItems dataSource={replenishSalaryTemplateSalaryItemSet}/> :
|
||||
<SalaryItemSettings
|
||||
ref={dom => this.salaryItemSettingsRef = dom}
|
||||
dataSource={replenishSalaryTemplateSalaryItemSet}
|
||||
onChangeSalaryItem={this.handleChangeSalaryItem}
|
||||
onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting}
|
||||
salarySobId={toJS(tmplDataSource).salarySob}
|
||||
salaryTemplateId={this.props.tmplId || ""}
|
||||
isReplenish={true} salaryBillItemNameSet={salaryBillItemNameSet}
|
||||
/>
|
||||
}
|
||||
</WeaSearchGroup>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class Index extends Component {
|
|||
copyDialog: { visible: false, title: "", copyId: "", salarySobId: "" },
|
||||
tmplSlide: {
|
||||
visible: false, tmplId: "", top: 0, width: 792, height: 100,
|
||||
measureT: "%", measureX: "px", measureY: "%"
|
||||
measureT: "%", measureX: "px", measureY: "%", detail: false
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -82,9 +82,10 @@ class Index extends Component {
|
|||
const { copyDialog, tmplSlide, selectedRowKeys } = this.state;
|
||||
const { id, salarySobId } = record;
|
||||
switch (key) {
|
||||
case "view":
|
||||
case "edit":
|
||||
this.setState({
|
||||
tmplSlide: { ...tmplSlide, visible: true, tmplId: id }
|
||||
tmplSlide: { ...tmplSlide, visible: true, tmplId: id, detail: key === "view" }
|
||||
});
|
||||
break;
|
||||
case "copy":
|
||||
|
|
@ -160,21 +161,22 @@ class Index extends Component {
|
|||
const {} = record;
|
||||
//显示更新模板
|
||||
return showOperateBtn ? <React.Fragment>
|
||||
<a href="javascript:void(0);" onClick={() => this.handleOpts({ key: "edit" }, record)}
|
||||
style={{ marginRight: 10 }}>{getLabel(501169, "编辑")}</a>
|
||||
<a href="javascript:void(0);" style={{ marginRight: 10 }}
|
||||
onClick={() => this.handleOpts({ key: "copy" }, record)}
|
||||
>{getLabel(77, "复制")}</a>
|
||||
<Dropdown
|
||||
overlay={<Menu onClick={e => this.handleOpts(e, record)}>
|
||||
<Menu.Item key="del">{getLabel(535052, "删除")}</Menu.Item>
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
>
|
||||
<a href="javascript:void(0);"><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment> : <a href="javascript:void(0);">{getLabel(83110, "查看详情")}</a>;
|
||||
<a href="javascript:void(0);" onClick={() => this.handleOpts({ key: "edit" }, record)}
|
||||
style={{ marginRight: 10 }}>{getLabel(501169, "编辑")}</a>
|
||||
<a href="javascript:void(0);" style={{ marginRight: 10 }}
|
||||
onClick={() => this.handleOpts({ key: "copy" }, record)}
|
||||
>{getLabel(77, "复制")}</a>
|
||||
<Dropdown
|
||||
overlay={<Menu onClick={e => this.handleOpts(e, record)}>
|
||||
<Menu.Item key="del">{getLabel(535052, "删除")}</Menu.Item>
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0);"><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment> :
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.handleOpts({ key: "view" }, record)}>{getLabel(83110, "查看详情")}</a>;
|
||||
}
|
||||
}
|
||||
]}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class Index extends Component {
|
|||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
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;
|
||||
return <div className="payroll-title-flex titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
|
|
@ -156,7 +156,11 @@ class Index extends Component {
|
|||
<React.Fragment>
|
||||
<Button type="ghost"
|
||||
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>
|
||||
}
|
||||
</div>
|
||||
|
|
@ -185,8 +189,29 @@ class Index extends Component {
|
|||
payrollStore: {
|
||||
initPayrollTempForm, initPayrollTempFeedbackForm, setSalaryBillItemNameSetting,
|
||||
initPayrollTempNormalForm, setTmplDataSource, hasBeenModify
|
||||
}, onClose
|
||||
}, onClose, detail
|
||||
} = 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) {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
.salary-payroll-content {
|
||||
padding: 8px 16px;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
|
||||
& > .wea-search-group {
|
||||
background: #FFF;
|
||||
|
|
@ -157,7 +158,7 @@
|
|||
margin-left: 10px;
|
||||
position: absolute;
|
||||
top: 25%;
|
||||
right: -208px;
|
||||
right: -262px;
|
||||
margin-top: -2px;
|
||||
|
||||
.sftv-item {
|
||||
|
|
|
|||
|
|
@ -91,36 +91,36 @@ export const condition = [
|
|||
labelcol: 6,
|
||||
viewAttr: 2
|
||||
},
|
||||
// {
|
||||
// browserConditionParam: {
|
||||
// completeParams: {},
|
||||
// conditionDataParams: {},
|
||||
// dataParams: {},
|
||||
// destDataParams: {},
|
||||
// hasAddBtn: false,
|
||||
// hasAdvanceSerach: true,
|
||||
// idSeparator: ",",
|
||||
// isAutoComplete: 1,
|
||||
// isDetail: 0,
|
||||
// isMultCheckbox: false,
|
||||
// isSingle: false,
|
||||
// linkUrl: "",
|
||||
// pageSize: 10,
|
||||
// quickSearchName: "",
|
||||
// replaceDatas: [],
|
||||
// title: getLabel(111, "岗位"),
|
||||
// type: "278",
|
||||
// viewAttr: 2
|
||||
// },
|
||||
// colSpan: 2,
|
||||
// conditionType: "BROWSER",
|
||||
// domkey: ["position"],
|
||||
// fieldcol: 18,
|
||||
// isQuickSearch: false,
|
||||
// label: getLabel(111, "岗位"),
|
||||
// labelcol: 6,
|
||||
// viewAttr: 2
|
||||
// },
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: getLabel(111, "岗位"),
|
||||
type: "278",
|
||||
viewAttr: 2
|
||||
},
|
||||
colSpan: 2,
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["position"],
|
||||
fieldcol: 18,
|
||||
isQuickSearch: false,
|
||||
label: getLabel(111, "岗位"),
|
||||
labelcol: 6,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
|
|
@ -403,8 +403,8 @@ export const mapBarOptions = (params) => ({
|
|||
},
|
||||
grid: {
|
||||
top: "10%",
|
||||
right: "0%",
|
||||
left: "5%",
|
||||
right: "2%",
|
||||
left: "2%",
|
||||
bottom: "10%",
|
||||
containLabel: true
|
||||
},
|
||||
|
|
@ -457,8 +457,9 @@ export const mapBarOptions = (params) => ({
|
|||
series: _.map(params.data, (item, index) => {
|
||||
return {
|
||||
name: item.name,
|
||||
barWidth: "32",
|
||||
barGap: "0%",
|
||||
barMaxWidth: 30,
|
||||
barMinWidth: 10,
|
||||
barGap: 0,
|
||||
data: _.map(item.data, (it) => it.replace(/,/g, "")),
|
||||
type: "bar",
|
||||
itemStyle: {
|
||||
|
|
@ -484,6 +485,10 @@ export const mapBarOptions = (params) => ({
|
|||
];
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
textShadowColor: "transparent",
|
||||
color: "#fff"
|
||||
},
|
||||
rich: {
|
||||
a: {
|
||||
fontWeight: "bold",
|
||||
|
|
@ -501,8 +506,9 @@ export const mapBarOptions = (params) => ({
|
|||
}),
|
||||
dataZoom: [
|
||||
{
|
||||
type: "inside"
|
||||
|
||||
type: "inside",
|
||||
start: params.xAxis.length <= 7 ? 0 : 25,
|
||||
end: params.xAxis.length <= 7 ? 100 : 75,
|
||||
},
|
||||
{
|
||||
type: "slider",
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class PovitpivotChartModal extends Component {
|
|||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { id, dimensionId, dimensionValue, isShare } = nextProps;
|
||||
this.getDataPerspective({ id, dimensionId, dimensionValue, isShare });
|
||||
const { id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth } = nextProps;
|
||||
this.getDataPerspective({ id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth });
|
||||
} else {
|
||||
this.setState({
|
||||
dataSource: [],
|
||||
|
|
@ -64,11 +64,11 @@ class PovitpivotChartModal extends Component {
|
|||
});
|
||||
} else if (type === "turn") {
|
||||
if (id === "PAGEINFO") {
|
||||
const { id, dimensionId, dimensionValue, isShare } = this.props;
|
||||
const { id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth } = this.props;
|
||||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () =>
|
||||
this.getDataPerspective({
|
||||
id, dimensionId, dimensionValue, isShare
|
||||
id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue