productionPlanChangeMacheInfo.js
3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* eslint-disable array-callback-return,no-undef */
import React, { Component } from 'react';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Layout, Spin, Button, Row, Col } from 'antd-v4';
import CommonListEvent from './CommonListEvent';/* 继承销售模块业务功能 */
import * as commonFunc from './commonFunc';/* 通用单据方法 */ /* 通用单据方法 */
import StaticEditTable from './CommonTable';/* 可编辑表格 */
import CommonBase from './CommonBase';/* 获取配置及数据 */
import * as commonBusiness from './commonBusiness';/* 单据业务功能 */
import SearchComponent from './SearchComponent';/* 搜索组件 */
import commonConfig from '../../utils/config';
const { Content } = Layout;
class ProductionPlanChangeMachineInfoComponent extends Component {
constructor(props) {
super(props);
this.state = {
};
}
/** 确认下单 */
handleSelect = () => {
const { slaveSelectedData, app } = this.props;
this.props.app.currentPane.select(app.currentPane.name, app.currentPane.config, slaveSelectedData);
this.props.app.currentPane.selectCancel(app.currentPane.name);
};
/** 关闭 */
handleCancelModal = () => {
const { app } = this.props;
this.props.app.currentPane.selectCancel(app.currentPane.name);
};
// ----------------------------数据修改回带end ---------------------------- //
render() {
const { pageLoading } = this.props;
return (
<div style={{ height: '100%' }}>
<Spin spinning={pageLoading}>
<div style={{ height: '100%' }}>
<CommonListComponent
{...this.props}
{...this.state}
onSelect={this.handleSelect}
onCancel={this.handleCancelModal}
onDoubleClick={this.handleSelect}
/>
</div>
</Spin>
</div>
);
}
}
const CommonListComponent = Form.create({
mapPropsToFields(props) {
const { masterData } = props;
const obj = commonFunc.mapPropsToFields(masterData, Form);
return obj;
},
})((props) => {
const { form, onReturnForm, slavePagination } = props;
/* 回带表单 */
onReturnForm(form);
const pagination = {
...slavePagination,
size: 'large',
pageSize: commonConfig.pageSize,
showQuickJumper: true,
hideOnSinglePage: true,
};
const tableProps = {
...commonBusiness.getTableTypes('slave', props),
tableProps: { rowKey: 'sId', pagination, onChange: props.onTitleChange },
};
const teamProps = {
...commonBusiness.getTableTypes('team', props),
tableProps: { rowKey: 'sId', pagination, onChange: props.onTitleChange },
};
return (
<Form >
<Layout>
<Layout>
<div id="modalChooseProcess">
<div style={{ maxHeight: '100%', zIndex: 20 }}>
<SearchComponent {...props} />
</div>
<Content className="xly-normal-list">
<Row>
<Col span={24} key="{groupProps.name}Col" >
<StaticEditTable {...tableProps} footer="hidden" tableBelone="list" showConfig={props.showConfig} />
</Col>
<Col span={24} key="{groupProps.name}Col" >
<StaticEditTable {...teamProps} footer="hidden" tableBelone="list" showConfig={props.showConfig} />
</Col>
</Row>
</Content>
</div>
</Layout>
<div style={{ textAlign: 'right', marginRight: '9px', marginBottom: '9px' }}>
<Button key="back" style={{ marginRight: '8px' }} onClick={props.onCancel}>取消</Button>
<Button type="primary" onClick={props.onSelect}>确认</Button>
</div>
</Layout>
</Form>
);
});
export default CommonBase(CommonListEvent(ProductionPlanChangeMachineInfoComponent));