Merge branch 'feature/2.15.2.2409.01合并业务线测试' into custom/领悦业务线
# Conflicts: # pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js # pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js # pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js # pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js # pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js # pc4mobx/hrmSalary/components/CustomBrowser/index.js # pc4mobx/hrmSalary/components/CustomBrowser/index.less # pc4mobx/hrmSalary/index.js
This commit is contained in:
commit
143d2ef8f8
|
|
@ -12,7 +12,7 @@ export const taxAgentRangeSync = (params) => {
|
|||
|
||||
// 系统管理员权限
|
||||
export const getPermission = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/permission", "GET", params);
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/auth/permission", "GET", params);
|
||||
};
|
||||
|
||||
//获取个税扣缴义务人表单
|
||||
|
|
@ -98,3 +98,61 @@ export const getTaxAgentSelectListAsAdmin = (params) => {
|
|||
export const hasIconInTax = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/sys/conf/code?code=hideIconInTax", "GET", params);
|
||||
};
|
||||
|
||||
/**权限-角色相关*/
|
||||
//角色列表
|
||||
export const getRoleList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/role/list", params);
|
||||
};
|
||||
//保存角色
|
||||
export const saveAuthRole = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/role/save", params);
|
||||
};
|
||||
//删除角色
|
||||
export const deleteAuthRole = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/role/delete", params);
|
||||
};
|
||||
//成员列表
|
||||
export const authMemberList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/member/list", params);
|
||||
};
|
||||
//保存成员
|
||||
export const saveAuthMember = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/member/save", params);
|
||||
};
|
||||
//数据列表
|
||||
export const authDataList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/data/list", params);
|
||||
};
|
||||
//删除成员
|
||||
export const deleteAuthMember = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/member/delete", params);
|
||||
};
|
||||
//删除数据
|
||||
export const deleteAuthData = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/data/delete", params);
|
||||
};
|
||||
//保存数据
|
||||
export const saveAuthData = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/data/save", params);
|
||||
};
|
||||
//同步数据
|
||||
export const syncAuthData = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/data/sync", params);
|
||||
};
|
||||
//同步成员
|
||||
export const syncAuthMember = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/member/sync", params);
|
||||
};
|
||||
//保存权限
|
||||
export const saveAuthOpt = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/auth/opt/save", params);
|
||||
};
|
||||
//权限项
|
||||
export const getAuthOptTree = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/auth/opt/tree", "GET", params);
|
||||
};
|
||||
//业务线详情
|
||||
export const getRole = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/auth/role/getRole", "GET", 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/siaccount/getAdminTaxAgentList", "get", {});
|
||||
};
|
||||
// 浮动薪酬档案导出
|
||||
export const exportVariableSalary = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/variableSalary/export", params);
|
||||
};
|
||||
|
||||
|
|
@ -10,8 +10,8 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Button, Icon, Select } from "antd";
|
||||
import classNames from "classnames";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import classNames from "classnames";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const Option = Select.Option;
|
||||
|
|
@ -39,23 +39,28 @@ class AssociativeSearchMult extends Component {
|
|||
};
|
||||
getData = (name = "") => {
|
||||
const { browserConditionParam } = this.props;
|
||||
const { completeURL, searchParamsKey, convertDatasource, dataParams = {} } = browserConditionParam;
|
||||
const {
|
||||
completeURL, filterByName, searchParamsKey, convertDatasource, dataParams = {}
|
||||
} = browserConditionParam;
|
||||
if (_.trim(name)) {
|
||||
postFetch(completeURL, { ...dataParams, [searchParamsKey]: name, current: 1, pageSize: 9999 })
|
||||
.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: _.map(data, o => ({ ...o, id: String(o.id), name: o.name })),
|
||||
activeKey: this.getActiveKey(data)
|
||||
});
|
||||
}
|
||||
});
|
||||
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: "" });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -8,13 +8,14 @@
|
|||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom";
|
||||
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 {
|
||||
|
|
@ -22,16 +23,27 @@ class CustomBrowserDialog extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [],
|
||||
query: { [props.searchParamsKey]: "" }
|
||||
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();
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.setState({ selectedRowKeys: nextProps.selectedValues });
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.setState({ pageInfo: { current: 1, pageSize: 10, total: 0 } });
|
||||
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 = {};
|
||||
}
|
||||
}
|
||||
|
|
@ -39,7 +51,7 @@ class CustomBrowserDialog extends Component {
|
|||
getData = () => {
|
||||
const { pageInfo, query } = this.state;
|
||||
const { dialogType, completeURL, convertDatasource, dataParams = {} } = this.props;
|
||||
let payload = { ...dataParams };
|
||||
let payload = { ...dataParams, ...query };
|
||||
dialogType === "table" && (payload = { ...pageInfo, ...payload, ...query });
|
||||
this.setState({ loading: true });
|
||||
postFetch(completeURL, payload).then(({ status, data }) => {
|
||||
|
|
@ -51,7 +63,7 @@ class CustomBrowserDialog extends Component {
|
|||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
} else {
|
||||
this.setState({ listDatas: data });
|
||||
this.setState({ listDatas: _.map(data, o => ({ ...o, id: String(o.id) })) });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -67,12 +79,13 @@ class CustomBrowserDialog extends Component {
|
|||
this.props.onChange && this.props.onChange([], {});
|
||||
};
|
||||
handleOk = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
selectedRowKeys.forEach((v) => {
|
||||
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(selectedRowKeys, this.selectedData);
|
||||
this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData);
|
||||
this.props.onCancel && this.props.onCancel();
|
||||
};
|
||||
getItemById = (id) => {
|
||||
|
|
@ -80,39 +93,136 @@ class CustomBrowserDialog extends Component {
|
|||
if (this.selectedData[id]) return this.selectedData[id];
|
||||
if (!_.isEmpty(listDatas)) {
|
||||
for (let i = 0; i < listDatas.length; i++) {
|
||||
if (id === listDatas[i].id) return listDatas[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;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, listDatas, pageInfo, selectedRowKeys, query } = this.state;
|
||||
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 - 55 : 260;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={this.handleOk}>{getLabel(111, "确 定")}</Button>,
|
||||
<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 style={{ padding: 10, height: "100%" }}>
|
||||
<div className="wea-hr-muti-input-left">
|
||||
<Row style={{ height: 35 }}>
|
||||
<Col span="24"> <WeaInputSearch/> </Col>
|
||||
</Row>
|
||||
<div>
|
||||
<WeaNewScroll height={sheight}>
|
||||
<CustomBrowserMutiLeft
|
||||
datas={listDatas}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</div>
|
||||
<div className="wea-transfer-opration">
|
||||
<CustomBrowserOperation/>
|
||||
</div>
|
||||
<div className="wea-hr-muti-input-right">
|
||||
<CustomBrowserMutiRight height={sheight}/>
|
||||
</div>
|
||||
<div style={{ padding: 10, height: "100%" }} 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={sheight}>
|
||||
<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={sheight} data={rightDatas} checkedKeys={rightCheckedKeys}
|
||||
checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })}
|
||||
onDoubleClick={this.onRightDoubleClick}
|
||||
/>
|
||||
</div>
|
||||
</React.Fragment> :
|
||||
<React.Fragment>
|
||||
<WeaInputSearch value={singleFilterVal} style={{ width: "100%", marginBottom: 10 }}
|
||||
onChange={singleFilterVal => this.setState({ singleFilterVal })}/>
|
||||
<WeaTransferList height={this.dialog ? this.dialog.state.height - 65 : 260} checkedKeys={[]}
|
||||
checkedCb={([id]) => this.handleRowClick(_.find(listDatas, item => item.id === id))}
|
||||
data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
</Spin>;
|
||||
if (dialogType === "table") {
|
||||
|
|
|
|||
|
|
@ -12,11 +12,51 @@ 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 } = this.props;
|
||||
const { datas, selectedKeys } = this.props;
|
||||
const list = datas.map(item => {
|
||||
return <li>
|
||||
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"/>
|
||||
|
|
|
|||
|
|
@ -14,25 +14,73 @@ import { Tree } from "antd";
|
|||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const TreeNode = Tree.TreeNode;
|
||||
|
||||
class CustomBrowserMutiRight extends Component {
|
||||
generateTreeNodes = () => {
|
||||
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);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { height } = this.props;
|
||||
const { height, checkedKeys } = this.props;
|
||||
return (
|
||||
<div className="wea-transfer-right">
|
||||
<WeaInputSearch/>
|
||||
<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}>*/}
|
||||
{/* {this.generateTreeNodes()}*/}
|
||||
{/*</Tree>*/}
|
||||
<Tree className="transfer-tree" draggable multiple={true} async={true} selectable={true}
|
||||
onSelect={this.checkHandler}
|
||||
onDoubleClick={this.onDoubleClick}
|
||||
selectedKeys={checkedKeys}>
|
||||
{this.generateTreeNodes()}
|
||||
</Tree>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -42,12 +42,12 @@ class CustomBrowserOperation extends Component {
|
|||
|
||||
const moveAllToLeftButton = (
|
||||
<Button type="primary" size="small" disabled={!leftAllActive} onClick={moveAllToRight}>
|
||||
{<span><i className="icon-coms-Browse-box-add-all"/></span>}
|
||||
{<span title={getLabel(111, "将当页数据全部添加到右侧已选列表")}><i className="icon-coms-right"/></span>}
|
||||
</Button>
|
||||
);
|
||||
const moveAllToRightButton = (
|
||||
<Button type="primary" size="small" disabled={!rightAllActive} onClick={moveAllToLeft}>
|
||||
{<span><i className="icon-coms-Browse-box-Delete-all"/></span>}
|
||||
{<span title={getLabel(111, "全部删除")}><i className="icon-coms-Browse-box-Delete-all"/></span>}
|
||||
</Button>
|
||||
);
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
*/
|
||||
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";
|
||||
|
|
@ -30,15 +31,24 @@ class Index extends Component {
|
|||
|
||||
componentDidMount() {
|
||||
const { value, fieldConfig } = this.props;
|
||||
const { browserConditionParam: { replaceDatas = [] } } = fieldConfig;
|
||||
if (value && replaceDatas.length > 0) {
|
||||
const { value: defaultValue, browserConditionParam: { replaceDatas = [] } } = fieldConfig;
|
||||
if ((value || defaultValue) && replaceDatas.length > 0) {
|
||||
this.setState({
|
||||
searchKeys: value.split(","),
|
||||
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;
|
||||
|
|
@ -55,16 +65,27 @@ class Index extends Component {
|
|||
};
|
||||
renderMult = () => {
|
||||
const { fieldConfig } = this.props;
|
||||
const { browserConditionParam = {} } = fieldConfig || {};
|
||||
const { selectedData, searchKeys } = this.state;
|
||||
return (<div>
|
||||
<AssociativeSearchMult
|
||||
{...fieldConfig}
|
||||
{...this.props}
|
||||
datas={selectedData}
|
||||
selectedValues={searchKeys}
|
||||
onChange={this.onBrowerChangeHandler}
|
||||
clickCallback={this.onBrowerClick}
|
||||
/>
|
||||
{
|
||||
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) => {
|
||||
|
|
@ -75,6 +96,7 @@ class Index extends Component {
|
|||
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(",") }
|
||||
|
|
|
|||
|
|
@ -11,12 +11,41 @@
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
.wea-input-focus {
|
||||
height: 35px !important;
|
||||
//width: 100% !important;
|
||||
.wea-hr-muti-dialog {
|
||||
.wea-input-focus {
|
||||
height: 35px !important;
|
||||
width: 100% !important;
|
||||
|
||||
input {
|
||||
height: 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Index extends Component {
|
|||
} else if (index === 1) {
|
||||
return { ...item, fixed: "left", width: 176 };
|
||||
}
|
||||
if (item.dataIndex === "operate") {
|
||||
if (item.dataIndex === "operate" || item.dataIndex === "opts") {
|
||||
return { ...item, fixed: "right", width: item.width || "120px" };
|
||||
}
|
||||
return { ...item, width: "33%" };
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
export const PAGE = {
|
||||
"salaryArchive": ["/hrmSalary/salaryFile"], //薪资档案
|
||||
"salarySob": ["/hrmSalary/ledger"], //薪资账套
|
||||
"salaryAcct": ["/hrmSalary/calculate", "/hrmSalary/calcView"], //薪资核算
|
||||
"salaryBill": ["/hrmSalary/payroll", "/hrmSalary/payrollGrant", "/hrmSalary/payrollDetail"], //工资单
|
||||
"taxDeclaration": ["/hrmSalary/declare", "/hrmSalary/generateDeclarationDetail"], //个税
|
||||
"addUpDeduction": ["/dataAcquisition/cumDeduct"], //累计专项附加扣除
|
||||
"specialAddDeduction": ["/dataAcquisition/specialAddDeduction"], //专项附加扣除
|
||||
"otherDeduction": ["/dataAcquisition/otherDeduct"], //其他免税扣除
|
||||
"addUpSituation": ["/dataAcquisition/cumSituation"], //往期累计情况
|
||||
"attendQuote": ["/dataAcquisition/attendance"], //考勤引用
|
||||
"myBill": ["/hrmSalary/mySalary", "/hrmSalary/mySalaryMobile"], //薪资福利
|
||||
"taxAgent": ["/hrmSalary/taxAgent"], //个税扣缴义务人
|
||||
"auth": ["/hrmSalary/roleManagement"], //业务管理线
|
||||
"variableArchive": ["/hrmSalary/variableSalary"], //浮动薪酬
|
||||
"siAccount": ["/socialSecurityBenefits/standingBook", "/socialSecurityBenefits/standingBookDetail", "/socialSecurityBenefits/sbofflineComparison"], //社保福利台账
|
||||
"siArchive": ["/socialSecurityBenefits/archives"], //社保档案
|
||||
"salaryField": ["/hrmSalary/fieldManagement"], //字段管理
|
||||
"salaryItem": ["/hrmSalary/salaryItem"], //薪资项目管理
|
||||
"siScheme": ["/socialSecurityBenefits/programme"], //社保福利方案
|
||||
"report": ["/hrmSalary/analysisOfSalaryStatistics", "/hrmSalary/reportView"] //报表
|
||||
};
|
||||
|
|
@ -42,6 +42,7 @@ import MobilePayroll from "./pages/mobilePayroll";
|
|||
import SysConfig from "./pages/sysConfig";
|
||||
import RuleConfig from "./pages/ruleConfig/ruleConfig";
|
||||
import Appconfig from "./pages/appConfig";
|
||||
import RoleManagement from "./pages/roleManagement";
|
||||
import FieldManagement from "./pages/fieldManagement";
|
||||
import AnalysisOfSalaryStatistics from "./pages/analysisOfSalaryStatistics";
|
||||
import EmployeeList from "./pages/employeeView";
|
||||
|
|
@ -52,6 +53,7 @@ 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 CustomRoutes from "./pages/custom-pages";
|
||||
|
|
@ -65,56 +67,9 @@ let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, "hrmSalary");
|
|||
getLocaleLabel = function (nextState, replace, callback) {
|
||||
callback();
|
||||
};
|
||||
|
||||
const Home = (props) => props.children;
|
||||
|
||||
const SocialSecurityBenefits = (props) => props.children;
|
||||
const DataAcquisition = (props) => props.children;
|
||||
|
||||
// historicalPayroll 历史工资单查看
|
||||
// salaryAdjustmentRecords 调薪记录查看
|
||||
|
||||
// mySalaryMobile 我的薪资福利-移动端
|
||||
// mySalaryMobile 我的薪资福利-移动端
|
||||
// mySalary 我的薪资福利
|
||||
// mySalaryView 我的薪资福利-查看工资单
|
||||
// socialSecurityBenefits 社保福利
|
||||
// programme 社保福利方案
|
||||
// archives 社保福利档案
|
||||
// standingBook 社保福利台账
|
||||
// sbofflineComparison 社保福利台账线下对比
|
||||
// salaryItem 薪资项目管理
|
||||
// salaryFile 薪资档案
|
||||
// dataAcquisition 数据采集
|
||||
// CumDeduct 累计专项附加扣除
|
||||
// otherDeduct 其他免税扣除
|
||||
// cumSituation 往期累计情况
|
||||
// attendance 考勤引用
|
||||
// specialAddDeduction 专项附件扣除
|
||||
// ledger 薪资账套
|
||||
// calculate 薪资核算
|
||||
// calculateDetail 核算详情
|
||||
// DoCalcDetail 核算详情页面-新
|
||||
// CalcView 核算查看页面-新
|
||||
// OfflineCompare 薪资核算线下对比-新
|
||||
// placeOnFileDetail 核算归档详情
|
||||
// compareDetail 线下线上对比
|
||||
// payroll 工资单发放
|
||||
// declare 个税申报表
|
||||
// generateDeclarationDetail 个税单详情
|
||||
// taxRate 个税税率表
|
||||
// taxAgent 个税扣缴义务人
|
||||
// mobilepayroll 移动端工资单
|
||||
// sysconfig 系統配置
|
||||
// sysconfig-1 规则配置
|
||||
// appconfig 应用配置
|
||||
// fieldManagement 字段管理
|
||||
// analysisOfSalaryStatistics 薪酬统计分析
|
||||
// reportView 薪酬报表查看
|
||||
// externalPersonManage 非系统人员管理
|
||||
// adjustSalaryManage 档案管理
|
||||
// supplementaryCalc 补算
|
||||
|
||||
const Routes = (
|
||||
<Route key="hrmSalary" path="hrmSalary" onEnter={getLocaleLabel} component={Layout}>
|
||||
<Route key="historicalPayroll" path="historicalPayroll" component={HistoricalPayroll}/>
|
||||
|
|
@ -161,6 +116,7 @@ const Routes = (
|
|||
<Route key="sysconfig" path="sysconfig" component={SysConfig}/>
|
||||
<Route key="sysconfig-1" path="sysconfig-1" component={RuleConfig}/>
|
||||
<Route key="appconfig" path="appconfig" component={Appconfig}/>
|
||||
<Route key="roleManagement" path="roleManagement" component={RoleManagement}/>
|
||||
<Route key="fieldManagement" path="fieldManagement" component={FieldManagement}/>
|
||||
<Route key="analysisOfSalaryStatistics" path="analysisOfSalaryStatistics" component={AnalysisOfSalaryStatistics}/>
|
||||
<Route key="analysisOfSalaryStatisticsId" path="analysisOfSalaryStatistics/:employeeId" component={EmployeeList}/>
|
||||
|
|
@ -168,6 +124,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}/>
|
||||
{CustomRoutes}
|
||||
</Route>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -8,12 +8,16 @@
|
|||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import Authority from "./pages/mySalary/authority";
|
||||
import stores from "./stores";
|
||||
|
||||
const { ls } = WeaTools;
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class Layout extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -40,13 +44,15 @@ class Layout extends Component {
|
|||
header.appendChild(link);
|
||||
top.$(".ant-message").remove();
|
||||
window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission();
|
||||
window.location.hash.indexOf("mobilepayroll") !== -1 && stores.taxAgentStore.initPageAndOptAuth();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<WeaLocaleProvider>{this.props.children}</WeaLocaleProvider>
|
||||
);
|
||||
const { taxAgentStore: { PageAndOptAuth, loading } } = this.props;
|
||||
return (<WeaLocaleProvider>
|
||||
<Authority store={{ loading, hasRight: PageAndOptAuth.able }}>{this.props.children}</Authority>
|
||||
</WeaLocaleProvider>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ class Index extends Component {
|
|||
|
||||
render() {
|
||||
const {
|
||||
taxAgentStore: { statisticsReportBtn },
|
||||
taxAgentStore: { PageAndOptAuth },
|
||||
attendanceStore: { statisticsForm, reportForm, tableStore }
|
||||
} = this.props;
|
||||
const {
|
||||
|
|
@ -283,6 +283,7 @@ class Index extends Component {
|
|||
reportName, keyword, year, logDialogVisible, filterConditions,
|
||||
dateRange, showSearchAd, isQuery
|
||||
} = this.state;
|
||||
const statisticsReportBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const buttons = selectedKey === "statistics" ? [
|
||||
<Button type="primary" onClick={() => this.handleReqBtnsClick("addReport")}>{getLabel(111, "新建报表")}</Button>,
|
||||
<Button type="ghost"
|
||||
|
|
@ -293,7 +294,7 @@ class Index extends Component {
|
|||
onSearch={() => this.handleReqBtnsClick("search")}/>
|
||||
] : selectedKey === "detail" ? [
|
||||
<span className="employeeYearWrapper">
|
||||
<span>{getLabel(111, "年薪资核算人员明细:")}</span>
|
||||
<span>{getLabel(111, "年度:")}</span>
|
||||
<WeaDatePicker value={year} format="YYYY" onChange={year => this.setState({ year })}/>
|
||||
</span>,
|
||||
<WeaInputSearch placeholder={getLabel(111, "请输入姓名、工号、身份证号")} className="search"
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,8 +40,9 @@ class Calculate extends Component {
|
|||
}
|
||||
|
||||
renderCalculateOpts = () => {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const { queryParams, isRefresh } = this.state;
|
||||
const admin = PageAndOptAuth.opts.includes("admin");
|
||||
let calculateOpts = [
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
calcDaialog: {
|
||||
|
|
@ -54,7 +55,7 @@ class Calculate extends Component {
|
|||
queryParams: { ...queryParams, ...v }
|
||||
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/>
|
||||
];
|
||||
return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts;
|
||||
return !admin ? calculateOpts.slice(1) : calculateOpts;
|
||||
};
|
||||
handleCalcOpts = ({ key }, record) => {
|
||||
const { isRefresh, progressModule } = this.state, { id } = record;
|
||||
|
|
@ -198,8 +199,7 @@ class Calculate extends Component {
|
|||
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(545781, "操作日志")
|
||||
}
|
||||
]}
|
||||
>
|
||||
]}>
|
||||
<div className="calculate-body">
|
||||
<CalculateTablelist queryParams={queryParams} isRefresh={isRefresh} onCalcOpts={this.handleCalcOpts}/>
|
||||
<CalculateDialog {...calcDaialog}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,12 @@ class Index extends Component {
|
|||
</span>,
|
||||
render: (__, record) => {
|
||||
const { operate: opts = [] } = record;
|
||||
const operate = [...opts, { index: "log", text: getLabel(30586, "查看日志") }];
|
||||
const admin = record.opts.includes("admin");
|
||||
const operate = admin ? [...opts, { index: "log", text: getLabel(30586, "查看日志") }] : [
|
||||
{ index: "3", text: getLabel(111, "查看") },
|
||||
{ index: "null", text: "" },
|
||||
{ index: "log", text: getLabel(30586, "查看日志") }
|
||||
];
|
||||
return <React.Fragment>
|
||||
{
|
||||
_.map(operate.slice(0, 2), f => (
|
||||
|
|
|
|||
|
|
@ -242,13 +242,21 @@ class Index extends Component {
|
|||
<BaseInfo {...this.props}/>
|
||||
<WeaTab
|
||||
datas={tabDatas} keyParam="viewcondition" selectedKey={selectedKey}
|
||||
onChange={v => this.setState({ selectedKey: v }, () => this.queryPCList())}
|
||||
onChange={v => this.setState({
|
||||
selectedKey: v,
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.queryPCList())}
|
||||
onSearch={v => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.queryPCList())}
|
||||
onAdSearch={v => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.queryPCList())}
|
||||
buttons={this.renderTabBtns()} searchType={["base", "advanced"]} advanceHeight={220}
|
||||
showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })}
|
||||
searchsAd={getSearchs(PCSearchForm, searchConditions, 2, false)}
|
||||
onSearchChange={(v) => PCSearchForm.updateFields({ employeeName: v })}
|
||||
searchsBaseValue={PCSearchForm.getFormParams().employeeName}
|
||||
onSearch={this.queryPCList} onAdSearch={this.queryPCList}
|
||||
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
|
||||
/>
|
||||
<WeaTable
|
||||
|
|
|
|||
|
|
@ -271,6 +271,9 @@ class EditCalcTable extends Component {
|
|||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleQuery = () => {
|
||||
this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } }, () => this.queryCalcResultList());
|
||||
};
|
||||
handleBatchEditing = () => {
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Index extends Component {
|
|||
|
||||
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
|
||||
onAdSearch = (bool = true) => {
|
||||
this.calcTableRef.wrappedInstance.queryCalcResultList();
|
||||
this.calcTableRef.wrappedInstance.handleQuery();
|
||||
bool && this.openAdvanceSearch();
|
||||
};
|
||||
init = async () => {
|
||||
|
|
|
|||
|
|
@ -18,23 +18,21 @@ class Layout extends Component {
|
|||
}
|
||||
|
||||
salaryacctAcctresultCheckAuth = () => {
|
||||
const { taxAgentStore: { getPermission } } = this.props;
|
||||
this.setState({ store: { ...this.state.store, loading: true } });
|
||||
getPermission().then(({ data }) => {
|
||||
const { isOpenDevolution } = data;
|
||||
if (isOpenDevolution) {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
salaryacctAcctresultCheckAuth({ salaryAcctRecordId }).then(({ status, data }) => {
|
||||
this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } }, () => {
|
||||
this.state.store.hasRight && this.props.init && this.props.init();
|
||||
});
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const { isOpenDevolution } = PageAndOptAuth;
|
||||
if (isOpenDevolution) {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
this.setState({ store: { ...this.state.store, loading: true } });
|
||||
salaryacctAcctresultCheckAuth({ salaryAcctRecordId }).then(({ status, data }) => {
|
||||
this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } }, () => {
|
||||
this.state.store.hasRight && this.props.init && this.props.init();
|
||||
});
|
||||
} else {
|
||||
this.setState({ store: { ...this.state.store, loading: false, hasRight: true } }, () => {
|
||||
this.props.init && this.props.init();
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ store: { ...this.state.store, loading: false } }));
|
||||
});
|
||||
} else {
|
||||
this.setState({ store: { ...this.state.store, loading: false, hasRight: true } }, () => {
|
||||
this.props.init && this.props.init();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
|
|
|||
|
|
@ -36,21 +36,19 @@ export default class CompareDetail extends React.Component {
|
|||
current: 1
|
||||
};
|
||||
fetchComparisonResultList(params);
|
||||
this.salaryacctAcctresultCheckAuth({ salaryAcctRecordId: getQueryString("id") })
|
||||
this.salaryacctAcctresultCheckAuth({ salaryAcctRecordId: getQueryString("id") });
|
||||
}
|
||||
|
||||
salaryacctAcctresultCheckAuth = (params) => {
|
||||
const { taxAgentStore: { getPermission } } = this.props;
|
||||
getPermission().then(({ data }) => {
|
||||
const { isOpenDevolution } = data;
|
||||
if (isOpenDevolution) {
|
||||
salaryacctAcctresultCheckAuth(params).then(({ status, data }) => {
|
||||
this.setState({ calculateAuth: data && status });
|
||||
});
|
||||
} else {
|
||||
this.setState({ calculateAuth: true });
|
||||
}
|
||||
});
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const { isOpenDevolution } = PageAndOptAuth;
|
||||
if (isOpenDevolution) {
|
||||
salaryacctAcctresultCheckAuth(params).then(({ status, data }) => {
|
||||
this.setState({ calculateAuth: data && status });
|
||||
});
|
||||
} else {
|
||||
this.setState({ calculateAuth: true });
|
||||
}
|
||||
};
|
||||
|
||||
getColumns = (columns) => {
|
||||
|
|
|
|||
|
|
@ -69,17 +69,15 @@ export default class CalculateDetail extends React.Component {
|
|||
}
|
||||
|
||||
salaryacctAcctresultCheckAuth = (params) => {
|
||||
const { taxAgentStore: { getPermission } } = this.props;
|
||||
getPermission().then(({ data }) => {
|
||||
const { isOpenDevolution } = data;
|
||||
if (isOpenDevolution) {
|
||||
salaryacctAcctresultCheckAuth(params).then(({ status, data }) => {
|
||||
this.setState({ calculateAuth: data && status });
|
||||
});
|
||||
} else {
|
||||
this.setState({ calculateAuth: true });
|
||||
}
|
||||
});
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const { isOpenDevolution } = PageAndOptAuth;
|
||||
if (isOpenDevolution) {
|
||||
salaryacctAcctresultCheckAuth(params).then(({ status, data }) => {
|
||||
this.setState({ calculateAuth: data && status });
|
||||
});
|
||||
} else {
|
||||
this.setState({ calculateAuth: true });
|
||||
}
|
||||
};
|
||||
|
||||
Input = (value, key) => {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import {
|
|||
deleteAttendance,
|
||||
getAttendanceFieldSettingList,
|
||||
getAttendanceList,
|
||||
getLedgerList,
|
||||
getSalaryCycleAndAttendCycle,
|
||||
importAttendQuoteData,
|
||||
returnToAttendanceFieldSettingDefault,
|
||||
|
|
@ -26,6 +25,7 @@ import moment from "moment";
|
|||
import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper";
|
||||
import AttendanceRefrenceDataModal from "./attendanceRefrenceDataModal";
|
||||
import AttendanceDataViewSlide from "./attendanceDataViewSlide";
|
||||
import { postFetch } from "../../../../util/request";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ class AttendanceDataComp extends Component {
|
|||
},
|
||||
fieldSetPayload: { visible: false, title: "", children: null },
|
||||
attendanceReferencePayload: { visible: false, title: "" },
|
||||
attendanceViewPayload: { visible: false, attendQuoteId: "", salaryYearMonth: "" }
|
||||
attendanceViewPayload: { visible: false, attendQuoteId: "", salaryYearMonth: "", showOperateBtn: false }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -85,25 +85,26 @@ class AttendanceDataComp extends Component {
|
|||
};
|
||||
getLedgerList = (importData) => {
|
||||
const { importFormPayload } = this.state;
|
||||
getLedgerList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
importFormPayload: {
|
||||
...importFormPayload, salarySobId: _.head(data).id,
|
||||
salarySobList: _.map(data, it => ({ key: it.id, showname: it.content }))
|
||||
}
|
||||
}, async () => {
|
||||
const { importFormPayload } = this.state;
|
||||
const { salaryYearMonth, salarySobId } = importFormPayload;
|
||||
const payload = { salaryYearMonthStr: salaryYearMonth, salarySobId };
|
||||
const { data } = await getSalaryCycleAndAttendCycle(payload);
|
||||
postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
importData: { ...importData, params: { salaryYearMonth, salarySobId } },
|
||||
importFormPayload: { ...importFormPayload, ...data }
|
||||
importFormPayload: {
|
||||
...importFormPayload, salarySobId: String(_.head(data).id),
|
||||
salarySobList: _.map(data, it => ({ key: String(it.id), showname: it.name }))
|
||||
}
|
||||
}, async () => {
|
||||
const { importFormPayload } = this.state;
|
||||
const { salaryYearMonth, salarySobId } = importFormPayload;
|
||||
const payload = { salaryYearMonthStr: salaryYearMonth, salarySobId };
|
||||
const { data } = await getSalaryCycleAndAttendCycle(payload);
|
||||
this.setState({
|
||||
importData: { ...importData, params: { salaryYearMonth, salarySobId } },
|
||||
importFormPayload: { ...importFormPayload, ...data }
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleChangeImportPayload = (key, value) => {
|
||||
const { importFormPayload, importData } = this.state;
|
||||
|
|
@ -149,11 +150,11 @@ class AttendanceDataComp extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
handleViewAttendanceData = ({ id, attendCycle }) => {
|
||||
handleViewAttendanceData = ({ id, attendCycle, opts = [] }) => {
|
||||
const { attendanceViewPayload } = this.state;
|
||||
this.setState({
|
||||
attendanceViewPayload: {
|
||||
...attendanceViewPayload,
|
||||
...attendanceViewPayload, showOperateBtn: opts.includes("admin"),
|
||||
visible: true, attendQuoteId: id,
|
||||
salaryYearMonth: attendCycle
|
||||
}
|
||||
|
|
@ -287,7 +288,7 @@ class AttendanceDataComp extends Component {
|
|||
dataSource, columns, pageInfo, loading, importData, importFormPayload, fieldSetPayload,
|
||||
attendanceReferencePayload, attendanceViewPayload
|
||||
} = this.state;
|
||||
const { showOperateBtn, salaryYearMonth } = this.props;
|
||||
const { salaryYearMonth } = this.props;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
|
|
@ -315,10 +316,11 @@ class AttendanceDataComp extends Component {
|
|||
width: 120,
|
||||
dataIndex: "operate",
|
||||
render: (_, record) => {
|
||||
const { opts = [] } = record;
|
||||
return (
|
||||
<div className="linkWapper">
|
||||
<a href="javascript: void(0);" onClick={() => this.handleViewAttendanceData(record)}>查看</a>
|
||||
{showOperateBtn &&
|
||||
{opts.includes("admin") &&
|
||||
<React.Fragment>
|
||||
<a href="javascript: void(0);" style={{ marginRight: 10 }}
|
||||
onClick={() => this.handleDeleteAttendanceData(record)}>删除</a>
|
||||
|
|
@ -336,9 +338,18 @@ class AttendanceDataComp extends Component {
|
|||
</React.Fragment>
|
||||
}
|
||||
{
|
||||
!showOperateBtn &&
|
||||
<a href="javascript:void(0)"
|
||||
onClick={() => this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")}</a>
|
||||
!opts.includes("admin") &&
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a href="javascript:void(0)"
|
||||
onClick={() => this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")}</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
|
|
@ -361,14 +372,13 @@ class AttendanceDataComp extends Component {
|
|||
{/* 考勤数据引用 */}
|
||||
<AttendanceRefrenceDataModal {...attendanceReferencePayload} onCancel={this.handleCloseQuoteModal}/>
|
||||
{/* 考勤数据查看 */}
|
||||
<AttendanceDataViewSlide {...attendanceViewPayload} showOperateBtn={showOperateBtn}
|
||||
onClose={() => this.setState({
|
||||
attendanceViewPayload: {
|
||||
...attendanceViewPayload,
|
||||
visible: false,
|
||||
attendQuoteId: ""
|
||||
}
|
||||
})}/>
|
||||
<AttendanceDataViewSlide {...attendanceViewPayload} onClose={() => this.setState({
|
||||
attendanceViewPayload: {
|
||||
...attendanceViewPayload,
|
||||
visible: false,
|
||||
attendQuoteId: ""
|
||||
}
|
||||
})}/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import { getSearchs } from "../../../../util";
|
|||
import {
|
||||
checkOperation,
|
||||
getAttendanceFieldSettingList,
|
||||
getLedgerList,
|
||||
returnToAttendanceFieldSettingDefault,
|
||||
saveAttendanceFieldSetting,
|
||||
saveAttendanceFieldSettingAsDefault,
|
||||
|
|
@ -21,6 +20,7 @@ import {
|
|||
} from "../../../../apis/attendance";
|
||||
import SelectItemModal from "../../../../components/selectItemsModal";
|
||||
import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper";
|
||||
import { postFetch } from "../../../../util/request";
|
||||
import "./index.less";
|
||||
|
||||
@inject("attendanceStore")
|
||||
|
|
@ -46,25 +46,26 @@ class AttendanceRefrenceDataModal extends Component {
|
|||
|
||||
getLedgerList = () => {
|
||||
const { attendanceStore: { refenceform } } = this.props;
|
||||
getLedgerList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
condition: _.map(reFrenceConditions, (item) => {
|
||||
const { items } = item;
|
||||
return {
|
||||
...item,
|
||||
items: _.map(items, child => {
|
||||
const { domkey } = child;
|
||||
if (domkey[0] === "salarySobIds") {
|
||||
return { ...child, options: _.map(data, it => ({ key: it.id, showname: it.content })) };
|
||||
}
|
||||
return { ...child };
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => refenceform.initFormFields(this.state.condition));
|
||||
}
|
||||
});
|
||||
postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
condition: _.map(reFrenceConditions, (item) => {
|
||||
const { items } = item;
|
||||
return {
|
||||
...item,
|
||||
items: _.map(items, child => {
|
||||
const { domkey } = child;
|
||||
if (domkey[0] === "salarySobIds") {
|
||||
return { ...child, options: _.map(data, it => ({ key: String(it.id), showname: it.name })) };
|
||||
}
|
||||
return { ...child };
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => refenceform.initFormFields(this.state.condition));
|
||||
}
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ class Index extends Component {
|
|||
|
||||
render() {
|
||||
const { selectedKey, salaryMonth, fieldName, logDialogVisible, filterConditions } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const topTab = [
|
||||
{ title: "考勤数据", key: "DATA" },
|
||||
{ title: "字段管理", key: "FIELD" }
|
||||
|
|
@ -115,7 +116,6 @@ class Index extends Component {
|
|||
selectedKey === "DATA" ?
|
||||
<AttendanceDataComp
|
||||
ref={dom => this.attendanceTableRef = dom}
|
||||
showOperateBtn={showOperateBtn}
|
||||
salaryYearMonth={salaryMonth}
|
||||
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
|
||||
/> :
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import TableRecord from "../components/tableRecord";
|
|||
import { dataCollectCondition } from "./columns";
|
||||
import { removePropertyCondition } from "../../../util/response";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import Layout from "../layout";
|
||||
import moment from "moment";
|
||||
|
||||
|
|
@ -65,7 +66,8 @@ class Index extends Component {
|
|||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null,
|
||||
targetid: ""
|
||||
targetid: "",
|
||||
taxAgentOption: []
|
||||
};
|
||||
this.tableRef = null;
|
||||
this.addItemRef = null;
|
||||
|
|
@ -102,11 +104,15 @@ class Index extends Component {
|
|||
* Params:
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
getAdvanceCondition = () => {
|
||||
getAdvanceCondition = async () => {
|
||||
const { cumDeductStore: { form } } = this.props;
|
||||
const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" });
|
||||
getCumDeductSaCondition().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({ advanceCondition: removePropertyCondition(data.condition) });
|
||||
this.setState({
|
||||
advanceCondition: removePropertyCondition(data.condition),
|
||||
taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name }))
|
||||
});
|
||||
form.initFormFields(removePropertyCondition(data.condition));
|
||||
}
|
||||
});
|
||||
|
|
@ -235,7 +241,8 @@ class Index extends Component {
|
|||
}
|
||||
};
|
||||
handleSaveData = () => {
|
||||
const { cumDeductStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { cumDeductStore: { addForm } } = this.props, { slidePayload } = this.state;
|
||||
const taxAgentOption = slidePayload.children.props.taxAgentOption;
|
||||
addForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = {
|
||||
|
|
@ -258,10 +265,11 @@ class Index extends Component {
|
|||
* Params: screenParams规则:日期必须放在数组最后一位,人员信息必须第一位
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
handleAddData = (title = "新建", editId = {}) => {
|
||||
const { taxAgentStore, cumDeductStore: { addForm } } = this.props;
|
||||
handleAddData = async (title = "新建", editId = {}) => {
|
||||
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
|
||||
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
|
||||
const { cumDeductStore: { addForm } } = this.props;
|
||||
const { slidePayload } = this.state;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const conditions = _.map(dataCollectCondition, (it, idx) => {
|
||||
if (idx === 0) {
|
||||
return {
|
||||
|
|
@ -347,8 +355,7 @@ class Index extends Component {
|
|||
* Date: 2023/2/17
|
||||
*/
|
||||
getScreen = () => {
|
||||
const { taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { declareMonth, taxAgentId, innerWidth } = this.state;
|
||||
const { declareMonth, taxAgentId, innerWidth, taxAgentOption } = this.state;
|
||||
const items = [
|
||||
{
|
||||
com: DataCollectionDatePicker({
|
||||
|
|
@ -461,10 +468,11 @@ class Index extends Component {
|
|||
* Params:
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
handleOpenImport = () => {
|
||||
handleOpenImport = async () => {
|
||||
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
|
||||
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
|
||||
const { importPayload } = this.state;
|
||||
const { importOpts } = importPayload;
|
||||
const { taxAgentStore: { taxAgentOption } } = this.props;
|
||||
this.setState({
|
||||
importPayload: {
|
||||
...importPayload,
|
||||
|
|
@ -496,7 +504,7 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { showOperateBtn }, cumDeductStore: { form } } = this.props;
|
||||
const { cumDeductStore: { form } } = this.props;
|
||||
const {
|
||||
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
|
||||
importPayload, exportPayloadType, targetid
|
||||
|
|
@ -517,7 +525,6 @@ class Index extends Component {
|
|||
ref={dom => this.tableRef = dom}
|
||||
url="/api/bs/hrmsalary/addUpDeduction/list"
|
||||
payload={tablePayload}
|
||||
showOperateBtn={showOperateBtn}
|
||||
onTableOperate={this.handleTableOperate}
|
||||
onViewDetails={(record) => this.handleAddData("累计专项附加扣除记录", record)}
|
||||
form={form}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import { dataCollectCondition, taxOptions } from "./columns";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { postFetch } from "../../../util/request";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -62,7 +63,8 @@ class Index extends Component {
|
|||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null,
|
||||
targetid: ""
|
||||
targetid: "",
|
||||
taxAgentOption: []
|
||||
};
|
||||
this.tableRef = null;
|
||||
this.addItemRef = null;
|
||||
|
|
@ -79,11 +81,15 @@ class Index extends Component {
|
|||
* Params:
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
getAdvanceCondition = () => {
|
||||
getAdvanceCondition = async () => {
|
||||
const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" });
|
||||
const { cumSituationStore: { form } } = this.props;
|
||||
getCumSituationSaCondition().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({ advanceCondition: removePropertyCondition(data.condition) });
|
||||
this.setState({
|
||||
advanceCondition: removePropertyCondition(data.condition),
|
||||
taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name }))
|
||||
});
|
||||
form.initFormFields(removePropertyCondition(data.condition));
|
||||
}
|
||||
});
|
||||
|
|
@ -141,10 +147,11 @@ class Index extends Component {
|
|||
* Params: screenParams规则:日期必须放在数组最后一位,人员信息必须第一位
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
handleAddData = (title = "新建", editId = {}) => {
|
||||
const { taxAgentStore, cumSituationStore: { addForm } } = this.props;
|
||||
handleAddData = async (title = "新建", editId = {}) => {
|
||||
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
|
||||
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
|
||||
const { cumSituationStore: { addForm } } = this.props;
|
||||
const { slidePayload } = this.state;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const conditions = _.map(dataCollectCondition, (it, idx) => {
|
||||
if (idx === 0) {
|
||||
return {
|
||||
|
|
@ -323,8 +330,7 @@ class Index extends Component {
|
|||
* Date: 2023/2/17
|
||||
*/
|
||||
getScreen = () => {
|
||||
const { taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { declareMonth, year, taxAgentId, innerWidth } = this.state;
|
||||
const { declareMonth, year, taxAgentId, innerWidth, taxAgentOption } = this.state;
|
||||
const items = [
|
||||
{
|
||||
com: DataCollectionDatePicker({
|
||||
|
|
@ -388,7 +394,8 @@ class Index extends Component {
|
|||
this.props.cumSituationStore.initAddForm();
|
||||
};
|
||||
handleSaveData = () => {
|
||||
const { cumSituationStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { cumSituationStore: { addForm } } = this.props, { slidePayload } = this.state;
|
||||
const taxAgentOption = slidePayload.children.props.taxAgentOption;
|
||||
addForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
import React, { Component } from "react";
|
||||
import UnifiedTable from "../../components/UnifiedTable";
|
||||
import { getTableDate } from "../../apis/cumDeduct";
|
||||
import { Menu, Popover } from "antd";
|
||||
import { Menu, Popover, Spin } from "antd";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -62,7 +62,7 @@ class DataTables extends Component {
|
|||
|
||||
render() {
|
||||
const { columns, dataSource, loading, selectedRowKeys, pageInfo } = this.state;
|
||||
const { showOperateBtn, onTableOperate, onViewDetails, isSpecial = false, form } = this.props;
|
||||
const { onTableOperate, onViewDetails, isSpecial = false, form } = this.props;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
|
|
@ -104,7 +104,7 @@ class DataTables extends Component {
|
|||
</a>;
|
||||
}
|
||||
};
|
||||
} else if (dataIndex === "operate") {
|
||||
} else if (dataIndex === "operate" || dataIndex === "opts") {
|
||||
return {
|
||||
...item,
|
||||
width: 150,
|
||||
|
|
@ -113,47 +113,48 @@ class DataTables extends Component {
|
|||
{
|
||||
!isSpecial &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
|
||||
{
|
||||
record.opts.includes("admin") &&
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
|
||||
}
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onViewDetails(record)}>查看明细</a>
|
||||
{
|
||||
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>
|
||||
}
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
{
|
||||
record.opts.includes("admin") &&
|
||||
<Menu.Item key="deleteSelectAddUpDeduction">{getLabel(111, "删除")}</Menu.Item>
|
||||
}
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
</React.Fragment>
|
||||
}
|
||||
{
|
||||
isSpecial &&
|
||||
<React.Fragment>
|
||||
{
|
||||
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>
|
||||
record.opts.includes("admin") &&
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>{getLabel(111, "编辑")}</a>
|
||||
}
|
||||
{
|
||||
record.opts.includes("admin") &&
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>{getLabel(111, "删除")}</a>
|
||||
}
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
|
|
@ -168,15 +169,10 @@ class DataTables extends Component {
|
|||
};
|
||||
}
|
||||
});
|
||||
return <UnifiedTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={getColumns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
xWidth={getColumns.length * 160}
|
||||
/>;
|
||||
return (<Spin spinning={loading.query}>
|
||||
<UnifiedTable rowKey="id" rowSelection={rowSelection} columns={getColumns}
|
||||
dataSource={dataSource} pagination={pagination} loading={loading.query}
|
||||
xWidth={getColumns.length * 160}/> </Spin>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ class Layout extends Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
|
||||
fetchTaxAgentOption();
|
||||
window.addEventListener("resize", this.resizeUpdate);
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +75,7 @@ class Layout extends Component {
|
|||
render() {
|
||||
const { showSearchAd, logDialogVisible, filterConditions } = this.state;
|
||||
const {
|
||||
title, btns, leftComp, children, taxAgentStore: { showOperateBtn },
|
||||
title, btns, leftComp, children, taxAgentStore: { PageAndOptAuth },
|
||||
slidePayload, onClose, onSave, slideLoading, form, condition, onImportFile,
|
||||
onAdSearch, onCancel, importPayload, detailOptBtns, logFunction, onClearTargrtid
|
||||
} = this.props;
|
||||
|
|
@ -86,6 +84,7 @@ class Layout extends Component {
|
|||
visible: importVisiable, importFormComponent, importOpts,
|
||||
importResult, templateLink, previewUrl
|
||||
} = importPayload;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
return (
|
||||
<div className="layoutWrapper">
|
||||
<WeaTop title={title} buttons={showOperateBtn ? btns : []}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import { dataCollectCondition } from "./columns";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { postFetch } from "../../../util/request";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -63,7 +64,8 @@ class Index extends Component {
|
|||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null,
|
||||
targetid: ""
|
||||
targetid: "",
|
||||
taxAgentOption: []
|
||||
};
|
||||
this.tableRef = null;
|
||||
this.addItemRef = null;
|
||||
|
|
@ -80,11 +82,15 @@ class Index extends Component {
|
|||
* Params:
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
getAdvanceCondition = () => {
|
||||
getAdvanceCondition = async () => {
|
||||
const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" });
|
||||
const { otherDeductStore: { form } } = this.props;
|
||||
getOtherDeductSaCondition().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({ advanceCondition: removePropertyCondition(data.condition) });
|
||||
this.setState({
|
||||
advanceCondition: removePropertyCondition(data.condition),
|
||||
taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name }))
|
||||
});
|
||||
form.initFormFields(removePropertyCondition(data.condition));
|
||||
}
|
||||
});
|
||||
|
|
@ -269,10 +275,11 @@ class Index extends Component {
|
|||
* Params: screenParams规则:日期必须放在数组最后一位,人员信息必须第一位
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
handleAddData = (title = "新建", editId = {}) => {
|
||||
const { taxAgentStore, otherDeductStore: { addForm } } = this.props;
|
||||
handleAddData = async (title = "新建", editId = {}) => {
|
||||
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
|
||||
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
|
||||
const { otherDeductStore: { addForm } } = this.props;
|
||||
const { slidePayload } = this.state;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const conditions = _.map(dataCollectCondition, (it, idx) => {
|
||||
if (idx === 0) {
|
||||
return {
|
||||
|
|
@ -358,8 +365,7 @@ class Index extends Component {
|
|||
* Date: 2023/2/17
|
||||
*/
|
||||
getScreen = () => {
|
||||
const { taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { declareMonth, taxAgentId, innerWidth } = this.state;
|
||||
const { declareMonth, taxAgentId, innerWidth, taxAgentOption } = this.state;
|
||||
const items = [
|
||||
{
|
||||
com: DataCollectionDatePicker({
|
||||
|
|
@ -403,7 +409,8 @@ class Index extends Component {
|
|||
this.props.otherDeductStore.initAddForm();
|
||||
};
|
||||
handleSaveData = () => {
|
||||
const { otherDeductStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { otherDeductStore: { addForm } } = this.props, { slidePayload } = this.state;
|
||||
const taxAgentOption = slidePayload.children.props.taxAgentOption;
|
||||
addForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import { condition } from "./components/condition";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { postFetch } from "../../../util/request";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -52,7 +53,8 @@ class Index extends Component {
|
|||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null,
|
||||
targetid: ""
|
||||
targetid: "",
|
||||
taxAgentOption: []
|
||||
};
|
||||
this.tableRef = null;
|
||||
this.addItemRef = null;
|
||||
|
|
@ -104,11 +106,15 @@ class Index extends Component {
|
|||
* Params:
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
getAdvanceCondition = () => {
|
||||
getAdvanceCondition = async () => {
|
||||
const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" });
|
||||
const { specialAddStore: { advanceForm } } = this.props;
|
||||
getSearchCondition().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({ advanceCondition: removePropertyCondition(data.condition) });
|
||||
this.setState({
|
||||
advanceCondition: removePropertyCondition(data.condition),
|
||||
taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name }))
|
||||
});
|
||||
advanceForm.initFormFields(removePropertyCondition(data.condition));
|
||||
}
|
||||
});
|
||||
|
|
@ -207,8 +213,7 @@ class Index extends Component {
|
|||
* Date: 2023/2/17
|
||||
*/
|
||||
getScreen = () => {
|
||||
const { taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { taxAgentId } = this.state;
|
||||
const { taxAgentId, taxAgentOption } = this.state;
|
||||
const items = [
|
||||
{
|
||||
com: DataCollectionSelect({
|
||||
|
|
@ -257,10 +262,11 @@ class Index extends Component {
|
|||
* Params: screenParams规则:日期必须放在数组最后一位,人员信息必须第一位
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
handleAddData = (title = "新建", editId = {}) => {
|
||||
const { taxAgentStore, specialAddStore: { addForm } } = this.props;
|
||||
handleAddData = async (title = "新建", editId = {}) => {
|
||||
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
|
||||
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
|
||||
const { specialAddStore: { addForm } } = this.props;
|
||||
const { slidePayload } = this.state;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const conditions = _.map(condition, (it, idx) => {
|
||||
if (idx === 0) {
|
||||
return {
|
||||
|
|
@ -341,7 +347,8 @@ class Index extends Component {
|
|||
this.props.specialAddStore.initAddForm();
|
||||
};
|
||||
handleSaveData = () => {
|
||||
const { specialAddStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { specialAddStore: { addForm } } = this.props, { slidePayload } = this.state;
|
||||
const taxAgentOption = slidePayload.children.props.taxAgentOption;
|
||||
addForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = {
|
||||
|
|
@ -369,10 +376,11 @@ class Index extends Component {
|
|||
* Params:
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
handleOpenImport = () => {
|
||||
handleOpenImport = async () => {
|
||||
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
|
||||
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
|
||||
const { importPayload } = this.state;
|
||||
const { importOpts } = importPayload;
|
||||
const { taxAgentStore: { taxAgentOption } } = this.props;
|
||||
this.setState({
|
||||
importPayload: {
|
||||
...importPayload,
|
||||
|
|
@ -403,7 +411,7 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { showOperateBtn }, specialAddStore: { advanceForm } } = this.props;
|
||||
const { specialAddStore: { advanceForm } } = this.props;
|
||||
const {
|
||||
taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, importPayload,
|
||||
exportPayloadType, targetid
|
||||
|
|
@ -425,7 +433,6 @@ class Index extends Component {
|
|||
url="/api/bs/hrmsalary/specialAddDeduction/list"
|
||||
payload={tablePayload}
|
||||
isSpecial
|
||||
showOperateBtn={showOperateBtn}
|
||||
onTableOperate={this.handleTableOperate}
|
||||
onViewDetails={(record) => this.handleAddData("专项附加扣除记录", record)}
|
||||
form={advanceForm}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import { inject, observer } from "mobx-react";
|
|||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { getTaxAgentSelectListAsAdmin } from "../../../../apis/taxAgent";
|
||||
import { saveDeclare } from "../../../../apis/declare";
|
||||
import { declareConditions } from "./condition";
|
||||
import { postFetch } from "../../../../util/request";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -33,24 +33,26 @@ class Index extends Component {
|
|||
|
||||
getTaxAgentSelectListAsAdmin = (props) => {
|
||||
const { declareStore: { declareForm } } = props;
|
||||
getTaxAgentSelectListAsAdmin().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(declareConditions, item => ({
|
||||
...item,
|
||||
items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgentId") {
|
||||
return {
|
||||
...o, options: _.map(data, g => ({ key: g.id, showname: g.content }))
|
||||
// helpfulTitle: getLabel(563420, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;")
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
}))
|
||||
}, () => declareForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
});
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(declareConditions, item => ({
|
||||
...item,
|
||||
items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgentId") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
options: _.map(data, g => ({ key: String(g.id), showname: g.name }))
|
||||
// helpfulTitle: getLabel(563420, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;")
|
||||
};
|
||||
}
|
||||
return { ...o, label: getLabel(o.lanId, o.label) };
|
||||
})
|
||||
}))
|
||||
}, () => declareForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
});
|
||||
};
|
||||
save = () => {
|
||||
const { declareStore: { declareForm } } = this.props;
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class Index extends Component {
|
|||
{
|
||||
dataIndex: "operate", title: getLabel(30585, "操作"),
|
||||
width: 170, render: (__, record) => {
|
||||
const { id } = record;
|
||||
const { id, opts = [] } = record;
|
||||
return <React.Fragment>
|
||||
<a
|
||||
href={`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=${id}`}
|
||||
|
|
@ -122,7 +122,7 @@ class Index extends Component {
|
|||
onClick={() => this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")}</a>
|
||||
}
|
||||
{
|
||||
showWithDrawBtn &&
|
||||
showWithDrawBtn && opts.includes("admin") &&
|
||||
<a
|
||||
href="javascript:void(0);" style={{ marginLeft: 10 }}
|
||||
onClick={() => {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ class Calculate extends Component {
|
|||
}
|
||||
|
||||
renderCalculateOpts = () => {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const { queryParams, isRefresh } = this.state;
|
||||
let calculateOpts = [
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { Spin } from "antd";
|
|||
import { inject, observer } from "mobx-react";
|
||||
import { MonthRangePicker } from "../reportView/components/statisticalMicroSettingsSlide";
|
||||
import { optionAddWhole } from "../../util/options";
|
||||
import { postFetch } from "../../util/request";
|
||||
import moment from "moment";
|
||||
import "./index.less";
|
||||
|
||||
|
|
@ -24,11 +25,8 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false,
|
||||
taxAgentId: "",
|
||||
countResult: {},
|
||||
loading: false, taxAgentId: "", countResult: {}, dataSource: [], taxAgentOption: [],
|
||||
salaryMonth: [moment().startOf("year").format("YYYY-MM"), moment().format("YYYY-MM")],
|
||||
dataSource: [],
|
||||
pageInfo: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
|
|
@ -38,8 +36,10 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
|
||||
fetchTaxAgentOption();
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) this.setState({ taxAgentOption: _.map(data, o => ({ key: String(o.id), showname: o.name })) });
|
||||
});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
|
@ -76,7 +76,6 @@ class Index extends Component {
|
|||
dataSource, columns, showSum, pageInfo, countResult
|
||||
}), "*");
|
||||
};
|
||||
|
||||
statisticsEmployeeDetailList = () => {
|
||||
const { params: { employeeId }, payrollFilesStore: { statisticsEmployeeDetailList } } = this.props;
|
||||
const { taxAgentId, salaryMonth, pageInfo } = this.state;
|
||||
|
|
@ -104,7 +103,6 @@ class Index extends Component {
|
|||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
|
||||
getColumns = () => {
|
||||
const { dataSource, pageInfo, countResult } = this.state;
|
||||
const { payrollFilesStore: { employeeTableStore } } = this.props;
|
||||
|
|
@ -121,13 +119,10 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
location,
|
||||
taxAgentStore: { showOperateBtn, taxAgentOption },
|
||||
payrollFilesStore: { employeeTableStore }
|
||||
} = this.props;
|
||||
const { salaryMonth, taxAgentId, loading } = this.state;
|
||||
const { location, taxAgentStore: { PageAndOptAuth }, payrollFilesStore: { employeeTableStore } } = this.props;
|
||||
const { salaryMonth, taxAgentId, loading, taxAgentOption } = this.state;
|
||||
const { query: { dept, name } } = location;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const btns = [
|
||||
<MonthRangePicker viewAttr={2} dateRange={salaryMonth}
|
||||
onChange={v => this.setState({ salaryMonth: v }, () => this.statisticsEmployeeDetailList())}/>,
|
||||
|
|
|
|||
|
|
@ -6,11 +6,8 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaTable } from "ecCom";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import LedgerBackCalcEditSlide from "./ledgerBackCalcEditSlide";
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class LedgerBackCalculatedSalaryItemTable extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -56,7 +53,8 @@ class LedgerBackCalculatedSalaryItemTable extends Component {
|
|||
|
||||
render() {
|
||||
const { backCalcEditSlide } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn }, dataSource, editId, saveSalarySobId, key } = this.props;
|
||||
const { record, dataSource, editId, saveSalarySobId, key } = this.props;
|
||||
const showOperateBtn = editId ? record.opts.includes("admin") : true;
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: "name",
|
||||
|
|
@ -78,7 +76,7 @@ class LedgerBackCalculatedSalaryItemTable extends Component {
|
|||
width: 80,
|
||||
render: (text, record, index) => {
|
||||
const { canEdit } = record;
|
||||
return (showOperateBtn && canEdit) ?
|
||||
return showOperateBtn ?
|
||||
<a href="javascript: void(0);" onClick={() => this.handleEditBackCalc(record)}>编辑</a> :
|
||||
<span></span>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,10 @@ import { duplicateLedger } from "../../../apis/ledger";
|
|||
import { WeaDialog } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../util";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import "./index.less";
|
||||
|
||||
@inject("ledgerStore", "taxAgentStore")
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
class CopyLedgerModal extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -31,35 +32,31 @@ class CopyLedgerModal extends Component {
|
|||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { ledgerStore, name, taxAgentId } = nextProps;
|
||||
const { copyForm: form } = ledgerStore;
|
||||
form.updateFields({
|
||||
name: { value: name },
|
||||
taxAgentId: { value: taxAgentId.toString() }
|
||||
});
|
||||
form.updateFields({ name: { value: name }, taxAgentId: { value: taxAgentId } });
|
||||
}
|
||||
}
|
||||
|
||||
getTaxAgentSelectListAsAdmin = () => {
|
||||
const { taxAgentStore, ledgerStore } = this.props;
|
||||
const { ledgerStore } = this.props;
|
||||
const { copyForm: form } = ledgerStore;
|
||||
const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
|
||||
getTaxAgentSelectListAsAdmin().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const conditions = _.map(copyConditions, it => {
|
||||
it.items = _.map(it.items, child => {
|
||||
if (child.domkey[0] === "taxAgentId") {
|
||||
return {
|
||||
...child,
|
||||
options: _.map(data, it => ({ key: it.id, showname: it.content }))
|
||||
};
|
||||
} else {
|
||||
return { ...child };
|
||||
}
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
const conditions = _.map(copyConditions, it => {
|
||||
it.items = _.map(it.items, child => {
|
||||
if (child.domkey[0] === "taxAgentId") {
|
||||
return {
|
||||
...child, options: _.map(data, it => ({ key: String(it.id), showname: it.name }))
|
||||
};
|
||||
} else {
|
||||
return { ...child };
|
||||
}
|
||||
});
|
||||
return { ...it };
|
||||
});
|
||||
return { ...it };
|
||||
});
|
||||
form.initFormFields(conditions);
|
||||
}
|
||||
});
|
||||
form.initFormFields(conditions);
|
||||
}
|
||||
});
|
||||
};
|
||||
handleSubmit = () => {
|
||||
const { ledgerStore, id, onRefreshList, onCancel } = this.props;
|
||||
|
|
@ -84,7 +81,6 @@ class CopyLedgerModal extends Component {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
const { onCancel, ledgerStore, ...extra } = this.props;
|
||||
const { loading } = this.state;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
* Date: 2022/12/12
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom";
|
||||
import PersonalScopeTable from "../../../components/PersonalScopeTable";
|
||||
|
|
@ -35,8 +34,6 @@ const APISaveFox = {
|
|||
save: saveLedgerPersonRange
|
||||
};
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class LedgerAssociatedPersonnel extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -221,7 +218,8 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
externalPersonModalVisible,
|
||||
loading, extEmpsWitch
|
||||
} = this.state;
|
||||
const { taxAgentStore: { showOperateBtn }, editId, saveSalarySobId } = this.props;
|
||||
const { record, editId, saveSalarySobId } = this.props;
|
||||
const admin = editId ? record.opts.includes("admin") : true;
|
||||
const topTab = [
|
||||
{
|
||||
title: "关联人员范围",
|
||||
|
|
@ -236,7 +234,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
viewcondition: "externalList"
|
||||
}
|
||||
];
|
||||
const btns = showOperateBtn ? [
|
||||
const btns = admin ? [
|
||||
<Button
|
||||
className="icon-coms-leading-in-btn"
|
||||
type="primary"
|
||||
|
|
@ -277,7 +275,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
datas={(extEmpsWitch === "0" || !extEmpsWitch) ? _.dropRight(topTab) : topTab}
|
||||
keyParam="viewcondition" //主键
|
||||
selectedKey={selectedKey}
|
||||
buttons={showOperateBtn && selectedKey === "listInclude" ? btns : btns.slice(1)}
|
||||
buttons={admin && selectedKey === "listInclude" ? btns : btns.slice(1)}
|
||||
onChange={selectedKey => this.setState({ selectedKey })}
|
||||
/>
|
||||
<PersonalScopeTable
|
||||
|
|
|
|||
|
|
@ -67,14 +67,8 @@ class LedgerBackCalculatedSalaryItem extends Component {
|
|||
_.map(backCalcItems, item => {
|
||||
const { key, label, helpContent, dataSource } = item;
|
||||
return (
|
||||
<WeaSearchGroup
|
||||
key={key}
|
||||
needTigger
|
||||
title={
|
||||
<TitleComp title={label} helpContent={helpContent}/>
|
||||
}
|
||||
showGroup
|
||||
>
|
||||
<WeaSearchGroup key={key} needTigger showGroup
|
||||
title={<TitleComp title={label} helpContent={helpContent}/>}>
|
||||
<LedgerBackCalculatedSalaryItemTable
|
||||
{...this.props} dataSource={dataSource}
|
||||
key={key} onRefresh={this.getAggregate}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSelect, WeaTextarea } from "ecCom";
|
||||
import { Col, Row } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { baseSettingFormItem } from "../config";
|
||||
import { getLedgerBasicForm } from "../../../apis/ledger";
|
||||
import {
|
||||
|
|
@ -19,11 +18,10 @@ import {
|
|||
prefixAddZero
|
||||
} from "../../../util/date";
|
||||
import { commonEnumList } from "../../../apis/ruleconfig";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import moment from "moment";
|
||||
import "./index.less";
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class LedgerBaseSetting extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -90,7 +88,11 @@ class LedgerBaseSetting extends Component {
|
|||
const { settingBaseInfo } = this.state;
|
||||
let tmpV = {};
|
||||
_.map(Object.keys(settingBaseInfo), key => {
|
||||
tmpV[key] = !_.isNil(basicForm[key]) ? basicForm[key].toString() : "";
|
||||
if (key === "taxAgentId") {
|
||||
tmpV[key] = _.map(basicForm["taxAgentIds"], it => it.toString()).join(",");
|
||||
} else {
|
||||
tmpV[key] = !_.isNil(basicForm[key]) ? basicForm[key].toString() : "";
|
||||
}
|
||||
});
|
||||
this.setState({
|
||||
settingBaseInfo: {
|
||||
|
|
@ -104,23 +106,21 @@ class LedgerBaseSetting extends Component {
|
|||
});
|
||||
};
|
||||
getTaxAgentSelectListAsAdmin = () => {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
|
||||
getTaxAgentSelectListAsAdmin().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
baseForm: _.map(baseSettingFormItem, it => {
|
||||
if (it.key === "taxAgentId") {
|
||||
return {
|
||||
...it,
|
||||
options: _.map(data, it => ({ key: it.id, showname: it.content }))
|
||||
};
|
||||
}
|
||||
return { ...it };
|
||||
})
|
||||
}, () => this.commonEenumList());
|
||||
}
|
||||
});
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
baseForm: _.map(baseSettingFormItem, it => {
|
||||
if (it.key === "taxAgentId") {
|
||||
return {
|
||||
...it, options: _.map(data, o => ({ key: String(o.id), showname: o.name }))
|
||||
};
|
||||
}
|
||||
return { ...it };
|
||||
})
|
||||
}, () => this.commonEenumList());
|
||||
}
|
||||
});
|
||||
};
|
||||
commonEenumList = () => {
|
||||
const payload = {
|
||||
|
|
@ -157,18 +157,20 @@ class LedgerBaseSetting extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { editId, taxAgentStore: { taxAgentOption } } = this.props;
|
||||
const { editId, record } = this.props;
|
||||
const { baseForm, settingBaseInfo } = this.state;
|
||||
const { canEdit, taxAgentId } = settingBaseInfo;
|
||||
let taxAgentIdDisabled = false, taxableItemsDisabled = false;
|
||||
const admin = editId ? record.opts.includes("admin") : true;
|
||||
return (
|
||||
<div className="baseSettingWrapper">
|
||||
<Row gutter={20}>
|
||||
<Col span={18} className="baseSettingLeft">
|
||||
{
|
||||
_.map(baseForm, item => {
|
||||
const { key, label, type, options = [], children = [] } = item;
|
||||
taxAgentIdDisabled = key === "taxAgentId" && editId && taxAgentId;
|
||||
const { key, label, type, options = [], children = [], multiple = false } = item;
|
||||
taxAgentIdDisabled = false;
|
||||
// taxAgentIdDisabled = key === "taxAgentId" && editId && taxAgentId;
|
||||
taxableItemsDisabled = key === "taxableItems" && editId;
|
||||
return <WeaFormItem
|
||||
key={key} label={label}
|
||||
|
|
@ -176,10 +178,10 @@ class LedgerBaseSetting extends Component {
|
|||
>
|
||||
{
|
||||
type === "INPUT" ?
|
||||
<WeaInput value={settingBaseInfo[key]} viewAttr={3} disabled={canEdit !== "true"}
|
||||
<WeaInput value={settingBaseInfo[key]} viewAttr={3} disabled={!admin}
|
||||
onChange={(v) => this.handleChangeField(key, v)}/> :
|
||||
type === "TEXTAREA" ?
|
||||
<WeaTextarea value={settingBaseInfo[key]} disabled={canEdit !== "true"}
|
||||
<WeaTextarea value={settingBaseInfo[key]} disabled={!admin}
|
||||
onChange={(v) => this.handleChangeField(key, v)}/> :
|
||||
type === "CHECKBOX" ?
|
||||
<React.Fragment>
|
||||
|
|
@ -189,12 +191,11 @@ class LedgerBaseSetting extends Component {
|
|||
</React.Fragment> :
|
||||
type === "SELECT" ?
|
||||
<WeaSelect value={settingBaseInfo[key]}
|
||||
options={((canEdit !== "true" || taxAgentIdDisabled || taxableItemsDisabled) && key === "taxAgentId") ? taxAgentOption : options}
|
||||
viewAttr={3}
|
||||
disabled={canEdit !== "true" || taxAgentIdDisabled || taxableItemsDisabled}
|
||||
options={options} viewAttr={3} multiple={multiple}
|
||||
disabled={!admin || taxAgentIdDisabled || taxableItemsDisabled}
|
||||
onChange={(v) => this.handleChangeField(key, v)}/> :
|
||||
type === "CUSTOM" ?
|
||||
<CustomSelect list={children} baseInfo={settingBaseInfo} inputStr={key}
|
||||
<CustomSelect list={children} baseInfo={settingBaseInfo} inputStr={key} admin={admin}
|
||||
onChange={(key, v) => this.handleChangeField(key, v)}/> : null
|
||||
}
|
||||
</WeaFormItem>;
|
||||
|
|
@ -211,8 +212,7 @@ class LedgerBaseSetting extends Component {
|
|||
export default LedgerBaseSetting;
|
||||
|
||||
const CustomSelect = (props) => {
|
||||
const { list, baseInfo, onChange, inputStr } = props;
|
||||
const { canEdit } = baseInfo;
|
||||
const { list, baseInfo, onChange, inputStr, admin } = props;
|
||||
const selectInfo = buildEditBasicInfo(baseInfo);
|
||||
return <Row gutter={10} key={inputStr}>
|
||||
{
|
||||
|
|
@ -220,8 +220,7 @@ const CustomSelect = (props) => {
|
|||
const { key, options = [] } = item;
|
||||
return <Col span={6}>
|
||||
<WeaSelect value={baseInfo[key]} options={options} viewAttr={3}
|
||||
disabled={canEdit !== "true"}
|
||||
onChange={(v) => onChange(key, v)}/>
|
||||
disabled={!admin} onChange={(v) => onChange(key, v)}/>
|
||||
</Col>;
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,11 @@
|
|||
* Date: 2022/12/12
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaButtonIcon, WeaTab, WeaTable } from "ecCom";
|
||||
import { Modal } from "antd";
|
||||
import LedgerAdjustRuleAddModal from "./ledgerAdjustRuleAddModal";
|
||||
import { listAdjustmentRule } from "../../../apis/ledger";
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class LedgerSalaryAdjustmentRules extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -92,9 +89,10 @@ class LedgerSalaryAdjustmentRules extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { showOperateBtn }, editId, onSaveParams } = this.props;
|
||||
const { record, editId, onSaveParams } = this.props;
|
||||
const { adjustRuleAddModal } = this.state;
|
||||
const { dataSource } = this.state;
|
||||
const showOperateBtn = editId ? record.opts.includes("admin") : true;
|
||||
const btns = showOperateBtn ? [
|
||||
<WeaButtonIcon buttonType="add" type="primary" onClick={this.handleAddAdjustRule}/>
|
||||
] : [];
|
||||
|
|
|
|||
|
|
@ -50,12 +50,13 @@ class LedgerSalaryItemBaseInfo extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, onChangeSortableList, onPreview } = this.props;
|
||||
const { dataSource, onChangeSortableList, onPreview, editId, record } = this.props;
|
||||
const { empFieldListOptions } = this.state;
|
||||
const options = _.map(empFieldListOptions, o => ({
|
||||
...o, disabled: _.map(dataSource, g => g.fieldId).includes(o.key)
|
||||
}));
|
||||
if (_.isEmpty(dataSource) || _.isEmpty(options)) return null;
|
||||
const admin = editId ? record.opts.includes("admin") : true;
|
||||
return (
|
||||
<WeaSearchGroup needTigger={false} showGroup title={<TitleComp onPreview={onPreview}/>}>
|
||||
<div className="userInfoWrapper">
|
||||
|
|
@ -80,6 +81,7 @@ class LedgerSalaryItemBaseInfo extends Component {
|
|||
className="wea-sortable-grid-item"
|
||||
/>
|
||||
<WeaSelect
|
||||
disabled={!admin}
|
||||
showSearch
|
||||
options={options}
|
||||
style={{ width: 150 }}
|
||||
|
|
|
|||
|
|
@ -140,9 +140,9 @@ class LedgerSalaryItemNormal extends Component {
|
|||
onChangeSelectedRowKeys,
|
||||
onAddSalaryItems,
|
||||
incomeCategoriesTitleName,
|
||||
taxAgentStore
|
||||
record
|
||||
} = this.props;
|
||||
const { showOperateBtn } = taxAgentStore;
|
||||
const showOperateBtn = editId ? record.opts.includes("admin") : true;
|
||||
const { categoryModal, addCategoryItemsVisible, moveModalPayload, salaryItemKeywords } = this.state;
|
||||
const newDateSource = _.map(dataSource, item => {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { Button } from "antd";
|
|||
import { WeaSwitch } from "comsMobx";
|
||||
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
import { searchConditions } from "../config";
|
||||
import { getTaxAgentSelectList } from "../../../apis/taxAgent";
|
||||
import { postFetch } from "../../../util/request";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -31,29 +31,28 @@ class LedgerSearchComp extends Component {
|
|||
|
||||
getTaxAgentSelectList = () => {
|
||||
const { ledgerStore: { searchForm } } = this.props;
|
||||
getTaxAgentSelectList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(searchConditions, o => {
|
||||
return {
|
||||
...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
|
||||
}))]
|
||||
};
|
||||
}
|
||||
return { ...j };
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => searchForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
});
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(searchConditions, o => {
|
||||
return {
|
||||
...o,
|
||||
items: _.map(o.items, j => {
|
||||
if (getKey(j) === "taxAgentId") {
|
||||
return {
|
||||
...j, options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({
|
||||
key: String(g.id), showname: g.name
|
||||
}))]
|
||||
};
|
||||
}
|
||||
return { ...j };
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => searchForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
});
|
||||
};
|
||||
formRender = (form, condition) => {
|
||||
const { isFormInit } = form, formParams = form.getFormParams();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import "./index.less";
|
|||
const { getLabel } = WeaLocaleProvider;
|
||||
const Step = WeaSteps.Step;
|
||||
|
||||
@inject("taxAgentStore", "ledgerStore")
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
class LedgerSlide extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -57,17 +57,18 @@ class LedgerSlide extends Component {
|
|||
return false;
|
||||
}
|
||||
this.setState({ loading: true });
|
||||
saveLedgerBasic({ ...extra, description, id: editId }).then(({ status, data, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { onRefreshList } = this.props;
|
||||
message.success("保存成功");
|
||||
onRefreshList();
|
||||
!editId && this.setState({ current: current + 1, saveSalarySobId: data });
|
||||
} else {
|
||||
message.error(errormsg || "保存失败");
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
saveLedgerBasic({ ...extra, description, id: editId, taxAgentIds: extra.taxAgentId.split(",") })
|
||||
.then(({ status, data, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { onRefreshList } = this.props;
|
||||
message.success("保存成功");
|
||||
onRefreshList();
|
||||
!editId && this.setState({ current: current + 1, saveSalarySobId: data });
|
||||
} else {
|
||||
message.error(errormsg || "保存失败");
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
|
|
@ -110,7 +111,8 @@ class LedgerSlide extends Component {
|
|||
return {
|
||||
...item,
|
||||
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 };
|
||||
})
|
||||
|
|
@ -118,7 +120,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
|
||||
|
|
@ -150,7 +153,7 @@ class LedgerSlide extends Component {
|
|||
handleSaveSalaryItemParams = (empFields, itemGroups) => this.setState({ empFields, itemGroups });
|
||||
|
||||
render() {
|
||||
const { visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { visible, editId, record } = this.props;
|
||||
const { current, saveSalarySobId, loading } = this.state;
|
||||
let tabs = [
|
||||
{
|
||||
|
|
@ -231,7 +234,7 @@ class LedgerSlide extends Component {
|
|||
measure="%"
|
||||
title={
|
||||
!editId ? <WeaTopTitle buttons={_.find(tabs, o => current === o.key).createBtns}/> :
|
||||
<WeaReqTitle buttons={showOperateBtn ? _.find(tabs, o => current === o.key).editBtns : []}
|
||||
<WeaReqTitle buttons={record.opts.includes("admin") ? _.find(tabs, o => current === o.key).editBtns : []}
|
||||
tabDatas={tabs} selectedKey={String(current)}
|
||||
onChange={cur => this.setState({ current: parseInt(cur) })}/>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class LedgerTable extends Component {
|
|||
return <WeaCheckbox
|
||||
value={text === 0 ? "1" : "0"}
|
||||
display="switch"
|
||||
disabled={!showOperateBtn}
|
||||
disabled={!record.opts.includes("admin")}
|
||||
onChange={(disable) => this.changeLedgerStatus({ id: record.id, disable: disable === "0" ? 1 : 0 })}
|
||||
/>;
|
||||
};
|
||||
|
|
@ -80,14 +80,14 @@ class LedgerTable extends Component {
|
|||
item.render = (text, record) => {
|
||||
return <div className="optWrapper">
|
||||
<a href="javascript:void(0);" className="mr10"
|
||||
onClick={() => onEditLedger(record)}>{showOperateBtn ? "编辑" : "查看"}</a>
|
||||
onClick={() => onEditLedger(record)}>{record.opts.includes("admin") ? "编辑" : "查看"}</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
record.opts.includes("admin") &&
|
||||
<a href="javascript:void(0);" className="mr10"
|
||||
onClick={() => this.handleMenuClick({ key: "copy" }, record)}>复制</a>
|
||||
}
|
||||
{
|
||||
showOperateBtn &&
|
||||
record.opts.includes("admin") &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
|
|
@ -148,11 +148,15 @@ class LedgerTable extends Component {
|
|||
};
|
||||
handleMenuClick = ({ key }, record) => {
|
||||
const { copyLedgerModal } = this.state;
|
||||
const { id, name, taxAgentId } = record;
|
||||
const { id, name, taxAgentIds } = record;
|
||||
switch (key) {
|
||||
case "copy":
|
||||
this.setState({
|
||||
copyLedgerModal: { ...copyLedgerModal, visible: true, id, name, taxAgentId }
|
||||
copyLedgerModal: {
|
||||
...copyLedgerModal,
|
||||
visible: true, id, name,
|
||||
taxAgentId: _.map(taxAgentIds, o => String(o)).join(",")
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "delete":
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ export const copyConditions = [
|
|||
fieldcol: 14,
|
||||
rules: "required|string",
|
||||
label: "个税扣缴义务人",
|
||||
multiple: true,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 3
|
||||
|
|
@ -86,6 +87,7 @@ export const baseSettingFormItem = [
|
|||
key: "taxAgentId",
|
||||
label: "个税扣缴义务人",
|
||||
type: "SELECT",
|
||||
multiple: true,
|
||||
options: []
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,34 +23,19 @@ class Index extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
searchVal: "", doSearch: false, logDialogVisible: false, filterConditions: "[]",
|
||||
slideparams: {
|
||||
visible: false,
|
||||
title: "新建账套",
|
||||
editId: ""
|
||||
}
|
||||
slideparams: { visible: false, title: "新建账套", editId: "", record: {} }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { fetchTaxAgentOption } = taxAgentStore;
|
||||
fetchTaxAgentOption();
|
||||
}
|
||||
|
||||
handleEditLedger = (record) => {
|
||||
const { slideparams } = this.state;
|
||||
const { id } = record;
|
||||
this.setState({ slideparams: { ...slideparams, visible: true, title: "编辑账套", editId: id } });
|
||||
this.setState({ slideparams: { ...slideparams, visible: true, title: "编辑账套", editId: id, record } });
|
||||
};
|
||||
handleResetLedger = () => {
|
||||
const { slideparams } = this.state;
|
||||
this.setState({
|
||||
slideparams: {
|
||||
...slideparams,
|
||||
visible: false,
|
||||
title: "新建账套",
|
||||
editId: ""
|
||||
}
|
||||
slideparams: { ...slideparams, visible: false, title: "新建账套", editId: "", record: {} }
|
||||
});
|
||||
};
|
||||
onDropMenuClick = (key, targetid = "") => {
|
||||
|
|
@ -69,7 +54,8 @@ class Index extends Component {
|
|||
render() {
|
||||
const { logDialogVisible, filterConditions, doSearch, slideparams } = this.state;
|
||||
const { taxAgentStore } = this.props;
|
||||
const { showOperateBtn } = taxAgentStore;
|
||||
const { PageAndOptAuth } = taxAgentStore;
|
||||
const admin = PageAndOptAuth.opts.includes("admin");
|
||||
const btns = [
|
||||
<Button
|
||||
type="primary"
|
||||
|
|
@ -80,7 +66,7 @@ class Index extends Component {
|
|||
return (
|
||||
<WeaTop
|
||||
title="薪资账套" className="ledgerOuter" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={showOperateBtn ? btns : btns.slice(-1)}
|
||||
buttons={admin ? btns : btns.slice(-1)}
|
||||
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={[
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
.ledgerSearch-Wrapper {
|
||||
min-width: 350px;
|
||||
margin-top: 5px;
|
||||
margin-right: 70px;
|
||||
position: relative;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ const APILIST = {
|
|||
cancelSalarySuspension: API.cancelStop //取消停薪
|
||||
};
|
||||
|
||||
@inject("payrollFilesStore", "taxAgentStore")
|
||||
@inject("payrollFilesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -100,12 +100,12 @@ class Index extends Component {
|
|||
case "CHANGE-SALARY":
|
||||
case "VIEW":
|
||||
case "EDIT":
|
||||
const { taxAgentStore: { showOperateBtn }, selectedKey: runStatuses } = this.props;
|
||||
const { record: { id: salaryArchiveId } } = params;
|
||||
const { selectedKey: runStatuses } = this.props;
|
||||
const { record: { id: salaryArchiveId, opts } } = params;
|
||||
this.setState({
|
||||
salaryFilesEditSlide: {
|
||||
...this.state.salaryFilesEditSlide, visible: true, salaryArchiveId,
|
||||
runStatuses, showOperateBtn
|
||||
runStatuses, showOperateBtn: opts.includes("admin")
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
|
@ -172,7 +172,7 @@ class Index extends Component {
|
|||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getColumns = () => {
|
||||
const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { payrollFilesStore: { tableStore } } = this.props;
|
||||
const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({
|
||||
dataIndex: it.dataIndex, title: it.title, align: "left",
|
||||
width: (it.dataIndex === "taxAgentName" || it.dataIndex === "operate") ? 185 : 150,
|
||||
|
|
@ -181,7 +181,7 @@ class Index extends Component {
|
|||
}));
|
||||
if (!_.isEmpty(columns)) {
|
||||
this.postMessageToChild({
|
||||
columns, showOperateBtn, selectedKey: this.props.selectedKey,
|
||||
columns, selectedKey: this.props.selectedKey,
|
||||
showDelSalaryFileBtn: this.props.showDelSalaryFileBtn,
|
||||
dataSource: this.state.dataSource, selectedRowKeys: this.state.selectedRowKeys,
|
||||
showSum: false, pageInfo: this.state.pageInfo
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ export const renderDropMenuDatas = (selectedKey, showOperateBtn) => {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return showOperateBtn ? menus : _.filter(menus, o => o.key === "custom_cols");
|
||||
return showOperateBtn ? menus : _.filter(menus, o => (o.key === "custom_cols" || o.key === "log"));
|
||||
};
|
||||
|
||||
export const salaryFileSearchConditions = [
|
||||
|
|
@ -440,7 +440,7 @@ export const salaryFilesConditions = [
|
|||
},
|
||||
{
|
||||
defaultshow: true, title: getLabel(543329, "发薪设置"),
|
||||
col: 1,lanId: 543329,
|
||||
col: 1, lanId: 543329,
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
|
|
@ -471,7 +471,7 @@ export const salaryFilesConditions = [
|
|||
defaultshow: true, title: getLabel(538004, "薪资档案"),
|
||||
titleHelpful: getLabel(543330, "提示:显示已生效的最新数据"),
|
||||
titleHelpfulLanId: 543330,
|
||||
col: 2, salaryFile: true,lanId: 538004,
|
||||
col: 2, salaryFile: true, lanId: 538004,
|
||||
items: []
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -247,15 +247,16 @@ class SalaryFiles extends Component {
|
|||
selectedKey, topTabCount, showSearchAd, isQuery, showDelSalaryFileBtn, showExtEmpsWitch,
|
||||
salaryFileImpDialog, salaryImportTypes, logDialogVisible, filterConditions
|
||||
} = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const tabs = _.map(tabList, o => ({ ...o, title: getLabel(o.lanId, o.title) }));
|
||||
const admin = PageAndOptAuth.opts.includes("admin");
|
||||
return (
|
||||
<div className="salary-files-wrapper">
|
||||
<WeaReqTop
|
||||
title={getLabel(538004, "薪资档案")} buttonSpace={10} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" showDropIcon dropMenuDatas={renderDropMenuDatas(selectedKey, showOperateBtn)}
|
||||
onDropMenuClick={this.onDropMenuClick}
|
||||
buttons={renderReqBtns(selectedKey, salaryImportTypes, this.handleReqBtnsCLick, showOperateBtn)}
|
||||
iconBgcolor="#F14A2D" showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={renderDropMenuDatas(selectedKey, admin)}
|
||||
buttons={renderReqBtns(selectedKey, salaryImportTypes, this.handleReqBtnsCLick, admin)}
|
||||
replaceTab={
|
||||
<WeaTab
|
||||
datas={!showExtEmpsWitch ? _.dropRight(tabs) : tabs} autoCalculateWidth
|
||||
|
|
@ -274,7 +275,7 @@ class SalaryFiles extends Component {
|
|||
</div>
|
||||
{/*列表*/}
|
||||
<SalaryFileList isQuery={isQuery} ref={dom => this.salaryFileListRef = dom}
|
||||
selectedKey={selectedKey} showOperateBtn={showOperateBtn}
|
||||
selectedKey={selectedKey} showOperateBtn={admin}
|
||||
showDelSalaryFileBtn={showDelSalaryFileBtn}
|
||||
onChangeTopTabCount={this.queryInsuranceTabTotal}
|
||||
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
* Date: 2023/10/12
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Dropdown, Menu, message, Tag } from "antd";
|
||||
import { getPayrollList } from "../../../../apis/payroll";
|
||||
|
|
@ -13,8 +12,6 @@ import moment from "moment";
|
|||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -100,7 +97,6 @@ class Index extends Component {
|
|||
|
||||
render() {
|
||||
const { loading, dataSource, columns, pageInfo } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
|
|
@ -132,7 +128,7 @@ class Index extends Component {
|
|||
const showGrant = haveBackCalc === 1 && salaryAcctType === 0;
|
||||
return <React.Fragment>
|
||||
{
|
||||
showOperateBtn &&
|
||||
record.opts.includes("admin") &&
|
||||
<a
|
||||
href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollGrant?id=${id}&ackFeedbackStatus=${ackFeedbackStatus}`}
|
||||
style={{ marginRight: 10 }} target="_blank">{getLabel(542702, "发放")}</a>
|
||||
|
|
|
|||
|
|
@ -8,9 +8,10 @@ import React, { Component } from "react";
|
|||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { postFetch } from "../../../../util/request";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { copyConditions } from "../conditions";
|
||||
import { duplicatePayroll, getPayrollTemplateLedgerList } from "../../../../apis/payroll";
|
||||
import { duplicatePayroll } from "../../../../apis/payroll";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
|
@ -31,29 +32,30 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
getPayrollTemplateLedgerList = (props) => {
|
||||
getPayrollTemplateLedgerList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(copyConditions, item => {
|
||||
return {
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "salarySobId") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
options: _.map(data, d => ({ key: d.id, showname: d.content }))
|
||||
};
|
||||
} else {
|
||||
return { ...o, label: getLabel(o.lanId, o.label) };
|
||||
}
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
props.payrollStore.payrollCopyForm.initFormFields(this.state.conditions);
|
||||
props.payrollStore.payrollCopyForm.updateFields({ salarySobId: { value: props.salarySobId } });
|
||||
});
|
||||
}
|
||||
});
|
||||
postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(copyConditions, item => {
|
||||
return {
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "salarySobId") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
options: _.map(data, d => ({ key: String(d.id), showname: d.name }))
|
||||
};
|
||||
} else {
|
||||
return { ...o, label: getLabel(o.lanId, o.label) };
|
||||
}
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
props.payrollStore.payrollCopyForm.initFormFields(this.state.conditions);
|
||||
props.payrollStore.payrollCopyForm.updateFields({ salarySobId: { value: props.salarySobId } });
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
save = () => {
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class Index extends Component {
|
|||
if (it === "ackFeedbackStatus" || it === "feedbackStatus") {
|
||||
payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" });
|
||||
} else {
|
||||
payrollTempFeedbackForm.updateFields({ [it]: !_.isEmpty(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" });
|
||||
payrollTempFeedbackForm.updateFields({ [it]: !_.isNil(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" });
|
||||
}
|
||||
});
|
||||
this.setState({
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
* Date: 2023/10/13
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaSelect, WeaTable } from "ecCom";
|
||||
import { Dropdown, Menu, message, Modal } from "antd";
|
||||
import { changePayrollDefaultUse, deletePayroll, getPayrollTemplateList } from "../../../../apis/payroll";
|
||||
|
|
@ -14,8 +13,6 @@ import UpdatePayrollTemplateSlide from "../updatePayrollTemplateSlide";
|
|||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -125,7 +122,7 @@ class Index extends Component {
|
|||
|
||||
render() {
|
||||
const { loading, dataSource, columns, pageInfo, copyDialog, tmplSlide, selectedRowKeys } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn }, forceUpdate } = this.props;
|
||||
const { forceUpdate } = this.props;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
|
|
@ -159,7 +156,7 @@ class Index extends Component {
|
|||
render: (__, record) => {
|
||||
const {} = record;
|
||||
//显示更新模板
|
||||
return showOperateBtn ? <React.Fragment>
|
||||
return record.opts.includes("admin") ? <React.Fragment>
|
||||
<a href="javascript:void(0);" onClick={() => this.handleOpts({ key: "edit" }, record)}
|
||||
style={{ marginRight: 10 }}>{getLabel(501169, "编辑")}</a>
|
||||
<a href="javascript:void(0);" style={{ marginRight: 10 }}
|
||||
|
|
|
|||
|
|
@ -39,8 +39,9 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
renderReqBtns = () => {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const { selectedKey, isRefresh, queryParams } = this.state;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
let reqBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "grant":
|
||||
|
|
@ -53,14 +54,14 @@ class Index extends Component {
|
|||
];
|
||||
break;
|
||||
case "template":
|
||||
const loading = this.templateRef ? this.templateRef.wrappedInstance.state.delLoading : false;
|
||||
const delDisabled = !this.templateRef || _.isEmpty(this.templateRef.wrappedInstance.state.selectedRowKeys);
|
||||
const loading = this.templateRef ? this.templateRef.state.delLoading : false;
|
||||
const delDisabled = !this.templateRef || _.isEmpty(this.templateRef.state.selectedRowKeys);
|
||||
const btns = [
|
||||
<Button type="primary" onClick={() => {
|
||||
this.templateRef.wrappedInstance.handleOpts({ key: "edit" }, {});
|
||||
this.templateRef.handleOpts({ key: "edit" }, {});
|
||||
}}>{getLabel(365, "新建")}</Button>,
|
||||
<Button type="ghost" loading={loading} disabled={delDisabled} onClick={() => {
|
||||
this.templateRef.wrappedInstance.handleOpts({ key: "del" }, {});
|
||||
this.templateRef.handleOpts({ key: "del" }, {});
|
||||
}}>{getLabel(32136, "批量删除")}</Button>
|
||||
];
|
||||
const queryBtns = [
|
||||
|
|
@ -74,10 +75,10 @@ class Index extends Component {
|
|||
break;
|
||||
case "watermark":
|
||||
const { baseSetSaveLoading } = this.state;
|
||||
reqBtns = [
|
||||
reqBtns = showOperateBtn ? [
|
||||
<Button type="primary" loading={baseSetSaveLoading}
|
||||
onClick={() => this.baseSetRef.salaryBillBaseSetSave()}>{getLabel(537558, "保存")}</Button>
|
||||
];
|
||||
] : [];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -91,7 +92,7 @@ class Index extends Component {
|
|||
case "grant":
|
||||
dom = <GrantTableList queryParams={queryParams} isRefresh={isRefresh}
|
||||
onUpdateTemp={(id) => this.setState({ selectedKey: "template" }, () => {
|
||||
this.templateRef.wrappedInstance.handleOpts({ key: "edit" }, { id });
|
||||
this.templateRef.handleOpts({ key: "edit" }, { id });
|
||||
})}
|
||||
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
|
||||
/>;
|
||||
|
|
|
|||
|
|
@ -91,36 +91,36 @@ export const condition = [
|
|||
labelcol: 6,
|
||||
viewAttr: 2
|
||||
},
|
||||
// {
|
||||
// browserConditionParam: {
|
||||
// completeParams: {},
|
||||
// conditionDataParams: {},
|
||||
// dataParams: {},
|
||||
// destDataParams: {},
|
||||
// hasAddBtn: false,
|
||||
// hasAdvanceSerach: true,
|
||||
// idSeparator: ",",
|
||||
// isAutoComplete: 1,
|
||||
// isDetail: 0,
|
||||
// isMultCheckbox: false,
|
||||
// isSingle: false,
|
||||
// linkUrl: "",
|
||||
// pageSize: 10,
|
||||
// quickSearchName: "",
|
||||
// replaceDatas: [],
|
||||
// title: getLabel(111, "岗位"),
|
||||
// type: "278",
|
||||
// viewAttr: 2
|
||||
// },
|
||||
// colSpan: 2,
|
||||
// conditionType: "BROWSER",
|
||||
// domkey: ["position"],
|
||||
// fieldcol: 18,
|
||||
// isQuickSearch: false,
|
||||
// label: getLabel(111, "岗位"),
|
||||
// labelcol: 6,
|
||||
// viewAttr: 2
|
||||
// },
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: getLabel(111, "岗位"),
|
||||
type: "278",
|
||||
viewAttr: 2
|
||||
},
|
||||
colSpan: 2,
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["position"],
|
||||
fieldcol: 18,
|
||||
isQuickSearch: false,
|
||||
label: getLabel(111, "岗位"),
|
||||
labelcol: 6,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
import React, { Component } from "react";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import {
|
||||
WeaBrowser,
|
||||
WeaCheckbox,
|
||||
WeaDialog,
|
||||
WeaError,
|
||||
|
|
@ -19,6 +18,7 @@ import {
|
|||
WeaTable
|
||||
} from "ecCom";
|
||||
import { reportStatisticsItemSave, statisticsItemChangetab, statisticsItemGetform } from "../../../apis/statistics";
|
||||
import CustomBrowser from "../../../components/CustomBrowser";
|
||||
import "../index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -263,23 +263,22 @@ class CustomStatisticsItemsModal extends Component {
|
|||
})
|
||||
});
|
||||
};
|
||||
handleChangeStatisticalItems = (itemValue, _names, datas) => {
|
||||
handleChangeStatisticalItems = (data) => {
|
||||
const itemValue = _.keys(data)[0], datas = _.values(data);
|
||||
const { formData } = this.state;
|
||||
this.setState({
|
||||
formData: {
|
||||
...formData,
|
||||
itemValue,
|
||||
itemValueSpan: _.map(datas, it => it.name).join(","),
|
||||
itemName: datas.length === 1 ? _.map(datas, it => it.names).join(",") : ""
|
||||
itemName: datas.length === 1 ? _.map(datas, it => it.name).join(",") : ""
|
||||
}
|
||||
}, () => {
|
||||
statisticsItemChangetab({ itemId: itemValue }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { ruleData } = data;
|
||||
const { columns, data: dataSource } = ruleData;
|
||||
this.setState({
|
||||
columns, dataSource
|
||||
});
|
||||
this.setState({ columns, dataSource });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -368,52 +367,37 @@ class CustomStatisticsItemsModal extends Component {
|
|||
className="statisticItemsWrapper"
|
||||
>
|
||||
<div className="statisticItemsBox">
|
||||
<WeaFormItem label={getLabel(111, "统计项目")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaError tipPosition="bottom" ref="proError" error={getLabel(111, "此项必填")}>
|
||||
<WeaBrowser
|
||||
title={getLabel(111, "统计项目")} type={162} viewAttr={!isShare ? 3 : 1} isSingle
|
||||
value={itemValue}
|
||||
replaceDatas={itemValue ? _.map(itemValue.split(","), (it, idx) => ({
|
||||
id: it,
|
||||
name: itemValueSpan.split(",")[idx]
|
||||
})) : []}
|
||||
completeParams={{
|
||||
type: 162,
|
||||
fielddbtype: "browser.salaryItemBrowser",
|
||||
f_weaver_belongto_usertype: "0"
|
||||
}}
|
||||
conditionDataParams={{
|
||||
type: "browser.salaryItemBrowser",
|
||||
fielddbtype: "browser.salaryItemBrowser",
|
||||
f_weaver_belongto_usertype: "0"
|
||||
}}
|
||||
dataParams={{
|
||||
type: "browser.salaryItemBrowser",
|
||||
f_weaver_belongto_usertype: "0"
|
||||
}}
|
||||
destDataParams={{
|
||||
type: "browser.salaryItemBrowser",
|
||||
f_weaver_belongto_usertype: "0"
|
||||
}}
|
||||
// isMultCheckbox
|
||||
inputStyle={{ width: "100%" }}
|
||||
onChange={this.handleChangeStatisticalItems}
|
||||
/>
|
||||
</WeaError>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label={getLabel(111, "统计项名称")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaError tipPosition="bottom" ref="nameError" error={getLabel(111, "此项必填")}>
|
||||
<WeaInput value={itemName} viewAttr={!isShare ? 3 : 1}
|
||||
onChange={itemName => this.setState({ formData: { ...formData, itemName } })}/>
|
||||
</WeaError>
|
||||
</WeaFormItem>
|
||||
<div className="customRuleTableWrapper">
|
||||
<WeaTable
|
||||
dataSource={dataSource}
|
||||
columns={cols}
|
||||
pagination={false}
|
||||
/>
|
||||
</div>
|
||||
{
|
||||
!_.isEmpty(columns) && <React.Fragment>
|
||||
<WeaFormItem label={getLabel(111, "统计项目")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaError tipPosition="bottom" ref="proError" error={getLabel(111, "此项必填")}>
|
||||
<CustomBrowser
|
||||
fieldConfig={{
|
||||
viewAttr: !isShare ? 3 : 1,
|
||||
browserConditionParam: {
|
||||
isSingle: true, completeURL: "/api/bs/hrmsalary/salaryitem/listAuth", tableProps: {},
|
||||
replaceDatas: itemValue ? _.map(itemValue.split(","), (it, idx) => ({
|
||||
id: it, name: itemValueSpan.split(",")[idx]
|
||||
})) : [], dataParams: { filterType: "QUERY_DATA" }, searchParamsKey: "", filterByName: true
|
||||
}
|
||||
}} value={itemValue} onCustomChange={this.handleChangeStatisticalItems}/>
|
||||
</WeaError>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label={getLabel(111, "统计项名称")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaError tipPosition="bottom" ref="nameError" error={getLabel(111, "此项必填")}>
|
||||
<WeaInput value={itemName} viewAttr={!isShare ? 3 : 1}
|
||||
onChange={itemName => this.setState({ formData: { ...formData, itemName } })}/>
|
||||
</WeaError>
|
||||
</WeaFormItem>
|
||||
<div className="customRuleTableWrapper">
|
||||
<WeaTable
|
||||
dataSource={dataSource}
|
||||
columns={cols}
|
||||
pagination={false}
|
||||
/>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class PovitpivotChartModal extends Component {
|
|||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { id, dimensionId, dimensionValue, isShare } = nextProps;
|
||||
this.getDataPerspective({ id, dimensionId, dimensionValue, isShare });
|
||||
const { id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth } = nextProps;
|
||||
this.getDataPerspective({ id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth });
|
||||
} else {
|
||||
this.setState({
|
||||
dataSource: [],
|
||||
|
|
@ -64,11 +64,11 @@ class PovitpivotChartModal extends Component {
|
|||
});
|
||||
} else if (type === "turn") {
|
||||
if (id === "PAGEINFO") {
|
||||
const { id, dimensionId, dimensionValue, isShare } = this.props;
|
||||
const { id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth } = this.props;
|
||||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () =>
|
||||
this.getDataPerspective({
|
||||
id, dimensionId, dimensionValue, isShare
|
||||
id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ class ReportContent extends Component {
|
|||
chartsType: "0",
|
||||
chartsInfo: {},
|
||||
povitView: {
|
||||
visible: false, id: "", isShare: false,
|
||||
dimensionId: "", dimensionValue: ""
|
||||
visible: false, id: "", isShare: false, dimensionId: "", dimensionValue: "", salaryStartMonth: "",
|
||||
salaryEndMonth: ""
|
||||
},
|
||||
rangSet: {
|
||||
visible: false, reportId: "",
|
||||
|
|
@ -69,10 +69,15 @@ class ReportContent extends Component {
|
|||
if (id === "PIVOTCHART") {
|
||||
const { record } = params;
|
||||
const { dimension: dimensionValue } = record;
|
||||
const { id: pivotId, dimensionId, isShare } = this.props.report;
|
||||
const {
|
||||
id: pivotId, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start
|
||||
} = this.props.report;
|
||||
const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType);
|
||||
|
||||
this.setState({
|
||||
povitView: {
|
||||
visible: true, id: pivotId, dimensionId, dimensionValue, isShare
|
||||
visible: true, id: pivotId, dimensionId, dimensionValue, isShare,
|
||||
salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01"
|
||||
}
|
||||
});
|
||||
} else if (id === "PAGEINFO_REPORT") {
|
||||
|
|
@ -282,7 +287,7 @@ class ReportContent extends Component {
|
|||
onCancel={() => this.setState({
|
||||
povitView: {
|
||||
visible: false, id: "", dimensionId: "", dimensionValue: "",
|
||||
isShare: false
|
||||
isShare: false, salaryStartMonth: "", salaryEndMonth: ""
|
||||
}
|
||||
})}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ import {
|
|||
statisticsItemList
|
||||
} from "../../../apis/statistics";
|
||||
import { commonEnumList } from "../../../apis/ruleconfig";
|
||||
import { getTaxAgentSelectList } from "../../../apis/taxAgent";
|
||||
import { getSalarysobListAll } from "../../../apis";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import { condition } from "./condition";
|
||||
import cs from "classnames";
|
||||
import "../index.less";
|
||||
|
|
@ -70,40 +69,44 @@ class StatisticalMicroSettingsSlide extends Component {
|
|||
}
|
||||
|
||||
getTaxAgentSelectList = async (props) => {
|
||||
const [salarySobList, empStatusList] = await Promise.all([getSalarysobListAll(), commonEnumList({ enumClass: "com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum" })]);
|
||||
getTaxAgentSelectList(props.isShare).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const conditions = _.map(condition, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, child => {
|
||||
if (getKey(child) === "taxAgent") {
|
||||
return {
|
||||
...child, viewAttr: props.isShare ? 1 : child.viewAttr,
|
||||
options: _.map(data, o => ({ key: o.id, showname: o.content }))
|
||||
};
|
||||
} else if (getKey(child) === "salarySob") {
|
||||
return {
|
||||
...child, viewAttr: props.isShare ? 1 : child.viewAttr,
|
||||
options: _.map(salarySobList.data, o => ({ key: String(o.id), showname: o.name }))
|
||||
};
|
||||
} else if (getKey(child) === "status") {
|
||||
return {
|
||||
...child, viewAttr: props.isShare ? 1 : child.viewAttr,
|
||||
options: _.map(empStatusList.data, o => ({ key: o.value.toString(), showname: o.defaultLabel }))
|
||||
};
|
||||
}
|
||||
return { ...child, viewAttr: props.isShare ? 1 : child.viewAttr };
|
||||
})
|
||||
};
|
||||
});
|
||||
this.setState({ conditions }, () => {
|
||||
props.form.initFormFields(this.state.conditions);
|
||||
props.id && this.reportStatisticsGetSearchCondition(props.id);
|
||||
});
|
||||
const [salarySobList, empStatusList] = await Promise.all([
|
||||
postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "QUERY_DATA" }),
|
||||
commonEnumList({ enumClass: "com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum" })
|
||||
]);
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
const conditions = _.map(condition, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, child => {
|
||||
if (getKey(child) === "taxAgent") {
|
||||
return {
|
||||
...child, viewAttr: props.isShare ? 1 : child.viewAttr,
|
||||
options: _.map(data, o => ({ key: String(o.id), showname: o.name }))
|
||||
};
|
||||
} else if (getKey(child) === "salarySob") {
|
||||
return {
|
||||
...child, viewAttr: props.isShare ? 1 : child.viewAttr,
|
||||
options: _.map(salarySobList.data, o => ({ key: String(o.id), showname: o.name }))
|
||||
};
|
||||
} else if (getKey(child) === "status") {
|
||||
return {
|
||||
...child, viewAttr: props.isShare ? 1 : child.viewAttr,
|
||||
options: _.map(empStatusList.data, o => ({ key: o.value.toString(), showname: o.defaultLabel }))
|
||||
};
|
||||
}
|
||||
return { ...child, viewAttr: props.isShare ? 1 : child.viewAttr };
|
||||
})
|
||||
};
|
||||
});
|
||||
this.setState({ conditions }, () => {
|
||||
props.form.initFormFields(this.state.conditions);
|
||||
props.id && this.reportStatisticsGetSearchCondition(props.id);
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
reportStatisticsGetSearchCondition = (id) => {
|
||||
const { conditions } = this.state;
|
||||
|
|
@ -149,7 +152,7 @@ class StatisticalMicroSettingsSlide extends Component {
|
|||
hiredate: extra["hiredate1__hiredate2"].value || [],
|
||||
department: _.map(department.valueObj, it => ({ id: it.id, name: it.name })),
|
||||
employee: _.map(employee.valueObj, it => ({ id: it.id, name: it.name })),
|
||||
// position: _.map(position.valueObj, it => ({ id: it.id, name: it.name })),
|
||||
position: _.map(position.valueObj, it => ({ id: it.id, name: it.name })),
|
||||
subCompany: _.map(subCompany.valueObj, it => ({ id: it.id, name: it.name })),
|
||||
taxAgent: value ? _.map(value.split(","), (it, idx) => ({ id: it, name: valueSpan.split(",")[idx] })) : [],
|
||||
status: statusVal ? _.map(statusVal.split(","), (it, idx) => ({
|
||||
|
|
|
|||
|
|
@ -109,7 +109,8 @@ class Index extends Component {
|
|||
render() {
|
||||
const { report, dimensionList, statisticalPayload } = this.state;
|
||||
const { isShare } = report;
|
||||
const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption, showOperateBtn } } = this.props;
|
||||
const { attendanceStore: { settingForm }, taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(111, "报表查看")} icon={<i className="icon-coms-fa"/>}
|
||||
|
|
@ -158,8 +159,7 @@ class Index extends Component {
|
|||
</div>
|
||||
{/*统计数据范围及规则设置弹框*/}
|
||||
<StatisticalMicroSettingsSlide
|
||||
{...statisticalPayload} form={settingForm}
|
||||
taxAgentAdminOption={taxAgentOption} isShare={isShare}
|
||||
{...statisticalPayload} form={settingForm} isShare={isShare}
|
||||
onClose={(isRefresh) => this.setState({
|
||||
statisticalPayload: { visible: false, id: "", dimension: "" }
|
||||
}, () => isRefresh && this.leftTabRef.reportStatisticsReportList())}
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@
|
|||
|
||||
.wea-form-item .wea-form-item-wrapper .wea-field-readonly {
|
||||
white-space: pre-wrap !important;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.wea-slide-modal-title {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* 角色新增
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/5
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { roleConditions } from "../conditions";
|
||||
import * as API from "../../../../apis/taxAgent";
|
||||
import "../index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
conditions: [], loading: false, formData: { taxAgentIds: [], sobIds: [] }
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.setState({
|
||||
conditions: _.map(roleConditions, item => ({
|
||||
...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
|
||||
}))
|
||||
}, () => nextProps.taxAgentStore.roleForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.taxAgentStore.initRoleForm();
|
||||
}
|
||||
|
||||
save = (isSetting) => {
|
||||
const { taxAgentStore: { roleForm } } = this.props;
|
||||
const { formData } = this.state;
|
||||
roleForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = roleForm.getFormParams();
|
||||
this.setState({ loading: true });
|
||||
API.saveAuthRole({ ...payload, ...formData }).then(({ status, data, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.props.onCancel(() => this.props.onSearch());
|
||||
isSetting && this.props.showRoleSetDialog({
|
||||
id: data, name: payload.name, selectedKey: "auth.MemberTargetTypeEnum"
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
handleFormChange = (val) => {
|
||||
const key = _.keys(val)[0];
|
||||
if (key === "taxAgentIds" || key === "sobIds") {
|
||||
this.setState({ formData: { ...this.state.formData, ...val } });
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions, loading, roleSetDialog } = this.state;
|
||||
const { taxAgentStore: { roleForm } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 520 }} initLoadCss title={getLabel(111, "添加业务线")} className="role-dialog"
|
||||
buttons={[
|
||||
<Button type="primary" loading={loading} onClick={() => this.save()}>{getLabel(111, "保存")}</Button>,
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.save(true)}>{getLabel(111, "保存并进入详细设置")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout">{getSearchs(roleForm, conditions, 1, false, this.handleFormChange)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 业务线管理
|
||||
* 高级搜索
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button } from "antd";
|
||||
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
return (
|
||||
<div className="role-advance-search">
|
||||
<WeaInputSearch value={advanceForm.getFormParams().name}
|
||||
onChange={v => advanceForm.updateFields({ name: v })}
|
||||
onSearch={this.props.onAdvanceSearch}
|
||||
/>
|
||||
<Button type="ghost" className="wea-advanced-search text-elli"
|
||||
onClick={this.props.onOpenAdvanceSearch}>{getLabel(545754, "高级搜索")}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
.role-advance-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.wea-advanced-search {
|
||||
top: 0;
|
||||
left: -1px;
|
||||
height: 28px;
|
||||
line-height: 1;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
color: #474747;
|
||||
padding: 4px 15px;
|
||||
}
|
||||
|
||||
.wea-advanced-search:hover {
|
||||
border: 1px solid #dadada;
|
||||
color: #474747;
|
||||
}
|
||||
|
||||
.text-elli {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
* 业务线管理
|
||||
* 高级搜索面板
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { roleSearchConditions } from "../conditions";
|
||||
import { getAuthOptTree } from "../../../../apis/taxAgent";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { Button } from "antd";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class AdvanceSearchPannel extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { conditions: [] };
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
const { data } = await getAuthOptTree();
|
||||
this.setState({
|
||||
conditions: _.map(roleSearchConditions, item => ({
|
||||
...item, title: getLabel(item.lanId, item.title),
|
||||
items: _.map(item.items, o => {
|
||||
if (getKey(o) === "opts") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
options: _.map(o.options, k => ({ ...k, showname: getLabel(k.lanId, k.showname) }))
|
||||
};
|
||||
} else if (getKey(o) === "pages") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
treeData: [{
|
||||
label: data.name, value: data.key, key: data.key, id: data.key, name: data.name,
|
||||
children: _.map(data.modules, i => ({
|
||||
label: i.name, value: `${data.key}-${i.key}`, key: `${data.key}-${i.key}`,
|
||||
id: `${data.key}-${i.key}`, name: i.name,
|
||||
children: _.map(i.pages, k => ({
|
||||
label: k.name, value: k.key, key: k.key, selectable: true,
|
||||
id: k.key, name: k.name
|
||||
}))
|
||||
}))
|
||||
}]
|
||||
};
|
||||
}
|
||||
return { ...o, label: getLabel(o.lanId, o.label) };
|
||||
})
|
||||
}))
|
||||
}, () => advanceForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
|
||||
handleReset = () => {
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
this.setState({
|
||||
conditions: _.map(this.state.conditions, item => ({
|
||||
...item, items: _.map(item.items, o => ({ ...o, value: "" }))
|
||||
}))
|
||||
}, () => advanceForm.resetForm());
|
||||
};
|
||||
handleFormChange = (val) => {
|
||||
const key = _.keys(val)[0];
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
if (key === "taxAgentIds" || key === "sobIds" || key === "pages") {
|
||||
this.setState({
|
||||
conditions: _.map(this.state.conditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (key === getKey(o)) {
|
||||
return { ...o, value: _.map(val[key], o => o.id).join(",") };
|
||||
}
|
||||
return { ...o, value: advanceForm.getFormParams()[getKey(o)] };
|
||||
})
|
||||
}))
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
const { conditions } = this.state;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="wea-advanced-searchsAd">
|
||||
{getSearchs(advanceForm, conditions, 2, false, this.handleFormChange)}
|
||||
</div>
|
||||
<div className="wea-search-buttons">
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={this.handleReset}>{getLabel(2022, "重置")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AdvanceSearchPannel;
|
||||
|
||||
|
|
@ -0,0 +1,261 @@
|
|||
export const roleConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["name"],
|
||||
fieldcol: 16,
|
||||
label: "名称",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeURL: "/api/bs/hrmsalary/taxAgent/listAuth",
|
||||
dataParams: { filterType: "QUERY_DATA" },
|
||||
filterByName: true,
|
||||
tableProps: {},
|
||||
isSingle: false,
|
||||
searchParamsKey: "name"
|
||||
},
|
||||
conditionType: "CUSTOMBROWSER",
|
||||
domkey: ["taxAgentIds"],
|
||||
fieldcol: 16,
|
||||
label: "个税扣缴义务人",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeURL: "/api/bs/hrmsalary/salarysob/listAuth",
|
||||
dataParams: { filterType: "QUERY_DATA" },
|
||||
filterByName: true,
|
||||
tableProps: {},
|
||||
isSingle: false,
|
||||
searchParamsKey: "name"
|
||||
},
|
||||
conditionType: "CUSTOMBROWSER",
|
||||
domkey: ["sobIds"],
|
||||
fieldcol: 16,
|
||||
label: "薪资账套",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "TEXTAREA",
|
||||
domkey: ["description"],
|
||||
fieldcol: 16,
|
||||
label: "描述",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: ""
|
||||
}
|
||||
];
|
||||
export const roleOperatorConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["targetTypeName"],
|
||||
fieldcol: 18,
|
||||
label: "对象类型",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["targetName"],
|
||||
fieldcol: 18,
|
||||
label: "对象",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["link"],
|
||||
fieldcol: 18,
|
||||
label: "连接符",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["sortedIndex"],
|
||||
fieldcol: 18,
|
||||
label: "批次",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: ""
|
||||
}
|
||||
];
|
||||
export const roleSearchConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["name"],
|
||||
fieldcol: 16,
|
||||
label: "名称",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeURL: "/api/bs/hrmsalary/taxAgent/listAuth",
|
||||
dataParams: { filterType: "QUERY_DATA" },
|
||||
filterByName: true,
|
||||
tableProps: {},
|
||||
isSingle: false,
|
||||
searchParamsKey: "name"
|
||||
},
|
||||
conditionType: "CUSTOMBROWSER",
|
||||
domkey: ["taxAgentIds"],
|
||||
fieldcol: 16,
|
||||
label: "个税扣缴义务人",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
type: "17"
|
||||
},
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["roleEmpIds"],
|
||||
fieldcol: 16,
|
||||
isQuickSearch: false,
|
||||
label: "成员",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeURL: "/api/bs/hrmsalary/salarysob/listAuth",
|
||||
dataParams: { filterType: "QUERY_DATA" },
|
||||
filterByName: true,
|
||||
tableProps: {},
|
||||
isSingle: false,
|
||||
searchParamsKey: "name"
|
||||
},
|
||||
conditionType: "CUSTOMBROWSER",
|
||||
domkey: ["sobIds"],
|
||||
fieldcol: 16,
|
||||
label: "薪资账套",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
type: "17"
|
||||
},
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["employeeIds"],
|
||||
fieldcol: 16,
|
||||
isQuickSearch: false,
|
||||
label: "数据",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["opts"],
|
||||
fieldcol: 16,
|
||||
label: "权限项",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
multiple: true,
|
||||
options: [
|
||||
{ key: "query", showname: "查询", lanId: 111 },
|
||||
{ key: "admin", showname: "管理", lanId: 111 }
|
||||
],
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeURL: "",
|
||||
dataParams: { filterType: "" },
|
||||
filterByName: true,
|
||||
tableProps: {},
|
||||
isSingle: false,
|
||||
treeSelect: true,
|
||||
searchParamsKey: "name"
|
||||
},
|
||||
conditionType: "CUSTOMBROWSER",
|
||||
domkey: ["pages"],
|
||||
fieldcol: 16,
|
||||
label: "页面",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
treeData: [],
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: "基本信息",
|
||||
lanId: 111,
|
||||
col: 2
|
||||
}
|
||||
];
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
.tax_role_setting_browser {
|
||||
width: 100%;
|
||||
display: inline-block !important;
|
||||
|
||||
.wea-field-readonly.border {
|
||||
cursor: default !important;
|
||||
}
|
||||
|
||||
.wea-field-readonly.border .child-item {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.only-operate {
|
||||
position: relative;
|
||||
|
||||
& > a {
|
||||
white-space: normal !important;
|
||||
display: inline !important;
|
||||
color: #2db7f5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.only-operate:hover {
|
||||
.ant-select-selection__choice__remove {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-select-selection__choice__remove:before {
|
||||
content: "\E62D";
|
||||
font-family: anticon !important;
|
||||
}
|
||||
|
||||
.ant-select-selection__choice__remove {
|
||||
visibility: hidden;
|
||||
right: -3px;
|
||||
font-size: 12px !important;
|
||||
top: 50%;
|
||||
margin-top: -6px;
|
||||
text-decoration: none;
|
||||
position: static;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
transform: scale(.66666667) rotate(0deg);
|
||||
}
|
||||
}
|
||||
|
||||
.tax_role_set_dialog {
|
||||
.tax_role_set_container {
|
||||
padding: 10px 25px;
|
||||
|
||||
.tax_role_form_item {
|
||||
min-height: 190px;
|
||||
border: 1px solid rgb(217, 217, 217);
|
||||
|
||||
& > .wea-select {
|
||||
margin: 10px 10px 0 20px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.tax_role_operator_setting {
|
||||
border-top: 1px solid rgb(217, 217, 217);
|
||||
padding: 8px;
|
||||
display: table;
|
||||
width: 100%;
|
||||
|
||||
& > div:last-child {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.tax_role_browser_form_item {
|
||||
margin: 12px 14px;
|
||||
}
|
||||
|
||||
.tax_role_auth_tree {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.tax_role_operator_setting_table {
|
||||
.setting_table_title {
|
||||
& > .operator {
|
||||
line-height: 45px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.role-dialog {
|
||||
.form-dialog-layout {
|
||||
.ant-select-selection {
|
||||
height: auto !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* 角色权限设置
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/21
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import * as API from "../../../../apis/taxAgent";
|
||||
import { Row } from "antd";
|
||||
import { WeaLocaleProvider, WeaTree } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class AuthTree extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
checkedKeys: [], expandedKeys: [], datas: {}
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { roleId } = this.props;
|
||||
API.getAuthOptTree({ roleId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
datas: {
|
||||
canClick: true, id: data.key, nodeid: data.key, isParent: true, name: data.name,
|
||||
subs: _.map(data.modules, item => ({
|
||||
...item, canClick: true, id: item.key, nodeid: item.key, pid: data.key, isParent: !_.isEmpty(item.pages),
|
||||
subs: _.map(item.pages, o => ({
|
||||
...o, canClick: true, id: `${item.key}-${o.key}`, nodeid: `${item.key}-${o.key}`,
|
||||
pid: item.key, isParent: !_.isEmpty(o.opts),
|
||||
subs: _.map(o.opts, k => ({
|
||||
canClick: true, id: `${o.key}-${k.key}`, name: k.name, nodeid: `${o.key}-${k.key}`,
|
||||
pid: `${item.key}-${o.key}`, isParent: false, able: k.able
|
||||
}))
|
||||
}))
|
||||
}))
|
||||
}
|
||||
}, () => this.setState({ expandedKeys: this.initExpandKeys(), checkedKeys: this.initCheckedKeys() }));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initExpandKeys = () => {
|
||||
const { datas } = this.state;
|
||||
const parentIds = [];
|
||||
const findParent = (node) => {
|
||||
if (node.subs && node.subs.length > 0) {
|
||||
parentIds.push(node.id);
|
||||
node.subs.forEach(child => findParent(child));
|
||||
}
|
||||
};
|
||||
findParent(datas);
|
||||
return parentIds;
|
||||
};
|
||||
initCheckedKeys = () => {
|
||||
const { datas } = this.state;
|
||||
const checkedIds = [];
|
||||
const findCheckedId = (node) => {
|
||||
if (node.subs && node.subs.length > 0) {
|
||||
node.subs.forEach(child => {
|
||||
if (!!child.able) checkedIds.push(child.id);
|
||||
findCheckedId(child);
|
||||
});
|
||||
}
|
||||
};
|
||||
findCheckedId(datas);
|
||||
return checkedIds;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { checkedKeys, expandedKeys, datas } = this.state;
|
||||
return (
|
||||
<Row className="tax_role_auth_tree">
|
||||
<WeaTree
|
||||
checkable onCheck={checkedKeys => this.setState({ checkedKeys })} checkedKeys={checkedKeys}
|
||||
expandedKeys={expandedKeys} onExpand={expandedKeys => this.setState({ expandedKeys })}
|
||||
datas={datas}
|
||||
/>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AuthTree;
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* 编辑角色操作者
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/20
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { roleOperatorConditions } from "../conditions";
|
||||
import { getSearchs } from "../../../../util";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class EditRoleDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
conditions: [], loading: false, targetSob: {}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.setState({
|
||||
conditions: _.map(roleOperatorConditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
o = { ...o, label: getLabel(o.lanId, o.label), value: String(nextProps.record[getKey(o)]) };
|
||||
switch (getKey(o)) {
|
||||
case "link":
|
||||
o = { ...o, options: nextProps.linkOptions, hide: _.isEmpty(nextProps.linkOptions) };
|
||||
break;
|
||||
case "sortedIndex":
|
||||
o = { ...o, hide: _.isEmpty(nextProps.linkOptions) };
|
||||
break;
|
||||
case "targetName":
|
||||
o = ["EMP", "DEPARTMENT", "JOB", "SUB_COMPANY", "ROLE"].includes(nextProps.record.targetType) ?
|
||||
{
|
||||
...o, value: "", browserConditionParam: {
|
||||
...this.renderBrowserType(nextProps.record.targetType),
|
||||
replaceDatas: [{ id: nextProps.record["target"], name: nextProps.record[getKey(o)] }]
|
||||
}
|
||||
} :
|
||||
nextProps.record.targetType === "SQL" ? {
|
||||
...o, conditionType: "TEXTAREA", otherParams: { minRows: 3 }
|
||||
} : nextProps.record.targetType === "LEVEL" ?
|
||||
{
|
||||
...o, startValue: nextProps.record[getKey(o)].split("-")[0],
|
||||
endValue: nextProps.record[getKey(o)].split("-")[1],
|
||||
conditionType: "SCOPE", precision: 0
|
||||
} : (nextProps.record.targetType === "SOB" ||
|
||||
nextProps.record.targetType === "TAX") ? {
|
||||
...o, value: nextProps.record["target"],
|
||||
conditionType: "CUSTOMBROWSER", browserConditionParam: {
|
||||
completeURL: nextProps.record.targetType === "SOB" ?
|
||||
"/api/bs/hrmsalary/salarysob/listAuth" : "/api/bs/hrmsalary/taxAgent/listAuth",
|
||||
dataParams: { filterType: "QUERY_DATA" },
|
||||
filterByName: true, isSingle: true,
|
||||
tableProps: {}, searchParamsKey: "name",
|
||||
replaceDatas: [{ id: nextProps.record["target"], name: nextProps.record["targetName"] }]
|
||||
}
|
||||
} : { ...o };
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return o;
|
||||
})
|
||||
})),
|
||||
targetSob: { id: nextProps.record["target"], name: nextProps.record["targetName"] }
|
||||
}, () => nextProps.taxAgentStore.roleOperatorForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.setState({ targetSob: {} });
|
||||
nextProps.taxAgentStore.initRoleOperatorForm();
|
||||
}
|
||||
if (nextProps.loading !== this.props.loading && !nextProps.loading) this.props.onCancel();
|
||||
}
|
||||
|
||||
renderBrowserType = (enumType) => {
|
||||
let browserType = {};
|
||||
switch (enumType) {
|
||||
case "EMP":
|
||||
browserType = { ...browserType, type: 17, isSingle: true, title: getLabel(82246, "人员选择") };
|
||||
break;
|
||||
case "DEPARTMENT":
|
||||
browserType = { ...browserType, type: 57, isSingle: true, title: getLabel(111, "部门选择") };
|
||||
break;
|
||||
case "JOB":
|
||||
browserType = { ...browserType, type: 278, isSingle: true, title: getLabel(111, "岗位选择") };
|
||||
break;
|
||||
case "SUB_COMPANY":
|
||||
browserType = { ...browserType, type: 164, isSingle: true, title: getLabel(111, "分部选择") };
|
||||
break;
|
||||
case "ROLE":
|
||||
browserType = { ...browserType, type: 65, isSingle: true, title: getLabel(111, "角色选择") };
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return browserType;
|
||||
};
|
||||
save = () => {
|
||||
const { targetSob } = this.state;
|
||||
const { taxAgentStore: { roleOperatorForm }, record, onChange } = this.props;
|
||||
roleOperatorForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const { targetName: __, link, sortedIndex } = roleOperatorForm.getFormParams();
|
||||
const targetName = roleOperatorForm.getFormDatas().targetName;
|
||||
onChange([_.assign(record, {
|
||||
editId: record.id, sortedIndex,
|
||||
id: record.targetType === "LEVEL" ? targetName.value.join("-") : targetName.value,
|
||||
name: record.targetType === "SQL" ? __ :
|
||||
record.targetType === "LEVEL" ? __.join("-") : (targetName.valueSpan || targetSob.name),
|
||||
link: link === "undefined" ? "OR" : link
|
||||
})]);
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
handleFormChange = (val) => {
|
||||
const { record } = this.props;
|
||||
const key = _.keys(val)[0];
|
||||
if (key === "targetName" && (record.targetType === "SOB" || record.targetType === "TAX"))
|
||||
this.setState({ targetSob: _.head(val[key]) });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions } = this.state;
|
||||
const { taxAgentStore: { roleOperatorForm }, linkOptions, loading } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: _.isEmpty(linkOptions) ? 129 : 223 }}
|
||||
initLoadCss title={getLabel(111, "编辑操作者")}
|
||||
buttons={[
|
||||
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(111, "保存")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout">
|
||||
{getSearchs(roleOperatorForm, conditions, 1, false, this.handleFormChange)}
|
||||
</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default EditRoleDialog;
|
||||
|
|
@ -0,0 +1,476 @@
|
|||
/*
|
||||
* 角色详情设置弹窗
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/5
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import {
|
||||
WeaBrowser,
|
||||
WeaDialog,
|
||||
WeaFormItem,
|
||||
WeaInputNumber,
|
||||
WeaLocaleProvider,
|
||||
WeaScope,
|
||||
WeaSelect,
|
||||
WeaTab,
|
||||
WeaTable,
|
||||
WeaTextarea,
|
||||
WeaTools
|
||||
} from "ecCom";
|
||||
import { commonEnumList } from "../../../../apis/archive";
|
||||
import EditRoleDialog from "./editRoleDialog";
|
||||
import AuthTree from "./authTree";
|
||||
import * as API from "../../../../apis/taxAgent";
|
||||
import { Button, Col, message, Modal, Row } from "antd";
|
||||
import "../index.less";
|
||||
import CustomBrowser from "../../../../components/CustomBrowser";
|
||||
import { roleConditions } from "../conditions";
|
||||
import { getSearchs } from "../../../../util";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
const APIFOX = {
|
||||
"auth.MemberTargetTypeEnum": API.authMemberList,
|
||||
"save.auth.MemberTargetTypeEnum": API.saveAuthMember,
|
||||
"delete.auth.MemberTargetTypeEnum": API.deleteAuthMember,
|
||||
"sync.auth.MemberTargetTypeEnum": API.syncAuthMember,
|
||||
"auth.DataTargetTypeEnum": API.authDataList,
|
||||
"save.auth.DataTargetTypeEnum": API.saveAuthData,
|
||||
"delete.auth.DataTargetTypeEnum": API.deleteAuthData,
|
||||
"sync.auth.DataTargetTypeEnum": API.syncAuthData
|
||||
};
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "baseinfo", name: "", options: [], enumType: "", selectedRowKeys: [],
|
||||
replaceDatas: [], loading: { set: false, query: false, async: false, delete: false },
|
||||
columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
editOperatorDialog: { visible: false, linkOptions: [], record: {} },
|
||||
dataTargetSettings: { link: "OR", sortedIndex: null }, conditions: [],
|
||||
formData: { taxAgentIds: [], sobIds: [] }
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.setState({
|
||||
name: nextProps.name, selectedKey: nextProps.selectedKey || "baseinfo"
|
||||
}, () => {
|
||||
!["auth.AuthTargetTypeEnum", "baseinfo"].includes(this.state.selectedKey) && this.getEnumList();
|
||||
!["auth.AuthTargetTypeEnum", "baseinfo"].includes(this.state.selectedKey) && this.getSettingRoler(nextProps.roleId);
|
||||
this.state.selectedKey === "baseinfo" && this.getRole(nextProps.roleId);
|
||||
this.state.selectedKey === "auth.DataTargetTypeEnum" && this.getConnectSymbol();
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
selectedRowKeys: [], replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
dataTargetSettings: { link: "OR", sortedIndex: "" }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getRole = (id) => {
|
||||
API.getRole({ id }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(roleConditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgentIds" || getKey(o) === "sobIds") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
value: _.map(data[getKey(o)], i => String(i.id)).join(","),
|
||||
browserConditionParam: {
|
||||
...o.browserConditionParam,
|
||||
replaceDatas: _.map(data[getKey(o)], i => ({ id: String(i.id), name: i.name }))
|
||||
}
|
||||
};
|
||||
}
|
||||
return { ...o, label: getLabel(o.lanId, o.label) };
|
||||
})
|
||||
})),
|
||||
formData: {
|
||||
taxAgentIds: _.map(data["taxAgentIds"], i => ({ id: String(i.id), name: i.name })),
|
||||
sobIds: _.map(data["sobIds"], i => ({ id: String(i.id), name: i.name }))
|
||||
}
|
||||
}, () => {
|
||||
this.props.taxAgentStore.roleForm.initFormFields(this.state.conditions);
|
||||
this.props.taxAgentStore.roleForm.updateFields({
|
||||
name: { value: data.name },
|
||||
description: { value: data.description }
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
getEnumList = () => {
|
||||
const payload = { enumClass: `com.engine.salary.enums.${this.state.selectedKey}` };
|
||||
commonEnumList(payload).then(({ status, data }) => {
|
||||
if (status) this.setState({
|
||||
options: _.map(data, o => ({ key: o.enum, showname: o.defaultLabel })),
|
||||
enumType: _.head(data).enum || ""
|
||||
});
|
||||
if (!status) this.setState({ options: [], enumType: "" });
|
||||
});
|
||||
};
|
||||
getSettingRoler = (roleId) => {
|
||||
const { selectedKey, pageInfo } = this.state;
|
||||
this.setState({ loading: { ...this.state.loading, query: true } });
|
||||
APIFOX[selectedKey]({ roleId, ...pageInfo }).then(({ status, data }) => {
|
||||
this.setState({ loading: { ...this.state.loading, query: false } });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns: [
|
||||
...columns, {
|
||||
dataIndex: "opt", title: getLabel(111, "操作"), width: 120,
|
||||
render: (__, record) => (<a href="javascript:void(0);"
|
||||
onClick={() => this.handleEditOperator(record)}>{getLabel(111, "编辑")}</a>)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleEditOperator = (record) => {
|
||||
this.setState({ editOperatorDialog: { ...this.state.editOperatorDialog, visible: true, record } });
|
||||
};
|
||||
getConnectSymbol = async () => {
|
||||
const payload = { enumClass: `com.engine.salary.enums.auth.DataLinkEnum` };
|
||||
const { data } = await commonEnumList(payload);
|
||||
const linkOptions = _.map(data, o => ({ key: o.enum, showname: o.defaultLabel }));
|
||||
this.setState({ editOperatorDialog: { ...this.state.editOperatorDialog, linkOptions } });
|
||||
};
|
||||
addOperatorSettings = () => {
|
||||
const { roleId } = this.props;
|
||||
const { selectedKey, enumType: targetType, replaceDatas, dataTargetSettings } = this.state;
|
||||
if (_.isEmpty(replaceDatas)) {
|
||||
Modal.warning({
|
||||
title: getLabel(111, "系统提示"),
|
||||
content: getLabel(111, "请先选择操作对象的值!")
|
||||
});
|
||||
return;
|
||||
}
|
||||
const payload = _.map(replaceDatas, o => ({
|
||||
roleId, target: o.id || "", id: o.editId || "",
|
||||
targetType: o.targetType || targetType,
|
||||
targetName: o.name || "",
|
||||
link: o.link || dataTargetSettings.link,
|
||||
sortedIndex: o.sortedIndex || dataTargetSettings.sortedIndex
|
||||
}));
|
||||
this.setState({ loading: { ...this.state.loading, set: true } });
|
||||
APIFOX[`save.${selectedKey}`](payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: { ...this.state.loading, set: false } });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.setState({ replaceDatas: [] }, () => this.getSettingRoler(roleId));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
deleteOperatorSettings = () => {
|
||||
const { roleId } = this.props;
|
||||
const { selectedKey, selectedRowKeys } = this.state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
Modal.warning({
|
||||
title: getLabel(111, "信息确认"),
|
||||
content: getLabel(111, "确定要删除所选批次吗?")
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.setState({ loading: { ...this.state.loading, delete: true } });
|
||||
APIFOX[`delete.${selectedKey}`](selectedRowKeys).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: { ...this.state.loading, delete: false } });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.setState({ selectedRowKeys: [] }, () => this.getSettingRoler(roleId));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
saveAuthOpt = () => {
|
||||
const { roleId } = this.props, { selectedKey } = this.state;
|
||||
if (selectedKey === "baseinfo") {
|
||||
this.saveBaseInfo();
|
||||
return;
|
||||
}
|
||||
const { state: { checkedKeys } } = this.authTreeRef;
|
||||
const payload = {
|
||||
roleId, opts: _.reduce(checkedKeys, (pre, cur) => {
|
||||
if (cur.indexOf("query") !== -1 || cur.indexOf("admin") !== -1) {
|
||||
const [page, opt] = cur.split("-");
|
||||
return [...pre, { page, opt }];
|
||||
}
|
||||
return pre;
|
||||
}, [])
|
||||
};
|
||||
this.setState({ loading: { ...this.state.loading, set: true } });
|
||||
API.saveAuthOpt(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: { ...this.state.loading, set: false } });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
saveBaseInfo = () => {
|
||||
const { taxAgentStore: { roleForm }, roleId } = this.props;
|
||||
const { formData } = this.state;
|
||||
roleForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = roleForm.getFormParams();
|
||||
this.setState({ loading: { ...this.state.loading, set: true } });
|
||||
API.saveAuthRole({ id: roleId, ...payload, ...formData }).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: { ...this.state.loading, set: false } });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.props.onSearch && this.props.onSearch();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
syncAuthData = () => {
|
||||
const { roleId } = this.props, { selectedKey } = this.state;
|
||||
this.setState({ async: true });
|
||||
APIFOX[`sync.${selectedKey}`]({ roleId }).then(({ status, errormsg }) => {
|
||||
this.setState({ async: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
getOperatorSetting = () => {
|
||||
const { roleId, taxAgentStore: { roleForm } } = this.props;
|
||||
const { selectedKey, enumType, replaceDatas, conditions } = this.state;
|
||||
if (!["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey)) {
|
||||
let browserType = {};
|
||||
switch (enumType) {
|
||||
case "EMP":
|
||||
browserType = { ...browserType, type: 17, title: getLabel(82246, "人员选择") };
|
||||
break;
|
||||
case "DEPARTMENT":
|
||||
browserType = { ...browserType, type: 57, title: getLabel(111, "部门选择") };
|
||||
break;
|
||||
case "JOB":
|
||||
browserType = { ...browserType, type: 278, title: getLabel(111, "岗位选择") };
|
||||
break;
|
||||
case "SUB_COMPANY":
|
||||
browserType = { ...browserType, type: 164, title: getLabel(111, "分部选择") };
|
||||
break;
|
||||
case "ROLE":
|
||||
browserType = { ...browserType, type: 65, title: getLabel(111, "角色选择") };
|
||||
break;
|
||||
case "SQL":
|
||||
return (<Row className="tax_role_browser_form_item">
|
||||
<WeaTextarea style={{ width: "100%" }} minRows={3}
|
||||
value={_.head(replaceDatas) ? _.head(replaceDatas).name : ""}
|
||||
onChange={v => this.setState({ replaceDatas: [{ id: v, name: v }] })}/>
|
||||
</Row>);
|
||||
case "LEVEL":
|
||||
return (<WeaFormItem label={getLabel(111, "安全级别")} labelCol={{ span: 2 }} wrapperCol={{ span: 5 }}
|
||||
className="tax_role_browser_form_item">
|
||||
<WeaScope isMobx value={_.reduce(replaceDatas, (pre, cur) => cur.id.split("-"), [])}
|
||||
onChange={v => this.setState({ replaceDatas: [{ id: v.join("-"), name: v.join("-") }] })}/>
|
||||
</WeaFormItem>);
|
||||
case "SOB":
|
||||
return (<WeaFormItem label={getLabel(111, "薪资账套")} labelCol={{ span: 2 }} wrapperCol={{ span: 5 }}
|
||||
className="tax_role_browser_form_item">
|
||||
<CustomBrowser
|
||||
fieldConfig={{
|
||||
viewAttr: 2,
|
||||
browserConditionParam: {
|
||||
completeURL: "/api/bs/hrmsalary/salarysob/listAuth", dataParams: { filterType: "QUERY_DATA" },
|
||||
filterByName: true, tableProps: {}, isSingle: false, searchParamsKey: "name", replaceDatas
|
||||
}
|
||||
}}
|
||||
value={_.map(replaceDatas, o => (o.id))}
|
||||
onCustomChange={replaceDatas => this.setState({
|
||||
replaceDatas: _.map(_.values(replaceDatas), o => ({ id: o.id, name: o.name }))
|
||||
})}
|
||||
/>
|
||||
</WeaFormItem>);
|
||||
case "TAX":
|
||||
return (<WeaFormItem label={getLabel(111, "扣缴义务人")} labelCol={{ span: 4 }} wrapperCol={{ span: 6 }}
|
||||
className="tax_role_browser_form_item">
|
||||
<CustomBrowser
|
||||
fieldConfig={{
|
||||
viewAttr: 2,
|
||||
browserConditionParam: {
|
||||
completeURL: "/api/bs/hrmsalary/taxAgent/listAuth", dataParams: { filterType: "QUERY_DATA" },
|
||||
filterByName: true, tableProps: {}, isSingle: false, searchParamsKey: "name", replaceDatas
|
||||
}
|
||||
}}
|
||||
value={_.map(replaceDatas, o => (o.id))}
|
||||
onCustomChange={replaceDatas => this.setState({
|
||||
replaceDatas: _.map(_.values(replaceDatas), o => ({ id: o.id, name: o.name }))
|
||||
})}
|
||||
/>
|
||||
</WeaFormItem>);
|
||||
default:
|
||||
return (<Row className="tax_role_browser_form_item"></Row>);
|
||||
}
|
||||
return (<Row className="tax_role_browser_form_item">
|
||||
<WeaBrowser {...browserType} isSingle={false} inputStyle={{ width: 150 }} replaceDatas={replaceDatas}
|
||||
onChange={(__, ___, replaceDatas) => this.setState({ replaceDatas })}/>
|
||||
</Row>);
|
||||
} else if (selectedKey === "auth.AuthTargetTypeEnum") {
|
||||
return (<AuthTree roleId={roleId} ref={dom => this.authTreeRef = dom}/>);
|
||||
}
|
||||
return getSearchs(roleForm, conditions, 1, false, this.handleFormChange);
|
||||
};
|
||||
handleFormChange = (val) => {
|
||||
const key = _.keys(val)[0];
|
||||
if (key === "taxAgentIds" || key === "sobIds") {
|
||||
this.setState({ formData: { ...this.state.formData, ...val } });
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { roleId, taxAgentStore } = this.props;
|
||||
const {
|
||||
selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog,
|
||||
dataTargetSettings
|
||||
} = this.state;
|
||||
const { linkOptions } = editOperatorDialog;
|
||||
const tabs = [
|
||||
{ title: getLabel(111, "基础信息"), viewcondition: "baseinfo" },
|
||||
{ title: getLabel(111, "成员设置"), viewcondition: "auth.MemberTargetTypeEnum" },
|
||||
{ title: getLabel(111, "功能权限"), viewcondition: "auth.AuthTargetTypeEnum" },
|
||||
{ title: getLabel(111, "数据范围"), viewcondition: "auth.DataTargetTypeEnum" }
|
||||
];
|
||||
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.getSettingRoler(roleId));
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => this.getSettingRoler(roleId));
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={this.syncAuthData} loading={loading.async}>{getLabel(111, "同步")}</Button>,
|
||||
<Button type="primary" loading={loading.set} onClick={this.saveAuthOpt}>{getLabel(111, "保存")}</Button>
|
||||
];
|
||||
["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.shift();
|
||||
!["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.pop();
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} hasScroll className="tax_role_set_dialog" initLoadCss
|
||||
title={`${getLabel(111, "编辑业务线")}-(${name})`}
|
||||
buttons={buttons} style={{
|
||||
width: 960, height: 606.6, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}
|
||||
>
|
||||
<div className="tax_role_set_container">
|
||||
<Row>
|
||||
<div className="tax_role_form_item">
|
||||
<WeaTab datas={tabs} keyParam="viewcondition" selectedKey={selectedKey}
|
||||
onChange={v => this.setState({
|
||||
selectedKey: v, replaceDatas: [], selectedRowKeys: []
|
||||
}, () => {
|
||||
taxAgentStore.roleForm.resetForm();
|
||||
const { selectedKey } = this.state;
|
||||
!["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && this.getEnumList();
|
||||
!["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && this.getSettingRoler(roleId);
|
||||
selectedKey === "auth.DataTargetTypeEnum" && this.getConnectSymbol();
|
||||
selectedKey === "baseinfo" && this.getRole(roleId);
|
||||
})}/>
|
||||
{
|
||||
!["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) &&
|
||||
<WeaSelect options={options} detailtype={3} value={enumType}
|
||||
onChange={v => this.setState({ enumType: v, replaceDatas: [] })}/>
|
||||
}
|
||||
{this.getOperatorSetting()}
|
||||
{
|
||||
!["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) &&
|
||||
<Row className="tax_role_operator_setting">
|
||||
{
|
||||
this.state.selectedKey === "auth.DataTargetTypeEnum" &&
|
||||
<Col span={16}>
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<WeaFormItem label={getLabel(111, "连接符")} labelCol={{ span: 8 }} wrapperCol={{ span: 14 }}>
|
||||
<WeaSelect value={dataTargetSettings.link} options={linkOptions}
|
||||
onChange={link => this.setState({
|
||||
dataTargetSettings: { ...dataTargetSettings, link }
|
||||
})}/>
|
||||
</WeaFormItem>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<WeaFormItem label={getLabel(111, "批次")} labelCol={{ span: 8 }} wrapperCol={{ span: 14 }}>
|
||||
<WeaInputNumber value={dataTargetSettings.sortedIndex}
|
||||
onChange={sortedIndex => this.setState({
|
||||
dataTargetSettings: { ...dataTargetSettings, sortedIndex }
|
||||
})}/>
|
||||
</WeaFormItem>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
}
|
||||
<Col span={8} offset={this.state.selectedKey === "auth.DataTargetTypeEnum" ? 0 : 16}>
|
||||
<Button type="primary" loading={loading.set}
|
||||
onClick={this.addOperatorSettings}>{getLabel(111, "添加操作者设置")}</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
}
|
||||
</div>
|
||||
</Row>
|
||||
{/*表格*/}
|
||||
{
|
||||
!["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) &&
|
||||
<Row className="tax_role_operator_setting_table">
|
||||
<Col span={24} className="setting_table_title">
|
||||
<div className="wea-f12 text-elli operator">
|
||||
<span>{getLabel(111, "已设操作者")}</span>
|
||||
<Button type="ghost" disabled={_.isEmpty(selectedRowKeys)} loading={loading.delete}
|
||||
onClick={this.deleteOperatorSettings}>{getLabel(111, "批量删除")}</Button>
|
||||
</div>
|
||||
<WeaTable rowKey="id" columns={columns} dataSource={dataSource} bordered loading={loading.query}
|
||||
pagination={pagination} rowSelection={rowSelection}/>
|
||||
{/* 编辑操作者*/}
|
||||
<EditRoleDialog {...editOperatorDialog} loading={loading.set}
|
||||
onChange={replaceDatas => this.setState({ replaceDatas }, () => this.addOperatorSettings())}
|
||||
onCancel={callback => this.setState({
|
||||
editOperatorDialog: { ...editOperatorDialog, visible: false, record: {} }
|
||||
}, () => callback && callback())}/>
|
||||
</Col>
|
||||
</Row>
|
||||
}
|
||||
</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* 个税扣缴义务人-角色设置
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/5
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaBrowser, WeaLocaleProvider } from "ecCom";
|
||||
import { message, Modal } from "antd";
|
||||
import AddRoleDialog from "../addRoleDialog";
|
||||
import RoleDetailSetDialog from "../roleDetailSetDialog";
|
||||
import * as API from "../../../../apis/taxAgent";
|
||||
import "../index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
addRoleDialog: { visible: false, taxAgentId: "" },
|
||||
roleSetDialog: { visible: false, roleId: "", name: "" }
|
||||
};
|
||||
}
|
||||
|
||||
showRoleSetDialog = (role) => this.setState({ roleSetDialog: { visible: true, roleId: role.id, name: role.name } });
|
||||
deleteAuthRole = (role) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(111, "信息确认"),
|
||||
content: getLabel(111, "确认要删除吗?"),
|
||||
onOk: () => {
|
||||
API.deleteAuthRole([role.id]).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.props.onSearch();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
render() {
|
||||
const { addRoleDialog, roleSetDialog } = this.state;
|
||||
const { taxAgent, onSearch } = this.props;
|
||||
const { role } = taxAgent;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<WeaBrowser type={-99991} isSingle={false} hasAddBtn hasBorder whiteBackground viewAttr={1}
|
||||
className="tax_role_setting_browser"
|
||||
addOnClick={() => this.setState({ addRoleDialog: { taxAgentId: taxAgent.id, visible: true } })}
|
||||
replaceDatas={_.map(role, o => ({
|
||||
id: o.id,
|
||||
name: <span className="only-operate">
|
||||
<a href="javascript:void(0);" onClick={() => this.showRoleSetDialog(o)}>{o.name}</a>
|
||||
<span className="ant-select-selection__choice__remove"
|
||||
onClick={() => this.deleteAuthRole(o)}/>
|
||||
</span>
|
||||
}))}/>
|
||||
{/*添加角色*/}
|
||||
<AddRoleDialog {...addRoleDialog} onSearch={onSearch}
|
||||
showRoleSetDialog={this.showRoleSetDialog}
|
||||
onCancel={callback => this.setState({
|
||||
addRoleDialog: { ...addRoleDialog, visible: false }
|
||||
}, () => callback && callback())}/>
|
||||
{/*角色详情设置*/}
|
||||
<RoleDetailSetDialog {...roleSetDialog} onSearch={onSearch}
|
||||
onCancel={callback => this.setState({
|
||||
roleSetDialog: { ...roleSetDialog, visible: false }
|
||||
}, () => callback && callback())}/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
* 角色管理
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/6
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import * as API from "../../apis/taxAgent";
|
||||
import AddRoleDialog from "./components/addRoleDialog";
|
||||
import RoleDetailSetDialog from "./components/roleDetailSetDialog";
|
||||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import AdvanceSearchPannel from "./components/advanceSearchPannel";
|
||||
import LogDialog from "../../components/logViewModal";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false },
|
||||
roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" },
|
||||
logDialogVisible: false, filterConditions: "", showSearchAd: false
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getRoleList();
|
||||
}
|
||||
|
||||
getRoleList = () => {
|
||||
const { taxAgentStore: { advanceForm } } = this.props, { pageInfo } = this.state;
|
||||
const paylaod = {
|
||||
...pageInfo, ...advanceForm.getFormParams(),
|
||||
employeeIds: !_.isEmpty(advanceForm.getFormParams()["employeeIds"]) ? advanceForm.getFormParams()["employeeIds"].split(",") : [],
|
||||
opts: !_.isEmpty(advanceForm.getFormParams()["opts"]) ? advanceForm.getFormParams()["opts"].split(",") : [],
|
||||
roleEmpIds: !_.isEmpty(advanceForm.getFormParams()["roleEmpIds"]) ? advanceForm.getFormParams()["roleEmpIds"].split(",") : [],
|
||||
sobIds: !_.isEmpty(advanceForm.getFormParams()["sobIds"]) ? advanceForm.getFormParams()["sobIds"].split(",") : [],
|
||||
taxAgentIds: !_.isEmpty(advanceForm.getFormParams()["taxAgentIds"]) ? advanceForm.getFormParams()["taxAgentIds"].split(",") : [],
|
||||
pages: !_.isEmpty(advanceForm.getFormParams()["pages"]) ? advanceForm.getFormParams()["pages"].split(",") : []
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
API.getRoleList(paylaod).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { list: dataSource, columns, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns: [..._.map(columns, o => {
|
||||
if (
|
||||
o.dataIndex === "resources" || o.dataIndex === "members" ||
|
||||
o.dataIndex === "opts" || o.dataIndex === "datas"
|
||||
) {
|
||||
const tabsKey = {
|
||||
resources: "baseinfo",
|
||||
members: "auth.MemberTargetTypeEnum",
|
||||
opts: "auth.AuthTargetTypeEnum",
|
||||
datas: "auth.DataTargetTypeEnum"
|
||||
};
|
||||
return {
|
||||
...o, render: (text, record) => (
|
||||
<a href="javascript:void(0)" style={{ marginRight: 10 }} onClick={() => this.showRoleSetDialog({
|
||||
...record, selectedKey: tabsKey[o.dataIndex]
|
||||
})}>{text}</a>)
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
}), {
|
||||
title: getLabel(111, "操作"), width: 150, dataIndex: "action",
|
||||
render: (__, record) => (
|
||||
<React.Fragment>
|
||||
<a href="javascript:void(0)" style={{ marginRight: 10 }}
|
||||
onClick={() => this.showRoleSetDialog(record)}>{getLabel(111, "编辑")}</a>
|
||||
<a href="javascript:void(0)" style={{ marginRight: 10 }}
|
||||
onClick={() => this.deleteAuthRole([record.id])}>{getLabel(111, "删除")}</a>
|
||||
<Dropdown overlay={
|
||||
<Menu onClick={e => this.handleDropMenuClick(e.key, record.id)}>
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0);"><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment>
|
||||
)
|
||||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
showRoleSetDialog = (role) => this.setState({
|
||||
roleSetDialog: { visible: true, roleId: role.id, name: role.name, selectedKey: role.selectedKey }
|
||||
});
|
||||
deleteAuthRole = (payload) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(111, "信息确认"),
|
||||
content: getLabel(111, "确认要删除吗?"),
|
||||
onOk: () => {
|
||||
API.deleteAuthRole(payload).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.setState({ selectedRowKeys: [] }, () => this.getRoleList());
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleDropMenuClick = (key, targetid = "") => {
|
||||
switch (key) {
|
||||
case "log":
|
||||
this.setState({
|
||||
logDialogVisible: true,
|
||||
filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog,
|
||||
logDialogVisible, filterConditions, showSearchAd
|
||||
} = this.state;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const admin = PageAndOptAuth.opts.includes("admin");
|
||||
const dropMenuDatas = [{
|
||||
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(545781, "操作日志")
|
||||
}];
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
addRoleDialog: { taxAgentId: "", visible: true }
|
||||
})}>{getLabel(111, "新建")}</Button>,
|
||||
<Button type="ghost" disabled={_.isEmpty(selectedRowKeys)}
|
||||
onClick={() => this.deleteAuthRole(selectedRowKeys)}>{getLabel(111, "批量删除")}</Button>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.setState({ showSearchAd: true })}
|
||||
onAdvanceSearch={() => this.setState({ pageInfo: { ...pageInfo, current: 1 } },
|
||||
() => this.getRoleList())}/>
|
||||
];
|
||||
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.getRoleList());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getRoleList());
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
!admin && buttons.shift();
|
||||
!admin && buttons.shift();
|
||||
return (
|
||||
<WeaTop title={getLabel(111, "业务线管理")} icon={<i className="icon-coms-Flow-setting"/>} iconBgcolor="#F14A2D"
|
||||
buttons={buttons} className="rolemanagement-index" showDropIcon dropMenuDatas={dropMenuDatas}
|
||||
onDropMenuClick={this.handleDropMenuClick}>
|
||||
<div className="rolemanagement-content">
|
||||
<div
|
||||
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<AdvanceSearchPannel onCancel={() => this.setState({ showSearchAd: false })}
|
||||
onAdSearch={() => this.setState({
|
||||
showSearchAd: false, pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.getRoleList())}/>
|
||||
</div>
|
||||
<WeaTable dataSource={dataSource} columns={columns} pagination={pagination} loading={loading}
|
||||
rowSelection={rowSelection} scroll={{ y: `calc(100vh - 173px)` }} rowKey="id"/>
|
||||
{/*添加角色*/}
|
||||
<AddRoleDialog {...addRoleDialog} onSearch={this.getRoleList}
|
||||
showRoleSetDialog={this.showRoleSetDialog}
|
||||
onCancel={callback => this.setState({
|
||||
addRoleDialog: { ...addRoleDialog, visible: false }
|
||||
}, () => callback && callback())}/>
|
||||
{/*角色详情设置*/}
|
||||
<RoleDetailSetDialog {...roleSetDialog} onSearch={this.getRoleList}
|
||||
onCancel={callback => this.setState({
|
||||
roleSetDialog: { ...roleSetDialog, visible: false }
|
||||
}, () => {
|
||||
this.props.taxAgentStore.initRoleForm();
|
||||
callback && callback();
|
||||
})}/>
|
||||
</div>
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} logFunction="authlink" filterConditions={filterConditions}
|
||||
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
</WeaTop>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
.rolemanagement-index {
|
||||
.rolemanagement-content {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 16px 16px 0;
|
||||
background: rgb(246, 246, 246);
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-container {
|
||||
background: #FFF;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #e5e5e5;
|
||||
|
||||
.wea-search-buttons {
|
||||
border-top: 1px solid #dadada;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
.wea-advanced-searchsAd {
|
||||
height: 247px;
|
||||
overflow: hidden auto;
|
||||
|
||||
.formItem-delete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -40px;
|
||||
}
|
||||
|
||||
.searchAdvanced-commonSelect {
|
||||
border-top: 1px solid #ebebeb;
|
||||
margin: 0 25px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.custom-advance-largeSpacing {
|
||||
padding-left: 26px;
|
||||
|
||||
.link {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 12px 10px 12px 26px;
|
||||
color: #2db7f5
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wea-input-focus .ant-input {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
}
|
||||
|
|
@ -144,20 +144,20 @@ export const conditions = [
|
|||
title: getLabel(111, "薪资核算固定列头数"),
|
||||
defaultshow: true
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["extEmpsWitch"],
|
||||
fieldcol: 10,
|
||||
label: getLabel(111, "开启非系统人员"),
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
title: getLabel(111, "非系统人员"),
|
||||
defaultshow: true
|
||||
},
|
||||
// {
|
||||
// items: [
|
||||
// {
|
||||
// conditionType: "SWITCH",
|
||||
// domkey: ["extEmpsWitch"],
|
||||
// fieldcol: 10,
|
||||
// label: getLabel(111, "开启非系统人员"),
|
||||
// labelcol: 8,
|
||||
// viewAttr: 2
|
||||
// }
|
||||
// ],
|
||||
// title: getLabel(111, "非系统人员"),
|
||||
// defaultshow: true
|
||||
// },
|
||||
{
|
||||
items: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom";
|
|||
import { message, Modal } from "antd";
|
||||
import * as API from "../../apis/ruleconfig";
|
||||
import { conditions, payloadList } from "./conditions";
|
||||
import ProgressModal from "../../components/progressModal";
|
||||
import { renderRuleForm } from "./form";
|
||||
import { getConditionDomkeys } from "../../util";
|
||||
import "./index.less";
|
||||
import ProgressModal from "../../components/progressModal";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
|
|||
|
|
@ -2,56 +2,240 @@ import { WeaLocaleProvider } from "ecCom";
|
|||
import { dataTypeOptions, patternOptions, roundingModeOptions } from "./options";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
export const columns = [
|
||||
|
||||
|
||||
export const salaryItemConditions = [
|
||||
{
|
||||
title: "名称",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "属性",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "薪资档案引用",
|
||||
dataIndex: "refere",
|
||||
key: "refere"
|
||||
},
|
||||
{
|
||||
title: "默认使用",
|
||||
dataIndex: "refere",
|
||||
key: "refere"
|
||||
},
|
||||
{
|
||||
title: "进位规则",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "保留小数位",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "取值方式",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "cz",
|
||||
key: "cz"
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["name"],
|
||||
fieldcol: 14,
|
||||
label: "名称",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["useDefault"],
|
||||
fieldcol: 14,
|
||||
label: "默认使用",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "0",
|
||||
rules: "required|string",
|
||||
tipLanId: 111,
|
||||
tip: "提示:开启后,每个薪资方案都有该薪资项目,可在具体薪资方案中删除",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["hideDefault"],
|
||||
fieldcol: 14,
|
||||
label: "核算时隐藏",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "0",
|
||||
rules: "required|string",
|
||||
tipLanId: 111,
|
||||
tip: "提示:开启后,在薪资账套中添加该项目时,默认勾选隐藏且在核算时隐藏该薪资项目,可在具体薪资账套中设置是否隐藏",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["sharedType"],
|
||||
fieldcol: 14,
|
||||
label: "可见性",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["taxAgentIds"],
|
||||
fieldcol: 14,
|
||||
label: "可见性范围",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [],
|
||||
multiple: true,
|
||||
rules: "",
|
||||
viewAttr: 2,
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["dataType"],
|
||||
fieldcol: 14,
|
||||
label: "字段类型",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [
|
||||
{ key: "number", showname: "数值", lanId: 111, selected: true },
|
||||
{ key: "string", showname: "字符", lanId: 111, selected: false }
|
||||
],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["roundingMode"],
|
||||
fieldcol: 14,
|
||||
label: "舍入规则",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [
|
||||
{ key: "1", selected: true, showname: "原始数据", lanId: 111 },
|
||||
{ key: "2", selected: false, showname: "四舍五入", lanId: 111 },
|
||||
{ key: "3", selected: false, showname: "向上舍入", lanId: 111 },
|
||||
{ key: "4", selected: false, showname: "向下舍入", lanId: 111 },
|
||||
{ key: "5", selected: false, showname: "见分进角", lanId: 111 }
|
||||
],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["pattern"],
|
||||
fieldcol: 14,
|
||||
label: "保留小数位",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "2",
|
||||
options: [
|
||||
{ key: "0", selected: false, showname: "0" },
|
||||
{ key: "1", selected: false, showname: "1" },
|
||||
{ key: "2", selected: true, showname: "2" },
|
||||
{ key: "3", selected: false, showname: "3" },
|
||||
{ key: "4", selected: false, showname: "4" },
|
||||
{ key: "5", selected: false, showname: "5" },
|
||||
{ key: "6", selected: false, showname: "6" },
|
||||
{ key: "7", selected: false, showname: "7" },
|
||||
{ key: "8", selected: false, showname: "8" },
|
||||
{ key: "9", selected: false, showname: "9" },
|
||||
{ key: "10", selected: false, showname: "10" }
|
||||
],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["valueType"],
|
||||
fieldcol: 14,
|
||||
label: "取值方式",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
otherParams: { detailtype: 3 },
|
||||
options: [
|
||||
{ key: "1", showname: "输入", selected: true, lanId: 111 },
|
||||
{ key: "2", showname: "公式", selected: false, lanId: 111 },
|
||||
{ key: "3", showname: "SQL", selected: false, lanId: 111 }
|
||||
],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["defaultValue"],
|
||||
fieldcol: 14,
|
||||
label: "默认值",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
otherParams: { precision: 2 },
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["formulaContent"],
|
||||
fieldcol: 14,
|
||||
label: "公式",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 3,
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["formulaId"],
|
||||
fieldcol: 14,
|
||||
label: "公式",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 3,
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["sortedIndex"],
|
||||
fieldcol: 14,
|
||||
label: "显示顺序",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["width"],
|
||||
fieldcol: 14,
|
||||
label: "显示宽度",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "TEXTAREA",
|
||||
domkey: ["description"],
|
||||
fieldcol: 14,
|
||||
label: "备注",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2,
|
||||
otherParams: { minRows: 3 }
|
||||
},
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["useInEmployeeSalary"],
|
||||
fieldcol: 14,
|
||||
label: "薪资档案引用",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "0",
|
||||
viewAttr: 2,
|
||||
tipLanId: 111,
|
||||
tip: "提示:开启后,该薪资项目不可删除或设为无效,取值方式会默认置为输入",
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["systemType"],
|
||||
fieldcol: 14,
|
||||
label: "是否系统默认",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "0",
|
||||
viewAttr: 2,
|
||||
hide: true
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const salaryItemFields = [
|
||||
|
|
|
|||
|
|
@ -1,62 +1,210 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTools } from "ecCom";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import FormalFormModal from "./formalFormModal";
|
||||
import SalaryItemForm from "./salaryItemForm";
|
||||
import "./index.less";
|
||||
import { salaryItemConditions } from "./columns";
|
||||
import { commonEnumList } from "../../apis/archive";
|
||||
import { postFetch } from "../../util/request";
|
||||
import { getItemForm } from "../../apis/item";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("salaryItemStore")
|
||||
@observer
|
||||
export default class CustomSalaryItemSlide extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showForm: false,
|
||||
formalModalVisible: false,
|
||||
salaryItemName: ""
|
||||
conditions: [], visible: false
|
||||
};
|
||||
}
|
||||
|
||||
handleChange = (params) => {
|
||||
this.props.onChange({ ...this.props.request, ...params });
|
||||
};
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
document.querySelector(".custom_salaryItemSlide").classList.add("zIndex0-weaslide-title");
|
||||
this.initForm(nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
document.querySelector(".custom_salaryItemSlide").classList.remove("zIndex0-weaslide-title");
|
||||
this.props.salaryItemStore.initItemsForm();
|
||||
}
|
||||
}
|
||||
|
||||
handleShowFormal = (salaryItemName) => {
|
||||
handleChange = (data) => {
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
form.updateFields({ formulaContent: { value: data["formula"] }, formulaId: { value: data["id"] } });
|
||||
};
|
||||
initForm = async (props) => {
|
||||
const { data: salaryItemForm } = props.id ?
|
||||
await getItemForm({ id: props.id }) :
|
||||
{
|
||||
data: { sharedType: "0", useDefault: "0", hideDefault: "0", pattern: 2, dataType: "number", valueType: "1" }
|
||||
};
|
||||
const [{ data: sharedTypeList }, { data: taxAgentList }] = await Promise.all([
|
||||
commonEnumList({ enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }),
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" })
|
||||
]);
|
||||
this.setState({
|
||||
formalModalVisible: true,
|
||||
salaryItemName
|
||||
conditions: _.map(salaryItemConditions, c => {
|
||||
return {
|
||||
...c, items: _.map(c.items, fields => {
|
||||
fields = {
|
||||
...fields, viewAttr: props.showOperateBtn ? fields.viewAttr : 1,
|
||||
label: getLabel(fields.lanId, fields.label),
|
||||
value: !_.isNil(salaryItemForm[getKey(fields)]) ? String(salaryItemForm[getKey(fields)]) : fields.value
|
||||
};
|
||||
switch (getKey(fields)) {
|
||||
case "sharedType":
|
||||
fields = {
|
||||
...fields, options: _.map(sharedTypeList, o => ({ key: o.value, showname: o.defaultLabel }))
|
||||
};
|
||||
break;
|
||||
case "taxAgentIds":
|
||||
fields = {
|
||||
...fields, options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name })),
|
||||
hide: String(salaryItemForm["sharedType"]) === "0" || !_.isNil(salaryItemForm["sharedType"])
|
||||
};
|
||||
break;
|
||||
case "dataType":
|
||||
case "valueType":
|
||||
fields = {
|
||||
...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) }))
|
||||
};
|
||||
break;
|
||||
case "roundingMode":
|
||||
fields = {
|
||||
...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) })),
|
||||
hide: String(salaryItemForm["dataType"]) === "string"
|
||||
};
|
||||
break;
|
||||
case "pattern":
|
||||
fields = {
|
||||
...fields, hide: String(salaryItemForm["dataType"]) === "string"
|
||||
};
|
||||
break;
|
||||
case "defaultValue":
|
||||
const otherParams = String(salaryItemForm["dataType"]) === "number" ? { precision: Number(salaryItemForm["pattern"]) } : {};
|
||||
fields = {
|
||||
...fields, otherParams,
|
||||
conditionType: String(salaryItemForm["dataType"]) === "string" ? "INPUT" : "INPUTNUMBER",
|
||||
hide: String(salaryItemForm["valueType"]) !== "1"
|
||||
};
|
||||
break;
|
||||
case "formulaContent":
|
||||
fields = {
|
||||
...fields, hide: String(salaryItemForm["valueType"]) === "1",
|
||||
label: String(salaryItemForm["valueType"]) === "2" ? getLabel(111, "公式") : getLabel(111, "SQL")
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return fields;
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
props.salaryItemStore.itemsForm.initFormFields(this.state.conditions);
|
||||
});
|
||||
};
|
||||
|
||||
// 保存公式成功回调
|
||||
handleSaveFormal = (data) => {
|
||||
this.handleChange({
|
||||
formulaId: data.id, formulaContent: data.formula,
|
||||
originFormulaContent: data.referenceType === "formula" ? data.formula : "",
|
||||
originSqlContent: data.referenceType === "sql" ? data.formula : ""
|
||||
handleChangeFormItem = (res) => {
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
const { conditions } = this.state, [key] = _.keys(res), value = res[key].value;
|
||||
this.setState({
|
||||
conditions: _.map(conditions, c => {
|
||||
return {
|
||||
...c, items: _.map(c.items, fields => {
|
||||
if (key === "sharedType" && getKey(fields) === "taxAgentIds") {
|
||||
fields = { ...fields, viewAttr: value === "0" ? 2 : 3, hide: value === "0" };
|
||||
} else if (key === "dataType" && (getKey(fields) === "roundingMode" || getKey(fields) === "pattern")) {
|
||||
fields = { ...fields, hide: value === "string" };
|
||||
} else if ((key === "dataType" || key === "pattern") && getKey(fields) === "defaultValue") {
|
||||
const otherParams = form.getFormParams().dataType === "number" ? { precision: Number(form.getFormParams().pattern) } : {};
|
||||
fields = {
|
||||
...fields, otherParams, conditionType: value === "string" ? "INPUT" : "INPUTNUMBER",
|
||||
hide: form.getFormParams().valueType !== "1"
|
||||
};
|
||||
} else if (key === "valueType" && (getKey(fields) === "formulaContent" || getKey(fields) === "defaultValue")) {
|
||||
fields = {
|
||||
...fields,
|
||||
label: getKey(fields) === "defaultValue" ? fields.label : form.getFormDatas().valueType.valueSpan,
|
||||
hide: (getKey(fields) === "formulaContent" && value === "1") || (getKey(fields) === "defaultValue" && value !== "1")
|
||||
};
|
||||
}
|
||||
return fields;
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
form.getFormParams().valueType === "1" &&
|
||||
form.updateFields({ formulaContent: { value: "" }, formulaId: { value: "" } });
|
||||
(form.getFormParams().valueType === "2" || form.getFormParams().valueType === "3") &&
|
||||
form.updateFields({ defaultValue: { value: "" } });
|
||||
});
|
||||
};
|
||||
renderForm = () => {
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
const { conditions } = this.state, { isFormInit } = form, formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && conditions.map(c => {
|
||||
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} onChange={this.handleChangeFormItem}/>
|
||||
{
|
||||
getKey(fields) === "formulaContent" && form.getFormParams().valueType !== "1" &&
|
||||
this.props.showOperateBtn &&
|
||||
<div className="formula_input_div" onClick={() => this.setState({ visible: true })}/>
|
||||
}
|
||||
{
|
||||
fields.tip && <WeaHelpfulTip
|
||||
style={{ marginLeft: 16 }} width={350} title={getLabel(fields.tipLanId, fields.tip)}
|
||||
placement="topLeft"/>
|
||||
}
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
});
|
||||
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { title, buttons } = this.props;
|
||||
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">{buttons}</div>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { request } = this.props;
|
||||
const { valueType, dataType, formulaId } = request;
|
||||
const { formalModalVisible, salaryItemName } = this.state;
|
||||
return (
|
||||
<div className="customSalaryItemSlide">
|
||||
<SalaryItemForm {...this.props} onChangeFieldsItem={this.handleChange} onShowFormal={this.handleShowFormal}/>
|
||||
{formalModalVisible &&
|
||||
<FormalFormModal
|
||||
name={salaryItemName}
|
||||
formulaId={formulaId}
|
||||
visible={formalModalVisible}
|
||||
valueType={valueType}
|
||||
dataType={dataType}
|
||||
onSaveFormal={data => {
|
||||
this.handleSaveFormal(data);
|
||||
}}
|
||||
onCancel={() =>
|
||||
this.setState({
|
||||
formalModalVisible: false,
|
||||
salaryItemName: ""
|
||||
})}
|
||||
/>}
|
||||
</div>
|
||||
const { onClose, salaryItemStore: { itemsForm: form } } = this.props;
|
||||
const { visible } = this.state;
|
||||
return (<WeaSlideModal
|
||||
className="custom_salaryItemSlide"{...this.props}
|
||||
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%"
|
||||
direction="right" title={this.renderTitle()} onClose={() => onClose()}
|
||||
content={<div className="form-dialog-layout">
|
||||
{this.renderForm()}
|
||||
{visible &&
|
||||
<FormalFormModal
|
||||
formulaId={form.getFormParams().formulaId}
|
||||
visible={visible}
|
||||
name={form.getFormParams().name}
|
||||
valueType={form.getFormParams().valueType}
|
||||
dataType={form.getFormParams().dataType}
|
||||
onSaveFormal={this.handleChange}
|
||||
onCancel={() => this.setState({ visible: false })}
|
||||
/>
|
||||
}
|
||||
</div>}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
|
||||
import { WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTop } from "ecCom";
|
||||
import { renderLoading, toDecimal_n } from "../../util";
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import { WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import * as API from "../../apis/item";
|
||||
import SalaryItemsTable from "./salaryItemsTable";
|
||||
import { toDecimal_n } from "../../util";
|
||||
import SystemSalaryItemModal from "./systemSalaryItemModal";
|
||||
import { columns } from "./columns";
|
||||
import SlideModalTitle from "../../components/slideModalTitle";
|
||||
import CustomSalaryItemSlide from "./customSalaryItemSlide";
|
||||
import CustomPaginationTable from "../../components/customPaginationTable";
|
||||
import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog";
|
||||
import "../socialSecurityBenefits/programme/index.less";
|
||||
import LogDialog from "../../components/logViewModal";
|
||||
import SalaryItemImportDialog from "./salaryItemImport";
|
||||
import * as API from "../../apis/item";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
@inject("salaryItemStore", "taxAgentStore", "salaryFileStore")
|
||||
|
|
@ -21,192 +19,83 @@ export default class SalaryItem extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value: "",
|
||||
selectedKey: "0",
|
||||
editable: false,
|
||||
isAdd: false,
|
||||
searchValue: "",
|
||||
formalModalVisible: false,
|
||||
searchParams: { current: 1, pageSize: 10, total: 0 },
|
||||
selectedRowKeys: [],
|
||||
syncSalarySetDialog: { visible: false, title: "", id: "" },
|
||||
name: "", isQuery: false, loading: false, sysVisible: false,
|
||||
customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗
|
||||
syncSalarySetDialog: { visible: false, id: "" }, // 同步到薪资账套弹窗
|
||||
logDialogVisible: false, filterConditions: "[]",
|
||||
salaryItemImpDialog: { visible: false, title: getLabel(24023, "数据导入") }
|
||||
};
|
||||
columns.map(item => {
|
||||
if (item.dataIndex == "refere") {
|
||||
item.render = () => {
|
||||
return (
|
||||
<Switch/>
|
||||
);
|
||||
};
|
||||
} else if (item.dataIndex == "cz") {
|
||||
item.render = () => {
|
||||
return (<div>
|
||||
<a style={{ marginRight: "10px" }}>编辑</a>
|
||||
<a style={{ marginRight: "10px" }}>删除</a>
|
||||
{/* <a>操作日志</a> */}
|
||||
</div>);
|
||||
};
|
||||
|
||||
}
|
||||
});
|
||||
this.record = {};
|
||||
}
|
||||
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
const { salaryItemStore: { getTableDatas }, salaryFileStore, taxAgentStore } = this.props;
|
||||
const { commonEnumList } = salaryFileStore;
|
||||
const { fetchTaxAgentOption } = taxAgentStore;
|
||||
fetchTaxAgentOption();
|
||||
commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" });
|
||||
getTableDatas({}).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
current: res.pageNum,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onEditItem = (record, isedit) => {
|
||||
this.record = record;
|
||||
const { salaryItemStore: { getItemForm, setEditSlideVisible } } = this.props;
|
||||
this.setState({
|
||||
editable: isedit, isAdd: false,
|
||||
syncSalarySetDialog: { ...this.state.syncSalarySetDialog, id: record.id }
|
||||
});
|
||||
getItemForm(record.id).then(() => {
|
||||
setEditSlideVisible(true);
|
||||
}).catch(({ errormsg }) => {
|
||||
message.error(errormsg || "");
|
||||
});
|
||||
};
|
||||
|
||||
// 删除列表项
|
||||
handleDeleteItem(record) {
|
||||
const { salaryItemStore: { deleteItemRequest, getTableDatas } } = this.props;
|
||||
handleDeleteItem = (recordId) => {
|
||||
const { selectedRowKeys, isQuery } = this.state;
|
||||
const params = recordId ? [recordId] : selectedRowKeys;
|
||||
if (_.isEmpty(params)) {
|
||||
message.warning(getLabel(111, "请勾选数据!"));
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除该条数据吗?",
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(111, "确认删除吗?"),
|
||||
onOk: () => {
|
||||
deleteItemRequest([record.id]).then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
API.deleteItem(params).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.setState({ isQuery: !isQuery });
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getColumns = () => {
|
||||
const { salaryItemStore, taxAgentStore: { showSalaryItemBtn, showOperateBtn } } = this.props;
|
||||
const { tableColumns } = salaryItemStore;
|
||||
let columns = tableColumns.map(column => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => { //前端元素转义
|
||||
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
|
||||
switch (newColumn.dataIndex) {
|
||||
case "name":
|
||||
return <a onClick={() => {
|
||||
this.onEditItem(record, false);
|
||||
}}>{text}</a>;
|
||||
case "useDefault":
|
||||
case "hideDefault":
|
||||
case "useInEmployeeSalary":
|
||||
return <Switch checked={text === 1} disabled/>;
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
});
|
||||
columns.push({
|
||||
key: "operate",
|
||||
title: "操作",
|
||||
width: 185,
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<a
|
||||
onClick={() => this.onEditItem(record, true)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"}</a>
|
||||
{
|
||||
(record.canDelete && (showSalaryItemBtn || showOperateBtn)) &&
|
||||
<a href="javascript:void(0)" style={{ marginLeft: 10 }}
|
||||
onClick={() => this.handleDeleteItem(record)}
|
||||
>{getLabel(535052, "删除")}</a>
|
||||
}
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")}</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0)" style={{ marginLeft: 10 }}><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
});
|
||||
return [
|
||||
// {
|
||||
// title: "序号",
|
||||
// dataIndex: "index",
|
||||
// align: "left",
|
||||
// width: 60,
|
||||
// render: (text, record, index) => {
|
||||
// const { current, pageSize } = this.state.searchParams;
|
||||
// return (current - 1) * pageSize + index + 1;
|
||||
// }
|
||||
// },
|
||||
...columns];
|
||||
};
|
||||
handleValidateForm = () => {
|
||||
return new Promise((resolve) => {
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
const { formulaId, valueType, sharedType, taxAgentIds } = form.getFormParams();
|
||||
let taxAgentValidate = true, formulaValidate = true;
|
||||
if (sharedType === "1" && !taxAgentIds) taxAgentValidate = false;
|
||||
if (valueType !== "1" && !formulaId) formulaValidate = false;
|
||||
resolve({ taxAgentValidate, formulaValidate });
|
||||
});
|
||||
};
|
||||
handleSalaryItem = (type) => {
|
||||
const { customItemDialog: { id }, isQuery } = this.state;
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
Promise.all([form.validateForm(), this.handleValidateForm()])
|
||||
.then(([f1, f2]) => {
|
||||
if (f1.isValid && f2.taxAgentValidate && f2.formulaValidate) {
|
||||
const { formulaContent, valueType, dataType, defaultValue, pattern, ...formData } = form.getFormParams();
|
||||
const key = valueType === "2" ? "originFormulaContent" : valueType === "3" ? "originSqlContent" : "formulaContent";
|
||||
this.setState({ loading: true });
|
||||
API.saveItem({
|
||||
...formData, valueType, dataType, pattern, [key]: formulaContent, id,
|
||||
defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue
|
||||
}).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
this.setState({ isQuery: !isQuery }, () => {
|
||||
message.success(getLabel(111, "操作成功"));
|
||||
type === "SAVECREATE" && form.updateFields({
|
||||
name: { value: "" }, formulaContent: { value: "" }, formulaId: { value: "" }
|
||||
});
|
||||
type !== "SAVECREATE" && this.setState({
|
||||
customItemDialog: { ...this.state.customItemDialog, visible: false, id: "" }
|
||||
});
|
||||
});
|
||||
|
||||
handleSearch(value) {
|
||||
const { salaryItemStore: { getTableDatas } } = this.props;
|
||||
getTableDatas({ ...this.state.searchParams, current: 1, name: value }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
current: 1,
|
||||
total: res.total
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
!f1.isValid && f1.showErrors();
|
||||
!f2.taxAgentValidate && f1.showError("taxAgentIds", getLabel(111, "\"可见性范围\"未填写"));
|
||||
!f2.formulaValidate && f1.showError("formulaContent", getLabel(111, `\"${form.getFormDatas().valueType.valueSpan}\"未填写`));
|
||||
this.forceUpdate();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
handlePageChange(value) {
|
||||
const { salaryItemStore: { getTableDatas } } = this.props;
|
||||
getTableDatas({ ...this.state.searchParams, name: this.state.searchValue, current: value }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
current: value,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
handleShowSizeChange(searchParams) {
|
||||
const { salaryItemStore: { getTableDatas } } = this.props;
|
||||
getTableDatas({ ...searchParams });
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
onDropMenuClick = (key, targetid = "") => {
|
||||
switch (key) {
|
||||
case "log":
|
||||
|
|
@ -228,206 +117,85 @@ export default class SalaryItem extends React.Component {
|
|||
}
|
||||
});
|
||||
break;
|
||||
case "customAdd":
|
||||
case "edit":
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const { loading } = this.state, showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const editTitle = !showOperateBtn ? getLabel(111, "查看自定义薪资项目") : getLabel(111, "修改自定义薪资项目");
|
||||
const title = key === "edit" ? editTitle : getLabel(111, "新建自定义薪资项目");
|
||||
const buttons = key === "edit" ? [
|
||||
<Button type="ghost" onClick={() => this.setState({
|
||||
syncSalarySetDialog: { visible: true, id: targetid }
|
||||
})}>{getLabel(111, "同步到薪资账套")}</Button>,
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.handleSalaryItem("SAVE")}>{getLabel(111, "保存")}</Button>
|
||||
] : [
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.handleSalaryItem("SAVE")}>{getLabel(111, "保存")}</Button>,
|
||||
<Button type="ghost" loading={loading}
|
||||
onClick={() => this.handleSalaryItem("SAVECREATE")}>{getLabel(111, "保存并继续创建")}</Button>
|
||||
];
|
||||
this.setState({
|
||||
customItemDialog: {
|
||||
visible: true, title, buttons: showOperateBtn ? buttons : [], id: targetid
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "delete":
|
||||
this.handleDeleteItem(targetid);
|
||||
break;
|
||||
case "sysAdd":
|
||||
this.setState({ sysVisible: true });
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const {
|
||||
salaryItemStore, salaryFileStore, taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption }
|
||||
} = this.props;
|
||||
const { userStatusList } = salaryFileStore;
|
||||
const { selectedRowKeys, logDialogVisible, filterConditions, salaryItemImpDialog } = this.state;
|
||||
const { loading, deleteItemRequest, getTableDatas } = salaryItemStore;
|
||||
const {
|
||||
tableDataSource,
|
||||
tableColumns,
|
||||
systemItemVisible,
|
||||
setSystemItemVisible,
|
||||
editSlideVisible,
|
||||
setEditSlideVisible,
|
||||
request
|
||||
} = salaryItemStore;
|
||||
if (this.getColumns().length === 2) { // 无权限处理
|
||||
return renderLoading();
|
||||
}
|
||||
|
||||
const handleMenuClick = (e) => {
|
||||
const { salaryItemStore: { setEditSlideVisible, initRequest } } = this.props;
|
||||
if (e.key === "1") {
|
||||
this.setState({ editable: true, isAdd: true });
|
||||
initRequest();
|
||||
setEditSlideVisible(true);
|
||||
} else if (e.key === "2") {
|
||||
setSystemItemVisible(true);
|
||||
}
|
||||
};
|
||||
|
||||
selectedRowKeys, logDialogVisible, filterConditions, name, isQuery, customItemDialog, sysVisible,
|
||||
salaryItemImpDialog
|
||||
} = this.state;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="2">{getLabel(111, "新增系统薪资项")}</Menu.Item>
|
||||
<Menu onClick={({ key }) => this.onDropMenuClick(key)}>
|
||||
<Menu.Item key="sysAdd">{getLabel(111, "新增系统薪资项")}</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
const buttons = [
|
||||
let buttons = [
|
||||
<Dropdown.Button overlay={menu} type="primary"
|
||||
onClick={() => handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>,
|
||||
<Button type="primary" onClick={() => {
|
||||
if (!selectedRowKeys.length) {
|
||||
message.info("未选中任何数据!");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确定要将所选的薪资项(共${selectedRowKeys.length}条数据)删除吗?`,
|
||||
onOk: () => {
|
||||
deleteItemRequest(selectedRowKeys).then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
this.setState({
|
||||
selectedRowKeys: [],
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}}>{getLabel(32136, "批量删除")}</Button>,
|
||||
<WeaInputSearch value={this.state.searchValue} placeholder={getLabel(111, "请输入名称")}
|
||||
onChange={value => this.setState({ searchValue: value })}
|
||||
onSearch={value => this.handleSearch(value)}/>
|
||||
onClick={() => this.onDropMenuClick("customAdd")}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>,
|
||||
<Button type="ghost" onClick={() => this.handleDeleteItem()}>{getLabel(32136, "批量删除")}</Button>,
|
||||
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })}
|
||||
placeholder={getLabel(111, "请输入名称")} onSearch={() => this.setState({ isQuery: !isQuery })}/>
|
||||
];
|
||||
// 新建和修改保存的回调
|
||||
const handleSlideSave = (continueFlag) => {
|
||||
const { salaryItemStore: { saveItem, request, getTableDatas } } = this.props;
|
||||
const payload = _.cloneDeep(request);
|
||||
const { name, sharedType, taxAgentIds } = request;
|
||||
if (!name || (sharedType === "1" && !taxAgentIds)) {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
content: "必要信息不完整,红色*为必填项!"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { pattern, defaultValue, dataType, ...extra } = payload;
|
||||
saveItem({
|
||||
...extra, pattern, dataType,
|
||||
defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue
|
||||
}, continueFlag)
|
||||
.then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const renderCustomOperate = () => {
|
||||
let arrList = [];
|
||||
if (this.state.isAdd) {
|
||||
arrList = [
|
||||
<Button type="primary" onClick={() => {
|
||||
handleSlideSave(false);
|
||||
}}>保存</Button>,
|
||||
<Button type="default" onClick={() => {
|
||||
handleSlideSave(true);
|
||||
}}>保存并继续创建</Button>
|
||||
];
|
||||
} else if (this.state.editable) {
|
||||
arrList = [
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({
|
||||
syncSalarySetDialog: {
|
||||
...this.state.syncSalarySetDialog,
|
||||
visible: true,
|
||||
title: getLabel(111, "请选择薪资账套")
|
||||
}
|
||||
})}
|
||||
>{getLabel(111, "同步到薪资账套")}</Button>,
|
||||
<Button type="primary" onClick={() => {
|
||||
handleSlideSave(true);
|
||||
}}>保存</Button>
|
||||
];
|
||||
}
|
||||
return arrList;
|
||||
};
|
||||
|
||||
const handleSaveSlideChange = (value) => {
|
||||
const { salaryItemStore: { setRequest } } = this.props;
|
||||
setRequest(value);
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
// getCheckboxProps: record => ({
|
||||
// disabled: !record.canDelete // Column configuration not to be checked
|
||||
// })
|
||||
};
|
||||
let dropMenuDatas = [
|
||||
{ key: "import", icon: <i className="icon-coms02-Template-import1"/>, content: getLabel(111, "导入") },
|
||||
{ key: "export", icon: <i className="iconfont icon-daochu"/>, content: getLabel(111, "导出") },
|
||||
{ key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>, content: getLabel(545781, "操作日志") }
|
||||
];
|
||||
!showOperateBtn && (buttons = buttons.slice(-1));
|
||||
!showOperateBtn && (dropMenuDatas = dropMenuDatas.slice(-1));
|
||||
return (
|
||||
<div className="mySalaryBenefitsWrapper">
|
||||
<WeaTop title="薪资项目管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={[
|
||||
{
|
||||
key: "import",
|
||||
icon: <i className="icon-coms02-Template-import1"/>,
|
||||
content: getLabel(111, "导入")
|
||||
},
|
||||
{
|
||||
key: "export",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(111, "导出")
|
||||
},
|
||||
{
|
||||
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(545781, "操作日志")
|
||||
}
|
||||
]} buttons={(showOperateBtn || showSalaryItemBtn) ? buttons : buttons.slice(-1)}>
|
||||
<div className="tableWrapper">
|
||||
<WeaNewScroll height="100%">
|
||||
<CustomPaginationTable
|
||||
rowKey={record => record.id}
|
||||
loading={loading}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={tableDataSource}
|
||||
columns={this.getColumns(tableColumns)}
|
||||
total={this.state.searchParams.total}
|
||||
current={this.state.searchParams.current}
|
||||
pageSize={this.state.searchParams.pageSize}
|
||||
onPageChange={(value) => {
|
||||
this.handlePageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
current,
|
||||
pageSize
|
||||
}
|
||||
}, () => {
|
||||
this.handleShowSizeChange({ name: this.state.searchValue, ...this.state.searchParams });
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
<React.Fragment>
|
||||
<WeaTop title={getLabel(111, "薪资项目管理")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={buttons} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}
|
||||
className="salaryProjectManagement">
|
||||
<div className="salaryItems_content">
|
||||
<SalaryItemsTable {...this.props} name={name} isQuery={isQuery} showOperateBtn={showOperateBtn}
|
||||
selectedRowKeys={selectedRowKeys} onDropMenuClick={this.onDropMenuClick}
|
||||
onChange={val => this.setState({ selectedRowKeys: val })}/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
{/*添加系统薪资项目*/}
|
||||
<SystemSalaryItemModal visible={sysVisible} onSearch={() => this.setState({ isQuery: !isQuery })}
|
||||
onCancel={(callback) => this.setState({ sysVisible: false }, () => callback && callback())}/>
|
||||
{/*同步薪资账套*/}
|
||||
<SyncToSalaryAccountSetDialog
|
||||
{...this.state.syncSalarySetDialog}
|
||||
onCancel={() => this.setState({
|
||||
syncSalarySetDialog: {
|
||||
...this.state.syncSalarySetDialog,
|
||||
visible: false, title: ""
|
||||
}
|
||||
})}
|
||||
/>
|
||||
onCancel={() => this.setState({ syncSalarySetDialog: { visible: false, id: "" } })}/>
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} logFunction="salaryitem" filterConditions={filterConditions}
|
||||
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
|
|
@ -436,61 +204,15 @@ export default class SalaryItem extends React.Component {
|
|||
onCancel={callback => {
|
||||
this.setState({
|
||||
salaryItemImpDialog: { ...salaryItemImpDialog, visible: false }
|
||||
}, () => callback && this.handleSearch(this.state.searchValue));
|
||||
}, () => callback && this.setState({ isQuery: !isQuery }));
|
||||
}}/>
|
||||
{
|
||||
systemItemVisible &&
|
||||
<SystemSalaryItemModal
|
||||
visible={systemItemVisible}
|
||||
onCancel={() => {
|
||||
setSystemItemVisible(false);
|
||||
}}
|
||||
onInitTableList={() => {
|
||||
getTableDatas({ ...this.state.searchParams, name: this.state.searchValue }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
editSlideVisible &&
|
||||
<WeaSlideModal
|
||||
className="slideOuterWrapper"
|
||||
visible={editSlideVisible}
|
||||
top={0}
|
||||
measureT="%"
|
||||
width={800}
|
||||
measureX="px"
|
||||
height={100}
|
||||
measureY="%"
|
||||
direction={"right"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
|
||||
editable={false}
|
||||
showOperateBtn={(showSalaryItemBtn || showOperateBtn)}
|
||||
customOperate={(showSalaryItemBtn || showOperateBtn) ? renderCustomOperate() : []}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<CustomSalaryItemSlide
|
||||
record={this.record} editable={this.state.editable}
|
||||
isAdd={this.state.isAdd} request={request}
|
||||
userStatusList={userStatusList}
|
||||
taxAgentAdminOption={taxAgentOption}
|
||||
onChange={(value) => {
|
||||
handleSaveSlideChange(value);
|
||||
}}/>
|
||||
}
|
||||
onClose={() => setEditSlideVisible(false)}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
{/*新增编辑自定义薪资项目*/}
|
||||
<CustomSalaryItemSlide {...customItemDialog} onSearch={() => this.setState({ isQuery: !isQuery })}
|
||||
showOperateBtn={showOperateBtn}
|
||||
onClose={callback => this.setState({
|
||||
customItemDialog: { ...customItemDialog, visible: false, id: "" }
|
||||
}, () => callback && callback())}/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,91 @@
|
|||
//薪资项目重构项
|
||||
.salaryProjectManagement {
|
||||
.wea-input-focus {
|
||||
height: 31.36px;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.salaryItems_content {
|
||||
height: 100%;
|
||||
padding: 8px 16px;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.custom_salaryItemSlide {
|
||||
.wea-slide-modal-title {
|
||||
border-bottom: 1px solid #e5e5e5 !important;
|
||||
}
|
||||
|
||||
.wea-slide-modal-content {
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
//display: block !important;
|
||||
|
||||
.formula_input_div {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.titleDialog {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 46px 0 16px;
|
||||
|
||||
.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;
|
||||
|
||||
button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.customSalaryItemSlide {
|
||||
padding: 16px;
|
||||
|
||||
|
|
@ -62,20 +150,20 @@
|
|||
|
||||
//系统薪资项添加modal
|
||||
.sys-salary-wrapper {
|
||||
.wea-dialog-body {
|
||||
height: 50vh;
|
||||
overflow: hidden auto;
|
||||
.sys-item-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.headerSearchWrapper {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding: 16px 20px;
|
||||
.sys-item-table-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #F6F6F6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.wea-tab {
|
||||
width: 100%;
|
||||
border-bottom: none;
|
||||
}
|
||||
.wea-new-table {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ export const roundingModeOptions = [
|
|||
showname: "见分进角"
|
||||
}
|
||||
];
|
||||
|
||||
export const patternOptions = [
|
||||
{
|
||||
key: "0",
|
||||
|
|
@ -83,7 +82,6 @@ export const patternOptions = [
|
|||
selected: false
|
||||
}
|
||||
];
|
||||
|
||||
export const dataTypeOptions = [
|
||||
{
|
||||
key: "number",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
* 薪资项目管理
|
||||
* 表格
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/16
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Dropdown, Menu, Spin } from "antd";
|
||||
import * as API from "../../apis/item";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class SalaryItemsTable extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, columns: [], dataSource: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getItemList(this.props);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.isQuery !== this.props.isQuery) this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current: 1 }
|
||||
}, () => this.getItemList(nextProps));
|
||||
}
|
||||
|
||||
getItemList = (props) => {
|
||||
const { name } = props;
|
||||
const { pageInfo } = this.state;
|
||||
const payload = { name, ...pageInfo };
|
||||
this.setState({ loading: true });
|
||||
API.getItemList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns: _.map(columns, o => {
|
||||
if (o.dataIndex === "useDefault" || o.dataIndex === "hideDefault" || o.dataIndex === "useInEmployeeSalary") {
|
||||
return { ...o, width: 80, render: text => <WeaCheckbox value={String(text)} disabled display="switch"/> };
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, columns, pageInfo, loading } = this.state;
|
||||
const { selectedRowKeys, onChange, onDropMenuClick, showOperateBtn } = this.props;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.getItemList(this.props));
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getItemList(this.props));
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys, onChange,
|
||||
getCheckboxProps: record => ({ disabled: !record.canDelete })
|
||||
};
|
||||
return (<Spin spinning={loading && pageInfo.total === 0}>
|
||||
<WeaTable rowKey="id" dataSource={dataSource} rowSelection={rowSelection} pagination={pagination}
|
||||
loading={loading} scroll={{ y: `calc(100vh - 180px)` }}
|
||||
columns={[
|
||||
...columns, {
|
||||
dataIndex: "opt", title: getLabel(111, "操作"), width: 140,
|
||||
render: (__, record) => (<React.Fragment>
|
||||
<a style={{ marginRight: 8 }} onClick={() => onDropMenuClick("edit", record.id)}
|
||||
href="javascript:void(0);">{showOperateBtn ? getLabel(111, "编辑") : getLabel(111, "查看")}</a>
|
||||
{
|
||||
showOperateBtn && record.canDelete &&
|
||||
<a style={{ marginRight: 8 }} href="javascript:void(0);"
|
||||
onClick={() => onDropMenuClick("delete", record.id)}>{getLabel(111, "删除")}</a>
|
||||
}
|
||||
<Dropdown overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")}</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment>)
|
||||
}
|
||||
]}/>
|
||||
</Spin>);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryItemsTable;
|
||||
|
|
@ -51,7 +51,6 @@ class SyncToSalaryAccountSetDialog extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
save = () => {
|
||||
const { salaryItemStore: { salarySetform }, id: salaryItemId } = this.props;
|
||||
salarySetform.validateForm().then(f => {
|
||||
|
|
@ -80,7 +79,7 @@ class SyncToSalaryAccountSetDialog extends Component {
|
|||
return (
|
||||
<WeaDialog
|
||||
{...this.props} className="salarySetDialog" initLoadCss
|
||||
style={{ width: 480 }}
|
||||
style={{ width: 480 }} title={getLabel(111, "请选择薪资账套")}
|
||||
buttons={[<Button type="primary" onClick={this.save}
|
||||
loading={this.state.loading}>{getLabel(537558, "确定")}</Button>]}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import React from "react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTab } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Button, message, Spin } from "antd";
|
||||
import { getSysItemList, saveSysItem } from "../../apis/item";
|
||||
import UnifiedTable from "../../components/UnifiedTable";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -10,20 +9,16 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
name: "",
|
||||
loading: false,
|
||||
saveLoading: false,
|
||||
selectedRowKeys: [],
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
dataSource: [], columns: [], name: "", loading: false, saveLoading: false,
|
||||
selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getSysItemList();
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getSysItemList();
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
|
||||
selectedRowKeys: [], name: ""
|
||||
});
|
||||
}
|
||||
|
||||
getSysItemList = () => {
|
||||
|
|
@ -33,41 +28,33 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
columns: _.map(columns, item => {
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}>{text}</span>;
|
||||
}
|
||||
};
|
||||
}),
|
||||
dataSource,
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
this.setState({ columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } });
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleAdd = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.info(getLabel(111, "未选择任何条目"));
|
||||
return;
|
||||
}
|
||||
this.setState({ saveLoading: true });
|
||||
saveSysItem(selectedRowKeys).then(({ status, errormsg }) => {
|
||||
this.setState({ saveLoading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "添加成功"));
|
||||
this.setState({ selectedRowKeys: [] }, () => {
|
||||
this.props.onInitTableList();
|
||||
this.props.onCancel();
|
||||
});
|
||||
this.setState({ selectedRowKeys: [] }, () => this.props.onCancel(this.props.onSearch()));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ saveLoading: false }));
|
||||
};
|
||||
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, "请输入薪资项目名称")} a onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.getSysItemList())}/>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { selectedRowKeys, pageInfo, loading, columns, dataSource, saveLoading } = this.state;
|
||||
|
|
@ -95,33 +82,20 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
title="添加系统薪资项目"
|
||||
initLoadCss className="sys-salary-wrapper"
|
||||
visible={this.props.visible} onCancel={() => {
|
||||
this.setState({ selectedRowKeys: [] }, () => {
|
||||
this.props.onCancel();
|
||||
});
|
||||
}} style={{ width: "60vw" }} scalable
|
||||
buttons={[
|
||||
<Button type="primary" loading={saveLoading} onClick={this.handleAdd}>添加</Button>
|
||||
]}
|
||||
>
|
||||
<div className="headerSearchWrapper">
|
||||
<WeaTab datas={[]} keyParam="viewcondition" //主键
|
||||
searchType={["base"]} onSearchChange={name => this.setState({ name })}
|
||||
onSearch={this.getSysItemList}
|
||||
/>
|
||||
<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.sysItemRef = dom}
|
||||
style={{
|
||||
width: "60vw", height: 600, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}} title={this.renderTitle()}
|
||||
buttons={[<Button type="primary" loading={saveLoading} disabled={_.isEmpty(selectedRowKeys)}
|
||||
onClick={this.handleAdd}>{getLabel(111, "添加")}</Button>]}>
|
||||
<div className="sys-item-table-box">
|
||||
<Spin spinning={loading && pageInfo.total === 0}>
|
||||
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} rowSelection={rowSelection}
|
||||
loading={loading} scroll={{ y: this.importRef ? this.sysItemRef.state.height - 16 : 600 }}
|
||||
rowKey="id"/>
|
||||
</Spin>
|
||||
</div>
|
||||
<UnifiedTable
|
||||
loading={loading}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
rowSelection={rowSelection}
|
||||
xWidth={columns.length * 120}
|
||||
/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
* Date: 2024/1/23
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { getIframeParentHeight } from "../../../../util";
|
||||
|
|
@ -14,8 +13,6 @@ import { convertToUrlString } from "../../../../util/url";
|
|||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class WelfareRecordList extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -126,7 +123,7 @@ class WelfareRecordList extends Component {
|
|||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getWelfareRecordList = () => {
|
||||
const { queryForm, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { queryForm } = this.props;
|
||||
const { pageInfo } = this.state;
|
||||
const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] };
|
||||
this.setState({ loading: true });
|
||||
|
|
@ -139,8 +136,7 @@ class WelfareRecordList extends Component {
|
|||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource, columns
|
||||
}, () => this.postMessageToChild({
|
||||
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, showOperateBtn,
|
||||
unitTableType: "welfareRecord"
|
||||
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, unitTableType: "welfareRecord"
|
||||
}));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import React, { Component } from "react";
|
|||
import { inject, observer } from "mobx-react";
|
||||
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import * as API from "../../../../apis/standingBook";
|
||||
import { welfareRQConditions } from "../columns";
|
||||
import { postFetch } from "../../../../util/request";
|
||||
import { MonthRangePicker } from "../../../reportView/components/statisticalMicroSettingsSlide";
|
||||
import moment from "moment";
|
||||
|
||||
|
|
@ -31,27 +31,28 @@ class WelfareRecordQuery extends Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
API.getAdminTaxAgentList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(welfareRQConditions, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgents") {
|
||||
return { ...o, options: _.map(data, g => ({ key: g.id.toString(), showname: g.name })) };
|
||||
}
|
||||
return o;
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
const { standingBookStore: { welfareRQForm }, onPutAccountOptions } = this.props;
|
||||
welfareRQForm.initFormFields(this.state.conditions);
|
||||
onPutAccountOptions(_.map(data, g => ({ key: g.id.toString(), showname: g.name })));
|
||||
});
|
||||
}
|
||||
});
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(welfareRQConditions, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgents") {
|
||||
return { ...o, options: _.map(data, g => ({ key: String(g.id), showname: g.name })) };
|
||||
}
|
||||
return o;
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
const { standingBookStore: { welfareRQForm }, onPutAccountOptions } = this.props;
|
||||
welfareRQForm.initFormFields(this.state.conditions);
|
||||
onPutAccountOptions(_.map(data, g => ({ key: g.id.toString(), showname: g.name })));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
renderForm = (form, conditions) => {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export default class StandingBook extends React.Component {
|
|||
value: "",
|
||||
selectedKey: "0",
|
||||
tableParams: {
|
||||
startTime: moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
|
||||
startTime: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
|
||||
endTime: moment(new Date()).endOf("year").format("YYYY-MM"),
|
||||
paymentOrganization: ""
|
||||
},
|
||||
|
|
@ -68,49 +68,45 @@ export default class StandingBook extends React.Component {
|
|||
init = () => {
|
||||
const { current, dialogProps } = this.state;
|
||||
const {
|
||||
taxAgentStore: { getPermission, fetchTaxAgentOption },
|
||||
taxAgentStore: { PageAndOptAuth, fetchTaxAgentOption },
|
||||
standingBookStore: { getAdminTaxAgentList }
|
||||
} = this.props;
|
||||
getPermission().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({ adminData: data });
|
||||
if (data.isOpenDevolution) {
|
||||
getAdminTaxAgentList().then((data) => {
|
||||
let taxAgentList = data.map(item => {
|
||||
let result = {};
|
||||
result.showname = item.name;
|
||||
result.key = item.id + "";
|
||||
result.selected = false;
|
||||
return result;
|
||||
});
|
||||
this.setState({
|
||||
dialogProps: {
|
||||
...dialogProps,
|
||||
options: taxAgentList,
|
||||
isAdmin: true
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
fetchTaxAgentOption().then(({ data }) => {
|
||||
let taxAgentList = data.map(item => {
|
||||
let result = {};
|
||||
result.showname = item.content;
|
||||
result.key = item.id + "";
|
||||
result.selected = false;
|
||||
return result;
|
||||
});
|
||||
this.setState({
|
||||
dialogProps: {
|
||||
...dialogProps,
|
||||
options: taxAgentList
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
this.getCommonList({ ...this.state.tableParams, current });
|
||||
}
|
||||
});
|
||||
this.setState({ adminData: PageAndOptAuth });
|
||||
if (data.isOpenDevolution) {
|
||||
getAdminTaxAgentList().then((data) => {
|
||||
let taxAgentList = data.map(item => {
|
||||
let result = {};
|
||||
result.showname = item.name;
|
||||
result.key = item.id + "";
|
||||
result.selected = false;
|
||||
return result;
|
||||
});
|
||||
this.setState({
|
||||
dialogProps: {
|
||||
...dialogProps,
|
||||
options: taxAgentList,
|
||||
isAdmin: true
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
fetchTaxAgentOption().then(({ data }) => {
|
||||
let taxAgentList = data.map(item => {
|
||||
let result = {};
|
||||
result.showname = item.content;
|
||||
result.key = item.id + "";
|
||||
result.selected = false;
|
||||
return result;
|
||||
});
|
||||
this.setState({
|
||||
dialogProps: {
|
||||
...dialogProps,
|
||||
options: taxAgentList
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
this.getCommonList({ ...this.state.tableParams, current });
|
||||
};
|
||||
|
||||
getCommonList = (payload = {}) => {
|
||||
|
|
|
|||
|
|
@ -119,7 +119,8 @@ class StandingBook extends Component {
|
|||
|
||||
render() {
|
||||
const { accountDialog, queryForm, logDialogVisible, filterConditions } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const rightBtns = [<Button type="primary" onClick={() => this.setState({
|
||||
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
|
||||
})}>{getLabel(538780, "核算")}</Button>];
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import React, { Component } from "react";
|
|||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
|
||||
import * as API from "../../../../../apis/welfareArchive";
|
||||
import { getTaxAgentSelectList } from "../../../../../apis/taxAgent";
|
||||
import { sysinfo } from "../../../../../apis/ruleconfig";
|
||||
import { getWelfareSearchsForm, welfareConditions } from "../../config";
|
||||
import { getConditionDomkeys, toDecimal_n } from "../../../../../util";
|
||||
import { postFetch } from "../../../../../util/request";
|
||||
import { Button, message, Modal } from "antd";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
|
|
@ -39,7 +39,9 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
getBaseForm = async (props) => {
|
||||
const [taxAgentListData, sysInfoData] = await Promise.all([getTaxAgentSelectList(), sysinfo()]);
|
||||
const [taxAgentListData, sysInfoData] = await Promise.all([
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }), sysinfo()
|
||||
]);
|
||||
const {
|
||||
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses,
|
||||
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData,
|
||||
|
|
@ -97,7 +99,7 @@ class Index extends Component {
|
|||
items: _.map(o.items, g => {
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label),
|
||||
options: _.map(taxAgentListData.data, j => ({ key: j.id, showname: j.content }))
|
||||
options: _.map(taxAgentListData.data, j => ({ key: String(j.id), showname: j.name }))
|
||||
};
|
||||
})
|
||||
};
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ class Index extends Component {
|
|||
if (type === "init") {
|
||||
this.getWelfareList(this.props, true);
|
||||
} else if (type === "turn") {
|
||||
const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params;
|
||||
const { runStatuses, showOperateBtn } = this.props;
|
||||
const { record: { baseInfoId, opts, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params;
|
||||
const { runStatuses } = this.props;
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({
|
||||
|
|
@ -114,6 +114,7 @@ class Index extends Component {
|
|||
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"], schemeId: fundSchemeId }),
|
||||
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["other"], schemeId: otherSchemeId })
|
||||
]);
|
||||
const showOperateBtn = opts.includes("admin");
|
||||
this.setState({
|
||||
welfareEditSlide: {
|
||||
...this.state.welfareEditSlide, visible: true, showOperateBtn,
|
||||
|
|
@ -128,18 +129,18 @@ class Index extends Component {
|
|||
case "DEL-TO-DO":
|
||||
case "DEL-TO-DO-STAY":
|
||||
const module = (id === "ADD-TO-PAY" || id === "STAY-DEL-TO-STOP" || id === "CANCEL-STOP") ?
|
||||
[baseInfo] : { ids: [baseInfo], ...interfaceParams };
|
||||
[baseInfoId] : { ids: [baseInfoId], ...interfaceParams };
|
||||
this.handleWelfareOpts(_.camelCase(id), module);
|
||||
break;
|
||||
case "DEL-ARCHIVE":
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(388758, "确认要删除吗?"),
|
||||
onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfo])
|
||||
onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfoId])
|
||||
});
|
||||
break;
|
||||
case "log":
|
||||
this.props.onFilterLog(id, baseInfo);
|
||||
this.props.onFilterLog(id, baseInfoId);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -156,7 +157,7 @@ class Index extends Component {
|
|||
};
|
||||
getWelfareList = (props, init = false) => {
|
||||
const { pageInfo } = this.state;
|
||||
const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props;
|
||||
const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount } = props;
|
||||
const params = { ...pageInfo, ...welfareForm.getFormParams() };
|
||||
const payload = runStatuses === "ext" ? { ...params, extWelArchiveList: true } : {
|
||||
...params,
|
||||
|
|
@ -183,10 +184,7 @@ class Index extends Component {
|
|||
}, () => {
|
||||
const { pageInfo, selectedRowKeys, columns, dataSource } = this.state;
|
||||
onChangeTopTabCount(runStatuses, total, init);
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys, runStatuses,
|
||||
columns, showOperateBtn
|
||||
});
|
||||
this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, runStatuses, columns });
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
|
|
|
|||
|
|
@ -151,7 +151,8 @@ class Index extends Component {
|
|||
selectedKey, topTabCount, showSearchAd, isQuery, recordDialogVisible,
|
||||
logDialogVisible, filterConditions, welfareImpDialog, showExtEmpsWitch
|
||||
} = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const tipList = _.find(welfareTipList, o => o.viewcondition === selectedKey).list;
|
||||
const tabs = _.map(tabList, o => ({ ...o, title: getLabel(o.lanId, o.title) }));
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* 方案信息确认
|
||||
* 保存并自动修改基数,仅保存方案设置
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/19
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTransfer } from "ecCom";
|
||||
import { Alert, Button } from "antd";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const WeaTransferList = WeaTransfer.list;
|
||||
|
||||
class BaseValidateDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { dataSource: [] };
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.setState({
|
||||
dataSource: _.filter(_.map(nextProps.baseChangeInfo.split("\n"), (g, gi) => ({
|
||||
id: gi + 1, name: g
|
||||
})), k => !!k.name)
|
||||
});
|
||||
}
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
|
||||
dataSource: []
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { dataSource } = this.state, { onCancel } = this.props;
|
||||
const scrollHeight = this.baseChangeRef ? this.baseChangeRef.state.height - 118 : 606.6;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={() => onCancel({
|
||||
validate: false, changeData: true
|
||||
})}>{getLabel(111, "保存并自动修改基数")}</Button>,
|
||||
<Button type="ghost" onClick={() => onCancel({
|
||||
validate: false, changeData: false
|
||||
})}>{getLabel(111, "仅保存方案设置")}</Button>
|
||||
];
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} hasScroll className="baseChangeDialog" initLoadCss ref={dom => this.baseChangeRef = dom}
|
||||
title={getLabel(131329, "信息确认")} buttons={buttons}
|
||||
style={{
|
||||
width: 750, height: 606.6, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}
|
||||
>
|
||||
<div className="baseChangeContent">
|
||||
<Alert
|
||||
message={getLabel(111, "是否需要将社保档案中不满足上下限的基数值,自动设置为对应的上限或下限值?")}
|
||||
description={getLabel(111, "以下员工的社保福利档案基数大于上限值,或小于下限值:")}
|
||||
type="warning"/>
|
||||
{
|
||||
!_.isEmpty(dataSource) ? <WeaTransferList
|
||||
data={dataSource} renderItem={(it) => (<div className="detailBox">
|
||||
<div className="order">{it.id}</div>
|
||||
<div className="content" title={it.name}>{it.name}</div>
|
||||
</div>)}
|
||||
height={scrollHeight} checkedCb={() => ({})} checkedKeys={[]}
|
||||
/> : <div className="empty">{getLabel(111, "无数据变更记录")}</div>
|
||||
}
|
||||
</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default BaseValidateDialog;
|
||||
|
|
@ -10,8 +10,9 @@ import { WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTab, WeaTools } fr
|
|||
import PlanSetTable from "./planSetTable";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import * as API from "../../../../../apis/welfareScheme";
|
||||
import { getTaxAgentSelectListAsAdmin } from "../../../../../apis/taxAgent";
|
||||
import { postFetch } from "../../../../../util/request";
|
||||
import { getConditionDomkeys, getSearchs } from "../../../../../util";
|
||||
import BaseValidateDialog from "./baseValidateDialog";
|
||||
import { planConditons } from "../../config";
|
||||
import cs from "classnames";
|
||||
|
||||
|
|
@ -24,7 +25,10 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, conditions: [], selectedKey: "2", planDatas: []
|
||||
loading: false, conditions: [], selectedKey: "2", planDatas: [],
|
||||
baseValidateDialog: {
|
||||
visible: false, baseChangeInfo: [], validatePayload: { validate: true, changeData: false }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +44,7 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
getForm = async (props) => {
|
||||
const { data: result } = await getTaxAgentSelectListAsAdmin();
|
||||
const { data: result } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
|
||||
const { id, welfareTypeEnum, programmeStore: { planForm }, showOperateBtn } = props;
|
||||
API.getForm(id ? _.assign({ welfareTypeEnum }, { id }) : { welfareTypeEnum }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
|
|
@ -54,7 +58,7 @@ class Index extends Component {
|
|||
return {
|
||||
...o, hide: schemeBatch["sharedType"] === "0" || _.isNil(schemeBatch["sharedType"]),
|
||||
viewAttr: (schemeBatch["sharedType"] === "1" && showOperateBtn) ? 3 : showOperateBtn ? o.viewAttr : 1,
|
||||
options: _.map(result, k => ({ key: k.id, showname: k.content })),
|
||||
options: _.map(result, k => ({ key: String(k.id), showname: k.name })),
|
||||
label: getLabel(o.lanId, o.label)
|
||||
};
|
||||
} else if (getKey(o) === "paymentType" || getKey(o) === "sharedType") {
|
||||
|
|
@ -86,21 +90,37 @@ class Index extends Component {
|
|||
if (planForm.getFormParams().sharedType === "1" && _.isEmpty(planForm.getFormParams().taxAgentIds)) {
|
||||
planForm.showError("taxAgentIds", getLabel(111, "\"可见范围\"未填写"));
|
||||
} else {
|
||||
const { planDatas } = this.state;
|
||||
const payload = {
|
||||
const { planDatas, baseValidateDialog } = this.state;
|
||||
const { validatePayload } = baseValidateDialog;
|
||||
let payload = {
|
||||
insuranceScheme: {
|
||||
...planForm.getFormParams(), welfareType: welfareTypeEnum, id,
|
||||
paymentArea: planForm.getFormParams().paymentType
|
||||
},
|
||||
insuranceSchemeDetailList: planDatas
|
||||
};
|
||||
id && (payload = { ...payload, ...validatePayload });
|
||||
this.setState({ loading: true });
|
||||
API[id ? "updateScheme" : "createScheme"](payload).then(({ status, errormsg }) => {
|
||||
API[id ? "updateScheme" : "createScheme"](payload).then(({ status, data, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
setHasBeenModify(false);
|
||||
this.props.onClose(true);
|
||||
if (id && Object.prototype.toString.call(data) === "[object String]" && data.indexOf("\n") !== -1) {
|
||||
this.setState({
|
||||
baseValidateDialog: {
|
||||
visible: true, baseChangeInfo: data,
|
||||
validatePayload: { ...baseValidateDialog.validatePayload, validate: false }
|
||||
}
|
||||
});
|
||||
} else {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
setHasBeenModify(false);
|
||||
this.props.onClose(true);
|
||||
this.setState({
|
||||
baseValidateDialog: {
|
||||
...baseValidateDialog, baseChangeInfo: [], validatePayload: { validate: true, changeData: false }
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
|
|
@ -194,7 +214,7 @@ class Index extends Component {
|
|||
|
||||
|
||||
render() {
|
||||
const { conditions, planDatas, selectedKey } = this.state;
|
||||
const { conditions, planDatas, selectedKey, baseValidateDialog } = this.state;
|
||||
const { programmeStore: { planForm }, showOperateBtn } = this.props;
|
||||
return (
|
||||
<WeaSlideModal
|
||||
|
|
@ -207,6 +227,14 @@ class Index extends Component {
|
|||
<PlanSetTable dataSource={planDatas} selectedKey={selectedKey} showOperateBtn={showOperateBtn}
|
||||
onPlanSet={this.handleSetPlanDatas}/>
|
||||
</WeaSearchGroup>
|
||||
{/* */}
|
||||
<BaseValidateDialog {...baseValidateDialog}
|
||||
onCancel={(validatePayload = {}) => this.setState({
|
||||
baseValidateDialog: {
|
||||
visible: false, baseChangeInfo: [],
|
||||
validatePayload: { validate: true, changeData: false, ...validatePayload }
|
||||
}
|
||||
}, () => !_.isEmpty(validatePayload) && this.save())}/>
|
||||
</div>}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -60,8 +60,9 @@ class Index extends Component {
|
|||
getList = (props) => {
|
||||
const {
|
||||
programmeStore: { planSearchForm }, selectedKey: welfareTypeEnum, customQuery,
|
||||
taxAgentStore: { showOperateBtn }
|
||||
taxAgentStore: { PageAndOptAuth }
|
||||
} = props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const { pageInfo } = this.state;
|
||||
const originPayload = { ...pageInfo, welfareTypeEnum }, customPayload = { welfareTypeEnum: customQuery },
|
||||
welfarePayload = { ...planSearchForm.getFormParams() };
|
||||
|
|
@ -239,7 +240,8 @@ class Index extends Component {
|
|||
|
||||
render() {
|
||||
const { dataSource, columns, pageInfo, loading, copyDialog, customDialog, welfarePlanEditSlide } = this.state;
|
||||
const { selectedKey, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { selectedKey, taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import WelfarePlanList from "./components/welfarePlanList";
|
|||
import LogDialog from "../../../components/logViewModal";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
import { tabList } from "../welfareArchive/config";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -63,7 +62,8 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const { logDialogVisible, filterConditions, selectedKey, showSearchAd, isQuery, customQuery } = this.state;
|
||||
const tabs = _.map(tabWelfarePlanList, o => ({ ...o, title: getLabel(o.lanId, o.title) }));
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -269,3 +269,91 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//方案基数变化
|
||||
.baseChangeDialog {
|
||||
.wea-dialog-body {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.baseChangeContent {
|
||||
background: #F6F6F6;
|
||||
padding: 16px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #ffff;
|
||||
}
|
||||
|
||||
.wea-search-group {
|
||||
padding: 0;
|
||||
margin-bottom: 10px;
|
||||
background: #FFF;
|
||||
|
||||
.wea-form-cell {
|
||||
padding: 0;
|
||||
|
||||
.wea-form-item {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.logTable {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.wea-transfer-list-wrapper {
|
||||
border: none;
|
||||
|
||||
.ant-tree-switcher {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.transfer-tree {
|
||||
background: #FFF;
|
||||
border: 1px solid #dadada;
|
||||
padding: 0;
|
||||
|
||||
& > li:not(:last-child) {
|
||||
.detailBox .content {
|
||||
border-bottom: 1px solid #dadada;
|
||||
}
|
||||
}
|
||||
|
||||
& > li {
|
||||
margin: 0 !important;
|
||||
|
||||
.detailBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.order {
|
||||
width: 35px;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
min-height: 40px;
|
||||
line-height: 40px;
|
||||
color: #000;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue