feature/2.9.42309.01-薪资核算详情页面列表改造(页面编辑)
This commit is contained in:
parent
0902c3bb71
commit
49e5a0ad73
|
|
@ -5,10 +5,12 @@
|
||||||
* Date: 2023/9/14
|
* Date: 2023/9/14
|
||||||
*/
|
*/
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
import { WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect, WeaTools } from "ecCom";
|
||||||
import { Button } from "antd";
|
import { Button, Col, Row } from "antd";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
|
import uuidV4 from "uuid/v4";
|
||||||
import { editCalcSearchConditions } from "./condition";
|
import { editCalcSearchConditions } from "./condition";
|
||||||
|
import { getExportField } from "../../../../../apis/calculate";
|
||||||
import { getSearchs } from "../../../../../util";
|
import { getSearchs } from "../../../../../util";
|
||||||
|
|
||||||
const getKey = WeaTools.getKey;
|
const getKey = WeaTools.getKey;
|
||||||
|
|
@ -20,12 +22,13 @@ class EditCalcAdvanceSearchPannel extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
searchConditions: []
|
searchConditions: [], salaryItems: [],
|
||||||
|
customSearchConditions: []
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
this.getExportField();
|
||||||
this.setState({
|
this.setState({
|
||||||
searchConditions: _.map(editCalcSearchConditions, item => {
|
searchConditions: _.map(editCalcSearchConditions, item => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -53,19 +56,57 @@ class EditCalcAdvanceSearchPannel extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getExportField = () => {
|
||||||
|
getExportField({ salaryAcctRecordId: this.props.salaryAcctRecordId })
|
||||||
|
.then(({ status, data }) => {
|
||||||
|
if (status) {
|
||||||
|
const { itemsByGroup } = data;
|
||||||
|
this.setState({
|
||||||
|
salaryItems: _.map(itemsByGroup, item => ({
|
||||||
|
key: item.salarySobItemGroupId.toString(),
|
||||||
|
label: item.salarySobItemGroupName,
|
||||||
|
options: _.map(item.salaryItems, o => ({
|
||||||
|
key: o.salaryItemId.toString(), showname: o.salaryItemName
|
||||||
|
}))
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
handleAddCustomSearchForm = () => {
|
||||||
|
const { customSearchConditions, salaryItems } = this.state;
|
||||||
|
this.setState({
|
||||||
|
customSearchConditions: [
|
||||||
|
...customSearchConditions,
|
||||||
|
{
|
||||||
|
com: CustomFormFields({
|
||||||
|
uuid: uuidV4(), onDelete: this.handleDelete, salaryItems
|
||||||
|
}),
|
||||||
|
uuid: uuidV4()
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
};
|
||||||
|
handleDelete = (uuid) => {
|
||||||
|
const { customSearchConditions } = this.state;
|
||||||
|
this.setState({
|
||||||
|
customSearchConditions: _.filter(customSearchConditions, o => o.uuid !== uuid)
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { searchConditions } = this.state;
|
const { searchConditions, customSearchConditions } = this.state;
|
||||||
const { calculateStore: { ECSearchForm } } = this.props;
|
const { calculateStore: { ECSearchForm } } = this.props;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="wea-advanced-searchsAd">
|
<div className="wea-advanced-searchsAd">
|
||||||
{getSearchs(ECSearchForm, searchConditions, 2, false)}
|
{getSearchs(ECSearchForm, searchConditions, 2, false)}
|
||||||
<WeaSearchGroup needTigger showGroup title={getLabel(32843, "其他条件")}>
|
<WeaSearchGroup needTigger showGroup title={getLabel(32843, "其他条件")} items={customSearchConditions}
|
||||||
<div className="custom-advance-form"></div>
|
col={2}/>
|
||||||
<div className="custom-advance-largeSpacing">
|
<div className="custom-advance-largeSpacing">
|
||||||
<Button className="link" icon="plus">{getLabel(111, "添加搜索条件")}</Button>
|
<Button className="link" icon="plus"
|
||||||
</div>
|
onClick={this.handleAddCustomSearchForm}>{getLabel(111, "添加搜索条件")}</Button>
|
||||||
</WeaSearchGroup>
|
</div>
|
||||||
<div className="searchAdvanced-commonSelect">
|
<div className="searchAdvanced-commonSelect">
|
||||||
<Button type="ghost">{getLabel(111, "保存常用筛选")}</Button>
|
<Button type="ghost">{getLabel(111, "保存常用筛选")}</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -86,3 +127,35 @@ class EditCalcAdvanceSearchPannel extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default EditCalcAdvanceSearchPannel;
|
export default EditCalcAdvanceSearchPannel;
|
||||||
|
|
||||||
|
const CustomFormFields = (props) => {
|
||||||
|
const { uuid, onDelete, salaryItems } = props;
|
||||||
|
console.log(133, salaryItems);
|
||||||
|
return <WeaFormItem labelCol={{ span: 0 }} wrapperCol={{ span: 18 }}>
|
||||||
|
<Row>
|
||||||
|
<Col span={6} style={{ paddingRight: 10 }}>
|
||||||
|
<WeaSelect options={salaryItems} showSearch optionFilterProp="children"/>
|
||||||
|
</Col>
|
||||||
|
<Col span={18}>
|
||||||
|
<Row>
|
||||||
|
<Col span={12} style={{ paddingRight: 10 }}>
|
||||||
|
<WeaSelect
|
||||||
|
options={[
|
||||||
|
{ key: "1", showname: getLabel(111, "包含") },
|
||||||
|
{ key: "2", showname: getLabel(111, "等于") },
|
||||||
|
{ key: "3", showname: getLabel(111, "不等于") }
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12} style={{ position: "relative" }}>
|
||||||
|
<WeaInput/>
|
||||||
|
<Button
|
||||||
|
type="ghost" icon="cross" className="formItem-delete" shape="circle"
|
||||||
|
onClick={() => onDelete(uuid)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</WeaFormItem>;
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class Index extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state;
|
const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state;
|
||||||
const { accountExceptInfo } = this.props;
|
const { accountExceptInfo, routeParams: { salaryAcctRecordId } } = this.props;
|
||||||
const formulaObj = _.get(columnDesc, [formulaTd]) || {};
|
const formulaObj = _.get(columnDesc, [formulaTd]) || {};
|
||||||
return (
|
return (
|
||||||
<div className="salary-edit-calc-content">
|
<div className="salary-edit-calc-content">
|
||||||
|
|
@ -81,6 +81,7 @@ class Index extends Component {
|
||||||
</div>
|
</div>
|
||||||
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||||
<EditCalcAdvanceSearchPannel
|
<EditCalcAdvanceSearchPannel
|
||||||
|
salaryAcctRecordId={salaryAcctRecordId}
|
||||||
onToggleSwitch={this.openAdvanceSearch}
|
onToggleSwitch={this.openAdvanceSearch}
|
||||||
onAdSearch={this.onAdSearch}
|
onAdSearch={this.onAdSearch}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -49,18 +49,29 @@
|
||||||
height: 320px;
|
height: 320px;
|
||||||
overflow: hidden auto;
|
overflow: hidden auto;
|
||||||
|
|
||||||
|
.formItem-delete {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: -40px;
|
||||||
|
}
|
||||||
|
|
||||||
.searchAdvanced-commonSelect {
|
.searchAdvanced-commonSelect {
|
||||||
border-top: 1px solid #e5e5e5;
|
border-top: 1px solid #ebebeb;
|
||||||
border-bottom: 1px solid #e5e5e5;
|
margin: 0 25px;
|
||||||
padding: 10px 16px;
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-advance-largeSpacing {
|
.custom-advance-largeSpacing {
|
||||||
|
padding-left: 26px;
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
padding: 12px 10px 12px 26px;
|
||||||
|
color: #2db7f5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue