产品-薪资核算详情页面以及薪资核算的线下对比页面添加查看权限功能
This commit is contained in:
parent
b77aad0e42
commit
9ed8b79e64
|
|
@ -564,3 +564,7 @@ export const cacheImportField = (params) => {
|
|||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
//薪资核算-页面查看权限
|
||||
export const salaryacctAcctresultCheckAuth = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/checkAuth", "GET", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import CustomTab from "../../components/customTab";
|
|||
import { inject, observer } from "mobx-react";
|
||||
import CompareDetailImportModal from "./compareDetailImportModal";
|
||||
import CustomPaginationTable from "../../components/customPaginationTable";
|
||||
import { salaryacctAcctresultCheckAuth } from "../../apis/calculate";
|
||||
import Authority from "../mySalary/authority";
|
||||
|
||||
@inject("calculateStore")
|
||||
@observer
|
||||
|
|
@ -17,7 +19,8 @@ export default class CompareDetail extends React.Component {
|
|||
onlyDiffEmployee: true,
|
||||
onlyDiffSalaryItem: true,
|
||||
importModalVisible: false,
|
||||
searchValue: ""
|
||||
searchValue: "",
|
||||
calculateAuth: false
|
||||
};
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
}
|
||||
|
|
@ -33,8 +36,15 @@ export default class CompareDetail extends React.Component {
|
|||
current: 1
|
||||
};
|
||||
fetchComparisonResultList(params);
|
||||
this.salaryacctAcctresultCheckAuth({ salaryAcctRecordId: getQueryString("id") })
|
||||
}
|
||||
|
||||
salaryacctAcctresultCheckAuth = (params) => {
|
||||
salaryacctAcctresultCheckAuth(params).then(({ status, data }) => {
|
||||
this.setState({ calculateAuth: data && status });
|
||||
});
|
||||
};
|
||||
|
||||
getColumns = (columns) => {
|
||||
let newColumns = [...columns];
|
||||
newColumns.map(item => {
|
||||
|
|
@ -169,7 +179,7 @@ export default class CompareDetail extends React.Component {
|
|||
comparisonResultColumns
|
||||
}
|
||||
} = this.props;
|
||||
const { importModalVisible, searchValue } = this.state;
|
||||
const { importModalVisible, searchValue, calculateAuth } = this.state;
|
||||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{ display: "inline-block" }}>
|
||||
|
|
@ -203,60 +213,63 @@ export default class CompareDetail extends React.Component {
|
|||
);
|
||||
};
|
||||
return (
|
||||
<div className="compareDetail">
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
leftOperation={
|
||||
renderLeftOperation()
|
||||
}
|
||||
/>
|
||||
<div className="titleBarWrapper">
|
||||
<div className="titleBar">
|
||||
<span className="leftTitle">公式=</span>
|
||||
<span className="rightTitle">系统值;线下值;<span style={{ color: "red" }}>差值</span></span>
|
||||
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
|
||||
store={{ loading: false, hasRight: calculateAuth }}>
|
||||
<div className="compareDetail">
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
leftOperation={
|
||||
renderLeftOperation()
|
||||
}
|
||||
/>
|
||||
<div className="titleBarWrapper">
|
||||
<div className="titleBar">
|
||||
<span className="leftTitle">公式=</span>
|
||||
<span className="rightTitle">系统值;线下值;<span style={{ color: "red" }}>差值</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="tableWrapper">
|
||||
<CustomPaginationTable
|
||||
loading={loading}
|
||||
dataSource={comparisonResultPageInfo.list ? comparisonResultPageInfo.list : []}
|
||||
columns={this.getColumns(comparisonResultColumns ? comparisonResultColumns : [])}
|
||||
scroll={{
|
||||
x: this.getColumns(comparisonResultColumns ? comparisonResultColumns : []).length * 150,
|
||||
y: `calc(100vh - 199px)`
|
||||
}}
|
||||
total={comparisonResultPageInfo.total}
|
||||
current={comparisonResultPageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
onPageChange={(value) => {
|
||||
this.pageInfo.current = value;
|
||||
this.handleDataPageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = { current, pageSize };
|
||||
this.handleShowSizeChange(this.pageInfo);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="tableWrapper">
|
||||
<CustomPaginationTable
|
||||
loading={loading}
|
||||
dataSource={comparisonResultPageInfo.list ? comparisonResultPageInfo.list : []}
|
||||
columns={this.getColumns(comparisonResultColumns ? comparisonResultColumns : [])}
|
||||
scroll={{
|
||||
x: this.getColumns(comparisonResultColumns ? comparisonResultColumns : []).length * 150,
|
||||
y: `calc(100vh - 199px)`
|
||||
}}
|
||||
total={comparisonResultPageInfo.total}
|
||||
current={comparisonResultPageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
onPageChange={(value) => {
|
||||
this.pageInfo.current = value;
|
||||
this.handleDataPageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = { current, pageSize };
|
||||
this.handleShowSizeChange(this.pageInfo);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{
|
||||
importModalVisible && <CompareDetailImportModal
|
||||
visiable={importModalVisible}
|
||||
id={this.id}
|
||||
onFinish={() => {
|
||||
this.handleComparisonFinish();
|
||||
}}
|
||||
onCancel={() => {
|
||||
this.setState({
|
||||
importModalVisible: false
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
{
|
||||
importModalVisible && <CompareDetailImportModal
|
||||
visiable={importModalVisible}
|
||||
id={this.id}
|
||||
onFinish={() => {
|
||||
this.handleComparisonFinish();
|
||||
}}
|
||||
onCancel={() => {
|
||||
this.setState({
|
||||
importModalVisible: false
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</Authority>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchG
|
|||
import { convertToUrlString, getQueryString } from "../../util/url";
|
||||
import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal";
|
||||
import ProgressModal from "../../components/progressModal";
|
||||
import { salaryacctAcctresultCheckAuth } from "../../apis/calculate";
|
||||
import Authority from "../mySalary/authority";
|
||||
|
||||
|
||||
const { ButtonSelect } = WeaDropdown;
|
||||
|
||||
@inject("calculateStore", "salaryFileStore", "taxAgentStore")
|
||||
|
|
@ -33,23 +35,31 @@ export default class CalculateDetail extends React.Component {
|
|||
progressVisible: false,
|
||||
progress: 0,
|
||||
accountIds: [],
|
||||
accountExceptInfo: ""
|
||||
accountExceptInfo: "",
|
||||
calculateAuth: false
|
||||
};
|
||||
this.id = "";
|
||||
this.timer = null;
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
async componentWillMount() {
|
||||
let id = getQueryString("id");
|
||||
this.id = id;
|
||||
const { calculateStore: { checkTaxAgent }, salaryFileStore } = this.props;
|
||||
const { commonEnumList } = salaryFileStore;
|
||||
this.salaryacctAcctresultCheckAuth({ salaryAcctRecordId: id });
|
||||
checkTaxAgent(this.id);
|
||||
let modalParam = { ...this.state.modalParam, salaryAcctRecordId: id };
|
||||
this.setState({ modalParam });
|
||||
commonEnumList("user", { enumClass: "com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum" });
|
||||
}
|
||||
|
||||
salaryacctAcctresultCheckAuth = (params) => {
|
||||
salaryacctAcctresultCheckAuth(params).then(({ status, data }) => {
|
||||
this.setState({ calculateAuth: data && status });
|
||||
});
|
||||
};
|
||||
|
||||
Input = (value, key) => {
|
||||
const { employeeName, workcode } = this.state.searchItemsValue;
|
||||
return (
|
||||
|
|
@ -263,7 +273,7 @@ export default class CalculateDetail extends React.Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { selectedKey, acctResultImportVisiable, showSearchAd } = this.state;
|
||||
const { selectedKey, acctResultImportVisiable, showSearchAd, calculateAuth } = this.state;
|
||||
const { taxAgentStore: { payrollPermission } } = this.props;
|
||||
const menu = (
|
||||
<Menu onClick={this.handleMenuClick.bind(this)}>
|
||||
|
|
@ -346,7 +356,7 @@ export default class CalculateDetail extends React.Component {
|
|||
|
||||
return (
|
||||
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
|
||||
store={{ loading: false, hasRight: payrollPermission }}>
|
||||
store={{ loading: false, hasRight: payrollPermission && calculateAuth }}>
|
||||
<div style={{ overflowY: "hidden", height: "100%" }}>
|
||||
<WeaTab
|
||||
datas={topTab}
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ export class TaxAgentStore {
|
|||
this.setSalaryItemBtn((isOpenDevolution && (isChief || isAdminEnable)));
|
||||
//薪酬统计报表权限
|
||||
this.setStatisticsReportBtn(!isOpenDevolution ? true : !!(isAdminEnable || isChief));
|
||||
//薪资核算详情页面查看权限
|
||||
this.setPayrollPermission(isAdminEnable && isOpenDevolution || !isOpenDevolution);
|
||||
resolve({ status, data });
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue