productionPlanInfo2.js
4.69 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/* 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, Select } from 'antd-v4'; // Switch
import styles from '../../index.less';
import * as commonFunc from '../Common/commonFunc';
import CommonBase from '../Common/CommonBase';
import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
import SearchComponent from '../Common/SearchComponent';/* 搜索组件 */
import CommonProductionPlanEvent from '../Common/CommonProductionPlanEvent';
import config from '../../utils/config';
import ProductionHeader from './productionHeader';/* 可编辑表格 */
const { Option } = Select;
const { Header, Content, Sider } = Layout;
class ProductionPlanInfoComponentInfo2 extends Component {
constructor(props) {
super(props);
this.state = {};
this.form = {}; /* 表单对象 */
}
render() {
const { pageLoading } = this.props;
return (
<div className="product-plan-info-box">
<Spin spinning={pageLoading} style={{ height: '100%' }}>
<div style={{ height: '100%' }}>
<ProductionPlanComponent
style={{ height: '100%' }}
{...this.props}
{...this.state}
/>
</div>
</Spin>
</div>
);
}
}
const ProductionPlanComponent = Form.create({
mapPropsToFields(props) {
const { masterData } = props;
const obj = commonFunc.mapPropsToFields(masterData, Form);
return obj;
},
})((props) => {
const {
form, onReturnForm, onSelectChange, sStateSelect, isDragAndDrop, stateOption,
} = props;
/* 回带表单 */
onReturnForm(form);
const pageFlag = sStateSelect === '0' || sStateSelect === '1' || sStateSelect === '2';
const workTeamProps = {
...commonBusiness.getTableTypes('workCenter', props),
tableProps: { rowKey: 'sWorkCenterId' },
isKeyUsesId: false,
enabled: false,
};
const machineProps = {
...commonBusiness.getTableTypes(sStateSelect === '0' ? 'unMachine' : 'machine', props),
tableProps: { rowKey: 'sMachineId' },
isKeyUsesId: false,
enabled: false,
};
const pagination = {
onChange: props.onPaginationChange,
size: 'large',
pageSize: config.pageSize,
pageNum: config.pageNum,
showQuickJumper: true,
};
const processProps = {
...commonBusiness.getTableTypes('slave', props),
tableProps: { pagination: pageFlag ? false : pagination },
scrollX: 3,
isDragAndDrop,
};
return (
<Form style={{ height: '100%' }}>
<Layout style={{ height: '100%' }}>
<Header className={styles.header} style={{ backgroundColor: 'rgb(100, 100, 100)' }}>
<ProductionHeader {...props} />
</Header>
<Layout className={styles.clayout} style={{ height: '100%' }} >
<div className={styles.content} style={{ height: '100%' }} >
<Layout
className="product-plain-container-layout"
style={{
margin: '5px 10px', height: '100%', flexDirection: 'row', backgroundColor: '#fff',
}}
>
<Sider className="product-plan-sider" width="340px">
<div>
<Select style={{ padding: '10px 11px' }} onChange={onSelectChange} value={sStateSelect} defaultValue={stateOption ? stateOption[0].key : sStateSelect}>
{
stateOption ? stateOption.map((item) => {
return (<Option key={item.key}>{item.value}</Option>);
}) : ''
}
<Option value="99" >全部数据</Option>
</Select>
</div>
<div>
<StaticEditTable {...workTeamProps} />
</div>
<div style={{ backgroundColor: '#fff' }}>
<StaticEditTable {...machineProps} />
</div>
</Sider>
<Content
style={{
backgroundColor: '#fff', height: '100vh', overflowY: 'hidden', borderRight: '1px solid #ddd', borderLeft: '1px solid #ddd',
}}
className="xly-normal-list"
>
<div style={{ maxHeight: '100%', zIndex: 20 }}>
<SearchComponent {...props} />
</div>
<StaticEditTable {...processProps} style={{ width: '100%' }} />
</Content>
</Layout>
</div>
</Layout>
</Layout>
</Form>
);
});
export default CommonBase(CommonProductionPlanEvent(ProductionPlanInfoComponentInfo2));