Merge branch 'feature/2.15.2.2411.01业务线-数据推送' into release/3.0.0.2502.01

This commit is contained in:
lys 2025-02-17 09:56:08 +08:00
commit 824f4a9e86
115 changed files with 5966 additions and 910 deletions

View File

@ -0,0 +1,26 @@
import { WeaTools } from "ecCom";
import { postFetch } from "../util/request";
// 推送配置列表
export const getPushSettingList = (params) => {
return postFetch("/api/bs/hrmsalary/push/setting/list", params);
};
// 保存推送配置
export const savePushSetting = (params) => {
return postFetch("/api/bs/hrmsalary/push/setting/save", params);
};
// 删除推送配置
export const deletePushSetting = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/push/setting/delete", "GET", params);
};
// 推送配置明细列表
export const getPushItemList = (params) => {
return postFetch("/api/bs/hrmsalary/push/item/list", params);
};
// 保存推送配置明细
export const savePushItemList = (params) => {
return postFetch("/api/bs/hrmsalary/push/item/save", params);
};
// 删除推送配置明细
export const deletePushItemList = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/push/item/delete", "GET", params);
};

View File

@ -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);
};
//获取个税扣缴义务人表单
@ -102,3 +102,73 @@ export const getTaxAgentSelectListAsAdmin = (params) => {
export const hasIconInTax = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/sys/conf/code?code=hideIconInTax", "GET", params);
};
/**权限-角色相关*/
//同步业务线
export const syncAuth = (params) => {
return postFetch("/api/bs/hrmsalary/auth/sync", 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);
};
//成员明细列表
export const authMemberDetail = (params) => {
return postFetch("/api/bs/hrmsalary/auth/member/detail", params);
};
//数据明细列表
export const authDataDetail = (params) => {
return postFetch("/api/bs/hrmsalary/auth/data/detail", params);
};

View File

@ -33,18 +33,17 @@ class AssociativeSearchMult extends Component {
}
}
handleSearch = (value) => {
this.setState({ loading: true });
this.getData(value);
};
handleSearch = (value) => this.getData(value);
getData = (name = "") => {
const { browserConditionParam } = this.props;
const { browserConditionParam, tags } = this.props;
if (tags) return;
const {
completeURL, filterByName, searchParamsKey, convertDatasource, dataParams = {}
} = browserConditionParam;
if (_.trim(name)) {
let payload = { ...dataParams };
searchParamsKey && (payload = { ...payload, [searchParamsKey]: name, current: 1, pageSize: 9999 });
this.setState({ loading: true });
postFetch(completeURL, payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status && data.list) {
@ -105,7 +104,7 @@ class AssociativeSearchMult extends Component {
render() {
const { data, dropdownWidth } = this.state;
const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {} } = this.props;
const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {}, tags } = this.props;
const clsname = classNames({
"required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues),
"mr12": viewAttr === "3" && _.isEmpty(selectedValues),
@ -127,7 +126,7 @@ class AssociativeSearchMult extends Component {
);
}
let options = data.map(d => <Option key={d.id} title={d.name}>{d.name}</Option>);
selectedValues && selectedValues.map((v) => {
!tags && selectedValues && selectedValues.map((v) => {
v && options.unshift(<Option key={v} title={datas[v].name}>{datas[v].name}</Option>);
});
const select = <Select

View File

@ -62,6 +62,8 @@ class CustomBrowserDialog extends Component {
listDatas: convertDatasource ? convertDatasource(data.list) : data.list,
pageInfo: { ...pageInfo, current, pageSize, total }
});
} else if (status && data.modeList) {
this.setState({ listDatas: _.map(data.modeList, o => ({ ...o, id: o.name })) });
} else {
this.setState({ listDatas: _.map(data, o => ({ ...o, id: String(o.id) })) });
}

View File

@ -97,17 +97,11 @@ class Index extends Component {
}, () => {
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(",") }
});
}
if (form) form.updateFields({ [getKey(fieldConfig)]: { value: this.state.searchKeys.join(",") } });
});
};
onBrowerClick = (keys, selectedObj) => {
if (_.isEmpty(keys)) {
this.setState({ searchKeys: [], selectedData: {}, rightDatas: [] });
}
if (_.isEmpty(keys)) this.setState({ searchKeys: [], selectedData: {}, rightDatas: [] });
this.setState({ browserDialog: { visible: true } });
};

View File

@ -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%" };

View File

@ -7,7 +7,7 @@ class Index extends Component {
render() {
return (
<WeaReqTop
title={getLabel(111, "编辑账套")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
title={this.props.title || getLabel(111, "编辑账套")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
showDropIcon={false} tabDatas={this.props.tabDatas} {...this.props}
/>
);

View File

@ -6,7 +6,7 @@ const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
render() {
return (
<WeaTop title={getLabel(111, "新建账套")} icon={<i className="icon-coms-fa"/>}
<WeaTop title={this.props.title || getLabel(111, "新建账套")} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" {...this.props}/>
);
}

View File

@ -1,111 +0,0 @@
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button } from "antd";
import { WeaLogView } from "comsMobx";
import { WeaLocaleProvider, WeaNewScroll, WeaTop } from "ecCom";
import { getSearchs, renderLoading, renderNoright } from "../util"; // 从util文件引入公共的方法
const getLabel = WeaLocaleProvider.getLabel;
const WeaLogViewComp = WeaLogView.Component;
@inject("baseFormStore")
@observer
export default class BaseForm extends React.Component {
componentWillMount() { // 初始化渲染页面
const { baseFormStore: { doInit } } = this.props;
doInit();
}
componentWillReceiveProps(nextProps) {
const { baseFormStore: { doInit } } = this.props;
if (this.props.location.key !== nextProps.location.key) { // 手动刷新、切换菜单 重新初始化
doInit();
}
}
// 渲染右键菜单和顶部下拉菜单
getRightMenu() {
const { baseFormStore: { setLogVisible, saveForm } } = this.props;
let btnArr = [
{
key: "BTN_SAVE",
icon: <i className="icon-coms-Preservation"/>,
content: `${getLabel(86, "保存")}`,
onClick: () => saveForm()
},
{
key: "log",
content: getLabel(83, "日志"),
icon: <i className="icon-coms-Print-log"/>,
onClick: () => setLogVisible(true)
}];
return btnArr;
}
render() {
/*
1判断是否无权限 是显示无权限页面
2渲染form页面:
2-1: WeaRightMenu 右键菜单
2-2: WeaTop: 顶部: 包括下拉菜单
2-3: renderLoading: 加载数据中的loading效果(统一封装在util中)
2-4: WeaNewScroll 顶部以下超长滚动处理
2-5: 通过getSearchs方法渲染form
*/
const { baseFormStore } = this.props;
const {
loading,
hasRight,
form,
condition,
logVisible,
logStore,
saveLoading,
setLogVisible,
saveForm
} = baseFormStore; // 从后台取数据 和 方法
if (!hasRight && !loading) { // 无权限处理
return renderNoright();
}
const btns = [ // 顶部按钮
<Button type="primary" loading={saveLoading} onClick={() => saveForm()}>保存</Button>
];
const collectParams = { // 收藏功能配置
favname: "基础表单",
favouritetype: 1,
objid: 0,
link: "wui/index.html#/ns_demo01/index",
importantlevel: 1
};
return (
<WeaTop
title="基础表单" // title
icon={<i className="icon-coms-fa"/>} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
buttons={btns} // 顶部按钮: 这里是保存按钮,不需要可以不显示
buttonSpace={10} // 按钮之间的间隔
showDropIcon={true} // 是否显示右侧下拉按钮
dropMenuDatas={this.getRightMenu()} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
>
{loading ? renderLoading() :
<WeaNewScroll height="100%">
{getSearchs(form, toJS(condition), 1)}
</WeaNewScroll>
}
<WeaLogViewComp // 日志功能(一般后端的应用设置是需要的)
visible={logVisible} // 日志弹框的显示隐藏
onCancel={() => setLogVisible(false)} // 关闭日志弹框时的操作设置logVisible属性为false
logStore={logStore} // 日志的store
logType="1" // 模块编码: 该参数要根据模块来给
logSmallType="1" // 细分模块编码: 该参数要根据模块来给
/>
</WeaTop>
);
}
}

View File

@ -0,0 +1,24 @@
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"], //报表
"dataPush": ["/hrmSalary/datapush"], //数据推送
"adjustRecord": ["/hrmSalary/adjustSalaryManage"] //调薪管理
};

View File

@ -28,7 +28,7 @@ import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail";
// import Declare from "./pages/declare";
import Declare from "./pages/declare/declare"; //重构的个税申报表
import TaxRate from "./pages/taxRate";
import TaxAgent from "./pages/taxAgent";
import TaxAgent from "./pages/salary/taxAgent";
import CalculateDetail from "./pages/calculateDetail";
import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail";
import CompareDetail from "./pages/calculateDetail/compareDetail";
@ -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";
@ -53,6 +54,7 @@ import AdjustSalaryManage from "./pages/adjustSalaryManage";
import TopologyMap from "./pages/topologyMap";
import SupplementaryCalc from "./pages/supplementaryCalc";
import VariableSalary from "./pages/variableSalary";
import Datapush from "./pages/datapush";
import Layout from "./layout";
import stores from "./stores";
import "./style/index";
@ -64,6 +66,7 @@ getLocaleLabel = function (nextState, replace, callback) {
};
const SocialSecurityBenefits = (props) => props.children;
const DataAcquisition = (props) => props.children;
const Routes = (
<Route key="hrmSalary" path="hrmSalary" onEnter={getLocaleLabel} component={Layout}>
<Route key="historicalPayroll" path="historicalPayroll" component={HistoricalPayroll}/>
@ -110,9 +113,11 @@ 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}/>
<Route key="datapush" path="datapush" component={Datapush}/>
<Route key="reportView" path="reportView" component={ReportView}/>
<Route key="externalPersonManage" path="externalPersonManage" component={ExternalPersonManage}/>
<Route key="topologyView" path="topologyView/:salarySobId/:salaryItemId" component={TopologyMap}/>

View File

@ -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);
@ -41,6 +45,7 @@ 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();
}
window.addEventListener("storage", this.setFontSize);
}
@ -68,9 +73,10 @@ class Layout extends Component {
};
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>);
}
}

View File

@ -271,7 +271,7 @@ class Index extends Component {
render() {
const {
taxAgentStore: { statisticsReportBtn, PageAndOptAuth },
taxAgentStore: { PageAndOptAuth },
attendanceStore: { statisticsForm, reportForm, tableStore }
} = this.props;
const {
@ -279,6 +279,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"
@ -289,7 +290,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"

View File

@ -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}

View File

@ -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 => (

View File

@ -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() {

View File

@ -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) => {

View File

@ -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) => {

View File

@ -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>
);
}

View File

@ -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: 黎永顺

View File

@ -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)}
/> :

View File

@ -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 { getDomkes } from "../../../util";
import Layout from "../layout";
import moment from "moment";
@ -66,7 +67,8 @@ class Index extends Component {
exportPayloadUrl: "",
exportPayloadType: false,
advanceCondition: null,
targetid: ""
targetid: "",
taxAgentOption: []
};
this.tableRef = null;
this.addItemRef = null;
@ -103,11 +105,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));
}
});
@ -236,7 +242,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 = {
@ -260,10 +267,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 {
@ -349,8 +357,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({
@ -463,10 +470,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,
@ -498,7 +506,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
@ -519,7 +527,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}

View File

@ -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";
import { getDomkes } from "../../../util";
const getKey = WeaTools.getKey;
@ -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 { 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));
}
});
@ -142,10 +148,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 {
@ -324,8 +331,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({
@ -389,7 +395,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 = {

View File

@ -27,8 +27,6 @@ class Layout extends Component {
}
componentDidMount() {
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
fetchTaxAgentOption();
window.addEventListener("resize", this.resizeUpdate);
}
@ -91,7 +89,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, form, condition, onImportFile,
onAdSearch, onCancel, importPayload, logFunction, onClearTargrtid
} = this.props;
@ -100,6 +98,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 : []}

View File

@ -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";
import { getDomkes } from "../../../util";
const getKey = WeaTools.getKey;
@ -64,7 +65,8 @@ class Index extends Component {
exportPayloadUrl: "",
exportPayloadType: false,
advanceCondition: null,
targetid: ""
targetid: "",
taxAgentOption: []
};
this.tableRef = null;
this.addItemRef = null;
@ -81,11 +83,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));
}
});
@ -270,10 +276,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 {
@ -359,8 +366,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({
@ -404,7 +410,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 = {

View File

@ -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";
import { getDomkes } from "../../../util";
const getKey = WeaTools.getKey;
@ -53,7 +54,8 @@ class Index extends Component {
exportPayloadUrl: "",
exportPayloadType: false,
advanceCondition: null,
targetid: ""
targetid: "",
taxAgentOption: []
};
this.tableRef = null;
this.addItemRef = null;
@ -105,11 +107,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));
}
});
@ -208,8 +214,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({
@ -258,10 +263,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 {
@ -342,7 +348,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 = {
@ -371,10 +378,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,
@ -405,7 +413,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
@ -427,7 +435,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}

View File

@ -0,0 +1,171 @@
/*
* 数据推送
* 新增编辑
* @Author: 黎永顺
* @Date: 2024/11/19
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaButtonIcon, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable, WeaTools } from "ecCom";
import PDetailDialog from "../PDDialog";
import { postFetch } from "../../../../util/request";
import * as API from "../../../../apis/datapush";
import { conditions } from "../../conditions";
import { Button, message, Modal } from "antd";
import { formRender } from "../../formRender";
const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey;
@inject("baseFormStore") @observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
conditions: [], loading: false, columns: [], dataSource: [],
PDDialog: { visible: false, title: "", settingId: "", detail: {} } //推送明细弹框
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
document.querySelector(".datapush_wrapper").classList.add("zIndex0-weaslide-title");
this.initForm(nextProps);
}
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
document.querySelector(".datapush_wrapper").classList.remove("zIndex0-weaslide-title");
this.props.baseFormStore.initForm();
}
}
initForm = async (props) => {
const { detail } = props;
const { data: salarySobList } = await postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" });
this.setState({
conditions: _.map(conditions, item => ({
...item, title: getLabel(item.lanId, item.title), items: _.map(item.items, o => {
o = { ...o, label: getLabel(o.lanId, o.label), value: detail[getKey(o)] || "" };
if (getKey(o) === "salarySobIds") {
return {
...o, value: detail[getKey(o)] ? detail[getKey(o)] : "",
options: _.map(salarySobList, o => ({ key: String(o.id), showname: o.name }))
};
} else if (getKey(o) === "able") {
return { ...o, value: !_.isEmpty(detail) ? String(detail[getKey(o)]) : o.value };
}
return { ...o };
})
}))
}, () => {
props.baseFormStore.form.initFormFields(this.state.conditions);
!_.isEmpty(detail) && this.getPushItemList(props);
});
};
getPushItemList = (props) => {
const { detail } = props || this.props;
const { id: settingId } = detail;
API.getPushItemList({ settingId }).then(({ status, data }) => {
if (status) {
const { columns, list: dataSource } = data;
this.setState({
dataSource, columns: [...columns, {
title: getLabel(111, "操作"), width: 120, render: (__, record) => (<React.Fragment>
<a href="javascript: void(0);" style={{ marginRight: 10 }}
onClick={() => this.handleOpts("edit", record)}>{getLabel(111, "编辑")}</a>
<a href="javascript: void(0);" style={{ marginRight: 10 }}
onClick={() => this.handleOpts("del", record.id)}>{getLabel(111, "删除")}</a>
</React.Fragment>)
}],
PDDialog: { ...this.state.PDDialog, settingId }
});
}
});
};
handleOpts = (type, detail = {}) => {
switch (type) {
case "edit":
const { PDDialog } = this.state;
this.setState({ PDDialog: { ...PDDialog, visible: true, title: getLabel(111, "编辑"), detail } });
break;
case "del":
Modal.confirm({
title: getLabel(111, "信息确认"),
content: getLabel(111, "确认要删除吗?"),
onOk: () => {
API.deletePushItemList({ id: detail }).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "删除成功"));
this.getPushItemList();
} else {
message.error(errormsg);
}
});
}
});
break;
default:
break;
}
};
save = () => {
const { baseFormStore: { form }, detail } = this.props;
form.validateForm().then(f => {
if (f.isValid) {
const { salarySobIds, ...payload } = form.getFormParams();
this.setState({ loading: true });
API.savePushSetting({ ...payload, salarySobIds: salarySobIds.split(","), id: detail.id })
.then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功"));
this.props.onClose(this.props.onSearch());
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
} else {
f.showErrors();
}
});
};
renderTitle = () => {
const { loading } = this.state, { title } = 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">
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
</div>
</div>;
};
render() {
const { baseFormStore: { form }, detail } = this.props, { conditions, columns, dataSource, PDDialog } = this.state;
return (<WeaSlideModal
className="pushdata_create_dialog" {...this.props} direction="right"
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%" title={this.renderTitle()}
content={<div className="form-dialog-layout">
{formRender(form, conditions)}
{!_.isEmpty(detail) &&
<WeaSearchGroup title={getLabel(111, "推送明细")} showGroup needTigger className="pushdata_detail">
<div className="opts">
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}
onClick={() => this.setState({
PDDialog: { ...PDDialog, visible: true, title: getLabel(111, "新建") }
})}/>
</div>
<WeaTable pagination={false} columns={columns} dataSource={dataSource} bordered/>
<PDetailDialog {...PDDialog} onSearch={this.getPushItemList}
onCancel={() => this.setState({ PDDialog: { ...PDDialog, visible: false, detail: {} } })}/>
</WeaSearchGroup>}
</div>}
/>);
}
}
export default Index;

View File

@ -0,0 +1,90 @@
/*
* 数据推送
* 自定义薪资项目选择树
* @Author: 黎永顺
* @Date: 2024/11/20
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { TreeSelect } from "antd";
import { formualSearchField, formualSearchGroup } from "../../../../apis/item";
import cs from "classnames";
const getLabel = WeaLocaleProvider.getLabel;
const TreeNode = TreeSelect.TreeNode;
class CustomTreeSelect extends Component {
constructor(props) {
super(props);
this.state = { sourceList: [] };
}
componentDidMount() {
formualSearchGroup({ referenceType: "sql" }).then(({ status, data }) => {
if (status) this.setState({ sourceList: _.map(data, o => ({ ...o, isLeaf: true })) });
});
}
getSourceItem = (sourceId) => {
formualSearchField({ sourceId, extendParam: { referenceType: "sql" } }).then(({ status, data }) => {
if (status) {
this.setState({
sourceList: _.map(this.state.sourceList, o => {
if (o.key === sourceId) return {
...o,
children: _.map(data, k => ({ key: k.fieldId, value: k.name, fieldType: k.fieldType, isLeaf: false }))
};
return { ...o };
})
});
}
});
};
generateTreeNodes = (data) => {
const treeNodes = [], showData = [...data];
showData.map((item) => {
let title = (
<div className="weapp-excel-code-action-list-variable">
<span className="weapp-excel-code-action-list-variable-name">{item.value}</span>
{
item.fieldType ?
<span
className={cs("weapp-excel-code-action-list-variable-tip", { "danger": item.fieldType === "string" })}>{item.fieldType === "number" ? getLabel(111, "数字") : getLabel(111, "文本")}</span> :
<span></span>
}
</div>
);
treeNodes.push(<TreeNode className="no-child-item" title={title} key={item.key} value={item.key}/>);
});
return treeNodes;
};
handleSelect = (nodeValue) => {
const { form } = this.props, { sourceList } = this.state;
const [source, __] = nodeValue.split("_");
const itemName = _.find(_.find(sourceList, o => o.key === source).children, k => k.key === nodeValue).value;
form.updateFields({ item: nodeValue, itemName, source });
};
render() {
const { sourceList } = this.state, { detail } = this.props;
const { itemName } = detail;
return (
<TreeSelect dropdownStyle={{ maxHeight: 320, overflow: "auto" }} defaultValue={itemName}
dropdownMatchSelectWidth className="custom_item_treeselect"
loadData={(node) => this.getSourceItem(node.props.value)}
onSelect={this.handleSelect}>
{
_.map(sourceList, o => (
<TreeNode title={o.value} key={o.key} value={o.key} isLeaf={o.isLeaf} selectable={false}>
{this.generateTreeNodes(o.children || [])}
</TreeNode>))
}
</TreeSelect>
);
}
}
export default CustomTreeSelect;

View File

@ -0,0 +1,96 @@
/*
* 数据推送
* 推送明细新增编辑
* @Author: 黎永顺
* @Date: 2024/11/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 { commonEnumList } from "../../../../apis/ruleconfig";
import * as API from "../../../../apis/datapush";
import { PDConditions } from "../../conditions";
import { Button, message } from "antd";
import { formRender } from "../../formRender";
const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey;
@inject("baseFormStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
conditions: [], loading: false
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.baseFormStore.initFormExtra();
}
initForm = async (props) => {
const { detail = {} } = props;
const { data: fieldType } = await commonEnumList({ enumClass: "com.engine.salary.enums.push.PushItemFieldEnum" });
this.setState({
conditions: _.map(PDConditions, item => ({
...item, items: _.map(item.items, o => {
o = { ...o, label: getLabel(o.lanId, o.label), value: detail[getKey(o)] || "" };
if (getKey(o) === "fieldType") {
return {
...o, value: detail[getKey(o)] ? String(detail[getKey(o)]) : "",
options: _.map(fieldType, o => ({ key: o.enum, showname: o.defaultLabel }))
};
}
return { ...o };
})
}))
}, () => {
props.baseFormStore.formExtra.initFormFields(this.state.conditions);
});
};
save = () => {
const { baseFormStore: { formExtra }, detail: { id }, settingId } = this.props;
formExtra.validateForm().then(f => {
if (f.isValid) {
const payload = formExtra.getFormParams();
this.setState({ loading: true });
API.savePushItemList({ ...payload, settingId, id })
.then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功"));
this.props.onCancel(this.props.onSearch());
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
} else {
f.showErrors();
}
});
};
render() {
const { baseFormStore: { formExtra }, detail } = this.props, { loading, conditions } = this.state;
return (
<WeaDialog
{...this.props} style={{ width: 480, height: 174 }} initLoadCss className="Pdetail_dialog"
buttons={[
<Button onClick={this.props.onCancel}>{getLabel(111, "取消")}</Button>,
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "保存")}</Button>
]}
>
<div className="form-dialog-layout">{formRender(formExtra, conditions, detail)}</div>
</WeaDialog>
);
}
}
export default Index;

View File

@ -0,0 +1,86 @@
/*
* 数据推送列表
*
* @Author: 黎永顺
* @Date: 2024/11/19
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom";
import * as API from "../../../../apis/datapush";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
constructor(props) {
super(props);
this.state = {
columns: [], dataSource: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }
};
}
componentDidMount() {
this.getPushSettingList();
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.isQuery !== this.props.isQuery) this.setState({
pageInfo: { ...this.state.pageInfo, current: 1 }
}, () => this.getPushSettingList(nextProps));
}
getPushSettingList = (props) => {
const { pageInfo } = this.state, { query } = props || this.props;
const payload = { ...pageInfo, ...query };
this.setState({ loading: true });
API.getPushSettingList(payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource: _.map(dataSource, o => ({
...o, salarySobs: _.map(o.salarySobs, k => k.name).join(","),
salarySobIds: _.map(o.salarySobs, k => k.id).join(",")
})),
columns: [..._.map(columns, o => {
if (o.dataIndex === "able") return {
...o, render: v => (<WeaCheckbox value={String(v)} disabled display="switch"/>)
};
return { ...o };
}), {
title: getLabel(111, "操作"), dataIndex: "opts", width: 120, render: (__, record) => (<React.Fragment>
<a href="javascript: void(0);" style={{ marginRight: 10 }}
onClick={() => this.props.onChange("edit", record)}>{getLabel(111, "编辑")}</a>
<a href="javascript: void(0);" style={{ marginRight: 10 }}
onClick={() => this.props.onChange("del", record.id)}>{getLabel(111, "删除")}</a>
</React.Fragment>)
}]
});
}
});
};
render() {
const { columns, dataSource, loading, pageInfo } = this.state;
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.getPushSettingList());
},
onChange: current => {
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getPushSettingList());
}
};
return (<WeaTable loading={loading} dataSource={dataSource} columns={columns} pagination={pagination}
scroll={{ y: `calc(100vh - 182px)` }}/>);
}
}
export default Index;

View File

@ -0,0 +1,147 @@
// 推送配置表单
export const conditions = [
{
items: [
{
conditionType: "INPUT",
domkey: ["name"],
fieldcol: 14,
label: "任务名称",
lanId: 111,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SWITCH",
domkey: ["able"],
fieldcol: 14,
label: "是否启用",
lanId: 111,
labelcol: 6,
value: "0",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["salarySobIds"],
fieldcol: 14,
label: "薪资账套",
lanId: 111,
labelcol: 6,
value: "",
multiple: true,
options: [],
rules: "required|string",
viewAttr: 3
},
{
browserConditionParam: {
completeURL: "/api/bs/hrmsalary/push/mode/list",
dataParams: {},
filterByName: true,
tableProps: {},
isSingle: true,
searchParamsKey: "name",
replaceDatas: [{}]
},
tags: true,
conditionType: "INPUT",
domkey: ["modeName"],
fieldcol: 14,
label: "建模名称",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
},
{
conditionType: "INPUT",
domkey: ["tableName"],
fieldcol: 14,
label: "数据表名",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
},
{
conditionType: "INPUT",
domkey: ["modeId"],
fieldcol: 14,
label: "建模ID",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
}
],
title: "基础信息",
lanId: 111,
col: 2,
defaultshow: true
}
];// 推送配置表单
export const PDConditions = [
{
items: [
{
conditionType: "INPUT",
domkey: ["item"],
fieldcol: 14,
label: "薪资项目",
lanId: 111,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["itemName"],
fieldcol: 14,
label: "薪资名称",
lanId: 111,
labelcol: 6,
viewAttr: 2,
hide: true
},
{
conditionType: "INPUT",
domkey: ["source"],
fieldcol: 14,
label: "薪资资源",
lanId: 111,
labelcol: 6,
viewAttr: 2,
hide: true
},
{
conditionType: "INPUT",
domkey: ["fieldName"],
fieldcol: 14,
label: "字段名称",
lanId: 111,
labelcol: 6,
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["fieldType"],
fieldcol: 14,
label: "字段类型",
lanId: 111,
labelcol: 6,
value: "",
options: [],
rules: "required|string",
viewAttr: 3
}
],
title: "",
defaultshow: true
}
];// 推送详细配置表单

View File

@ -0,0 +1,51 @@
import React from "react";
import { WeaFormItem, WeaSearchGroup, WeaTools } from "ecCom";
import { WeaSwitch } from "comsMobx";
import CustomTreeSelect from "./components/PDDialog/customTreeSelect";
import CustomBrowser from "../../components/CustomBrowser";
const getKey = WeaTools.getKey;
export const formRender = (form, conditions, params) => {
const { isFormInit } = form;
const formParams = form.getFormParams();
let group = [];
isFormInit && conditions && 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">
{
getKey(fields) === "item" ?
<React.Fragment>
<CustomTreeSelect
detail={params} fieldConfig={fields} form={form} formParams={formParams}/>
{
_.isEmpty(formParams.item) &&
<span className="wea-required-e9" style={{ verticalAlign: "middle" }}>
<img src="/images/BacoError_wev9.png" alt=""/>
</span>
}
</React.Fragment>
:
getKey(fields) === "modeName" ?
<CustomBrowser fieldConfig={fields} form={form} formParams={formParams}
onCustomChange={(v) => !!_.values(v)[0] && form.updateFields({
tableName: _.values(v)[0].subname,
modeId: _.values(v)[0].domid
})}/>
: <WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
}
</WeaFormItem>),
colSpan: 1,
hide: fields.hide
});
});
!_.isEmpty(items) && group.push(
<WeaSearchGroup col={c.col || 1} needTigger={true} showGroup={c.defaultshow} items={items} center={false}
title={c.title}/>);
});
return group;
};

View File

@ -0,0 +1,95 @@
/*
* 数据推送
*
* @Author: 黎永顺
* @Date: 2024/11/19
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom";
import * as API from "../../apis/datapush";
import DatapushList from "./components/datapushList";
import DatapushDialog from "./components/DPDialog";
import { Button, message, Modal } from "antd";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore", "baseFormStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
selectedKey: "datapush", isQuery: false, query: { name: "" },
DPDialog: { visible: false, title: "", detail: {} } //数据推送弹框
};
}
handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });
handleOperate = (type, detail = {}) => {
switch (type) {
case "create":
case "edit":
const title = type === "create" ? getLabel(111, "新建") : getLabel(111, "编辑");
this.setState({ DPDialog: { visible: true, title, detail } });
break;
case "del":
Modal.confirm({
title: getLabel(111, "信息确认"),
content: getLabel(111, "确认要删除吗?"),
onOk: () => {
API.deletePushSetting({ id: detail }).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "删除成功"));
this.handleAdvanceSearch();
} else {
message.error(errormsg);
}
});
}
});
break;
default:
break;
}
};
render() {
const { selectedKey, DPDialog, isQuery, query } = this.state;
const { taxAgentStore: { PageAndOptAuth } } = this.props;
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const tabs = [
{
title: getLabel(111, "数据推送"), key: "datapush", showDropIcon: false, dropMenuDatas: [],
buttons: showOperateBtn ? [
<Button type="primary" onClick={() => this.handleOperate("create")}>{getLabel(111, "新建")}</Button>,
<WeaInputSearch style={{ top: -3 }} value={query.name} onSearch={this.handleAdvanceSearch}
onChange={v => this.setState({ query: { ...query, name: v } })}/>
] : [<WeaInputSearch style={{ top: -3 }} value={query.name} onSearch={this.handleAdvanceSearch}
onChange={v => this.setState({ query: { ...query, name: v } })}/>],
children: <DatapushList isQuery={isQuery} query={query} onChange={this.handleOperate}/>
}
];
return (
<WeaReqTop
title={getLabel(111, "数据推送")} icon={<i className="icon-coms-fa"/>} selectedKey={selectedKey}
iconBgcolor="#F14A2D" tabDatas={tabs} className="datapush_wrapper" buttonSpace={10}
buttons={_.find(tabs, o => selectedKey === o.key).buttons}
onChange={selectedKey => this.setState({ selectedKey })}
showDropIcon={_.find(tabs, o => selectedKey === o.key).showDropIcon} onDropMenuClick={this.handleOperate}
dropMenuDatas={_.find(tabs, o => selectedKey === o.key).dropMenuDatas}
>
{_.find(tabs, o => selectedKey === o.key).children}
{/*数据推送框*/}
<DatapushDialog {...DPDialog} onClose={() => this.setState({ DPDialog: { ...DPDialog, visible: false } })}
onSearch={this.handleAdvanceSearch}/>
</WeaReqTop>
);
}
}
export default Index;

