diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js index b0a9ead4..b7afc211 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js @@ -40,7 +40,10 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) { + if ( + (nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) || + (nextProps.fieldConfig.value !== this.props.fieldConfig.value && _.isEmpty(nextProps.fieldConfig.value)) + ) { this.setState({ searchKeys: [], selectedData: [] }); } } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.js new file mode 100644 index 00000000..77d46acc --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.js @@ -0,0 +1,36 @@ +/* + * 业务线管理 + * 高级搜索 + * @Author: 黎永顺 + * @Date: 2024/9/24 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore") +@observer +class Index extends Component { + render() { + const { taxAgentStore: { advanceForm } } = this.props; + return ( +
+ advanceForm.updateFields({ name: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.less new file mode 100644 index 00000000..556cfd69 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.less @@ -0,0 +1,27 @@ +.role-advance-search { + display: flex; + align-items: center; + position: relative; + + .wea-advanced-search { + top: 0; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js new file mode 100644 index 00000000..fab6c856 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js @@ -0,0 +1,98 @@ +/* + * 业务线管理 + * 高级搜索面板 + * @Author: 黎永顺 + * @Date: 2024/9/24 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import { roleSearchConditions } from "../conditions"; +import { getSearchs } from "../../../../util"; +import { Button } from "antd"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore") +@observer +class AdvanceSearchPannel extends Component { + constructor(props) { + super(props); + this.state = { conditions: [] }; + } + + componentDidMount() { + const { taxAgentStore: { advanceForm } } = this.props; + this.setState({ + conditions: _.map(roleSearchConditions, item => ({ + ...item, title: getLabel(item.lanId, item.title), + items: _.map(item.items, o => { + if (getKey(0) === "opts") { + return { + ...o, label: getLabel(o.lanId, o.label), + options: _.map(o.options, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + }; + } + return { ...o, label: getLabel(o.lanId, o.label) }; + }) + })) + }, () => advanceForm.initFormFields(this.state.conditions)); + } + + handleReset = () => { + const { taxAgentStore: { advanceForm } } = this.props; + this.setState({ + conditions: _.map(roleSearchConditions, item => ({ + ...item, items: _.map(item.items, o => ({ ...o, value: "" })) + })) + }, () => advanceForm.resetForm()); + }; + handleFormChange = (val) => { + const key = _.keys(val)[0]; + const { taxAgentStore: { advanceForm } } = this.props; + if (key === "taxAgentIds" || key === "sobIds") { + this.setState({ + conditions: _.map(roleSearchConditions, item => ({ + ...item, items: _.map(item.items, o => { + if (key === getKey(o)) { + return { ...o, value: _.map(val[key], o => o.id).join(",") }; + } + return { ...o, value: advanceForm.getFormParams()[getKey(o)] }; + }) + })) + }); + } + }; + + render() { + const { taxAgentStore: { advanceForm } } = this.props; + const { conditions } = this.state; + return ( + +
+ {getSearchs(advanceForm, conditions, 2, false, this.handleFormChange)} +
+
+
+ + + + + + + + + +
+
+
+ ); + } +} + +export default AdvanceSearchPannel; + diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js index e3c1388b..4b2bd858 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js @@ -114,3 +114,143 @@ export const roleOperatorConditions = [ title: "" } ]; +export const roleSearchConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["name"], + fieldcol: 16, + label: "名称", + lanId: 111, + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeURL: "/api/bs/hrmsalary/taxAgent/listAuth", + dataParams: { filterType: "QUERY_DATA" }, + filterByName: true, + tableProps: {}, + isSingle: false, + searchParamsKey: "name" + }, + conditionType: "CUSTOMBROWSER", + domkey: ["taxAgentIds"], + fieldcol: 16, + label: "个税扣缴义务人", + lanId: 111, + labelcol: 8, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "17" + }, + conditionType: "BROWSER", + domkey: ["roleEmpIds"], + fieldcol: 16, + isQuickSearch: false, + label: "成员", + lanId: 111, + labelcol: 8, + viewAttr: 2 + }, + { + browserConditionParam: { + completeURL: "/api/bs/hrmsalary/salarysob/listAuth", + dataParams: { filterType: "QUERY_DATA" }, + filterByName: true, + tableProps: {}, + isSingle: false, + searchParamsKey: "name" + }, + conditionType: "CUSTOMBROWSER", + domkey: ["sobIds"], + fieldcol: 16, + label: "薪资账套", + lanId: 111, + labelcol: 8, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "17" + }, + conditionType: "BROWSER", + domkey: ["employeeIds"], + fieldcol: 16, + isQuickSearch: false, + label: "数据", + lanId: 111, + labelcol: 8, + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["opts"], + fieldcol: 16, + label: "权限项", + lanId: 111, + labelcol: 8, + multiple: true, + options: [ + { key: "query", showname: "查询", lanId: 111 }, + { key: "admin", showname: "管理", lanId: 111 } + ], + value: "", + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["pages"], + fieldcol: 16, + label: "页面", + lanId: 111, + labelcol: 8, + multiple: true, + options: [ + { key: "query", showname: "查询", lanId: 111 }, + { key: "admin", showname: "管理", lanId: 111 } + ], + value: "", + viewAttr: 2 + } + ], + defaultshow: true, + title: "基本信息", + lanId: 111, + col: 2 + } +]; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index b9a95a6d..28ab4f22 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -9,12 +9,16 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; -import { Button, message, Modal } from "antd"; +import { WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; +import { Button, Dropdown, Menu, message, Modal } from "antd"; import * as API from "../../apis/taxAgent"; -import "./index.less"; import AddRoleDialog from "./components/addRoleDialog"; import RoleDetailSetDialog from "./components/roleDetailSetDialog"; +import AdvanceInputBtn from "./components/advanceInputBtn"; +import AdvanceSearchPannel from "./components/advanceSearchPannel"; +import LogDialog from "../../components/logViewModal"; +import cs from "classnames"; +import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -24,9 +28,10 @@ class Index extends Component { constructor(props) { super(props); this.state = { - query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false }, - roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" } + roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" }, + logDialogVisible: false, filterConditions: "", showSearchAd: false }; } @@ -35,8 +40,15 @@ class Index extends Component { } getRoleList = () => { - const { query, pageInfo } = this.state; - const paylaod = { ...pageInfo, ...query }; + const { taxAgentStore: { advanceForm } } = this.props, { pageInfo } = this.state; + const paylaod = { + ...pageInfo, ...advanceForm.getFormParams(), + employeeIds: !_.isEmpty(advanceForm.getFormParams()["employeeIds"]) ? advanceForm.getFormParams()["employeeIds"].split(",") : [], + opts: !_.isEmpty(advanceForm.getFormParams()["opts"]) ? advanceForm.getFormParams()["opts"].split(",") : [], + roleEmpIds: !_.isEmpty(advanceForm.getFormParams()["roleEmpIds"]) ? advanceForm.getFormParams()["roleEmpIds"].split(",") : [], + sobIds: !_.isEmpty(advanceForm.getFormParams()["sobIds"]) ? advanceForm.getFormParams()["sobIds"].split(",") : [], + taxAgentIds: !_.isEmpty(advanceForm.getFormParams()["taxAgentIds"]) ? advanceForm.getFormParams()["taxAgentIds"].split(",") : [] + }; this.setState({ loading: true }); API.getRoleList(paylaod).then(({ status, data }) => { this.setState({ loading: false }); @@ -69,8 +81,15 @@ class Index extends Component { this.showRoleSetDialog(record)}>{getLabel(111, "编辑")} - this.deleteAuthRole([record.id])}>{getLabel(111, "删除")} + this.handleDropMenuClick(e.key, record.id)}> + {getLabel(545781, "操作日志")} + + }> + + ) }] @@ -97,23 +116,39 @@ class Index extends Component { } }); }; + handleDropMenuClick = (key, targetid = "") => { + switch (key) { + case "log": + this.setState({ + logDialogVisible: true, + filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]" + }); + break; + default: + break; + } + }; render() { const { - query, dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog + dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog, + logDialogVisible, filterConditions, showSearchAd } = this.state; const { taxAgentStore: { PageAndOptAuth } } = this.props; const admin = PageAndOptAuth.opts.includes("admin"); - + const dropMenuDatas = [{ + key: "log", icon: , + content: getLabel(545781, "操作日志") + }]; const buttons = [ , , - this.setState({ query: { name } })} - onSearch={() => this.setState({ pageInfo: { ...pageInfo, current: 1 } }, - () => this.getRoleList())}/> + this.setState({ showSearchAd: true })} + onAdvanceSearch={() => this.setState({ pageInfo: { ...pageInfo, current: 1 } }, + () => this.getRoleList())}/> ]; const pagination = { ...pageInfo, @@ -134,11 +169,17 @@ class Index extends Component { !admin && buttons.shift(); !admin && buttons.shift(); return ( - } - iconBgcolor="#F14A2D" buttons={buttons} className="rolemanagement-index" - > + } iconBgcolor="#F14A2D" + buttons={buttons} className="rolemanagement-index" showDropIcon dropMenuDatas={dropMenuDatas} + onDropMenuClick={this.handleDropMenuClick}>
+
+ this.setState({ showSearchAd: false })} + onAdSearch={() => this.setState({ + showSearchAd: false, pageInfo: { ...pageInfo, current: 1 } + }, () => this.getRoleList())}/> +
{/*添加角色*/} @@ -156,6 +197,9 @@ class Index extends Component { callback && callback(); })}/>
+ {/*操作日志*/} + this.setState({ logDialogVisible: false })}/>
); } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.less b/pc4mobx/hrmSalary/pages/roleManagement/index.less index 17beeb3e..e911681c 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.less +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.less @@ -1,13 +1,57 @@ .rolemanagement-index { .rolemanagement-content { height: 100%; - overflow-y: hidden; + overflow-y: auto; padding: 16px 16px 0; background: rgb(246, 246, 246); .wea-new-table { background: #FFF; } + + .searchAdvanced-condition-hide { + display: none; + } + + .searchAdvanced-condition-container { + background: #FFF; + margin-bottom: 10px; + border: 1px solid #e5e5e5; + + .wea-search-buttons { + border-top: 1px solid #dadada; + padding: 15px 0; + } + + .wea-advanced-searchsAd { + height: 247px; + overflow: hidden auto; + + .formItem-delete { + position: absolute; + top: 0; + right: -40px; + } + + .searchAdvanced-commonSelect { + border-top: 1px solid #ebebeb; + margin: 0 25px; + padding: 10px 0; + } + + .custom-advance-largeSpacing { + padding-left: 26px; + + .link { + border: none; + border-radius: 0; + padding: 12px 10px 12px 26px; + color: #2db7f5 + } + } + + } + } } .wea-input-focus .ant-input { diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index a65d8b31..94d9898f 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -9,6 +9,7 @@ import { PAGE } from "../config"; const { TableStore } = WeaTableNew; export class TaxAgentStore { + @observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单 @observable roleForm = new WeaForm(); //权限-角色form表单 @action initRoleForm = () => this.roleForm = new WeaForm(); @observable roleOperatorForm = new WeaForm(); //权限-角色操作者form表单