diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js index 53a96c2b..415f7e33 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js @@ -30,11 +30,13 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { const { importDialog } = this.state; if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { baseTableStore: { VSalryForm } } = nextProps; - const payload = { ...VSalryForm.getFormParams(), hasData: importDialog.hasData }; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = nextProps; + const payload = { + ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), hasData: importDialog.hasData + }; this.setState({ importDialog: { - ...importDialog, salaryMonth: VSalryForm.getFormParams().salaryMonth, + ...importDialog, salaryMonth: VExtraSalryForm.getFormParams().salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } }); @@ -49,10 +51,10 @@ class Index extends Component { } handleImport = (payload) => { - const { baseTableStore: { VSalryForm } } = this.props; + const { baseTableStore: { VExtraSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth } = importDialog; - const { taxAgentIds } = VSalryForm.getFormParams(); + const { taxAgentIds } = VExtraSalryForm.getFormParams(); this.setState({ importDialog: { ...importDialog, nextloading: true } }); API.importVariableSalary({ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") @@ -66,14 +68,17 @@ class Index extends Component { }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); }; renderFormComponent = () => { - const { baseTableStore: { VSalryForm } } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth: month, hasData } = importDialog; return
{ - const payload = { ...VSalryForm.getFormParams(), salaryMonth: val, hasData }; + const payload = { + ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), + salaryMonth: val, hasData + }; this.setState({ importDialog: { ...importDialog, salaryMonth: val, @@ -100,9 +105,12 @@ class Index extends Component { content={getLabel(543208, "导出现有数据")} helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")} onChange={val => { - const { baseTableStore: { VSalryForm } } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props; const { salaryMonth } = importDialog; - const payload = { salaryMonth, ...VSalryForm.getFormParams(), hasData: val === "1" }; + const payload = { + salaryMonth, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), + hasData: val === "1" + }; this.setState({ importDialog: { ...importDialog, hasData: val === "1", diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index 6b4fcf8b..01969697 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -9,14 +9,20 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; import { WeaTableNew } from "comsMobx"; import { message, Modal, Spin } from "antd"; import * as API from "../../../../apis/variableSalary"; +import { getSearchs } from "../../../../util"; +import { extraConditions } from "../../conditions"; +import AdvanceInputBtn from "../advanceInputBtn"; +import SearchPannel from "../searchPannel"; import { toJS } from "mobx"; +import cs from "classnames"; const WeaTableComx = WeaTableNew.WeaTable; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; @inject("baseTableStore") @observer @@ -25,11 +31,30 @@ class Index extends Component { super(props); this.state = { pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [], - selectedRowKeys: [] + selectedRowKeys: [], condtions: [], showSearchAd: false }; } - componentDidMount() { + async componentDidMount() { + const { data: taxAgentOption } = await API.getAdminTaxAgentList(); + this.setState({ + condtions: _.map(extraConditions, item => { + return { + ...item, items: _.map(item.items, child => { + if (getKey(child) === "taxAgentIds") { + return { + ...child, label: getLabel(child.lanId, child.label), + options: _.map(taxAgentOption, o => ({ key: o.id, showname: o.content })) + }; + } + return { ...child, label: getLabel(child.lanId, child.label) }; + }) + }; + }) + }, () => { + const { baseTableStore: { VExtraSalryForm } } = this.props; + VExtraSalryForm.initFormFields(this.state.condtions); + }); window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", this.handleResize, false); this.getVariableSalaryList(); @@ -73,12 +98,12 @@ class Index extends Component { } }; getVariableSalaryList = () => { - const { baseTableStore: { VSalryForm, getVariableSalaryList } } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm, getVariableSalaryList } } = this.props; const { pageInfo } = this.state; - const { departmentIds, taxAgentIds } = VSalryForm.getFormParams(); + const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); getVariableSalaryList({ - ...pageInfo, ...VSalryForm.getFormParams(), + ...pageInfo, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") }).then(({ status, data }) => { @@ -137,17 +162,26 @@ class Index extends Component { const childFrameObj = document.getElementById("unitTable"); childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; + openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); render() { - const { loading, dataSource } = this.state; - const { baseTableStore: { SFTableStore } } = this.props; + const { loading, dataSource, condtions, showSearchAd } = this.state; + const { baseTableStore: { SFTableStore, VExtraSalryForm } } = this.props; const dom = document.querySelector(".wea-new-top-req-content"); let height = 280; if (dom && dataSource.length > 0) { - height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 16; + height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 62; } return ( +
+ {getSearchs(VExtraSalryForm, condtions, 2, false, () => this.getVariableSalaryList())} + this.openAdvanceSearch()} + onAdvanceSearch={() => this.getVariableSalaryList()}/> +
+
+ this.setState({ showSearchAd: false })} onAdSearch={this.handleAdvanceSearch}/> +