View File

@ -0,0 +1,134 @@
.datapush_wrapper {
.wea-new-top-req-title > div:last-child {
right: 16px !important;
}
.wea-new-top-req-content {
padding: 8px 16px 0 16px;
.wea-new-table {
background: #FFF;
}
.ant-spin-nested-loading, .ant-spin-container {
height: 100% !important;
}
.pushdata_create_dialog {
.scroller {
background: #f6f6f6;
}
.pushdata_detail {
.opts {
width: 100%;
display: flex;
justify-content: flex-end;
align-items: center;
padding: 8px;
}
}
.wea-slide-modal-title {
border-bottom: 1px solid #ebebeb;
}
.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:last-child {
margin-left: 10px;
}
}
}
}
}
}
.custom_item_treeselect {
.weapp-excel-code-action-list-variable-tip {
display: none;
}
}
.no-child-item {
.ant-select-tree-switcher {
display: none !important;
}
.ant-select-tree-node-content-wrapper {
width: 100%;
}
.weapp-excel-code-action-list-variable {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.weapp-excel-code-action-list-variable-name {
height: 20px;
line-height: 18px;
-webkit-flex: 1 1;
flex: 1 1;
overflow: hidden;
text-overflow: ellipsis;
word-break: keep-all;
white-space: nowrap;
cursor: pointer;
}
.danger {
color: rgb(255, 102, 106) !important;
border: 1px solid rgb(255, 193, 195) !important;
background-color: rgb(255, 223, 224) !important;
}
.weapp-excel-code-action-list-variable-tip {
width: 40px;
height: 20px;
line-height: 18px;
text-align: center;
vertical-align: middle;
color: rgb(255, 205, 80);
border: 1px solid rgb(255, 222, 138);
background-color: rgb(255, 245, 219);
border-radius: 2px;
}
}
}

View File

@ -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";
import * as API from "../../../../apis/ruleconfig";
const getKey = WeaTools.getKey;
@ -35,29 +35,31 @@ class Index extends Component {
getTaxAgentSelectListAsAdmin = async (props) => {
const { data: sysinfo } = await API.sysinfo();
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, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;")
};
} else if (getKey(o) === "salaryMonthStr") {
return {
...o,
label: sysinfo["TAX_DECLARATION_DATE_TYPE"] === "1" ? getLabel(111, "税款所属期") : getLabel(111, "薪资所属月")
};
}
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, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;")
};
} else if (getKey(o) === "salaryMonthStr") {
return {
...o,
label: sysinfo["TAX_DECLARATION_DATE_TYPE"] === "1" ? getLabel(111, "税款所属期") : getLabel(111, "薪资所属月")
};
}
return { ...o, label: getLabel(o.lanId, o.label) };
})
}))
}, () => declareForm.initFormFields(this.state.conditions));
}
});
};
save = () => {
const { declareStore: { declareForm } } = this.props;

View File

@ -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={() => {

View File

@ -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({

View File

@ -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())}/>,

View File

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

View File

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

View File

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

View File

@ -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>;
}

View File

@ -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,42 +32,39 @@ 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;
const { copyForm: form } = ledgerStore;
form.validateForm().then(f => {
if (f.isValid) {
const payload = { id, ...form.getFormParams() };
const { taxAgentId, ...formParams } = form.getFormParams();
const payload = { id, ...formParams, taxAgentIds: taxAgentId.split(",") };
this.setState({ loading: true });
duplicateLedger(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
@ -84,7 +82,6 @@ class CopyLedgerModal extends Component {
});
};
render() {
const { onCancel, ledgerStore, ...extra } = this.props;
const { loading } = this.state;

View File

@ -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";
@ -37,8 +36,6 @@ const APISaveFox = {
edit: editLedgerPersonRange
};
@inject("taxAgentStore")
@observer
class LedgerAssociatedPersonnel extends Component {
constructor(props) {
super(props);
@ -224,7 +221,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: "关联人员范围",
@ -239,7 +237,7 @@ class LedgerAssociatedPersonnel extends Component {
viewcondition: "externalList"
}
];
const btns = showOperateBtn ? [
const btns = admin ? [
<Button
className="icon-coms-leading-in-btn"
type="primary"
@ -280,7 +278,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
@ -289,7 +287,7 @@ class LedgerAssociatedPersonnel extends Component {
APIFox={APIFox}
tabActive={selectedKey}
searchValue={searchValue}
showOperateBtn={showOperateBtn}
showOperateBtn={admin}
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
onEditScope={this.handleAddPersonal}
/>

View File

@ -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}

View File

@ -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,19 @@ class LedgerBaseSetting extends Component {
};
render() {
const { editId, taxAgentStore: { taxAgentOption } } = this.props;
const { editId, record, PageAndOptAuth } = 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 = key === "taxAgentId" && editId && !PageAndOptAuth.isChief;
taxableItemsDisabled = key === "taxableItems" && editId;
return <WeaFormItem
key={key} label={label}
@ -176,10 +177,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 +190,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={taxAgentIdDisabled ? 1 : 3} multiple={multiple}
disabled={!admin || 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 +211,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 +219,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>;
})
}

View File

@ -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}/>
] : [];

View File

@ -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 }}

View File

@ -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 {

View File

@ -10,12 +10,13 @@ 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;
@inject("ledgerStore") @observer
@inject("ledgerStore")
@observer
class LedgerSearchComp extends Component {
constructor(props) {
super(props);
@ -30,26 +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();

View File

@ -23,7 +23,7 @@ import "./index.less";
const { getLabel } = WeaLocaleProvider;
const Step = WeaSteps.Step;
@inject("taxAgentStore", "ledgerStore")
@inject("ledgerStore")
@observer
class LedgerSlide extends Component {
constructor(props) {
@ -67,17 +67,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: 黎永顺
@ -198,7 +199,7 @@ class LedgerSlide extends Component {
};
render() {
const { visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
const { visible, editId, record } = this.props;
const { current, saveSalarySobId, loading, salaryApprovalStatus } = this.state;
let tabs = [
{
@ -296,7 +297,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) })}/>
}

View File

@ -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":

View File

@ -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: []
},
{

View File

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

View File

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

View File

@ -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

View File

@ -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 = [
@ -449,7 +449,7 @@ export const salaryFilesConditions = [
},
{
defaultshow: true, title: getLabel(543329, "发薪设置"),
col: 1,lanId: 543329,
col: 1, lanId: 543329,
items: [
{
colSpan: 1,
@ -480,7 +480,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: []
}
];

View File

@ -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)}

View File

@ -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>

View File

@ -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 = () => {

View File

@ -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);
@ -126,7 +123,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, "条")}`,
@ -160,23 +157,23 @@ class Index extends Component {
render: (__, record) => {
const {} = record;
//显示更新模板
return showOperateBtn ? <React.Fragment>
<a href="javascript:void(0);" onClick={() => this.handleOpts({ key: "edit" }, record)}
style={{ marginRight: 10 }}>{getLabel(501169, "编辑")}</a>
<a href="javascript:void(0);" style={{ marginRight: 10 }}
onClick={() => this.handleOpts({ key: "copy" }, record)}
>{getLabel(77, "复制")}</a>
<Dropdown
overlay={<Menu onClick={e => this.handleOpts(e, record)}>
<Menu.Item key="del">{getLabel(535052, "删除")}</Menu.Item>
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
</Menu>
}>
<a href="javascript:void(0);"><i className="icon-coms-more"/></a>
</Dropdown>
</React.Fragment> :
<a href="javascript:void(0);"
onClick={() => this.handleOpts({ key: "view" }, record)}>{getLabel(83110, "查看详情")}</a>;
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 }}
onClick={() => this.handleOpts({ key: "copy" }, record)}
>{getLabel(77, "复制")}</a>
<Dropdown
overlay={<Menu onClick={e => this.handleOpts(e, record)}>
<Menu.Item key="del">{getLabel(535052, "删除")}</Menu.Item>
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
</Menu>
}
>
<a href="javascript:void(0);"><i className="icon-coms-more"/></a>
</Dropdown>
</React.Fragment> : <a href="javascript:void(0);"
onClick={() => this.handleOpts({ key: "view" }, record)}>{getLabel(83110, "查看详情")}</a>;
}
}
]}

View File

@ -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)}
/>;

View File

@ -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>
);

View File

@ -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;

View File

@ -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())}

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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
}
];

View File

@ -0,0 +1,120 @@
.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;
}
}
}
.authDetail_dialog {
.authDetail-dialog-title {
display: flex;
justify-content: space-between;
align-items: center;
}
.authDetail-table {
background: #f6f6f6;
padding: 8px 16px;
height: 100%;
.wea-new-table {
background: #FFF;
}
}
}

View File

@ -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;

View File

@ -0,0 +1,97 @@
/*
* 角色详情设置弹窗
* 成员数据明细查询
* @Author: 黎永顺
* @Date: 2024/9/27
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom";
import * as API from "../../../../apis/taxAgent";
import "../index.less";
const getLabel = WeaLocaleProvider.getLabel;
const APIFOX = {
"auth.MemberTargetTypeEnum": API.authMemberDetail,
"auth.DataTargetTypeEnum": API.authDataDetail
};
class DetailDialog extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
query: { username: "" }, dataSource: [], columns: []
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
query: { username: "" }, pageInfo: { current: 1, pageSize: 10, total: 0 }
});
}
getData = (props) => {
const { pageInfo, query } = this.state, { roleId, selectedKey } = props || this.props;
let payload = { ...pageInfo, ...query, roleId };
this.setState({ loading: true });
APIFOX[selectedKey](payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({
columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total }
});
}
});
};
renderTitle = () => {
const { selectedKey } = this.props, { query } = this.state;
const title = selectedKey === "auth.MemberTargetTypeEnum" ? getLabel(111, "成员明细") : getLabel(111, "数据明细");
return (<div className="authDetail-dialog-title">
<span>{title}</span>
<WeaInputSearch value={query.username} onChange={v => this.setState({ query: { username: v } })}
onSearch={v => this.setState({ pageInfo: { current: 1 } }, () => this.getData())}/>
</div>);
};
render() {
const { loading, dataSource, pageInfo, columns } = this.state;
const sheight = this.dialog ? this.dialog.state.height - 120 : 260;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({
pageInfo: { ...pageInfo, current, pageSize }
}, () => this.getData());
},
onChange: current => {
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getData());
}
};
return (
<WeaDialog
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={this.renderTitle()}
className="authDetail_dialog" style={{
width: 784, height: 460, minHeight: 200, minWidth: 380,
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
}} buttons={[]}>
<div className="authDetail-table">
<WeaTable dataSource={dataSource} loading={loading} pagination={pagination} scroll={{ y: sheight }}
rowKey="id" columns={columns}/>
</div>
</WeaDialog>
);
}
}
export default DetailDialog;

View File

@ -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;

View File

@ -0,0 +1,495 @@
/*
* 角色详情设置弹窗
*
* @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 DetailDialog from "./detailDialog";
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: {} },
detailDialog: { visible: false, roleId: "", selectedKey: "" },
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",
detailDialog: {
...this.state.detailDialog, roleId: nextProps.roleId,
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, "操作成功!"));
this.props.onSearch && this.props.onSearch();
} 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, "操作成功!"));
this.props.onSearch && this.props.onSearch();
} 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, counts } = this.props;
const {
selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog,
dataTargetSettings, detailDialog
} = this.state;
const { linkOptions } = editOperatorDialog;
const tabs = [
{ title: getLabel(111, "基础信息"), viewcondition: "baseinfo", showcount: true, count: "resources" },
{
title: getLabel(111, "成员设置"), viewcondition: "auth.MemberTargetTypeEnum", showcount: true, count: "members"
},
{ title: getLabel(111, "功能权限"), viewcondition: "auth.AuthTargetTypeEnum", showcount: true, count: "opts" },
{ title: getLabel(111, "数据范围"), viewcondition: "auth.DataTargetTypeEnum", showcount: true, count: "datas" }
];
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();
!["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.unshift(
<Button type="primary" onClick={() => this.setState({
detailDialog: { ...detailDialog, visible: true }
})}>{selectedKey === "auth.MemberTargetTypeEnum" ? getLabel(111, "成员明细") : getLabel(111, "数据明细")}</Button>
);
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} countParam="count" counts={counts}
onChange={v => this.setState({
selectedKey: v, replaceDatas: [], selectedRowKeys: [],
detailDialog: { ...detailDialog, selectedKey: v }
}, () => {
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())}/>
{/*成员、数据明细查看*/}
<DetailDialog {...detailDialog}
onCancel={() => this.setState({ detailDialog: { ...detailDialog, visible: false } })}/>
</Col>
</Row>
}
</div>
</WeaDialog>
);
}
}
export default Index;

View File

@ -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;

View File

@ -0,0 +1,242 @@
/*
* 角色管理
*
* @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 },
logDialogVisible: false, filterConditions: "", showSearchAd: false, syncLoading: false,
roleSetDialog: {
visible: false, roleId: "", name: "", selectedKey: "",
counts: { datas: 0, members: 0, resources: 0, opts: 0 }
}
};
}
componentDidMount() {
this.getRoleList();
}
syncAuth = () => {
this.setState({ syncLoading: true });
API.syncAuth().then(({ status, errormsg }) => {
this.setState({ syncLoading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.getRoleList();
} else {
message.error(errormsg);
}
});
};
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>
)
}]
}, () => {
const { roleSetDialog, dataSource } = this.state;
roleSetDialog.roleId && this.setState({
roleSetDialog: {
...roleSetDialog, counts: {
...roleSetDialog.counts, ..._.reduce(_.keys(roleSetDialog.counts), (pre, cur) => ({
...pre, [cur]: _.find(dataSource, o => o.id === roleSetDialog.roleId)[cur] || 0
}), {})
}
}
});
});
}
});
};
showRoleSetDialog = (role) => this.setState({
roleSetDialog: {
visible: true, roleId: role.id, name: role.name, selectedKey: role.selectedKey,
counts: {
...this.state.roleSetDialog.counts, ..._.reduce(_.keys(this.state.roleSetDialog.counts), (pre, cur) => ({
...pre, [cur]: role[cur] || 0
}), {})
}
}
});
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, syncLoading
} = 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, "操作日志")
}];
let buttons = [
<Button type="primary" onClick={() => this.setState({
addRoleDialog: { taxAgentId: "", visible: true }
})}>{getLabel(111, "新建")}</Button>,
<Button type="ghost" loading={syncLoading} onClick={this.syncAuth}>{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 = buttons.slice(-1));
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, roleId: "" }
}, () => {
this.props.taxAgentStore.initRoleForm();
callback && callback();
})}/>
</div>
{/*操作日志*/}
<LogDialog visible={logDialogVisible} logFunction="authlink" filterConditions={filterConditions}
onCancel={() => this.setState({ logDialogVisible: false })}/>
</WeaTop>
);
}
}
export default Index;

View File

@ -0,0 +1,60 @@
.rolemanagement-index {
.rolemanagement-content {
height: 100%;
overflow-y: auto;
padding: 8px 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;
}
}

View File

@ -0,0 +1,48 @@
/*
* Author: 黎永顺
* name: 基础设置
* Description:
* Date: 2022/11/29
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions";
import { getSearchs } from "../../../util";
@inject("taxAgentStore")
@observer
class BaseSettings extends Component {
componentDidMount() {
}
render() {
const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props;
return (
<div className="form-dialog-layout">
{
decentralization === "0" ?
getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) :
getSearchs(salarytaxAgentForm, convertConditon(editConditions, !isChief), 1, false)
}
</div>
);
}
}
export default BaseSettings;
export const convertConditon = (condition, bool) => {
return _.map(condition, item => {
return {
...item,
items: _.map(item.items, child => {
return {
...child,
viewAttr: bool ? 1 : child.viewAttr
};
})
};
});
};

View File

@ -0,0 +1,46 @@
/*
* Author: 黎永顺
* name: 个税扣缴义务人小提示组件
* Description:
* Date: 2022/11/22
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
class ComHint extends Component {
/*
* Author: 黎永顺
* Description: 提示语注释
* Params: isChief=总管理员
* Date: 2022/11/22
*/
renderTips = () => {
const { isChief = true } = this.props;
if (isChief) {
return [
<p>{getLabel(111, "1、个税扣缴义务人与档案中的个税扣缴义务人匹配修改个税扣缴义务人名称薪资档案的个税扣缴义务人数据同步更新")}</p>,
<p>{getLabel(111, "2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人否则不予删除")}</p>,
<p>{getLabel(111, "3、只有薪酬总管理员能够操作个税扣缴义务人的增减和开启/关闭分权;")}</p>,
<p>{getLabel(111, "4、开启分权需维护个税扣缴义务人的管理员当前总管理员默认有管理员的权限")}</p>
];
} else {
return [];
}
};
render() {
return (
<div className="comHint">
<div className="hintHeader">{getLabel(111, "小提示")}</div>
<div className="hintTips">
{this.renderTips()}
</div>
</div>
);
}
}
export default ComHint;

View File

@ -0,0 +1,440 @@
export const fieldList = [
{
key: "name",
label: "名称",
lanId: 33439,
type: "TEXT",
viewAttr: 1
},
{
key: "taxCode",
label: "税号",
lanId: 111,
type: "TEXT",
viewAttr: 3
},
{
key: "city",
label: "报税所属区域",
lanId: 111,
type: "SELECT",
viewAttr: 3
},
{
key: "areaCode",
label: "行政区划代码",
lanId: 111,
type: "TEXT",
viewAttr: 3
},
{
key: "passwordType",
label: "密码校验类型",
lanId: 111,
type: "RADIO",
viewAttr: 3,
options: [
{
key: "TAX_NET_PASSWORD",
showname: "个税网报密码",
lanId: 111
},
{
key: "REAL_NAME_PASSWORD",
showname: "实名账号密码",
lanId: 111
}
]
},
{
key: "account",
label: "实名账号",
lanId: 111,
type: "TEXT",
viewAttr: 3
},
{
key: "realNamePassword",
label: "实名账号密码",
lanId: 111,
type: "PASSWORD",
viewAttr: 3
},
{
key: "netPassword",
label: "个税网报密码",
lanId: 111,
type: "PASSWORD",
viewAttr: 3
},
{
key: "taxRegistrationNumber",
label: "登记序号",
type: "TEXT",
lanId: 111,
viewAttr: 1
},
{
key: "departmentCode",
label: "部门编码",
lanId: 111,
type: "TEXT",
viewAttr: 1
},
{
key: "checkStatus",
label: "报税信息验证状态",
lanId: 111,
type: "TEXT",
viewAttr: 1
}
];
export const taxFillCondition = [
{
items: [
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxAgentName"],
fieldcol: 14,
label: "个税扣缴义务人",
lanId: 537996,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxRegistrationNumber"],
fieldcol: 14,
label: "登记序号",
lanId: 545138,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxpayerStatus"],
fieldcol: 14,
label: "纳税人状态",
lanId: 545139,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["legalPersonName"],
fieldcol: 14,
label: "法人姓名",
lanId: 545140,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["mobile"],
fieldcol: 14,
label: "联系电话",
lanId: 545141,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["businessAddress"],
fieldcol: 14,
label: "生产经营地址",
lanId: 545142,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["industryName"],
fieldcol: 14,
label: "行业名称",
lanId: 545143,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxAuthorities"],
fieldcol: 14,
label: "主管税务机关",
lanId: 545144,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxBranch"],
fieldcol: 14,
label: "主管税务科所",
lanId: 545145,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["divideFiling"],
fieldcol: 14,
label: "是否分部门备案",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
}
],
defaultshow: true
}
];
export const deptFillCondition = [
{
items: [
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["departmentName"],
fieldcol: 14,
label: "部门名称",
lanId: 536641,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["departmentCode"],
fieldcol: 14,
label: "部门编码",
lanId: 111,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true
}
];
export const taxFillColumns = [
{
dataIndex: "taxCode",
title: "税号",
titleId: "",
fixed: "left"
},
{
dataIndex: "taxAgentName",
title: "个税扣缴义务人",
titleId: "537996"
},
{
dataIndex: "taxRegistrationNumber",
title: "登记序号",
titleId: "545138"
},
{
dataIndex: "taxpayerStatus",
title: "纳税人状态",
titleId: "545139"
},
{
dataIndex: "taxAuthorities",
title: "主管税务机关",
titleId: "545144"
},
{
dataIndex: "taxBranch",
title: "主管税务科所",
titleId: "545145"
},
{
dataIndex: "businessAddress",
title: "生产经营地址",
titleId: "545142"
},
{
dataIndex: "industryName",
title: "行业名称",
titleId: "545143"
},
{
dataIndex: "legalPersonName",
title: "法人姓名",
titleId: "545140"
},
{
dataIndex: "mobile",
title: "联系电话",
titleId: "545141"
}
];
export const personScopeConditions = [
{
items: [
{
conditionType: "SELECT_LINKAGE",
domkey: ["targetType"],
fieldcol: 18,
label: "对象类型",
lanId: 111,
labelcol: 6,
options: [],
viewAttr: 3,
rules: "selectLinkageRequired",
selectLinkageDatas: {}
},
{
conditionType: "SELECT",
domkey: ["employeeStatus"],
fieldcol: 18,
label: "选择员工状态",
lanId: 111,
labelcol: 6,
value: "",
detailtype: "2",
rules: "required",
viewAttr: 3
},
],
defaultshow: true
}
];
export const scopeSelectLinkageDatas = {
EMPLOYEE:{
browserConditionParam: {
completeParams: {},
dataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
pageSize: 10,
linkUrl: "",
type: "17",
viewAttr: 3,
rules:'required',
title: ""
},
conditionType: "BROWSER",
domkey: ["target"],
fieldcol: 24,
label: "",
labelcol: 0,
value: "",
rules: "required",
viewAttr: 3
},
DEPT:{
browserConditionParam: {
completeParams: {},
dataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
pageSize: 10,
linkUrl: "",
type: "57",
viewAttr: 3,
rules:'required',
title: ""
},
conditionType: "BROWSER",
domkey: ["target"],
fieldcol: 24,
label: "",
labelcol: 0,
value: "",
rules: "required",
viewAttr: 3
},
SUBCOMPANY:{
browserConditionParam: {
completeParams: {},
dataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
pageSize: 10,
linkUrl: "",
type: "164",
viewAttr: 3,
rules:'required',
title: ""
},
conditionType: "BROWSER",
domkey: ["target"],
fieldcol: 24,
label: "",
labelcol: 0,
value: "",
rules: "required",
viewAttr: 3
},
POSITION:{
browserConditionParam: {
completeParams: {},
dataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
pageSize: 10,
linkUrl: "",
type: "278",
viewAttr: 3,
rules:'required',
title: ""
},
conditionType: "BROWSER",
domkey: ["target"],
fieldcol: 24,
label: "",
labelcol: 0,
value: "",
rules: "required",
viewAttr: 3
},
SQL: {
conditionType: "TEXTAREA",
domkey: ["target"],
fieldcol: 24,
label: "",
labelcol: 0,
value: "",
rules: "required",
viewAttr: 3
}
};

View File

@ -0,0 +1,165 @@
.taxAgentSlideContent {
height: 100%;
background: #F6F6F6;
.ant-steps {
margin: 0 0 20px 0 !important;
padding-top: 20px;
}
.personal-scope {
padding: 8px 16px;
height: 100%;
.wea-tab, .wea-new-table {
background: #FFF;
}
.icon-refresh {
display: flex;
justify-content: center;
align-items: center;
width: 20px;
height: 20px;
color: #fff;
background: #55a1f8;
cursor: pointer;
border-radius: 3px;
}
}
.baseSettingWrapper, .taxDeclarationInfoWrapper {
padding: 12px 12px 12px 20px;
.wea-search-group {
padding: 0;
border: 1px solid #e5e5e5;
border-bottom: none;
.wea-content {
padding: 0;
.wea-form-cell, .wea-form-item {
border-bottom: 1px solid #e5e5e5;
padding: 5px 10px 5px 30px;
.wea-form-item {
padding: 0 !important;
border-bottom: none !important;
}
}
}
}
}
}
.comHint {
width: 100%;
margin: 16px 0;
border: 1px solid #e5e5e5;
background: #FFF;
.hintHeader {
background: #f6f6f6;
height: 40px;
border-bottom: 1px solid #e5e5e5;
padding-left: 16px;
line-height: 40px;
}
.hintTips {
width: 100%;
color: #999;
line-height: 20px;
padding: 0 16px;
display: inline-block;
p {
margin: 1rem 0;
}
}
}
.slideOuterWrapper {
.wea-slide-modal-title {
height: initial;
line-height: initial;
text-align: left;
}
.rodal-close {
z-index: 99;
top: 10px !important;
}
}
@media (min-width: 1260px) {
.slideOuterWrapper {
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
max-width: 100% !important;
}
}
}
@media screen and (min-width: 1060px) and (max-width: 1260px) {
.slideOuterWrapper {
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
max-width: calc(100% - 96px) !important;
}
}
}
//添加关联人员弹框中的下拉框样式
.personalScopeModalWrapper {
.wea-select, .ant-select-selection, .ant-select {
width: 100%;
}
.wea-select {
display: inline-block;
position: relative;
}
.ant-select-selection {
height: 30px;
border-radius: 0;
}
}
.taxfillingDialog {
.ant-modal-title {
.text-elli {
color: #111;
font-weight: 700;
}
}
.taxfillingDialogContent {
height: 100%;
padding: 16px;
background: #f6f6f6;
overflow-y: auto;
.wea-search-group {
padding: 0;
background: #FFF;
border: 1px solid #e5e5e5;
border-bottom: 0;
.ant-row, .wea-form-cell {
padding: 0;
}
.wea-form-item {
padding: 5px 16px;
border-bottom: 1px solid #e5e5e5;
}
}
.wea-new-table {
background: #FFF;
}
}
}

View File

@ -0,0 +1,234 @@
/*
* Author: 黎永顺
* name: 人员范围
* Description:
* Date: 2022/11/30
*/
import React, { Component } from "react";
import { message, Modal } from "antd";
import { inject, observer } from "mobx-react";
import { WeaButtonIcon, WeaInputSearch, WeaLocaleProvider, WeaTab } from "ecCom";
import {
taxAgentRangeDelete,
taxAgentRangeExtDelete,
taxAgentRangeExtSave,
taxAgentRangeImportData
} from "../../../apis/taxAgent";
import { sysinfo } from "../../../apis/ruleconfig";
import PersonalScopeTable from "./personalScopeTable";
import PersonalScopeModal from "./personalScopeModal";
import ImportDialog from "../../../components/importDialog";
import ExternalPersonModal from "../../../components/externalPersonModal";
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore")
@observer
class PersonalScope extends Component {
constructor(props) {
super(props);
this.state = {
searchValue: "", selectedKey: "listInclude", rowKeys: [], loading: false,
extEmpsWitch: "1", //非系统人员开关, 1 开启, 0关闭
personalAddModal: {
visible: false, externalVisible: false, title: getLabel(111, "关联人员"), includeType: "", record: {}
},
importParams: {
visible: false, title: getLabel(111, "数据导入"), nextloading: false, importResult: {}, imageId: "",
link: `/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${props.taxAgentId}`,
previewUrl: "/api/bs/hrmsalary/taxAgent/range/preview"
}
};
this.personalScopeTableRef = null;
}
componentDidMount() {
const { taxAgentStore: { hasIconInTax } } = this.props;
hasIconInTax();
this.getSysinfo();
}
/*
* Author: 黎永顺
* Description:非系统人员开关查询
* Params:
* Date: 2023/11/9
*/
getSysinfo = () => {
sysinfo().then(({ status, data }) => {
if (status) this.setState({ extEmpsWitch: data.extEmpsWitch });
});
};
/*
* Author: 黎永顺
* Description: 删除人员范围
* Params:
* Date: 2022/11/30
*/
taxAgentRangeDelete = () => {
Modal.confirm({
title: "信息确认",
content: "确认要删除吗?",
onOk: () => {
const { selectedKey } = this.state;
const API = selectedKey === "listExt" ? taxAgentRangeExtDelete : taxAgentRangeDelete;
API(this.state.rowKeys).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.setState({ rowKeys: [] }, () => {
this.personalScopeTableRef.clearRowkeys();
});
} else {
message.error(errormsg || "删除失败");
}
});
}
});
};
/*
* Author: 黎永顺
* Description:新增人员范围
* Params:
* Date: 2022/11/30
*/
handleAddPersonal = (record = {}) => {
const { personalAddModal, selectedKey } = this.state;
this.setState({
personalAddModal: {
...personalAddModal, record,
visible: selectedKey !== "listExt",
externalVisible: selectedKey === "listExt",
includeType: selectedKey === "listInclude" ? 1 : 0
}
});
};
handleImportFile = (params) => {
const { taxAgentId } = this.props, { importParams } = this.state;
this.setState({ importParams: { ...importParams, nextloading: true } });
taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, errormsg, data }) => {
this.setState({ importParams: { ...importParams, nextloading: false } });
if (status) {
this.setState({ importParams: { ...importParams, importResult: data } });
} else {
message.warning(errormsg);
}
});
};
/*
* Author: 黎永顺
* Description: 保存非系统人员
* Params:
* Date: 2023/11/9
*/
handleSaveExtPersons = (payload = {}) => {
const { taxAgentId } = this.props;
const { personalAddModal } = this.state;
this.setState({ loading: false });
taxAgentRangeExtSave({ taxAgentId, ...payload }).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success("新增成功");
this.setState({
personalAddModal: {
...personalAddModal,
externalVisible: false
}
}, () => this.personalScopeTableRef.getPersonalScopeList());
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
};
render() {
const { selectedKey, searchValue, rowKeys, personalAddModal, importParams, extEmpsWitch, loading } = this.state;
const { taxAgentStore: { PageAndOptAuth }, taxAgentId } = this.props;
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const topTab = [
{
title: "管理范围",
viewcondition: "listInclude"
},
{
title: "从范围中排除",
viewcondition: "listExclude"
},
{
title: "非系统人员范围",
viewcondition: "listExt"
}
];
const btns = showOperateBtn ? [
<span className="icon-refresh" title={getLabel(111, "导入")} onClick={() => {
this.setState({ importParams: { ...importParams, visible: true } });
}}><i className="icon-coms-leading-in"/></span>,
<WeaButtonIcon
buttonType="del"
type="primary"
disabled={_.isEmpty(rowKeys)}
onClick={this.taxAgentRangeDelete}
/>,
<WeaButtonIcon buttonType="add" type="primary" onClick={() => this.handleAddPersonal()}/>,
<WeaInputSearch
style={{ width: 220 }}
value={searchValue}
onChange={searchValue => this.setState({ searchValue })}
placeholder="请输入对象"
onSearch={() => this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1)}
/>
] : [<WeaInputSearch
style={{ width: 220 }}
value={searchValue}
onChange={searchValue => this.setState({ searchValue })}
placeholder="请输入对象"
onSearch={() => this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1)}
/>];
(selectedKey === "listExclude" || selectedKey === "listExt") && btns.shift();
return (
<div className="personal-scope">
<WeaTab
datas={(extEmpsWitch === "0" || !extEmpsWitch) ? topTab.slice(0, -1) : topTab}
keyParam="viewcondition" //主键
selectedKey={selectedKey}
buttons={btns}
onChange={selectedKey => this.setState({ selectedKey })}
/>
<PersonalScopeTable
ref={dom => this.personalScopeTableRef = dom}
taxAgentId={taxAgentId}
tabActive={selectedKey}
searchValue={searchValue}
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
onEditScope={this.handleAddPersonal}
/>
{/*非系统人员添加*/}
<ExternalPersonModal
visible={personalAddModal.externalVisible} loading={loading}
onCancel={() => this.setState({ personalAddModal: { ...personalAddModal, externalVisible: false } })}
onExternalPersonSave={this.handleSaveExtPersons}
/>
<PersonalScopeModal
{...personalAddModal}
taxAgentId={taxAgentId}
onSuccess={() => this.personalScopeTableRef.getPersonalScopeList()}
onCancel={(callback) =>
this.setState({
personalAddModal: { ...personalAddModal, visible: false, includeType: "", record: {} }
}, () => callback && callback())
}
/>
<ImportDialog {...importParams}
nextCallback={imageId => this.setState({ importParams: { ...importParams, imageId } })}
nextUplaodCallback={imageId => this.handleImportFile({ imageId })}
onResetImportResult={() => this.setState(({
importParams: { ...importParams, importResult: {}, imageId: "" }
}))}
onCancel={(callback) => this.setState({
importParams: { ...importParams, visible: false }
}, () => callback && this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1))}/>
</div>
);
}
}
export default PersonalScope;

View File

@ -0,0 +1,160 @@
/*
* Author: 黎永顺
* name: 新增人员范围弹框
* Description:
* Date: 2022/11/30
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaSwitch } from "comsMobx";
import { WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import { Button, message } from "antd";
import { getTaxAgentRangeForm, taxAgentRangeEdit, taxAgentRangeSave } from "../../../apis/taxAgent";
import { personScopeConditions, scopeSelectLinkageDatas } from "./constants";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore")
@observer
class PersonalScopeModal extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, conditions: [], employeeStatus: []
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initPersonScopeForm();
}
getTaxAgentRangeForm = (props) => {
const { record } = props;
getTaxAgentRangeForm().then(({ status, data }) => {
if (status) {
const { employeeStatus, targetTypeList } = data;
this.setState({
employeeStatus, conditions: _.map(personScopeConditions, item => ({
...item, items: _.map(item.items, o => {
if (getKey(o) === "employeeStatus") {
return {
...o, label: getLabel(o.lanId, o.label), value: !_.isEmpty(record) ? record.status : "",
options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name }))
};
}
return {
...o, label: getLabel(o.lanId, o.label), viewAttr: !_.isEmpty(record) ? 1 : 3,
options: _.map(targetTypeList, it => ({
key: it.id, showname: it.name,
selected: !_.isEmpty(record) ? it.id === record.targetType : it.id === "EMPLOYEE"
})),
selectLinkageDatas: {
..._.reduce(_.keys(scopeSelectLinkageDatas), (pre, cur) => {
if (cur !== "SQL") {
return {
...pre,
[cur]: {
...scopeSelectLinkageDatas[cur],
browserConditionParam: {
...scopeSelectLinkageDatas[cur].browserConditionParam,
isSingle: true,
replaceDatas: !_.isEmpty(record) ? [{
id: String(record.targetId),
name: record.targetName
}] : []
}
}
};
}
return {
...pre, [cur]: { ...scopeSelectLinkageDatas[cur], value: !_.isEmpty(record) ? record.target : "" }
};
}, {})
}
};
})
}))
}, () => this.props.taxAgentStore.personScopeForm.initFormFields(this.state.conditions));
}
});
};
taxAgentRangeSave = () => {
const { taxAgentStore: { personScopeForm }, record = {} } = this.props;
personScopeForm.validateForm().then(f => {
if (f.isValid) {
const { employeeStatus, targetType, target } = personScopeForm.getFormParams();
const { includeType, taxAgentId } = this.props;
const payload = {
includeType, taxAgentId, employeeStatus: employeeStatus.split(","), id: record.id,
targetParams: _.map(target.split(","), it => ({
targetType, targetId: targetType === "SQL" ? "0" : it,
target: targetType === "SQL" ? target : ""
}))
};
this.setState({ loading: true });
const API = !_.isEmpty(record) ? taxAgentRangeEdit : taxAgentRangeSave;
API(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess);
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: true }));
} else {
f.showErrors();
}
});
};
renderForm = () => {
const { taxAgentStore: { personScopeForm } } = this.props;
const { conditions, employeeStatus } = this.state, { isFormInit } = personScopeForm,
formParams = personScopeForm.getFormParams();
const checked = formParams.employeeStatus && _.every(_.map(employeeStatus, o => o.id), k => formParams.employeeStatus.indexOf(k) !== -1);
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={personScopeForm.getError(fields)}
tipPosition="bottom">
{
getKey(fields) === "employeeStatus" &&
<WeaCheckbox value={checked ? "1" : "0"} content={getLabel(111, "全选")}
onChange={this.handleChangeAll}/>
}
<WeaSwitch fieldConfig={fields} form={personScopeForm} formParams={formParams}/>
</WeaFormItem>),
hide: fields.hide
});
});
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
});
return group;
};
handleChangeAll = (val) => {
const { taxAgentStore: { personScopeForm } } = this.props, { employeeStatus } = this.state;
val === "1" ? personScopeForm.updateFields({ employeeStatus: { value: _.map(employeeStatus, o => o.id).join(",") } }) :
personScopeForm.updateFields({ employeeStatus: { value: "" } });
};
render() {
const { title, taxAgentStore: { personScopeForm } } = this.props, { loading } = this.state;
const buttons = [
<Button type="primary" onClick={this.taxAgentRangeSave} loading={loading}>{getLabel(111, "确定")}</Button>,
<Button type="ghost" onClick={() => personScopeForm.resetForm()}>{getLabel(111, "重置")}</Button>
];
return (
<WeaDialog {...this.props} initLoadCss title={title} style={{ width: 600, height: 159 }} buttons={buttons}>
<div className="form-dialog-layout">{this.renderForm()}</div>
</WeaDialog>
);
}
}
export default PersonalScopeModal;

View File

@ -0,0 +1,139 @@
/*
* Author: 黎永顺
* name: 人员范围列表数据
* Description:
* Date: 2022/11/30
*/
import React, { Component } from "react";
import { WeaTable } from "ecCom";
import { getTaxAgentRangeListExclude, getTaxAgentRangeListInclude, taxAgentRangelistExt } from "../../../apis/taxAgent";
import "./index.less";
import { calcPageNo } from "../../../util";
const APIFox = {
listInclude: getTaxAgentRangeListInclude,
listExclude: getTaxAgentRangeListExclude,
listExt: taxAgentRangelistExt
};
class PersonalScopeTable extends Component {
constructor(props) {
super(props);
this.state = {
loading: {
query: false
},
dataSource: [],
columns: [],
selectedRowKeys: [],
pageInfo: {
current: 1,
pageSize: 10,
total: 0
}
};
}
componentDidMount() {
this.getPersonalScopeList();
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.tabActive !== this.props.tabActive) {
this.setState({ selectedRowKeys: [] }, () => {
this.getPersonalScopeList(nextProps.tabActive);
nextProps.onChangeSelectKey([]);
});
}
}
getPersonalScopeList = (tabActive = this.props.tabActive, current) => {
const { searchValue, taxAgentId } = this.props;
const { pageInfo, loading } = this.state;
const payload = {
taxAgentId, targetName: searchValue, ...pageInfo, current: current || pageInfo.current
};
this.setState({ loading: { ...loading, query: true } });
APIFox[tabActive](payload).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
const { pageNum: current, pageSize, total, columns, list: dataSource } = data;
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource,
columns: _.map(columns, item => {
return {
...item,
render: (text, record) => {
if (item.dataIndex === "targetName") {
return <a href="javascript:void(0);" onClick={() => this.props.onEditScope(record)}>{text}</a>;
}
return <span className="tdEllipsis" title={text}>{text}</span>;
}
};
})
});
}
}).catch(() => {
this.setState({ loading: { ...loading, query: false } });
});
};
/*
* Author: 黎永顺
* Description: 清空选中项
* Params:
* Date: 2022/11/30
*/
clearRowkeys = () => {
const { pageInfo, selectedRowKeys } = this.state;
this.setState({
selectedRowKeys: [],
pageInfo: {
...pageInfo,
current: calcPageNo(pageInfo.total, pageInfo.current, 10, selectedRowKeys.length)
}
}, () => {
this.getPersonalScopeList();
});
};
render() {
const { dataSource, columns, pageInfo, loading, selectedRowKeys } = this.state;
const { onChangeSelectKey } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${total}`,
showQuickJumper: true,
pageSizeOptions: ["10", "20", "50", "100"],
onChange: current => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => {
this.getPersonalScopeList();
});
}
};
const rowSelection = {
selectedRowKeys,
onChange: (selectedRowKeys) => {
this.setState({ selectedRowKeys }, () => {
onChangeSelectKey(this.state.selectedRowKeys);
});
}
};
return (
<WeaTable
rowKey="id"
rowSelection={rowSelection}
dataSource={dataSource}
pagination={pagination}
loading={loading.query}
columns={columns}
scroll={{ y: `calc(100vh - 230px)` }}
/>
);
}
}
export default PersonalScopeTable;

