custom/美之高
This commit is contained in:
parent
8eadce0ce3
commit
57272b9077
|
|
@ -227,6 +227,7 @@ class EditCalcTable extends Component {
|
|||
}
|
||||
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const { mzgOptPermission } = this.props;
|
||||
const i18n = {
|
||||
"操作": getLabel(30585, "操作"), "编辑": getLabel(501169, "编辑"),
|
||||
"点击锁定所有解锁的项目值": getLabel(543649, "点击锁定所有解锁的项目值"),
|
||||
|
|
@ -242,13 +243,13 @@ class EditCalcTable extends Component {
|
|||
};
|
||||
this.setState({ originPayloadData: { ...payload, i18n } });
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n, mzgOptPermission }), "*");
|
||||
};
|
||||
queryCalcResultList = () => {
|
||||
const { pageInfo } = this.state;
|
||||
const {
|
||||
calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId },
|
||||
calcDetail = false
|
||||
calcDetail = false, mzgOptPermission = false
|
||||
} = this.props;
|
||||
const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams();
|
||||
const payload = {
|
||||
|
|
@ -262,8 +263,16 @@ class EditCalcTable extends Component {
|
|||
acctResultList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, pageInfo: list } = data;
|
||||
let { columns, pageInfo: list } = data;
|
||||
const { list: dataSource, pageNum: current, pageSize, total } = list;
|
||||
// 美之高操作权限
|
||||
columns = _.map(columns, it => {
|
||||
if (!_.isEmpty(it.children)) {
|
||||
return { ...it, children: _.map(it.children, o => ({ ...o, mzgOptPermission })), mzgOptPermission };
|
||||
}
|
||||
return { ...it, mzgOptPermission };
|
||||
});
|
||||
|
||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => {
|
||||
const { pageInfo, selectedRowKeys } = this.state;
|
||||
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
|
||||
|
|
@ -331,13 +340,17 @@ const traverse = (arr, calcDetail) => {
|
|||
return {
|
||||
title: item.text, width: item.width + "px", ellipsis: true, calcDetail,
|
||||
dataIndex: item.column, children: traverse(item.children, calcDetail),
|
||||
fixed: item.fixed || false, dataType: item.dataType, align: "center"
|
||||
fixed: item.fixed || false, dataType: item.dataType, align: "center",
|
||||
//美之高操作权限
|
||||
mzgOptPermission: item.mzgOptPermission
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
title: item.text, width: item.width + "px", fixed: item.fixed || false,
|
||||
dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus, calcDetail,
|
||||
pattern: item.pattern, dataType: item.dataType, align: "center"
|
||||
pattern: item.pattern, dataType: item.dataType, align: "center",
|
||||
//美之高操作权限
|
||||
mzgOptPermission: item.mzgOptPermission
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ class Index extends Component {
|
|||
renderReqBtns = () => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { selectedKey, accountExceptInfo, approvalInfo } = this.state;
|
||||
const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo;
|
||||
const { isOpenApproval, approvalWorkflowUrl, canEdit, hideEdit } = approvalInfo;
|
||||
let reqBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "calc":
|
||||
|
|
@ -164,7 +164,7 @@ class Index extends Component {
|
|||
);
|
||||
const moreMenu = (
|
||||
<Menu onClick={this.handleMoreMenuClick}>
|
||||
{canEdit && <Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>}
|
||||
{canEdit && !hideEdit && <Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>}
|
||||
<Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item>
|
||||
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
|
||||
<Menu.Item key="offlineCompare">{getLabel(543249, "线下对比")}</Menu.Item>
|
||||
|
|
@ -203,14 +203,15 @@ class Index extends Component {
|
|||
};
|
||||
renderContent = () => {
|
||||
const { selectedKey, approvalInfo } = this.state;
|
||||
const { canEdit } = approvalInfo;
|
||||
const { canEdit, hideEdit } = approvalInfo;
|
||||
let dom = null;
|
||||
switch (selectedKey) {
|
||||
case "person":
|
||||
dom = <SalaryCalcPersonConfirm calcDetail={!canEdit} {...this.props}/>;
|
||||
break;
|
||||
case "calc":
|
||||
dom = <SalaryEditCalc {...this.props} calcDetail={!canEdit} ref={dom => this.calc = dom}/>;
|
||||
dom = <SalaryEditCalc {...this.props} calcDetail={!canEdit} mzgOptPermission={hideEdit}
|
||||
ref={dom => this.calc = dom}/>;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue