feature/2.9.42309.01-薪资核算详情页面列表改造(页面编辑)
This commit is contained in:
parent
707ca40f05
commit
f29d985e64
|
|
@ -61,7 +61,7 @@ class EditCalcAdvanceSearchPannel extends Component {
|
|||
{getSearchs(ECSearchForm, searchConditions, 2, false)}
|
||||
<div className="wea-search-buttons">
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<span style={{ marginLeft: 15 }}><Button type="primary">{getLabel(388113, "搜索")}</Button></span>
|
||||
<span style={{ marginLeft: 15 }}><Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button></span>
|
||||
<span style={{ marginLeft: 15 }}><Button type="ghost"
|
||||
onClick={() => ECSearchForm.resetForm()}>{getLabel(2022, "重置")}</Button></span>
|
||||
<span style={{ marginLeft: 15 }}><Button type="ghost"
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ class EditCalcTable extends Component {
|
|||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
break;
|
||||
case "FORMULA":
|
||||
const { dataIndex } = params;
|
||||
this.props.onShowFormulaTd(dataIndex);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -74,7 +78,6 @@ class EditCalcTable extends Component {
|
|||
const { list: dataSource, pageNum: current, pageSize, total } = list;
|
||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => {
|
||||
const { pageInfo, selectedRowKeys } = this.state;
|
||||
console.log(selectedRowKeys);
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys,
|
||||
columns: _.map(traverse(columns), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false }))
|
||||
|
|
@ -107,13 +110,13 @@ const traverse = (arr) => {
|
|||
return _.map(arr, item => {
|
||||
if (!_.isEmpty(item.children)) {
|
||||
return {
|
||||
title: item.text, width: item.width + "px",
|
||||
title: item.text, width: item.width + "px", ellipsis: true,
|
||||
dataIndex: item.column, children: traverse(item.children)
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
title: item.text, width: item.width + "px",
|
||||
dataIndex: item.column
|
||||
dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
salarySobCycle: {}, showSearchAd: false
|
||||
salarySobCycle: {}, showSearchAd: false,
|
||||
columnDesc: {}, formulaTd: ""
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -28,18 +29,25 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
|
||||
onAdSearch = () => {
|
||||
this.calcTableRef.wrappedInstance.queryCalcResultList();
|
||||
this.openAdvanceSearch();
|
||||
};
|
||||
init = async () => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const [salarySobCycle, columnDesc] = await Promise.all([getSalarySobCycle({ salaryAcctRecordId }), getColumnDesc({ salaryAcctRecordId })]);
|
||||
if (salarySobCycle.status && columnDesc.status) {
|
||||
this.setState({
|
||||
salarySobCycle: salarySobCycle.data
|
||||
salarySobCycle: salarySobCycle.data,
|
||||
columnDesc: columnDesc.data
|
||||
});
|
||||
}
|
||||
};
|
||||
handleShowFormulaTa = (dataIndex) => this.setState({ formulaTd: dataIndex });
|
||||
|
||||
render() {
|
||||
const { salarySobCycle, showSearchAd } = this.state;
|
||||
const { salarySobCycle, showSearchAd, formulaTd, columnDesc } = this.state;
|
||||
const formulaObj = _.get(columnDesc, [formulaTd]) || {};
|
||||
return (
|
||||
<div className="salary-edit-calc-content">
|
||||
<div className="salary-flex-between weapp-salary-tb-tip">
|
||||
|
|
@ -57,16 +65,17 @@ class Index extends Component {
|
|||
<div className="salary-flex-between formula-detail-area">
|
||||
<div className="formula-detail">
|
||||
<span>{getLabel(18125, "公式")}=</span>
|
||||
<span></span>
|
||||
<span>{formulaObj.formulaContent}</span>
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<EditCalcAdvanceSearchPannel
|
||||
onToggleSwitch={this.openAdvanceSearch}
|
||||
onAdSearch={this.onAdSearch}
|
||||
/>
|
||||
</div>
|
||||
<EditCalcTable {...this.props}/>
|
||||
<EditCalcTable ref={dom => this.calcTableRef = dom} {...this.props} onShowFormulaTd={this.handleShowFormulaTa}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue