zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
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
//
//  PBSiteMaterialViewController.m
//  IphoneBIMe
//
//  Created by ZhangJF on 2022/8/24.
//  Copyright © 2022 ProBIM. All rights reserved.
//
 
#import "PBSiteMaterialViewController.h"
#import "PBProjectModel.h"
#import "PBSchedulePlanModel.h"
#import "PBScheduleHeaderView.h"
#import "PBMateralTableViewCell.h"
#import "PBMechanicalPlanModel.h"
#import "PBSiteMechanicalModel.h"
#import "PBEditTimeView.h"
#import "PBChooseType.h"
#import "PBArtifactsViewController.h"
#import "PBArtifactsInfoModel.h"
#import "PBScheduleListModel.h"
 
static NSString *const CellID = @"CellID";
@interface PBSiteMaterialViewController ()<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, strong) NSArray *dataList;
@property (nonatomic, strong) NSArray *typeDataList;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) PBEditTimeView *editTimeView;
@property (nonatomic, strong) PBChooseType *chooseTypeView;
@property (nonatomic, strong) PBScheduleHeaderView *headerView;
@property (nonatomic, strong) NSMutableArray *siteMaterialArrM;
@property (nonatomic, strong) NSIndexPath *currentIndexPath;
@property (nonatomic, copy) NSString *fillDate;
@property (nonatomic, copy) NSString *creatName;
@property (nonatomic, copy) NSString *creatId;
@property (nonatomic, assign) BOOL isAdd;
@end
 
