From ae43a2aa7cc313cf7362f28255b5944006dc7695 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 18 Apr 2025 16:21:49 +0800 Subject: [PATCH] release/2.19.1.2501.01 --- .../hrmSalary/pages/calculate/calculate.js | 56 +++++++++++++++---- .../components/calculateQuery/index.js | 2 +- .../components/calculateTablelist/index.js | 8 ++- pc4mobx/hrmSalary/pages/calculate/config.js | 19 +++++++ pc4mobx/hrmSalary/pages/calculate/index.less | 26 +++++++++ 5 files changed, 97 insertions(+), 14 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/calculate/config.js diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index e6207394..b23739b8 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -6,7 +6,8 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom"; +import { WeaForm } from "comsMobx"; import { Button, message, Modal } from "antd"; import moment from "moment"; import CalculateQuery from "./components/calculateQuery"; @@ -15,9 +16,15 @@ import CalculateDialog from "./components/calculateDialog"; import ProgressModal from "../../components/progressModal"; import LogDialog from "../../components/logViewModal"; import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate"; +import FormInfo from "../../components/FormInfo"; +import { queryConditions } from "./config"; +import { getTaxAgentSelectList } from "../../apis/taxAgent"; +import cs from "classnames"; import "./index.less"; +const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; +const form = new WeaForm(); @inject("calculateStore", "taxAgentStore") @observer @@ -31,17 +38,32 @@ class Calculate extends Component { moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), moment(new Date()).endOf("year").format("YYYY-MM") ] - }, isRefresh: false, logDialogVisible: false, + }, isRefresh: false, logDialogVisible: false, conditions: [], progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") }, - calcDaialog: { visible: false, title: "" } + calcDaialog: { visible: false, title: "" }, showAdvance: false }; this.timer = null; this.handleDebounce = null; } + async componentDidMount() { + const { data } = await getTaxAgentSelectList(); + this.setState({ + conditions: _.map(queryConditions, item => ({ + ...item, items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label) }; + if (getKey(o) === "taxAgentIds") { + return { ...o, options: _.map(data, k => ({ key: k.id, showname: k.content })) }; + } + return { ...o }; + }) + })) + }, () => form.initFormFields(this.state.conditions)); + } + renderCalculateOpts = () => { const { taxAgentStore: { showOperateBtn } } = this.props; - const { queryParams, isRefresh } = this.state; + const { queryParams, isRefresh, showAdvance } = this.state; let calculateOpts = [ this.setState({ calcDaialog: { @@ -49,10 +71,11 @@ class Calculate extends Component { title: getLabel(538780, "核算") } })}>{getLabel(538780, "核算")}, - this.setState({ - isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, - queryParams: { ...queryParams, ...v } - })} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> + this.setState({ showAdvance: !showAdvance })} + onChange={v => this.setState({ + isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, + queryParams: { ...queryParams, ...v } + })} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> ]; return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts; }; @@ -188,7 +211,9 @@ class Calculate extends Component { }; render() { - const { queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions } = this.state; + const { + queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance + } = this.state; return ( } iconBgcolor="#F14A2D" buttons={this.renderCalculateOpts()} className="calculate-main-layout" showDropIcon @@ -201,7 +226,18 @@ class Calculate extends Component { ]} > - + + + + this.setState({ isRefresh: !isRefresh })}>{getLabel(111, "搜索")} + form.resetForm()}>{getLabel(111, "重置")} + this.setState({ showAdvance: !showAdvance })}>{getLabel(111, "取消")} + + + this.setState({ calcDaialog: { ...calcDaialog, visible: false }, diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js index e8e89b97..0c74ccd5 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js @@ -27,7 +27,7 @@ class Index extends Component { onChange={v => this.props.onChange({ name: v })} onSearch={this.props.onSearch} /> - {getLabel(111, "高级搜索")} + {getLabel(111, "高级搜索")} ); diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js index eecfa1db..63ab2e87 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js @@ -29,12 +29,14 @@ class Index extends Component { } getSalaryAcctList = (props) => { - const { pageInfo } = this.state; - const { queryParams } = props; + const { pageInfo } = this.state, { queryParams, form } = props; + const { taxAgentIds } = form.getFormParams(); const { dateRange, ...extra } = queryParams; const [startMonthStr, endMonthStr] = dateRange || []; const params = { startMonthStr, endMonthStr, ...extra }; - const payload = { ...pageInfo, ...params }; + const payload = { + ...pageInfo, ...params, taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [] + }; this.setState({ loading: true }); getSalaryAcctList(payload).then(({ status, data }) => { this.setState({ loading: false }); diff --git a/pc4mobx/hrmSalary/pages/calculate/config.js b/pc4mobx/hrmSalary/pages/calculate/config.js new file mode 100644 index 00000000..02da5b10 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/config.js @@ -0,0 +1,19 @@ +export const queryConditions = [ + { + items: [ + { + conditionType: "SELECT", + domkey: ["taxAgentIds"], + fieldcol: 14, + label: "个税扣缴义务人", + lanI: 111, + multiple: true, + options: [], + labelcol: 6, + value: "", + viewAttr: 2 + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index d7f45047..2e73f6b2 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -90,6 +90,32 @@ overflow-y: hidden; } + .advance-calc { + display: none; + background: #FFF; + margin-bottom: 8px; + + .advance-calc-btns { + display: flex; + justify-content: center; + align-items: center; + padding: 15px 0; + border-top: 1px solid #dadada; + + button { + margin-right: 15px; + } + } + + .wea-search-group, .wea-content { + padding: 0; + } + } + + .show-advance-calc { + display: block; + } + .calculate-body { height: 100%; width: 100%;