View File

@ -0,0 +1,303 @@
/*
* Author: 黎永顺
* name: 新增/编辑个税扣缴义务人
* Description:
* Date: 2022/11/29
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { Button, message, Modal } from "antd";
import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom";
import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions";
import BaseSettings, { convertConditon } from "./baseSettings";
import PersonalScope from "./personalScope";
import TaxDeclarationInfo from "./taxDeclarationInfo";
import TaxFilingInfoDialofg from "./taxFillingInfoDialog";
import WeaTopTitle from "../../../components/custom-title/weaTopTitle";
import WeaReqTitle from "../../../components/custom-title/weaReqTitle";
import * as API from "../../../apis/taxAgent";
import { registrationCheck } from "../../../apis/taxAgent";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
const Step = WeaSteps.Step;
@inject("taxAgentStore")
@observer
class TaxAgentSlide extends Component {
constructor(props) {
super(props);
this.state = {
current: 0, loading: false, verifyLoading: false, taxAgentId: "",
taxFilingInfoDialofg: {
visible: false, title: "", checkPayload: {},
isEdit: false, jumpAll: false, loading: false,
taxAgentTaxReturnCheckFormDTO: null
}
};
this.taxInfoRef = null;
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible || nextProps.decentralization !== this.props.decentralization) {
const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = nextProps;
decentralization === "0" ?
salarytaxAgentForm.setCondition(convertConditon(decentralizationConditions, !isChief), true) :
salarytaxAgentForm.setCondition(convertConditon(editConditions, !isChief), true);
this.setState({ current: nextProps.current, taxAgentId: nextProps.taxAgentId }, () => {
if (this.state.taxAgentId) this.getTaxAgentForm();
});
}
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.setSalarytaxAgentForm();
}
getTaxAgentForm = () => {
const { taxAgentId } = this.state;
const { taxAgentStore: { salarytaxAgentForm } } = this.props;
API.getTaxAgentForm({ id: taxAgentId }).then(({ status, data }) => {
if (status) {
const { name, description, adminUserIds, sortedIndex } = data;
salarytaxAgentForm.updateFields({
name: { value: name },
adminUserIds: {
value: _.map(adminUserIds, it => it.id.toString()).join(","),
valueSpan: _.map(adminUserIds, it => it.content).join(",")
},
sortedIndex: { value: sortedIndex },
description: { value: description }
});
}
});
};
/*
* Author: 黎永顺
* Description: 保存个税扣缴义务人
* Params:
* Date: 2022/12/1
*/
saveTaxAgent = (payload) => {
const { onOk, salaryOn } = this.props;
const { current } = this.state;
this.setState({ loading: true });
API.saveTaxAgent(payload).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(22619, "保存成功"));
this.setState({
current: !salaryOn ? current + 2 : current + 1,
taxAgentId: data
}, () => onOk());
} else {
message.error(errormsg || getLabel(22620, "保存失败"));
}
}).catch(() => this.setState({ loading: false }));
};
/*
* Author: 黎永顺
* Description: 编辑个税扣缴义务人
* Params:
* Date: 2022/12/1
*/
updateTaxAgent = (payload) => {
const { onCancel } = this.props;
this.setState({ loading: true });
API.updateTaxAgent(payload).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(31439, "更新成功"));
onCancel(true);
} else {
message.error(errormsg || getLabel(31825, "更新失败"));
}
}).catch(() => this.setState({ loading: false }));
};
handleSave = () => {
const { taxAgentStore: { salarytaxAgentForm } } = this.props;
const { taxAgentId } = this.state;
salarytaxAgentForm.validateForm().then((f) => {
if (f.isValid) {
const formData = salarytaxAgentForm.getFormParams();
const payload = {
...formData,
adminUserIds: formData.adminUserIds ? formData.adminUserIds.split(",") : []
};
taxAgentId ? this.updateTaxAgent({ ...payload, id: taxAgentId }) : this.saveTaxAgent(payload);
} else {
f.showErrors();
}
});
};
handleSaveAndVerify = (jumpAll = false) => {
const { isEdit } = this.props, { taxAgentId, taxFilingInfoDialofg } = this.state;
const { fieldForm, fieldItem } = this.taxInfoRef.state;
const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm;
const boolean = _.every(_.filter(fieldItem, item => item.viewAttr === 3), it => fieldForm[it.key]);
if (!boolean) {
Modal.warning({
title: getLabel(131329, "信息确认"),
content: getLabel(518702, "必要信息不完整,红色*为必填项!")
});
return;
}
const [nation, province, city] = cityStr ? cityStr.split("-") : [];
const proBool = _.every(cityStr ? cityStr.split("-") : [], it => it !== "undefined");
if (!proBool) {
Modal.warning({
title: getLabel(131329, "信息确认"),
content: getLabel(111, "请展开选择报税所属区域!")
});
return;
}
// requestType: 1:保存并验证 2保存
const payload = {
...extra, nation, province, city,
taxAgentId, requestType: 1, password: netPassword || realNamePassword,
cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : ""
};
this.setState({ verifyLoading: true });
API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, data, errormsg }) => {
this.setState({ verifyLoading: false });
if (status) {
message.success(getLabel(22619, "保存成功!"));
this.setState({
taxFilingInfoDialofg: {
...taxFilingInfoDialofg, visible: true,
isEdit, jumpAll, title: fieldForm.name, checkPayload: payload,
taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO || data.table.list
}
});
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
}).catch(() => this.setState({ verifyLoading: false }));
};
handleSubmit = (selectKey) => {
const { taxFilingInfoDialofg, taxAgentId } = this.state;
const { fieldForm } = this.taxInfoRef.state;
const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm;
const [nation, province, city] = cityStr ? cityStr.split("-") : [];
const { taxAgentTaxReturnCheckFormDTO } = taxFilingInfoDialofg;
this.setState({
taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: true }
});
registrationCheck({
...extra, nation, province, city,
taxAgentId, password: netPassword || realNamePassword,
cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : "",
..._.find(taxAgentTaxReturnCheckFormDTO, it => it.index === selectKey)
}).then(({ status, data, errormsg }) => {
this.setState({
taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false }
});
if (status) {
message.success(getLabel(22619, "保存成功!"));
this.setState({
taxFilingInfoDialofg: {
...taxFilingInfoDialofg,
taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO
}
});
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
}).catch(() => {
this.setState({
taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false }
});
});
};
render() {
const {
isEdit, title, visible, onCancel, salaryOn, decentralization, isChief, taxAgentStore: { PageAndOptAuth }
} = this.props;
const { current, taxAgentId, taxFilingInfoDialofg, loading, verifyLoading } = this.state;
let tabs = [
{
key: 0, title: getLabel(82751, "基础设置"),
createBtns: [
<Button type="primary" onClick={this.handleSave}
loading={loading}>{getLabel(33199, "保存并进入下一步")}</Button>
],
editBtns: [
<Button type="primary" onClick={this.handleSave}
loading={loading}>{getLabel(537558, "保存")}</Button>
],
children: <BaseSettings decentralization={decentralization} isChief={isChief}/>
},
{
key: 1, title: getLabel(544342, "报税信息"),
createBtns: [
<Button type="ghost" loading={verifyLoading}
onClick={() => this.handleSaveAndVerify(true)}>{getLabel(543470, "完成,跳过所有步骤")}</Button>,
<Button type="ghost"
onClick={() => this.setState({ current: current + 1 })}>{getLabel(1402, "下一步")}</Button>
],
editBtns: [
<Button type="primary" loading={verifyLoading}
onClick={() => this.handleSaveAndVerify(false)}>{getLabel(544343, "保存并验证")}</Button>
],
children: <TaxDeclarationInfo ref={dom => this.taxInfoRef = dom} taxAgentId={taxAgentId} isChief={isChief}/>
},
{
key: 2, title: getLabel(124810, "人员范围"),
createBtns: [
<Button type="ghost"
onClick={() => this.setState({ current: !salaryOn ? current - 2 : current - 1 })}>{getLabel(1876, "上一步")}</Button>
],
editBtns: [],
children: <PersonalScope taxAgentId={taxAgentId}/>
}
];
tabs = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs;
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
return (
<WeaSlideModal
className="taxAgentSlide" visible={visible} top={0} width={65} height={100} measure="%" direction="right"
title={
!this.props.taxAgentId ?
<WeaTopTitle title={title} buttons={_.find(tabs, o => current === o.key).createBtns}/> :
<WeaReqTitle buttons={showOperateBtn ? _.find(tabs, o => current === o.key).editBtns : []}
tabDatas={tabs} selectedKey={String(current)} title={title}
onChange={cur => this.setState({ current: parseInt(cur) })}/>
}
content={
<div className="taxAgentSlideContent">
{
!isEdit &&
<WeaSteps current={current} style={{ margin: "20px 0" }}>
{
_.map(tabs, item => {
const { key, title } = item;
return <Step description={title} key={key}/>;
})
}
</WeaSteps>
}
{_.find(tabs, o => current === o.key).children}
<TaxFilingInfoDialofg
{...taxFilingInfoDialofg}
onSubmit={this.handleSubmit}
onCancel={(isRefresh) => {
const { jumpAll } = taxFilingInfoDialofg;
this.setState({
current: jumpAll ? this.state.current + 1 : this.state.current,
taxFilingInfoDialofg: {
...taxFilingInfoDialofg, visible: false,
taxAgentTaxReturnCheckFormDTO: null
}
}, () => {
isRefresh && this.taxInfoRef.taxReturnGetForm();
jumpAll && this.props.onCancel(true);
});
}}
/>
</div>
}
onClose={() => onCancel()}
/>
);
}
}
export default TaxAgentSlide;

