From 6493e32314ea0e564025d25afa7c8f7836c873ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 29 Aug 2023 14:21:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E8=83=BD=E7=AE=97=E8=96=AA-=E6=B5=81?= =?UTF-8?q?=E9=87=8F=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD=E7=9A=84=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../intelligentCalculateSalarySettings.js | 4 + .../components/insufficientTrafficAlert.js | 20 ++++- .../components/interfaceFlowStatistics.js | 89 +++++++++++++++++-- .../components/trafficUsageRecords.js | 31 ++++++- .../index.less | 41 +++++++++ 5 files changed, 171 insertions(+), 14 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js b/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js index 04f0dae4..dd7d0a9f 100644 --- a/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js +++ b/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js @@ -29,3 +29,7 @@ export const apiflowRecordList = (params) => { export const apiflowStatisticsInfo = (params) => { return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/statistics/info", params); }; +//智能算薪-接口流量使用明细 +export const apiflowStatisticsList = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/statistics/list", params); +}; diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js index 655cc93d..5e7cb1eb 100644 --- a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js @@ -5,7 +5,7 @@ * Date: 2023/7/19 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInputNumber, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; import { Modal } from "antd"; import { apiflowWarnConfigGetForm } from "../../../apis/intelligentCalculateSalarySettings"; @@ -66,7 +66,7 @@ class InsufficientTrafficAlert extends Component { label={getLabel(544288, "提醒规则")} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} > - + { + const { onChange, value } = props; + return ( +
+ {getLabel(111, "流量不足")} + + {getLabel(111, "时提醒")} + {getLabel(111, "为确保智能算薪正常使用,设置建议:若每个月消耗流量10,000,则不足10,000时提醒,以此预留一个月时间续流量")} +
+ ); +}; + + diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/interfaceFlowStatistics.js b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/interfaceFlowStatistics.js index 71366383..9c0a5edd 100644 --- a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/interfaceFlowStatistics.js +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/interfaceFlowStatistics.js @@ -5,7 +5,11 @@ * Date: 2023/8/29 */ import React, { Component } from "react"; -import { apiflowStatisticsInfo } from "../../../apis/intelligentCalculateSalarySettings"; +import { Button, message } from "antd"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { apiflowStatisticsInfo, apiflowStatisticsList } from "../../../apis/intelligentCalculateSalarySettings"; + +const getLabel = WeaLocaleProvider.getLabel; class InterfaceFlowStatistics extends Component { constructor(props) { @@ -15,21 +19,28 @@ class InterfaceFlowStatistics extends Component { lastUpdateTime: "", staticData: [ { - key: "total", label: "购买接口总流量", value: "", icon: require("../../../common/purchased.png") + key: "total", + label: getLabel(111, "购买接口总流量"), + value: "", + icon: require("../../../common/purchased.png") }, { - key: "remain", label: "剩余总流量", value: "", icon: require("../../../common/remaining.png") + key: "remain", label: getLabel(111, "剩余总流量"), value: "", icon: require("../../../common/remaining.png") }, { - key: "used", label: "已使用总流量", value: "", icon: require("../../../common/traffic.png") + key: "used", label: getLabel(111, "已使用总流量"), value: "", icon: require("../../../common/traffic.png") } ] - } + }, + columns: [], dataSource: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false }; } componentDidMount() { this.apiflowStatisticsInfo(); + this.apiflowStatisticsList(); } apiflowStatisticsInfo = () => { @@ -50,11 +61,57 @@ class InterfaceFlowStatistics extends Component { } }); }; + apiflowStatisticsList = () => { + const { pageInfo } = this.state; + const payload = { ...pageInfo }; + this.setState({ loading: true }); + apiflowStatisticsList(payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: _.map(columns, item => { + const { dataIndex } = item; + let width = ""; + switch (dataIndex) { + case "taxAgentName": + case "used": + width = "40%"; + break; + default: + width = "10%"; + break; + } + return { ...item, width }; + }) + }); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + }; render() { - const { statisticsInfo } = this.state; + const { statisticsInfo, pageInfo, loading, dataSource, columns } = this.state; const { staticData } = statisticsInfo; - + 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.apiflowStatisticsList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.apiflowStatisticsList()); + } + }; return (
@@ -73,7 +130,23 @@ class InterfaceFlowStatistics extends Component { }) }
-
+
+
+
{getLabel(111, "使用明细")}
+ +
+ ({getLabel(111, "月统计详情")}) + } + ]} + scroll={{ y: `calc(100vh - 190px)` }} + /> +
); } diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/trafficUsageRecords.js b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/trafficUsageRecords.js index 27678e84..6ea92377 100644 --- a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/trafficUsageRecords.js +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/trafficUsageRecords.js @@ -72,14 +72,37 @@ class TrafficUsageRecords extends Component { apiflowRecordList(payload).then(({ status, data }) => { this.setState({ loading: false }); if (status) { - console.log(data); + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: _.map(columns, item => { + const { dataIndex } = item; + let width = ""; + switch (dataIndex) { + case "indexNum": + case "taxAgentName": + case "employeeName": + case "businessTypeName": + case "creator": + case "result": + width = "10%"; + break; + case "idCardNo": + width = "20%"; + break; + default: + break; + } + return { ...item, width }; + }) + }); } }).catch(() => this.setState({ loading: false })); }; render() { const { intelligentStore: { form } } = this.props; - const { conditions, loading, pageInfo } = this.state; + const { conditions, loading, pageInfo, dataSource, columns } = this.state; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -101,9 +124,9 @@ class TrafficUsageRecords extends Component {
{getSearchs(form, conditions, 4, false, this.apiflowRecordList)}
); diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.less b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.less index b29fee75..6fff3639 100644 --- a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.less +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.less @@ -68,6 +68,26 @@ border-bottom: 1px solid #f2f2f2; } } + + .threshold { + display: flex; + align-items: center; + + .before { + margin-right: 6px; + } + + .after { + margin-left: 6px; + margin-right: 16px; + } + + .tip { + display: inline-block; + color: #999; + padding: 6px 0; + } + } } .trafficUsageRecords-layout { @@ -120,6 +140,11 @@ flex-direction: column; justify-content: center; + .data { + color: #111; + font-size: 14px; + } + .title { margin-top: 8px; color: #999; @@ -128,4 +153,20 @@ } } } + + .detail-area { + margin-top: 8px; + + .title { + height: 40px; + display: flex; + align-items: center; + justify-content: space-between; + + .text { + font-size: 14px; + color: #111; + } + } + } }