custom/领悦
This commit is contained in:
parent
3f65ce2e1c
commit
658f4fa64f
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div className={`wea-associative-search ${clsname}`} ref="customSelectMui">
|
||||
<div className={`customMuiSelect wea-associative-search ${clsname}`} ref="customSelectMui">
|
||||
<Select
|
||||
{...this.props}
|
||||
hasScroll={false}
|
||||
|
|
@ -50,18 +57,19 @@ class Index extends Component {
|
|||
multiple={true}
|
||||
notFoundContent=""
|
||||
defaultActiveFirstOption={true}
|
||||
showArrow={false}
|
||||
filterOption={false}
|
||||
defaultValue={selectedValues}
|
||||
value={selectedValues}
|
||||
showArrow={true}
|
||||
filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
|
||||
defaultValue={defaultValue}
|
||||
value={value}
|
||||
dropdownStyle={{ minWidth: dropdownWidth }}
|
||||
onSearch={_.debounce(this.handleSearch, 400)}
|
||||
onChange={this.handleChange}
|
||||
onBlur={() => this.setState({ visible: !visible })}
|
||||
onFocus={() => this.setState({ visible: !visible })}
|
||||
>
|
||||
{options}
|
||||
{options.map(d => <Option key={d.id} title={d.name}>{d.name}</Option>)}
|
||||
</Select>
|
||||
<div className="ant-input-group-wrap">
|
||||
<Button type="ghost" icon="search" />
|
||||
{!visible ? <i className="icon-coms-down2 arrow"/> : <i className="icon-coms-up2 arrow"/>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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 })}/>
|
||||
</WeaFormItem>,
|
||||
<WeaFormItem label={ffgsqcLabel} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaInputSearch value={ffgsqc} onChange={value => onChange({ ...query, ffgsqc: value })}
|
||||
onSearch={() => onChange({ ...query, isQuery: !isQuery })}/>
|
||||
<CustomSelect options={companyOpts} onChange={(val) => console.log(val)}/>
|
||||
{/*<WeaInputSearch value={ffgsqc} onChange={value => onChange({ ...query, ffgsqc: value })}*/}
|
||||
{/* onSearch={() => onChange({ ...query, isQuery: !isQuery })}/>*/}
|
||||
</WeaFormItem>
|
||||
];
|
||||
const dropMenuDatas = [
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<Layout title={getLabel(111, "薪资汇总表")} query={query} onChange={this.handleLayoutChange}
|
||||
listRef={this.listRef} isQuery={isQuery} lyAuth={lyAuth} ffgsqcLabel={getLabel(111, "发放公司全称")}>
|
||||
companyOpts={companyOpts} listRef={this.listRef}
|
||||
isQuery={isQuery} lyAuth={lyAuth} ffgsqcLabel={getLabel(111, "发放公司全称")}>
|
||||
<List query={query} isQuery={isQuery} type="salarySum" ref={dom => this.listRef = dom}
|
||||
onInit={() => this.forceUpdate()} ffgsqcLabel={getLabel(111, "发放公司全称")}/>
|
||||
</Layout>
|
||||
|
|
|
|||
Loading…
Reference in New Issue