View File

@ -0,0 +1,137 @@
/*
* Author: 黎永顺
* name: 个税扣缴义务人列表
* Description:
* Date: 2022/11/29
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import { Dropdown, Menu } from "antd";
import * as API from "../../../apis/taxAgent";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
class TaxAgentTable extends Component {
constructor(props) {
super(props);
this.state = {
loading: {
query: false
},
dataSource: [],
columns: [],
pageInfo: {
current: 1,
pageSize: 10,
total: 0
}
};
}
componentDidMount() {
this.getTaxAgentList();
}
getTaxAgentList = () => {
const { pageInfo, loading } = this.state;
const { searchValue, onOperate } = this.props;
const payload = {
name: searchValue,
...pageInfo
};
this.setState({ loading: { ...loading, query: true } });
API.getTaxAgentList(payload).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
const { pageNum: current, pageSize, total, columns, list: dataSource } = data;
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource,
columns: _.map(columns, item => {
if (item.dataIndex === "employeeRange") {
return {
...item,
render: (text, record) => {
return <a href="javaScript:void(0);" onClick={() => onOperate("edit", record.id, 2)}>{text}</a>;
}
};
}
return {
...item,
render: (text) => {
return <span className="tdEllipsis" title={text}>{text}</span>;
}
};
})
});
}
}).catch(() => {
this.setState({ loading: { ...loading, query: false } });
});
};
render() {
const { dataSource, columns, pageInfo, loading } = this.state;
const { onOperate, isChief } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({
pageInfo: { ...pageInfo, current, pageSize }
}, () => {
this.getTaxAgentList();
});
},
onChange: current => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => {
this.getTaxAgentList();
});
}
};
return (
<WeaTable
dataSource={dataSource}
pagination={pagination}
loading={loading.query}
columns={[
...columns,
{
title: getLabel(30585, "操作"),
key: "operation",
width: 120,
render: (text, record) =>
<div className="operationWapper">
<a href="javaScript:void(0);" style={{ marginRight: 10 }}
onClick={() => onOperate("edit", record.id)}>{getLabel(501169, "编辑")}</a>
{
isChief &&
<a href="javaScript:void(0);" style={{ marginRight: 10 }}
onClick={() => onOperate("delete", record.id)}>{getLabel(535052, "删除")}</a>
}
<Dropdown
overlay={
<Menu>
<Menu.Item>
<a href="javascript:void(0)"
onClick={() => onOperate("log", record.id)}>{getLabel(545781, "操作日志")}</a>
</Menu.Item>
</Menu>
}>
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
</Dropdown>
</div>
}
]}
/>
);
}
}
export default TaxAgentTable;

View File

@ -0,0 +1,146 @@
/*
* Author: 黎永顺
* name: 报税信息
* Description:
* Date: 2022/12/1
*/
import React, { Component } from "react";
import { WeaBrowser, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom";
import { fieldList } from "./constants";
import { taxReturnGetForm } from "../../../apis/taxAgent";
const { getLabel } = WeaLocaleProvider;
class TaxDeclarationInfo extends Component {
constructor(props) {
super(props);
this.state = {
fieldForm: {
name: "",
taxCode: "",
city: "",
cityVal: [],
areaCode: null,
passwordType: "TAX_NET_PASSWORD",
account: "",
realNamePassword: "",
netPassword: null,
taxRegistrationNumber: "",
departmentCode: "",
checkStatus: ""
},
fieldItem: []
};
}
componentDidMount() {
this.setState({
fieldItem: _.filter(_.map(fieldList, item => ({
...item,
label: getLabel(item.lanId, item.label),
viewAttr: this.props.isChief ? item.viewAttr : 1
})), it => it.key !== "account" && it.key !== "realNamePassword")
}, () => {
this.taxReturnGetForm();
});
}
taxReturnGetForm = () => {
const { taxAgentId } = this.props;
taxReturnGetForm({ taxAgentId }).then(({ status, data }) => {
if (status) {
const { fieldForm } = this.state;
this.setState({
fieldForm: {
...fieldForm,
..._.reduce(_.keys(fieldForm), (pre, cur) => {
if (cur !== "city") {
if (cur === "checkStatus") {
const checkStatusMap = {
"NOT_COMMIT": getLabel(111, "未验证"),
"SUCCESS": getLabel(111, "成功"),
"FAIL": getLabel(111, "失败")
};
return { ...pre, [cur]: checkStatusMap[data[cur]] };
}
return { ...pre, [cur]: data[cur] };
}
return {
...pre,
[cur]: `${data["nation"]}-${data["province"]}-${data[cur]}`
};
}, {}),
cityVal: (data["city"] && data["cityName"]) ? [{ id: data["city"], name: data["cityName"] }] : []
}
});
}
});
};
handleChangeValue = (key, value, cityVal = []) => {
const { fieldForm } = this.state;
this.setState({
fieldForm: !_.isEmpty(cityVal) ? {
...fieldForm, [key]: value, cityVal
} : { ...fieldForm, [key]: value }
}, () => {
if (key === "passwordType" && this.state.fieldForm.passwordType === "REAL_NAME_PASSWORD") {
this.setState({
fieldItem: _.filter(fieldList, it => it.key !== "netPassword"),
fieldForm: { ...this.state.fieldForm, account: null, realNamePassword: null, netPassword: null }
});
} else if (key === "passwordType" && this.state.fieldForm.passwordType === "TAX_NET_PASSWORD") {
this.setState({
fieldItem: _.filter(fieldList, it => it.key !== "account" && it.key !== "realNamePassword"),
fieldForm: { ...this.state.fieldForm, netPassword: null, account: null, realNamePassword: null }
});
}
});
};
render() {
const { fieldItem, fieldForm } = this.state;
return (
<div className="taxDeclarationInfoWrapper">
<WeaSearchGroup col={1} needTigger showGroup>
{
_.map(fieldItem, item => {
const { key, label, type, viewAttr, options = [] } = item;
return <WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 14 }} key={key}>
{
(type === "TEXT" || type === "PASSWORD") &&
<WeaInput autocomplete="off" value={fieldForm[key]} type={_.lowerCase(type)} viewAttr={viewAttr}
onChange={(v) => this.handleChangeValue(key, v)}/>
}
{
type === "SELECT" &&
<WeaBrowser replaceDatas={fieldForm["cityVal"]} type={58} viewAttr={viewAttr}
helpfulTip={getLabel(111, "请展开选择报税所属区域")}
onChange={(__, ___, datas) => {
if (!_.isEmpty(datas)) {
this.handleChangeValue(key, `1-${datas[0].pid}-${datas[0].id}`, _.map(datas, it => ({
id: it.id,
name: it.name
})));
} else {
this.handleChangeValue(key, "", []);
}
}}
/>
}
{
type === "RADIO" &&
<WeaSelect detailtype={3} value={fieldForm[key]}
options={_.map(options, it => ({ ...it, showname: getLabel(it.lanId, it.showname) }))}
viewAttr={viewAttr}
onChange={(v) => this.handleChangeValue(key, v)}/>
}
</WeaFormItem>;
})
}
</WeaSearchGroup>
</div>
);
}
}
export default TaxDeclarationInfo;