@implementation PBSiteMaterialViewController
 
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.f) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.navigationController.interactivePopGestureRecognizer.enabled = NO;    //让rootView禁止滑动
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [PBNoteCenter addObserver:self selector:@selector(updateAddArtifacts:) name:PBNoteCenterUpdateArtifacts object:nil];
    [self setupUI];
    [self loadUserTypeWithPlanID:@"" andUserType:@"" andIndexPath:nil andModel:nil];
    [self loadData];
    [self setupNav];
}
- (void)updateAddArtifacts:(NSNotification *)noti {
    PBSiteMechanicalModel *siteMechanicalModel = self.siteMaterialArrM[self.currentIndexPath.row];
    siteMechanicalModel.elementList = noti.object;
    [self.tableView reloadRowsAtIndexPaths:@[self.currentIndexPath] withRowAnimation:UITableViewRowAnimationFade];
}
- (void)setupNav {
    self.title = @"现场材料";
    PBBackNavItem *backNav = [PBBackNavItem backNacItem];
    backNav.title = @"返回";
    [backNav addTarget:self action:@selector(backItemAction) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *backNavItem = [[UIBarButtonItem alloc] initWithCustomView:backNav];
    self.navigationItem.leftBarButtonItem = backNavItem;
    
    UIBarButtonItem *saveNavItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(saveAction)];
    self.navigationItem.rightBarButtonItem = saveNavItem;
}
- (void)backItemAction {
    [PBNoteCenter removeObserver:self];
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)saveAction{
    [YJProgressHUD showProgress:@"正在保存..." inView:self.view];
    NSMutableArray *arrM = [[NSMutableArray alloc] init];
    for (PBSiteMechanicalModel *obj in self.siteMaterialArrM) {
//        if (obj.MobileSafe_Name == nil || obj.MobileSafe_Measure == nil) {
//            [YJProgressHUD showMessage:@"请填写完整" inView:self.view];
//            return;
//        }
        NSMutableArray *elementArrM = [[NSMutableArray alloc] init];
        for (PBArtifactsInfoModel *model in obj.elementList) {
            NSDictionary *elementDict =  @{
                @"bhaselerel" : model.bhaselerel == nil? @"" : model.bhaselerel,
                @"relelejson" : model.relelejson == nil? @"" : model.relelejson,
                @"bm_guid" : model.bm_guid == nil? @"" : model.bm_guid,
                @"bm_materialname" : model.bm_materialname == nil? @"" : model.bm_materialname,
                @"bm_materialcode" : model.bm_materialcode == nil? @"" : model.bm_materialcode,
                @"bm_materialmodel" : model.bm_materialmodel == nil? @"" : model.bm_materialmodel,
                @"bm_materialcount" : model.bm_materialcount == nil? @"" : model.bm_materialcount,
                @"bm_materialunit" : model.bm_materialunit == nil? @"" : model.bm_materialunit,
                @"bm_materialfac" : model.bm_materialfac == nil? @"" : model.bm_materialfac,
                @"bm_planarrtime" : model.bm_planarrtime == nil? @"" : model.bm_planarrtime,
                @"bc_guid_materialtype" : model.bc_guid_materialtype == nil? @"" : model.bc_guid_materialtype,
                @"bc_guid_materialstatus" : model.bc_guid_materialstatus == nil? @"" : model.bc_guid_materialstatus,
                @"bm_extjson" : model.bm_extjson == nil? @"" : model.bm_extjson
            };
            [elementArrM addObject:elementDict];
        }
        NSString *jsonStr = [NSString arrConvertToJson:elementArrM.copy];
        NSDictionary *dict = @{
            @"MachineDetial_Name": obj.MachineDetial_Name == nil? @"" : obj.MachineDetial_Name, //材料名称
            @"MachineDetial_Parts": jsonStr == nil? @"" : jsonStr,//部位(json)
            @"MachineDetial_Size": obj.MachineDetial_Size == nil? @"" : obj.MachineDetial_Size, //材料规格
            @"MachineDetial_Unit": obj.MachineDetial_Unit == nil? @"" : obj.MachineDetial_Unit,//材料单位
            @"MachineDetial_Sum": obj.MachineDetial_Sum == nil? @"" : obj.MachineDetial_Sum,//材料总量
            @"MachineDetial_Approcach": obj.MachineDetial_Approcach == nil? @"" : obj.MachineDetial_Approcach,//当日进厂量
            @"MachineDetial_Add": obj.MachineDetial_Add == nil? @"" : obj.MachineDetial_Add, //累计进场
            @"MachineDetial_Product": obj.MachineDetial_Product == nil? @"" : obj.MachineDetial_Product,//生产情况
            @"MachineDetial_Estimated": obj.MachineDetial_Estimated == nil? @"" : obj.MachineDetial_Estimated, //预计到场
            @"MachineDetial_Remark": obj.MachineDetial_Remark == nil? @"" : obj.MachineDetial_Remark, //备注
 
            @"MachineDetial_ProjectID": self.schedulePlanModel.UID == nil? @"" : self.schedulePlanModel.UID,//进度计划编码
            @"MachineDetial_Unittime": self.fillDate == nil? @"" : self.fillDate,//填报日期
            @"MachineDetial_Createuser": self.creatName == nil? @"" : self.creatName,//填报人
            @"organizeId": self.projectModel.organizeid == nil? @"" : self.projectModel.organizeid //项目编码
        };
        [arrM addObject:dict];
    }
    
    [[PBNetworkTools sharedTools] AddMachineJSONWithOrganizeId:self.projectModel.organizeid andMobile:arrM.copy andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            NSLog(@"%@",error);
            [YJProgressHUD showMessage:@"加载失败" inView:self.view];
            return;
        }
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
        if (networkModel.Ret == 1) {
            [YJProgressHUD hide];
            PBScheduleListModel *listModel = [[PBScheduleListModel alloc] init];
            listModel.MobilePA_ProjectID = self.schedulePlanModel.UID;
            listModel.MobilePA_ProjectName = self.schedulePlanModel.Name;
            listModel.MobilePA_Unittime = self.fillDate;
            listModel.MobilePA_CreateUser = self.creatName;
            listModel.MobilePA_Createuserid =  self.creatId;
            listModel.MobilePA_state = @"待提交";
            if (self.AddSuccessBlock) {
                self.AddSuccessBlock(listModel);
            }
            [PBNoteCenter removeObserver:self];
            [self.navigationController popViewControllerAnimated:YES];
        }else {
            [YJProgressHUD showMessage:networkModel.Msg inView:self.view];
        }
    }];
}
 
