From 1de3de5fb52678b8f4e38b727c2c843aeafa0c9d Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Tue, 8 Mar 2022 16:45:33 +0800 Subject: [PATCH] =?UTF-8?q?cumDeduct=E5=88=97=E8=A1=A8=E5=8F=8A=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/importModal/modalStep1.js | 27 ++++++++---- .../pages/dataAcquisition/cumDeduct/index.js | 43 +++++++++++-------- pc4mobx/hrmSalary/stores/cumDeduct.js | 8 ++-- 3 files changed, 48 insertions(+), 30 deletions(-) diff --git a/pc4mobx/hrmSalary/components/importModal/modalStep1.js b/pc4mobx/hrmSalary/components/importModal/modalStep1.js index ca620e26..c9bf0b1c 100644 --- a/pc4mobx/hrmSalary/components/importModal/modalStep1.js +++ b/pc4mobx/hrmSalary/components/importModal/modalStep1.js @@ -1,20 +1,30 @@ import React from 'react' -import { WeaSteps, WeaDatePicker, WeaInput } from 'ecCom'; +import { WeaSteps, WeaDatePicker, WeaInput, WeaSelect } from 'ecCom'; +import { inject, observer } from 'mobx-react'; import { Upload, Icon, Row, Col, Button } from "antd"; import uploadImg from './upload.svg' const Dragger = Upload.Dragger; +@inject("taxAgentStore") +@observer export default class ModalStep1 extends React.Component { constructor(props) { super(props) this.state = { datetime: "", - personValue: "" + taxAgentId: "" } } + + componentWillMount() { // 初始化渲染页面 + const { taxAgentStore: {fetchTaxAgentOption} } = this.props; + fetchTaxAgentOption(); + } + render() { - const { datetime, personValue } = this.state + const { datetime, taxAgentId } = this.state + const { taxAgentStore: {taxAgentOption} } = this.props; return (
@@ -34,12 +44,13 @@ export default class ModalStep1 extends React.Component { 个税扣缴义务人 - { - this.setState({ personValue: value }); + options={taxAgentOption} + value={taxAgentId} + onChange={v => { + this.setState({ taxAgentId: v }); }} /> diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 96b5d0fe..5c6586a1 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -32,16 +32,17 @@ export default class CumDeduct extends React.Component { taxAgentId: "" } } - + componentWillMount() { // 初始化渲染页面 - const { cumDeductStore: { doInit }, taxAgentStore: {fetchTaxAgentOption} } = this.props; + const { cumDeductStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props; doInit(); fetchTaxAgentOption(); } getSearchsAdQuick() { const { monthValue, taxAgentId } = this.state; - const { taxAgentStore: {taxAgentOption }} = this.props; + + const { taxAgentStore: { taxAgentOption }, cumDeductStore: {form, getTableDatas} } = this.props; return (
@@ -50,7 +51,10 @@ export default class CumDeduct extends React.Component { value={monthValue} format="YYYY-MM" width={200} - onChange={value => this.setState({ monthValue: value })} + onChange={v => { + this.setState({monthValue: v}) + getTableDatas({ declareMonth: [v] }) + }} />
@@ -70,25 +74,26 @@ export default class CumDeduct extends React.Component { options={taxAgentOption} value={taxAgentId} onChange={v => { - this.setState({ taxAgentId: v }); + this.setState({taxAgentId: v}) + getTableDatas({ taxAgentId: v }) }} />
- ) + ) } render() { const { cumDeductStore, taxAgentStore } = this.props; - const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = cumDeductStore; + const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = cumDeductStore; const { taxAgentOption } = taxAgentStore - + if (!hasRight && !loading) { // 无权限处理 return renderNoright(); } const rightMenu = [// 右键菜单 - { + { key: 'BTN_COLUMN', icon: , content: '显示列定制', @@ -127,7 +132,7 @@ export default class CumDeduct extends React.Component { visiable: true }) } - + const menu = ( @@ -136,13 +141,13 @@ export default class CumDeduct extends React.Component { ); const btns = [ - , + , 导出全部 ] - + return (
@@ -158,9 +163,9 @@ export default class CumDeduct extends React.Component { dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 buttons={btns} > - +
- +
+ comsWeaTableStore={tableStore} // table store + hasOrder={true} // 是否启用排序 + needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度 + /> - {this.setState({visiable: false})}}/> + { this.setState({ visiable: false }) }} />
) } diff --git a/pc4mobx/hrmSalary/stores/cumDeduct.js b/pc4mobx/hrmSalary/stores/cumDeduct.js index c2669f38..2bd250c4 100644 --- a/pc4mobx/hrmSalary/stores/cumDeduct.js +++ b/pc4mobx/hrmSalary/stores/cumDeduct.js @@ -38,12 +38,14 @@ export class CumDeductStore { // 渲染table数据 @action - getTableDatas = (toFirstPage = true) => { + getTableDatas = (params) => { + params = params || {}; this.loading = true; - let params = this.form.getFormParams() || {}; + let requestParams = this.form.getFormParams() || {}; + requestParams = {...requestParams, ...params} API.getCumDeductList(params).then(action(res => { if (res.status) { // 接口请求成功/失败处理 - toFirstPage ? this.tableStore.getDatas(res.data.datas, 1) : this.tableStore.getDatas(res.data.datas); // table 请求数据 + this.tableStore.getDatas(res.data.datas); // table 请求数据 } else { message.error(res.msg || '接口调用失败!') }