diff --git a/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js b/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js index d545b9bb..cd51bce3 100644 --- a/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js +++ b/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js @@ -17,3 +17,39 @@ export const apiflowBillingConfigSave = (params) => { export const apiflowBillingConfigEnable = (params) => { return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/billing/config/enable", params); }; +//智能算薪-流量不足提醒初始化表单 +export const apiflowWarnConfigGetForm = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/config/getForm", "GET", params); +}; +//智能算薪-接口流量使用记录 +export const apiflowRecordList = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/record/list", 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); +}; +//智能算薪-流量不足提醒编辑或保存 +export const apiflowWarnConfigSave = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/config/save", params); +}; +//智能算薪-流量不足提醒对象列表 +export const apiflowWarnReceiverList = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/receiver/list", "GET", params); +}; +//智能算薪-编辑保存流量不足提醒对象 +export const apiflowWarnReceiverSave = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/receiver/save", params); +}; +//智能算薪-编辑保存流量不足提醒对象 +export const apiflowWarnReceiverGetForm = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/receiver/getForm", params); +}; +//智能算薪-流量不足提醒对象-删除 +export const apiflowWarnReceiverDelete = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/receiver/delete", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/common/purchased.png b/pc4mobx/hrmSalary/common/purchased.png new file mode 100644 index 00000000..64223fdc Binary files /dev/null and b/pc4mobx/hrmSalary/common/purchased.png differ diff --git a/pc4mobx/hrmSalary/common/remaining.png b/pc4mobx/hrmSalary/common/remaining.png new file mode 100644 index 00000000..655818c0 Binary files /dev/null and b/pc4mobx/hrmSalary/common/remaining.png differ diff --git a/pc4mobx/hrmSalary/common/traffic.png b/pc4mobx/hrmSalary/common/traffic.png new file mode 100644 index 00000000..477bfa10 Binary files /dev/null and b/pc4mobx/hrmSalary/common/traffic.png differ diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index cb13a5ee..683ad7d8 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -139,16 +139,8 @@ const Routes = ( - - + + diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index d43cfb66..5b882dee 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -353,18 +353,10 @@ export default class CalculateDetail extends React.Component { onClick={() => this.downloadTxtfile(accountExceptInfo)}/>); return buttons; }; - const topTab = [ - { - title: "人员确认", - viewcondition: "0" - }, - { - title: "薪资核算", - viewcondition: "1" - } + { title: "人员确认", viewcondition: "0" }, + { title: "薪资核算", viewcondition: "1" } ]; - const adBtn = [ // 高级搜索内部按钮 ]} + > +
+ {getSearchs(remindObjform, remindObjConditions, 1)} +
+ + ); + } +} + +export default EditBeRemindObjDialog; diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/enableSettings.js b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/enableSettings.js index ed849754..61961807 100644 --- a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/enableSettings.js +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/enableSettings.js @@ -13,7 +13,6 @@ import { apiflowBillingConfigGet, apiflowBillingConfigSave } from "../../../apis/intelligentCalculateSalarySettings"; -import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/index.less b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/index.less deleted file mode 100644 index 461a27cc..00000000 --- a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/index.less +++ /dev/null @@ -1,58 +0,0 @@ -.enable-settings { - .swith-area, .userinfo { - display: flex; - align-items: center; - justify-content: space-between; - padding: 10px 16px; - background-color: #fff; - box-sizing: border-box; - height: 80px; - border: 2px solid #e5e5e5; - border-left-color: #5d9cec; - - .left { - padding: 10px 0; - display: flex; - flex-direction: column; - justify-content: space-around; - - .title { - font-size: 14px; - margin-bottom: 4px; - } - - .info { - font-size: 12px; - color: #999; - } - } - } - - .userinfo { - margin-top: 16px; - - .left { - flex: 1 !important; - - .wea-search-group, .wea-form-cell { - padding: 0; - } - } - } -} - -.insufficientAlertWrapper { - background: #fff; - padding: 0; - border: 1px solid #f2f2f2; - border-bottom: none; - - .wea-content { - padding: 0; - - .wea-form-item { - padding: 5px 12px; - border-bottom: 1px solid #f2f2f2; - } - } -} diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js index 9649f2f2..c725a669 100644 --- a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js @@ -5,8 +5,22 @@ * Date: 2023/7/19 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; -import "./index.less"; +import { + WeaButtonIcon, + WeaCheckbox, + WeaFormItem, + WeaInputNumber, + WeaLocaleProvider, + WeaSearchGroup, + WeaTable +} from "ecCom"; +import { message, Modal, Spin } from "antd"; +import EditBeRemindObjDialog from "./editBeRemindObjDialog"; +import { + apiflowWarnConfigGetForm, + apiflowWarnReceiverDelete, + apiflowWarnReceiverList +} from "../../../apis/intelligentCalculateSalarySettings"; const getLabel = WeaLocaleProvider.getLabel; @@ -14,44 +28,237 @@ class InsufficientTrafficAlert extends Component { constructor(props) { super(props); this.state = { - remind: "0" + enable: "0", + remindEvent: { businessId: "", eventId: "", moduleId: "", id: "" }, + threshold: null, channelList: [ + { label: "EMobile", type: "IM", channel: "1", value: "1", config: {} }, + { label: "邮件", type: "email", channel: "3", value: "1", config: {} }, + { label: "短信", type: "message", channel: "4", value: "1", config: {} } + ], columns: [], dataSource: [], + loading: false, remindObjDialog: { visible: false, title: "", warnConfigId: "", id: "" } }; } + componentDidMount() { + this.apiflowWarnConfigGetForm(); + } + + apiflowWarnConfigGetForm = () => { + const { remindEvent } = this.state; + apiflowWarnConfigGetForm().then(({ status, data }) => { + if (status) { + const { enable, businessId, eventId, moduleId, id, threshold } = data; + this.setState({ + enable: enable ? "1" : "0", + remindEvent: { ...remindEvent, businessId, eventId, moduleId, id }, + threshold + }, () => { + this.state.enable === "1" && this.apiflowWarnReceiverList(); + }); + } + }); + }; + apiflowWarnReceiverList = () => { + const { remindEvent } = this.state; + const { id } = remindEvent; + const payload = { + warnConfigId: id || this.props.warnConfigId + }; + apiflowWarnReceiverList(payload).then(({ status, data }) => { + if (status) { + const { columns, list: dataSource } = data; + this.setState({ + dataSource, + columns: _.map(columns, item => { + const { dataIndex } = item; + let width = ""; + switch (dataIndex) { + case "employeeName": + case "mobile": + width = "30%"; + break; + case "email": + width = "40%"; + break; + default: + break; + } + return { ...item, width }; + }) + }); + } + }); + }; + apiflowWarnReceiverDelete = (id) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定删除吗?删除后数据不可找回"), + onOk: () => { + apiflowWarnReceiverDelete({ id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.apiflowWarnReceiverList(); + } else { + message.error(errormsg || getLabel(20462, "删除失败!")); + } + }); + } + }); + }; + handleEnale = (enable) => { + if (enable === "1") { + this.setState({ enable }, () => this.apiflowWarnReceiverList()); + } else { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确认关闭提醒吗?关闭并保存后,流量不足时将无法及时提醒。"), + onOk: () => { + this.setState({ enable }); + }, + onCancel: () => { + this.setState({ enable: this.state.enable }); + } + }); + } + }; + handleChangeChannel = (o) => { + const { channelList } = this.state; + this.setState({ + channelList: _.map(channelList, item => { + if (item.type === o.type) { + return { ...item, ...o }; + } + return { ...item }; + }) + }); + }; + render() { - const { remind } = this.state; + const { + remindEvent, enable, channelList, threshold, + loading, columns, dataSource, remindObjDialog + } = this.state; + const { id } = remindEvent; return ( - this.setState({ remind })}/> + { - remind === "1" && + enable === "1" && - - - - - + this.setState({ threshold: o })}/> + {/**/} + {/* {getLabel(544287, "提醒推送方式")}:*/} + {/* */} + {/* */} + {/* }*/} + {/*>*/} + {/* */} + {/**/} } + { + enable === "1" && +
+
+ {getLabel(111, "提醒对象设置")} + this.setState({ + remindObjDialog: { + ...remindObjDialog, visible: true, title: getLabel(111, "添加提醒对象"), + warnConfigId: id || this.props.warnConfigId + } + })} + /> + {/* 添加提醒对象*/} + this.setState({ + remindObjDialog: { + ...remindObjDialog, visible: false, title: "", warnConfigId: "", id: "" + } + })} + /> +
+ { + loading ?
+ +
: () + } + ]} pagination={false} + scroll={{ y: `calc(100vh - 190px)` }} + /> + } +
+ }
); } } export default InsufficientTrafficAlert; + + +const ReminderRules = (props) => { + const { onChange, value } = props; + return ( +
+ {getLabel(111, "流量不足")} + + {getLabel(111, "时提醒")} + {getLabel(111, "为确保智能算薪正常使用,设置建议:若每个月消耗流量10,000,则不足10,000时提醒,以此预留一个月时间续流量")} +
+ ); +}; + +const Pushmethod = (props) => { + const { onChange, channelList } = props; + return
+ { + _.map(channelList, item => { + const { label, type, value } = item; + return ( +
+ onChange({ ...item, value: o })}/> + {(type !== "email" && value === "1") && } +
+ ); + }) + } +
; +}; + + diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/interfaceFlowStatistics.js b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/interfaceFlowStatistics.js new file mode 100644 index 00000000..f96dc3ea --- /dev/null +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/interfaceFlowStatistics.js @@ -0,0 +1,162 @@ +/* + * Author: 黎永顺 + * name: 智能算薪-接口流量统计 + * Description: + * Date: 2023/8/29 + */ +import React, { Component } from "react"; +import { Button, message, Spin } from "antd"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { apiflowStatisticsInfo, apiflowStatisticsList } from "../../../apis/intelligentCalculateSalarySettings"; + +const getLabel = WeaLocaleProvider.getLabel; + +class InterfaceFlowStatistics extends Component { + constructor(props) { + super(props); + this.state = { + statisticsInfo: { + lastUpdateTime: "", + staticData: [ + { + key: "total", + label: getLabel(111, "购买接口总流量"), + value: "", + icon: require("../../../common/purchased.png") + }, + { + key: "remain", label: getLabel(111, "剩余总流量"), value: "", icon: require("../../../common/remaining.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 = () => { + const { statisticsInfo } = this.state; + apiflowStatisticsInfo().then(({ status, data }) => { + if (status) { + const { lastUpdateTime, ...extraData } = data; + this.setState({ + statisticsInfo: { + ...statisticsInfo, + lastUpdateTime, + staticData: _.map(statisticsInfo.staticData, item => ({ + ...item, + value: extraData[item["key"]] + })) + } + }, () => this.props.updateTime(this.state.statisticsInfo)); + } + }); + }; + 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 })); + }; + handleExport = () => { + window.open(`${window.ecologyContentPath || ""}/api/bs/hrmsalary/taxdeclaration/apiflow/statistics/export`, "_blank"); + }; + + render() { + 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 ( +
+
+ { + _.map(staticData, item => { + const { label, icon, value } = item; + return ( +
+
+
+
{value}
+
{label}
+
+
+ ); + }) + } +
+
+
+
{getLabel(111, "使用明细")}
+ +
+ { + loading ?
+ +
: ({getLabel(111, "月统计详情")}) + } + ]} + scroll={{ y: `calc(100vh - 190px)` }} + /> + } +
+
+ ); + } +} + +export default InterfaceFlowStatistics; diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/trafficUsageRecords.js b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/trafficUsageRecords.js new file mode 100644 index 00000000..6ea92377 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/trafficUsageRecords.js @@ -0,0 +1,136 @@ +/* + * Author: 黎永顺 + * name: 智能算薪-流量使用记录 + * Description: + * Date: 2023/8/28 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { trafficUsageConditions } from "./constants"; +import { getSearchs } from "../../../util"; +import moment from "moment"; +import { apiflowRecordList } from "../../../apis/intelligentCalculateSalarySettings"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore", "intelligentStore") +@observer +class TrafficUsageRecords extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], columns: [], dataSource: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false + }; + } + + componentDidMount() { + const { taxAgentStore: { fetchTaxAgentOption }, intelligentStore: { form } } = this.props; + fetchTaxAgentOption().then(({ data }) => { + this.setState({ + conditions: _.map(trafficUsageConditions, item => { + return { + ...item, + items: _.map(item.items, o => { + if (o.conditionType === "SELECT" && o.domkey[0] === "taxAgentId") { + return { + ...o, + options: [ + { key: "", showname: getLabel(111, "全部(个税扣缴义务人)") }, + ..._.map(data, (i) => ({ key: i.id, showname: i.content })) + ] + }; + } else if (o.conditionType === "SELECT" && o.domkey[0] !== "taxAgentId") { + return { + ...o, + options: _.map(o.options, it => ({ ...it, showname: getLabel(it.lanId, it.showname) })) + }; + } + return { ...o }; + }) + }; + }) + }, () => { + form.initFormFields(this.state.conditions); + form.updateFields({ + ["startDate__endDate"]: { + value: [moment().startOf("month").format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")] + } + }); + this.apiflowRecordList(); + }); + }); + } + + apiflowRecordList = () => { + const { pageInfo } = this.state; + const { intelligentStore: { form } } = this.props; + const payload = { ...form.getFormParams(), ...pageInfo }; + this.setState({ loading: true }); + apiflowRecordList(payload).then(({ status, data }) => { + 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 "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, dataSource, columns } = this.state; + 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.apiflowRecordList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.apiflowRecordList()); + } + }; + return ( +
+
{getSearchs(form, conditions, 4, false, this.apiflowRecordList)}
+ +
+ ); + } +} + +export default TrafficUsageRecords; diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.js b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.js index f6c2984c..6d3625a1 100644 --- a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.js +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.js @@ -1,33 +1,86 @@ import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaReqTop } from "ecCom"; +import { Button, message, Modal } from "antd"; import EnableSettings from "./components/enableSettings"; import InsufficientTrafficAlert from "./components/insufficientTrafficAlert"; +import TrafficUsageRecords from "./components/trafficUsageRecords"; +import InterfaceFlowStatistics from "./components/interfaceFlowStatistics"; +import { apiflowWarnConfigSave } from "../../apis/intelligentCalculateSalarySettings"; +import "./index.less"; +import { convertToUrlString } from "../../util/url"; const getLabel = WeaLocaleProvider.getLabel; const tabs = [ { key: "ENABLE_SETTINGS", title: getLabel(111, "启用设置") }, - // { key: "INTERFACE_FLOW_STATISTICS", title: getLabel(111, "接口流量统计") }, - // { key: "INSUFFICIENT_TRAFFIC_ALERT", title: getLabel(111, "流量不足提醒") }, - // { key: "TRAFFIC_USAGE_RECORD", title: getLabel(111, "流量使用记录") } + { key: "INTERFACE_FLOW_STATISTICS", title: getLabel(111, "接口流量统计") }, + { key: "INSUFFICIENT_TRAFFIC_ALERT", title: getLabel(111, "流量不足提醒") }, + { key: "TRAFFIC_USAGE_RECORD", title: getLabel(111, "流量使用记录") } ]; +@inject("intelligentStore") +@observer class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "ENABLE_SETTINGS" + selectedKey: "ENABLE_SETTINGS", lastUpdateTime: "", + loading: false, warnConfigId: "" }; + this.alertRef = null; } + /* + * Author: 黎永顺 + * Description:流量不足提醒 - 基础信息保存 + * Params: + * Date: 2023/8/29 + */ + saveItaBaseInfo = () => { + const { channelList, enable, threshold, remindEvent } = this.alertRef.state; + const validateError = (enable === "1") && (_.every(channelList, o => o.channel !== "1") || _.isNil(threshold)); + if (validateError) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + const { businessId, id } = remindEvent; + const config = _.map(_.filter(channelList, p => p.value === "1"), o => ({ channel: o.channel, config: o.config })); + const payload = { + id, businessId, threshold, + enable: enable === "1", + config: JSON.stringify(config) + }; + this.setState({ loading: true }); + apiflowWarnConfigSave(payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + this.setState({ warnConfigId: data }); + payload.enable && this.alertRef.apiflowWarnReceiverList(); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + }; renderChildren = () => { - const { selectedKey } = this.state; + const { selectedKey, warnConfigId } = this.state; let CurrentDom = null; switch (selectedKey) { case "ENABLE_SETTINGS": CurrentDom = ; break; + case "INTERFACE_FLOW_STATISTICS": + CurrentDom = + this.setState({ lastUpdateTime: data.lastUpdateTime })}/>; + break; case "INSUFFICIENT_TRAFFIC_ALERT": - CurrentDom = ; + CurrentDom = this.alertRef = dom} warnConfigId={warnConfigId}/>; + break; + case "TRAFFIC_USAGE_RECORD": + CurrentDom = ; break; default: CurrentDom = null; @@ -35,14 +88,29 @@ class Index extends Component { } return CurrentDom; }; + handleExport = () => { + const { intelligentStore: { form } } = this.props; + window.open(`${window.ecologyContentPath || ""}/api/bs/hrmsalary/taxdeclaration/apiflow/record/export?${convertToUrlString(form.getFormParams())}`, "_blank"); + }; render() { - const { selectedKey } = this.state; + const { selectedKey, lastUpdateTime, loading } = this.state; + const buttons = selectedKey === "INSUFFICIENT_TRAFFIC_ALERT" ? + [] : + selectedKey === "TRAFFIC_USAGE_RECORD" ? + [] : + selectedKey === "INTERFACE_FLOW_STATISTICS" ? [ + + {getLabel(111, "最后统计时间:")} + {lastUpdateTime} + + ] : []; return ( } iconBgcolor="#F14A2D" tabDatas={tabs} onChange={selectedKey => this.setState({ selectedKey })} + buttons={buttons} className="intelligentSetting-layout" >
{this.renderChildren()}
diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.less b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.less new file mode 100644 index 00000000..971e3b4e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/index.less @@ -0,0 +1,224 @@ +.intelligentSetting-layout { + .wea-new-top-req-title > div:last-child { + right: 16px !important; + } + + .statistic-time { + display: flex; + align-items: center; + justify-content: flex-end; + font-size: 12px; + } + + .space { + display: flex; + align-items: center; + + .mr10 { + margin-right: 10px; + } + } +} + +.enable-settings { + .swith-area, .userinfo { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 16px; + background-color: #fff; + box-sizing: border-box; + height: 80px; + border: 2px solid #e5e5e5; + border-left-color: #5d9cec; + + .left { + padding: 10px 0; + display: flex; + flex-direction: column; + justify-content: space-around; + + .title { + font-size: 14px; + margin-bottom: 4px; + } + + .info { + font-size: 12px; + color: #999; + } + } + } + + .userinfo { + margin-top: 16px; + + .left { + flex: 1 !important; + + .wea-search-group, .wea-form-cell { + padding: 0; + } + } + } +} + +.insufficientAlertWrapper { + background: #fff; + padding: 0; + border: 1px solid #f2f2f2; + border-bottom: none; + + .flex { + display: flex; + } + + .items-center { + align-items: center; + } + + .wea-content { + padding: 0; + + .wea-form-item { + padding: 5px 12px; + border-bottom: 1px solid #f2f2f2; + } + } + + .threshold { + display: flex; + align-items: center; + + .before { + margin-right: 6px; + } + + .after { + margin-left: 16px; + margin-right: 16px; + } + + .tip { + display: inline-block; + color: #999; + padding: 6px 0; + } + } + + .channel-list { + display: flex; + align-items: center; + + & > .channel-item:not(:first-child) { + margin-left: 16px; + } + + .channel-item { + display: inline-flex; + align-items: center; + min-height: 30px; + } + + .icon-coms-Flow-setting { + font-size: 16px; + cursor: pointer; + margin-top: 5px; + } + } + + .table { + .title { + height: 40px; + justify-content: space-between; + background: #f6f6f6; + + .titleLeft { + font-size: 14px; + color: #111; + padding: 0; + } + } + } +} + +.trafficUsageRecords-layout { + height: 100%; + box-sizing: border-box; + + .head { + margin-bottom: 16px; + + .wea-search-group { + width: 80%; + } + + .wea-search-group, .wea-content, .wea-form-cell, .wea-form-item { + padding: 0; + } + } +} + +.statisticsInfo-layout { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + + .static-data { + display: flex; + align-items: center; + justify-content: space-around; + height: 80px; + background-color: #fff; + border: 2px solid #e5e5e5; + + .item { + display: flex; + + .left { + width: 65px; + height: 65px; + + img { + width: 100%; + height: 100% + } + } + + .right { + margin-left: 8px; + display: flex; + flex-direction: column; + justify-content: center; + + .data { + color: #111; + font-size: 14px; + } + + .title { + margin-top: 8px; + color: #999; + font-size: 14px; + } + } + } + } + + .detail-area { + margin-top: 8px; + + .title { + height: 40px; + display: flex; + align-items: center; + justify-content: space-between; + + .text { + font-size: 14px; + color: #111; + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemEditSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemEditSlide.js index de0c2871..d476edbd 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemEditSlide.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemEditSlide.js @@ -23,7 +23,7 @@ class LedgerSalaryItemEditSlide extends Component { const key = Object.keys(params)[0]; this.props.onUpdateRequest(request, key); }; - handleShowFormal = () => this.props.onEditFormnul(); + handleShowFormal = (salaryItemName) => this.props.onEditFormnul(salaryItemName); render() { return ( diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js index 5a3167e9..2e48ba54 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js @@ -147,7 +147,7 @@ class LedgerSalaryItemNormal extends Component { const newDateSource = _.map(dataSource, item => { return { ...item, - items: _.filter(item.items || [], child => child.name.indexOf(salaryItemKeywords) !== -1) + items: _.filter(item.items || [], child => (child.name.indexOf(salaryItemKeywords) !== -1 || child.formulaContent.indexOf(salaryItemKeywords) !== -1)) }; }); return ( @@ -262,7 +262,7 @@ const TitleComp = (props) => { } ; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js index 57522e83..123b74ab 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js @@ -28,7 +28,8 @@ class LedgerSalaryItemTable extends Component { visible: false, formulaId: "", valueType: "", - dataType: "" + dataType: "", + name: "" } }; } @@ -163,13 +164,13 @@ class LedgerSalaryItemTable extends Component { originSqlContent: ((valueType.toString() === "2" && (!originFormulaContent || originFormulaContent === " ")) || (valueType.toString() === "1") || (valueType.toString() === "2" && originFormulaContent)) ? " " : originSqlContent }, salaryItemId); }; - handleEditFormnul = () => { + handleEditFormnul = (salaryItemName) => { const { salaryItemPayload, editFormulModal } = this.state; const { record } = salaryItemPayload; const { valueType, formulaId, dataType, originFormulaContent, originSqlContent } = record; this.setState({ editFormulModal: { - ...editFormulModal, visible: true, valueType, dataType, + ...editFormulModal, visible: true, valueType, dataType, name: salaryItemName, formulaId: ((valueType.toString() === "2" && (originFormulaContent || originFormulaContent !== " ")) || valueType.toString() === "3" && (originSqlContent || originSqlContent === " ")) ? formulaId : "" } }); @@ -180,7 +181,7 @@ class LedgerSalaryItemTable extends Component { editFormulModal: { ...editFormulModal, visible: false, - formulaId: "", + formulaId: "", name: "", valueType: "", dataType: "" } }); @@ -255,9 +256,9 @@ class LedgerSalaryItemTable extends Component { dataIndex: "valueType", key: "valueType", render: (e, record) => { - const { valueType } = record; + const { valueType, formulaContent } = record; const key = !_.isNil(valueType) ? valueType : ""; - return {key.toString() === "1" ? "输入" : key.toString() === "2" ? "自定义公式" : key.toString() === "3" ? "SQL" : ""} ; + return {key.toString() === "1" ? "输入" : key.toString() === "2" ? formulaContent : key.toString() === "3" ? formulaContent : ""} ; } }, { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 7ad8bb01..8116c06a 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -189,7 +189,7 @@ export default class MobilePayroll extends React.Component { salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : []} > { - (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0") && + (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0")) && { - (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0") && + (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0")) && { - (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0") && + (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0")) && this.salaryArchivePreview(params)} importFile={(params) => this.handleImportFile(params)} - templateLink={ - "/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=" + params + templateLink={`/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=${params}&${convertToUrlString(searchItemsValue)}` } visiable={importParams.visible} onCancel={() => { diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 1cf37553..74326a8f 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -433,6 +433,7 @@ class Index extends Component { { this.query(); this.setState({ selectedRowKeys: [] }); @@ -523,6 +524,7 @@ class Index extends Component { { this.query(); this.setState({ selectedRowKeys: [] }); @@ -834,6 +836,7 @@ class Index extends Component {
this.importRef = dom} + searchItemsValue={this.state.searchItemsValue} refreshList={() => { this.query(); this.setState({ selectedRowKeys: [] }); diff --git a/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js b/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js index 0837dfa9..f3c01f9a 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js @@ -162,7 +162,7 @@ export default class SalaryFileViewSlide extends React.Component { item.dataType === "number" ? { item.value = value; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index fe601cc5..9e407f56 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -8,7 +8,8 @@ export default class CustomSalaryItemSlide extends React.Component { super(props); this.state = { showForm: false, - formalModalVisible: false + formalModalVisible: false, + salaryItemName: "" }; } @@ -16,9 +17,10 @@ export default class CustomSalaryItemSlide extends React.Component { this.props.onChange({ ...this.props.request, ...params }); }; - handleShowFormal = () => { + handleShowFormal = (salaryItemName) => { this.setState({ - formalModalVisible: true + formalModalVisible: true, + salaryItemName }); }; @@ -34,12 +36,13 @@ export default class CustomSalaryItemSlide extends React.Component { render() { const { request } = this.props; const { valueType, dataType, formulaId } = request; - const { formalModalVisible } = this.state; + const { formalModalVisible, salaryItemName } = this.state; return (
{formalModalVisible && this.setState({ - formalModalVisible: false + formalModalVisible: false, + salaryItemName: "" })} />}
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js index 58808c61..98c706fc 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js @@ -208,7 +208,7 @@ export default class FormalFormModal extends React.Component { }); this.parameters = result; let params = { - name: "公式1", + name: this.props.name || "公式1", description: "备注", module: "salary", useFor: "salaryitem", diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js index 73418bad..16a8a099 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js @@ -133,7 +133,7 @@ class SalaryItemForm extends Component { (type === "INPUT" && display) ? (key === "originSqlContent" || key === "originFormulaContent") && onShowFormal()} + onClick={() => (key === "originSqlContent" || key === "originFormulaContent") && onShowFormal(request["name"])} onChange={v => this.handleChangeSalaryFiledItems(key, v)}/> : (type === "SWITCH" && display) ? diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 8b078187..cab89a87 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -293,8 +293,10 @@ export default class Archives extends React.Component { // 模板点击 handleTemplateLinkClick = (exportData) => { + const { archivesStore: { form } } = this.props; + const formParams = form.getFormParams() || {}; const { selectedKey } = this.state; - let url = `/api/bs/hrmsalary/scheme/template/export?exportData=${exportData}&runStatuses=${selectedKey === "pending" ? "1" : "2,3"}`; + let url = `/api/bs/hrmsalary/scheme/template/export?exportData=${exportData}&runStatuses=${selectedKey === "pending" ? "1" : "2,3"}&${convertToUrlString(formParams)}`; window.open(`${window.location.origin}${url}`); }; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js index 3e7ebcfa..fabf6a86 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js @@ -203,7 +203,7 @@ export default class DefaultSlideForm extends React.Component { return ( { this.updateDataSource(record, v, "paymentProportion"); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 9ed9d668..7bb28208 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -2,12 +2,26 @@ display: flex; flex-direction: column; height: 100%; + background: #f6f6f6; + + .wea-new-top-req-wapper .wea-new-top-req-main { + background: #f6f6f6 !important; + } + + .wea-new-top-req-wapper .wea-new-top-req { + z-index: 0 !important; + } + + .wea-search-tab, .wea-input-focus { + background: #f6f6f6; + } .normalWapper { - flex: 1; + height: 100%; display: flex; flex-direction: column; overflow: hidden; + padding: 0 16px; .tableWrapper { flex: 1; @@ -16,12 +30,18 @@ .ant-spin-nested-loading, .ant-spin-container { height: 100%; } + + .wea-new-table { + background: #fff; + } } .topContent { padding: 8px 20px; display: flex; align-items: center; + background: #fff; + margin-top: 16px; .month { margin-right: 26px; @@ -69,14 +89,16 @@ //退差;补差 .regressionWrapper, .differenceWrapper { - flex: 1; + height: 100%; overflow: hidden; display: flex; flex-direction: column; + padding: 16px; .tableWrapper { flex: 1; overflow: hidden; + .ant-spin-nested-loading, .ant-spin-container { height: 100%; } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js index a5ae1a93..f58a9740 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js @@ -6,13 +6,15 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaTab } from "ecCom"; +import { WeaLocaleProvider, WeaReqTop } from "ecCom"; import NormalIndex from "./components/normal"; import OverViewIndex from "./components/overView"; import AbnormalListIndex from "./components/abnormalList"; import Regression from "./components/regression"; import MakeupDifference from "./components/makeupDifference"; +const { getLabel } = WeaLocaleProvider; + @inject("standingBookStore") @observer class StandingBookDetail extends Component { @@ -43,7 +45,7 @@ class StandingBookDetail extends Component { newTabList.push(newTabList.splice(_.findIndex(newTabList, it => it.id === "4"), 1)[0]); this.setState({ selectedKey: newTabList[0].id, - tabList: _.map(newTabList, it => ({ title: it.content, viewcondition: it.id })), + tabList: _.map(newTabList, it => ({ title: it.content, key: it.id })), remarks, billMonth }); }); @@ -53,33 +55,31 @@ class StandingBookDetail extends Component { const { selectedKey, tabList, remarks, billMonth } = this.state; return (
- { - this.setState({ selectedKey }); - }} - /> - { - (selectedKey === "1" || selectedKey === "3") && - - } - { - selectedKey === "2" && - - } - { - selectedKey === "4" && - - } - { - selectedKey === "5" && - } - { - selectedKey === "6" && - } + } + iconBgcolor="#F14A2D" showDropIcon={false} tabDatas={tabList} selectedKey={selectedKey} + onChange={selectedKey => this.setState({ selectedKey })} + > + { + (selectedKey === "1" || selectedKey === "3") && + + } + { + selectedKey === "2" && + + } + { + selectedKey === "4" && + + } + { + selectedKey === "5" && + } + { + selectedKey === "6" && + } +
); } diff --git a/pc4mobx/hrmSalary/stores/index.js b/pc4mobx/hrmSalary/stores/index.js index 7d14ab86..fdc926a3 100644 --- a/pc4mobx/hrmSalary/stores/index.js +++ b/pc4mobx/hrmSalary/stores/index.js @@ -20,6 +20,7 @@ import { PayrollFilesStore } from "./payrollFiles"; import { SpecialAddStore } from "./specialAdd"; import { ExternalPersonManageStore } from "./externalPersonManage"; import { EmployeeDeclareStore } from "./employeeDeclare"; +import { IntelligentStore } from "./intelligent"; module.exports = { baseFormStore: new BaseFormStore(), @@ -43,5 +44,6 @@ module.exports = { payrollFilesStore: new PayrollFilesStore(), specialAddStore: new SpecialAddStore(), externalPersonManageStore: new ExternalPersonManageStore(), - employeeDeclareStore: new EmployeeDeclareStore() + employeeDeclareStore: new EmployeeDeclareStore(), + intelligentStore: new IntelligentStore(), }; diff --git a/pc4mobx/hrmSalary/stores/intelligent.js b/pc4mobx/hrmSalary/stores/intelligent.js new file mode 100644 index 00000000..7d0caf9b --- /dev/null +++ b/pc4mobx/hrmSalary/stores/intelligent.js @@ -0,0 +1,14 @@ +import { action, observable } from "mobx"; +import { WeaForm, WeaTableNew } from "comsMobx"; + +const { TableStore } = WeaTableNew; + +export class IntelligentStore { + @observable form = new WeaForm(); //流量使用记录查询form实例 + @observable remindObjform = new WeaForm(); //流量使用记录查询form实例 + @observable tableStore = new TableStore(); + + @action("...") + Init = () => { + }; +}