- (void)loadUserTypeWithPlanID:(NSString *)planId andUserType:(NSString *)type andIndexPath:(NSIndexPath *) indexPath andModel:(PBSiteMechanicalModel *)mechanicalModel {
    [[PBNetworkTools sharedTools] GetMachineWithOrganizeId:self.projectModel.organizeid andMobileUserDetial_ProjectID:planId andMobile_UserType:type andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            NSLog(@"%@",error);
            [YJProgressHUD showMessage:@"加载失败" inView:self.view];
            return;
        }
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
        if (networkModel.Ret == 1) {
            NSMutableArray *typeArrM = [[NSMutableArray alloc] init];
            for (NSDictionary *obj in networkModel.Data) {
                PBMechanicalPlanModel *model = [PBMechanicalPlanModel yy_modelWithDictionary:obj];
                [typeArrM addObject:model];
            }
            if (indexPath == nil){
                self.typeDataList = typeArrM.copy;
            }else {
                if (typeArrM.count > 0){
                    PBMechanicalPlanModel *typeModel = typeArrM[0];
                    mechanicalModel.MachineDetial_Name = typeModel.Machine_Name; //材料名称
                    mechanicalModel.MachineDetial_Size = typeModel.Machine_Size; //材料规格
                    mechanicalModel.MachineDetial_Unit = typeModel.Machine_Unit; //材料单位
                    mechanicalModel.MachineDetial_Sum =  typeModel.Machine_PlanNum; //材料总量
                    mechanicalModel.MachineDetial_Add =  typeModel.Machine_AddNum; //累计进场
                    mechanicalModel.MachineDetialAdd =  typeModel.Machine_AddNum; //累计记录
                    [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
                }
            }
        }else {
            [YJProgressHUD showMessage:networkModel.Msg inView:self.view];
        }
    }];
}
 
- (void)loadData {
    self.dataList = @[@{@"name": @"材料进场情况", @"child": self.siteMaterialArrM}];
    if(self.isAdd) {
        [self.tableView reloadData];
    }else {
        [[PBNetworkTools sharedTools] GetMachineJSONWithUnittime:self.fillDate andCreateuserId:self.creatId andPlanID:self.schedulePlanModel.UID andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
            if (error) {
                NSLog(@"%@",error);
                [YJProgressHUD showMessage:@"加载失败" inView:self.view];
                return;
            }
            NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
            PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
            if (networkModel.Ret == 1) {
    //            [YJProgressHUD hide];
                for (NSDictionary *obj in networkModel.Data) {
                    PBSiteMechanicalModel *model = [PBSiteMechanicalModel yy_modelWithDictionary:obj];
                    model.MachineDetialAdd = model.MachineDetial_Add;
                    NSArray *elementList = [NSString convertTodictionaryOrArr:model.MachineDetial_Parts];
                    NSMutableArray *modelArr = [[NSMutableArray alloc] init];
                    for (NSDictionary *ele in elementList) {
                        PBArtifactsInfoModel *artifactsInfoModel = [PBArtifactsInfoModel yy_modelWithDictionary:ele];
                        [modelArr addObject:artifactsInfoModel];
                    }
                    model.elementList = modelArr.copy;
                    [self.siteMaterialArrM addObject:model];
                }
                [self.tableView reloadData];
            }else {
                [YJProgressHUD showMessage:networkModel.Msg inView:self.view];
            }
        }];
    }
}
- (void)setupUI {
    self.view.backgroundColor = [UIColor whiteColor];
    self.tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStyleGrouped];
    
