From de4b4a68e0d4ea454997620de77df626cd5d7356 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 9 May 2025 14:29:06 +0800 Subject: [PATCH] =?UTF-8?q?custom-=E8=81=94=E7=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apis/custom-apis/liante/index.js | 23 +++ pc4mobx/hrmSalary/index.js | 3 + .../hrmSalary/pages/calculate/calculate.js | 25 ++- .../components/calculateTablelist/index.js | 6 +- pc4mobx/hrmSalary/pages/custom-pages/index.js | 13 ++ .../custom-pages/liante/cbsDetail/index.js | 87 +++++++++ .../liante/cbsDetail/pushedDetailList.js | 97 ++++++++++ .../custom-pages/liante/cbsList/index.js | 176 ++++++++++++++++++ .../custom-pages/liante/cbsList/index.less | 52 ++++++ 9 files changed, 477 insertions(+), 5 deletions(-) create mode 100644 pc4mobx/hrmSalary/apis/custom-apis/liante/index.js create mode 100644 pc4mobx/hrmSalary/pages/custom-pages/liante/cbsDetail/index.js create mode 100644 pc4mobx/hrmSalary/pages/custom-pages/liante/cbsDetail/pushedDetailList.js create mode 100644 pc4mobx/hrmSalary/pages/custom-pages/liante/cbsList/index.js create mode 100644 pc4mobx/hrmSalary/pages/custom-pages/liante/cbsList/index.less diff --git a/pc4mobx/hrmSalary/apis/custom-apis/liante/index.js b/pc4mobx/hrmSalary/apis/custom-apis/liante/index.js new file mode 100644 index 00000000..cdc1fa38 --- /dev/null +++ b/pc4mobx/hrmSalary/apis/custom-apis/liante/index.js @@ -0,0 +1,23 @@ +import { WeaTools } from "ecCom"; +import { postFetch } from "../../../util/request"; + +// 联特薪酬二开-cbs推送列表(分页) +export const getPushCBSList = (params) => { + return postFetch("/api/bs/hrmsalary/cbs/push/list", params); +}; +// 联特薪酬二开-cbs推送明细列表(分页) +export const getPushCBSInfoList = (params) => { + return postFetch("/api/bs/hrmsalary/cbs/push/infoList", params); +}; +// 联特薪酬二开-生成CBS推送数据 +export const generateCBSPushList = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/generateCBSPushList", params); +}; +// 联特薪酬二开-推送数据到CBS +export const pushDataToCBS = (params) => { + return postFetch("/api/bs/hrmsalary/cbs/push/pushDataToCBS", params); +}; +// 联特薪酬二开-cbs推送明细列表(分页) +export const getPushCBSBaseInfo = params => { + return WeaTools.callApi("/api/bs/hrmsalary/cbs/push/getBaseInfo", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index a457493f..a9cadbac 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -60,6 +60,8 @@ import SupplementaryCalc from "./pages/supplementaryCalc"; import VariableSalary from "./pages/variableSalary"; import Datapush from "./pages/datapush"; import Layout from "./layout"; + +import CustomRoutes from "./pages/custom-pages"; import stores from "./stores"; import "./style/index"; // 读取系统多语言配置 @@ -137,6 +139,7 @@ const Routes = ( + {CustomRoutes} ); diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index 3a7b563d..426ea64d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -16,6 +16,7 @@ import CalculateDialog from "./components/calculateDialog"; import ProgressModal from "../../components/progressModal"; import LogDialog from "../../components/logViewModal"; import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate"; +import { generateCBSPushList } from "../../apis/custom-apis/liante"; import FormInfo from "../../components/FormInfo"; import { queryConditions } from "./config"; import { postFetch } from "../../util/request"; @@ -40,7 +41,8 @@ class Calculate extends Component { ] }, isRefresh: false, logDialogVisible: false, conditions: [], progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") }, - calcDaialog: { visible: false, title: "" }, showAdvance: false + calcDaialog: { visible: false, title: "" }, showAdvance: false, selectedRowKeys: [], + cbsloading: false }; this.timer = null; this.handleDebounce = null; @@ -63,9 +65,11 @@ class Calculate extends Component { renderCalculateOpts = () => { const { taxAgentStore: { PageAndOptAuth } } = this.props; - const { queryParams, isRefresh, showAdvance } = this.state; + const { queryParams, isRefresh, showAdvance, selectedRowKeys, cbsloading } = this.state; const admin = PageAndOptAuth.opts.includes("admin"); let calculateOpts = [ + , + ] + }, + { title: getLabel(111, "已推送"), key: "1", buttons: [] } + ]; + return (} iconBgcolor="#F14A2D" + onChange={v => this.setState({ + selectedKey: v, + queryParams: { ...queryParams, name: "", salarySobId: "" } + })} + buttons={_.find(tabs, o => selectedKey === o.key).buttons}> + + {getLabel(111, "薪资所属月")}: + {baseInfo.salaryMonth} + + this.setState({ selectedRowKeys: v })}/> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/liante/cbsDetail/pushedDetailList.js b/pc4mobx/hrmSalary/pages/custom-pages/liante/cbsDetail/pushedDetailList.js new file mode 100644 index 00000000..f29ca6f1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/liante/cbsDetail/pushedDetailList.js @@ -0,0 +1,97 @@ +/* + * CBS推送详情 + * 未推送列表 + * @Author: 黎永顺 + * @Date: 2025/5/9 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import * as API from "../../../../apis/custom-apis/liante"; + +const getLabel = WeaLocaleProvider.getLabel; + +class PushedDetailList extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, columns: [], dataSource: [], + pageInfo: { current: 1, pageSize: 10, total: 0 } + }; + } + + componentDidMount() { + this.getPushCBSInfoList(); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.selectedKey !== this.props.selectedKey) { + this.setState({ + columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 } + }, () => this.getPushCBSInfoList(nextProps)); + } + if (nextProps.isQuery !== this.props.isQuery) this.getPushCBSInfoList(nextProps); + } + + getPushCBSInfoList = (props) => { + const { pageInfo } = this.state, { + selectedKey: pushStatus, params + } = props || this.props, { salaryCbsId } = params; + const payload = { ...pageInfo, pushStatus, salaryCbsId }; + this.setState({ loading: true }); + API.getPushCBSInfoList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { current, pageSize, total }, + columns: [...columns, { + dataIndex: "options", title: getLabel(30585, "操作"), + width: 80, render: (_, record) => ( + this.props.pushDataToCBS([record.id], false)}> + {getLabel(111, "推送")} + + ) + }] + }); + } + }); + }; + + render() { + const { dataSource, columns, pageInfo, loading } = this.state, { + selectedKey, selectedRowKeys, setSelectedRowKeys + } = this.props; + 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.getPushCBSInfoList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getPushCBSInfoList()); + } + }; + const rowSelection = { + selectedRowKeys, onChange: setSelectedRowKeys + }; + return (
+ o.dataIndex !== "options") : columns}/> +
); + } +} + +export default PushedDetailList; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/liante/cbsList/index.js b/pc4mobx/hrmSalary/pages/custom-pages/liante/cbsList/index.js new file mode 100644 index 00000000..1dd97708 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/liante/cbsList/index.js @@ -0,0 +1,176 @@ +/* + * CBS推送列表 + * + * @Author: 黎永顺 + * @Date: 2025/5/8 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; +import { Button, message, Modal, Tag } from "antd"; +import * as API from "../../../../apis/custom-apis/liante"; +import LogDialog from "../../../../components/logViewModal"; +import { MonthRangePicker } from "../../../reportView/components/statisticalMicroSettingsSlide"; +import moment from "moment"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, columns: [], dataSource: [], selectedRowKeys: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, logDialogVisible: false, + queryParams: { + salaryYearMonth: [ + moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), + moment(new Date()).endOf("year").format("YYYY-MM") + ] + }, + filterConditions: "[]" + }; + } + + componentDidMount() { + this.getPushCBSList(); + } + + getPushCBSList = () => { + const { pageInfo, queryParams } = this.state; + const payload = { ...pageInfo, ...queryParams }; + this.setState({ loading: true }); + API.getPushCBSList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, pageInfo: { list: dataSource, pageNum, pageSize, total } } = data; + this.setState({ + dataSource, pageInfo: { pageNum, pageSize, total }, + columns: [..._.map(_.filter(columns, col => col.column !== "acctTimes"), o => { + o = { dataIndex: o.column, title: o.text, width: o.width }; + if (o.dataIndex === "salarySob") { + return { + ...o, render: (text, record) => { + const { acctTimes } = record; + return
+ {text} +
+ {`${getLabel(15323, "第")}${acctTimes}${getLabel(18929, "次")}`} +
+
; + } + }; + } + return o; + }), { + dataIndex: "options", title: getLabel(30585, "操作"), + width: 120, render: (_, record) => ( + + {getLabel(111, "推送")} + + {/**/} + {/* */} + {/* this.onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")}*/} + {/* */} + {/* */} + {/* }>*/} + {/* */} + {/**/} + ) + }] + }); + } + }); + }; + pushDataToCBS = (isConfirm = false) => { + const { selectedRowKeys: salaryCbsIds } = this.state, payload = { salaryCbsIds, isConfirm }; + API.pushDataToCBS(payload).then(({ status, data, errormsg }) => { + if (status && !!data) { + Modal.confirm({ + title: getLabel(111, "提示信息"), + content: data, + onOk: () => { + this.pushDataToCBS(true); + } + }); + } else if (status && !data) { + message.success(getLabel(111, "操作成功!")); + this.getPushCBSList(); + } else if (!status) { + Modal.warning({ title: getLabel(111, "提示信息"), content: errormsg }); + } + }); + }; + onDropMenuClick = (key, targetid = "") => { + switch (key) { + case "log": + this.setState({ + logDialogVisible: true, + filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]" + }); + break; + default: + break; + } + }; + + render() { + const { + logDialogVisible, queryParams, filterConditions, dataSource, columns, pageInfo, loading, selectedRowKeys + } = this.state; + const { salaryYearMonth } = queryParams; + 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.getPushCBSList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getPushCBSList()); + } + }; + const rowSelection = { + selectedRowKeys, onChange: v => this.setState({ selectedRowKeys: v }) + }; + return (} iconBgcolor="#F14A2D" showDropIcon={false} + buttons={[ + , + this.setState({ queryParams: { salaryYearMonth: v } }, () => this.getPushCBSList())}/> + ]} + onDropMenuClick={this.onDropMenuClick} + dropMenuDatas={[ + { + key: "log", icon: , + content: getLabel(545781, "操作日志") + } + ]} + > + + this.setState({ logDialogVisible: false })}/> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/liante/cbsList/index.less b/pc4mobx/hrmSalary/pages/custom-pages/liante/cbsList/index.less new file mode 100644 index 00000000..6308d7a9 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/liante/cbsList/index.less @@ -0,0 +1,52 @@ +.pushCBS { + .wea-new-top-content { + background: #f6f6f6; + padding: 8px 16px 0 16px; + + .wea-new-table { + background: #fff; + } + } +} + +.pushCBSDetailWrapper { + .wea-new-top-req-title > div:last-child { + right: 16px !important; + } + + .baseInfo-ant-row { + margin: 8px 16px; + padding: 16px 8px; + background: #FFF; + } + + .CBSDetailList { + padding: 0 16px; + + .wea-new-table { + background: #FFF; + } + } +} + +.pushCBSAdd { + .wea-new-top-content { + background: #f6f6f6; + padding: 8px 16px 0 16px; + + .wea-new-table { + background: #fff; + } + } +} + +.pushCBSUpdate { + .wea-new-top-content { + background: #f6f6f6; + padding: 8px 16px 0 16px; + + .wea-new-table { + background: #fff; + } + } +}