View File

@ -0,0 +1,132 @@
/*
* Author: 黎永顺
* name: 个税申报-异常失败详情
* Description:
* Date: 2023/8/18
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
import { Button, message } from "antd";
import { deptFillCondition, taxFillColumns, taxFillCondition } from "./constants";
import { getSearchs } from "../../../util";
import { saveDepartmentCodeAndCheck } from "../../../apis/taxAgent";
const { getLabel } = WeaLocaleProvider;
@inject("taxAgentStore")
@observer
class TaxFilingInfoDialofg extends Component {
constructor(props) {
super(props);
this.state = {
selectedRowKeys: [], checkLoading: false
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (!_.isEmpty(nextProps.taxAgentTaxReturnCheckFormDTO) &&
Object.prototype.toString.call(nextProps.taxAgentTaxReturnCheckFormDTO) === "[object Object]"
) {
const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm, deptfillInfoForm } } = nextProps;
taxfillInfoForm.initFormFields(taxFillCondition);
deptfillInfoForm.initFormFields(deptFillCondition);
const fields = _.map(taxFillCondition[0].items, it => {
return it.domkey[0];
});
fields.map(item => {
taxfillInfoForm.updateFields({
[item]: item !== "divideFiling" ? (taxAgentTaxReturnCheckFormDTO[item] || "") : (taxAgentTaxReturnCheckFormDTO[item] === "ON" ? getLabel(538048, "是") : getLabel(30587, "否"))
});
});
}
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
const { taxAgentStore: { setTaxfillInfoForm, initDeptfillInfoForm } } = nextProps;
setTaxfillInfoForm();
initDeptfillInfoForm();
}
}
handleSaveOrKnow = () => {
const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, checkPayload } = this.props;
if (taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是")) {
deptfillInfoForm.validateForm().then(f => {
if (f.isValid) {
this.setState({ checkLoading: true });
saveDepartmentCodeAndCheck(_.omitBy({ ...checkPayload, ...deptfillInfoForm.getFormParams() }, val => _.isNil(val)))
.then(({ status, errormsg }) => {
this.setState({ checkLoading: false });
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.props.onCancel(true);
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ checkLoading: false }));
} else {
f.showErrors();
}
});
} else {
this.props.onCancel();
}
};
render() {
const { selectedRowKeys, checkLoading } = this.state;
const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, taxAgentTaxReturnCheckFormDTO, loading } = this.props;
const rowSelection = {
type: "radio",
selectedRowKeys,
onChange: selectedRowKeys => this.setState({ selectedRowKeys })
};
return (
<WeaDialog
{...this.props}
hasScroll className="taxfillingDialog" initLoadCss
buttons={
Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ?
[
<Button type="primary" onClick={this.handleSaveOrKnow} loading={checkLoading}>
{taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") ? getLabel(537558, "保存") : getLabel(545147, "知道了")}
</Button>
] : [
<Button loading={loading} type="primary"
onClick={() => !_.isEmpty(selectedRowKeys) && this.props.onSubmit(selectedRowKeys[0])}>{getLabel(725, "提交")}</Button>
]
}
style={{
width: 850,
height: 480,
minHeight: 200,
minWidth: 380,
maxHeight: "50%",
maxWidth: "50%",
overflow: "hidden",
transform: "translate(0px, 0px)"
}}
>
<div className="taxfillingDialogContent">
{
Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ?
<React.Fragment>
{getSearchs(taxfillInfoForm, taxFillCondition, 1)}
{taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") && getSearchs(deptfillInfoForm, deptFillCondition, 1)}
</React.Fragment> :
<WeaTable
rowKey="index" dataSource={taxAgentTaxReturnCheckFormDTO}
columns={_.map(taxFillColumns, o => ({
dataIndex: o.dataIndex,
width: 200,
title: getLabel(o.titleId, o.title)
}))}
scroll={{ x: 1200 }} rowSelection={rowSelection}
/>
}
</div>
</WeaDialog>
);
}
}
export default TaxFilingInfoDialofg;

View File

@ -0,0 +1,101 @@
.salaryAgentWrapper {
.wea-new-top-content {
background: #f6f6f6;
padding: 8px 16px 0;
}
.wea-new-top {
.wea-input-focus {
height: 31.36px;
line-height: 0;
}
}
.comContent {
.wea-search-group:first-child {
margin-bottom: 16px;
}
.wea-search-group {
padding: 0;
background: #fff;
.wea-title {
padding: 0 10px;
}
.wea-content {
padding: 0;
.wea-form-item {
padding-left: 18px;
}
}
}
.customTitleWrapper {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.ant-btn {
margin-left: 10px;
border-radius: 0;
padding: 0;
background: transparent;
border: none;
font-size: 20px;
line-height: 20px;
}
.ant-btn.ant-btn-primary[disabled] {
color: #d8d8d8;
}
.ant-btn.ant-btn-primary {
color: #55a1f8;
}
}
.tdEllipsis {
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.ant-col-10 {
span:nth-child(2) {
//margin-top: -6px;
}
}
.taxAgentSlide {
.wea-slide-modal-title {
height: auto;
line-height: normal;
text-align: left;
background: #FFF;
.wea-new-top .ant-col-10 {
padding-right: 45px !important;
}
}
.rodal-close {
z-index: 99;
top: 10px !important;
}
.wea-new-top-req-wapper .wea-new-top-req-title > div:last-child {
right: 45px !important;
}
.wea-slide-modal-content {
height: 100%;
}
}
}

View File

@ -0,0 +1,236 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { Button, message, Modal } from "antd";
import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaSearchGroup, WeaTop } from "ecCom";
import ComHint from "./components/comHint";
import TaxAgentTable from "./components/taxAgentTable";
import TaxAgentSlide from "./components/taxAgentSlide";
import LogDialog from "../../components/logViewModal";
import * as API from "../../apis/taxAgent";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
@inject("taxAgentStore")
@observer
class TaxAgent extends Component {
constructor(props) {
super(props);
this.state = {
syncLoading: false, //同步人员范围loading
searchValue: "",
decentralization: "0", //启用分权
taxAgentSlideProps: {
isEdit: false, visible: false, title: getLabel(543629, "新增个税扣缴义务人"),
taxAgentId: "", current: 0, salaryOn: false
},
logDialogVisible: false,
filterConditions: "[]"
};
this.taxAgentTableRef = null;
}
componentDidMount() {
this.getTaxAgentBaseForm();
}
getTaxAgentBaseForm = () => {
API.getTaxAgentBaseForm().then(({ status, data }) => {
if (status) {
const { devolutionStatus } = data;
this.setState({ decentralization: String(devolutionStatus || 0) });
}
});
};
/*
* Author: 黎永顺
* Description:开启关闭个税扣缴义务人开关
* Params:
* Date: 2022/11/29
*/
taxAgentBaseSave = devolutionStatus => {
this.setState({ decentralization: this.state.decentralization }, () => {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: `${getLabel(33703, "确认")}${devolutionStatus === "0" ? getLabel(26471, "停用") : getLabel(26472, "启用")}${getLabel(524044, "分权")}?`,
onOk: () => {
const paylaod = { devolutionStatus };
const { taxAgentStore } = this.props;
const { taxAgentBaseSave, setSalarytaxAgentForm } = taxAgentStore;
taxAgentBaseSave(paylaod).then(({ status, errormsg }) => {
if (status) {
message.success(`${devolutionStatus === "0" ? "停用" : "启用"}分权成功`);
this.getTaxAgentBaseForm();
this.taxAgentTableRef.getTaxAgentList();
setSalarytaxAgentForm();
} else {
message.error(errormsg || `${devolutionStatus === "0" ? "停用" : "启用"}分权失败`);
}
});
}
});
});
};
/*
* Author: 黎永顺
* Description:
* Params:添加个税扣缴义务人
* Date: 2022/11/29
*/
handleAddTaxAgent = () => {
this.setState({
taxAgentSlideProps: {
...this.state.taxAgentSlideProps,
visible: true, current: 0
}
});
};
/*
* Author: 黎永顺
* Description:启用分权
* Params:
* Date: 2022/12/1
*/
taxAgentRangeSync = () => {
const { taxAgentStore } = this.props;
const { taxAgentRangeSync } = taxAgentStore;
this.setState({ syncLoading: true });
taxAgentRangeSync({}).then(({ status, data, errormsg }) => {
this.setState({ syncLoading: false });
if (status) {
message.success(data || getLabel(30700, "操作成功"));
this.taxAgentTableRef.getTaxAgentList();
} else {
message.error(data || errormsg || getLabel(30651, "操作失败"));
}
});
};
handelResetSlide = (isUpdate = false) => {
const { taxAgentStore } = this.props;
const { salarytaxAgentForm } = taxAgentStore;
this.setState({
taxAgentSlideProps: {
...this.state.taxAgentSlideProps,
isEdit: false,
visible: false,
title: getLabel(543629, "新增个税扣缴义务人"),
taxAgentId: "",
current: 0
}
}, () => {
isUpdate && this.taxAgentTableRef.getTaxAgentList();
salarytaxAgentForm.resetForm();
});
};
handleOperate = (type, itemId, current = 0) => {
switch (type) {
case "edit":
this.setState({
taxAgentSlideProps: {
...this.state.taxAgentSlideProps,
visible: true, title: getLabel(543632, "编辑个税扣缴义务人"),
taxAgentId: itemId, current, isEdit: true
}
});
break;
case "delete":
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(388758, "确认要删除吗?"),
onOk: () => {
API.deleteTaxAgent([itemId]).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(502230, "删除成功"));
this.taxAgentTableRef.getTaxAgentList();
} else {
message.error(errormsg || getLabel(20462, "删除失败"));
}
});
}
});
break;
case "log":
this.setState({
logDialogVisible: true,
filterConditions: itemId ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${itemId}\"}]` : "[]"
});
break;
default:
break;
}
};
render() {
const { taxAgentStore: { PageAndOptAuth: permission } } = this.props;
const {
searchValue, decentralization, taxAgentSlideProps, syncLoading, logDialogVisible, filterConditions
} = this.state;
const btns = [
<Button type="primary" onClick={this.taxAgentRangeSync}
loading={syncLoading}>{getLabel(543633, "同步人员范围")}</Button>,
<WeaInputSearch
style={{ width: 220 }}
value={searchValue}
onChange={searchValue => this.setState({ searchValue })}
placeholder={getLabel(543634, "请输入个税扣缴义务人名称")}
onSearch={() => this.taxAgentTableRef.getTaxAgentList()}
/>
];
const customTitle = <div className="customTitleWrapper">
<span>{getLabel(537996, "个税扣缴义务人")}</span>
{
permission.isChief &&
<Button type="primary" size="small" onClick={this.handleAddTaxAgent}>
<span className="icon-coms-Add-to-hot" title={getLabel(384113, "添加")}></span>
</Button>
}
</div>;
const showOperateBtn = permission.opts.includes("admin");
return (
<div className="salaryAgentWrapper">
<WeaTop
title={getLabel(537996, "个税扣缴义务人")}
icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D"
buttons={showOperateBtn ? btns : btns.slice(1)}
showDropIcon onDropMenuClick={key => this.handleOperate(key)}
dropMenuDatas={[
{
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(545781, "操作日志")
}
]}
>
<div className="comContent">
{
permission.isChief &&
<WeaSearchGroup title={getLabel(82743, "基础信息")} showGroup needTigger={false}>
<WeaFormItem label={getLabel(543639, "启用分权")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaCheckbox value={decentralization} display="switch" onChange={this.taxAgentBaseSave}/>
</WeaFormItem>
</WeaSearchGroup>
}
<WeaSearchGroup title={customTitle} showGroup needTigger={false}>
<TaxAgentTable searchValue={searchValue} onOperate={this.handleOperate}
isChief={permission.isChief} //isChief- 是否是总管理员
ref={dom => this.taxAgentTableRef = dom}/>
</WeaSearchGroup>
</div>
<ComHint/>
<TaxAgentSlide
{...taxAgentSlideProps}
isChief={permission.isChief} //isChief- 是否是总管理员
decentralization={decentralization} //是否开启分权 0否 1是 ;开启分权才有管理员的添加
onOk={() => this.taxAgentTableRef.getTaxAgentList()}
onCancel={(isUpdate = false) => this.handelResetSlide(isUpdate)}
/>
{/*操作日志*/}
<LogDialog visible={logDialogVisible} logFunction="taxagent" filterConditions={filterConditions}
onCancel={() => this.setState({ logDialogVisible: false })}/>
</WeaTop>
</div>
);
}
}
export default TaxAgent;