//    UITableViewController *tvc = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain];
//    [self addChildViewController:tvc];
//    self.tableView = tvc.tableView;
    
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.backgroundColor = [UIColor whiteColor];
    self.tableView.tableFooterView = [UIView new];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.showsVerticalScrollIndicator = NO;
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.estimatedRowHeight = 100.f;
    [self.tableView registerClass:[PBMateralTableViewCell class] forCellReuseIdentifier:CellID];
    [self.view addSubview:self.tableView];
 
    if (@available(iOS 15.0, *)) {
        self.tableView.sectionHeaderTopPadding = 0;
    }
    CGFloat bottomH = 64.f;
    if (IS_IPHONE_X) {
        bottomH = 64.f + IPHONE_X_BOTTOM;
    }
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.left.right.equalTo(self.view);
        make.bottom.equalTo(self.view).offset(-bottomH);
    }];
    UIButton *addTaskBtn = [[UIButton alloc] init];
    [addTaskBtn setImage:[UIImage imageNamed:@"add_material"] forState:UIControlStateNormal];
    [addTaskBtn addTarget:self action:@selector(addPersonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:addTaskBtn];
    [addTaskBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.tableView.mas_bottom).offset(7);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.height.equalTo(@48);
    }];
    PBScheduleHeaderView *headerV = [[PBScheduleHeaderView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 132)];
    self.headerView = headerV;
    headerV.schedulePlanModel = self.schedulePlanModel;
    headerV.fillDate = self.fillDate;
    headerV.ChooseDate = ^{
        if (self.isAdd) {
            [self.view endEditing:YES];
            [PBKeyWindow addSubview:self.editTimeView];
            self.editTimeView.fillData = self.fillDate;
            self.editTimeView.ChooseCompleteBlock = ^(BOOL isSelsected, NSString *date){
                if (isSelsected) {
                    date = [date stringByReplacingOccurrencesOfString:@"年" withString:@"-"];
                    date = [date stringByReplacingOccurrencesOfString:@"月" withString:@"-"];
                    date = [date stringByReplacingOccurrencesOfString:@"日" withString:@""];
                    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
                    [formatter setDateFormat:@"yyyy-MM-dd"];
                    NSDate *newDate = [formatter dateFromString:date];
                    NSString * dateStr = [formatter stringFromDate:newDate];
                    self.fillDate = dateStr;
                    self.headerView.fillDate = self.fillDate;
                }
            };
            [self.editTimeView show];
        }else {
            [YJProgressHUD showMessage:@"无法修改日期" inView:self.view];
        }
    };
    self.tableView.tableHeaderView = headerV;
    
}
- (void)addPersonAction {
    PBSiteMechanicalModel *sitePerModel = [[PBSiteMechanicalModel alloc] init];
    [self.siteMaterialArrM addObject:sitePerModel];
    [self.tableView reloadData];
}
 
 
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return self.dataList.count;
}
 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    NSDictionary *item = self.dataList[section];
    NSArray *arr = [item valueForKey:@"child"];
    return arr.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 52;
}
 
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    //最后一个
    return 0.01;
}
 
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    return nil;
}
 
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UIView *bgView = [[UIView alloc]init];
    bgView.backgroundColor = [UIColor whiteColor];
    UIView *iconV = [[UIView alloc] init];
    iconV.backgroundColor = PBColor(95, 158, 249);
    [bgView addSubview:iconV];
    [iconV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(bgView).offset(20);
        make.size.mas_equalTo(CGSizeMake(6, 20));
        make.left.equalTo(bgView);
    }];
    NSDictionary *dict = self.dataList[section];
    UILabel *nameL = [UILabel z_labelWithText:[dict valueForKey:@"name"] Color:[UIColor z_colorWithR:95 G:158 B:249] isBold:YES Font:18];
    [bgView addSubview:nameL];
    [nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(iconV);
        make.left.equalTo(iconV.mas_right).offset(5);
    }];
    return bgView;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSDictionary *item = self.dataList[indexPath.section];
    NSArray *arr = [item valueForKey:@"child"];
    PBSiteMechanicalModel *model = arr[indexPath.row];
    PBMateralTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellID forIndexPath:indexPath];
    cell.siteMechanicalModel = model;
    cell.materialIndex = indexPath.row + 1;
    cell.ChooseTypeBlock = ^{
        [self.view endEditing:YES];
        [PBKeyWindow addSubview:self.chooseTypeView];
        self.chooseTypeView.siteMechanicalModel = model;
        self.chooseTypeView.dateList = self.typeDataList;
        self.chooseTypeView.ChooseCompleteBlock = ^(BOOL isSelsected, NSInteger index){
            if (isSelsected) {
                PBMechanicalPlanModel *typeModel = self.typeDataList[index];
                [self loadUserTypeWithPlanID:self.schedulePlanModel.UID andUserType:typeModel.Machine_Name andIndexPath:indexPath andModel:model];
            }
        };
        [self.chooseTypeView show];
    };
    cell.AddElementBlock = ^{
        self.currentIndexPath = indexPath;
        [self.view endEditing:YES];
        PBArtifactsViewController *artifactsVC = [[PBArtifactsViewController alloc] init];
        artifactsVC.siteMechanicalModel = model;
        artifactsVC.projectModel = self.projectModel;
        artifactsVC.selectList = model.elementList.mutableCopy;
        [self.navigationController pushViewController:artifactsVC animated:YES];
    };
    cell.DeleteElementBlock = ^(NSArray * _Nonnull elements) {
        model.elementList = elements;
        [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    };
    cell.ChooseTimeBlock = ^{
        [self.view endEditing:YES];
        [PBKeyWindow addSubview:self.editTimeView];
        self.editTimeView.fillData = self.fillDate;
        self.editTimeView.ChooseCompleteBlock = ^(BOOL isSelsected, NSString *date){
            if (isSelsected) {
                date = [date stringByReplacingOccurrencesOfString:@"年" withString:@"-"];
                date = [date stringByReplacingOccurrencesOfString:@"月" withString:@"-"];
                date = [date stringByReplacingOccurrencesOfString:@"日" withString:@""];
                NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
                [formatter setDateFormat:@"yyyy-MM-dd"];
                NSDate *newDate = [formatter dateFromString:date];
                NSString * dateStr = [formatter stringFromDate:newDate];
                model.MachineDetial_Estimated = dateStr;
                [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
            }
        };
        [self.editTimeView show];
    };
    cell.DeleteBlock = ^{
        [self.siteMaterialArrM removeObjectAtIndex:indexPath.row];
        [self.tableView reloadData];
    };
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
}
 
- (void)setSchedulePlanModel:(PBSchedulePlanModel *)schedulePlanModel{
    _schedulePlanModel = schedulePlanModel;
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    self.fillDate = [formatter stringFromDate:[NSDate date]];
    self.creatName = Realname;
    self.creatId = UserID;
    self.isAdd = true;
}
- (void)setScheduleListModel:(PBScheduleListModel *)scheduleListModel {
    _scheduleListModel = scheduleListModel;
    PBSchedulePlanModel *planModel = [[PBSchedulePlanModel alloc] init];
    planModel.UID = scheduleListModel.MobilePA_ProjectID;
    planModel.Name = scheduleListModel.MobilePA_ProjectName;
    self.schedulePlanModel = planModel;
    self.fillDate = scheduleListModel.MobilePA_Unittime;
    self.creatName = scheduleListModel.MobilePA_CreateUser;
    self.creatId = scheduleListModel.MobilePA_Createuserid;
    self.isAdd = false;
}
- (void)setProjectModel:(PBProjectModel *)projectModel {
    _projectModel = projectModel;
}
- (PBEditTimeView *)editTimeView {
    if (_editTimeView == nil) {
        _editTimeView = [[PBEditTimeView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _editTimeView.visualViewHeight = 300;
    }
    return _editTimeView;
}
- (PBChooseType *)chooseTypeView {
    if (_chooseTypeView == nil) {
        _chooseTypeView = [[PBChooseType alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _chooseTypeView.visualViewHeight = 300;
    }
    return _chooseTypeView;;
}
- (NSMutableArray *)siteMaterialArrM {
    if (_siteMaterialArrM == nil) {
        _siteMaterialArrM = [[NSMutableArray alloc] init];
    }
    return _siteMaterialArrM;
}
- (void)dealloc {
    [PBNoteCenter removeObserver:self];
}
/*
#pragma mark - Navigation
 
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
 
@end