From b4a966ea20bce5566ff4fab96b44b799a34cd399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 27 Sep 2024 15:32:21 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 8 ++ .../components/customBrowserDialog.js | 68 ++++++++------ .../components/CustomBrowser/index.less | 33 +++++-- .../roleManagement/components/index.less | 19 ++++ .../roleDetailSetDialog/detailDialog.js | 92 +++++++++++++++++++ .../components/roleDetailSetDialog/index.js | 37 ++++++-- .../hrmSalary/pages/roleManagement/index.js | 29 +++++- 7 files changed, 237 insertions(+), 49 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 20997a2b..1d1509fc 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -160,3 +160,11 @@ export const getAuthOptTree = (params) => { export const getRole = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/auth/role/getRole", "GET", params); }; +//成员明细列表 +export const authMemberDetail = (params) => { + return postFetch("/api/bs/hrmsalary/auth/member/detail", params); +}; +//数据明细列表 +export const authDataDetail = (params) => { + return postFetch("/api/bs/hrmsalary/auth/data/detail", params); +}; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js index 9eabe37a..4cb5a125 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js @@ -97,7 +97,6 @@ class CustomBrowserDialog extends Component { } } }; - onLeftListCheck = (keys, datas) => { const { leftListSelectedData } = this.state; let targets = leftListSelectedData.concat(datas); @@ -154,6 +153,31 @@ class CustomBrowserDialog extends Component { } return bool; }; + renderTitle = () => { + const { dialogType, searchParamsKey, isSingle } = this.props, { + query, pageInfo, selectedRowKeys, singleFilterVal + } = this.state; + return (
+ {getLabel(111, "数据选择")} + { + dialogType === "table" ? + this.setState({ query: { ...query, [searchParamsKey]: value } })} + onSearch={() => { + this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => { + this.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + }}/> : isSingle ? + this.setState({ singleFilterVal })}/> : +
+ } +
); + }; render() { const { @@ -161,7 +185,7 @@ class CustomBrowserDialog extends Component { singleFilterVal } = this.state; const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props; - const sheight = this.dialog ? this.dialog.state.height - 55 : 260; + const sheight = this.dialog ? this.dialog.state.height - 116 : 260; const buttons = [ , @@ -172,7 +196,7 @@ class CustomBrowserDialog extends Component { if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true; if (rightDatas && rightDatas.length > 0) rightAllActive = true; let dom = -
+
{ !isSingle ?
@@ -184,7 +208,7 @@ class CustomBrowserDialog extends Component {
- +
this.setState({ rightCheckedKeys })} onDoubleClick={this.onRightDoubleClick} />
: - - this.setState({ singleFilterVal })}/> - this.handleRowClick(_.find(listDatas, item => item.id === id))} - data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/> - + this.handleRowClick(_.find(listDatas, item => item.id === id))} + data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/> }
; @@ -257,33 +278,20 @@ class CustomBrowserDialog extends Component { selectedRowKeys, onChange: selectedRowKeys => this.setState({ selectedRowKeys }) }; - dom = - this.setState({ query: { ...query, [searchParamsKey]: value } })} - onSearch={() => { - this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => { - this.getData(); - selectedRowKeys.forEach((v) => { - let item = this.getItemById(v); - if (item) this.selectedData[v] = item; - }); - }); - }}/> + dom =
- ; +
; } dialogType === "table" && isSingle && buttons.splice(0, 1); return ( this.dialog = dom} title={getLabel(111, "数据选择")} - className="custom_browser_dialog" style={{ + {...this.props} initLoadCss ref={dom => this.dialog = dom} title={this.renderTitle()} + className="custom_browser_dialog" draggable={false} style={{ width: 784, height: 460, minHeight: 200, minWidth: 380, maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" - }} buttons={buttons}> - {dom} - + }} buttons={buttons}>{dom} ); } } diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.less b/pc4mobx/hrmSalary/components/CustomBrowser/index.less index 8cf2ce40..d4d61a16 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.less +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.less @@ -1,10 +1,18 @@ .custom_browser_dialog { - .tableSearch { - float: right; - margin: 16px; - position: relative; - z-index: 99; - min-width: 200px; + .wea-hr-muti-dialog-title { + display: flex; + justify-content: space-between; + align-items: center; + } + + .wea-hr-muti-input-table { + background: #f6f6f6; + padding: 8px 16px; + height: 100%; + + .wea-new-table { + background: #FFF; + } } .ant-spin-nested-loading, .ant-spin-container { @@ -12,6 +20,19 @@ } .wea-hr-muti-dialog { + height: 100%; + background: #f6f6f6; + padding: 8px 16px; + + .wea-hr-muti-input-left, .wea-hr-muti-input-right { + background: #FFF; + } + + .wea-transfer-list { + background: #FFF; + border: 1px solid #e9e9e9; + } + .wea-input-focus { height: 35px !important; width: 100% !important; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/index.less b/pc4mobx/hrmSalary/pages/roleManagement/components/index.less index aaac5a7e..e471d7e0 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/index.less +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/index.less @@ -99,3 +99,22 @@ } } } + +.authDetail_dialog { + .authDetail-dialog-title { + display: flex; + justify-content: space-between; + align-items: center; + } + + .authDetail-table { + background: #f6f6f6; + padding: 8px 16px; + height: 100%; + + .wea-new-table { + background: #FFF; + } + } + +} diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js new file mode 100644 index 00000000..4c59b8bf --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js @@ -0,0 +1,92 @@ +/* + * 角色详情设置弹窗 + * 成员、数据明细查询 + * @Author: 黎永顺 + * @Date: 2024/9/27 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom"; +import * as API from "../../../../apis/taxAgent"; +import "../index.less"; + +const getLabel = WeaLocaleProvider.getLabel; +const APIFOX = { + "auth.MemberTargetTypeEnum": API.authMemberDetail, + "auth.DataTargetTypeEnum": API.authDataDetail +}; + +class DetailDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, + query: { username: "" }, dataSource: [], columns: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ query: { username: "" } }); + } + + getData = (props) => { + const { pageInfo, query } = this.state, { roleId, selectedKey } = props || this.props; + let payload = { ...pageInfo, ...query, roleId }; + this.setState({ loading: true }); + APIFOX[selectedKey](payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + console.log(data); + } + }); + }; + renderTitle = () => { + const { selectedKey } = this.props, { query } = this.state; + const title = selectedKey === "auth.MemberTargetTypeEnum" ? getLabel(111, "成员明细") : getLabel(111, "数据明细"); + return (
+ {title} + this.setState({ query: { username: v } })} + onSearch={v => this.setState({ pageInfo: { current: 1 } }, () => this.getData())}/> +
); + }; + + render() { + const { loading, dataSource, pageInfo, columns } = this.state; + const sheight = this.dialog ? this.dialog.state.height - 16 : 260; + + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getData()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getData()); + } + }; + + return ( + this.dialog = dom} title={this.renderTitle()} + className="authDetail_dialog" style={{ + width: 784, height: 460, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} buttons={[]}> +
+ +
+
+ ); + } +} + +export default DetailDialog; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js index bcacf2ec..4dc8d2c2 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js @@ -24,6 +24,7 @@ import { } from "ecCom"; import { commonEnumList } from "../../../../apis/archive"; import EditRoleDialog from "./editRoleDialog"; +import DetailDialog from "./detailDialog"; import AuthTree from "./authTree"; import * as API from "../../../../apis/taxAgent"; import { Button, Col, message, Modal, Row } from "antd"; @@ -55,6 +56,7 @@ class Index extends Component { replaceDatas: [], loading: { set: false, query: false, async: false, delete: false }, columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, editOperatorDialog: { visible: false, linkOptions: [], record: {} }, + detailDialog: { visible: false, roleId: "", selectedKey: "" }, dataTargetSettings: { link: "OR", sortedIndex: null }, conditions: [], formData: { taxAgentIds: [], sobIds: [] } }; @@ -63,7 +65,11 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { this.setState({ - name: nextProps.name, selectedKey: nextProps.selectedKey || "baseinfo" + name: nextProps.name, selectedKey: nextProps.selectedKey || "baseinfo", + detailDialog: { + ...this.state.detailDialog, roleId: nextProps.roleId, + selectedKey: nextProps.selectedKey || "baseinfo" + } }, () => { !["auth.AuthTargetTypeEnum", "baseinfo"].includes(this.state.selectedKey) && this.getEnumList(); !["auth.AuthTargetTypeEnum", "baseinfo"].includes(this.state.selectedKey) && this.getSettingRoler(nextProps.roleId); @@ -220,6 +226,7 @@ class Index extends Component { this.setState({ loading: { ...this.state.loading, set: false } }); if (status) { message.success(getLabel(111, "操作成功!")); + this.props.onSearch && this.props.onSearch(); } else { message.error(errormsg); } @@ -253,6 +260,7 @@ class Index extends Component { this.setState({ async: false }); if (status) { message.success(getLabel(111, "操作成功!")); + this.props.onSearch && this.props.onSearch(); } else { message.error(errormsg); } @@ -345,17 +353,19 @@ class Index extends Component { }; render() { - const { roleId, taxAgentStore } = this.props; + const { roleId, taxAgentStore, counts } = this.props; const { selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog, - dataTargetSettings + dataTargetSettings, detailDialog } = this.state; const { linkOptions } = editOperatorDialog; const tabs = [ - { title: getLabel(111, "基础信息"), viewcondition: "baseinfo" }, - { title: getLabel(111, "成员设置"), viewcondition: "auth.MemberTargetTypeEnum" }, - { title: getLabel(111, "功能权限"), viewcondition: "auth.AuthTargetTypeEnum" }, - { title: getLabel(111, "数据范围"), viewcondition: "auth.DataTargetTypeEnum" } + { title: getLabel(111, "基础信息"), viewcondition: "baseinfo", showcount: true, count: "resources" }, + { + title: getLabel(111, "成员设置"), viewcondition: "auth.MemberTargetTypeEnum", showcount: true, count: "members" + }, + { title: getLabel(111, "功能权限"), viewcondition: "auth.AuthTargetTypeEnum", showcount: true, count: "opts" }, + { title: getLabel(111, "数据范围"), viewcondition: "auth.DataTargetTypeEnum", showcount: true, count: "datas" } ]; const pagination = { ...pageInfo, @@ -383,6 +393,11 @@ class Index extends Component { ]; ["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.shift(); !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.pop(); + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.unshift( + + ); return (
- this.setState({ - selectedKey: v, replaceDatas: [], selectedRowKeys: [] + selectedKey: v, replaceDatas: [], selectedRowKeys: [], + detailDialog: { ...detailDialog, selectedKey: v } }, () => { taxAgentStore.roleForm.resetForm(); const { selectedKey } = this.state; @@ -464,6 +480,9 @@ class Index extends Component { onCancel={callback => this.setState({ editOperatorDialog: { ...editOperatorDialog, visible: false, record: {} } }, () => callback && callback())}/> + {/*成员、数据明细查看*/} + this.setState({ detailDialog: { ...detailDialog, visible: false } })}/> } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 89f47949..3b419943 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -30,8 +30,11 @@ class Index extends Component { this.state = { dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false }, - roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" }, - logDialogVisible: false, filterConditions: "", showSearchAd: false, syncLoading: false + logDialogVisible: false, filterConditions: "", showSearchAd: false, syncLoading: false, + roleSetDialog: { + visible: false, roleId: "", name: "", selectedKey: "", + counts: { datas: 0, members: 0, resources: 0, opts: 0 } + } }; } @@ -106,12 +109,30 @@ class Index extends Component { ) }] + }, () => { + const { roleSetDialog, dataSource } = this.state; + roleSetDialog.roleId && this.setState({ + roleSetDialog: { + ...roleSetDialog, counts: { + ...roleSetDialog.counts, ..._.reduce(_.keys(roleSetDialog.counts), (pre, cur) => ({ + ...pre, [cur]: _.find(dataSource, o => o.id === roleSetDialog.roleId)[cur] || 0 + }), {}) + } + } + }); }); } }); }; showRoleSetDialog = (role) => this.setState({ - roleSetDialog: { visible: true, roleId: role.id, name: role.name, selectedKey: role.selectedKey } + roleSetDialog: { + visible: true, roleId: role.id, name: role.name, selectedKey: role.selectedKey, + counts: { + ...this.state.roleSetDialog.counts, ..._.reduce(_.keys(this.state.roleSetDialog.counts), (pre, cur) => ({ + ...pre, [cur]: role[cur] || 0 + }), {}) + } + } }); deleteAuthRole = (payload) => { Modal.confirm({ @@ -204,7 +225,7 @@ class Index extends Component { {/*角色详情设置*/} this.setState({ - roleSetDialog: { ...roleSetDialog, visible: false } + roleSetDialog: { ...roleSetDialog, visible: false, roleId: "" } }, () => { this.props.taxAgentStore.initRoleForm(); callback && callback(); From 8996fa8d796c3aa5acb860799e26269b4527e76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 27 Sep 2024 16:20:28 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../variableSalary/components/salaryFileList/index.js | 10 ++++++---- pc4mobx/hrmSalary/pages/variableSalary/index.js | 8 ++++---- pc4mobx/hrmSalary/pages/variableSalary/index.less | 9 +++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index f3b0e52a..d68ae568 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -31,7 +31,6 @@ class Index extends Component { componentDidMount() { window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", this.handleResize, false); - this.getVariableSalaryList(); } componentWillUnmount() { @@ -40,9 +39,12 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.taxAgentIds !== this.props.taxAgentIds && nextProps.taxAgentIds) { + this.getVariableSalaryList(nextProps); + } if (nextProps.isQuery !== this.props.isQuery) this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } - }, () => this.getVariableSalaryList()); + }, () => this.getVariableSalaryList(nextProps)); } handleReceive = async ({ data }) => { @@ -67,8 +69,8 @@ class Index extends Component { } } }; - getVariableSalaryList = () => { - const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = this.props; + getVariableSalaryList = (props) => { + const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = props || this.props; const { pageInfo } = this.state; const { departmentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 115aa93e..6401465d 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -109,15 +109,15 @@ class Index extends Component { , this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, + this.setState({ taxAgentIds: val })}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ] : [ this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, + this.setState({ taxAgentIds: val })}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ], diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.less b/pc4mobx/hrmSalary/pages/variableSalary/index.less index b76440d6..ac609fbd 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.less +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.less @@ -1,6 +1,15 @@ .variable_salary_wrapper { .wea-new-top-req-title > div:last-child { right: 16px !important; + + .ant-calendar-range-picker { + min-width: 100px !important; + width: 100px; + } + + .wea-input-focus { + width: 140px; + } } .wea-new-top-req-content { From ce711f9c97127a609beb94a64d23ed8f9a49c9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 27 Sep 2024 16:45:47 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/roleDetailSetDialog/detailDialog.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js index 4c59b8bf..dc70c5a3 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js @@ -29,7 +29,9 @@ class DetailDialog extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData(nextProps); - if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ query: { username: "" } }); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + query: { username: "" }, pageInfo: { current: 1, pageSize: 10, total: 0 } + }); } getData = (props) => { @@ -39,7 +41,10 @@ class DetailDialog extends Component { APIFOX[selectedKey](payload).then(({ status, data }) => { this.setState({ loading: false }); if (status) { - console.log(data); + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } + }); } }); }; @@ -55,7 +60,7 @@ class DetailDialog extends Component { render() { const { loading, dataSource, pageInfo, columns } = this.state; - const sheight = this.dialog ? this.dialog.state.height - 16 : 260; + const sheight = this.dialog ? this.dialog.state.height - 120 : 260; const pagination = { ...pageInfo, From d4763dc2d2105f3e1ac9cd75425a6bd9e4cb2d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 27 Sep 2024 18:30:31 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/salaryFileDialog/index.js | 8 ++- .../salaryFileImportDialog/index.js | 22 ++++---- .../components/salaryFileList/index.js | 15 +++-- .../components/salaryItemList/index.js | 9 +-- .../components/searchPannel/index.js | 16 +++++- .../pages/variableSalary/conditions.js | 24 ++++++++ .../hrmSalary/pages/variableSalary/index.js | 56 +++++-------------- .../hrmSalary/pages/variableSalary/index.less | 14 ++--- pc4mobx/hrmSalary/style/index.less | 4 ++ 9 files changed, 90 insertions(+), 78 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 1635c3a4..8fbde56a 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -38,8 +38,9 @@ class Index extends Component { } } - initForm = (props) => { - const { baseTableStore: { VSSalaryFileForm }, detail, taxAgentOption } = props; + initForm = async (props) => { + const { baseTableStore: { VSSalaryFileForm }, detail } = props; + const { data: taxAgentOption } = await API.getAdminTaxAgentList(); API.getCreateForm().then(({ data }) => { this.setState({ conditions: [ @@ -48,7 +49,8 @@ class Index extends Component { if (getKey(o) === "taxAgentIds") { return { ...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label), - options: taxAgentOption, value: detail[getKey(o)] || "" + options: _.map(taxAgentOption, o => ({ key: String(o.id), showname: o.name })), + value: detail[getKey(o)] ? String(detail[getKey(o)]) : "" }; } return { diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js index c8917e45..53a96c2b 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js @@ -30,12 +30,13 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { const { importDialog } = this.state; if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { baseTableStore: { VSalryForm }, salaryMonth, taxAgentIds } = nextProps; - const payload = { - salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: importDialog.hasData - }; + const { baseTableStore: { VSalryForm } } = nextProps; + const payload = { ...VSalryForm.getFormParams(), hasData: importDialog.hasData }; this.setState({ - importDialog: { ...importDialog, salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } + importDialog: { + ...importDialog, salaryMonth: VSalryForm.getFormParams().salaryMonth, + link: `${importDialog.link}?${convertToUrlString(payload)}` + } }); } else { this.setState({ @@ -48,9 +49,10 @@ class Index extends Component { } handleImport = (payload) => { - const { taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth } = importDialog; + const { taxAgentIds } = VSalryForm.getFormParams(); this.setState({ importDialog: { ...importDialog, nextloading: true } }); API.importVariableSalary({ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") @@ -64,14 +66,14 @@ class Index extends Component { }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); }; renderFormComponent = () => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth: month, hasData } = importDialog; return
{ - const payload = { salaryMonth: val, hasData, taxAgentIds, ...VSalryForm.getFormParams() }; + const payload = { ...VSalryForm.getFormParams(), salaryMonth: val, hasData }; this.setState({ importDialog: { ...importDialog, salaryMonth: val, @@ -98,9 +100,9 @@ class Index extends Component { content={getLabel(543208, "导出现有数据")} helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")} onChange={val => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { salaryMonth } = importDialog; - const payload = { salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: val === "1" }; + const payload = { salaryMonth, ...VSalryForm.getFormParams(), hasData: val === "1" }; this.setState({ importDialog: { ...importDialog, hasData: val === "1", diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index d68ae568..12345d68 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -31,6 +31,7 @@ class Index extends Component { componentDidMount() { window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", this.handleResize, false); + this.getVariableSalaryList(); } componentWillUnmount() { @@ -39,9 +40,6 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.taxAgentIds !== this.props.taxAgentIds && nextProps.taxAgentIds) { - this.getVariableSalaryList(nextProps); - } if (nextProps.isQuery !== this.props.isQuery) this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } }, () => this.getVariableSalaryList(nextProps)); @@ -69,14 +67,15 @@ class Index extends Component { } } }; - getVariableSalaryList = (props) => { - const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = props || this.props; + getVariableSalaryList = () => { + const { baseTableStore: { VSalryForm, getVariableSalaryList } } = this.props; const { pageInfo } = this.state; - const { departmentIds } = VSalryForm.getFormParams(); + const { departmentIds, taxAgentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); getVariableSalaryList({ - ...pageInfo, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(","), - ...VSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [] + ...pageInfo, ...VSalryForm.getFormParams(), + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") }).then(({ status, data }) => { this.setState({ loading: false }); if (status) { diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js index 210df203..737b34de 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js @@ -9,7 +9,7 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTable } from "ecCom"; -import { message, Modal } from "antd"; +import { message, Modal, Spin } from "antd"; import * as API from "../../../../apis/variableSalary"; const getLabel = WeaLocaleProvider.getLabel; @@ -103,9 +103,10 @@ class Index extends Component { }, () => this.getVariableSalaryItemList()); } }; - return ( - + return ( + + ); } } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js index d5b274a9..9a541fd6 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js @@ -7,9 +7,11 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import { Button } from "antd"; +import * as API from "../../../../apis/variableSalary"; import { inject, observer } from "mobx-react"; import { getSearchs } from "../../../../util"; import { conditions } from "../../conditions"; +import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -24,12 +26,19 @@ class VariableSalarySearchPannel extends Component { }; } - componentDidMount() { + async componentDidMount() { + const { data } = await API.getAdminTaxAgentList(); this.setState({ searchConditions: _.map(conditions, item => { return { ...item, items: _.map(item.items, child => { + if (getKey(child) === "taxAgentIds") { + return { + ...child, label: getLabel(child.lanId, child.label), + options: _.map(data, o => ({ key: String(o.id), showname: o.name, selected: true })) + }; + } return { ...child, label: getLabel(child.lanId, child.label) }; }) }; @@ -54,7 +63,10 @@ class VariableSalarySearchPannel extends Component { - + diff --git a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js index 72ff44cf..5e14461a 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js @@ -1,3 +1,5 @@ +import moment from "moment"; + export const conditions = [ { items: [ @@ -22,6 +24,28 @@ export const conditions = [ value: "", viewAttr: 2 }, + { + conditionType: "MONTHPICKER", + domkey: ["salaryMonth"], + fieldcol: 14, + label: "薪资所属月", + lanId: 111, + labelcol: 6, + value: moment(new Date()).format("YYYY-MM"), + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["taxAgentIds"], + fieldcol: 14, + label: "个税扣缴义务人", + lanId: 111, + labelcol: 6, + value: "", + options: [], + multiple: true, + viewAttr: 2 + }, { browserConditionParam: { completeParams: {}, diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 6401465d..1902c6cb 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -10,7 +10,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { WeaDatePicker, WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaSelect } from "ecCom"; +import { WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop } from "ecCom"; import * as API from "../../apis/variableSalary"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SearchPannel from "./components/searchPannel"; @@ -19,7 +19,6 @@ import SalaryFileDialog from "./components/salaryFileDialog"; import SalaryItemList from "./components/salaryItemList"; import SalaryFileList from "./components/salaryFileList"; import SalaryFileImportDialog from "./components/salaryFileImportDialog"; -import moment from "moment"; import { Button } from "antd"; import cs from "classnames"; import "./index.less"; @@ -32,27 +31,13 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "salaryFile", isQuery: false, showSearchAd: false, taxAgentIds: "", - salaryMonth: moment(new Date()).format("YYYY-MM"), taxAgentOption: [], - SIDialog: { visible: false, title: "", id: "", taxAgentOption: [] }, //薪资项目薪资编辑弹框 - SFDialog: { visible: false, title: "", detail: {}, taxAgentOption: [] }, //薪资档案编辑弹框 + selectedKey: "salaryFile", isQuery: false, showSearchAd: false, + SIDialog: { visible: false, title: "", id: "" }, //薪资项目薪资编辑弹框 + SFDialog: { visible: false, title: "", detail: {} }, //薪资档案编辑弹框 SFImpDialog: { visible: false, title: getLabel(24023, "数据导入") }//薪资档案导入 }; } - 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 } - }); - } - }); - } - handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery }); openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); handleOperate = (type, detail = {}) => { @@ -71,12 +56,12 @@ class Index extends Component { break; case "export": const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), it => it.dataIndex); - const { salaryMonth, taxAgentIds } = this.state; + const { taxAgentIds, departmentIds } = VSalryForm.getFormParams(); const payload = { ...VSalryForm.getFormParams(), taxAgentIds: !_.isEmpty(taxAgentIds) ? taxAgentIds.split(",") : [], - departmentIds: !_.isEmpty(VSalryForm.getFormParams().taxAgentIds) ? VSalryForm.getFormParams().taxAgentIds.split(",") : [], - salaryMonth, columns + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + columns }; WeaLoadingGlobal.start(); const promise = API.exportVariableSalary(payload); @@ -91,10 +76,8 @@ class Index extends Component { }; render() { - const { - selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery, salaryMonth, taxAgentOption, taxAgentIds - } = this.state; - const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm } } = this.props; + const { selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery } = this.state; + const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm, VSalryForm } } = this.props; const tabs = [ { title: getLabel(111, "薪资档案"), key: "salaryFile", showDropIcon: true, @@ -107,22 +90,14 @@ class Index extends Component { buttons: showOperateBtn ? [ , , - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val })}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ] : [ - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val })}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ], - children: this.handleOperate("create", data)}/> + children: !_.isEmpty(VSalryForm.getFormParams()) ? this.handleOperate("create", data)}/> : null }, { title: getLabel(111, "薪资项目"), key: "salaryItem", showDropIcon: false, dropMenuDatas: [], @@ -161,11 +136,10 @@ class Index extends Component { SFDialog: { ...SFDialog, visible: false } }, () => callback && callback())}/> {/* 薪资档案导入*/} - { - this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } }, - () => callback && this.handleAdvanceSearch()); - }}/> + { + this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } }, + () => callback && this.handleAdvanceSearch()); + }}/> ); } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.less b/pc4mobx/hrmSalary/pages/variableSalary/index.less index ac609fbd..f38e90b8 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.less +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.less @@ -1,15 +1,6 @@ .variable_salary_wrapper { .wea-new-top-req-title > div:last-child { right: 16px !important; - - .ant-calendar-range-picker { - min-width: 100px !important; - width: 100px; - } - - .wea-input-focus { - width: 140px; - } } .wea-new-top-req-content { @@ -40,7 +31,7 @@ } .wea-advanced-searchsAd { - height: 108px; + height: 155px; overflow: hidden auto; .formItem-delete { @@ -66,6 +57,9 @@ } } + .wea-form-item-wrapper { + display: block !important; + } } } diff --git a/pc4mobx/hrmSalary/style/index.less b/pc4mobx/hrmSalary/style/index.less index 5f2c76d6..02955b0b 100644 --- a/pc4mobx/hrmSalary/style/index.less +++ b/pc4mobx/hrmSalary/style/index.less @@ -39,6 +39,10 @@ .form-dialog-layout { background: #f6f6f6; + .wea-form-item .wea-form-item-wrapper .wea-field-readonly { + line-height: 28px; + } + .wea-search-group { padding: 16px; } From 198668654ad9b638b26a9f0ffd06c609a46fd550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 27 Sep 2024 18:38:37 +0800 Subject: [PATCH 5/5] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/variableSalary/components/salaryFileDialog/index.js | 3 ++- .../pages/variableSalary/components/searchPannel/index.js | 4 ++-- pc4mobx/hrmSalary/pages/variableSalary/index.js | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 8fbde56a..8c7a5fea 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -14,6 +14,7 @@ import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; import { salaryFileConditions } from "../../conditions"; import * as API from "../../../../apis/variableSalary"; +import { postFetch } from "../../../../util/request"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -40,7 +41,7 @@ class Index extends Component { initForm = async (props) => { const { baseTableStore: { VSSalaryFileForm }, detail } = props; - const { data: taxAgentOption } = await API.getAdminTaxAgentList(); + const { data: taxAgentOption } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); API.getCreateForm().then(({ data }) => { this.setState({ conditions: [ diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js index 9a541fd6..4f68f6c0 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import { Button } from "antd"; -import * as API from "../../../../apis/variableSalary"; +import { postFetch } from "../../../../util/request"; import { inject, observer } from "mobx-react"; import { getSearchs } from "../../../../util"; import { conditions } from "../../conditions"; @@ -27,7 +27,7 @@ class VariableSalarySearchPannel extends Component { } async componentDidMount() { - const { data } = await API.getAdminTaxAgentList(); + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }); this.setState({ searchConditions: _.map(conditions, item => { return { diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 61b402ac..2ea8e816 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -19,7 +19,6 @@ 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 { Button } from "antd"; import cs from "classnames"; import "./index.less";