View File

@ -5,9 +5,8 @@ import { WeaSwitch } from "comsMobx";
import FormalFormModal from "./formalFormModal";
import { salaryItemConditions } from "./columns";
import { commonEnumList } from "../../apis/archive";
import { postFetch } from "../../util/request";
import { getItemForm } from "../../apis/item";
import { getTaxAgentSelectList } from "../../apis/taxAgent";
const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey;
@ -44,7 +43,7 @@ export default class CustomSalaryItemSlide extends React.Component {
};
const [{ data: sharedTypeList }, { data: taxAgentList }] = await Promise.all([
commonEnumList({ enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }),
getTaxAgentSelectList()
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" })
]);
this.setState({
conditions: _.map(salaryItemConditions, c => {
@ -63,8 +62,8 @@ export default class CustomSalaryItemSlide extends React.Component {
break;
case "taxAgentIds":
fields = {
...fields, options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content })),
hide: String(salaryItemForm["sharedType"]) === "0" || _.isNil(salaryItemForm["sharedType"])
...fields, options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name })),
hide: String(salaryItemForm["sharedType"]) === "0" || !_.isNil(salaryItemForm["sharedType"])
};
break;
case "dataType":

View File

@ -119,8 +119,8 @@ export default class SalaryItem extends React.Component {
break;
case "customAdd":
case "edit":
const { taxAgentStore: { showOperateBtn } } = this.props;
const { loading } = this.state;
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" ? [
@ -153,11 +153,12 @@ export default class SalaryItem extends React.Component {
};
render() {
const { taxAgentStore: { showOperateBtn } } = this.props;
const { taxAgentStore: { PageAndOptAuth } } = this.props;
const {
selectedRowKeys, logDialogVisible, filterConditions, name, isQuery, customItemDialog, sysVisible,
salaryItemImpDialog
} = this.state;
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const menu = (
<Menu onClick={({ key }) => this.onDropMenuClick(key)}>
<Menu.Item key="sysAdd">{getLabel(111, "新增系统薪资项")}</Menu.Item>

View File

@ -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 }));

View File

@ -8,45 +8,51 @@ 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";
const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey;
@inject("standingBookStore") @observer
@inject("standingBookStore")
@observer
class WelfareRecordQuery extends Component {
constructor(props) {
super(props);
this.state = {
conditions: [],
dateRange: [moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), moment(new Date()).endOf("year").format("YYYY-MM")]
dateRange: [
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
moment(new Date()).endOf("year").format("YYYY-MM")
]
};
}
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) => {

View File

@ -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 = {}) => {

View File

@ -60,37 +60,36 @@ class StandingBook extends Component {
progressVisible: true
}, () => {
this.timer = setInterval(() => {
getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization)
.then(({ status, data }) => {
if (status) {
if (!data.status) {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 });
message.error(data.message);
return;
}
if (this.state.progress !== 100) {
this.setState({
progress: (Number(data.progress).toFixed(2)) * 100
});
} else {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 }, () => {
message.success(getLabel(543232, "核算成功"));
this.setState({
accountDialog: { ...this.state.accountDialog, visible: false }
}, () => {
this.wfListRef.wrappedInstance.getWelfareRecordList();
const calcPayload = { ...payload, creator };
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(calcPayload)}`);
});
});
}
} else {
getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization).then(({ status, data }) => {
if (status) {
if (!data.status) {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 });
message.error(data.message);
return;
}
}).catch(() => {
if (this.state.progress !== 100) {
this.setState({
progress: (Number(data.progress).toFixed(2)) * 100
});
} else {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 }, () => {
message.success(getLabel(543232, "核算成功"));
this.setState({
accountDialog: { ...this.state.accountDialog, visible: false }
}, () => {
this.wfListRef.getWelfareRecordList();
const calcPayload = { ...payload, creator };
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(calcPayload)}`);
});
});
}
} else {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 });
}
}).catch(() => {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 });
});
@ -120,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>];
@ -138,7 +138,7 @@ class StandingBook extends Component {
onSearch={(payload) => {
this.setState({
queryForm: { ...queryForm, ...payload }
}, () => this.wfListRef.wrappedInstance.getWelfareRecordList());
}, () => this.wfListRef.getWelfareRecordList());
}}
onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })}
/>

View File

@ -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 }))
};
})
};

View File

@ -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 }));

Some files were not shown because too many files have changed in this diff Show More