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..dc70c5a3 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js @@ -0,0 +1,97 @@ +/* + * 角色详情设置弹窗 + * 成员、数据明细查询 + * @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: "" }, pageInfo: { current: 1, pageSize: 10, total: 0 } + }); + } + + 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) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } + }); + } + }); + }; + 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 - 120 : 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(); diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 1635c3a4..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; @@ -38,8 +39,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 postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); API.getCreateForm().then(({ data }) => { this.setState({ conditions: [ @@ -48,7 +50,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 f3b0e52a..12345d68 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -42,7 +42,7 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.isQuery !== this.props.isQuery) this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } - }, () => this.getVariableSalaryList()); + }, () => this.getVariableSalaryList(nextProps)); } handleReceive = async ({ data }) => { @@ -68,13 +68,14 @@ class Index extends Component { } }; getVariableSalaryList = () => { - const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = this.props; + 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 bceb4585..d131e375 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..4f68f6c0 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 { postFetch } from "../../../../util/request"; 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 postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }); 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 16df4811..2ea8e816 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,8 +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 moment from "moment"; import { Button } from "antd"; import cs from "classnames"; import "./index.less"; @@ -33,28 +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, "数据导入") }//薪资档案导入 }; } - 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 } - }); - } - handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery }); openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); handleOperate = (type, detail = {}) => { @@ -73,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); @@ -93,10 +76,8 @@ class Index extends Component { }; render() { - const { - selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery, salaryMonth, taxAgentOption, taxAgentIds - } = this.state; - const { taxAgentStore: { PageAndOptAuth }, baseTableStore: { VSSalaryItemForm } } = this.props; + const { selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery } = this.state; + const { taxAgentStore: { PageAndOptAuth }, baseTableStore: { VSSalaryItemForm, VSalryForm } } = this.props; const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const tabs = [ { @@ -110,22 +91,14 @@ class Index extends Component { buttons: showOperateBtn ? [ , , - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ] : [ - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, 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: [], @@ -164,11 +137,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 b76440d6..f38e90b8 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.less +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.less @@ -31,7 +31,7 @@ } .wea-advanced-searchsAd { - height: 108px; + height: 155px; overflow: hidden auto; .formItem-delete { @@ -57,6 +57,9 @@ } } + .wea-form-item-wrapper { + display: block !important; + } } }