feature/2.15.1.2407.01-权限
This commit is contained in:
parent
4999cc12bf
commit
f1f4258090
|
|
@ -54,7 +54,7 @@ class LedgerBackCalculatedSalaryItemTable extends Component {
|
|||
render() {
|
||||
const { backCalcEditSlide } = this.state;
|
||||
const { record, dataSource, editId, saveSalarySobId, key } = this.props;
|
||||
const showOperateBtn = record.opts.includes("admin");
|
||||
const showOperateBtn = editId ? record.opts.includes("admin") : true;
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: "name",
|
||||
|
|
@ -76,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>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
loading, extEmpsWitch
|
||||
} = this.state;
|
||||
const { record, editId, saveSalarySobId } = this.props;
|
||||
const admin = record.opts.includes("admin");
|
||||
const admin = editId ? record.opts.includes("admin") : true;
|
||||
const topTab = [
|
||||
{
|
||||
title: "关联人员范围",
|
||||
|
|
|
|||
|
|
@ -67,14 +67,8 @@ class LedgerBackCalculatedSalaryItem extends Component {
|
|||
_.map(backCalcItems, item => {
|
||||
const { key, label, helpContent, dataSource } = item;
|
||||
return (
|
||||
<WeaSearchGroup
|
||||
key={key}
|
||||
needTigger
|
||||
title={
|
||||
<TitleComp title={label} helpContent={helpContent}/>
|
||||
}
|
||||
showGroup
|
||||
>
|
||||
<WeaSearchGroup key={key} needTigger showGroup
|
||||
title={<TitleComp title={label} helpContent={helpContent}/>}>
|
||||
<LedgerBackCalculatedSalaryItemTable
|
||||
{...this.props} dataSource={dataSource}
|
||||
key={key} onRefresh={this.getAggregate}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSelect, WeaTextarea } from "ecCom";
|
||||
import { Col, Row } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { baseSettingFormItem } from "../config";
|
||||
import { getLedgerBasicForm } from "../../../apis/ledger";
|
||||
import {
|
||||
|
|
@ -23,8 +22,6 @@ import { postFetch } from "../../../util/request";
|
|||
import moment from "moment";
|
||||
import "./index.less";
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class LedgerBaseSetting extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -160,10 +157,11 @@ class LedgerBaseSetting extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { editId } = this.props;
|
||||
const { editId, record } = this.props;
|
||||
const { baseForm, settingBaseInfo } = this.state;
|
||||
const { canEdit, taxAgentId } = settingBaseInfo;
|
||||
let taxAgentIdDisabled = false, taxableItemsDisabled = false;
|
||||
const admin = editId ? record.opts.includes("admin") : true;
|
||||
return (
|
||||
<div className="baseSettingWrapper">
|
||||
<Row gutter={20}>
|
||||
|
|
@ -180,10 +178,10 @@ class LedgerBaseSetting extends Component {
|
|||
>
|
||||
{
|
||||
type === "INPUT" ?
|
||||
<WeaInput value={settingBaseInfo[key]} viewAttr={3} disabled={canEdit !== "true"}
|
||||
<WeaInput value={settingBaseInfo[key]} viewAttr={3} disabled={!admin}
|
||||
onChange={(v) => this.handleChangeField(key, v)}/> :
|
||||
type === "TEXTAREA" ?
|
||||
<WeaTextarea value={settingBaseInfo[key]} disabled={canEdit !== "true"}
|
||||
<WeaTextarea value={settingBaseInfo[key]} disabled={!admin}
|
||||
onChange={(v) => this.handleChangeField(key, v)}/> :
|
||||
type === "CHECKBOX" ?
|
||||
<React.Fragment>
|
||||
|
|
@ -194,10 +192,10 @@ class LedgerBaseSetting extends Component {
|
|||
type === "SELECT" ?
|
||||
<WeaSelect value={settingBaseInfo[key]}
|
||||
options={options} viewAttr={3} multiple={multiple}
|
||||
disabled={canEdit !== "true" || taxAgentIdDisabled || taxableItemsDisabled}
|
||||
disabled={!admin || taxAgentIdDisabled || taxableItemsDisabled}
|
||||
onChange={(v) => this.handleChangeField(key, v)}/> :
|
||||
type === "CUSTOM" ?
|
||||
<CustomSelect list={children} baseInfo={settingBaseInfo} inputStr={key}
|
||||
<CustomSelect list={children} baseInfo={settingBaseInfo} inputStr={key} admin={admin}
|
||||
onChange={(key, v) => this.handleChangeField(key, v)}/> : null
|
||||
}
|
||||
</WeaFormItem>;
|
||||
|
|
@ -214,8 +212,7 @@ class LedgerBaseSetting extends Component {
|
|||
export default LedgerBaseSetting;
|
||||
|
||||
const CustomSelect = (props) => {
|
||||
const { list, baseInfo, onChange, inputStr } = props;
|
||||
const { canEdit } = baseInfo;
|
||||
const { list, baseInfo, onChange, inputStr, admin } = props;
|
||||
const selectInfo = buildEditBasicInfo(baseInfo);
|
||||
return <Row gutter={10} key={inputStr}>
|
||||
{
|
||||
|
|
@ -223,8 +220,7 @@ const CustomSelect = (props) => {
|
|||
const { key, options = [] } = item;
|
||||
return <Col span={6}>
|
||||
<WeaSelect value={baseInfo[key]} options={options} viewAttr={3}
|
||||
disabled={canEdit !== "true"}
|
||||
onChange={(v) => onChange(key, v)}/>
|
||||
disabled={!admin} onChange={(v) => onChange(key, v)}/>
|
||||
</Col>;
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class LedgerSalaryAdjustmentRules extends Component {
|
|||
const { record, editId, onSaveParams } = this.props;
|
||||
const { adjustRuleAddModal } = this.state;
|
||||
const { dataSource } = this.state;
|
||||
const showOperateBtn = record.opts.includes("admin");
|
||||
const showOperateBtn = editId ? record.opts.includes("admin") : true;
|
||||
const btns = showOperateBtn ? [
|
||||
<WeaButtonIcon buttonType="add" type="primary" onClick={this.handleAddAdjustRule}/>
|
||||
] : [];
|
||||
|
|
|
|||
|
|
@ -50,12 +50,13 @@ class LedgerSalaryItemBaseInfo extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, onChangeSortableList, onPreview } = this.props;
|
||||
const { dataSource, onChangeSortableList, onPreview, editId, record } = this.props;
|
||||
const { empFieldListOptions } = this.state;
|
||||
const options = _.map(empFieldListOptions, o => ({
|
||||
...o, disabled: _.map(dataSource, g => g.fieldId).includes(o.key)
|
||||
}));
|
||||
if (_.isEmpty(dataSource) || _.isEmpty(options)) return null;
|
||||
const admin = editId ? record.opts.includes("admin") : true;
|
||||
return (
|
||||
<WeaSearchGroup needTigger={false} showGroup title={<TitleComp onPreview={onPreview}/>}>
|
||||
<div className="userInfoWrapper">
|
||||
|
|
@ -80,6 +81,7 @@ class LedgerSalaryItemBaseInfo extends Component {
|
|||
className="wea-sortable-grid-item"
|
||||
/>
|
||||
<WeaSelect
|
||||
disabled={!admin}
|
||||
showSearch
|
||||
options={options}
|
||||
style={{ width: 150 }}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ class LedgerSalaryItemNormal extends Component {
|
|||
incomeCategoriesTitleName,
|
||||
record
|
||||
} = this.props;
|
||||
const showOperateBtn = record.opts.includes("admin");
|
||||
const showOperateBtn = editId ? record.opts.includes("admin") : true;
|
||||
const { categoryModal, addCategoryItemsVisible, moveModalPayload, salaryItemKeywords } = this.state;
|
||||
const newDateSource = _.map(dataSource, item => {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -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 = () => {
|
||||
|
|
|
|||
|
|
@ -54,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 = [
|
||||
|
|
@ -92,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)}
|
||||
/>;
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ class Index extends Component {
|
|||
const {
|
||||
query, dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog
|
||||
} = this.state;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const admin = PageAndOptAuth.opts.includes("admin");
|
||||
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
addRoleDialog: { taxAgentId: "", visible: true }
|
||||
|
|
@ -109,6 +112,8 @@ class Index extends Component {
|
|||
const rowSelection = {
|
||||
selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
!admin && buttons.shift();
|
||||
!admin && buttons.shift();
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(111, "业务线管理")} icon={<i className="icon-coms-Flow-setting"/>}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import SalaryFileDialog from "./components/salaryFileDialog";
|
|||
import SalaryItemList from "./components/salaryItemList";
|
||||
import SalaryFileList from "./components/salaryFileList";
|
||||
import SalaryFileImportDialog from "./components/salaryFileImportDialog";
|
||||
import { postFetch } from "../../util/request";
|
||||
import moment from "moment";
|
||||
import { Button } from "antd";
|
||||
import cs from "classnames";
|
||||
|
|
@ -40,16 +41,17 @@ class Index extends Component {
|
|||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
API.getAdminTaxAgentList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const taxAgentOption = _.map(data, (o, i) => ({ key: String(o.id), showname: o.name }));
|
||||
this.setState({
|
||||
taxAgentOption, taxAgentIds: _.map(taxAgentOption, o => o.key).join(","),
|
||||
SIDialog: { ...this.state.SIDialog, taxAgentOption },
|
||||
SFDialog: { ...this.state.SFDialog, taxAgentOption }
|
||||
});
|
||||
}
|
||||
async componentDidMount() {
|
||||
const [queryTax, adminTax] = await Promise.all([
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }),
|
||||
postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" })
|
||||
]);
|
||||
const taxAgentOption = _.map(adminTax.data, o => ({ key: String(o.id), showname: o.name }));
|
||||
this.setState({
|
||||
taxAgentOption: _.map(queryTax.data, o => ({ key: String(o.id), showname: o.name })),
|
||||
taxAgentIds: _.map(queryTax.data, o => String(o.id)).join(","),
|
||||
SIDialog: { ...this.state.SIDialog, taxAgentOption },
|
||||
SFDialog: { ...this.state.SFDialog, taxAgentOption }
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +96,8 @@ class Index extends Component {
|
|||
const {
|
||||
selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery, salaryMonth, taxAgentOption, taxAgentIds
|
||||
} = this.state;
|
||||
const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm } } = this.props;
|
||||
const { taxAgentStore: { PageAndOptAuth }, baseTableStore: { VSSalaryItemForm } } = this.props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const tabs = [
|
||||
{
|
||||
title: getLabel(111, "浮动数据"), key: "salaryFile", showDropIcon: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue