-
+
{this.generateTreeNodes()}
diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js
index c6688f32..ab56ef02 100644
--- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js
+++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js
@@ -42,12 +42,12 @@ class CustomBrowserOperation extends Component {
const moveAllToLeftButton = (
);
const moveAllToRightButton = (
);
return (
diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js
index 92d2944f..b0a9ead4 100644
--- a/pc4mobx/hrmSalary/components/CustomBrowser/index.js
+++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js
@@ -30,15 +30,21 @@ class Index extends Component {
componentDidMount() {
const { value, fieldConfig } = this.props;
- const { browserConditionParam: { replaceDatas = [] } } = fieldConfig;
- if (value && replaceDatas.length > 0) {
+ const { value: defaultValue, browserConditionParam: { replaceDatas = [] } } = fieldConfig;
+ if ((value || defaultValue) && replaceDatas.length > 0) {
this.setState({
- searchKeys: value.split(","),
+ searchKeys: (value || defaultValue).split(","),
selectedData: _.reduce(replaceDatas, (pre, cur) => ({ ...pre, [cur["id"]]: cur }), {})
});
}
}
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) {
+ this.setState({ searchKeys: [], selectedData: [] });
+ }
+ }
+
renderSingle = () => {
const { fieldConfig } = this.props;
const { selectedData, searchKeys } = this.state;
diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js
index 51e4f4a3..543cf535 100644
--- a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js
+++ b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js
@@ -24,7 +24,7 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
- conditions: [], loading: false
+ conditions: [], loading: false, formData: { taxAgentIds: [], sobIds: [] }
};
}
@@ -40,15 +40,13 @@ class Index extends Component {
}
save = (isSetting) => {
- const { taxAgentStore: { roleForm }, taxAgentId } = this.props;
+ const { taxAgentStore: { roleForm } } = this.props;
+ const { formData } = this.state;
roleForm.validateForm().then(f => {
if (f.isValid) {
const payload = roleForm.getFormParams();
-
- console.log(payload,roleForm.getFormDatas())
- return
this.setState({ loading: true });
- API.saveAuthRole({ ...payload, taxAgentId }).then(({ status, data, errormsg }) => {
+ API.saveAuthRole({ ...payload, ...formData }).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
@@ -63,16 +61,19 @@ class Index extends Component {
}
});
};
- handleFormChange=(val)=>{
- console.log(val)
- }
+ 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 (
this.save()}>{getLabel(111, "保存")},
);
}
diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js
index 0ec684c4..957b88df 100644
--- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js
+++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js
@@ -13,6 +13,7 @@ import {
WeaDialog,
WeaFormItem,
WeaInput,
+ WeaInputNumber,
WeaLocaleProvider,
WeaScope,
WeaSelect,
@@ -26,6 +27,7 @@ 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";
const getLabel = WeaLocaleProvider.getLabel;
const APIFOX = {
@@ -46,7 +48,8 @@ class Index extends Component {
selectedKey: "auth.MemberTargetTypeEnum", 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: {} }
+ editOperatorDialog: { visible: false, linkOptions: [], record: {} },
+ dataTargetSettings: { link: "OR", sortedIndex: null }
};
}
@@ -57,7 +60,10 @@ class Index extends Component {
this.getSettingRoler(nextProps.roleId);
});
} else {
- this.setState({ selectedRowKeys: [], replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 } });
+ this.setState({
+ selectedRowKeys: [], replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
+ dataTargetSettings: { link: "OR", sortedIndex: "" }
+ });
}
}
@@ -91,18 +97,18 @@ class Index extends Component {
}
});
};
- handleEditOperator = async (record) => {
- let { selectedKey } = this.state, linkOptions = [];
- if (selectedKey === "auth.DataTargetTypeEnum") {
- const payload = { enumClass: `com.engine.salary.enums.auth.DataLinkEnum` };
- const { data } = await commonEnumList(payload);
- linkOptions = _.map(data, o => ({ key: o.enum, showname: o.defaultLabel }));
- }
- this.setState({ editOperatorDialog: { visible: true, record, linkOptions } });
+ 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 } = this.state;
+ const { selectedKey, enumType: targetType, replaceDatas, dataTargetSettings } = this.state;
if (_.isEmpty(replaceDatas)) {
Modal.warning({
title: getLabel(111, "系统提示"),
@@ -111,8 +117,11 @@ class Index extends Component {
return;
}
const payload = _.map(replaceDatas, o => ({
- roleId, targetType: o.targetType || targetType, target: o.id || "", targetName: o.name || "",
- link: o.link || "OR", sortedIndex: o.sortedIndex || 0, id: o.editId || ""
+ 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 }) => {
@@ -213,6 +222,23 @@ class Index extends Component {
cur.id.split("-"), [])}
onChange={v => this.setState({ replaceDatas: [{ id: v.join("-"), name: v.join("-") }] })}/>
);
+ case "SOB":
+ return (
+ (o.id))}
+ onCustomChange={replaceDatas => this.setState({
+ replaceDatas: _.map(_.values(replaceDatas), o => ({ id: o.id, name: o.name }))
+ })}
+ />
+ );
default:
return (
);
}
@@ -228,8 +254,10 @@ class Index extends Component {
render() {
const { roleId } = this.props;
const {
- selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog
+ selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog,
+ dataTargetSettings
} = this.state;
+ const { linkOptions } = editOperatorDialog;
const tabs = [
{ title: getLabel(111, "成员"), viewcondition: "auth.MemberTargetTypeEnum" },
{ title: getLabel(111, "权限"), viewcondition: "auth.AuthTargetTypeEnum" },
@@ -287,6 +315,7 @@ class Index extends Component {
}, () => {
this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getEnumList();
this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getSettingRoler(roleId);
+ this.state.selectedKey === "auth.DataTargetTypeEnum" && this.getConnectSymbol();
})}/>
{
this.state.selectedKey !== "auth.AuthTargetTypeEnum" &&
@@ -297,7 +326,30 @@ class Index extends Component {
{
this.state.selectedKey !== "auth.AuthTargetTypeEnum" &&
-
+ {
+ this.state.selectedKey === "auth.DataTargetTypeEnum" &&
+
+
+
+
+ this.setState({
+ dataTargetSettings: { ...dataTargetSettings, link }
+ })}/>
+
+
+
+
+ this.setState({
+ dataTargetSettings: { ...dataTargetSettings, sortedIndex }
+ })}/>
+
+
+
+
+ }
+
{getLabel(111, "添加操作者设置")}
diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js
index 66c7c9e3..425e1a9f 100644
--- a/pc4mobx/hrmSalary/pages/roleManagement/index.js
+++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js
@@ -22,7 +22,8 @@ class Index extends Component {
super(props);
this.state = {
query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
- loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false }
+ loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false },
+ roleSetDialog: { visible: false, roleId: "", name: "" }
};
}
@@ -41,14 +42,21 @@ class Index extends Component {
this.setState({
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
columns: [...columns, {
- title: getLabel(111, "操作"), width: 120, dataIndex: "action",
+ title: getLabel(111, "操作"), width: 150, dataIndex: "action",
render: (__, record) => (
- this.deleteAuthRole([record.id])}>{getLabel(111, "删除")})
+
+ this.showRoleSetDialog(record)}>{getLabel(111, "编辑")}
+ this.deleteAuthRole([record.id])}>{getLabel(111, "删除")}
+
+ )
}]
});
}
});
};
+ showRoleSetDialog = (role) => this.setState({ roleSetDialog: { visible: true, roleId: role.id, name: role.name } });
deleteAuthRole = (payload) => {
Modal.confirm({
title: getLabel(111, "信息确认"),
@@ -98,12 +106,12 @@ class Index extends Component {
};
return (
}
+ title={getLabel(111, "业务线管理")} icon={}
iconBgcolor="#F14A2D" buttons={buttons} className="rolemanagement-index"
>
+ rowSelection={rowSelection} scroll={{ y: `calc(100vh - 173px)` }} rowKey="id"/>
{/*添加角色*/}
{
@@ -46,7 +47,10 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void
>
{
fields.conditionType === "CUSTOMBROWSER" ?
- :
+ onChange({
+ [getKey(fields)]: _.map(_.values(val), o => ({ id: o.id, name: o.name }))
+ })}/> :
}
{