Merge branch 'release/2.19.1.2501.01-个税' into custom-艾志工业-合并个税
# Conflicts: # pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js # pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js # pc4mobx/hrmSalary/pages/declareDetail/index.js # pc4mobx/hrmSalary/stores/taxAgent.js
This commit is contained in:
commit
4ebbfaa995
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -61,6 +61,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 => {
|
||||
|
|
@ -187,6 +191,18 @@ export const saveTaxMapping = 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);
|
||||
};
|
||||
//薪资账套-获取薪资账套中拓扑图数据
|
||||
export const getSalaryItemTopology = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/item/topology", 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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ export const recessionList = (params) => {
|
|||
return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params);
|
||||
};
|
||||
//查询补差列表
|
||||
export const balanceList = (params) => {
|
||||
export const balanceList = (params, ids) => {
|
||||
return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params);
|
||||
};
|
||||
//删除退差数据
|
||||
|
|
|
|||
|
|
@ -134,3 +134,23 @@ export const getSalaryListSum = (params) => {
|
|||
export const exportSalaryList = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/report/statistics/employee/exportSalaryList", params);
|
||||
};
|
||||
//薪酬统计报表-保存全局自定义列配置
|
||||
export const savePageListSetting = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/common/pageList/save/setting", params);
|
||||
};
|
||||
//薪酬统计报表-保存页面模板
|
||||
export const savePageListTemplate = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/common/pageList/template/save", params);
|
||||
};
|
||||
//薪酬统计报表-获取页面模板
|
||||
export const getPageListTemplatelist = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/common/pageList/template/list", params);
|
||||
};
|
||||
//薪酬统计报表-切换个体页面模板
|
||||
export const changePageListTemplate = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/common/pageList/template/change", params);
|
||||
};
|
||||
//薪酬统计报表-删除模板
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
import { WeaTools } from "ecCom";
|
||||
import { postExportFetch, postFetch } from "../util/request";
|
||||
|
||||
//浮动薪酬项目列表
|
||||
export const getVariableSalaryItemList = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalaryItem/listPage", params);
|
||||
};
|
||||
//删除浮动薪酬项目
|
||||
export const deleteVariableSalaryItem = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalaryItem/delete", params);
|
||||
};
|
||||
//获取浮动薪酬项目详情
|
||||
export const getVariableSalaryItemDetail = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalaryItem/getDetail", params);
|
||||
};
|
||||
//保存/更新 浮动薪酬项目
|
||||
export const saveVariableSalaryItem = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalaryItem/save", params);
|
||||
};
|
||||
|
||||
//创建浮动薪酬档案时获取项目信息
|
||||
export const getCreateForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/getCreateForm", params);
|
||||
};
|
||||
//创建浮动薪酬档案
|
||||
export const createVariableSalary = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/createData", params);
|
||||
};
|
||||
//创建浮动薪酬档案
|
||||
export const getVariableSalaryList = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/list", params);
|
||||
};
|
||||
//导入浮动薪酬档案
|
||||
export const importVariableSalary = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/importData", params);
|
||||
};
|
||||
//删除浮动薪酬档案
|
||||
export const deleteVariableSalary = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/deleteSelectData", params);
|
||||
};
|
||||
//获取浮动薪酬档案明细
|
||||
export const getVariableSalaryDetail = params => {
|
||||
return postFetch("/api/bs/hrmsalary/variableSalary/getDetail", params);
|
||||
};
|
||||
// 获取当前管理员下的所有的个税扣缴义务人
|
||||
export const getAdminTaxAgentList = () => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare: false });
|
||||
};
|
||||
// 浮动薪酬档案导出
|
||||
export const exportVariableSalary = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/variableSalary/export", params);
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 单选
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/3
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import AssociativeSearchMult from "./associativeSearchMult";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class AssociativeSearchSingle extends Component {
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<AssociativeSearchMult {...this.props}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AssociativeSearchSingle;
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 多选
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/29
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Button, Icon, Select } from "antd";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import classNames from "classnames";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const Option = Select.Option;
|
||||
|
||||
class AssociativeSearchMult extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, data: [], activeKey: "", dropdownWidth: 200
|
||||
};
|
||||
this.selectedData = {};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { dropdownWidth } = this.state;
|
||||
const w = $(this.refs.searchWrapperMui).outerWidth();
|
||||
if (dropdownWidth < w) {
|
||||
this.setState({ dropdownWidth: w });
|
||||
}
|
||||
}
|
||||
|
||||
handleSearch = (value) => {
|
||||
this.setState({ loading: true });
|
||||
this.getData(value);
|
||||
};
|
||||
getData = (name = "") => {
|
||||
const { browserConditionParam } = this.props;
|
||||
const {
|
||||
completeURL, filterByName, searchParamsKey, convertDatasource, dataParams = {}
|
||||
} = browserConditionParam;
|
||||
if (_.trim(name)) {
|
||||
let payload = { ...dataParams };
|
||||
searchParamsKey && (payload = { ...payload, [searchParamsKey]: name, current: 1, pageSize: 9999 });
|
||||
postFetch(completeURL, payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status && data.list) {
|
||||
this.setState({
|
||||
data: convertDatasource ? convertDatasource(data.list) : data.list,
|
||||
activeKey: this.getActiveKey(convertDatasource ? convertDatasource(data.list) : data.list)
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
data: filterByName ? _.filter(_.map(data, o => ({
|
||||
...o, id: String(o.id), name: o.name
|
||||
})), k => k.name.indexOf(name) !== -1) : _.map(data, o => ({ ...o, id: String(o.id), name: o.name })),
|
||||
activeKey: this.getActiveKey(data)
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({ data: [], loading: false, activeKey: "" });
|
||||
}
|
||||
};
|
||||
getActiveKey = (data) => {
|
||||
const { selectedValues = [] } = this.props;
|
||||
let v = "";
|
||||
if (data && data.length > 0) {
|
||||
let target = data.filter((d) => selectedValues.indexOf(d.id) === -1);
|
||||
if (!_.isEmpty(target)) v = String(target[0].id);
|
||||
}
|
||||
return v;
|
||||
};
|
||||
getItemById = (id) => {
|
||||
const { data } = this.state, { datas } = this.props;
|
||||
if (datas[id]) return datas[id];
|
||||
if (!_.isEmpty(data)) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (id === data[i].id) return data[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
handleChange = (values) => {
|
||||
this.selectedData = {};
|
||||
values.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
this.props.onChange && this.props.onChange(values, this.selectedData);
|
||||
this.setState({ activeKey: "" });
|
||||
};
|
||||
handleBlur = () => this.setState({ data: [], activeKey: "" });
|
||||
handleClick = (e) => {
|
||||
e && e.preventDefault();
|
||||
const { datas, selectedValues } = this.props;
|
||||
if (this.props.clickCallback) this.props.clickCallback(selectedValues, datas);
|
||||
};
|
||||
isReadOnly = () => {
|
||||
const { viewAttr } = this.props;
|
||||
return viewAttr === 1 || viewAttr === "1";
|
||||
};
|
||||
|
||||
render() {
|
||||
const { data, dropdownWidth } = this.state;
|
||||
const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {} } = this.props;
|
||||
const clsname = classNames({
|
||||
"required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues),
|
||||
"mr12": viewAttr === "3" && _.isEmpty(selectedValues),
|
||||
"wea-associative-single": (isSingle || browserConditionParam.isSingle),
|
||||
"wea-associative-search-mult": !(isSingle || browserConditionParam.isSingle)
|
||||
});
|
||||
if (this.isReadOnly()) {
|
||||
let arr = [];
|
||||
selectedValues && selectedValues.map(v => {
|
||||
let item = datas[v].name;
|
||||
if (_.isString(item)) {
|
||||
arr.push(<a className="child-item wdb">{item}</a>);
|
||||
} else {
|
||||
arr.push(<a className="child-item wdb" dangerouslySetInnerHTML={{ __html: item }}> </a>);
|
||||
}
|
||||
});
|
||||
return (
|
||||
<span className={`wea-associative-search wea-field-readonly ${clsname} `} ref="searchWrapperMui">{arr}</span>
|
||||
);
|
||||
}
|
||||
let options = data.map(d => <Option key={d.id} title={d.name}>{d.name}</Option>);
|
||||
selectedValues && selectedValues.map((v) => {
|
||||
v && options.unshift(<Option key={v} title={datas[v].name}>{datas[v].name}</Option>);
|
||||
});
|
||||
const select = <Select
|
||||
{...this.props}
|
||||
hasScroll={false}
|
||||
hideSelected={true}
|
||||
transitionName=""
|
||||
animation=""
|
||||
multiple={true}
|
||||
notFoundContent=""
|
||||
defaultActiveFirstOption={true}
|
||||
showArrow={false}
|
||||
filterOption={false}
|
||||
defaultValue={selectedValues}
|
||||
value={selectedValues}
|
||||
dropdownStyle={{ minWidth: dropdownWidth }}
|
||||
onSearch={_.debounce(this.handleSearch, 400)}
|
||||
onChange={this.handleChange}
|
||||
onBlur={this.handleBlur}
|
||||
>
|
||||
{options}
|
||||
</Select>;
|
||||
return (
|
||||
<div className={`wea-associative-search ${clsname}`} ref="searchWrapperMui">
|
||||
{select}
|
||||
<Icon type="loading" style={{ display: this.state.loading ? "block" : "none" }}/>
|
||||
<div className="ant-input-group-wrap">
|
||||
<Button type="ghost" icon="search" onClick={this.handleClick}/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AssociativeSearchMult;
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* 自定义组件
|
||||
* 下拉树选择框
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { TreeSelect } from "antd";
|
||||
import classNames from "classnames";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class AssociativeTreeMult extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
data: []
|
||||
};
|
||||
this.selectedData = {};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { treeData } = this.props;
|
||||
this.setState({ data: this.filterTree(treeData) });
|
||||
}
|
||||
|
||||
handleChange = (values) => {
|
||||
this.selectedData = {};
|
||||
values.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
this.props.onChange && this.props.onChange(values, this.selectedData);
|
||||
};
|
||||
getItemById = (id) => {
|
||||
const { data } = this.state, { datas } = this.props;
|
||||
if (datas[id]) return datas[id];
|
||||
if (!_.isEmpty(data)) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (id === data[i].id) return data[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
filterTree = (nodes) => {
|
||||
const selectableNodes = [];
|
||||
const recurse = (nodes) => {
|
||||
nodes.forEach((node) => {
|
||||
if (node.selectable) selectableNodes.push(node);
|
||||
if (node.children) recurse(node.children);
|
||||
});
|
||||
};
|
||||
recurse(nodes);
|
||||
return selectableNodes;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { viewAttr, selectedValues, datas, isSingle, treeData } = this.props;
|
||||
const clsname = classNames({
|
||||
"required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues)
|
||||
});
|
||||
const tProps = {
|
||||
treeData,
|
||||
multiple: true,
|
||||
allowClear: false,
|
||||
treeCheckable: true,
|
||||
style: { width: "100%" },
|
||||
treeDefaultExpandAll: true,
|
||||
value: selectedValues,
|
||||
onChange: this.handleChange,
|
||||
dropdownMatchSelectWidth: true,
|
||||
dropdownStyle: { minWidth: 200, maxHeight: 280, overflowY: "auto" },
|
||||
getPopupContainer: (triggerNode) => triggerNode.parentNode
|
||||
};
|
||||
return (
|
||||
<span className={`${clsname}`} ref="treeSelectWrapperMui"><TreeSelect {...tProps} /></span>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AssociativeTreeMult;
|
||||
|
|
@ -0,0 +1,299 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 弹框选择
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable, WeaTransfer } from "ecCom";
|
||||
import { Button, Col, Row, Spin } from "antd";
|
||||
import CustomBrowserMutiLeft from "./customBrowserMutiLeft";
|
||||
import CustomBrowserMutiRight from "./customBrowserMutiRight";
|
||||
import CustomBrowserOperation from "./customBrowserOperation";
|
||||
import { postFetch } from "../../../util/request";
|
||||
|
||||
const WeaTransferList = WeaTransfer.list;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class CustomBrowserDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [],
|
||||
query: { [props.searchParamsKey]: "" }, singleFilterVal: "",
|
||||
leftListSelectedKeys: [], // 左侧table选择的keys
|
||||
leftListSelectedData: [], // 左侧table选择的数据
|
||||
rightCheckedKeys: [], //右侧选择的keys
|
||||
rightDatas: [] // 右侧展示的数据
|
||||
};
|
||||
this.selectedData = {};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.getData();
|
||||
this.setState({
|
||||
selectedRowKeys: nextProps.selectedValues,
|
||||
leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas)
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, query: { [this.props.searchParamsKey]: "" },
|
||||
rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: []
|
||||
});
|
||||
this.selectedData = {};
|
||||
}
|
||||
}
|
||||
|
||||
getData = () => {
|
||||
const { pageInfo, query } = this.state;
|
||||
const { dialogType, completeURL, convertDatasource, dataParams = {} } = this.props;
|
||||
let payload = { ...dataParams, ...query };
|
||||
dialogType === "table" && (payload = { ...pageInfo, ...payload, ...query });
|
||||
this.setState({ loading: true });
|
||||
postFetch(completeURL, payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status && data.list) {
|
||||
const { pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
listDatas: convertDatasource ? convertDatasource(data.list) : data.list,
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
} else {
|
||||
this.setState({ listDatas: _.map(data, o => ({ ...o, id: String(o.id) })) });
|
||||
}
|
||||
});
|
||||
};
|
||||
handleRowClick = record => {
|
||||
if (!this.props.isSingle) return;
|
||||
const values = [record.id];
|
||||
const selectedData = { [record["id"]]: record };
|
||||
this.props.onCancel();
|
||||
this.props.onChange && this.props.onChange(values, selectedData);
|
||||
};
|
||||
handleClear = () => {
|
||||
this.props.onCancel();
|
||||
this.props.onChange && this.props.onChange([], {});
|
||||
};
|
||||
handleOk = () => {
|
||||
const { selectedRowKeys, rightDatas } = this.state, { dialogType } = this.props;
|
||||
const convertSelectedRowKeys = dialogType !== "table" ? rightDatas.map((v) => v.id) : selectedRowKeys;
|
||||
convertSelectedRowKeys.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData);
|
||||
this.props.onCancel && this.props.onCancel();
|
||||
};
|
||||
getItemById = (id) => {
|
||||
const { listDatas } = this.state;
|
||||
if (this.selectedData[id]) return this.selectedData[id];
|
||||
if (!_.isEmpty(listDatas)) {
|
||||
for (let i = 0; i < listDatas.length; i++) {
|
||||
if (String(id) === String(listDatas[i].id)) return listDatas[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
onLeftListCheck = (keys, datas) => {
|
||||
const { leftListSelectedData } = this.state;
|
||||
let targets = leftListSelectedData.concat(datas);
|
||||
targets = _.uniqBy(targets, "id");
|
||||
targets = targets.filter((t) => keys.indexOf(t["id"]) > -1);
|
||||
this.setState({ leftListSelectedKeys: keys, leftListSelectedData: targets });
|
||||
};
|
||||
onleftDoubleClick = (data) => {
|
||||
const { rightDatas } = this.state;
|
||||
this.setState({
|
||||
rightDatas: rightDatas.concat(data),
|
||||
rightCheckedKeys: [],
|
||||
leftListSelectedData: [],
|
||||
leftListSelectedKeys: []
|
||||
});
|
||||
};
|
||||
onRightDoubleClick = (key) => {
|
||||
const { rightDatas } = this.state;
|
||||
const newRightDatas = rightDatas.filter(item => String(item.id) !== key);
|
||||
this.setState({ rightDatas: newRightDatas, rightCheckedKeys: [] });
|
||||
};
|
||||
moveTo = (direction) => {
|
||||
const { rightDatas, rightCheckedKeys, listDatas, leftListSelectedData } = this.state;
|
||||
if (direction === "right") {
|
||||
this.setState({
|
||||
rightDatas: rightDatas.concat(leftListSelectedData),
|
||||
leftListSelectedData: [],
|
||||
leftListSelectedKeys: []
|
||||
});
|
||||
} else if (direction === "left") {
|
||||
this.setState({
|
||||
rightDatas: rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => String(item.id) === checkedKey)),
|
||||
rightCheckedKeys: []
|
||||
});
|
||||
} else if (direction === "allToLeft") {
|
||||
this.setState({ rightDatas: [], rightCheckedKeys: [] });
|
||||
} else if (direction === "allToRight") {
|
||||
if (this.leftListAllActive()) {
|
||||
this.setState({
|
||||
rightDatas: rightDatas.concat(listDatas),
|
||||
rightCheckedKeys: [],
|
||||
leftListSelectedData: [],
|
||||
leftListSelectedKeys: []
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
leftListAllActive = () => {
|
||||
const { rightDatas, listDatas } = this.state;
|
||||
let bool = true;
|
||||
if (_.isEmpty(listDatas)) bool = false;
|
||||
if (!_.isEmpty(listDatas) && !_.isEmpty(rightDatas)) {
|
||||
bool = listDatas.filter((l) => !rightDatas.some(r => l.id === r.id)).length !== 0;
|
||||
}
|
||||
return bool;
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { dialogType, searchParamsKey, isSingle } = this.props, {
|
||||
query, pageInfo, selectedRowKeys, singleFilterVal
|
||||
} = this.state;
|
||||
return (<div className="wea-hr-muti-dialog-title">
|
||||
<span>{getLabel(111, "数据选择")}</span>
|
||||
{
|
||||
dialogType === "table" ?
|
||||
<WeaInputSearch
|
||||
value={query[searchParamsKey]} style={{ width: 220 }}
|
||||
onChange={value => this.setState({ query: { ...query, [searchParamsKey]: value } })}
|
||||
onSearch={() => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => {
|
||||
this.getData();
|
||||
selectedRowKeys.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
});
|
||||
}}/> : isSingle ?
|
||||
<WeaInputSearch value={singleFilterVal} onChange={singleFilterVal => this.setState({ singleFilterVal })}/> :
|
||||
<div/>
|
||||
}
|
||||
</div>);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
loading, listDatas, pageInfo, selectedRowKeys, query, leftListSelectedKeys, rightDatas, rightCheckedKeys,
|
||||
singleFilterVal
|
||||
} = this.state;
|
||||
const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props;
|
||||
const sheight = this.dialog ? this.dialog.state.height - 116 : 260;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={this.handleOk}
|
||||
disabled={dialogType !== "table" && _.isEmpty(rightDatas)}>{getLabel(111, "确 定")}</Button>,
|
||||
<Button type="ghost" onClick={this.handleClear}>{getLabel(111, "清 除")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>];
|
||||
let rightActive = false, leftActive = false, rightAllActive = false;
|
||||
if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true;
|
||||
if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true;
|
||||
if (rightDatas && rightDatas.length > 0) rightAllActive = true;
|
||||
let dom = <Spin spinning={loading}>
|
||||
<div className="wea-hr-muti-dialog">
|
||||
{
|
||||
!isSingle ? <React.Fragment>
|
||||
<div className="wea-hr-muti-input-left">
|
||||
<Row style={{ height: 35 }}>
|
||||
<Col span="24">
|
||||
<WeaInputSearch value={query[searchParamsKey]} onSearch={this.getData}
|
||||
onChange={value => this.setState({ query: { ...query, [searchParamsKey]: value } })}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<div>
|
||||
<WeaNewScroll height={this.dialog ? this.dialog.state.height - 51 : 260}>
|
||||
<CustomBrowserMutiLeft
|
||||
filterData={rightDatas}
|
||||
datas={listDatas}
|
||||
onDoubleClick={this.onleftDoubleClick}
|
||||
onClick={this.onLeftListCheck}
|
||||
selectedKeys={leftListSelectedKeys}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</div>
|
||||
<div className="wea-transfer-opration">
|
||||
<CustomBrowserOperation
|
||||
rightActive={rightActive}
|
||||
leftActive={leftActive}
|
||||
leftAllActive={this.leftListAllActive()}
|
||||
rightAllActive={rightAllActive}
|
||||
moveToRight={() => this.moveTo("right")}
|
||||
moveToLeft={() => this.moveTo("left")}
|
||||
moveAllToRight={() => this.moveTo("allToRight")}
|
||||
moveAllToLeft={() => this.moveTo("allToLeft")}
|
||||
/>
|
||||
</div>
|
||||
<div className="wea-hr-muti-input-right">
|
||||
<CustomBrowserMutiRight
|
||||
height={this.dialog ? this.dialog.state.height - 51 : 260}
|
||||
data={rightDatas} checkedKeys={rightCheckedKeys}
|
||||
checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })}
|
||||
onDoubleClick={this.onRightDoubleClick}
|
||||
/>
|
||||
</div>
|
||||
</React.Fragment> :
|
||||
<WeaTransferList height={this.dialog ? this.dialog.state.height - 16 : 260} checkedKeys={[]}
|
||||
checkedCb={([id]) => this.handleRowClick(_.find(listDatas, item => item.id === id))}
|
||||
data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/>
|
||||
}
|
||||
</div>
|
||||
</Spin>;
|
||||
if (dialogType === "table") {
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => {
|
||||
this.getData();
|
||||
selectedRowKeys.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
});
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => {
|
||||
this.getData();
|
||||
selectedRowKeys.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: selectedRowKeys => this.setState({ selectedRowKeys })
|
||||
};
|
||||
dom = <div className="wea-hr-muti-input-table">
|
||||
<WeaTable dataSource={listDatas} loading={loading} pagination={pagination} scroll={{ y: sheight }}
|
||||
onRowClick={this.handleRowClick} rowSelection={!isSingle ? rowSelection : null}
|
||||
rowKey={rowKey || "id"} columns={columns}/>
|
||||
</div>;
|
||||
}
|
||||
dialogType === "table" && isSingle && buttons.splice(0, 1);
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={this.renderTitle()}
|
||||
className="custom_browser_dialog" draggable={false} style={{
|
||||
width: 784, height: 460, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}} buttons={buttons}>{dom}</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CustomBrowserDialog;
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 选择框左边
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
let timeout = null;
|
||||
|
||||
class CustomBrowserMutiLeft extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.dataObj = {};
|
||||
}
|
||||
|
||||
onClick = (data) => {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(() => {
|
||||
let { selectedKeys } = this.props;
|
||||
let keys = selectedKeys ? [...selectedKeys] : [];
|
||||
let datas = [];
|
||||
if (keys.indexOf(data.id) > -1) {
|
||||
keys = keys.filter((k) => k !== data.id);
|
||||
} else {
|
||||
keys.push(data.id);
|
||||
}
|
||||
keys.forEach((k) => this.dataObj[k] && datas.push(this.dataObj[k]));
|
||||
this.props.onClick && this.props.onClick(keys, datas);
|
||||
}, 200);
|
||||
};
|
||||
onDoubleClick = (data) => {
|
||||
clearTimeout(timeout);
|
||||
this.props.onDoubleClick && this.props.onDoubleClick([data]);
|
||||
};
|
||||
cls = (item) => {
|
||||
const { selectedKeys, filterData } = this.props;
|
||||
let cls = [];
|
||||
if (selectedKeys && selectedKeys.indexOf(item.id) > -1) {
|
||||
cls.push("selected");
|
||||
}
|
||||
if (filterData && filterData.filter((d) => d.id === item.id).length > 0) {
|
||||
cls.push("hide");
|
||||
}
|
||||
return cls.join(" ");
|
||||
};
|
||||
|
||||
render() {
|
||||
const { datas, selectedKeys } = this.props;
|
||||
const list = datas.map(item => {
|
||||
this.dataObj[item.id] = item;
|
||||
return <li className={this.cls(item)} onClick={() => this.onClick(item)}
|
||||
onDoubleClick={() => this.onDoubleClick(item)}>
|
||||
<div className="item-wrap" style={{ fontSize: 12 }}> {item.name} </div>
|
||||
<div className="icon-wrap"/>
|
||||
<i className="icon-coms-Selected"/>
|
||||
</li>;
|
||||
});
|
||||
return (
|
||||
<div className="wea-crm-list">
|
||||
<ul className="wea-crm-list-wrapper">
|
||||
{list}
|
||||
</ul>
|
||||
{
|
||||
list.length === 0 &&
|
||||
<div className="empty-tip" style={{ color: "#2f2929", paddingTop: 30, textAlign: "center" }}>
|
||||
{getLabel(111, "没有可显示的数据")}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CustomBrowserMutiLeft;
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 选择框右边
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom";
|
||||
import { Tree } from "antd";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const TreeNode = Tree.TreeNode;
|
||||
|
||||
let timeout = null;
|
||||
|
||||
class CustomBrowserMutiRight extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
key: ""
|
||||
};
|
||||
this.nodeIds = [];
|
||||
this.nodeObj = {};
|
||||
}
|
||||
|
||||
generateTreeNodes = () => {
|
||||
const { data } = this.props, { key } = this.state;
|
||||
const treeNodes = [];
|
||||
let showData = [...data];
|
||||
if (_.trim(key)) {
|
||||
showData = showData.filter((item) => {
|
||||
return item.name.indexOf(_.trim(key)) > -1;
|
||||
});
|
||||
}
|
||||
showData = _.uniqBy(showData, "id");
|
||||
this.nodeIds = [];
|
||||
this.nodeObj = {};
|
||||
showData.map((item) => {
|
||||
let title = (
|
||||
<div>
|
||||
<div className="item-wrap" style={{ whiteSpace: "normal" }}>
|
||||
<div className="item-top">
|
||||
<span style={{ marginRight: "5px" }}>{item.name}</span>
|
||||
</div>
|
||||
<div className="item-bottom"></div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
treeNodes.push(<TreeNode title={title} key={item["id"]} isLeaf={true}/>);
|
||||
this.nodeIds.push(item["id"]);
|
||||
this.nodeObj[item["id"]] = item;
|
||||
});
|
||||
return treeNodes;
|
||||
};
|
||||
handleSearchChange = (v) => this.setState({ key: v });
|
||||
checkHandler = (v) => {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(() => {
|
||||
this.props.checkedCb && this.props.checkedCb(v);
|
||||
}, 200);
|
||||
};
|
||||
onDoubleClick = (key) => {
|
||||
clearTimeout(timeout);
|
||||
this.props.onDoubleClick && this.props.onDoubleClick(key);
|
||||
};
|
||||
onDragStart = (obj) => {
|
||||
clearTimeout(timeout);
|
||||
this.props.checkedCb && this.props.checkedCb([]);
|
||||
};
|
||||
onDrop = (obj) => {
|
||||
const dragNodes = obj.dragNodesKeys;
|
||||
const targetNode = obj.node.props.eventKey;
|
||||
const result = [];
|
||||
this.nodeIds.filter((item) => {
|
||||
return dragNodes.indexOf(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>),
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,71 +61,18 @@ import ExternalPersonManage from "./pages/externalPersonManage";
|
|||
import AdjustSalaryManage from "./pages/adjustSalaryManage";
|
||||
import TopologyMap from "./pages/topologyMap";
|
||||
import SupplementaryCalc from "./pages/supplementaryCalc";
|
||||
import VariableSalary from "./pages/variableSalary";
|
||||
import Layout from "./layout";
|
||||
|
||||
import stores from "./stores";
|
||||
import "./style/index";
|
||||
|
||||
// 读取系统多语言配置
|
||||
let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, "hrmSalary");
|
||||
|
||||
// 不需要读取系统多语言
|
||||
getLocaleLabel = function (nextState, replace, callback) {
|
||||
callback();
|
||||
};
|
||||
|
||||
const Home = (props) => props.children;
|
||||
|
||||
const SocialSecurityBenefits = (props) => props.children;
|
||||
const DataAcquisition = (props) => props.children;
|
||||
|
||||
// historicalPayroll 历史工资单查看
|
||||
// salaryAdjustmentRecords 调薪记录查看
|
||||
|
||||
// mySalaryMobile 我的薪资福利-移动端
|
||||
// mySalaryMobile 我的薪资福利-移动端
|
||||
// mySalary 我的薪资福利
|
||||
// mySalaryView 我的薪资福利-查看工资单
|
||||
// socialSecurityBenefits 社保福利
|
||||
// programme 社保福利方案
|
||||
// archives 社保福利档案
|
||||
// standingBook 社保福利台账
|
||||
// sbofflineComparison 社保福利台账线下对比
|
||||
// salaryItem 薪资项目管理
|
||||
// salaryFile 薪资档案
|
||||
// dataAcquisition 数据采集
|
||||
// CumDeduct 累计专项附加扣除
|
||||
// otherDeduct 其他免税扣除
|
||||
// cumSituation 往期累计情况
|
||||
// attendance 考勤引用
|
||||
// specialAddDeduction 专项附件扣除
|
||||
// ledger 薪资账套
|
||||
// calculate 薪资核算
|
||||
// calculateDetail 核算详情
|
||||
// DoCalcDetail 核算详情页面-新
|
||||
// CalcView 核算查看页面-新
|
||||
// OfflineCompare 薪资核算线下对比-新
|
||||
// placeOnFileDetail 核算归档详情
|
||||
// compareDetail 线下线上对比
|
||||
// payroll 工资单发放
|
||||
// declare 个税申报表
|
||||
// generateDeclarationDetail 个税单详情
|
||||
// taxRate 个税税率表
|
||||
// taxAgent 个税扣缴义务人
|
||||
// mobilepayroll 移动端工资单
|
||||
// sysconfig 系統配置
|
||||
// sysconfig-1 规则配置
|
||||
// appconfig 应用配置
|
||||
// fieldManagement 字段管理
|
||||
// analysisOfSalaryStatistics 薪酬统计分析
|
||||
// reportView 薪酬报表查看
|
||||
// externalPersonManage 非系统人员管理
|
||||
// adjustSalaryManage 档案管理
|
||||
// supplementaryCalc 补算
|
||||
// employeedeclare 人员信息报送
|
||||
// employeedeclareDetail 人员信息报送详情
|
||||
// intelligentCalculateSalarySettings 智能算薪
|
||||
|
||||
const Routes = (
|
||||
<Route key="hrmSalary" path="hrmSalary" onEnter={getLocaleLabel} component={Layout}>
|
||||
<Route key="historicalPayroll" path="historicalPayroll" component={HistoricalPayroll}/>
|
||||
|
|
@ -194,6 +141,7 @@ const Routes = (
|
|||
<Route key="externalPersonManage" path="externalPersonManage" component={ExternalPersonManage}/>
|
||||
<Route key="topologyView" path="topologyView/:salarySobId/:salaryItemId" component={TopologyMap}/>
|
||||
<Route key="supplementaryCalc" path="supplementaryCalc" component={SupplementaryCalc}/>
|
||||
<Route key="variableSalary" path="variableSalary" component={VariableSalary}/>
|
||||
</Route>
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,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 +42,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;
|
||||
|
|
@ -219,3 +218,47 @@ export const salaryDetailSearchConditions = [
|
|||
col: 2
|
||||
}
|
||||
];
|
||||
export const tempCondition = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["name"],
|
||||
fieldcol: 14,
|
||||
label: "模板名称",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["sharedType"],
|
||||
fieldcol: 14,
|
||||
label: "可见性",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
options: [],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["limitIds"],
|
||||
fieldcol: 14,
|
||||
label: "可见性范围",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
options: [],
|
||||
detailtype: 3,
|
||||
multiple: true,
|
||||
rules: "",
|
||||
viewAttr: 1,
|
||||
hide: true
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class EmployeeDetails extends Component {
|
|||
pagination={pagination}
|
||||
loading={loading}
|
||||
columns={columns}
|
||||
scroll={{ y: `calc(100vh - 174px)` }}
|
||||
scroll={{ y: `calc(100vh - 182px)` }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Date: 2023/4/17
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { WeaAlertPage, WeaLocaleProvider } from "ecCom";
|
||||
import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd";
|
||||
import {
|
||||
reportStatisticsReportDelete,
|
||||
|
|
@ -14,7 +14,6 @@ import {
|
|||
} from "../../../apis/statistics";
|
||||
import "../index.less";
|
||||
|
||||
const SubMenu = Menu.SubMenu;
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
class ReportList extends Component {
|
||||
|
|
@ -87,7 +86,9 @@ class ReportList extends Component {
|
|||
return (
|
||||
<Row gutter={16} className="reportRow">
|
||||
{
|
||||
_.isEmpty(dataSource) ? <div className="empty">{getLabel(83553, "暂无数据")}</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,31 @@ 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: [], 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 +65,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,10 +106,10 @@ class SalaryDetails extends Component {
|
|||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getSalaryList = (props) => {
|
||||
const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props;
|
||||
const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props || this.props;
|
||||
const [startDateStr, endDateStr] = dateRange;
|
||||
const { taxAgentIds, subcompanyIds, departmentIds, ...extra } = salaryDetailSearchForm.getFormParams();
|
||||
const { pageInfo } = this.state;
|
||||
const { pageInfo, transferDialog, updateSum } = this.state;
|
||||
const payload = {
|
||||
taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [],
|
||||
departmentIds: departmentIds ? departmentIds.split(",") : [],
|
||||
|
|
@ -84,45 +117,55 @@ class SalaryDetails extends Component {
|
|||
...extra, ...pageInfo, startDateStr, endDateStr
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
API.getSalaryList(payload).then(async ({ status, data }) => {
|
||||
// API.getSalaryListSum(payload),
|
||||
const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]);
|
||||
API.getSalaryList(payload).then(({ status, data }) => {
|
||||
if (updateSum) this.getSalaryListSum(payload);
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { dataKey, pageInfo: pageparams } = data;
|
||||
const { columns, dataKey, pageInfo: pageparams } = data;
|
||||
const { list: dataSource, pageNum: current, total, pageSize } = pageparams;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload,
|
||||
showTotalCell: confCode === "1"
|
||||
}, () => 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 +173,156 @@ 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;
|
||||
this.setState({
|
||||
tempDialog: {
|
||||
...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id)
|
||||
// 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: [] }
|
||||
}, () => 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,127 @@
|
|||
/*
|
||||
* 薪酬统计分析-薪资明细
|
||||
* 列表模板设置
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/11/7
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { tempCondition } from "./conditions";
|
||||
import { getTaxAgentSelectList } from "../../../apis/taxAgent";
|
||||
import * as API from "../../../apis/statistics";
|
||||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../util";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("attendanceStore")
|
||||
@observer
|
||||
class SalaryDetailTempDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, conditions: []
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTempForm(nextProps);
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.setState({ loading: false, conditions: [] }, () => nextProps.attendanceStore.initTempForm());
|
||||
}
|
||||
}
|
||||
|
||||
getTempForm = (props) => {
|
||||
getTaxAgentSelectList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { id, template } = props;
|
||||
this.setState({
|
||||
conditions: _.map(tempCondition, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "sharedType") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label), value: id ? String(template["sharedType"]) : "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 }))
|
||||
};
|
||||
}
|
||||
return { ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "" };
|
||||
})
|
||||
}))
|
||||
}, () => {
|
||||
const { attendanceStore: { tempForm } } = props;
|
||||
tempForm.initFormFields(this.state.conditions);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
save = () => {
|
||||
const { attendanceStore: { tempForm }, setting, id } = this.props;
|
||||
tempForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.setState({ loading: true });
|
||||
const { limitIds, ...formVal } = tempForm.getFormParams();
|
||||
const payload = {
|
||||
page: "salary_details_report", setting, id, ...formVal,
|
||||
limitIds: !_.isEmpty(limitIds) ? limitIds.split(",") : []
|
||||
};
|
||||
API.savePageListTemplate(payload).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.props.onCancel(this.props.onSuccess());
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
formFieldChange = (field) => {
|
||||
const key = Object.keys(field)[0], value = field[key].value;
|
||||
this.setState({
|
||||
conditions: _.map(this.state.conditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (key === "sharedType" && getKey(o) === "limitIds") {
|
||||
return {
|
||||
...o, hide: value !== "0", viewAttr: value === "0" ? 3 : 1,
|
||||
rules: value === "0" ? "required|string" : ""
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
}))
|
||||
}, () => {
|
||||
const { attendanceStore: { tempForm } } = this.props;
|
||||
tempForm.initFormFields(this.state.conditions);
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, conditions } = this.state;
|
||||
const { attendanceStore: { tempForm } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 127 }} initLoadCss title={getLabel(111, "模板保存")}
|
||||
buttons={[<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>]}>
|
||||
<div className="form-dialog-layout">{getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryDetailTempDialog;
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* 薪酬报表-薪酬明细
|
||||
* 模板管理新增编辑弹框
|
||||
* @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;
|
||||
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)}>{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: [], 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 = []) => {
|
||||
this.setState({
|
||||
tempDialog: {
|
||||
visible: true, setting, 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: [] }
|
||||
}, () => 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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%;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -242,18 +264,26 @@ class Index extends Component {
|
|||
<BaseInfo {...this.props}/>
|
||||
<WeaTab
|
||||
datas={tabDatas} keyParam="viewcondition" selectedKey={selectedKey}
|
||||
onChange={v => this.setState({ selectedKey: v }, () => this.queryPCList())}
|
||||
onChange={v => this.setState({
|
||||
selectedKey: v,
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.queryPCList())}
|
||||
onSearch={v => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.queryPCList())}
|
||||
onAdSearch={v => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.queryPCList())}
|
||||
buttons={this.renderTabBtns()} searchType={["base", "advanced"]} advanceHeight={220}
|
||||
showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })}
|
||||
searchsAd={getSearchs(PCSearchForm, searchConditions, 2, false)}
|
||||
onSearchChange={(v) => PCSearchForm.updateFields({ employeeName: v })}
|
||||
searchsBaseValue={PCSearchForm.getFormParams().employeeName}
|
||||
onSearch={this.queryPCList} onAdSearch={this.queryPCList}
|
||||
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
|
||||
/>
|
||||
<WeaTable
|
||||
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;
|
||||
|
|
@ -272,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 {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,12 @@ import React, { Component } from "react";
|
|||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { acctResultList, updateLockEmpStatus, updateLockStatus } from "../../../../../apis/calculate";
|
||||
import {
|
||||
acctResultList,
|
||||
updateLockEmpCellStatus,
|
||||
updateLockEmpStatus,
|
||||
updateLockStatus
|
||||
} from "../../../../../apis/calculate";
|
||||
import ProgressModal from "../../../../../components/progressModal";
|
||||
import BatchUpdateSalaryItemValDialog from "./batchUpdateSalaryItemValDialog";
|
||||
import EditSalaryCalcSlide from "./editSalaryCalcSlide";
|
||||
|
|
@ -135,7 +140,7 @@ class EditCalcTable extends Component {
|
|||
});
|
||||
};
|
||||
updateEmpLockStatus = (payload) => {
|
||||
const { lockStatus } = payload;
|
||||
const { lockStatus, salaryItemId } = payload;
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: <div>
|
||||
|
|
@ -166,13 +171,16 @@ class EditCalcTable extends Component {
|
|||
}, 500);
|
||||
});
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
updateLockEmpStatus({ ...payload, salaryAcctRecordId }).then(({ status, errormsg }) => {
|
||||
const params = salaryItemId ? payload : { ...payload, salaryAcctRecordId };
|
||||
const APIFunction = salaryItemId ? updateLockEmpCellStatus : updateLockEmpStatus;
|
||||
APIFunction(params).then(({ status, errormsg }) => {
|
||||
clearInterval(this.timerLock);
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
});
|
||||
if (status) {
|
||||
clearInterval(this.timerLock);
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
}, () => this.queryCalcResultList());
|
||||
this.queryCalcResultList();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
|
|
@ -224,8 +232,8 @@ class EditCalcTable extends Component {
|
|||
"点击锁定所有解锁的项目值": getLabel(543649, "点击锁定所有解锁的项目值"),
|
||||
"点击解锁所有锁定的项目值": getLabel(543648, "点击解锁所有锁定的项目值"),
|
||||
"锁定的项目值": getLabel(543647, "锁定的项目值"),
|
||||
"当前状态锁定,点击解锁": getLabel(111, "当前状态锁定,点击解锁"),
|
||||
"当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"),
|
||||
"当前状态锁定,右击解锁": getLabel(111, "当前状态锁定,右击解锁"),
|
||||
"当前状态未锁定,右击锁定": getLabel(111, "当前状态未锁定,右击锁定"),
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
|
||||
"批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"),
|
||||
|
|
@ -271,6 +279,9 @@ class EditCalcTable extends Component {
|
|||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleQuery = () => {
|
||||
this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } }, () => this.queryCalcResultList());
|
||||
};
|
||||
handleBatchEditing = () => {
|
||||
};
|
||||
|
||||
|
|
@ -321,7 +332,7 @@ const traverse = (arr, calcDetail) => {
|
|||
return _.map(arr, item => {
|
||||
if (!_.isEmpty(item.children)) {
|
||||
return {
|
||||
title: item.text, width: item.width + "px", ellipsis: true,
|
||||
title: item.text, width: item.width + "px", ellipsis: true, calcDetail,
|
||||
dataIndex: item.column, children: traverse(item.children, calcDetail),
|
||||
fixed: item.fixed || false, dataType: item.dataType, align: "center"
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class Index extends Component {
|
|||
|
||||
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
|
||||
onAdSearch = (bool = true) => {
|
||||
this.calcTableRef.wrappedInstance.queryCalcResultList();
|
||||
this.calcTableRef.wrappedInstance.handleQuery();
|
||||
bool && this.openAdvanceSearch();
|
||||
};
|
||||
init = async () => {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class PersonAbnormalDialog extends Component {
|
|||
<WeaDialog
|
||||
{...this.props}
|
||||
scalable hasScroll className="declareResultDialog" initLoadCss
|
||||
title={getLabel(111, "未报送人员")}
|
||||
title={getLabel(111, "未报送人员")} ref={dom => this.errorRef = dom}
|
||||
style={{
|
||||
width: 1150, height: 606.6, minHeight: 200, minWidth: 380, maxHeight: "90%",
|
||||
maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
|
|
@ -73,7 +73,7 @@ class PersonAbnormalDialog extends Component {
|
|||
<WeaTable
|
||||
columns={columns} dataSource={dataSource}
|
||||
loading={loading} className="declareTable"
|
||||
pagination={pagination}
|
||||
pagination={pagination} scroll={{ y: this.errorRef ? this.errorRef.state.height - 124 : 600 }}
|
||||
/>
|
||||
</div>
|
||||
</WeaDialog>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class Index extends Component {
|
|||
selectedKey: "person", progressVisible: false, progress: 0, loading: { calcTax: false, feedback: false },
|
||||
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
|
||||
salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" },
|
||||
approvalInfo: {},//审批信息,
|
||||
accountExceptInfo: "" //核算报错信息,
|
||||
|
||||
};
|
||||
|
|
@ -37,6 +38,12 @@ class Index extends Component {
|
|||
this.timer = null;
|
||||
}
|
||||
|
||||
init = () => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
API.getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => {
|
||||
if (status) this.setState({ approvalInfo });
|
||||
});
|
||||
};
|
||||
handleMenuClick = ({ key }) => {
|
||||
switch (key) {
|
||||
case "calc_selected":
|
||||
|
|
@ -125,6 +132,15 @@ class Index extends Component {
|
|||
case "offlineCompare":
|
||||
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calcOc/${salaryAcctRecordId}`, "_blank");
|
||||
break;
|
||||
case "LOCK":
|
||||
case "UNLOCK":
|
||||
const { selectedRowKeys } = this.calc.calcTableRef.wrappedInstance.state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(543303, "请选择表格数据!"));
|
||||
return;
|
||||
}
|
||||
this.calc.calcTableRef.wrappedInstance.updateEmpLockStatus({ lockStatus: key, acctEmpIds: selectedRowKeys });
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -193,7 +209,9 @@ class Index extends Component {
|
|||
});
|
||||
};
|
||||
renderReqBtns = () => {
|
||||
const { selectedKey, accountExceptInfo, loading } = this.state;
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { selectedKey, accountExceptInfo, approvalInfo, loading } = this.state;
|
||||
const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo;
|
||||
let reqBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "calc":
|
||||
|
|
@ -204,10 +222,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 = [
|
||||
|
|
@ -222,6 +242,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)}/>);
|
||||
|
|
@ -240,14 +264,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;
|
||||
|
|
@ -263,7 +288,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) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaBrowser, WeaFormItem } from "ecCom";
|
||||
import { getDomkes, getSearchs } from "../../util";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import { getDomkes, toDecimal_n } from "../../util";
|
||||
import FormInfo from "../../components/FormInfo";
|
||||
import "./index.less";
|
||||
|
||||
class AddItems extends Component {
|
||||
|
|
@ -60,9 +62,207 @@ class AddItems extends Component {
|
|||
|
||||
render() {
|
||||
const { form, condition = [] } = this.props;
|
||||
const itemRender = {
|
||||
// 累计专项附加扣除
|
||||
addUpChildEducation: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpChildEducation: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpContinuingEducation: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpContinuingEducation: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpHousingLoanInterest: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpHousingLoanInterest: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpHousingRent: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpHousingRent: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpSupportElderly: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpSupportElderly: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpIllnessMedical: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpIllnessMedical: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpInfantCare: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpInfantCare: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
//专项附加扣除
|
||||
childrenEducation: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ childrenEducation: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
continuingEducation: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ continuingEducation: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
housingLoanInterest: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ housingLoanInterest: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
housingRent: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ housingRent: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
supportingElder: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ supportingElder: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
seriousIllnessTreatment: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ seriousIllnessTreatment: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
infantCare: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ infantCare: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
//往期累计情况(工资、薪金)
|
||||
addUpIncome: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpIncome: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpSubtraction: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpSubtraction: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpSocialSecurityTotal: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpSocialSecurityTotal: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpAccumulationFundTotal: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpAccumulationFundTotal: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpEnterpriseAndOther: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpEnterpriseAndOther: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpOtherDeduction: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpOtherDeduction: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpTaxExemptIncome: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpTaxExemptIncome: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpAllowedDonation: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpAllowedDonation: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpTaxSavings: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpTaxSavings: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpAdvanceTax: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpAdvanceTax: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
actualAddUpAdvanceTax: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ actualAddUpAdvanceTax: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
taxAdjustment: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ taxAdjustment: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
addUpTaxableIncome: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ addUpTaxableIncome: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
// 其他免税扣除
|
||||
freeIncome: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ freeIncome: { value: toDecimal_n(v, 2) } })}/>
|
||||
{field.extraDom && field.extraDom}
|
||||
</React.Fragment>);
|
||||
},
|
||||
businessHealthyInsurance: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ businessHealthyInsurance: { value: toDecimal_n(v, 2) } })}/>
|
||||
{field.extraDom && field.extraDom}
|
||||
</React.Fragment>);
|
||||
},
|
||||
taxDelayEndowmentInsurance: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ taxDelayEndowmentInsurance: { value: toDecimal_n(v, 2) } })}/>
|
||||
{field.extraDom && field.extraDom}
|
||||
</React.Fragment>);
|
||||
},
|
||||
deductionAllowedDonation: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ deductionAllowedDonation: { value: toDecimal_n(v, 2) } })}/>
|
||||
{field.extraDom && field.extraDom}
|
||||
</React.Fragment>);
|
||||
},
|
||||
derateDeduction: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ derateDeduction: { value: toDecimal_n(v, 2) } })}/>
|
||||
{field.extraDom && field.extraDom}
|
||||
</React.Fragment>);
|
||||
},
|
||||
otherDeduction: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ otherDeduction: { value: toDecimal_n(v, 2) } })}/>
|
||||
{field.extraDom && field.extraDom}
|
||||
</React.Fragment>);
|
||||
},
|
||||
privatePension: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ privatePension: { value: toDecimal_n(v, 2) } })}/>
|
||||
{field.extraDom && field.extraDom}
|
||||
</React.Fragment>);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="addItemsWrapper">
|
||||
{getSearchs(form, condition)}
|
||||
<div className="addItemsWrapper form-dialog-layout">
|
||||
<FormInfo center={false} form={form} formFields={condition} colCount={2} custLabelCol={8}
|
||||
itemRender={itemRender}/>
|
||||
<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,8 +5,7 @@
|
|||
* Date: 2023/2/20
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaSearchGroup } from "ecCom";
|
||||
import UnifiedTable from "../../../components/UnifiedTable";
|
||||
import { WeaSearchGroup, WeaTable } from "ecCom";
|
||||
import { getTableRecordDate } from "../../../apis/cumDeduct";
|
||||
import { DataCollectionDateRangePick, DataCollectionSelect, Input } from "../cumDeduct";
|
||||
import "./index.less";
|
||||
|
|
@ -87,9 +86,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 } }));
|
||||
|
|
@ -161,14 +173,6 @@ class TableRecord extends Component {
|
|||
{
|
||||
com: Input({ value: record.username })
|
||||
},
|
||||
{
|
||||
com: DataCollectionDateRangePick({
|
||||
label: "税款所属期",
|
||||
range: recordPayload[screenParams[screenParams.length - 1]] || [],
|
||||
onChange: this.handleTablerecordScreen,
|
||||
key: screenParams[screenParams.length - 1]
|
||||
})
|
||||
},
|
||||
{
|
||||
com: DataCollectionSelect({
|
||||
label: "个税扣缴义务人",
|
||||
|
|
@ -177,28 +181,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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ export const dataCollectCondition = [
|
|||
fieldcol: 12,
|
||||
label: "税款所属期",
|
||||
lanId: 542240,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
|
|
@ -414,7 +414,7 @@ export const dataCollectCondition = [
|
|||
domkey: ["taxAgentId"],
|
||||
fieldcol: 12,
|
||||
label: "个税扣缴义务人",
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
lanId: 537996,
|
||||
value: "",
|
||||
options: [],
|
||||
|
|
@ -448,7 +448,7 @@ export const dataCollectCondition = [
|
|||
isQuickSearch: false,
|
||||
label: "人员",
|
||||
lanId: 30042,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,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";
|
||||
import SalaryCumDeductChooseTaxPeriodDialog from "./components/salaryCumDeductChooseTaxPeriodDialog";
|
||||
|
|
@ -253,6 +254,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
|
||||
};
|
||||
|
|
@ -346,7 +348,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
@ -524,11 +526,15 @@ class Index extends Component {
|
|||
|
||||
onlineFeedback = () => {
|
||||
this.setState({ feedbackLoading: true });
|
||||
onlineFeedback().then(({ status, errormsg }) => {
|
||||
onlineFeedback().then(({ status, data, errormsg }) => {
|
||||
this.setState({ feedbackLoading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "获取成功!"));
|
||||
this.tableRef.getTableDate();
|
||||
if (data.finish) {
|
||||
message.success(getLabel(111, "获取成功!"));
|
||||
this.tableRef.getTableDate();
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -321,8 +254,9 @@ export const dataCollectCondition = [
|
|||
domkey: ["taxAdjustment"],
|
||||
fieldcol: 14,
|
||||
label: "个税调差",
|
||||
helpfulTitle: "1、【个税调差】=【已缴税额】-【累计已预扣预缴税额】。\n" +
|
||||
helpfulTip: "1、【个税调差】=【已缴税额】-【累计已预扣预缴税额】。\n" +
|
||||
"2、直接输入或导入【个税调差】值,则以输入/导入为准,公式失效。再次编辑减数或被减数,会再次按公式自动计算。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
precision: 2,
|
||||
|
|
@ -337,7 +271,7 @@ export const dataCollectCondition = [
|
|||
value: "",
|
||||
precision: 2,
|
||||
viewAttr: 2
|
||||
},
|
||||
}
|
||||
|
||||
// {
|
||||
// conditionType: "INPUTNUMBER",
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import AddItems from "../addItems";
|
|||
import TableRecord from "../components/tableRecord";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import SalaryCumDeductChooseTaxPeriodDialog from "../cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog";
|
||||
import { getDomkes } from "../../../util";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
|
@ -416,7 +417,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
@ -429,6 +430,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,32 +23,28 @@
|
|||
}
|
||||
|
||||
.addItemsWrapper {
|
||||
padding-bottom: 8px;
|
||||
|
||||
.baseForm {
|
||||
.wea-form-cell {
|
||||
padding-right: 20% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-search-group {
|
||||
.wea-form-cell-wrapper {
|
||||
border: 1px solid #e5e5e5;
|
||||
.tipWrapper {
|
||||
background: #FFF;
|
||||
margin: 0 16px;
|
||||
}
|
||||
|
||||
& > div:last-child {
|
||||
border-bottom: none
|
||||
}
|
||||
.extra_tax {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
right: -20px;
|
||||
|
||||
.wea-form-cell {
|
||||
padding: 4px 16px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.wea-form-item {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
i {
|
||||
color: #2db7f5;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -57,6 +53,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 +119,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, tabBtns = [], logFunction, onClearTargrtid
|
||||
slidePayload, onClose, form, condition, onImportFile, tabBtns = [],
|
||||
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)}
|
||||
|
|
@ -112,7 +127,7 @@ class Layout extends Component {
|
|||
buttons={showOperateBtn ? tabBtns : []}
|
||||
/>
|
||||
<div className="dataContent">
|
||||
<WeaNewScroll height="100%">{children}</WeaNewScroll>
|
||||
{children}
|
||||
{/*导入弹框*/}
|
||||
<ImportModal
|
||||
visible={importVisiable} onCancel={onCancel} importParams={importFormComponent}
|
||||
|
|
@ -125,21 +140,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
|
||||
}
|
||||
|
|
@ -129,9 +62,22 @@ export const dataCollectCondition = [
|
|||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["freeIncome"],
|
||||
dataType: "freeIncome",
|
||||
fieldcol: 14,
|
||||
label: "免税收入",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
precision: 2,
|
||||
viewAttr: 2,
|
||||
extraDom: null
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["businessHealthyInsurance"],
|
||||
dataType: "healthInsurance",
|
||||
fieldcol: 14,
|
||||
label: "商业健康保险",
|
||||
labelcol: 8,
|
||||
|
|
@ -142,6 +88,7 @@ export const dataCollectCondition = [
|
|||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["taxDelayEndowmentInsurance"],
|
||||
dataType: "endowmentInsurance",
|
||||
fieldcol: 14,
|
||||
label: "税延养老保险",
|
||||
labelcol: 8,
|
||||
|
|
@ -149,19 +96,10 @@ export const dataCollectCondition = [
|
|||
precision: 2,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["otherDeduction"],
|
||||
fieldcol: 14,
|
||||
label: "其他",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
precision: 2,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["deductionAllowedDonation"],
|
||||
dataType: "grantDonation",
|
||||
fieldcol: 14,
|
||||
label: "准予扣除的捐赠额",
|
||||
labelcol: 8,
|
||||
|
|
@ -169,9 +107,32 @@ export const dataCollectCondition = [
|
|||
precision: 2,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["derateDeduction"],
|
||||
dataType: "derateDeduction",
|
||||
fieldcol: 14,
|
||||
label: "减免税额",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
precision: 2,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["otherDeduction"],
|
||||
dataType: "otherDerateDeduction",
|
||||
fieldcol: 14,
|
||||
label: "其他",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
precision: 2,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["privatePension"],
|
||||
dataType: "personalPension",
|
||||
fieldcol: 14,
|
||||
label: "个人养老金",
|
||||
labelcol: 8,
|
||||
|
|
@ -185,6 +146,419 @@ export const dataCollectCondition = [
|
|||
col: 2
|
||||
}
|
||||
];
|
||||
export const taxDetailSettingsConditions = {
|
||||
freeIncome: [{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["freeItem"],
|
||||
fieldcol: 14,
|
||||
label: "免税事项",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["freeProperty"],
|
||||
fieldcol: 14,
|
||||
label: "免税性质",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["freeAmount"],
|
||||
fieldcol: 14,
|
||||
label: "免税金额",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true,
|
||||
col: 1
|
||||
}],
|
||||
healthInsurance: [{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["identificationNumber"],
|
||||
fieldcol: 14,
|
||||
label: "税优识别码",
|
||||
lanId: 111,
|
||||
helpfulTip: "为确保税收优惠商业健康保险保单的唯一性、真实性和有效性,由商业健康保险信息平台按照“一人一单一码”的原则进行核发,填写个人保单凭证上打印的数字识别码。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "DATEPICKER",
|
||||
domkey: ["effectiveDate"],
|
||||
fieldcol: 14,
|
||||
label: "保单生效日期",
|
||||
lanId: 111,
|
||||
helpfulTip: "该商业健康保险保单生效的日期。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["yearPremium"],
|
||||
fieldcol: 14,
|
||||
label: "年度保费",
|
||||
lanId: 111,
|
||||
helpfulTip: "商业健康保险保单年度内该保单的总保费。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["monthPremium"],
|
||||
fieldcol: 14,
|
||||
label: "月度保费",
|
||||
lanId: 111,
|
||||
helpfulTip: "月缴费的保单填写每月所缴保费,按年一次性缴费的保单填写年度保费除以12后的金额。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["currentDeduction"],
|
||||
fieldcol: 14,
|
||||
label: "本期扣除金额",
|
||||
lanId: 111,
|
||||
helpfulTip: "根据国家有关政策对个人购买或单位统一购买符合规定的商业健康保险产品的支出,扣除限额为2400。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true,
|
||||
col: 1
|
||||
}],
|
||||
endowmentInsurance: [{
|
||||
items: [
|
||||
{
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["deductionMonth"],
|
||||
fieldcol: 14,
|
||||
label: "申报扣除月份",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["accountNumber"],
|
||||
fieldcol: 14,
|
||||
label: "税延养老账户编号",
|
||||
lanId: 111,
|
||||
helpfulTip: "按照中国保险信息技术管理有限责任公司相关信息平台出具的《个人税收递延型商业养老保险扣除凭证》载明的对应项目填写。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["checkCode"],
|
||||
fieldcol: 14,
|
||||
label: "报税校验码",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["yearPremium"],
|
||||
fieldcol: 14,
|
||||
label: "年度保费",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["monthPremium"],
|
||||
fieldcol: 14,
|
||||
label: "月度保费",
|
||||
lanId: 111,
|
||||
helpfulTip: "取得工资薪金所得、连续性劳务报酬所得(特定行业除外)的个人,填写《个人税收递延型商业养老保险扣除凭证》载明的月度保费金额,一次性缴费的保单填写月平均保费金额。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["currentDeduction"],
|
||||
fieldcol: 14,
|
||||
label: "本期扣除金额",
|
||||
lanId: 111,
|
||||
helpfulTip: "取得工资薪金所得的个人,应按税延养老保险扣除凭证记载的当月金额和扣除限额孰低的方法计算可扣除额。扣除限额按照申报扣除当月的工资薪金的 6%和1000元孰低的办法确定。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true,
|
||||
col: 1
|
||||
}],
|
||||
grantDonation: [{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["recipientName"],
|
||||
fieldcol: 14,
|
||||
label: "受赠单位名称",
|
||||
lanId: 111,
|
||||
helpfulTip: "受赠单位名称填写受赠单位的法定名称全称。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["taxCode"],
|
||||
fieldcol: 14,
|
||||
label: "受赠单位纳税人识别号",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["donationNumber"],
|
||||
fieldcol: 14,
|
||||
label: "捐赠凭证号",
|
||||
lanId: 111,
|
||||
helpfulTip: "捐赠凭证",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "DATEPICKER",
|
||||
domkey: ["donateDate"],
|
||||
fieldcol: 14,
|
||||
label: "捐赠日期",
|
||||
lanId: 111,
|
||||
helpfulTip: "填写个人发生的公益慈善事业捐赠的具体日期。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["donateAmount"],
|
||||
fieldcol: 14,
|
||||
label: "捐赠金额",
|
||||
lanId: 111,
|
||||
helpfulTip: "填写个人发生的公益慈善事业捐赠的具体金额。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["deductionProportion"],
|
||||
fieldcol: 14,
|
||||
label: "扣除比例",
|
||||
lanId: 111,
|
||||
helpfulTip: "填写税法规定的可以公益慈善事业捐赠支出税前扣除比例。如:0.3(30%)或者1(100%),请注意,必须是小数形式的百分比。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["actualDeduction"],
|
||||
fieldcol: 14,
|
||||
label: "实际扣除金额",
|
||||
lanId: 111,
|
||||
helpfulTip: "填写个人取得“扣除所得项目”对应收入办理扣缴申报或者自行申报时,实际扣除的公益慈善事业捐赠支出金额。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true,
|
||||
col: 1
|
||||
}],
|
||||
derateDeduction: [{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["derateItem"],
|
||||
fieldcol: 14,
|
||||
label: "减免事项",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["derateProperty"],
|
||||
fieldcol: 14,
|
||||
label: "减免性质",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["derateAmount"],
|
||||
fieldcol: 14,
|
||||
label: "减免金额",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true,
|
||||
col: 1
|
||||
}],
|
||||
otherDerateDeduction: [{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["otherDeduction"],
|
||||
fieldcol: 14,
|
||||
label: "减免税额",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["remark"],
|
||||
fieldcol: 14,
|
||||
label: "备注",
|
||||
lanId: 111,
|
||||
helpfulTip: "根据政策要求,一定要在备注中写明具体扣除项目名称,备注不超过20个字符。",
|
||||
helpfulTipLanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true,
|
||||
col: 1
|
||||
}],
|
||||
personalPension: [{
|
||||
items: [
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["voucherTypeName"],
|
||||
fieldcol: 14,
|
||||
label: "凭证类型",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["voucherNo"],
|
||||
fieldcol: 14,
|
||||
label: "凭证编码",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["payAmount"],
|
||||
fieldcol: 14,
|
||||
label: "缴费金额",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required",
|
||||
precision: 2,
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true,
|
||||
col: 1
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,165 @@
|
|||
/*
|
||||
* 数据采集-其他免税扣除
|
||||
* 明细设置弹框
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/12/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaHelpfulTip, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import FormInfo from "../../../components/FormInfo";
|
||||
import { taxDetailSettingsConditions } from "./columns";
|
||||
import { Button, message } from "antd";
|
||||
import { getDomkes, toDecimal_n } from "../../../util";
|
||||
import { postFetch } from "../../../util/request";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("otherDeductStore")
|
||||
@observer
|
||||
class DetailSettingsDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, conditions: []
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.setState({
|
||||
conditions: _.map(taxDetailSettingsConditions[nextProps.dataType], item => ({
|
||||
...item, items: _.map(item.items, o => ({
|
||||
...o, options: getKey(o) === "voucherTypeName" ?
|
||||
[{ key: "MONTH", showname: "月度" }, { key: "YEAR", showname: "年度" }] : []
|
||||
}))
|
||||
}))
|
||||
}, () => {
|
||||
this.props.otherDeductStore.settingsForm.initFormFields(this.state.conditions);
|
||||
if (nextProps.id) _.map(getDomkes(this.state.conditions), domkey => {
|
||||
this.props.otherDeductStore.settingsForm.updateFields({ [domkey]: { value: nextProps.record[domkey] } });
|
||||
});
|
||||
});
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.props.otherDeductStore.initSettingsForm();
|
||||
}
|
||||
}
|
||||
|
||||
save = () => {
|
||||
const { otherDeductStore: { settingsForm }, mainId, id, dataType } = this.props;
|
||||
settingsForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
let { deductionMonth, ...payload } = settingsForm.getFormParams();
|
||||
deductionMonth && (payload = { ...payload, deductionMonth: deductionMonth + "-01" });
|
||||
this.setState({ loading: true });
|
||||
postFetch(`/api/bs/hrmsalary/otherDeduction/save${_.upperFirst(dataType)}`, { ...payload, mainId, id })
|
||||
.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();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { otherDeductStore: { settingsForm } } = this.props, { loading, conditions } = this.state;
|
||||
const itemRender = {
|
||||
freeAmount: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ freeAmount: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
identificationNumber: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>);
|
||||
},
|
||||
effectiveDate: (field, textAreaProps, form, formParams) => {
|
||||
return (<div className="cust">
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
||||
<div className="cus_helpful">
|
||||
<WeaHelpfulTip title={getLabel(field.helpfulTipLanId, field.helpfulTip)}/>
|
||||
</div>
|
||||
</div>);
|
||||
},
|
||||
donateDate: (field, textAreaProps, form, formParams) => {
|
||||
return (<div className="cust">
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
||||
<div className="cus_helpful">
|
||||
<WeaHelpfulTip title={getLabel(field.helpfulTipLanId, field.helpfulTip)}/>
|
||||
</div>
|
||||
</div>);
|
||||
},
|
||||
yearPremium: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ yearPremium: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
monthPremium: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ monthPremium: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
currentDeduction: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ currentDeduction: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
donateAmount: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ donateAmount: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
deductionProportion: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ deductionProportion: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
actualDeduction: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ actualDeduction: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
derateAmount: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ derateAmount: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
otherDeduction: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ otherDeduction: { value: toDecimal_n(v, 2) } })}/>);
|
||||
},
|
||||
payAmount: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
|
||||
form={form} formParams={formParams}
|
||||
onBlur={(v) => v && form.updateFields({ payAmount: { value: toDecimal_n(v, 2) } })}/>);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} initLoadCss title={getLabel(111, "明细设置")}
|
||||
style={{ width: 480, height: _.reduce(conditions, (pre, cur) => (pre += cur.items.length), 0) * 47 + 33 }}
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "确定")}</Button>,
|
||||
<Button type="ghost" onClick={() => this.props.onCancel()}>{getLabel(111, "取消")}</Button>
|
||||
]}
|
||||
>
|
||||
<FormInfo className="form-dialog-layout" center={false} itemRender={itemRender}
|
||||
form={settingsForm} formFields={conditions}/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default DetailSettingsDialog;
|
||||
|
|
@ -29,6 +29,8 @@ import { dataCollectCondition } from "./columns";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { getDomkes } from "../../../util";
|
||||
import TaxSetDialog from "./taxSetDialog";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -63,7 +65,8 @@ class Index extends Component {
|
|||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null,
|
||||
targetid: ""
|
||||
targetid: "",
|
||||
taxSetDialog: { visible: false, dataType: "", id: "" }
|
||||
};
|
||||
this.tableRef = null;
|
||||
this.addItemRef = null;
|
||||
|
|
@ -293,7 +296,17 @@ class Index extends Component {
|
|||
return {
|
||||
...it, title: getLabel(83871, "数据采集"),
|
||||
items: _.map(it.items, o => ({
|
||||
...o, label: getLabel(o.lanId, o.label)
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
extraDom: !_.isEmpty(editId) &&
|
||||
<a href="javascript:void(0);" className="extra_tax" title={getLabel(111, "添加附表")}
|
||||
onClick={() => this.setState({
|
||||
taxSetDialog: {
|
||||
visible: true, dataType: o.dataType, id: editId.id,
|
||||
label: getLabel(o.lanId, o.label)
|
||||
}
|
||||
})}>
|
||||
<i className="icon-coms02-Preview-1"/>
|
||||
</a>
|
||||
}))
|
||||
};
|
||||
}
|
||||
|
|
@ -394,7 +407,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
@ -407,6 +420,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
|
||||
};
|
||||
|
|
@ -515,7 +529,7 @@ class Index extends Component {
|
|||
const { taxAgentStore: { showOperateBtn }, otherDeductStore: { form } } = this.props;
|
||||
const {
|
||||
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
|
||||
importPayload, exportPayloadType, targetid
|
||||
importPayload, exportPayloadType, targetid, taxSetDialog
|
||||
} = this.state;
|
||||
const tablePayload = { declareMonth: [declareMonth], taxAgentId };
|
||||
return (
|
||||
|
|
@ -538,6 +552,8 @@ class Index extends Component {
|
|||
onViewDetails={(record) => this.handleAddData("其他免税扣除记录", record)}
|
||||
form={form}
|
||||
/>
|
||||
<TaxSetDialog {...taxSetDialog}
|
||||
onCancel={() => this.setState({ taxSetDialog: { ...taxSetDialog, visible: false } })}/>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* 其他免税扣除设置
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/12/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaButtonIcon, WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import DetailSettingsDialog from "./detailSettingsDialog";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class TaxSetDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
selectedRowKeys: [], detailSettingsDialog: { visible: false, dataType: "", mainId: "", id: "", record: {} }
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.setState({
|
||||
detailSettingsDialog: { ...this.state.detailSettingsDialog, dataType: nextProps.dataType, mainId: nextProps.id }
|
||||
}, () => this.getList(nextProps));
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.setState({
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
loading: false,
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
selectedRowKeys: [],
|
||||
detailSettingsDialog: { visible: false }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getList = (props) => {
|
||||
const { id, dataType, viewParams = {} } = props || this.props, { pageInfo, detailSettingsDialog } = this.state;
|
||||
this.setState({ loading: true });
|
||||
postFetch(`/api/bs/hrmsalary/otherDeduction/${dataType}List`, { ...pageInfo, ...viewParams, id })
|
||||
.then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { current, pageSize, total }, columns: _.map(columns, o => ({
|
||||
...o,
|
||||
width: o.dataIndex === "operate" && 120,
|
||||
render: (text, record) => o.dataIndex === "operate" ? (<div className="space_div">
|
||||
<a href="javascript:void(0);" onClick={() => this.setState({
|
||||
detailSettingsDialog: { ...detailSettingsDialog, visible: true, id: record.id, record }
|
||||
})}>{getLabel(111, "编辑")}</a>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.handleDelete([record.id])}>{getLabel(111, "删除")}</a>
|
||||
</div>) : (<span>{text}</span>)
|
||||
}))
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleDelete = (ids = []) => {
|
||||
const { selectedRowKeys } = this.state, { dataType } = this.props;
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(388758, "确认要删除吗?"),
|
||||
onOk: () => {
|
||||
postFetch(`/api/bs/hrmsalary/otherDeduction/delete${_.upperFirst(dataType)}`, { ids })
|
||||
.then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(502230, "删除成功!"));
|
||||
this.setState({ selectedRowKeys: _.difference(selectedRowKeys, ids) }, () => this.getList());
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { pageInfo, dataSource, loading, columns, selectedRowKeys, detailSettingsDialog } = this.state;
|
||||
const { viewParams } = this.props;
|
||||
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: 1, pageSize } }, () => this.getList());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getList());
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
return (<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.taxSetRef = dom}
|
||||
title={`${getLabel(111, "附表明细")}(${this.props.label})`}
|
||||
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 && pageInfo.total === 0}>
|
||||
{
|
||||
_.isEmpty(viewParams) && <div className="sys-item-table-opts">
|
||||
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}
|
||||
onClick={() => this.setState({
|
||||
detailSettingsDialog: { ...detailSettingsDialog, visible: true }
|
||||
})}/>
|
||||
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "删除")}
|
||||
disabled={_.isEmpty(selectedRowKeys)} onClick={() => {
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(111, "请选择要删除的数据!"));
|
||||
return;
|
||||
}
|
||||
this.handleDelete(selectedRowKeys);
|
||||
}}/>
|
||||
</div>
|
||||
}
|
||||
<WeaTable columns={!_.isEmpty(viewParams) ? _.filter(columns, o => o.dataIndex !== "operate") : columns}
|
||||
dataSource={dataSource} pagination={pagination} bordered
|
||||
rowSelection={rowSelection} loading={loading} rowKey="id"
|
||||
scroll={{ y: this.taxSetRef ? this.taxSetRef.state.height - 164 : 600 }}/>
|
||||
<DetailSettingsDialog {...detailSettingsDialog} onCancel={(callback) => this.setState({
|
||||
detailSettingsDialog: { ...detailSettingsDialog, visible: false, id: "" }
|
||||
}, () => callback && callback())} onSuccess={this.getList}/>
|
||||
</Spin>
|
||||
</div>
|
||||
</WeaDialog>);
|
||||
}
|
||||
}
|
||||
|
||||
export default TaxSetDialog;
|
||||
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,11 +1,10 @@
|
|||
.generateDeclarationDetail {
|
||||
.tabWrapper {
|
||||
padding-left: 10px
|
||||
}
|
||||
.declare-detail-table-container {
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.tableWrapper {
|
||||
height: calc(100vh - 48px);
|
||||
overflow: auto;
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +34,8 @@
|
|||
.declare-body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
overflow-y: auto;
|
||||
|
||||
.wea-new-table {
|
||||
|
|
|
|||
|
|
@ -169,3 +169,13 @@ export const taxTabConditions = [
|
|||
title: ""
|
||||
}
|
||||
];
|
||||
// 查看附表对应字段
|
||||
export const appendixFields = [
|
||||
{ dataIndex: "taxFreeIncome", dataType: "freeIncome" },
|
||||
{ dataIndex: "commercialHealthInsurance", dataType: "healthInsurance" },
|
||||
{ dataIndex: "taxDeferredEndowmentInsurance", dataType: "endowmentInsurance" },
|
||||
{ dataIndex: "allowedDonation", dataType: "grantDonation" },
|
||||
{ dataIndex: "taxDeduction", dataType: "derateDeduction" },
|
||||
{ dataIndex: "other", dataType: "otherDerateDeduction" },
|
||||
{ dataIndex: "", dataType: "personalPension" }
|
||||
];
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Date: 2023/12/28
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { WeaCheckbox, WeaLocaleProvider } from "ecCom";
|
||||
import { message } from "antd";
|
||||
import ImportDialog from "../../../components/importDialog";
|
||||
import * as API from "../../../apis/declare";
|
||||
|
|
@ -17,7 +17,7 @@ class TaxDeclareDetailImportDialog extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
importDialog: {
|
||||
visible: false, title: "", nextloading: false,
|
||||
visible: false, title: "", nextloading: false, hasData: "0",
|
||||
link: null, importResult: {}, imageId: "", taxDeclarationId: "",
|
||||
previewUrl: "/api/bs/hrmsalary/taxdeclaration/preview",
|
||||
extraPreview: { taxDeclarationId: "" }
|
||||
|
|
@ -49,16 +49,16 @@ class TaxDeclareDetailImportDialog extends Component {
|
|||
}).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
|
||||
};
|
||||
handleExportTemp = () => {
|
||||
const { importDialog: { taxDeclarationId } } = this.state;
|
||||
const { importDialog: { taxDeclarationId, hasData } } = this.state;
|
||||
message.destroy();
|
||||
message.loading(getLabel(111, "下载中"), 0);
|
||||
const promise = API.taxdeclarationExportTemplate({ taxDeclarationId });
|
||||
const promise = API.taxdeclarationExportTemplate({ taxDeclarationId, hasData: hasData === "1" });
|
||||
message.destroy();
|
||||
};
|
||||
handleCancel = () => {
|
||||
this.setState({
|
||||
importDialog: {
|
||||
visible: false, title: "", nextloading: false,
|
||||
visible: false, title: "", nextloading: false, hasData: "0",
|
||||
link: null, importResult: {}, imageId: "", taxDeclarationId: "",
|
||||
previewUrl: "/api/bs/hrmsalary/taxdeclaration/preview"
|
||||
}
|
||||
|
|
@ -71,10 +71,17 @@ class TaxDeclareDetailImportDialog extends Component {
|
|||
<ImportDialog
|
||||
{...importDialog} onCancel={this.handleCancel}
|
||||
onResetImportResult={() => this.setState(({
|
||||
importDialog: { ...importDialog, importResult: {}, imageId: "" }
|
||||
importDialog: { ...importDialog, importResult: {}, imageId: "", hasData: "0" }
|
||||
}))}
|
||||
nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
|
||||
nextUplaodCallback={imageId => this.handleImport({ imageId })}
|
||||
exportDataDom={
|
||||
<WeaCheckbox
|
||||
content={getLabel(543208, "导出现有数据")} value={importDialog.hasData}
|
||||
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
|
||||
onChange={val => this.setState({ importDialog: { ...importDialog, hasData: val } })}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ import TaxDeclareDetailImportDialog from "./components/taxDeclareDetailImportDia
|
|||
import TabEditDialog from "./components/tabEditDialog";
|
||||
import LeftTab from "./components/leftTab";
|
||||
import { confirmDialog } from "./confirm";
|
||||
import { appendixFields } from "./components/constants";
|
||||
import "./index.less";
|
||||
import TaxSetDialog from "../dataAcquisition/otherDeduct/taxSetDialog";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
|
|
@ -65,6 +67,7 @@ class Index extends Component {
|
|||
intelCalcSalaryStatus: false, //智能算薪 总开关是否开启
|
||||
declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 },
|
||||
reportType: "", showLeft: false,
|
||||
taxSetDialog: { visible: false, dataType: "", viewParams: {} },//查看附表
|
||||
azOperate: false //艾志二开操作按钮的权限
|
||||
};
|
||||
this.timer = null;
|
||||
|
|
@ -147,6 +150,15 @@ class Index extends Component {
|
|||
});
|
||||
}
|
||||
});
|
||||
} else if (id === "APPENDIX") {
|
||||
const { taxAgentId, taxCycle } = this.state.declareInfo;
|
||||
this.setState({
|
||||
taxSetDialog: {
|
||||
visible: true, viewParams: { employeeId: params.employeeId, taxAgentId, taxCycle: taxCycle + "-01" },
|
||||
dataType: _.find(appendixFields, o => o.dataIndex === params.dataIndex).dataType,
|
||||
label: params.title
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -155,7 +167,8 @@ class Index extends Component {
|
|||
const i18n = {
|
||||
"总计": getLabel(523, "总计"), "编辑": getLabel(501169, "编辑"),
|
||||
"操作": getLabel(30585, "操作"), "共": getLabel(83698, "共"),
|
||||
"条": getLabel(18256, "条"), "删除": getLabel(535052, "删除")
|
||||
"条": getLabel(18256, "条"), "删除": getLabel(535052, "删除"),
|
||||
"查看附表": getLabel(111, "查看附表")
|
||||
};
|
||||
const declareStatus = intelCalcSalaryStatus ? declareInfo.declareStatus : "";
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
|
|
@ -180,7 +193,10 @@ class Index extends Component {
|
|||
if (idx <= 1) {
|
||||
return { ...it, width: 150, fixed: "left", ellipsis: true };
|
||||
}
|
||||
return { ...it, width: 150, ellipsis: true };
|
||||
return {
|
||||
...it, width: 150, ellipsis: true,
|
||||
isAppendix: _.findIndex(appendixFields, o => o.dataIndex === it.dataIndex) !== -1
|
||||
};
|
||||
}),
|
||||
azOperate: true
|
||||
}, () => {
|
||||
|
|
@ -353,7 +369,7 @@ class Index extends Component {
|
|||
const { taxAgentStore: { showOperateBtn, isTaxDeclareAdmin } } = this.props;
|
||||
const {
|
||||
tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide,
|
||||
editTabVisible, reportType, showLeft, azOperate
|
||||
editTabVisible, reportType, showLeft, azOperate, taxSetDialog
|
||||
} = this.state;
|
||||
const [__, taxDeclarationId] = selectedKey.split("%%");
|
||||
let btns = [
|
||||
|
|
@ -463,6 +479,9 @@ class Index extends Component {
|
|||
<TabEditDialog visible={editTabVisible}
|
||||
onCancel={(isRefresh) => this.setState({ editTabVisible: false }, () => isRefresh && this.init(false))}/>
|
||||
</div>
|
||||
{/*查看附表*/}
|
||||
<TaxSetDialog {...taxSetDialog}
|
||||
onCancel={() => this.setState({ taxSetDialog: { ...taxSetDialog, visible: false } })}/>
|
||||
<div className="declareDetail-layout-table-content">
|
||||
<Spin spinning={loading.query}>
|
||||
<iframe
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@
|
|||
height: 100%;
|
||||
padding: 16px;
|
||||
background: #f6f6f6;
|
||||
overflow-y: auto;
|
||||
|
||||
.declareTable {
|
||||
background: #FFF;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@
|
|||
padding: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 20px;
|
||||
font-size: 20px !important;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
|
|
@ -370,6 +370,16 @@
|
|||
|
||||
.incomeDialogContent {
|
||||
height: 100%;
|
||||
padding: 16px;
|
||||
padding: 8px 16px;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-input-focus {
|
||||
margin-bottom: 2px!important;
|
||||
margin-top: 0!important;
|
||||
}
|
||||
|
||||
.clearfix {
|
||||
background: #FFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(newDateSource, 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>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class LedgerSalaryItemSelectDialog extends Component {
|
|||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} hasScroll className="incomeDialog" initLoadCss
|
||||
{...this.props} hasScroll className="incomeDialog" initLoadCss ref={dom => this.incomeRef = dom}
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.props.handleClearSalaryItem}>{getLabel(111, "清除")}</Button>
|
||||
]}
|
||||
|
|
@ -109,6 +109,7 @@ class LedgerSalaryItemSelectDialog extends Component {
|
|||
showHeader={false} dataSource={dataSource}
|
||||
loading={loading} pagination={pagination}
|
||||
columns={columns} onRowClick={this.handleRowClick}
|
||||
scroll={{ y: this.incomeRef ? this.incomeRef.state.height - 106 : 600 }}
|
||||
/>
|
||||
</div>
|
||||
</WeaDialog>
|
||||
|
|
|
|||
|
|
@ -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 : ""
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -287,18 +289,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,6 +13,7 @@ import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
|
|||
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
|
||||
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
|
||||
import LedgerSalaryItem from "./ledgerSalaryItem";
|
||||
import LedgerAccountApprRule from "./ledgerAccountApprRule";
|
||||
import IncomeTaxFields from "./incomeTaxFields";
|
||||
import IncomeTaxFieldsCorresponding from "./incomeTaxFieldsCorresponding";
|
||||
import CumulativeFields from "./cumulativeFields";
|
||||
|
|
@ -20,12 +21,14 @@ import WeaTopTitle from "../../../components/custom-title/weaTopTitle";
|
|||
import WeaReqTitle from "../../../components/custom-title/weaReqTitle";
|
||||
import {
|
||||
addupruleSave,
|
||||
salaryApprovalSaveForm,
|
||||
saveAdjustmentRule,
|
||||
saveLedgerBasic,
|
||||
saveLedgerItem,
|
||||
taxreportruleSave,
|
||||
taxruleSave
|
||||
} from "../../../apis/ledger";
|
||||
import { sysConfCodeRule } from "../../../apis/ruleconfig";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -37,19 +40,23 @@ class LedgerSlide extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
current: 0,
|
||||
loading: false,
|
||||
baseSettingInfo: {},
|
||||
adjustRules: [],
|
||||
empFields: [], itemGroups: [],
|
||||
current: 0, loading: false, baseSettingInfo: {}, adjustRules: [],
|
||||
empFields: [], itemGroups: [], saveSalarySobId: "",
|
||||
salaryApprovalStatus: false,
|
||||
taxruleFields: [], taxruleKeys: "", //个税字段对应
|
||||
incomeTaxFields: [], incomeTaxKeys: "", //个税申报字段对应
|
||||
addupruleFields: [], addupruleKeys: "", //累计字段对应
|
||||
saveSalarySobId: "",
|
||||
taxableItems: "" //薪资类型 1||489 对应显示个税设置-累计字段对应
|
||||
};
|
||||
}
|
||||
|
||||
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: ""
|
||||
|
|
@ -123,11 +130,12 @@ 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.formulaContent;
|
||||
delete it.originFormulaContent;
|
||||
delete it.originSqlContent;
|
||||
// if (it.id && it.id.length > 4) delete it.id;
|
||||
return { ...it };
|
||||
})
|
||||
|
|
@ -135,7 +143,8 @@ class LedgerSlide extends Component {
|
|||
}),
|
||||
items: _.map(_.find(itemGroups, it => it.name === "未分类").items, child => {
|
||||
// if (child.id && child.id.length > 4) delete child.id;
|
||||
// delete child.formulaContent;
|
||||
delete child.originFormulaContent;
|
||||
delete child.originSqlContent;
|
||||
return { ...child };
|
||||
}) || [],
|
||||
salarySobId: salarySobId || saveSalarySobId
|
||||
|
|
@ -158,7 +167,7 @@ class LedgerSlide extends Component {
|
|||
*/
|
||||
taxRuleSave = () => {
|
||||
const { editId } = this.props;
|
||||
const { taxruleKeys, taxruleFields, saveSalarySobId, taxableItems } = this.state;
|
||||
const { taxruleKeys, taxruleFields, saveSalarySobId, taxableItems, salaryApprovalStatus } = this.state;
|
||||
const payload = {
|
||||
salarySobId: editId || saveSalarySobId,
|
||||
incomeCategoryParams: _.map(taxruleFields, it => {
|
||||
|
|
@ -184,7 +193,7 @@ class LedgerSlide extends Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(22619, "保存成功!"));
|
||||
!editId && (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && this.handleClose();
|
||||
!editId && (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && !salaryApprovalStatus && this.handleClose();
|
||||
} else {
|
||||
message.error(errormsg || getLabel(22620, "保存失败!"));
|
||||
}
|
||||
|
|
@ -241,7 +250,7 @@ class LedgerSlide extends Component {
|
|||
addupruleSave = () => {
|
||||
const {
|
||||
taxableItems, incomeTaxFields, incomeTaxKeys, addupruleFields,
|
||||
addupruleKeys, saveSalarySobId
|
||||
addupruleKeys, saveSalarySobId, salaryApprovalStatus
|
||||
} = this.state;
|
||||
const { editId } = this.props;
|
||||
if ((!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489")) {
|
||||
|
|
@ -292,7 +301,7 @@ class LedgerSlide extends Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(22619, "保存成功!"));
|
||||
!editId && this.handleClose();
|
||||
(saveSalarySobId && !salaryApprovalStatus) && this.handleClose();
|
||||
} else {
|
||||
message.error(errormsg || getLabel(22620, "保存失败!"));
|
||||
}
|
||||
|
|
@ -317,9 +326,45 @@ class LedgerSlide extends Component {
|
|||
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, taxableItems, saveSalarySobId, loading } = this.state;
|
||||
const { current, taxableItems, saveSalarySobId, loading, salaryApprovalStatus } = this.state;
|
||||
let tabs = [
|
||||
{
|
||||
key: 0, title: getLabel(82751, "基础设置"),
|
||||
|
|
@ -409,7 +454,9 @@ class LedgerSlide extends Component {
|
|||
{
|
||||
key: 6, title: getLabel(111, "同步个税配置"),
|
||||
createBtns:
|
||||
!(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ?
|
||||
(((taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && salaryApprovalStatus) ||
|
||||
(!(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && salaryApprovalStatus) ||
|
||||
((taxableItems && taxableItems.toString() === "1" || taxableItems.toString() === "489") && !salaryApprovalStatus)) ?
|
||||
[
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
|
|
@ -433,7 +480,10 @@ class LedgerSlide extends Component {
|
|||
createBtns: [
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading} onClick={this.addupruleSave}>{getLabel(111, "完成")}</Button>
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.setState({ current: !salaryApprovalStatus ? current : current + 1 }, () => this.addupruleSave())}>
|
||||
{!salaryApprovalStatus ? getLabel(111, "完成") : getLabel(111, "保存并进入下一步")}
|
||||
</Button>
|
||||
],
|
||||
editBtns: [<Button type="primary" loading={loading}
|
||||
onClick={this.addupruleSave}>{getLabel(111, "保存")}</Button>],
|
||||
|
|
@ -441,10 +491,25 @@ class LedgerSlide extends Component {
|
|||
onSetAdduprule={(addupruleFields, selectedKey) => this.setState({
|
||||
addupruleFields, addupruleKeys: selectedKey
|
||||
})}/>
|
||||
},
|
||||
{
|
||||
key: 8, 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}/>
|
||||
}
|
||||
];
|
||||
(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") &&
|
||||
(tabs = _.map(_.filter(tabs, o => o.key !== 7), (k, j) => ({ ...k, key: j })));
|
||||
!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 {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,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 }) => {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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