productionMainPlan.js
27.7 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
/* 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, Avatar, Tabs, Card, Row, Col, message } from 'antd-v4'; // Switch, Modal, Card, Row, Col
import styles from '@/index.less';
import * as commonFunc from '@/components/Common/commonFunc';
import CommonBase from '@/components/Common/CommonBase';
import * as commonBusiness from '@/components/Common/commonBusiness';/* 单据业务功能 */
import StaticEditTable from '@/components/Common/CommonTable';/* 可编辑表格 */
import SearchComponent from '@/components/Common/SearchComponent';/* 搜索组件 */
import CommonProductionMainPlanEvent from '@/components/Common/CommonProductionmMainPlanEvent';
import CommonListSelect from '@/components/Common/CommonListSelect';/* 选择界面 */
import Toolbar from '@/components/Common/ToolBar/ToolBarNew';
import * as commonUtils from '@/utils/utils';/* 通用方法 */
import Gantt from '@/components/Charts/Gantt';
import ProductionUnifiedPlanning from '@/components/productionMainPlan/productionUnifiedPlanning';
import CustomizedChar from '@/components/Common/ShowChar/CustomizedChar';
import MoveUp from '@/assets/processUp.svg';
import MoveDown from '@/assets/processDown.svg';
import DisableMoveUp from '@/assets/disableprocessUp.svg';
import DisableMoveDown from '@/assets/disableprocessDown.svg';
import MoveTop from '@/assets/processTop.svg';
import DisableMoveTop from '@/assets/disableprocessTop.svg';
import MoveBottom from '@/assets/processBottom.svg';
import DisableMoveBottom from '@/assets/disableprocessBottom.svg';
import ShowList from '@/assets/list.svg';
import DisableShowList from '@/assets/disablelist.svg';
import ShowGantt from '@/assets/gantt.svg';
import DisableShowGantt from '@/assets/disablegantt.svg';
import commonConfig from '@/utils/config';
import AntdDraggableModal from '@/components/Common/AntdDraggableModal';
import ShowCheckModel from '@/assets/checkModel.svg';
import DisableShowCheckModel from '@/assets/disablecheckModel.svg';
import selfstyles from './index.less';
import GanttStyles from '../productionScheduleTree/index.less';
const { TabPane } = Tabs;
const { Header, Content, Sider } = Layout;
class ProductionMainPlanComponent extends Component {
constructor(props) {
super(props);
this.state = {};
this.form = {}; /* 表单对象 */
}
// onRowMouseEnter = (name, record) => {
// // if (this.props.enabled && name === 'control') {
// // this.props.onTableSelectRowChange(name, [record.sId]);
// // }
// }
onDoubleClick = (name, record) => {
if (this.props.onDoubleClick !== undefined) {
this.props.onDoubleClick(record);
}
};
onRowClick1 = (name, record, bRowClick) => {
let selectedRowKeys = [...this.props.slaveSelectedRowKeys];
if (commonUtils.isEmptyArr(selectedRowKeys)) {
const keys = [];
keys.push(record.sId);
selectedRowKeys = keys;
} else {
const indexKey = selectedRowKeys.indexOf(record.sId);
if (indexKey === -1) {
selectedRowKeys.push(record.sId);
} else if (indexKey !== -1) {
if (!bRowClick) { /* 可输入行,行内点击时 不去除selectedRowKeys */
selectedRowKeys.splice(indexKey, 1);
}
}
}
this.props.onTableSelectRowChange(name, selectedRowKeys);
};
// eslint-disable-next-line no-unused-vars
onRowClick = (name, record, bRowClick) => {
// let selectedRowKeys = [...this.props.slaveSelectedRowKeys];
// if (commonUtils.isEmptyArr(selectedRowKeys)) {
// const keys = [];
// keys.push(record.sId);
// selectedRowKeys = keys;
// } else {
// const indexKey = selectedRowKeys.indexOf(record.sId);
// if (indexKey === -1) {
// selectedRowKeys.push(record.sId);
// } else if (indexKey !== -1) {
// if (!bRowClick) { /* 可输入行,行内点击时 不去除selectedRowKeys */
// selectedRowKeys.splice(indexKey, 1);
// }
// }
// }
// this.props.onTableSelectRowChange(name, selectedRowKeys);
/* 子表选中 */
if (name === 'slaveInfo') {
const { slaveInfoSelectedRowKeys } = this.props;
let selectedRowKeys = slaveInfoSelectedRowKeys;
if (commonUtils.isEmptyArr(selectedRowKeys)) {
const keys = [];
keys.push(record.sId);
selectedRowKeys = keys;
} else {
const indexKey = selectedRowKeys.indexOf(record.sId);
if (indexKey === -1) {
selectedRowKeys.push(record.sId);
} else if (indexKey !== -1) {
if (!bRowClick) { /* 可输入行,行内点击时 不去除selectedRowKeys */
selectedRowKeys.splice(indexKey, 1);
}
}
}
this.props.onTableSelectRowChange(name, selectedRowKeys);
}
};
/** 处理选择行发生改变 */
handleTableFilterData = (name, data, record) => {
/* 外置处理业务 */
if (name === 'slave') {
let slaveInfoDataNew = [];
if (commonUtils.isNotEmptyArr(data)) {
slaveInfoDataNew = data.filter(item => item.sProductionPlanId === record.sId);
}
return slaveInfoDataNew;
}
};
handleCancelUnifiedPlanningChooseModal = () => {
this.props.onGetProdData('workCenter', 'Sp_Productionplan_Pie_Char', {});
const { workCenterSelectedRowKeys, workCenterData } = this.props;
if (commonUtils.isNotEmptyArr(workCenterData)) {
const addFilter = {};
addFilter.bFilterName = 'sWorkCenterId';
addFilter.bFilterCondition = '=';
addFilter.bFilterValue = commonUtils.isEmpty(workCenterSelectedRowKeys) ? workCenterData[0].sWorkCenterId : workCenterSelectedRowKeys;
const filterArr = [addFilter];
this.props.onGetProdData('machine', 'Sp_Productionplan_sColumnarStack_Char', { bFilter: JSON.stringify(filterArr) });
}
this.props.onSaveState({ unifiedPlanningChooseVisible: false });
this.props.onRefresh();
};
handlePieCard = async (sWorkCenterId) => {
const addFilter = {};
addFilter.bFilterName = 'sWorkCenterId';
addFilter.bFilterCondition = '=';
addFilter.bFilterValue = sWorkCenterId;
let bProductionPlanOutside = false;
if (sWorkCenterId === '0000000000') {
bProductionPlanOutside = true; /* 跳转到发外排程 */
}
const filterArr = [addFilter];
this.props.onGetProdData('machine', 'Sp_Productionplan_sColumnarStack_Char', { bFilter: JSON.stringify(filterArr) });
this.props.onSaveState({ workCenterSelectedRowKeys: [sWorkCenterId], bProductionPlanOutside });
};
handleWorkCenterData = () => {
const { workCenterData, workCenterCharData } = this.props;
return commonUtils.isNotEmptyArr(workCenterData) && commonUtils.isNotEmptyObject(workCenterCharData) && commonUtils.isNotEmptyArr(workCenterCharData.data) ? workCenterData.map((child) => {
const charConfigArr = [];
const charConfigAndDataArr = [];
const charConfig = commonBusiness.getCharConfig('', 'sPieGroup', child.sWorkCenterId, 1, 20, 65);
charConfigArr.push({ ...charConfig });
// charConfigAndData.percent = 3;
const charConfigAndData = workCenterCharData.data.filter(item => item.sWorkCenterId === child.sWorkCenterId)[0];
charConfigAndDataArr.push({ ...charConfig, child: { data: [{ ...charConfigAndData }], height: 90 } });
const charProps = commonBusiness.getCharTypes(child.sWorkCenterName, charConfigArr, charConfigAndDataArr, this.props, { bordered: false });
const gridStyle = {
width: '99%',
padding: '5px 10px',
height: '80px',
};
return (
<Col span={4} style={{ padding: '0px' }}>
<Card.Grid style={gridStyle} border={false} onClick={this.handlePieCard.bind(this, child.sWorkCenterId)}>
<div className="card_data" >
<div className="card_data_title">{child.sWorkCenterName}</div>
<div className="card_data_detail">工时:{child.dHourSum}{commonUtils.isNotEmptyNumber(child.dHourSum) ? 'h' : ''} </div>
<div className="card_data_detail">数量:{child.iPlanSum}</div>
</div>
<div className="card_data_char" >
<div className="card_char"> <div className="card_data_hour">{child.dStdWorkCenterHour}h</div><CustomizedChar {... charProps} percent /> </div>
<div className="card_char_bottom">最晚:<span title={child.sLimitDate} className={child.iLimitColor === 1 ? 'limitDateWeight' : 'limitDate'}>{child.sLimitDate}</span> </div>
</div>
</Card.Grid>
</Col>);
}) : '';
}
sortData = (tempData) => {
tempData.sort((g1, g2) => {
return g1.iOrder - g2.iOrder;
});
return tempData;
};
/* 控制排序 */
orderData = (e, name, type) => {
// 埋入数据修监听点
this.props.onSaveState({
dataChanged: true,
});
const { [`${name}SelectedRowKeys`]: tableselectedRowKeys, app, slavePagination: slavePaginationOld } = this.props;
let { [`${name}Data`]: currentData } = this.props;
if (name === 'slave') {
if (commonUtils.isEmptyArr(tableselectedRowKeys)) {
message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseMoveData'));/* 请勾选要移动数据 */
return;
}
if (commonUtils.isEmptyArr(currentData)) {
message.warn(commonFunc.showMessage(app.commonConst, 'NoProcessData'));/* 请填写工序表数据 */
return;
}
const tempNew = currentData.filter((item) => { /* 获取勾选数据集 */
return tableselectedRowKeys.indexOf(item.sId) > -1;
});
if (commonUtils.isEmptyArr(tempNew)) {
message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseMoveData'));/* 请选择要移动数据 */
return;
}
const len = currentData.length;
const newLen = tempNew.length;
let num = 0.01;/* 循环增加体 */
let targetiOrder = -1;
if (type === 1) { /* 上移 */
const iIndex = currentData.findIndex(item => item.sId === tempNew[0].sId);/* 选中第一个节点的下标 */
if (iIndex === 0) {
if (newLen === 1) {
message.warn(commonFunc.showMessage(app.commonConst, 'NoUp'));/* 无需上移 */
return;
} else {
targetiOrder = 0;
}
} else {
targetiOrder = currentData[iIndex - 1].iOrder - 1; /* 目标排序号 */
}
} else if (type === 2) { /* 下移 */
const iIndex = currentData.findIndex(item => item.sId === tempNew[newLen - 1].sId);/* 选中最后一个节点的下标 */
if (iIndex === len - 1) {
if (newLen === 1) {
message.warn(commonFunc.showMessage(app.commonConst, 'NoDown')); /* 无需下移 */
return;
} else {
targetiOrder = currentData[iIndex].iOrder;
}
} else {
targetiOrder = currentData[iIndex + 1].iOrder;
}
} else if (type === 0) { /* 置顶 */
const iIndex = currentData.findIndex(item => item.sId === tempNew[0].sId);/* 选中第一个节点的下标 */
if (iIndex === 0) {
if (newLen === 1) {
message.warn(commonFunc.showMessage(app.commonConst, 'NoTop')); /* 无需置顶 */
return;
} else {
targetiOrder = currentData[iIndex].iOrder;
}
} else {
targetiOrder = currentData[0].iOrder - 1;
}
} else if (type === 3) { /* 置底 */
const iIndex = currentData.findIndex(item => item.sId === tempNew[newLen - 1].sId);/* 选中最后一个节点的下标 */
if (iIndex === len - 1) {
if (newLen === 1) {
message.warn(commonFunc.showMessage(app.commonConst, 'NoBottom')); /* 无需置底 */
return;
} else {
targetiOrder = currentData[iIndex].iOrder;
}
} else {
targetiOrder = currentData[len - 1].iOrder + 1;
}
}
tempNew.forEach((item) => {
const index1 = currentData.findIndex(item1 => item1.sId === item.sId);
currentData[index1] = { ...item, iOrder: targetiOrder + num, handleType: 'update' };
num += 0.01;
});
currentData = this.sortData(currentData);
currentData = this.orderNum(currentData);
const iIndex = currentData.findIndex(item => item.sSlaveId === tableselectedRowKeys[0]);
const slavePagination = { ...slavePaginationOld };
slavePagination.current = Math.ceil((iIndex + 1) / commonConfig.pageSize);
this.props.onSaveState({ [`${name}Data`]: currentData, slavePagination });
}
};
/* 自定义排序号 */
orderNum = (tableData) => {
tableData.forEach((item, index) => {
item.iOrder = index + 1;
item.handleType = 'update';
});
return tableData;
};
/* 切换稽查列表 */
changeCheckModel= (e, type) => {
if (type === 'checkModel') {
const { slaveFilterCondition } = this.props;
/* 调用获取甘特图数据 */
const chart = {};
chart.sProcedureName = 'Sp_Manufacture_GetPlanAPSstate';
chart.paramsMap = {
};
this.props.onCheckModel(chart, slaveFilterCondition).catch(() => {
this.props.onSaveState({ pageLoading: false });
});
}
};
/* 切换甘特图/列表视图 */
changeGantt = (e, type) => {
let bGantt = false;
if (type === 'gantt') {
const { slaveFilterCondition } = this.props;
bGantt = true;
/* 调用获取甘特图数据 */
const chart = {};
chart.sProcedureName = 'Sp_WorkOrder_GtCharAll';
chart.paramsMap = {
};
this.props.onGanttChar(chart, slaveFilterCondition).finally(() => {
this.props.onSaveState({ pageLoading: false });
});
} else if (type === 'list') {
bGantt = false;
}
this.props.onSaveState({ bGantt });
};
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}
onTableFilterData={this.handleTableFilterData}
onCancelUnifiedPlanningChooseModal={this.handleCancelUnifiedPlanningChooseModal}
onGetWorkCenterCharShow={this.handleWorkCenterData}
orderData={this.orderData}
onRowClick={this.onRowClick}
onDoubleClick={this.onDoubleClick}
onCheckModel={this.changeCheckModel}
changeGantt={this.changeGantt}
// onRowMouseEnter={this.onRowMouseEnter}
/>
</div>
</Spin>
</div>
);
}
}
const ProductionPlanComponent = Form.create({
mapPropsToFields(props) {
const { masterData } = props;
const obj = commonFunc.mapPropsToFields(masterData, Form);
return obj;
},
})((props) => {
const {
form, onReturnForm, app, onGetChartClick, slavePagination, planLoadingSate, iPageSize, bGantt, charGanttData,
} = props;
/* 回带表单 */
onReturnForm(form);
const pagination = {
pageSize: commonUtils.isNotEmptyNumber(iPageSize) && iPageSize !== 0 ? iPageSize : commonConfig.pageSize,
...slavePagination,
size: 'large',
pageSizeOptions: commonConfig.pageSizeOptions,
// showQuickJumper: true,
hideOnSinglePage: false,
showSizeChanger: true,
current: commonUtils.isEmptyObject(slavePagination) ? 1 : slavePagination.current,
// size: 'large',
};
const width = '18px';
const height = '18px';
const moveUp = {
title: '上移',
width: { width },
height: { height },
img: <img src={MoveUp} alt="上移" width="16px" height="16px" />,
disableimg: <img src={DisableMoveUp} alt="上移" width="16px" height="16px" />,
};
const moveDown = {
title: '下移',
width: { width },
height: { height },
img: <img src={MoveDown} alt="下移" width="16px" height="16px" />,
disableimg: <img src={DisableMoveDown} alt="下移" width="16px" height="16px" />,
};
const moveTop = {
title: '置顶',
width: { width },
height: { height },
img: <img src={MoveTop} alt="置顶" width="16px" height="16px" />,
disableimg: <img src={DisableMoveTop} alt="置顶" width="16px" height="16px" />,
};
const moveBottom = {
title: '置底',
width: { width },
height: { height },
img: <img src={MoveBottom} alt="置底" width="16px" height="16px" />,
disableimg: <img src={DisableMoveBottom} alt="置底" width="16px" height="16px" />,
};
const showGantt = {
title: '查看Gantt',
width: { width },
height: { height },
img: <img src={ShowGantt} alt="更换机台" width="20px" height="20px" />,
disableimg: <img src={DisableShowGantt} alt="更换机台" width="20px" height="20px" />,
};
const showList = {
title: '查看列表',
width: { width },
height: { height },
img: <img src={ShowList} alt="更换机台" width="20px" height="20px" />,
disableimg: <img src={DisableShowList} alt="更换机台" width="20px" height="20px" />,
};
const showCheckModel = {
title: '齐套稽查',
width: { width },
height: { height },
img: <img src={ShowCheckModel} alt="齐套稽查" width="18px" height="18px" />,
disableimg: <img src={DisableShowCheckModel} alt="齐套稽查" width="18px" height="18px" />,
};
let zoom = {};
zoom.scale = 'Minutes';
zoom.step = '10'; /* 间隔 */
if (commonUtils.isNotEmptyObject(charGanttData)) {
// eslint-disable-next-line prefer-destructuring
zoom = charGanttData.zoom;
}
const ganttProps = {
// ...commonBusiness.getGanttTypes('slave', props),
tasks: commonUtils.isNotEmptyObject(charGanttData) ? charGanttData : {}, /* 甘特图数据源 */
zoom: commonUtils.isNotEmptyObject(zoom) ? zoom : {},
onDataUpdated: props.onDataUpdated,
};
// onChange: props.onTitleChange.bind(this, 'slave'),, 表头没有点击排序事件可以不添加onChange事件
const tableProps = {
...commonBusiness.getTableTypes('slave', props),
onTableFilterData: props.onTableFilterData,
// tableBelone: 'list',
tableProps: {
rowKey: 'sId',
pagination,
onRow: (record) => {
return {
onClick: () => { props.onRowClick('slave', record, true); },
onDoubleClick: () => { props.onDoubleClick('slave', record); },
// onMouseEnter: () => { props.onRowMouseEnter('slave', record); },
};
},
onChange: props.onTitleChange.bind(this, 'slave'),
},
clearArray: props.clearArray,
};
const tableInfoProps = {
...commonBusiness.getTableTypes('slaveInfo', props),
tableProps: {
rowKey: 'sId',
pagination,
// rowSelection: null,
planLoadingSate,
onRow: (record) => {
return {
onClick: () => { props.onRowClick('slaveInfo', record, true); },
onDoubleClick: () => { props.onDoubleClick('slaveInfo', record); },
// onMouseEnter: () => { props.onRowMouseEnter('slaveInfo', record); },
};
},
onChange: props.onTitleChange.bind(this, 'slaveInfo'),
},
// data: commonUtils.isNotEmptyObject(props.slaveInfoDataNew) ? props.slaveInfoDataNew : props.slaveInfoData,
};
let unifiedPlanningType = {};
if (commonUtils.isNotEmptyObject(props.unifiedPlanningChooseData)) {
unifiedPlanningType = {
app: {
...props.app,
currentPane: {
name: 'unifiedPlanning',
config: props.unifiedPlanningConfig,
conditonValues: props.getSqlCondition(props.unifiedPlanningConfig),
title: props.unifiedPlanningChooseData.sMenuName,
route: props.unifiedPlanningChooseData.sName,
formId: props.unifiedPlanningChooseData.sId,
key: props.sModelsId + props.unifiedPlanningChooseData.sId,
sModelsType: props.unifiedPlanningChooseData.sModelType,
select: props.onSelect,
selectCancel: props.onCancelUnifiedPlanningChooseModal,
},
},
dispatch: props.dispatch,
content: props.content,
id: new Date().getTime().toString(),
};
}
const addProps = {};
const charConfigArr = [];
const charConfigAndDataArr = [];
const charConfig = commonBusiness.getCharConfig('机台排程', 'sEqualColumnarStack', '1324324', 1, 24, 280);
charConfigArr.push({ ...charConfig });
if (commonUtils.isNotEmptyArr(props.machineCharData)) {
charConfigAndDataArr.push({
...charConfig,
child: {
...props.machineCharData, height: 300, chartName: 'chartMachine', onChartClick: onGetChartClick,
},
});
}
/* 生产进度详情 */
let searchWorkSchedule = {};
let workScheduleConfig = {};
let searchWorkTitle = '';
if (commonUtils.isNotEmptyObject(props.workScheduleConfig)) {
// eslint-disable-next-line prefer-destructuring
workScheduleConfig = props.workScheduleConfig;
searchWorkTitle = workScheduleConfig.sActiveName;
const sWorkOrderId = commonUtils.isNotEmptyObject(props.workScheduleRecord) ? props.workScheduleRecord.sWorkOrderId : '';
searchWorkSchedule = {
app: {
...props.app,
currentPane: {
name: 'workSchedule',
config: workScheduleConfig,
conditonValues: props.getSqlCondition(workScheduleConfig),
title: workScheduleConfig.sActiveName,
route: '/indexPage/commonList',
formRoute: '/indexPage/commonList',
formId: workScheduleConfig.sActiveId,
key: props.sModelsId + workScheduleConfig.sId,
sModelsType: 'search/workSchedule',
bFilterProName: 'p_sWorkOrderId_pro',
bFilterProValue: sWorkOrderId,
// select: props.onSelect,
// selectCancel: props.onSelectCancel,
},
},
dispatch: props.dispatch,
content: props.content,
id: new Date().getTime().toString(),
realizeHeight: props.realizeHeight, /* 拖动偏移高度 */
bNotShowBtn: true,
rowSelection: null,
};
}
const machineCharProps = commonBusiness.getCharTypes('machineChar', charConfigArr, charConfigAndDataArr, props);
const setUp = commonFunc.showMessage(app.commonConst, 'setUp');/* 上移 */
const setDown = commonFunc.showMessage(app.commonConst, 'setDown');/* 下移 */
const setTop = commonFunc.showMessage(app.commonConst, 'setTop');/* 置顶 */
const setBottom = commonFunc.showMessage(app.commonConst, 'setBottom');/* 置底 */
const bSetList = true; /* 显示列表 */
const bSetGantt = true; /* 显示甘特图 */
return (
<Form style={{ height: '100%' }}>
<Layout style={{ height: '100%' }} className="xly-productionPlan-list">
<Header className={styles.header}>
<Toolbar {...props} className="billBtnGroup" style={{ backgroundColor: '#646464', color: 'rgb(255,255,255)' }} />
</Header>
<Layout className={styles.clayout} style={{ height: '100%' }} >
<div className={styles.filterContent}>
<SearchComponent {...props} />
</div>
<Content>
<div id="slaveTabs" className={styles.bShow}>
<div>
<Avatar src={props.imgSrc} />
</div>
<Tabs className={styles.slaveTabs} tabBarStyle={{ marginLeft: 10, marginRight: 10 }}>
<TabPane tab="产品主计划" key={2} >
<div className={selfstyles.mainPlan} >
<Layout className="processList">
<Sider className="process">
<a title={setTop} {...addProps} onClick={props.moveEnabled ? e => props.orderData(e, 'slave', 0) : null}>{ props.moveEnabled ? moveTop.img : moveTop.disableimg}</a>
<a title={setUp} {...addProps} onClick={props.moveEnabled ? e => props.orderData(e, 'slave', 1) : null}>{ props.moveEnabled ? moveUp.img : moveUp.disableimg }</a>
<a title={setDown} {...addProps} onClick={props.moveEnabled ? e => props.orderData(e, 'slave', 2) : null}>{props.moveEnabled ? moveDown.img : moveDown.disableimg }</a>
<a title={setBottom} {...addProps} onClick={props.moveEnabled ? e => props.orderData(e, 'slave', 3) : null}>{props.moveEnabled ? moveBottom.img : moveBottom.disableimg }</a>
{ bSetList ? <a title="查看列表" {...addProps} onClick={props.bGantt ? e => props.changeGantt(e, 'list', 0) : null}>{props.bGantt ? showList.img : showList.disableimg }</a> : ''}
{ bSetGantt ? <a title="查看甘特图" {...addProps} onClick={!props.bGantt ? e => props.changeGantt(e, 'gantt', 0) : null}>{ !props.bGantt ? showGantt.img : showGantt.disableimg }</a> : ''}
<a title="齐套稽查" {...addProps} onClick={commonUtils.isEmptyObject(props.sortedInfo) ? e => props.onCheckModel(e, 'checkModel') : null}>{commonUtils.isEmptyObject(props.sortedInfo) ? showCheckModel.img : showCheckModel.disableimg }</a>
</Sider>
{
bGantt && commonUtils.isNotEmptyObject(charGanttData) ?
<Content style={{ height: 'calc( 100vh - 230px )' }} className={GanttStyles.ganttList} >
<div className="gantt-container" style={{ width: '100vm', height: '100%' }} >
<Gantt {...ganttProps} />
</div>
</Content> :
<Content
className="xly-normal-list productPlan"
>
<StaticEditTable {...tableProps} footer="hidden" slaveInfo={tableInfoProps} setExpandedRowRender="Y" offsetHeight={30} />
</Content>
}
</Layout>
</div>
</TabPane>
<TabPane tab="工作中心&机台计划" key={3}>
<Content
className="xly-productionPlanInfo"
style={{ maxHeight: 'calc( 100vh - 220px)', overflowY: 'auto' }}
>
<Card bordered={false} className="productionCardInfo">
<Row gutter={6}>
{props.onGetWorkCenterCharShow()}
</Row>
</Card>
<div className={selfstyles.charContainer}>
<CustomizedChar {... machineCharProps} />
</div>
</Content>
</TabPane>
</Tabs>
</div>
</Content>
</Layout>
{
props.unifiedPlanningChooseVisible ?
<AntdDraggableModal
width={1100}
title="统一规划"
visible={props.unifiedPlanningChooseVisible}
onCancel={props.onCancelUnifiedPlanningChooseModal}
footer={null}
>
{ props.unifiedPlanningChooseVisible ? <ProductionUnifiedPlanning {...unifiedPlanningType} /> : '' }
</AntdDraggableModal>
: ''
}
{
props.workScheduleVisible ?
<AntdDraggableModal
className="workScheduleModal"
width={1300}
title={commonUtils.isEmptyObject(searchWorkSchedule) ? searchWorkTitle : searchWorkSchedule.app.currentPane.title}
visible={props.workScheduleVisible}
onCancel={props.onCloseModel.bind(this, 'workScheduleVisible')}
onSaveState={props.onSaveState}
footer={null}
>
<CommonListSelect {...searchWorkSchedule} />
</AntdDraggableModal> : null
}
</Layout>
</Form>
);
});
export default CommonBase(CommonProductionMainPlanEvent(ProductionMainPlanComponent));