From 658f4fa64ff9f80112ebab01334e85e8c9c3b6be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sat, 14 Sep 2024 09:55:54 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E9=A2=86=E6=82=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apis/custom-apis/lingyue/index.js | 6 ++++ .../components/CustomSelect/index.js | 32 ++++++++++++------- .../components/CustomSelect/index.less | 15 +++++++++ .../pages/custom-pages/lingyue/layout.js | 11 ++++--- .../lingyue/salarySummary/index.js | 21 +++++++++--- 5 files changed, 65 insertions(+), 20 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js b/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js index b0a1d330..2ea772ea 100644 --- a/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js +++ b/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js @@ -49,3 +49,9 @@ export const getHistoryVoucherDetailList = (params) => { export const deleteHistoryVoucher = (params) => { return postFetch("/api/bs/hrmsalary/ly/PZ/deleteHistoryVoucher", params); }; +export const getSalaryReportFFgsList = (params) => { + return postFetch("/api/bs/hrmsalary/ly/salaryReport/ffgsList", params); +}; +export const getSIReportGmgsList = (params) => { + return postFetch("/api/bs/hrmsalary/ly/PZ/SIReport/gmgsList", params); +}; diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.js b/pc4mobx/hrmSalary/components/CustomSelect/index.js index 73bed78b..3ec7c4ec 100644 --- a/pc4mobx/hrmSalary/components/CustomSelect/index.js +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.js @@ -10,7 +10,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; import classNames from "classnames"; -import { Button, Select } from "antd"; +import { Select } from "antd"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -20,7 +20,7 @@ class Index extends Component { constructor(props) { super(props); this.state = { - loading: false, data: [], activeKey: "", dropdownWidth: 200 + visible: false, dropdownWidth: 200, value: props.value || "" }; this.selectedData = {}; } @@ -33,14 +33,21 @@ class Index extends Component { } } + handleChange = (value) => { + this.setState({ value }); + typeof this.props.onChange == "function" && + this.props.onChange(`${value}`); + }; + render() { - const { data, dropdownWidth } = this.state; + const { dropdownWidth, visible } = this.state; + const { options, defaultValue, value } = this.props; const clsname = classNames({ - "mr12": true, "wea-associative-search-mult": true }); + console.log(value); return ( -
+
-
); diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.less b/pc4mobx/hrmSalary/components/CustomSelect/index.less index e69de29b..50ca418a 100644 --- a/pc4mobx/hrmSalary/components/CustomSelect/index.less +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.less @@ -0,0 +1,15 @@ +.customMuiSelect { + .ant-input-group-wrap { + i { + padding-left: 2px !important; + padding-right: 2px !important; + padding-top: 0; + padding-bottom: 0; + line-height: 28px; + height: 28px; + border-radius: 2px; + color: #333 !important; + } + } + +} diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js index 523ae681..ca830667 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js @@ -9,7 +9,8 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaDatePicker, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaTop } from "ecCom"; +import { WeaDatePicker, WeaFormItem, WeaLocaleProvider, WeaTop } from "ecCom"; +import CustomSelect from "../../../components/CustomSelect"; import { Button } from "antd"; import "./index.less"; @@ -20,7 +21,8 @@ const getLabel = WeaLocaleProvider.getLabel; class Layout extends Component { render() { const { - title, query, onChange, listRef, isQuery, lyAuth = false, ffgsqcLabel, taxAgentStore: { salaryManager } + title, query, onChange, listRef, isQuery, lyAuth = false, ffgsqcLabel, taxAgentStore: { salaryManager }, + companyOpts } = this.props; const { salaryMonth, ffgsqc } = query; let buttons = [ @@ -31,8 +33,9 @@ class Layout extends Component { onChange={value => onChange({ ...query, salaryMonth: value, isQuery: !isQuery })}/> , - onChange({ ...query, ffgsqc: value })} - onSearch={() => onChange({ ...query, isQuery: !isQuery })}/> + console.log(val)}/> + {/* onChange({ ...query, ffgsqc: value })}*/} + {/* onSearch={() => onChange({ ...query, isQuery: !isQuery })}/>*/} ]; const dropMenuDatas = [ diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js index 9181f188..147bca7a 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js @@ -20,23 +20,36 @@ class Index extends Component { constructor(props) { super(props); this.state = { - query: { salaryMonth: moment().format("YYYY-MM"), ffgsqc: "" }, isQuery: false, lyAuth: false + query: { salaryMonth: moment().format("YYYY-MM"), ffgsqc: "" }, isQuery: false, lyAuth: false, + companyOpts: [] }; this.listRef = null; } componentDidMount() { API.getLYPermission().then(({ status, data }) => this.setState({ lyAuth: !!status && !!data })); + this.getSalaryReportFFgsList(); } + getSalaryReportFFgsList = () => { + const { query } = this.state; + const { salaryMonth } = query; + API.getSalaryReportFFgsList({ salaryMonth }).then(({ status, data }) => { + if (status) this.setState({ companyOpts: _.map(data, o => ({ ...o, name: o.content })) }); + }); + }; handleLayoutChange = ({ isQuery, ...val }) => this.setState({ query: { ...this.state.query, ...val } }, - () => this.setState({ isQuery })); + () => { + this.getSalaryReportFFgsList(); + this.setState({ isQuery }); + }); render() { - const { query, isQuery, lyAuth } = this.state; + const { query, isQuery, lyAuth, companyOpts } = this.state; return ( + companyOpts={companyOpts} listRef={this.listRef} + isQuery={isQuery} lyAuth={lyAuth} ffgsqcLabel={getLabel(111, "发放公司全称")}> this.listRef = dom} onInit={() => this.forceUpdate()} ffgsqcLabel={getLabel(111, "发放公司全称")}/>