+ onClick={() => onEditLedger(record)}>{record.opts.includes("admin") ? "编辑" : "查看"}
{
- showOperateBtn &&
+ record.opts.includes("admin") &&
}
{
- showOperateBtn &&
+ record.opts.includes("admin") &&
{
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":
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/config.js b/pc4mobx/hrmSalary/pages/ledgerPage/config.js
index b3bc609a..1449a6d8 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/config.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/config.js
@@ -19,6 +19,7 @@ export const copyConditions = [
fieldcol: 14,
rules: "required|string",
label: "个税扣缴义务人",
+ multiple: true,
labelcol: 6,
value: "",
viewAttr: 3
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/index.js b/pc4mobx/hrmSalary/pages/ledgerPage/index.js
index d053ae3b..5cf659a0 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/index.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/index.js
@@ -23,34 +23,19 @@ class Index extends Component {
super(props);
this.state = {
searchVal: "", doSearch: false, logDialogVisible: false, filterConditions: "[]",
- slideparams: {
- visible: false,
- title: "新建账套",
- editId: ""
- }
+ slideparams: { visible: false, title: "新建账套", editId: "", record: {} }
};
}
- componentDidMount() {
- const { taxAgentStore } = this.props;
- const { fetchTaxAgentOption } = taxAgentStore;
- fetchTaxAgentOption();
- }
-
handleEditLedger = (record) => {
const { slideparams } = this.state;
const { id } = record;
- this.setState({ slideparams: { ...slideparams, visible: true, title: "编辑账套", editId: id } });
+ this.setState({ slideparams: { ...slideparams, visible: true, title: "编辑账套", editId: id, record } });
};
handleResetLedger = () => {
const { slideparams } = this.state;
this.setState({
- slideparams: {
- ...slideparams,
- visible: false,
- title: "新建账套",
- editId: ""
- }
+ slideparams: { ...slideparams, visible: false, title: "新建账套", editId: "", record: {} }
});
};
onDropMenuClick = (key, targetid = "") => {
@@ -69,7 +54,8 @@ class Index extends Component {
render() {
const { logDialogVisible, filterConditions, doSearch, slideparams } = this.state;
const { taxAgentStore } = this.props;
- const { showOperateBtn } = taxAgentStore;
+ const { PageAndOptAuth } = taxAgentStore;
+ const admin = PageAndOptAuth.opts.includes("admin");
const btns = [
} iconBgcolor="#F14A2D"
- buttons={showOperateBtn ? btns : btns.slice(-1)}
+ buttons={admin ? btns : btns.slice(-1)}
showDropIcon onDropMenuClick={this.onDropMenuClick}
dropMenuDatas={[
{
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/index.less b/pc4mobx/hrmSalary/pages/ledgerPage/index.less
index 182042bf..6c03f0cf 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/index.less
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/index.less
@@ -12,7 +12,6 @@
.ledgerSearch-Wrapper {
min-width: 350px;
- margin-top: 5px;
margin-right: 70px;
position: relative;
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js
index efe2605b..65488f6a 100644
--- a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js
@@ -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
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js
index e1ee1288..09d14961 100644
--- a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js
@@ -209,7 +209,7 @@ export const renderDropMenuDatas = (selectedKey, showOperateBtn) => {
default:
break;
}
- return showOperateBtn ? menus : _.filter(menus, o => o.key === "custom_cols");
+ return showOperateBtn ? menus : _.filter(menus, o => (o.key === "custom_cols" || o.key === "log"));
};
export const salaryFileSearchConditions = [
@@ -440,7 +440,7 @@ export const salaryFilesConditions = [
},
{
defaultshow: true, title: getLabel(543329, "发薪设置"),
- col: 1,lanId: 543329,
+ col: 1, lanId: 543329,
items: [
{
colSpan: 1,
@@ -471,7 +471,7 @@ export const salaryFilesConditions = [
defaultshow: true, title: getLabel(538004, "薪资档案"),
titleHelpful: getLabel(543330, "提示:显示已生效的最新数据"),
titleHelpfulLanId: 543330,
- col: 2, salaryFile: true,lanId: 538004,
+ col: 2, salaryFile: true, lanId: 538004,
items: []
}
];
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js b/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js
index 344a3284..8cc9b781 100644
--- a/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js
@@ -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 (
}
- 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={
{/*列表*/}
this.salaryFileListRef = dom}
- selectedKey={selectedKey} showOperateBtn={showOperateBtn}
+ selectedKey={selectedKey} showOperateBtn={admin}
showDelSalaryFileBtn={showDelSalaryFileBtn}
onChangeTopTabCount={this.queryInsuranceTabTotal}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
index 30ec27a6..9736415a 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
@@ -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 = {}) => {
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js
index 39ceeec2..84f44c94 100644
--- a/pc4mobx/hrmSalary/pages/taxAgent/index.js
+++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js
@@ -48,13 +48,9 @@ export default class TaxAgent extends React.Component {
}
getPermission = () => {
- const { getPermission } = this.props.taxAgentStore;
- getPermission().then(({ status, data }) => {
- if (status) {
- this.setState({ permission: data }, () => {
- this.getTaxAgentBaseForm();
- });
- }
+ const { PageAndOptAuth } = this.props.taxAgentStore;
+ this.setState({ permission: PageAndOptAuth }, () => {
+ this.getTaxAgentBaseForm();
});
};
diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js
index dafd7b40..b391c647 100644
--- a/pc4mobx/hrmSalary/stores/taxAgent.js
+++ b/pc4mobx/hrmSalary/stores/taxAgent.js
@@ -4,6 +4,7 @@ import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from "../apis/taxAgent"; // 引入API接口文件
import { decentralizationConditions, editConditions } from "../pages/taxAgent/editConditions";
+import { PAGE } from "../config";
const { TableStore } = WeaTableNew;
@@ -12,6 +13,7 @@ export class TaxAgentStore {
@action initRoleForm = () => this.roleForm = new WeaForm();
@observable roleOperatorForm = new WeaForm(); //权限-角色操作者form表单
@action initRoleOperatorForm = () => this.roleOperatorForm = new WeaForm();
+ @observable PageAndOptAuth = { able: false, opts: [] }; // 业务线页面权限
@observable tableStore = new TableStore(); // new table
@@ -143,9 +145,15 @@ export class TaxAgentStore {
@action
getPermission = params => {
+ _.map(_.keys(PAGE), page => {
+ if (_.some(PAGE[page], k => window.location.hash.indexOf(k) !== -1)) params = { ...params, page };
+ });
+ this.loading = true;
return new Promise((resolve, reject) => {
API.getPermission(params).then(({ status, data }) => {
+ this.loading = false;
if (status) {
+ this.PageAndOptAuth = data;
const { isAdminEnable, isChief, isOpenDevolution } = data;
this.setShowOperateBtn(
!isOpenDevolution ? true : isAdminEnable ? true : false