Merge branch 'feature/2.19.1.2501.01-PC端Token验证' into custom/湖南国科微电子股份有限公司(HR项目)
# Conflicts: # pc4mobx/hrmSalary/apis/payroll.js # pc4mobx/hrmSalary/pages/mobilePayroll/index.js
This commit is contained in:
commit
4d1b58ca22
|
|
@ -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);
|
||||
|
|
@ -215,8 +218,9 @@ export const exportComparisonResult = (salaryAcctRecordId) => {
|
|||
};
|
||||
|
||||
// 核算进度条
|
||||
export const getCalculateProgress = (id) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=ACCT_PROGRESS_" + id, "get", {});
|
||||
export const getCalculateProgress = (id = "", paymentOrganization = "") => {
|
||||
const extra= paymentOrganization ? `_${paymentOrganization}` : paymentOrganization
|
||||
return WeaTools.callApi(`/api/bs/hrmsalary/progress/getRate?cacheKey=ACCT_PROGRESS_${id}${extra}`, "get", {});
|
||||
};
|
||||
|
||||
// 核算进度条
|
||||
|
|
@ -232,6 +236,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);
|
||||
|
|
@ -270,6 +278,10 @@ export const deleteExportTemplate = (params) => {
|
|||
export const getExportTemplateForm = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params);
|
||||
};
|
||||
//薪资审批-薪资核算页面获取审批信息
|
||||
export const getApprovalInfoByRecordId = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salarysob/salaryApproval/getApprovalInfoByRecordId", "GET", params);
|
||||
};
|
||||
//薪资核算-薪资项目改变否
|
||||
export const getCompareSobConfig = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/compareSobConfig", "GET", 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 => {
|
||||
|
|
@ -155,3 +159,15 @@ export const salarysobRangeImportData = params => {
|
|||
export const getSalaryItemForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params);
|
||||
};
|
||||
//薪资核算规则配置-获取薪资审批规则表单
|
||||
export const getSalaryApprovalForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/getForm", params);
|
||||
};
|
||||
//薪资核算规则配置-保存薪资审批规则表单
|
||||
export const salaryApprovalSaveForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/saveForm", params);
|
||||
};
|
||||
//薪资核算规则配置-获取能够添加的项目
|
||||
export const getListSalaryItem = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/listSalaryItem", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -206,22 +206,23 @@ export const sendMobileCode = (params) => {
|
|||
return postFetch("/api/bs/hrmsalary/salaryBill/sendMobileCode", params);
|
||||
};
|
||||
//工资单-验证方式
|
||||
export const payrollCheckType = (params, header) => {
|
||||
return fetch(`/api/bs/hrmsalary/salaryBill/payrollCheckType`, {
|
||||
export const payrollCheckType = async header => {
|
||||
const res = await fetch(`/api/bs/hrmsalary/salaryBill/payrollCheckType`, {
|
||||
method: "GET",
|
||||
mode: "cors",
|
||||
headers: { "Content-Type": "application/json", ...header }
|
||||
}).then(res => res.json());
|
||||
// return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/payrollCheckType", "GET", params);
|
||||
});
|
||||
return await res.json();
|
||||
};
|
||||
//工资单-反馈验证
|
||||
export const feedBackSalaryBill = params => {
|
||||
export const feedBackSalaryBill = async params => {
|
||||
const { header, ...payload } = params;
|
||||
return fetch(`/api/bs/hrmsalary/salaryBill/feedBackSalaryBill?${convertToUrlString(payload)}`, {
|
||||
const res = await fetch(`/api/bs/hrmsalary/salaryBill/feedBackSalaryBill?${convertToUrlString(payload)}`, {
|
||||
method: "GET",
|
||||
mode: "cors",
|
||||
headers: { "Content-Type": "application/json", ...header }
|
||||
}).then(res => res.json());
|
||||
});
|
||||
return await res.json();
|
||||
// return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/feedBackSalaryBill", "GET", params);
|
||||
};
|
||||
//工资单-确认
|
||||
|
|
|
|||
|
|
@ -134,3 +134,27 @@ 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 downloadPageListTemplate = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/common/pageList/template/file/download", 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);
|
||||
};
|
||||
//薪酬统计报表-删除模板
|
||||
export const deleteTemplatePageList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/common/pageList/template/delete", 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);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export const getVariableSalaryDetail = params => {
|
|||
};
|
||||
// 获取当前管理员下的所有的个税扣缴义务人
|
||||
export const getAdminTaxAgentList = () => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getAdminTaxAgentList", "get", {});
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare: false });
|
||||
};
|
||||
// 浮动薪酬档案导出
|
||||
export const exportVariableSalary = (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(String(item)) === -1;
|
||||
}).forEach((id) => {
|
||||
if (String(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,245 @@
|
|||
/*
|
||||
* 自定义穿梭框组件
|
||||
* 弹框选择
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable } 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: [], columns: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
query: props.searchParamsKey ? { [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]: "" }, selectedRowKeys: [],
|
||||
rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
});
|
||||
this.selectedData = {};
|
||||
}
|
||||
}
|
||||
|
||||
getData = (init = false, props) => {
|
||||
const { query, pageInfo } = this.state;
|
||||
const { completeURL, convertDatasource, dataParams = {}, dialogType } = props || this.props;
|
||||
let payload = { ...dataParams, ...query };
|
||||
dialogType === "table" && (payload = { ...payload, ...pageInfo });
|
||||
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, columns: data.columns,
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
} 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>{this.props.title || getLabel(111, "数据选择")}</span>
|
||||
<div>{this.props.titleOptsComs}</div>
|
||||
</div>);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, pageInfo, selectedRowKeys,
|
||||
columns
|
||||
} = this.state;
|
||||
const {
|
||||
searchParamsKey, saveLoading, dialogType = "", rowKey, tableOpts = {}, 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>
|
||||
]
|
||||
} = this.props;
|
||||
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>;
|
||||
if (dialogType === "table") {
|
||||
const sheight = this.dialog ? this.dialog.state.height - 156 : 260;
|
||||
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());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getData());
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: selectedRowKeys => this.setState({ selectedRowKeys }, () => this.props.onSelect(selectedRowKeys))
|
||||
};
|
||||
dom = <div className="wea-hr-muti-input-table">
|
||||
{this.props.children}
|
||||
<WeaTable dataSource={listDatas} loading={loading} pagination={pagination} scroll={{ y: sheight }}
|
||||
rowSelection={rowSelection} rowKey={rowKey || "id"}
|
||||
columns={!_.isEmpty(tableOpts) ? [...columns, tableOpts] : columns}/>
|
||||
</div>;
|
||||
}
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={this.renderTitle()}
|
||||
className="custom_browser_dialog" draggable={true} 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,99 @@
|
|||
.custom_browser_dialog {
|
||||
.wea-hr-muti-dialog-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.wea-select, .ant-select-selection, .ant-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wea-select {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ant-select-selection {
|
||||
height: 30px;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-hr-muti-input-table {
|
||||
background: #f6f6f6;
|
||||
padding: 8px 16px;
|
||||
height: 100%;
|
||||
|
||||
.table_opts {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background: #FFF;
|
||||
|
||||
.wea-button-icon {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
||||
import { observer } from "mobx-react";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
@observer
|
||||
export default class FormInfo extends Component {
|
||||
renderForm = () => {
|
||||
const {
|
||||
formFields, form, colCount, itemRender, onSelectedChangeHandle, showLabel, multiColumn, custLabelCol,
|
||||
childrenComponents
|
||||
} = this.props;
|
||||
|
||||
let groupArr = [];
|
||||
const formParams = form.getFormParams();
|
||||
const labelVisible = showLabel == null || showLabel == true;
|
||||
const col = colCount ? colCount : 1;
|
||||
const labelCol = labelVisible ? (custLabelCol || 6) : 0;
|
||||
const itemProps = {
|
||||
// ratio1to2: labelVisible && custLabelCol == null,
|
||||
style: { marginLeft: 0 },
|
||||
tipPosition: "bottom",
|
||||
labelCol: { span: labelCol },
|
||||
wrapperCol: { span: 22 - labelCol }
|
||||
};
|
||||
const textAreaProps = { minRows: 4, maxRows: 4 };
|
||||
|
||||
formFields.map((fields, i) => {
|
||||
let formItems = [];
|
||||
fields.items.map((field, j) => {
|
||||
const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null;
|
||||
const showCheckbox = field.checkbox || false;
|
||||
let label = getLabel(field.lanId, field.label);
|
||||
if (showCheckbox)
|
||||
label = <WeaCheckbox content={label} value={field.checkboxValue} onChange={(v) => {
|
||||
field.checkboxValue = v === "1";
|
||||
onSelectedChangeHandle && onSelectedChangeHandle(field, v);
|
||||
}}/>;
|
||||
let coms;
|
||||
if (customerRender == null) {
|
||||
coms = <WeaSwitch fieldConfig={{
|
||||
...field, helpfulTip: getLabel(field.helpfulTipLanId || "", field.helpfulTip || ""), ...textAreaProps,
|
||||
hasBorder: false
|
||||
}} form={form} formParams={formParams}/>;
|
||||
} else {
|
||||
coms = customerRender({
|
||||
...field, helpfulTip: getLabel(field.helpfulTipLanId || "", field.helpfulTip || "")
|
||||
}, textAreaProps, form, formParams);
|
||||
}
|
||||
Object.assign(itemProps, { label, error: form.getError(field) });
|
||||
let col = colCount ? colCount : 1;
|
||||
if (multiColumn != null) {//检查有哪些字段需要一行显示多个
|
||||
const idx = _.findIndex(multiColumn, item => item.key === field.domkey[0]);
|
||||
if (idx > -1) {
|
||||
col = field.colSpan || 1;
|
||||
if (multiColumn[idx].labelCol != null)//检查字段是否有配置标题宽度
|
||||
Object.assign(itemProps, {
|
||||
labelCol: { span: multiColumn[idx].labelCol },
|
||||
wrapperCol: { span: 24 - multiColumn[idx].labelCol }
|
||||
});
|
||||
} else {
|
||||
Object.assign(itemProps, {
|
||||
labelCol: { span: labelCol },
|
||||
wrapperCol: { span: 24 - labelCol }
|
||||
});
|
||||
}
|
||||
}
|
||||
coms != null && formItems.push({
|
||||
com: (<WeaFormItem {...itemProps}>{coms}</WeaFormItem>), hide: field.hide,
|
||||
col
|
||||
});
|
||||
|
||||
if (childrenComponents && childrenComponents[field.domkey[0]]) {
|
||||
childrenComponents[field.domkey[0]]().map(child => formItems.push(child));
|
||||
}
|
||||
});
|
||||
|
||||
groupArr.push(<WeaSearchGroup
|
||||
center={this.props.center != null ? this.props.center : true}
|
||||
needTigger={true}
|
||||
title={formFields.length < 2 ? null : fields.title}
|
||||
showGroup={true}
|
||||
items={formItems}
|
||||
col={col}
|
||||
fontSize={14}/>);
|
||||
});
|
||||
return groupArr;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { formFields, className, form } = this.props;
|
||||
if (formFields == null || !form.isFormInit) return (<div></div>);
|
||||
return (
|
||||
<div className={className}>{this.renderForm()}</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -39,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: nextProps.record.targetType !== "SQL" ? String(nextProps.record.targetId) : nextProps.record.target,
|
||||
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 = [
|
||||
|
|
@ -112,6 +98,11 @@ class PersonalScopeModal extends Component {
|
|||
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" : "" });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -129,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: "信息确认",
|
||||
|
|
@ -139,14 +130,14 @@ class PersonalScopeModal extends Component {
|
|||
}
|
||||
const payload = {
|
||||
employeeStatus: status.split(","),
|
||||
includeType,
|
||||
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("保存成功");
|
||||
|
|
@ -159,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) {
|
||||
|
|
@ -176,7 +168,7 @@ class PersonalScopeModal extends Component {
|
|||
break;
|
||||
case "SQL":
|
||||
return <div style={{ display: "flex", alignItems: "center" }}>
|
||||
<WeaTextarea minRows={2} viewAttr={3} style={{ width: 270 }} value={targetTypeIds}
|
||||
<WeaTextarea minRows={2} viewAttr={3} style={{ width: 270 }} value={targetTypeIdsNames}
|
||||
onChange={val => this.setState({ targetTypeIds: val, targetTypeIdsNames: val })}/>
|
||||
<WeaHelpfulTip style={{ marginLeft: 10 }} width={200} placement="topLeft" title={<SQLHelpTip/>}/>
|
||||
</div>;
|
||||
|
|
@ -186,9 +178,9 @@ class PersonalScopeModal extends Component {
|
|||
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 });
|
||||
|
|
@ -197,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: ""
|
||||
|
|
@ -205,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>,
|
||||
|
|
@ -233,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 })}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class PersonalScopeTable extends Component {
|
|||
}
|
||||
|
||||
getPersonalScopeList = (tabActive = this.props.tabActive) => {
|
||||
const { searchValue, searchKeyVal, APIFox } = this.props;
|
||||
const { searchValue, searchKeyVal, APIFox, showOperateBtn } = this.props;
|
||||
const { pageInfo, loading } = this.state;
|
||||
const payload = {
|
||||
[searchKeyVal["key"]]: searchKeyVal["value"],
|
||||
|
|
@ -59,7 +59,10 @@ class PersonalScopeTable extends Component {
|
|||
columns: _.map(columns, item => {
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
render: (text, record) => {
|
||||
if (item.dataIndex === "targetName" && showOperateBtn) {
|
||||
return <a href="javascript:void(0);" onClick={() => this.props.onEditScope(record)}>{text}</a>;
|
||||
}
|
||||
return <span className="tdEllipsis" title={text}>{text}</span>;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,8 +18,10 @@ CodeMirror.extendMode("javascript", {
|
|||
if (this.jsonMode) {
|
||||
return /^[\[,{]$/.test(content) || /^}/.test(textAfter) || /^]/.test(textAfter);
|
||||
} else {
|
||||
if (content == ";" && state.lexical && state.lexical.type == ")") return false;
|
||||
return /^[;{}]$/.test(content) && !/^;/.test(textAfter);
|
||||
if (content == ";" && state.lexical && state.lexical.type == "}") return false;
|
||||
// if (content == ";" && state.lexical && state.lexical.type == ")") return false;
|
||||
return /[=,]/.test(content) || /.*\)/.test(textAfter);
|
||||
// return /^[;{}]$/.test(content) && !/^;/.test(textAfter);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -94,7 +96,8 @@ CodeMirror.defineExtension("autoFormatRange", function (from, to) {
|
|||
atSol = false;
|
||||
}
|
||||
if (!atSol && inner.mode.newlineAfterToken &&
|
||||
inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i + 1] || "", inner.state))
|
||||
// inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i + 1] || "", inner.state))
|
||||
inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos, stream.pos + 2) || text[i + 1] || "", inner.state))
|
||||
newline();
|
||||
}
|
||||
if (!stream.pos && outer.blankLine) outer.blankLine(state);
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@
|
|||
}
|
||||
|
||||
.data-detail {
|
||||
padding-bottom: 16px;
|
||||
|
||||
.salary-group {
|
||||
background: #FFF;
|
||||
|
||||
|
|
@ -153,13 +155,14 @@
|
|||
.item-count {
|
||||
//flex-basis: 328px;
|
||||
flex: 1;
|
||||
padding-left: 16px;
|
||||
padding: 12px 16px;
|
||||
height: 100%;
|
||||
line-height: 40px;
|
||||
background: #fff;
|
||||
font-size: 12px;
|
||||
color: #5F5F5F;
|
||||
word-break: break-all;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,68 +54,16 @@ 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 补算
|
||||
// variableSalary 浮动薪酬
|
||||
|
||||
const Routes = (
|
||||
<Route key="hrmSalary" path="hrmSalary" onEnter={getLocaleLabel} component={Layout}>
|
||||
<Route key="historicalPayroll" path="historicalPayroll" component={HistoricalPayroll}/>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ class Layout extends Component {
|
|||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) {
|
||||
stores.baseFormStore.initForm();
|
||||
stores.baseFormStore.initFormExtra();
|
||||
if (window.location.hash.indexOf("payroll") !== -1) {
|
||||
window.localStorage.removeItem("template-basedata");
|
||||
window.localStorage.removeItem("salary-showset");
|
||||
|
|
@ -30,6 +32,7 @@ class Layout extends Component {
|
|||
}
|
||||
|
||||
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");
|
||||
|
|
@ -41,8 +44,31 @@ class Layout extends Component {
|
|||
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>
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ class Index extends Component {
|
|||
const payload = {
|
||||
...pageInfo, ...extra,
|
||||
departmentIds: departmentIds ? departmentIds.split(",") : [],
|
||||
positionIds: departmentIds ? departmentIds.split(",") : [],
|
||||
operatorIds: departmentIds ? departmentIds.split(",") : [],
|
||||
positionIds: positionIds ? positionIds.split(",") : [],
|
||||
operatorIds: operatorIds ? operatorIds.split(",") : [],
|
||||
effectiveTime: effectiveTime1 ? [effectiveTime1, effectiveTime2] : [],
|
||||
operateTime: operateTime1 ? [operateTime1, operateTime2] : []
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -154,6 +153,36 @@ export const salaryDetailSearchConditions = [
|
|||
multiple: true,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: false,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
icon: "icon-coms-hrm",
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "",
|
||||
type: "17",
|
||||
viewAttr: 2
|
||||
},
|
||||
colSpan: 1,
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["employeeIds"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(111, "人员"),
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
|
|
@ -219,3 +248,66 @@ 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: "UPLOAD",
|
||||
domkey: ["fileId"],
|
||||
fieldcol: 14,
|
||||
label: "导出模板",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
datas: [],
|
||||
multiSelection: false,
|
||||
showClearAll: false,
|
||||
showListBottom: true,
|
||||
showListTop: true,
|
||||
maxFilesNumber: 1,
|
||||
limitType: "xlsx",
|
||||
uploadUrl: "/api/doc/upload/uploadFile",
|
||||
category: "111",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
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)}>
|
||||
|
|
|
|||
|
|
@ -6,13 +6,19 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import { message, Spin } from "antd";
|
||||
import * as API from "../../../apis/statistics";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaSelect } from "ecCom";
|
||||
import { Button, message, Modal, Spin } from "antd";
|
||||
import { getIframeParentHeight } from "../../../util";
|
||||
import { sysConfCodeRule } from "../../../apis/ruleconfig";
|
||||
import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog";
|
||||
import SalaryDetailsTempDialog from "./salaryDetailsTempDialog";
|
||||
import SalaryTempMangerDialog from "./salaryTempMangerDialog";
|
||||
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,15 +30,32 @@ 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: "", tempManageQuery: false,
|
||||
showTotalCell: false, updateSum: true,
|
||||
tempDialog: { visible: false, setting: [], heads: [], id: "", template: {} },
|
||||
transferDialog: {
|
||||
visible: false, searchParamsKey: "name", saveLoading: false,
|
||||
dataParams: { page: "salary_details_report" },
|
||||
completeURL: "", convertDatasource: datas => {
|
||||
return {
|
||||
listDatas: _.map(datas.setting, o => ({ id: o.id || o.column, name: o.name || o.text })),
|
||||
checked: converCheckedCol(datas)
|
||||
};
|
||||
},
|
||||
dialogType: "temp"
|
||||
},
|
||||
tempManageDialog: { //模板管理
|
||||
visible: false, completeURL: "", dialogType: "table", dataParams: { page: "salary_details_report" }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getSalaryList(this.props);
|
||||
async componentDidMount() {
|
||||
const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]);
|
||||
this.setState({ showTotalCell: confCode === "1" });
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
window.addEventListener("resize", () => this.forceUpdate(), false);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
|
|
@ -43,20 +66,31 @@ class SalaryDetails extends Component {
|
|||
|
||||
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) : ""
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleReceive = ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
const { pageInfo } = this.state;
|
||||
if (type === "init") {
|
||||
this.getColumns();
|
||||
// this.getColumns();
|
||||
this.getSalaryList(this.props);
|
||||
} else if (type === "turn") {
|
||||
if (id === "PAGEINFO") {
|
||||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize },
|
||||
updateSum: false
|
||||
pageInfo: { ...pageInfo, current, pageSize }, updateSum: false
|
||||
}, () => this.getSalaryList(this.props));
|
||||
} else if (id === "CHECKBOX") {
|
||||
const { selectedRowKeys: checkBox } = params;
|
||||
|
|
@ -73,56 +107,67 @@ 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 { taxAgentIds, subcompanyIds, departmentIds, employeeIds, ...extra } = salaryDetailSearchForm.getFormParams();
|
||||
const { pageInfo, transferDialog, updateSum } = this.state;
|
||||
const payload = {
|
||||
taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [],
|
||||
departmentIds: departmentIds ? departmentIds.split(",") : [],
|
||||
subcompanyIds: subcompanyIds ? subcompanyIds.split(",") : [],
|
||||
employeeIds: employeeIds ? employeeIds.split(",") : [],
|
||||
...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"
|
||||
}, () => tableStore.getDatas(dataKey.datas));
|
||||
columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload
|
||||
}, () => {
|
||||
// tableStore.getDatas(dataKey.datas)
|
||||
this.getColumns();
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getSalaryListSum = (payload) => {
|
||||
API.getSalaryListSum(payload).then(({ status, data }) => {
|
||||
if (status) this.setState({ sumRow: data.sumRow }, () => this.getColumns());
|
||||
});
|
||||
};
|
||||
handleExportSalaryList = (key) => {
|
||||
const { attendanceStore: { tableStore } } = this.props;
|
||||
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;
|
||||
const columns = _.filter(tempCols, o => o.column !== "acctTimes");
|
||||
if (key === "SELECTED" && selectedRowKeys.length === 0) {
|
||||
message.warning(getLabel(543345, "请选择需要导出的数据!"));
|
||||
return;
|
||||
}
|
||||
WeaLoadingGlobal.start();
|
||||
const promise = API.exportSalaryList({
|
||||
...payload, ids: key === "SELECTED" ? selectedRowKeys : [],
|
||||
columns: _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"), o => o.dataIndex)
|
||||
...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
|
||||
} = this.state;
|
||||
// const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
|
||||
// const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
|
||||
const columns = _.filter(tempCols, o => o.column !== "acctTimes");
|
||||
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
|
||||
}))
|
||||
|
|
@ -130,30 +175,161 @@ class SalaryDetails extends Component {
|
|||
}
|
||||
return [];
|
||||
};
|
||||
handleSetDefCols = (params = {}) => this.setState({
|
||||
transferDialog: {
|
||||
...this.state.transferDialog, visible: true, dataParams: { ...this.state.transferDialog.dataParams, ...params },
|
||||
completeURL: "/api/bs/hrmsalary/common/pageList/template/get", dialogType: "temp"
|
||||
}
|
||||
}, () => this.getPageListTemplatelist());
|
||||
|
||||
savePageListSetting = (values) => {
|
||||
const { transferDialog } = this.state;
|
||||
const payload = {
|
||||
...transferDialog.dataParams, 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, dialogType: "temp" }
|
||||
}, () => this.getSalaryList());
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
handelAddTemp = (templateId = "") => {
|
||||
const { tempDialog, tempPageList } = this.state;
|
||||
if (_.isEmpty(this.transferRef.state.rightDatas)) {
|
||||
message.warning(getLabel(111, "请选择设置!"));
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
tempDialog: {
|
||||
...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id),
|
||||
heads: _.map(this.transferRef.state.rightDatas, o => o.name)
|
||||
// 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.setState({
|
||||
transferDialog: {
|
||||
...this.state.transferDialog,
|
||||
dataParams: { ...this.state.transferDialog.dataParams, id: templateId }
|
||||
}
|
||||
}, () => {
|
||||
this.transferRef.getData(true);
|
||||
this.getSalaryList();
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
handleDelTemp = (ids) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(111, "确认删除吗?"),
|
||||
onOk: () => {
|
||||
API.deleteTemplatePageList({ ids }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.setState({ tempManageQuery: !this.state.tempManageQuery }, () => this.getPageListTemplatelist());
|
||||
} 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"
|
||||
/>
|
||||
</Spin>
|
||||
<WeaTableComx
|
||||
style={{ display: "none" }}
|
||||
comsWeaTableStore={tableStore}
|
||||
needScroll={true}
|
||||
columns={this.getColumns()}
|
||||
/>
|
||||
</div>
|
||||
const {
|
||||
loading, dataSource, transferDialog, tempDialog, tempPageList, templateId, tempManageDialog, tempManageQuery
|
||||
} = this.state;
|
||||
const { dateRange, showSearchAd } = this.props;
|
||||
const { dialogType } = transferDialog;
|
||||
return (<React.Fragment>
|
||||
<div className="query-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()}*/}
|
||||
{/*/>*/}
|
||||
{/*默认显示列,薪资模板列表*/}
|
||||
<CustomTransferDialog {...transferDialog} ref={dom => this.transferRef = dom}
|
||||
onCancel={() => this.setState({
|
||||
transferDialog: { ...transferDialog, completeURL: "", visible: false }
|
||||
})}
|
||||
buttons={
|
||||
dialogType === "temp" ? [
|
||||
<Button type="primary"
|
||||
onClick={this.handelAddTemp}>{getLabel(111, "存为模板")}</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({
|
||||
tempManageDialog: {
|
||||
...tempManageDialog, visible: true,
|
||||
completeURL: "/api/bs/hrmsalary/common/pageList/template/pageList"
|
||||
}
|
||||
})}>{getLabel(111, "模板管理")}</Button>
|
||||
] : []
|
||||
}
|
||||
titleOptsComs={
|
||||
dialogType === "temp" ?
|
||||
<WeaSelect style={{ width: 200 }} options={tempPageList}
|
||||
showSearch optionFilterProp="children"
|
||||
value={templateId}
|
||||
onChange={this.changePageListTemplate}/> : null
|
||||
}/>
|
||||
{/*薪资明细模板设置*/}
|
||||
<SalaryDetailsTempDialog {...tempDialog}
|
||||
onCancel={callback => this.setState({
|
||||
tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] }
|
||||
}, () => callback && callback())}
|
||||
onSuccess={this.getPageListTemplatelist}/>
|
||||
{/*薪资明细自定义列模板管理*/}
|
||||
<SalaryTempMangerDialog {...tempManageDialog} onDelete={this.handleDelTemp} isQuery={tempManageQuery}
|
||||
onSuccess={this.getPageListTemplatelist} onCancel={() => this.setState({
|
||||
tempManageDialog: { ...tempManageDialog, completeURL: "", visible: false }
|
||||
})}/>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryDetails;
|
||||
|
||||
export const converCheckedCol = (data) => {
|
||||
return _.reduce(data.checked || [], (pre, cur) => {
|
||||
const item = _.find(data.setting, k => k.column === cur.column);
|
||||
if (!_.isEmpty(item)) return [...pre, { ...item, id: item.id || item.column, name: item.name || item.text }];
|
||||
return pre;
|
||||
}, []);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* 薪酬统计分析-薪资明细
|
||||
* 列表模板设置
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/11/7
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLoadingGlobal, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { tempCondition } from "./conditions";
|
||||
import { getTaxAgentSelectList } from "../../../apis/taxAgent";
|
||||
import * as API from "../../../apis/statistics";
|
||||
import { downloadPageListTemplate } 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"]) : "1",
|
||||
options: [
|
||||
{ key: "1", showname: getLabel(111, "私有") },
|
||||
{ key: "0", showname: getLabel(111, "共享") }
|
||||
]
|
||||
};
|
||||
} else if (getKey(o) === "limitIds") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label), hide: !id || (id && template["sharedType"] === 1),
|
||||
value: id ? template["limitIds"].join(",") : "",
|
||||
options: _.map(data, o => ({ key: o.id, showname: o.content }))
|
||||
};
|
||||
} else if (getKey(o) === "fileId") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "",
|
||||
datas: id && template[getKey(o)] ? [
|
||||
{ fileid: template[getKey(o)], filename: template["fileName"], showDelete: true }
|
||||
] : [], labelExtra: getLabel(111, "下载示例"), labelType: "download"
|
||||
};
|
||||
}
|
||||
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, fileId, ...formVal } = tempForm.getFormParams();
|
||||
const payload = {
|
||||
page: "salary_details_report", setting, id, ...formVal,
|
||||
limitIds: !_.isEmpty(limitIds) ? limitIds.split(",") : []
|
||||
};
|
||||
API.savePageListTemplate(_.assign(payload, fileId ? { fileId } : {})).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
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) => {
|
||||
if (field === "download") {
|
||||
const { setting, heads } = this.props;
|
||||
WeaLoadingGlobal.start();
|
||||
const promise = downloadPageListTemplate({ setting, heads });
|
||||
return;
|
||||
}
|
||||
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 !== "0", viewAttr: value === "0" ? 3 : 1,
|
||||
rules: value === "0" ? "required|string" : ""
|
||||
};
|
||||
} else if (key === "fileId" && getKey(o) === "fileId") {
|
||||
return {
|
||||
...o, value, datas: value ? _.map(field[key].valueSpan, o => ({
|
||||
fileid: o.fileid, filename: o.filename, showDelete: true
|
||||
})) : []
|
||||
};
|
||||
}
|
||||
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 tempDialog">{getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryDetailTempDialog;
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 薪酬报表-薪酬明细
|
||||
* 模板管理新增编辑弹框
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/12/4
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTransfer } from "ecCom";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import { Button } from "antd";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class SalaryTempAdminDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, selectedKeys: [], dataSource: []
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { dataParams = {} } = nextProps;
|
||||
this.setState({ loading: true });
|
||||
postFetch("/api/bs/hrmsalary/common/pageList/template/get", { ...dataParams })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
dataSource: _.map(data.setting, o => ({ id: o.column, name: o.text })),
|
||||
selectedKeys: _.map(data.checked, o => o.column)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { dataSource, selectedKeys } = this.state, { dataParams } = this.props;
|
||||
const heads = _.reduce(selectedKeys, (pre, cur) => {
|
||||
const item = dataSource.find(data => data.id === cur);
|
||||
if (item) pre.push(item.name);
|
||||
return pre;
|
||||
}, []);
|
||||
return (<WeaDialog
|
||||
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={getLabel(111, "模板管理")}
|
||||
className="temp_admin_dialog" style={{
|
||||
width: 784, height: 460, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}} buttons={[
|
||||
<Button type="primary"
|
||||
onClick={() => this.props.onAddTemp(dataParams.id, selectedKeys, heads)}>{getLabel(111, "确 定")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>
|
||||
]}>
|
||||
<WeaTransfer data={dataSource} selectedKeys={selectedKeys} onChange={v => this.setState({ selectedKeys: v })}
|
||||
height={this.dialog ? this.dialog.state.height - 10 : 260}/>
|
||||
</WeaDialog>);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryTempAdminDialog;
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* 薪酬报表-薪酬明细
|
||||
* 模板管理弹框
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/12/4
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaButtonIcon, WeaLocaleProvider } from "ecCom";
|
||||
import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog";
|
||||
import SalaryTempAdminDialog from "./salaryTempAdminDialog";
|
||||
import SalaryDetailsTempDialog from "./salaryDetailsTempDialog";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class SalaryTempMangerDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedRowKeys: [], tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } },
|
||||
tempDialog: { visible: false, setting: [], heads: [], id: "", template: {} }
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.isQuery !== this.props.isQuery) this.setState({ selectedRowKeys: [] }, () => this.tempManageRef.getData());
|
||||
}
|
||||
|
||||
handleTempAdminCols = (params = {}) => this.setState({
|
||||
tempAdminDialog: { visible: true, dataParams: { ...this.state.tempAdminDialog.dataParams, ...params } }
|
||||
});
|
||||
handelAddTemp = (id = "", setting = [], heads = []) => {
|
||||
this.setState({
|
||||
tempDialog: {
|
||||
visible: true, setting, heads, id, template: _.find(this.tempManageRef.state.listDatas, o => o.id === id)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { selectedRowKeys, tempAdminDialog, tempDialog } = this.state;
|
||||
return (<CustomTransferDialog ref={dom => this.tempManageRef = dom} {...this.props} buttons={[]}
|
||||
title={getLabel(111, "模板管理")}
|
||||
onSelect={v => this.setState({ selectedRowKeys: v })}
|
||||
tableOpts={{
|
||||
title: getLabel(111, "操作"),
|
||||
dataIndex: "options",
|
||||
width: 120,
|
||||
render: (text, record) => (<React.Fragment>
|
||||
{
|
||||
record.canEdit &&
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.handleTempAdminCols({ id: record.id })}
|
||||
style={{ marginRight: 10 }}>{getLabel(111, "编辑")}</a>
|
||||
}
|
||||
{
|
||||
record.canEdit &&
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.props.onDelete([record.id])}>{getLabel(111, "删除")}</a>
|
||||
}
|
||||
|
||||
</React.Fragment>)
|
||||
}}>
|
||||
<div className="table_opts">
|
||||
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}
|
||||
onClick={() => this.handleTempAdminCols()}/>
|
||||
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "删除")}
|
||||
onClick={() => this.props.onDelete(selectedRowKeys)} disabled={_.isEmpty(selectedRowKeys)}/>
|
||||
</div>
|
||||
{/*模板管理*/}
|
||||
<SalaryTempAdminDialog {...tempAdminDialog} onAddTemp={this.handelAddTemp} onCancel={() => this.setState({
|
||||
tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } }
|
||||
})}/>
|
||||
{/*薪资明细模板设置*/}
|
||||
<SalaryDetailsTempDialog {...tempDialog}
|
||||
onCancel={callback => this.setState({
|
||||
tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] }
|
||||
}, () => callback && callback())}
|
||||
onSuccess={() => this.setState({
|
||||
tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } }
|
||||
}, () => {
|
||||
this.props.onSuccess();
|
||||
this.tempManageRef.getData();
|
||||
})}/>
|
||||
</CustomTransferDialog>);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryTempMangerDialog;
|
||||
|
|
@ -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;
|
||||
|
|
@ -275,7 +271,7 @@ class Index extends Component {
|
|||
|
||||
render() {
|
||||
const {
|
||||
taxAgentStore: { statisticsReportBtn },
|
||||
taxAgentStore: { statisticsReportBtn, PageAndOptAuth },
|
||||
attendanceStore: { statisticsForm, reportForm, tableStore }
|
||||
} = this.props;
|
||||
const {
|
||||
|
|
@ -307,13 +303,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, "操作日志")
|
||||
|
|
@ -323,8 +315,9 @@ class Index extends Component {
|
|||
icon: <i className="icon-coms-Custom"/>,
|
||||
content: getLabel(111, "显示列定制"),
|
||||
onClick: () => {
|
||||
tableStore.setColSetVisible(true);
|
||||
tableStore.tableColSet(true);
|
||||
this.salaryRef.wrappedInstance.handleSetDefCols();
|
||||
// tableStore.setColSetVisible(true);
|
||||
// tableStore.tableColSet(true);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
|
@ -333,18 +326,14 @@ class Index extends Component {
|
|||
{ key: "detail", title: getLabel(111, "员工明细") },
|
||||
{ key: "salaryDetail", title: getLabel(111, "薪资明细") }
|
||||
];
|
||||
dropMenuDatas = selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1);
|
||||
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 !== "detail"} onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}>
|
||||
{
|
||||
selectedKey === "statistics" ?
|
||||
<ReportList
|
||||
|
|
@ -356,7 +345,11 @@ 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}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +182,7 @@
|
|||
}
|
||||
|
||||
.wea-advanced-searchsAd {
|
||||
height: 155px;
|
||||
height: 200px;
|
||||
overflow: hidden auto;
|
||||
|
||||
.formItem-delete {
|
||||
|
|
@ -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%;
|
||||
|
|
@ -345,3 +382,17 @@
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
.tempDialog {
|
||||
.wea-form-item-label {
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
.wea-form-item-label-extra {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
cursor: pointer;
|
||||
color: #4d7ad8;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ class AppConfig extends Component {
|
|||
} = 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>
|
||||
// <Button type="ghost" onClick={() => this.handleOperate("import")}>{getLabel(111, "迁入")}</Button>,
|
||||
// <Button type="ghost" onClick={() => this.handleOperate("export")}>{getLabel(111, "迁出")}</Button>
|
||||
];
|
||||
const items = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import {
|
|||
addedemployeeList,
|
||||
deleteAcctemployee,
|
||||
reducedemployeeList,
|
||||
refreshAcctemployee,
|
||||
saveAcctemployee
|
||||
} from "../../../../../apis/calculate";
|
||||
import { personConfirmSearchConditions } from "./condition";
|
||||
|
|
@ -78,6 +79,7 @@ class Index extends Component {
|
|||
|
||||
renderTabBtns = () => {
|
||||
const { selectedKey, selectedRowKeys } = this.state;
|
||||
const { calcDetail } = this.props;
|
||||
let tabBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "range":
|
||||
|
|
@ -90,8 +92,11 @@ 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);
|
||||
break;
|
||||
case "add":
|
||||
case "sub":
|
||||
|
|
@ -180,9 +185,26 @@ 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 } } = this.props;
|
||||
const { calculateStore: { PCSearchForm }, calcDetail } = this.props;
|
||||
const {
|
||||
selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys,
|
||||
columns, dataSource
|
||||
|
|
@ -260,8 +282,8 @@ class Index extends Component {
|
|||
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
|
||||
/>
|
||||
<WeaTable
|
||||
dataSource={dataSource} loading={loading} rowSelection={rowSelection} pagination={pagination}
|
||||
scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
|
||||
dataSource={dataSource} loading={loading} rowSelection={calcDetail ? null : rowSelection}
|
||||
pagination={pagination} scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
|
||||
columns={[..._.map(columns, item => {
|
||||
let width = "";
|
||||
const { dataIndex } = item;
|
||||
|
|
@ -280,9 +302,10 @@ class Index extends Component {
|
|||
dataIndex: "operate",
|
||||
title: getLabel(30585, "操作"),
|
||||
width: 120,
|
||||
render: (_, record) => (
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>
|
||||
render: (_, record) => (<React.Fragment>
|
||||
{calcDetail ? null : <a href="javascript:void(0);"
|
||||
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>}
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
]}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ class EditSalaryBaseInfo extends Component {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return <WeaBrowser {...browserType} viewAttr={3} value={value} valueSpan={valueSpan} inputStyle={{ width: 200 }}
|
||||
return <WeaBrowser {...browserType} viewAttr={this.props.viewAttr === 1 ? 1 : 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 } };
|
||||
|
|
|
|||
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* 核算编辑
|
||||
* 数据查看锚点
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2025/2/10
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import classnames from "classnames";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class CalcAnchorList extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
collapsed: false, currentIndex: 0
|
||||
};
|
||||
this.isClickRef = null;
|
||||
this.timerRef = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
document.getElementById("salary_anchor_area").addEventListener("scroll", this.handlerScroll);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
|
||||
collapsed: false,
|
||||
currentIndex: 0
|
||||
});
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.getElementById("salary_anchor_area").removeEventListener("scroll", this.handlerScroll);
|
||||
}
|
||||
|
||||
handlerScroll = () => {
|
||||
// 点击锚点时,不执行滚动函数
|
||||
if (this.isClickRef) return;
|
||||
// 获取滚动容器的滚动高度(这里相对于#salary_anchor_area滚动的)
|
||||
const scrollTop = document.getElementById("salary_anchor_area").scrollTop;
|
||||
// 获取所有wea-search-group anchor_开头的元素集合
|
||||
const contentList = document.querySelectorAll("[class^='wea-search-group anchor_']");
|
||||
const offsetTopArr = [];
|
||||
contentList.forEach((item) => {
|
||||
// 获取每个wea-search-group anchor_开头的元素的offsetTop
|
||||
offsetTopArr.push(item.offsetTop);
|
||||
});
|
||||
for (let i = 0; i < offsetTopArr.length; i++) {
|
||||
// 当滚动条高度达到对应wea-search-group anchor_开头的元素的滚动高度、则将锚点设置为高亮状态
|
||||
if (scrollTop + 190 >= offsetTopArr[i]) this.setState({ currentIndex: i });
|
||||
}
|
||||
};
|
||||
onClickAnchor = (item, index) => {
|
||||
const anchorElement = document.getElementById("salary_anchor_area");
|
||||
const el = document.querySelector(`.anchor_${item.salarySobItemGroupId}`);
|
||||
if (el) {
|
||||
anchorElement.scroll({ top: el.offsetTop, behavior: "smooth" });
|
||||
}
|
||||
this.setState({ currentIndex: index });
|
||||
// 点击时设置为true,为了防止同时执行滚动事件
|
||||
this.isClickRef = true;
|
||||
// 清除定时器,防止滚动事件触发、出现走马灯闪烁问题
|
||||
if (this.timerRef) clearTimeout(this.timerRef);
|
||||
this.timerRef = setTimeout(() => {
|
||||
this.isClickRef = false;
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { collapsed, currentIndex } = this.state, { datas } = this.props;
|
||||
return (
|
||||
<div id="anchorList-contianer" style={{ position: "sticky", top: 8, zIndex: 10086 }}>
|
||||
<div className={classnames("anchor-list-wrapper", { "anchor-list-collapsed": collapsed })}>
|
||||
{
|
||||
collapsed ?
|
||||
<div className="anchor-list-collapsed-btn">
|
||||
<i className="icon-coms02-Initialize-template"
|
||||
onClick={() => this.setState({ collapsed: !collapsed })}/>
|
||||
</div> :
|
||||
<React.Fragment>
|
||||
<div className="anchor-list-header">
|
||||
<i className="icon-coms-right" onClick={() => this.setState({ collapsed: !collapsed })}/>
|
||||
</div>
|
||||
<div className="anchor-list">
|
||||
<div className="anchor-list-ink">
|
||||
<span className="anchor-list-ink-ball visible"
|
||||
style={{ top: `${2.5 + currentIndex * 27.7}px`, height: 23 }}/>
|
||||
</div>
|
||||
{_.map(datas, (o, i) => (
|
||||
<div className={classnames("anchor-list-link", { "anchor-list-link-active": currentIndex === i })}
|
||||
onClick={() => this.onClickAnchor(o, i)}>
|
||||
<span
|
||||
className={classnames("anchor-list-link-title", { "anchor-list-link-title-active": currentIndex === i })}>{o.salarySobItemGroupName}</span>
|
||||
</div>)
|
||||
)}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CalcAnchorList;
|
||||
|
|
@ -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";
|
||||
|
|
@ -25,7 +30,7 @@ class EditCalcTable extends Component {
|
|||
this.state = {
|
||||
loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
selectedRowKeys: [], progressVisible: false, progress: 0,
|
||||
salaryCalcSlide: { visible: false, id: "" }, originPayloadData: {},
|
||||
salaryCalcSlide: { visible: false, id: "", viewAttr: 2 }, originPayloadData: {},
|
||||
batchUpdateDialog: {
|
||||
visible: false, salaryAcctRecordId: "", idList: [], salaryItemId: "",
|
||||
conditions: [], pattern: 0, dataType: ""
|
||||
|
|
@ -68,9 +73,9 @@ class EditCalcTable extends Component {
|
|||
this.updateEmpLockStatus({ ...params });
|
||||
break;
|
||||
case "EDIT":
|
||||
const { id: salaryCalcId } = params;
|
||||
const { id: salaryCalcId, showSee } = params;
|
||||
this.setState({
|
||||
salaryCalcSlide: { visible: true, id: salaryCalcId }
|
||||
salaryCalcSlide: { visible: true, id: salaryCalcId, viewAttr: showSee ? 1 : 2 }
|
||||
});
|
||||
break;
|
||||
case "DIAGRAM":
|
||||
|
|
@ -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,13 +232,13 @@ 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, "批量更新"),
|
||||
"查看拓扑图": getLabel(111, "查看拓扑图"), "锁定": getLabel(111, "锁定"),
|
||||
"解锁": getLabel(111, "解锁")
|
||||
"解锁": getLabel(111, "解锁"), "查看": getLabel(111, "查看")
|
||||
};
|
||||
this.setState({ originPayloadData: { ...payload, i18n } });
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
|
|
@ -261,7 +269,7 @@ class EditCalcTable extends Component {
|
|||
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload,
|
||||
calcDetail,
|
||||
calcDetail, showSee: calcDetail,
|
||||
columns: _.every(traverse(columns, calcDetail), (it, idx) => !it.fixed) ? _.map(traverse(columns, calcDetail), (it, idx) => ({
|
||||
...it,
|
||||
fixed: idx < 2 ? "left" : false
|
||||
|
|
@ -296,10 +304,7 @@ class EditCalcTable extends Component {
|
|||
/>
|
||||
<EditSalaryCalcSlide {...salaryCalcSlide}
|
||||
onClose={(isFresh) => this.setState({
|
||||
salaryCalcSlide: {
|
||||
visible: false,
|
||||
id: ""
|
||||
}
|
||||
salaryCalcSlide: { visible: false, id: "", viewAttr: 2 }
|
||||
}, () => isFresh === "true" && this.queryCalcResultList())}/>
|
||||
{
|
||||
progressVisible &&
|
||||
|
|
@ -324,7 +329,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"
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ import PayrollItemsTable from "../../../../calculateDetail/payrollItemsTable";
|
|||
import IssuedAndReissueTable from "../../../../calculateDetail/issuedAndReissueTable";
|
||||
import { acctresultDetail, saveAcctResult } from "../../../../../apis/calculate";
|
||||
import { toDecimal_n } from "../../../../../util";
|
||||
import CalcAnchorList from "./calcAnchorList";
|
||||
import "./index.less";
|
||||
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class EditSalaryCalcSlide extends Component {
|
||||
|
|
@ -29,7 +29,7 @@ class EditSalaryCalcSlide extends Component {
|
|||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.acctresultDetail(nextProps.id);
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedKey: "0" });
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedKey: "0" }, () => document.getElementById("salary_anchor_area").scrollTop = 0);
|
||||
}
|
||||
|
||||
acctresultDetail = (id) => {
|
||||
|
|
@ -43,14 +43,17 @@ class EditSalaryCalcSlide extends Component {
|
|||
});
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { loading } = this.state;
|
||||
const { loading } = this.state, { viewAttr } = this.props;
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{getLabel(543559, "编辑薪资")}</div>
|
||||
<div className="title">{viewAttr === 2 ? getLabel(543559, "编辑薪资") : getLabel(111, "查看薪资")}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
{
|
||||
viewAttr === 2 &&
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
}
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
|
|
@ -88,7 +91,7 @@ class EditSalaryCalcSlide extends Component {
|
|||
save = () => {
|
||||
const { id: salaryAcctEmpId } = this.props;
|
||||
const { issuedAndReissueItems, itemsByGroup, baseInfo } = this.state;
|
||||
if (_.every(baseInfo, it => !it.canEdit || (it.canEdit && !it.fieldValue))) {
|
||||
if (!_.every(baseInfo, (item) => (!item.canEdit || !!item.fieldValue))) {
|
||||
Modal.warning({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(518702, "必要信息不完整,红色*为必填项!")
|
||||
|
|
@ -96,7 +99,8 @@ class EditSalaryCalcSlide extends Component {
|
|||
return;
|
||||
}
|
||||
const payload = {
|
||||
salaryAcctEmpId, employeeInfos: baseInfo,
|
||||
salaryAcctEmpId,
|
||||
employeeInfos: _.map(baseInfo, o => ({ ...o, fieldValue: o.fieldValue.id || o.fieldValue })),
|
||||
items: [
|
||||
..._.reduce(itemsByGroup, (pre, cur) => {
|
||||
return [
|
||||
|
|
@ -139,7 +143,9 @@ class EditSalaryCalcSlide extends Component {
|
|||
className="salary-calculate-esf-layout" {...this.props}
|
||||
top={0} width={60} height={100} measure={"%"}
|
||||
direction={"right"} title={this.renderTitle()}
|
||||
content={<div className="salary-calculate-esf-area">
|
||||
content={<div className="salary-calculate-esf-area" id="salary_anchor_area">
|
||||
{/*锚点*/}
|
||||
<CalcAnchorList datas={itemsByGroup} visible={this.props.visible}/>
|
||||
<EditSalaryBaseInfo {...this.props} baseInfo={baseInfo}
|
||||
onChange={baseInfo => this.setState({ baseInfo })}/>
|
||||
<WeaTab keyParam="viewcondition" className="calc-esf-tab"
|
||||
|
|
@ -148,12 +154,14 @@ class EditSalaryCalcSlide extends Component {
|
|||
/>
|
||||
{
|
||||
selectedKey === "0" && _.map(itemsByGroup, item => {
|
||||
return <PayrollItemsTable {...item} onChangeIssueReissueValue={this.handleItemValueChange}/>;
|
||||
return <PayrollItemsTable {...this.props} {...item}
|
||||
onChangeIssueReissueValue={this.handleItemValueChange}/>;
|
||||
})
|
||||
}
|
||||
{
|
||||
selectedKey === "1" &&
|
||||
<IssuedAndReissueTable
|
||||
{...this.props}
|
||||
dataSource={issuedAndReissueItems}
|
||||
onChangeIssueReissueValue={this.handleItemValueChange}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@
|
|||
height: 100%;
|
||||
|
||||
.salary-calculate-esf-area {
|
||||
position: relative;
|
||||
background: #f6f6f6;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
|
|
@ -149,6 +150,10 @@
|
|||
|
||||
.esf-base-info-form, .wea-title, .wea-content {
|
||||
padding: 0;
|
||||
|
||||
.ant-row {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.esf-form-content {
|
||||
|
|
@ -191,6 +196,109 @@
|
|||
.wea-search-group {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
//锚点按钮
|
||||
.anchor-list-collapsed {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.anchor-list-wrapper {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
margin: 10px 15px 20px;
|
||||
padding: 8px 10px;
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 3px 12px 0 rgba(0, 0, 0, .12);
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
|
||||
.anchor-list-collapsed-btn {
|
||||
opacity: .5;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.anchor-list-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
min-width: 130px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.anchor-list {
|
||||
padding: 0 10px;
|
||||
position: relative;
|
||||
margin-top: 10px;
|
||||
transition: margin-top .3s;
|
||||
|
||||
.anchor-list-ink {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 5px;
|
||||
height: 100%;
|
||||
|
||||
.anchor-list-ink-ball.visible {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.anchor-list-ink-ball {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
display: none;
|
||||
width: 3px;
|
||||
height: 8px;
|
||||
background-color: #5d9cec;
|
||||
border: 1.5px solid #5d9cec;
|
||||
border-radius: 8px;
|
||||
transform: translateX(-50%);
|
||||
transition: top .3s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
.anchor-list-ink:before {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
background-color: #f0f0f0;
|
||||
content: " ";
|
||||
}
|
||||
|
||||
.anchor-list-link {
|
||||
padding: 7px 0 7px 10px;
|
||||
line-height: 1.143;
|
||||
|
||||
.anchor-list-link-title {
|
||||
position: relative;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
color: #666;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
transition: all .3s;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.anchor-list-link-active > .anchor-list-link-title {
|
||||
color: #5d9cec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,12 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom";
|
|||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import Layout from "./layout";
|
||||
import { acctresultAccounting, getCalculateProgress, getExportField } from "../../../apis/calculate";
|
||||
import {
|
||||
acctresultAccounting,
|
||||
getApprovalInfoByRecordId,
|
||||
getCalculateProgress,
|
||||
getExportField
|
||||
} from "../../../apis/calculate";
|
||||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm";
|
||||
import SalaryEditCalc from "./components/salaryEditCalc";
|
||||
|
|
@ -30,6 +35,7 @@ class Index extends Component {
|
|||
selectedKey: "person", progressVisible: false, progress: 0,
|
||||
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
|
||||
salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" },
|
||||
approvalInfo: {},//审批信息,
|
||||
accountExceptInfo: "" //核算报错信息,
|
||||
|
||||
};
|
||||
|
|
@ -37,6 +43,12 @@ class Index extends Component {
|
|||
this.timer = null;
|
||||
}
|
||||
|
||||
init = () => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => {
|
||||
if (status) this.setState({ approvalInfo });
|
||||
});
|
||||
};
|
||||
handleMenuClick = ({ key }) => {
|
||||
switch (key) {
|
||||
case "calc_selected":
|
||||
|
|
@ -125,12 +137,23 @@ 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;
|
||||
}
|
||||
};
|
||||
renderReqBtns = () => {
|
||||
const { selectedKey, accountExceptInfo } = this.state;
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { selectedKey, accountExceptInfo, approvalInfo } = this.state;
|
||||
const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo;
|
||||
let reqBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "calc":
|
||||
|
|
@ -141,10 +164,12 @@ class Index extends Component {
|
|||
);
|
||||
const moreMenu = (
|
||||
<Menu onClick={this.handleMoreMenuClick}>
|
||||
<Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>
|
||||
{canEdit && <Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>}
|
||||
<Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item>
|
||||
<Menu.Item key="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 = [
|
||||
|
|
@ -155,6 +180,10 @@ class Index extends Component {
|
|||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calc.openAdvanceSearch()}
|
||||
onAdvanceSearch={() => this.calc.onAdSearch(false)}/>
|
||||
];
|
||||
!canEdit && reqBtns.splice(0, 1);
|
||||
isOpenApproval && reqBtns.unshift(<Button type="ghost" onClick={() => {
|
||||
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
|
||||
}}>{getLabel(111, "发起审批")}</Button>);
|
||||
accountExceptInfo && reqBtns.unshift(<i className="iconfont icon-jinggao"
|
||||
title={getLabel(111, "存在异常信息,点击下载!")}
|
||||
onClick={() => this.downloadTxtfile(accountExceptInfo)}/>);
|
||||
|
|
@ -173,14 +202,15 @@ class Index extends Component {
|
|||
element.click();
|
||||
};
|
||||
renderContent = () => {
|
||||
const { selectedKey } = this.state;
|
||||
const { selectedKey, approvalInfo } = this.state;
|
||||
const { canEdit } = approvalInfo;
|
||||
let dom = null;
|
||||
switch (selectedKey) {
|
||||
case "person":
|
||||
dom = <SalaryCalcPersonConfirm {...this.props}/>;
|
||||
dom = <SalaryCalcPersonConfirm calcDetail={!canEdit} {...this.props}/>;
|
||||
break;
|
||||
case "calc":
|
||||
dom = <SalaryEditCalc {...this.props} ref={dom => this.calc = dom}/>;
|
||||
dom = <SalaryEditCalc {...this.props} calcDetail={!canEdit} ref={dom => this.calc = dom}/>;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -196,7 +226,7 @@ class Index extends Component {
|
|||
const { calculateStore: { setOtherConditions } } = this.props;
|
||||
const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state;
|
||||
return (
|
||||
<Layout {...this.props}>
|
||||
<Layout {...this.props} init={this.init}>
|
||||
<div className="salary-calculate-do-calc">
|
||||
<WeaReqTop
|
||||
title={getLabel(538011, "薪资核算")} tabDatas={tabs} selectedKey={selectedKey}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@ class IssuedAndReissueTable extends Component {
|
|||
/>
|
||||
</span>,
|
||||
render: (text, record) => {
|
||||
const { canEdit, pattern } = record;
|
||||
const { canEdit, pattern } = record, { viewAttr } = this.props;
|
||||
return <WeaInputNumber
|
||||
disabled={!canEdit}
|
||||
min={0}
|
||||
viewAttr={viewAttr}
|
||||
precision={pattern || 2}
|
||||
value={text || 0}
|
||||
onChange={(value) => onChangeIssueReissueValue(record.salaryItemName, value, "issuedAndReissueItems")}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,9 @@ class PayrollItemsTable extends Component {
|
|||
</span>,
|
||||
width: "20%",
|
||||
render: (text, record) => {
|
||||
const { canEdit, dataType, pattern } = record;
|
||||
const { canEdit, dataType, pattern } = record, { viewAttr } = this.props;
|
||||
return dataType === "number" ? <WeaInputNumber
|
||||
viewAttr={viewAttr}
|
||||
disabled={!canEdit}
|
||||
precision={!_.isNil(pattern) ? pattern : 0}
|
||||
value={text || 0}
|
||||
|
|
@ -46,6 +47,7 @@ class PayrollItemsTable extends Component {
|
|||
/> : <WeaInput
|
||||
disabled={!canEdit}
|
||||
value={text}
|
||||
viewAttr={viewAttr}
|
||||
onChange={(value) => onChangeIssueReissueValue(record.salaryItemId, value, "itemsByGroup", salarySobItemGroupId)}
|
||||
/>;
|
||||
}
|
||||
|
|
@ -66,7 +68,7 @@ class PayrollItemsTable extends Component {
|
|||
}
|
||||
];
|
||||
return (
|
||||
<WeaSearchGroup title={salarySobItemGroupName} showGroup needTigger>
|
||||
<WeaSearchGroup title={salarySobItemGroupName} showGroup needTigger className={`anchor_${salarySobItemGroupId}`}>
|
||||
<WeaTable
|
||||
rowKey="salaryItemId"
|
||||
dataSource={dataSource}
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ class AddItems extends Component {
|
|||
render() {
|
||||
const { form, condition = [] } = this.props;
|
||||
return (
|
||||
<div className="addItemsWrapper">
|
||||
{getSearchs(form, condition)}
|
||||
<div className="addItemsWrapper form-dialog-layout">
|
||||
{getSearchs(form, condition, 2, false)}
|
||||
<Tips><span>若此员工数据已存在在同期列表中,则当前数据保存后会覆盖列表数据</span></Tips>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ class AttendanceDataViewSlide extends Component {
|
|||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data.pageInfo;
|
||||
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, i) => ({ ...o, width: 150, fixed: i === 0 ? "left" : null }))
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
|
||||
|
|
@ -103,7 +102,7 @@ class AttendanceDataViewSlide extends Component {
|
|||
</div>
|
||||
<WeaTable
|
||||
columns={columns} dataSource={dataSource} bordered pagination={pagination}
|
||||
loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 225px)` }}/>
|
||||
loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 240px)` }}/>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,15 @@
|
|||
flex-direction: column;
|
||||
|
||||
.wea-form-item {
|
||||
padding: 8px 16px 0 16px;
|
||||
height: 46px;
|
||||
line-height: 46px;
|
||||
background: #FFF;
|
||||
margin: 8px 16px 0 16px;
|
||||
|
||||
.wea-form-item-label {
|
||||
line-height: 46px !important;
|
||||
padding-left: 8px !important;
|
||||
}
|
||||
|
||||
.to {
|
||||
padding: 0 10px
|
||||
|
|
@ -15,7 +23,7 @@
|
|||
flex: 1;
|
||||
overflow: hidden;
|
||||
background: #FFF;
|
||||
margin: 16px;
|
||||
margin: 8px 16px;
|
||||
}
|
||||
|
||||
.linkWapper {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,41 @@
|
|||
.tableRecordWrapper {
|
||||
padding: 0 16px;
|
||||
|
||||
.form-dialog-layout {
|
||||
padding: 0 !important;
|
||||
|
||||
.wea-search-group {
|
||||
padding: 16px 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-form-cell-wrapper {
|
||||
& > div:first-child {
|
||||
height: 47px !important;
|
||||
line-height: 47px;
|
||||
}
|
||||
|
||||
& > div:last-child {
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
|
||||
.to {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.accumulated {
|
||||
.wea-form-cell-wrapper {
|
||||
& > div:first-child {
|
||||
height: 46px !important;
|
||||
line-height: 46px;
|
||||
height: 47px !important;
|
||||
line-height: 47px;
|
||||
}
|
||||
|
||||
& > div:nth-child(2) {
|
||||
//width: 40% !important;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
display: flex !important;
|
||||
|
|
@ -18,10 +46,6 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > div:last-child {
|
||||
//width: 40% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@
|
|||
* Date: 2023/2/20
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaSearchGroup } from "ecCom";
|
||||
import UnifiedTable from "../../../components/UnifiedTable";
|
||||
import { WeaLocaleProvider, WeaSearchGroup, WeaTable } from "ecCom";
|
||||
import { getTableRecordDate } from "../../../apis/cumDeduct";
|
||||
import { DataCollectionDateRangePick, DataCollectionSelect, Input } from "../cumDeduct";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class TableRecord extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -87,9 +88,22 @@ class TableRecord extends Component {
|
|||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource,
|
||||
columns
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
|
||||
columns: _.map(columns, (o, i) => {
|
||||
let col = {
|
||||
...o, width: 110,
|
||||
render: text => (<span className="dataAc-ellipsis" title={text}>{text}</span>)
|
||||
};
|
||||
switch (o.dataIndex) {
|
||||
case "taxAgentName":
|
||||
col = { ...col, width: 180 };
|
||||
break;
|
||||
default:
|
||||
col = { ...col };
|
||||
break;
|
||||
}
|
||||
return i === 0 ? { ...col, fixed: "left" } : col;
|
||||
})
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
|
||||
|
|
@ -155,19 +169,11 @@ class TableRecord extends Component {
|
|||
};
|
||||
const items = screenParams.length === 1 ? [
|
||||
{
|
||||
com: Input({ value: record.username })
|
||||
com: Input({ label: getLabel(111, "姓名"), value: record.username })
|
||||
}
|
||||
] : [
|
||||
{
|
||||
com: Input({ value: record.username })
|
||||
},
|
||||
{
|
||||
com: DataCollectionDateRangePick({
|
||||
label: "税款所属期",
|
||||
range: recordPayload[screenParams[screenParams.length - 1]] || [],
|
||||
onChange: this.handleTablerecordScreen,
|
||||
key: screenParams[screenParams.length - 1]
|
||||
})
|
||||
com: Input({ label: getLabel(111, "姓名"), value: record.username })
|
||||
},
|
||||
{
|
||||
com: DataCollectionSelect({
|
||||
|
|
@ -177,28 +183,26 @@ class TableRecord extends Component {
|
|||
onChange: this.handleTablerecordScreen,
|
||||
key: "taxAgentId"
|
||||
})
|
||||
},
|
||||
{
|
||||
com: DataCollectionDateRangePick({
|
||||
label: "税款所属期",
|
||||
range: recordPayload[screenParams[screenParams.length - 1]] || [],
|
||||
onChange: this.handleTablerecordScreen,
|
||||
key: screenParams[screenParams.length - 1]
|
||||
})
|
||||
}
|
||||
];
|
||||
return (
|
||||
<div className="tableRecordWrapper">
|
||||
{
|
||||
!_.isEmpty(screenParams) &&
|
||||
<WeaSearchGroup className={className} showGroup needTigger={false} items={items} col={width > 1280 ? 3 : 2}/>
|
||||
<div className="form-dialog-layout">
|
||||
<WeaSearchGroup className={className} showGroup needTigger={false} items={items} col={2}/>
|
||||
</div>
|
||||
}
|
||||
<UnifiedTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={_.map(columns, item => ({
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}> {text} </span>;
|
||||
}
|
||||
}))}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
xWidth={columns.length * 180}
|
||||
/>
|
||||
<WeaTable rowKey="id" rowSelection={rowSelection} bordered dataSource={dataSource} pagination={pagination}
|
||||
loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 310px)` }} columns={columns}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,400 +1,3 @@
|
|||
export const columns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
export const modalColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "taxAgentName",
|
||||
key: "taxAgentName"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
key: "departmentName"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobNum",
|
||||
key: "jobNum"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "idNo",
|
||||
key: "idNo"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "hiredate",
|
||||
key: "hiredate"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "addUpChildEducation",
|
||||
key: "addUpChildEducation"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "addUpContinuingEducation",
|
||||
key: "addUpContinuingEducation"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "addUpHousingLoanInterest",
|
||||
key: "addUpHousingLoanInterest"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "addUpHousingRent",
|
||||
key: "addUpHousingRent"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "addUpSupportElderly",
|
||||
key: "addUpSupportElderly"
|
||||
},
|
||||
{
|
||||
title: "累计婴幼儿照护",
|
||||
dataIndex: "addUpInfantCare",
|
||||
key: "addUpInfantCare"
|
||||
},
|
||||
{
|
||||
title: "累计大病医疗",
|
||||
dataIndex: "addUpIllnessMedical",
|
||||
key: "addUpIllnessMedical"
|
||||
}
|
||||
];
|
||||
export const specialModalColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "taxAgentName",
|
||||
key: "taxAgentName"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
key: "departmentName"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobNum",
|
||||
key: "jobNum"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "idNo",
|
||||
key: "idNo"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "hiredate",
|
||||
key: "hiredate"
|
||||
},
|
||||
{
|
||||
title: "子女教育",
|
||||
dataIndex: "childrenEducation",
|
||||
key: "childrenEducation"
|
||||
},
|
||||
{
|
||||
title: "继续教育",
|
||||
dataIndex: "continuingEducation",
|
||||
key: "continuingEducation"
|
||||
},
|
||||
{
|
||||
title: "住房贷款利息",
|
||||
dataIndex: "housingLoanInterest",
|
||||
key: "housingLoanInterest"
|
||||
},
|
||||
{
|
||||
title: "住房租金",
|
||||
dataIndex: "housingRent",
|
||||
key: "housingRent"
|
||||
},
|
||||
{
|
||||
title: "赡养老人",
|
||||
dataIndex: "supportingElder",
|
||||
key: "supportingElder"
|
||||
},
|
||||
{
|
||||
title: "婴幼儿照护",
|
||||
dataIndex: "infantCare",
|
||||
key: "infantCare"
|
||||
},
|
||||
{
|
||||
title: "大病医疗",
|
||||
dataIndex: "seriousIllnessTreatment",
|
||||
key: "seriousIllnessTreatment"
|
||||
}
|
||||
];
|
||||
export const otherModalColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "taxAgentName",
|
||||
key: "taxAgentName"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
key: "departmentName"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobNum",
|
||||
key: "jobNum"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "idNo",
|
||||
key: "idNo"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "hiredate",
|
||||
key: "hiredate"
|
||||
},
|
||||
{
|
||||
title: "商业健康保险",
|
||||
dataIndex: "businessHealthyInsurance",
|
||||
key: "businessHealthyInsurance"
|
||||
},
|
||||
{
|
||||
title: "税延养老保险",
|
||||
dataIndex: "taxDelayEndowmentInsurance",
|
||||
key: "taxDelayEndowmentInsurance"
|
||||
},
|
||||
{
|
||||
title: "其他",
|
||||
dataIndex: "otherDeduction",
|
||||
key: "otherDeduction"
|
||||
},
|
||||
{
|
||||
title: "准予扣除的捐赠额",
|
||||
dataIndex: "deductionAllowedDonation",
|
||||
key: "deductionAllowedDonation"
|
||||
}
|
||||
];
|
||||
export const situationModalColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "taxAgentName",
|
||||
key: "taxAgentName"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
key: "departmentName"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobNum",
|
||||
key: "jobNum"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "idNo",
|
||||
key: "idNo"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "hiredate",
|
||||
key: "hiredate"
|
||||
},
|
||||
{
|
||||
title: "累计收入额",
|
||||
dataIndex: "addUpIncome",
|
||||
key: "addUpIncome"
|
||||
},
|
||||
{
|
||||
title: "累计减除费用",
|
||||
dataIndex: "addUpSubtraction",
|
||||
key: "addUpSubtraction"
|
||||
},
|
||||
{
|
||||
title: "累计社保个人合计",
|
||||
dataIndex: "addUpSocialSecurityTotal",
|
||||
key: "addUpSocialSecurityTotal"
|
||||
},
|
||||
{
|
||||
title: "累计公积金个人合计",
|
||||
dataIndex: "addUpAccumulationFundTotal",
|
||||
key: "addUpAccumulationFundTotal"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "addUpChildEducation",
|
||||
key: "addUpChildEducation"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "addUpContinuingEducation",
|
||||
key: "addUpContinuingEducation"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "addUpHousingLoanInterest",
|
||||
key: "addUpHousingLoanInterest"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "addUpHousingRent",
|
||||
key: "addUpHousingRent"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "addUpSupportElderly",
|
||||
key: "addUpSupportElderly"
|
||||
},
|
||||
{
|
||||
title: "累计企业(职业)年金及其他福利",
|
||||
dataIndex: "addUpEnterpriseAndOther",
|
||||
key: "addUpEnterpriseAndOther"
|
||||
},
|
||||
{
|
||||
title: "累计其他免税扣除",
|
||||
dataIndex: "addUpOtherDeduction",
|
||||
key: "addUpOtherDeduction"
|
||||
},
|
||||
{
|
||||
title: "累计免税收入",
|
||||
dataIndex: "addUpTaxExemptIncome",
|
||||
key: "addUpTaxExemptIncome"
|
||||
},
|
||||
{
|
||||
title: "累计准予扣除的捐赠额",
|
||||
dataIndex: "addUpAllowedDonation",
|
||||
key: "addUpAllowedDonation"
|
||||
},
|
||||
{
|
||||
title: "累计减免税额",
|
||||
dataIndex: "addUpTaxSavings",
|
||||
key: "addUpTaxSavings"
|
||||
},
|
||||
{
|
||||
title: "累计已预扣预缴税额",
|
||||
dataIndex: "addUpAdvanceTax",
|
||||
key: "addUpAdvanceTax"
|
||||
},
|
||||
{
|
||||
title: "累计婴幼儿照护",
|
||||
dataIndex: "addUpInfantCare",
|
||||
key: "addUpInfantCare"
|
||||
},
|
||||
{
|
||||
title: "累计大病医疗",
|
||||
dataIndex: "addUpIllnessMedical",
|
||||
key: "addUpIllnessMedical"
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
|
||||
export const dataSource = [];
|
||||
|
||||
export const dataCollectCondition = [
|
||||
{
|
||||
items: [
|
||||
|
|
@ -404,7 +7,7 @@ export const dataCollectCondition = [
|
|||
fieldcol: 12,
|
||||
label: "税款所属期",
|
||||
lanId: 542240,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
|
|
@ -414,7 +17,7 @@ export const dataCollectCondition = [
|
|||
domkey: ["taxAgentId"],
|
||||
fieldcol: 12,
|
||||
label: "个税扣缴义务人",
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
lanId: 537996,
|
||||
value: "",
|
||||
options: [],
|
||||
|
|
@ -448,7 +51,7 @@ export const dataCollectCondition = [
|
|||
isQuickSearch: false,
|
||||
label: "人员",
|
||||
lanId: 30042,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import TableRecord from "../components/tableRecord";
|
|||
import { dataCollectCondition } from "./columns";
|
||||
import { removePropertyCondition } from "../../../util/response";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { getDomkes } from "../../../util";
|
||||
import Layout from "../layout";
|
||||
import moment from "moment";
|
||||
|
||||
|
|
@ -239,6 +240,7 @@ class Index extends Component {
|
|||
addForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = {
|
||||
..._.reduce(getDomkes(dataCollectCondition), (pre, cur) => ({ ...pre, [cur]: "" }), {}),
|
||||
...addForm.getFormParams(),
|
||||
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
|
||||
};
|
||||
|
|
@ -332,7 +334,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
@ -555,8 +557,10 @@ export const DataCollectionSelect = (props) => {
|
|||
};
|
||||
|
||||
export const Input = (props) => {
|
||||
const { value } = props;
|
||||
return (<WeaInput value={value} viewAttr={1}/>);
|
||||
const { value, label } = props;
|
||||
return (<WeaFormItem label={label} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaInput value={value} viewAttr={1}/>
|
||||
</WeaFormItem>);
|
||||
};
|
||||
export const DataCollectionDateRangePick = (props) => {
|
||||
const { range, label, onChange, format = "YYYY-MM", key } = props;
|
||||
|
|
|
|||
|
|
@ -1,70 +1,3 @@
|
|||
export const columns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
}
|
||||
];
|
||||
export const dataCollectCondition = [
|
||||
{
|
||||
items: [
|
||||
|
|
@ -74,7 +7,7 @@ export const dataCollectCondition = [
|
|||
fieldcol: 12,
|
||||
label: "税款所属期",
|
||||
lanId: 542240,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
|
|
@ -84,7 +17,7 @@ export const dataCollectCondition = [
|
|||
domkey: ["taxAgentId"],
|
||||
fieldcol: 12,
|
||||
label: "个税扣缴义务人",
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
lanId: 537996,
|
||||
value: "",
|
||||
options: [],
|
||||
|
|
@ -133,7 +66,7 @@ export const dataCollectCondition = [
|
|||
isQuickSearch: false,
|
||||
label: "人员",
|
||||
lanId: 30042,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import { dataCollectCondition, taxOptions } from "./columns";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { getDomkes } from "../../../util";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -379,7 +380,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
@ -392,6 +393,7 @@ class Index extends Component {
|
|||
addForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = {
|
||||
..._.reduce(getDomkes(dataCollectCondition), (pre, cur) => ({ ...pre, [cur]: "" }), {}),
|
||||
...addForm.getFormParams(),
|
||||
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@
|
|||
* Date: 2023/2/17
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import UnifiedTable from "../../components/UnifiedTable";
|
||||
import { getTableDate } from "../../apis/cumDeduct";
|
||||
import { Menu, Popover } from "antd";
|
||||
import { Spin } from "antd";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -16,25 +15,53 @@ class DataTables extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: {
|
||||
query: false
|
||||
},
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
loading: { query: false }, dataSource: [], columns: [], selectedRowKeys: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getTableDate();
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getTableDate();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({ pageInfo: { ...this.state.pageInfo, ...params } }, () => this.getTableDate());
|
||||
break;
|
||||
case "CHECKBOX":
|
||||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
break;
|
||||
case "DEL":
|
||||
this.props.onTableOperate({ key: "deleteSelectAddUpDeduction" }, params);
|
||||
break;
|
||||
case "EDIT":
|
||||
this.props.onTableOperate({ key: "handleAddData" }, params);
|
||||
break;
|
||||
case "VIEW":
|
||||
this.props.onViewDetails(params);
|
||||
break;
|
||||
case "log":
|
||||
this.props.onTableOperate({ key: "log" }, params);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
getTableDate = (extraPayload = {}) => {
|
||||
const { loading, pageInfo } = this.state;
|
||||
const { url, payload } = this.props;
|
||||
const { loading, pageInfo, selectedRowKeys } = this.state;
|
||||
const { url, payload, isSpecial } = this.props;
|
||||
const module = {
|
||||
...pageInfo, url, ...payload, ...extraPayload,
|
||||
departmentIds: extraPayload.departmentIds ? extraPayload.departmentIds.split(",") : []
|
||||
|
|
@ -45,10 +72,12 @@ class DataTables extends Component {
|
|||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource,
|
||||
columns
|
||||
});
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns
|
||||
}, () => this.postMessageToChild({
|
||||
dataSource: this.state.dataSource, scrollHeight: 103, selectedRowKeys, isSpecial,
|
||||
pageInfo: this.state.pageInfo, unitTableType: "dataAcquisition",
|
||||
columns: this.state.columns
|
||||
}));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
|
||||
};
|
||||
|
|
@ -59,124 +88,34 @@ class DataTables extends Component {
|
|||
* Date: 2023/2/20
|
||||
*/
|
||||
handleClearRows = () => this.setState({ selectedRowKeys: [] });
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"),
|
||||
"条": getLabel(18256, "条"), "删除": getLabel(111, "删除"), "查看明细": getLabel(111, "查看明细"),
|
||||
"操作日志": getLabel(545781, "操作日志")
|
||||
};
|
||||
const childFrameObj = document.getElementById("unitTable");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
|
||||
render() {
|
||||
const { columns, dataSource, loading, selectedRowKeys, pageInfo } = this.state;
|
||||
const { showOperateBtn, onTableOperate, onViewDetails, isSpecial = false, form } = this.props;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => {
|
||||
this.getTableDate({ ...form.getFormParams() });
|
||||
});
|
||||
},
|
||||
onChange: (current) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => {
|
||||
this.getTableDate({ ...form.getFormParams() });
|
||||
});
|
||||
}
|
||||
};
|
||||
const getColumns = _.map(columns, item => {
|
||||
const { dataIndex } = item;
|
||||
if (dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
return <a
|
||||
className="ellipsis"
|
||||
href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}
|
||||
>
|
||||
{text}
|
||||
</a>;
|
||||
}
|
||||
};
|
||||
} else if (dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
width: 150,
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
{
|
||||
!isSpecial &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onViewDetails(record)}>查看明细</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="deleteSelectAddUpDeduction">删除</Menu.Item>
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
{
|
||||
isSpecial &&
|
||||
<React.Fragment>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}> {text} </span>;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
return <UnifiedTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={getColumns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
xWidth={getColumns.length * 160}
|
||||
/>;
|
||||
const { dataSource, loading } = this.state;
|
||||
const dom = document.querySelector(".dataContent");
|
||||
let height = 280;
|
||||
if (dataSource.length > 0 && dom) {
|
||||
const tableHeight = dataSource.length * 46 + 124;
|
||||
height = dom.offsetHeight > tableHeight ? tableHeight : dom.offsetHeight;
|
||||
}
|
||||
return (<div style={{ height: height + "px" }}>
|
||||
<Spin spinning={loading.query}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/unitTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
|
||||
id="unitTable"
|
||||
/>
|
||||
</Spin>
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,33 +23,17 @@
|
|||
}
|
||||
|
||||
.addItemsWrapper {
|
||||
padding-bottom: 8px;
|
||||
|
||||
.baseForm {
|
||||
.wea-form-cell {
|
||||
padding-right: 20% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-search-group {
|
||||
.wea-form-cell-wrapper {
|
||||
border: 1px solid #e5e5e5;
|
||||
|
||||
& > div:last-child {
|
||||
border-bottom: none
|
||||
}
|
||||
|
||||
.wea-form-cell {
|
||||
padding: 4px 16px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.wea-form-item {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.tipWrapper {
|
||||
background: #FFF;
|
||||
margin: 0 16px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,6 +41,15 @@
|
|||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #F6F6F6;
|
||||
|
||||
.wea-new-top-wapper, .wea-tab {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.wea-tab {
|
||||
margin: 8px 16px;
|
||||
}
|
||||
|
||||
.wea-tab-left {
|
||||
min-width: 600px !important;
|
||||
|
|
@ -114,6 +107,68 @@
|
|||
.dataContent {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
padding: 0 16px;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
|
||||
.dataAc-ellipsis {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-slide-modal .wea-slide-modal-content {
|
||||
background: #f6f6f6;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.titleDialog {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 46px 8px 16px;
|
||||
background: #fff;
|
||||
|
||||
.titleCol {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.titleLeftBox {
|
||||
.titleIcon {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14A2D;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.titleRightBox {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import ImportModal from "./importDialog";
|
||||
import LogDialog from "../../components/logViewModal";
|
||||
import SlideModalTitle from "../../components/slideModalTitle";
|
||||
import { getSearchs } from "../../util";
|
||||
import "./index.less";
|
||||
|
||||
|
|
@ -73,15 +73,29 @@ class Layout extends Component {
|
|||
break;
|
||||
}
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { slidePayload, slideLoading, detailOptBtns, onSave } = this.props;
|
||||
const { title } = slidePayload;
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{title}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">
|
||||
{(slidePayload.children && slidePayload.children.props.className) ? [...detailOptBtns] :
|
||||
<Button type="primary" loading={slideLoading} onClick={onSave}>{getLabel(537558, "保存")}</Button>}
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { showSearchAd, logDialogVisible, filterConditions } = this.state;
|
||||
const {
|
||||
title, btns, leftComp, children, taxAgentStore: { showOperateBtn },
|
||||
slidePayload, onClose, onSave, slideLoading, form, condition, onImportFile,
|
||||
onAdSearch, onCancel, importPayload, detailOptBtns, logFunction, onClearTargrtid
|
||||
slidePayload, onClose, form, condition, onImportFile,
|
||||
onAdSearch, onCancel, importPayload, logFunction, onClearTargrtid
|
||||
} = this.props;
|
||||
const { visible, title: subtitle, children: slideChildren } = slidePayload;
|
||||
const { visible, children: slideChildren } = slidePayload;
|
||||
const {
|
||||
visible: importVisiable, importFormComponent, importOpts,
|
||||
importResult, templateLink, previewUrl
|
||||
|
|
@ -99,6 +113,7 @@ class Layout extends Component {
|
|||
]}
|
||||
/>
|
||||
<WeaTab
|
||||
advanceHeight={162}
|
||||
searchType={["base", "advanced"]}
|
||||
replaceLeft={leftComp}
|
||||
searchsAd={getSearchs(form, toJS(condition), 2)}
|
||||
|
|
@ -111,7 +126,7 @@ class Layout extends Component {
|
|||
searchsBaseValue={form.getFormParams().username}
|
||||
/>
|
||||
<div className="dataContent">
|
||||
<WeaNewScroll height="100%">{children}</WeaNewScroll>
|
||||
{children}
|
||||
{/*导入弹框*/}
|
||||
<ImportModal
|
||||
visible={importVisiable} onCancel={onCancel} importParams={importFormComponent}
|
||||
|
|
@ -124,21 +139,12 @@ class Layout extends Component {
|
|||
visible={visible}
|
||||
top={0}
|
||||
measureT="%"
|
||||
width={80}
|
||||
measureX="%"
|
||||
width={850}
|
||||
measureX="px"
|
||||
height={100}
|
||||
measureY="%"
|
||||
direction="right"
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={subtitle}
|
||||
loading={slideLoading}
|
||||
onSave={onSave}
|
||||
editable={subtitle.length <= 2}
|
||||
showOperateBtn={showOperateBtn}
|
||||
customOperate={subtitle.length <= 2 ? [] : detailOptBtns}
|
||||
/>
|
||||
}
|
||||
title={this.renderTitle()}
|
||||
content={slideChildren}
|
||||
onClose={onClose}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,70 +1,3 @@
|
|||
export const columns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
}
|
||||
];
|
||||
export const dataCollectCondition = [
|
||||
{
|
||||
items: [
|
||||
|
|
@ -74,7 +7,7 @@ export const dataCollectCondition = [
|
|||
fieldcol: 12,
|
||||
label: "税款所属期",
|
||||
lanId: 542240,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
|
|
@ -84,7 +17,7 @@ export const dataCollectCondition = [
|
|||
domkey: ["taxAgentId"],
|
||||
fieldcol: 12,
|
||||
label: "个税扣缴义务人",
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
lanId: 537996,
|
||||
value: "",
|
||||
options: [],
|
||||
|
|
@ -118,7 +51,7 @@ export const dataCollectCondition = [
|
|||
isQuickSearch: false,
|
||||
label: "人员",
|
||||
lanId: 30042,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import { dataCollectCondition } from "./columns";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { getDomkes } from "../../../util";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -394,7 +395,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
@ -407,6 +408,7 @@ class Index extends Component {
|
|||
addForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = {
|
||||
..._.reduce(getDomkes(dataCollectCondition), (pre, cur) => ({ ...pre, [cur]: "" }), {}),
|
||||
...addForm.getFormParams(),
|
||||
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export const condition = [
|
|||
fieldcol: 12,
|
||||
label: "个税扣缴义务人",
|
||||
lanId: 537996,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [],
|
||||
rules: "required|string",
|
||||
|
|
@ -40,7 +40,7 @@ export const condition = [
|
|||
isQuickSearch: false,
|
||||
label: "人员",
|
||||
lanId: 30042,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import { condition } from "./components/condition";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { getDomkes } from "../../../util";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -332,7 +333,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
@ -345,6 +346,7 @@ class Index extends Component {
|
|||
addForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = {
|
||||
..._.reduce(getDomkes(condition), (pre, cur) => ({ ...pre, [cur]: "" }), {}),
|
||||
...addForm.getFormParams(),
|
||||
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { getSearchs } from "../../../../util";
|
|||
import { getTaxAgentSelectListAsAdmin } from "../../../../apis/taxAgent";
|
||||
import { saveDeclare } from "../../../../apis/declare";
|
||||
import { declareConditions } from "./condition";
|
||||
import * as API from "../../../../apis/ruleconfig";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -31,7 +32,8 @@ class Index extends Component {
|
|||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.declareStore.initDeclareForm();
|
||||
}
|
||||
|
||||
getTaxAgentSelectListAsAdmin = (props) => {
|
||||
getTaxAgentSelectListAsAdmin = async (props) => {
|
||||
const { data: sysinfo } = await API.sysinfo();
|
||||
const { declareStore: { declareForm } } = props;
|
||||
getTaxAgentSelectListAsAdmin().then(({ status, data }) => {
|
||||
if (status) {
|
||||
|
|
@ -44,6 +46,11 @@ class Index extends Component {
|
|||
...o, options: _.map(data, g => ({ key: g.id, showname: g.content }))
|
||||
// helpfulTitle: getLabel(563420, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;")
|
||||
};
|
||||
} else if (getKey(o) === "salaryMonthStr") {
|
||||
return {
|
||||
...o,
|
||||
label: sysinfo["TAX_DECLARATION_DATE_TYPE"] === "1" ? getLabel(111, "税款所属期") : getLabel(111, "薪资所属月")
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
|
|
@ -58,7 +65,9 @@ class Index extends Component {
|
|||
if (f.isValid) {
|
||||
const payload = declareForm.getFormParams();
|
||||
this.setState({ loading: true });
|
||||
saveDeclare({ ...payload }).then(({ status, errormsg }) => {
|
||||
saveDeclare({
|
||||
...payload, taxCycle: `${payload.salaryMonthStr}-01`, salaryDate: `${payload.salaryMonthStr}-01`
|
||||
}).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功"));
|
||||
|
|
|
|||
|
|
@ -1,27 +1,24 @@
|
|||
import React from "react";
|
||||
import CustomTab from "../../components/customTab";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
||||
import { getQueryString } from "../../util/url";
|
||||
import * as API from "../../apis/declare";
|
||||
import { Button } from "antd";
|
||||
import UnifiedTable from "../../components/UnifiedTable";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
export default class GenerateDeclarationDetail extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false,
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
declareInfo: {}
|
||||
loading: false, dataSource: [], columns: [], declareInfo: {},
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
this.getDetailList();
|
||||
this.getDeclareInfo();
|
||||
}
|
||||
|
|
@ -37,31 +34,19 @@ export default class GenerateDeclarationDetail extends React.Component {
|
|||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource,
|
||||
pageInfo: {
|
||||
...pageInfo,
|
||||
current, pageSize, total
|
||||
},
|
||||
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns: _.map(_.filter(columns, it => it.dataIndex !== "jobNum"), item => {
|
||||
if (item.dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
return <a className="ellipsis"
|
||||
href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}
|
||||
>
|
||||
{text}
|
||||
</a>;
|
||||
}
|
||||
...item, width: 180,
|
||||
render: (text, record) => (<a className="ellipsis" href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}>{text}</a>)
|
||||
};
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}>{text}</span>;
|
||||
}
|
||||
...item, width: (item.dataIndex === "cardType" || item.dataIndex === "cardNum") ? 180 : 100,
|
||||
render: (text) => (<span className="ellipsis" title={text}>{text}</span>)
|
||||
};
|
||||
})
|
||||
});
|
||||
|
|
@ -78,26 +63,19 @@ export default class GenerateDeclarationDetail extends React.Component {
|
|||
const url = `${window.location.origin}/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=${getQueryString("id")}`;
|
||||
window.open(url, "_self");
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { declareInfo } = this.state;
|
||||
return (<React.Fragment>
|
||||
<span>{getLabel(111, "薪资所属月")}:{declareInfo.salaryMonth}</span>
|
||||
<span style={{ marginLeft: "10px" }}>{getLabel(111, "个税扣缴义务人")}:{declareInfo.taxAgentName}</span>
|
||||
</React.Fragment>);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { declareInfo, loading, pageInfo, columns, dataSource } = this.state;
|
||||
const { loading, pageInfo, columns, dataSource } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
|
||||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Button type="primary" onClick={this.handleExport}>导出</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const renderLeftOperation = () => {
|
||||
return (
|
||||
<div style={{ display: "inline-block", lineHeight: "47px" }}>
|
||||
<span>薪资所属月:{declareInfo.salaryMonth}</span>
|
||||
<span style={{ marginLeft: "10px" }}>个税扣缴义务人:{declareInfo.taxAgentName}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const buttons = showOperateBtn ? [<Button type="primary"
|
||||
onClick={this.handleExport}>{getLabel(111, "导出全部")}</Button>] : [];
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
|
|
@ -115,23 +93,12 @@ export default class GenerateDeclarationDetail extends React.Component {
|
|||
}, () => this.getDetailList());
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="generateDeclarationDetail">
|
||||
<CustomTab
|
||||
searchOperationItem={showOperateBtn && renderRightOperation()}
|
||||
leftOperation={renderLeftOperation()}
|
||||
/>
|
||||
<div className="tableWrapper">
|
||||
<UnifiedTable
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
xWidth={columns.length * 120}
|
||||
/>
|
||||
</div>
|
||||
return (<WeaTop title={this.renderTitle()} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={buttons}>
|
||||
<div className="declare-detail-table-container">
|
||||
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} loading={loading}
|
||||
scroll={{ x: 1200, y: `calc(100vh - 186px)` }}/>
|
||||
</div>
|
||||
);
|
||||
</WeaTop>);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
.generateDeclarationDetail {
|
||||
.tabWrapper{
|
||||
padding-left: 10px
|
||||
}
|
||||
.tableWrapper {
|
||||
height: calc(100vh - 48px);
|
||||
overflow: auto;
|
||||
.declare-detail-table-container {
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -34,7 +34,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;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@
|
|||
.baseSettingWrapper {
|
||||
padding: 12px 12px 12px 20px;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
.baseSettingLeft {
|
||||
border: 1px solid #ebedf0;
|
||||
padding: 0 !important;
|
||||
|
|
@ -249,7 +253,7 @@
|
|||
padding: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 20px;
|
||||
font-size: 20px !important;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资核算规则配置
|
||||
* Description:
|
||||
* Date: 2024/4/24
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
import LedgerAccountSalaryItemsSet from "./ledgerAccountSalaryItemsSet";
|
||||
import * as API from "../../../apis/ledger";
|
||||
import { acctApprRulesConditions } from "../config";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
class LedgerAccountApprRule extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
conditions: [], approvalId: "", approvalItemGroup: []
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
init = () => {
|
||||
const { saveSalarySobId, editId } = this.props;
|
||||
API.getSalaryApprovalForm({ salarySobId: editId || saveSalarySobId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
approvalId: data.id,
|
||||
approvalItemGroup: _.map(data.approvalItemGroup, item => ({
|
||||
...item, id: String(item.sorted),
|
||||
approvalItems: _.map(item.approvalItems, o => ({ ...o, id: `${String(item.sorted)}-${String(o.sorted)}` }))
|
||||
})),
|
||||
conditions: _.map(acctApprRulesConditions, item => ({
|
||||
...item, items: _.map(item.items, o => ({
|
||||
...o, value: getKey(o) === "isOpenApproval" ? (data[getKey(o)] ? "1" : "0") : data[getKey(o)],
|
||||
viewAttr: getKey(o) === "approvalWorkflowUrl" ? (data["isOpenApproval"] ? 3 : 2) : o.viewAttr,
|
||||
hide: getKey(o) !== "isOpenApproval" ? !data["isOpenApproval"] : false,
|
||||
label: getLabel(o.lanId, o.label)
|
||||
}))
|
||||
}))
|
||||
}, () => {
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
AARForm.initFormFields(this.state.conditions);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
const { ledgerStore: { initAARForm } } = this.props;
|
||||
initAARForm();
|
||||
}
|
||||
|
||||
renderForm = (form, conditions) => {
|
||||
const { saveSalarySobId, editId } = this.props;
|
||||
const { approvalItemGroup } = this.state;
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && conditions && conditions.map(c => {
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
if (getKey(fields) !== "approvalItemGroup") {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}
|
||||
onChange={this.handleFormItemChange}/>
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
} else {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<LedgerAccountSalaryItemsSet datas={approvalItemGroup} salarySobId={editId || saveSalarySobId}
|
||||
onAddItems={(groupId, items) => this.setState({
|
||||
approvalItemGroup: _.map(approvalItemGroup, o => ({
|
||||
...o,
|
||||
approvalItems: (groupId === o.id && !_.isEmpty(items)) ? [...o.approvalItems, ..._.map(items, (k, ki) => ({
|
||||
salaryItemId: k.id, salaryItemName: k.name,
|
||||
id: `${String(o.sorted)}-${String(o.approvalItems.length + ki)}`
|
||||
}))] : o.approvalItems
|
||||
}))
|
||||
}, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
|
||||
onEdit={(groupName, groupId) => this.setState({
|
||||
approvalItemGroup: groupId ? _.map(approvalItemGroup, o => ({
|
||||
...o, groupName: groupId === o.id ? groupName : o.groupName
|
||||
})) : [{
|
||||
approvalItems: [], groupName, id: String(approvalItemGroup.length)
|
||||
}, ...approvalItemGroup]
|
||||
}, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
|
||||
onDelete={(group, item) => this.setState({
|
||||
approvalItemGroup: _.isEmpty(item) ? _.filter(approvalItemGroup, o => o.id !== group.id) :
|
||||
_.map(approvalItemGroup, o => ({
|
||||
...o,
|
||||
approvalItems: _.filter(o.approvalItems, oo => oo.id !== item.id)
|
||||
}))
|
||||
}, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
|
||||
onChange={datas => this.setState({
|
||||
approvalItemGroup: datas
|
||||
}, () => form.updateFields({ approvalItemGroup: { value: datas } }))}/>
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
}
|
||||
});
|
||||
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
convertFormItemViewAttr = (viewAttr) => {
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
const { isOpenApproval } = AARForm.getFormParams();
|
||||
this.setState({
|
||||
conditions: _.map(this.state.conditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "approvalWorkflowUrl") {
|
||||
return { ...o, viewAttr, hide: isOpenApproval === "0" };
|
||||
} else if (getKey(o) === "approvalItemGroup") {
|
||||
return { ...o, viewAttr, hide: isOpenApproval === "0" };
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
}))
|
||||
});
|
||||
};
|
||||
handleFormItemChange = (value) => {
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
const { isOpenApproval } = AARForm.getFormParams();
|
||||
if (_.keys(value)[0] === "isOpenApproval") {
|
||||
this.convertFormItemViewAttr(isOpenApproval === "1" ? 3 : 2);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions } = this.state;
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
return (
|
||||
<div className="form-dialog-layout" style={{ background: "#FFF" }}>
|
||||
{this.renderForm(AARForm, conditions)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountApprRule;
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:审批规则分类编辑
|
||||
* Description:
|
||||
* Date: 2024/4/25
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { getSearchs } from "../../../util";
|
||||
import { classifyConditions } from "../config";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
class LedgerAccountApprRuleClassifyNameEditDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { conditions: [] };
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.init(nextProps);
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.ledgerStore.initAARClassifyForm();
|
||||
}
|
||||
|
||||
init = (props) => {
|
||||
const { ledgerStore: { AARClassifyForm }, groupName, groupId } = props;
|
||||
this.setState({
|
||||
conditions: _.map(classifyConditions, item => ({
|
||||
...item,
|
||||
items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
|
||||
}))
|
||||
}, () => {
|
||||
AARClassifyForm.initFormFields(this.state.conditions);
|
||||
groupId && AARClassifyForm.updateFields({ groupName });
|
||||
});
|
||||
};
|
||||
save = () => {
|
||||
const { ledgerStore: { AARClassifyForm }, groupId } = this.props;
|
||||
AARClassifyForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.props.onCancel();
|
||||
this.props.onEdit(AARClassifyForm.getFormParams().groupName, groupId);
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions } = this.state;
|
||||
const { ledgerStore: { AARClassifyForm } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 80 }} initLoadCss
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.save}>{getLabel(537558, "保存")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout">{getSearchs(AARClassifyForm, conditions, 1, false)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountApprRuleClassifyNameEditDialog;
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资核算规则配置-审批薪资项目
|
||||
* Description:
|
||||
* Date: 2024/4/24
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaButtonIcon, WeaLocaleProvider, WeaSortable, WeaTransfer } from "ecCom";
|
||||
import LedgerAccountApprRuleClassifyNameEditDialog from "./ledgerAccountApprRuleClassifyNameEditDialog";
|
||||
import * as API from "../../../apis/ledger";
|
||||
import { Icon, Modal } from "antd";
|
||||
import cs from "classnames";
|
||||
import SalaryItemModal from "../../payroll/stepForm/salaryItemModal";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class LedgerAccountSalaryItemsSet extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
editDialog: { visible: false, groupName: "", groupId: "", title: "" },
|
||||
salaryItemDialog: { visible: false, title: getLabel(111, "薪资项目项"), options: [], groupId: "" }
|
||||
};
|
||||
}
|
||||
|
||||
handleDeleteClick = (group, item = {}) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(543231, "确认删除本条数据吗?"),
|
||||
onOk: () => this.props.onDelete(group, item)
|
||||
});
|
||||
};
|
||||
handleAddSalaryItems = (group) => {
|
||||
const { salaryItemDialog } = this.state;
|
||||
const { salarySobId, datas } = this.props;
|
||||
const payload = {
|
||||
salarySobId, excludeIds: _.reduce(datas, (pre, cur) => {
|
||||
return pre.concat(_.map(cur.approvalItems, o => o.salaryItemId));
|
||||
}, [])
|
||||
};
|
||||
API.getListSalaryItem(payload).then(({ status, data }) => {
|
||||
if (status) this.setState({
|
||||
salaryItemDialog: {
|
||||
...salaryItemDialog, visible: true, options: data, groupId: group.id
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
handleConfirm = () => {
|
||||
const { salaryItemDialog } = this.state;
|
||||
this.setState({
|
||||
salaryItemDialog: { ...salaryItemDialog, visible: false }
|
||||
}, () => this.props.onAddItems(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem)));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { editDialog, salaryItemDialog } = this.state;
|
||||
const { datas } = this.props;
|
||||
return (
|
||||
<div>
|
||||
<div style={{ textAlign: "right", padding: "10px 0" }}>
|
||||
<WeaButtonIcon buttonType="add" type="primary"
|
||||
onClick={() => this.setState({
|
||||
editDialog: { visible: true, title: getLabel(111, "添加分类") }
|
||||
})}/>
|
||||
|
||||
</div>
|
||||
<div className={cs("salaryItemSettingWrapper", { required: _.isEmpty(datas) })}>
|
||||
<WeaSortable
|
||||
datas={datas}
|
||||
onChange={list => this.props.onChange(list)}
|
||||
renderNodeItem={(item) => {
|
||||
return <div className="salaryItemWrapper">
|
||||
<div className="salaryItemHeader">
|
||||
<span className="titleWrapper">
|
||||
<span className="salaryClassTitle">{item.groupName}</span>
|
||||
<span className="iconWrapper">
|
||||
<i className="icon-coms-edit" onClick={() => this.setState({
|
||||
editDialog: {
|
||||
visible: true, groupName: item.groupName, groupId: item.id, title: getLabel(111, "分类名称编辑")
|
||||
}
|
||||
})}/>
|
||||
<i className="icon-coms-Delete" onClick={() => this.handleDeleteClick(item)}/>
|
||||
</span>
|
||||
</span>
|
||||
<i className="icon-coms-Add-to" onClick={() => this.handleAddSalaryItems(item)}/>
|
||||
</div>
|
||||
<div className="salaryItemContent">
|
||||
{
|
||||
!_.isEmpty(item.approvalItems) ?
|
||||
<WeaSortable
|
||||
datas={item.approvalItems}
|
||||
onChange={(items) => this.props.onChange(
|
||||
_.map(datas, child => {
|
||||
if (child.id === item.id) {
|
||||
return { ...child, approvalItems: items };
|
||||
}
|
||||
return { ...child };
|
||||
})
|
||||
)}
|
||||
renderNodeItem={(filed) => {
|
||||
return <div className="salaryItemList">
|
||||
<div className="salaryItem" title={filed.salaryItemName}>
|
||||
<div className="salaryItemName">{filed.salaryItemName}</div>
|
||||
<Icon type="cross" onClick={() => this.handleDeleteClick(item, filed)}/>
|
||||
</div>
|
||||
</div>;
|
||||
}}
|
||||
className="wea-sortable-salary-item"
|
||||
/> :
|
||||
<div className="empty">暂无数据</div>
|
||||
}
|
||||
</div>
|
||||
</div>;
|
||||
}}
|
||||
className="wea-sortable-salary-item"
|
||||
/>
|
||||
<LedgerAccountApprRuleClassifyNameEditDialog {...editDialog} {...this.props}
|
||||
onCancel={() => this.setState({
|
||||
editDialog: { ...editDialog, visible: false }
|
||||
})}/>
|
||||
<SalaryItemModal {...salaryItemDialog}
|
||||
onCancel={() => this.setState({
|
||||
salaryItemDialog: { ...salaryItemDialog, visible: false }
|
||||
})} onConfirm={this.handleConfirm}>
|
||||
<div className="modalContent">
|
||||
<WeaTransfer
|
||||
data={salaryItemDialog.options}
|
||||
selectedKeys={_.map(_.filter(salaryItemDialog.options, g => g.checkedSalaryItem), o => o.id)}
|
||||
onChange={v => {
|
||||
this.setState({
|
||||
salaryItemDialog: {
|
||||
...salaryItemDialog,
|
||||
options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) }))
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</SalaryItemModal>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountSalaryItemsSet;
|
||||
|
|
@ -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}
|
||||
|
|
@ -286,7 +289,9 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
APIFox={APIFox}
|
||||
tabActive={selectedKey}
|
||||
searchValue={searchValue}
|
||||
showOperateBtn={showOperateBtn}
|
||||
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
|
||||
onEditScope={this.handleAddPersonal}
|
||||
/>
|
||||
{/*关联人员范围导入*/}
|
||||
{importParams.visible && (
|
||||
|
|
@ -336,9 +341,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
onCancel={() =>
|
||||
this.setState({
|
||||
personalAddModal: {
|
||||
...personalAddModal,
|
||||
visible: false,
|
||||
includeType: ""
|
||||
...personalAddModal, record: {}, includeType: "", visible: false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,8 @@ class LedgerMovoTo extends Component {
|
|||
];
|
||||
return (
|
||||
<WeaDialog
|
||||
{...extraProps} style={{ width: 440, height: 232 }}
|
||||
buttons={buttons} hasScroll initLoadCss
|
||||
className="moveModalWrapper"
|
||||
>
|
||||
{...extraProps} buttons={buttons} hasScroll initLoadCss className="moveModalWrapper"
|
||||
style={{ width: 440, height: Math.ceil((dataList.length - 1) / 3) * 25 + 41 }}>
|
||||
<WeaSearchGroup showGroup needTigger={false}>
|
||||
<WeaSelect
|
||||
options={_.filter(dataList, item => item.showname === "未分类")}
|
||||
|
|
|
|||
|
|
@ -254,20 +254,19 @@ class LedgerSalaryItem extends Component {
|
|||
* Params:
|
||||
* Date: 2022/12/14
|
||||
*/
|
||||
handleAddSalaryItems = (id, items) => {
|
||||
handleAddSalaryItems = (id, items, insertId) => {
|
||||
const { itemGroups } = this.state;
|
||||
this.setState({
|
||||
itemGroups: _.map(itemGroups, it => {
|
||||
if (id === it.uuid) {
|
||||
items = _.map(items, child => {
|
||||
const { id: itemsId, ...extraItems } = child;
|
||||
return { ...extraItems, salaryItemGroupId: it.uuid };
|
||||
});
|
||||
if (insertId) it.items.splice(_.findIndex(it.items, k => (k.id === insertId) || (k.key === insertId)) + 1, 0, ...items);
|
||||
return {
|
||||
...it, items: _.map([..._.map(items, child => {
|
||||
const { id: itemsId, ...extraItems } = child;
|
||||
return { ...extraItems, salaryItemGroupId: it.uuid };
|
||||
}), ...it.items], (childItem, childItemIndex) => {
|
||||
return {
|
||||
...childItem,
|
||||
sortedIndex: childItemIndex
|
||||
};
|
||||
...it, items: _.map(insertId ? it.items : [...items, ...it.items], (childItem, childItemIndex) => {
|
||||
return { ...childItem, sortedIndex: childItemIndex };
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
@ -319,7 +318,7 @@ class LedgerSalaryItem extends Component {
|
|||
items: [...it.items, {
|
||||
...extraItems,
|
||||
salaryItemGroupId: moveToItemId,
|
||||
key: moveId,
|
||||
key: moveId ? moveId : items.key,
|
||||
sortedIndex: !_.isEmpty(it.items) ? it.items[it.items.length - 1].sortedIndex + 1 : 0
|
||||
}]
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,25 +1,15 @@
|
|||
import React from "react";
|
||||
import { Button, Switch } from "antd";
|
||||
import { WeaDialog, WeaInputSearch, WeaTable } from "ecCom";
|
||||
import { Button, Spin } from "antd";
|
||||
import { WeaCheckbox, WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { listSalaryItem } from "../../../apis/ledger";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
export default class LedgerSalaryItemAddModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: {
|
||||
query: false
|
||||
},
|
||||
name: "",
|
||||
selectedRowKeys: [],
|
||||
dataSource: [],
|
||||
dataSourceCopy: [],
|
||||
columns: [],
|
||||
pageInfo: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
}
|
||||
loading: { query: false }, name: "", selectedRowKeys: [], dataSource: [],
|
||||
dataSourceCopy: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -42,12 +32,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
excludeIds.push(i.salaryItemId);
|
||||
});
|
||||
});
|
||||
const payload = {
|
||||
excludeIds,
|
||||
name,
|
||||
...pageInfo,
|
||||
...extra
|
||||
};
|
||||
const payload = { excludeIds, name, ...pageInfo, ...extra };
|
||||
this.setState({ loading: { ...loading, query: true } });
|
||||
listSalaryItem(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: { ...loading, query: false } });
|
||||
|
|
@ -56,9 +41,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
const tmpV = !_.isEmpty(dataSource) ? dataSource : [];
|
||||
this.setState({
|
||||
dataSourceCopy: [...dataSourceCopy, ...tmpV],
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource: tmpV,
|
||||
columns
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource: tmpV, columns
|
||||
});
|
||||
}
|
||||
}).catch(() => {
|
||||
|
|
@ -76,7 +59,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
case "useDefault":
|
||||
case "hideDefault":
|
||||
case "useInEmployeeSalary":
|
||||
return <Switch checked={text === 1}/>;
|
||||
return <WeaCheckbox value={String(text)} disabled display="switch"/>;
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
||||
}
|
||||
|
|
@ -85,10 +68,9 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
});
|
||||
return newColumns;
|
||||
};
|
||||
|
||||
handleAdd = () => {
|
||||
const { dataSourceCopy, selectedRowKeys } = this.state;
|
||||
const { onAddSalaryItems, id, onCancel, itemGroups } = this.props;
|
||||
const { onAddSalaryItems, id, onCancel, itemGroups, record } = this.props;
|
||||
const arrItems = _.find(itemGroups, it => it.uuid === id).items || [];
|
||||
let selectItems = [];
|
||||
_.uniqWith(dataSourceCopy, _.isEqual).map((item) => {
|
||||
|
|
@ -104,54 +86,53 @@ export default class LedgerSalaryItemAddModal extends React.Component {
|
|||
});
|
||||
});
|
||||
onCancel();
|
||||
onAddSalaryItems(id, selectItems);
|
||||
onAddSalaryItems(id, selectItems, record.id || record.key);
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { name, pageInfo } = this.state;
|
||||
return <div className="sys-item-title">
|
||||
<span>{getLabel(111, "添加薪资项目")}</span>
|
||||
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })} style={{ width: 200 }}
|
||||
placeholder={getLabel(111, "请输入薪资项目名称")} onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.listSalaryItem())}/>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { onCancel, visible } = this.props;
|
||||
const { name, selectedRowKeys, pageInfo, dataSource, loading } = this.state;
|
||||
const { selectedRowKeys, pageInfo, dataSource, loading } = this.state;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current: 1, pageSize } }, () => this.listSalaryItem());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => {
|
||||
this.listSalaryItem();
|
||||
});
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.listSalaryItem());
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => {
|
||||
this.setState({ selectedRowKeys }, () => {
|
||||
});
|
||||
}
|
||||
selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
visible={visible} onCancel={onCancel} hasScroll
|
||||
title="添加薪资项目" style={{ width: "80vw", height: 400 }}
|
||||
buttons={[<Button type="primary" onClick={this.handleAdd} disabled={_.isEmpty(selectedRowKeys)}>添加</Button>]}
|
||||
>
|
||||
<div style={{ display: "flex", justifyContent: "flex-end", alignItems: "center", padding: 20 }}>
|
||||
<WeaInputSearch
|
||||
placeholder="请输入薪资项目名称"
|
||||
value={name}
|
||||
onChange={(name) => this.setState({ name })}
|
||||
onSearch={() => this.listSalaryItem({ current: 1 })}
|
||||
/>
|
||||
<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.sysItemRef = dom}
|
||||
title={this.renderTitle()}
|
||||
buttons={[<Button type="primary" onClick={this.handleAdd}
|
||||
disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "添加")}</Button>]}
|
||||
style={{
|
||||
width: "60vw", height: 600, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}>
|
||||
<div className="sys-item-table-box">
|
||||
<Spin spinning={loading.query && pageInfo.total === 0}>
|
||||
<WeaTable columns={this.getSalaryItemAddColumns()} dataSource={dataSource} pagination={pagination}
|
||||
loading={loading.query} scroll={{ y: this.sysItemRef ? this.sysItemRef.state.height - 112 : 600 }}
|
||||
rowKey={record => record.id || record.key} rowSelection={rowSelection}/>
|
||||
</Spin>
|
||||
</div>
|
||||
<WeaTable
|
||||
rowKey={record => record.id || record.key}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
columns={this.getSalaryItemAddColumns()}
|
||||
/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class LedgerSalaryItemBaseInfo extends Component {
|
|||
};
|
||||
handleDeleteEmplist = (item) => {
|
||||
const { dataSource, onChangeSortableList } = this.props;
|
||||
onChangeSortableList(_.xorWith(dataSource, [item], _.isEqual));
|
||||
onChangeSortableList(_.filter(dataSource, o => o.id !== item.id));
|
||||
};
|
||||
|
||||
render() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class LedgerSalaryItemNormal extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
addCategoryItemsVisible: false,
|
||||
addCategoryItemsVisible: { visible: false, id: "", record: {} },
|
||||
categoryModal: {
|
||||
visible: false,
|
||||
title: "新增分类",
|
||||
|
|
@ -170,7 +170,11 @@ class LedgerSalaryItemNormal extends Component {
|
|||
onEditCategory={this.handleAddCategory}
|
||||
onDeleteCategory={this.handleDeleteCategory}
|
||||
onDeleteCategoryItems={this.handleDeleteCategoryItems}
|
||||
onAddCategoryItems={(id) => this.setState({ addCategoryItemsVisible: { visible: true, id } })}
|
||||
onAddCategoryItems={(id) => this.setState({
|
||||
addCategoryItemsVisible: {
|
||||
...addCategoryItemsVisible, visible: true, id
|
||||
}
|
||||
})}
|
||||
onUpgo={this.handleUpgo}
|
||||
onDowngo={this.handleDowngo}
|
||||
/>
|
||||
|
|
@ -178,13 +182,16 @@ class LedgerSalaryItemNormal extends Component {
|
|||
>
|
||||
<LedgerSalaryItemTable
|
||||
tableData={items}
|
||||
dataSource={_.find(dataSource, childItem => childItem.id === id || childItem.uuid === uuid).items}
|
||||
dataSource={_.find(dataSource, childItem => childItem.uuid === uuid).items}
|
||||
salarySobId={editId || saveSalarySobId}
|
||||
selectedRowKeys={field.selectedRowKeys || []}
|
||||
onDropCategoryItem={(data) => onDropCategoryItem(field, data)}
|
||||
onHandleItemhide={(data) => onHandleItemhide(field, data)}
|
||||
onChangeSelectedRowKeys={(data) => onChangeSelectedRowKeys(field, data)}
|
||||
onMoveTo={this.handleMoveTo}
|
||||
onAddCategoryItems={(record) => this.setState({
|
||||
addCategoryItemsVisible: { visible: true, record, id: uuid }
|
||||
})}
|
||||
/>
|
||||
</WeaSearchGroup>;
|
||||
})
|
||||
|
|
@ -198,7 +205,7 @@ class LedgerSalaryItemNormal extends Component {
|
|||
<LedgerSalaryItemAddModal
|
||||
{...addCategoryItemsVisible}
|
||||
itemGroups={dataSource}
|
||||
onCancel={() => this.setState({ addCategoryItemsVisible: { visible: false, id: "" } })}
|
||||
onCancel={() => this.setState({ addCategoryItemsVisible: { visible: false, id: "", record: {} } })}
|
||||
onAddSalaryItems={onAddSalaryItems}
|
||||
/>
|
||||
<CategoryAddModal
|
||||
|
|
@ -232,11 +239,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>
|
||||
|
|
|
|||
|
|
@ -128,8 +128,10 @@ class LedgerSalaryItemTable extends Component {
|
|||
formulaContent, formulaId, name,
|
||||
hideDefault: _.isNil(hideDefault) ? "0" : hideDefault,
|
||||
valueType, roundingMode, pattern,
|
||||
originFormulaContent, originSqlContent,
|
||||
useInEmployeeSalary: !_.isNil(useInEmployeeSalary) ? useInEmployeeSalary : "0"
|
||||
useInEmployeeSalary: !_.isNil(useInEmployeeSalary) ? useInEmployeeSalary : "0",
|
||||
//不能改成其他空值
|
||||
originFormulaContent: _.isNil(originFormulaContent) ? formulaContent : originFormulaContent,
|
||||
originSqlContent: _.isNil(originSqlContent) ? formulaContent : originSqlContent
|
||||
},
|
||||
record,
|
||||
userStatusList: _.map(userStatusList, it => ({ key: it.value.toString(), showname: it.defaultLabel }))
|
||||
|
|
@ -173,7 +175,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 : ""
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -288,18 +290,22 @@ class LedgerSalaryItemTable extends Component {
|
|||
width: 80,
|
||||
render: (text, record) => <WeaCheckbox
|
||||
value={text ? String(text) : !text ? "0" : "1"}
|
||||
onChange={value => this.handleChangeItem(value, record.id || record.key)}
|
||||
onChange={value => {
|
||||
this.handleChangeItem(value, record.id || record.key);
|
||||
}}
|
||||
/>
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
key: "operate",
|
||||
width: 120,
|
||||
width: 180,
|
||||
render: (_, record) => (
|
||||
<React.Fragment>
|
||||
<a href="javascript:void(0);" onClick={() => this.handleEditSalaryItem(record)}
|
||||
style={{ marginRight: 10 }}>编辑</a>
|
||||
<a href="javascript:void(0);" onClick={() => this.props.onAddCategoryItems(record)}
|
||||
style={{ marginRight: 10 }}>{getLabel(111, "插入")}</a>
|
||||
<a href="javascript:void(0);" onClick={() => onMoveTo(record)}>移动到</a>
|
||||
</React.Fragment>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@ import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
|
|||
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
|
||||
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
|
||||
import LedgerSalaryItem from "./ledgerSalaryItem";
|
||||
import LedgerAccountApprRule from "./ledgerAccountApprRule";
|
||||
import WeaTopTitle from "../../../components/custom-title/weaTopTitle";
|
||||
import WeaReqTitle from "../../../components/custom-title/weaReqTitle";
|
||||
import { saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
|
||||
import { salaryApprovalSaveForm, saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
|
||||
import { sysConfCodeRule } from "../../../apis/ruleconfig";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -28,10 +30,18 @@ class LedgerSlide extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
current: 0, loading: false, baseSettingInfo: {}, adjustRules: [],
|
||||
empFields: [], itemGroups: [], saveSalarySobId: ""
|
||||
empFields: [], itemGroups: [], saveSalarySobId: "",
|
||||
salaryApprovalStatus: false
|
||||
};
|
||||
}
|
||||
|
||||
async componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { data } = await sysConfCodeRule({ code: "SALARY_APPROVAL_STATUS" });
|
||||
this.setState({ salaryApprovalStatus: data === "1" });
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.setState({
|
||||
saveSalarySobId: ""
|
||||
|
|
@ -76,7 +86,7 @@ class LedgerSlide extends Component {
|
|||
* Date: 2022/12/12
|
||||
*/
|
||||
saveLedgerAdjustRule = () => {
|
||||
const { adjustRules, saveSalarySobId } = this.state;
|
||||
const { adjustRules, saveSalarySobId, salaryApprovalStatus } = this.state;
|
||||
const payload = {
|
||||
salarySobId: this.props.editId || saveSalarySobId,
|
||||
ruleParams: adjustRules
|
||||
|
|
@ -86,7 +96,7 @@ class LedgerSlide extends Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success("保存成功");
|
||||
this.handleClose();
|
||||
!salaryApprovalStatus && this.handleClose();
|
||||
} else {
|
||||
message.success(errormsg || "保存失败");
|
||||
}
|
||||
|
|
@ -106,9 +116,9 @@ class LedgerSlide extends Component {
|
|||
if (!it.salarySobId) delete it.id;
|
||||
return { ...it };
|
||||
}),
|
||||
itemGroups: _.map(_.filter(itemGroups, it => it.name !== "未分类"), item => {
|
||||
itemGroups: _.map(_.filter(itemGroups, it => it.name !== "未分类"), (item, index) => {
|
||||
return {
|
||||
...item,
|
||||
...item, sortedIndex: index,
|
||||
items: _.map(item.items, it => {
|
||||
delete it.originFormulaContent;
|
||||
delete it.originSqlContent;
|
||||
|
|
@ -151,9 +161,45 @@ class LedgerSlide extends Component {
|
|||
*/
|
||||
handleSaveSalaryItemParams = (empFields, itemGroups) => this.setState({ empFields, itemGroups });
|
||||
|
||||
handleDefaultSave = () => {
|
||||
const { saveSalarySobId } = this.state;
|
||||
const { state: { approvalId } } = this.approRef.wrappedInstance;
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
const { approvalItemGroup, isOpenApproval, ...extra } = AARForm.getFormParams();
|
||||
const group = _.map(approvalItemGroup, (item, index) => ({
|
||||
groupName: item.groupName, sorted: index,
|
||||
approvalItems: _.map(item.approvalItems, (o, oi) => ({
|
||||
salaryItemId: o.salaryItemId, sorted: oi,
|
||||
salaryItemName: o.salaryItemName
|
||||
}))
|
||||
}));
|
||||
if (isOpenApproval === "1" && _.isEmpty(extra.approvalWorkflowUrl)) {
|
||||
AARForm.showError("approvalWorkflowUrl", getLabel(111, "\"审批流程地址\"未填写"));
|
||||
return;
|
||||
} else if (isOpenApproval === "1" && _.isEmpty(group)) {
|
||||
AARForm.showError("approvalItemGroup", getLabel(111, "\"审批薪资项目\"未填写"));
|
||||
return;
|
||||
}
|
||||
const payload = {
|
||||
...extra, isOpenApproval: isOpenApproval === "1", id: approvalId,
|
||||
salarySobId: this.props.editId || saveSalarySobId,
|
||||
approvalItemGroup: group
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
salaryApprovalSaveForm(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "保存成功!"));
|
||||
saveSalarySobId && this.handleClose();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { current, saveSalarySobId, loading } = this.state;
|
||||
const { current, saveSalarySobId, loading, salaryApprovalStatus } = this.state;
|
||||
let tabs = [
|
||||
{
|
||||
key: 0, title: getLabel(82751, "基础设置"),
|
||||
|
|
@ -210,9 +256,11 @@ class LedgerSlide extends Component {
|
|||
{
|
||||
key: 4, title: getLabel(543469, "调薪计薪规则"),
|
||||
createBtns: [
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>{getLabel(111, "完成")}</Button>
|
||||
<Button type="primary"
|
||||
onClick={() => this.setState({ current: !salaryApprovalStatus ? current : current + 1 }, () => this.saveLedgerAdjustRule())}>{!salaryApprovalStatus ? getLabel(111, "完成") : getLabel(111, "保存并进入下一步")}</Button>
|
||||
],
|
||||
editBtns: [
|
||||
<Button type="primary" loading={loading}
|
||||
|
|
@ -220,8 +268,23 @@ class LedgerSlide extends Component {
|
|||
],
|
||||
children: <LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>
|
||||
},
|
||||
{
|
||||
key: 5, title: getLabel(111, "核算审批规则"),
|
||||
createBtns: [
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading} onClick={this.handleDefaultSave}>{getLabel(111, "完成")}</Button>
|
||||
],
|
||||
editBtns: [
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={this.handleDefaultSave}>{getLabel(111, "保存")}</Button>
|
||||
],
|
||||
children: <LedgerAccountApprRule {...this.props} ref={dom => this.approRef = dom}
|
||||
saveSalarySobId={saveSalarySobId}/>
|
||||
}
|
||||
];
|
||||
!salaryApprovalStatus && tabs.pop();
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className="ledgerSlideLayout slideOuterWrapper"
|
||||
|
|
|
|||
|
|
@ -803,3 +803,57 @@ export const keepDecimalPlaces = [
|
|||
showname: "5"
|
||||
}
|
||||
];
|
||||
export const acctApprRulesConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["isOpenApproval"],
|
||||
fieldcol: 20,
|
||||
label: "是否开启审批",
|
||||
lanId: 111,
|
||||
labelcol: 4,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["approvalWorkflowUrl"],
|
||||
fieldcol: 20,
|
||||
label: "审批流程地址",
|
||||
lanId: 111,
|
||||
labelcol: 4,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "CUSTOM",
|
||||
domkey: ["approvalItemGroup"],
|
||||
fieldcol: 20,
|
||||
label: "审批薪资项目",
|
||||
lanId: 111,
|
||||
labelcol: 4,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const classifyConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["groupName"],
|
||||
fieldcol: 18,
|
||||
label: "分类名称",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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,5 +1,11 @@
|
|||
.ledgerWrapper {
|
||||
height: 100%;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.tdEllipsis {
|
||||
display: inline-block;
|
||||
|
|
@ -12,8 +18,6 @@
|
|||
|
||||
.ledgerSearch-Wrapper {
|
||||
min-width: 350px;
|
||||
margin-top: 5px;
|
||||
margin-right: 70px;
|
||||
position: relative;
|
||||
|
||||
& > button {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* 工资单查看启用二次验证弹框
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2025/4/15
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { WeaForm, WeaSwitch } from "comsMobx";
|
||||
import { Button, message } from "antd";
|
||||
import * as API from "../../apis/mySalaryBenefits";
|
||||
import FormInfo from "../../components/FormInfo";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const form = new WeaForm();
|
||||
|
||||
class CheckSecondaryVerifyDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, conditions: [], notSetting: false
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm();
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) form.initSecVerifyform();
|
||||
}
|
||||
|
||||
initForm = () => {
|
||||
const { salaryBillToken } = this.props;
|
||||
API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, salaryBillToken)
|
||||
.then(({ conditions, notSetting }) => {
|
||||
this.setState({ conditions: [{ title: "", items: conditions }], notSetting }, () => {
|
||||
form.initFormFields(this.state.conditions);
|
||||
});
|
||||
});
|
||||
};
|
||||
save = () => {
|
||||
const { salaryBillToken } = this.props;
|
||||
form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = { ...form.getFormParams() };
|
||||
API.doSecondAuth({ ...payload, mouldCode: "HRM", itemCode: "SALARY" }, salaryBillToken)
|
||||
.then(({ status, checkStatus, checkMsg }) => {
|
||||
if (status && checkStatus === "1") {
|
||||
message.success(checkMsg);
|
||||
this.props.onCancel(this.props.onSuccess);
|
||||
} else {
|
||||
message.error(checkMsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions, loading, notSetting } = this.state;
|
||||
const itemRender = {
|
||||
authCode: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
||||
{
|
||||
notSetting && <div style={{ clear: "both", paddingTop: 10 }}>
|
||||
{getLabel("111", "您还未设置二次验证密码,请先在系统中设置验证密码")}
|
||||
{/*<a href="javascript:void(0);"*/}
|
||||
{/* onClick={() => this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")}</a>*/}
|
||||
</div>
|
||||
}
|
||||
</React.Fragment>);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 550, height: notSetting ? 80 + 26 : 80 }} initLoadCss
|
||||
title={getLabel(111, "身份验证")} buttons={[
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "确认")}</Button>
|
||||
]}>
|
||||
<div className="form-dialog-layout">
|
||||
<FormInfo className="form-dialog-layout" center={false} itemRender={itemRender}
|
||||
form={form} formFields={conditions}/>
|
||||
</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CheckSecondaryVerifyDialog;
|
||||
|
||||
|
|
@ -11,10 +11,10 @@ import { salaryBillGetToken } from "../../apis/mySalaryBenefits";
|
|||
import { confirmSalaryBill, feedBackSalaryBill } from "../../apis/payroll";
|
||||
import CaptchaModal from "../../components/captchaModal";
|
||||
import PassSetDialog from "./passSetDialog";
|
||||
import PCInterfaceTokenDialog from "./PCInterfaceTokenDialog";
|
||||
import { ConfirmBtns } from "../mySalary/mySalaryView";
|
||||
import Content from "../../components/pcTemplate/content";
|
||||
import MobileTemplate from "../../components/mobileTemplate";
|
||||
import CheckSecondaryVerifyDialog from "./checkSecondaryVerifyDialog";
|
||||
import "../mySalary/index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -34,7 +34,9 @@ export default class MobilePayroll extends React.Component {
|
|||
employeeInformation: {},
|
||||
salaryTemplate: []
|
||||
},
|
||||
salaryBillToken: {}
|
||||
salaryBillToken: {},
|
||||
// 统一二次验证
|
||||
checkSecVerify: false
|
||||
};
|
||||
this.id = "";
|
||||
}
|
||||
|
|
@ -44,17 +46,37 @@ export default class MobilePayroll extends React.Component {
|
|||
this.id = getQueryString("id");
|
||||
const { mySalaryStore: { init, setMySalaryBill } } = this.props;
|
||||
setMySalaryBill({});
|
||||
// if (type !== "phone") {
|
||||
// const { data, status } = await payrollCheckType();
|
||||
// if (status && data === "PWD") {
|
||||
// init(false, () => this.getMySalaryBill(this.id));
|
||||
// } else {
|
||||
// this.setState({ captchaVisible: true });
|
||||
// }
|
||||
// }
|
||||
//统一调用token
|
||||
type !== "phone" && await this.initPC();
|
||||
type === "phone" && await this.initMobile();
|
||||
}
|
||||
|
||||
initPC = async () => {
|
||||
const { mySalaryStore: { setInitEmVerify } } = this.props;
|
||||
const params = this.getUrlkey();
|
||||
const { data } = await salaryBillGetToken({
|
||||
id: _.pick(params, ["id"]).id,
|
||||
recipient: _.pick(params, ["recipient"]).recipient,
|
||||
salaryCode: _.pick(params, ["salaryCode"]).salaryCode
|
||||
});
|
||||
this.setState({ salaryBillToken: data }, () => {
|
||||
payrollCheckType(this.state.salaryBillToken).then(({ data, status }) => {
|
||||
if (status && data === "PWD") {
|
||||
API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
|
||||
.then(({ status, isNeedSecondAuth }) => {
|
||||
if (status && isNeedSecondAuth) {
|
||||
this.setState({ checkSecVerify: true });
|
||||
} else {
|
||||
this.getMySalaryBill(getQueryString("id"));
|
||||
setInitEmVerify();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({ captchaVisible: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
initMobile = async () => {
|
||||
const { mySalaryStore: { setInitEmVerify } } = this.props;
|
||||
if (window.em) {
|
||||
|
|
@ -74,7 +96,11 @@ 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({
|
||||
id: _.pick(params, ["id"]).id,
|
||||
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 }) => {
|
||||
|
|
@ -177,7 +203,7 @@ export default class MobilePayroll extends React.Component {
|
|||
|
||||
render() {
|
||||
const { mySalaryStore: { clearLoading, pwdForm, setInitEmVerify } } = this.props;
|
||||
const { salaryBillToken, visible, captchaVisible, notSetting, pwdSetVisible } = this.state;
|
||||
const { salaryBillToken, visible, captchaVisible, notSetting, pwdSetVisible, checkSecVerify } = this.state;
|
||||
const type = getQueryString("type");
|
||||
if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return <div>
|
||||
<WeaDialog
|
||||
|
|
@ -202,15 +228,19 @@ export default class MobilePayroll extends React.Component {
|
|||
}
|
||||
</WeaDialog>
|
||||
<PassSetDialog form={pwdForm} visible={pwdSetVisible} onCancel={() => this.setState({ pwdSetVisible: false })}/>
|
||||
{/* PC端接口token验证*/}
|
||||
{type !== "phone" &&
|
||||
<PCInterfaceTokenDialog {...this.props} salaryBillToken={salaryBillToken}
|
||||
onSetSalaryBillToken={salaryBillToken => this.setState({ salaryBillToken })}
|
||||
onCaptcha={() => this.setState({ captchaVisible: true })}
|
||||
init={() => {
|
||||
setInitEmVerify();
|
||||
this.getMySalaryBill(getQueryString("id"));
|
||||
}}/>}
|
||||
{/*统一外部调用token*/}
|
||||
<CheckSecondaryVerifyDialog visible={checkSecVerify} salaryBillToken={salaryBillToken}
|
||||
onCancel={(callback) => this.setState({ checkSecVerify: false }, () => callback && callback())}
|
||||
onSuccess={() => {
|
||||
this.getMySalaryBill(getQueryString("id"));
|
||||
setInitEmVerify();
|
||||
}}/>
|
||||
{/*发送验证码*/}
|
||||
<CaptchaModal
|
||||
visible={captchaVisible} id={getQueryString("id")}
|
||||
onCancel={() => this.setState({ captchaVisible: false })}
|
||||
onConfirm={() => this.props.mySalaryStore.setInitEmVerify()}
|
||||
/>
|
||||
</div>;
|
||||
const {
|
||||
salaryTemplate, salaryGroups, employeeInformation,
|
||||
|
|
@ -249,11 +279,6 @@ export default class MobilePayroll extends React.Component {
|
|||
</div>
|
||||
</Authority>
|
||||
}
|
||||
<CaptchaModal
|
||||
visible={captchaVisible} id={getQueryString("id")}
|
||||
onCancel={() => this.setState({ captchaVisible: false })}
|
||||
onConfirm={() => this.props.mySalaryStore.setInitEmVerify()}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Index extends Component {
|
|||
<span>{moment(it.sendTime).format("YYYY-MM")}</span>
|
||||
</div>
|
||||
<a
|
||||
href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=${it.id}&recipient=${it.employeeId}&type=phone`}
|
||||
href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=${it.id}&salaryCode=${it.salaryCode}&type=phone`}
|
||||
target="_blank">
|
||||
{`${getLabel(33564, "查看")}>`}
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -599,6 +599,7 @@ export default class PayrollGrant extends React.Component {
|
|||
<WeaTab
|
||||
datas={topTab} keyParam="viewcondition" selectedKey={selectedKey} searchType={["base", "advanced"]}
|
||||
onChange={v => this.setState({ selectedKey: v }, () => {
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
getInfoList({ salarySendId: currentId, isGranted: v !== "0" });
|
||||
})}
|
||||
searchsBasePlaceHolder="请输入姓名" showSearchAd={grantListShowSearchAd} buttonsAd={adBtn}
|
||||
|
|
@ -652,7 +653,7 @@ export default class PayrollGrant extends React.Component {
|
|||
this.pageInfo = { current, pageSize };
|
||||
this.handleShowSizeChange(this.pageInfo);
|
||||
}}
|
||||
scroll={{ y: `calc(100vh - 236px)` }}
|
||||
scroll={{ y: `calc(100vh - 255px)` }}
|
||||
/> : renderLoading()
|
||||
}
|
||||
</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 || "",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -358,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,
|
||||
|
|
@ -398,7 +407,7 @@ export const salaryFilesConditions = [
|
|||
domkey: ["position"],
|
||||
fieldcol: 14,
|
||||
label: "岗位",
|
||||
lanId: 6086,
|
||||
lanId: 111,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ export const tempNormalSetConditions = [
|
|||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["theme"],
|
||||
fieldcol: 10,
|
||||
fieldcol: 8,
|
||||
label: "工资单标题",
|
||||
lanId: 543588,
|
||||
labelcol: 6,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue