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
//
//  PBSitePerTableViewCell.m
//  IphoneBIMe
//
//  Created by ZhangJF on 2022/8/30.
//  Copyright © 2022 ProBIM. All rights reserved.
//
 
#import "PBSitePerTableViewCell.h"
#import "PBSitePerModel.h"
#import "PBSiteMaterialModel.h"
 
@interface PBSitePerTableViewCell()<UITextFieldDelegate>
@property (nonatomic, weak) UILabel *chooseTaskL; //所选类型
@property (nonatomic, weak) UILabel *planProportionL; //计划
//@property (nonatomic, weak) UILabel *GrandProportionL; //累计
@property (nonatomic, weak) UIButton *chooseTask;//选择工种
@property (nonatomic, weak) UITextField *todayTF; //增减
@property (nonatomic, weak) UITextField *tomTF; //现场
@property (nonatomic, weak) UILabel *taskNameL; //人员1
@property (nonatomic, weak) UILabel *typeL;//人员类别 自定义
@property (nonatomic, weak) UIView *typeBg;//类别输入背景
@property (nonatomic, weak) UITextField *typeTF;// 人员类别
@property (nonatomic, weak) UILabel *compalte; // 人员总数
//@property (nonatomic, strong) UIToolbar *kbToolbar;
 
@property (nonatomic, weak) UILabel *planunitL;
//@property (nonatomic, weak) UILabel *GrandunitL;
@property (nonatomic, weak) UILabel *unitL;
@property (nonatomic, weak) UILabel *tomunitL;
@end
@implementation PBSitePerTableViewCell
 
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    UIButton *deleteBtn = [UIButton z_bgImageButton:[UIImage imageNamed:@"delete_task"]];
    [deleteBtn addTarget:self action:@selector(deleteAction) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:deleteBtn];
    [deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(6);
        make.left.equalTo(self.contentView).offset(12);
        make.size.mas_equalTo(CGSizeMake(20, 20));
    }];
    UILabel *taskNameL = [UILabel z_labelWithText:@"人员1" Color:[UIColor z_colorWithR:95 G:158 B:249] isBold:YES Font:14];
    [self.contentView addSubview:taskNameL];
    [taskNameL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(deleteBtn);
        make.left.equalTo(deleteBtn.mas_right).offset(8);
    }];
    UIButton *chooseTask = [[UIButton alloc] init];
    [chooseTask addTarget:self action:@selector(choosetype) forControlEvents:UIControlEventTouchUpInside];
    chooseTask.layer.cornerRadius = 4;
    chooseTask.layer.borderWidth = 1.f;
    chooseTask.layer.borderColor = [[UIColor z_colorWithR:108 G:108 B:108] CGColor];
    [self.contentView addSubview:chooseTask];
    [chooseTask mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(deleteBtn.mas_bottom).offset(6);
        make.left.equalTo(self.contentView).offset(12);
        make.right.equalTo(self.contentView).offset(-12);
        make.height.equalTo(@44);
    }];
    UILabel *chooseTaskL = [UILabel z_labelWithText:@"请选择" Color:[UIColor z_colorWithR:174 G:174 B:174] isBold:NO Font:14];
    [self.contentView addSubview:chooseTaskL];
    [chooseTaskL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(chooseTask).offset(12);
        make.right.equalTo(chooseTask).offset(-44);
        make.centerY.equalTo(chooseTask);
    }];
    UIImageView *chooseImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"chooseTask_icon"]];
    [self.contentView addSubview:chooseImageV];
    [chooseImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(chooseTask).offset(18);
        make.right.equalTo(chooseTask).offset(-14);
        make.size.mas_equalTo(CGSizeMake(12, 10));
    }];
    UILabel *typeL = [UILabel z_labelWithText:@"人员类别" Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
    [self.contentView addSubview:typeL];
    [typeL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(chooseTask.mas_bottom).offset(16);
        make.left.equalTo(chooseTask);
    }];
    UIView *typeBg = [[UIView alloc] init];
    typeBg.layer.cornerRadius = 4;
    typeBg.layer.borderWidth = 1.f;
    typeBg.layer.borderColor = [[UIColor z_colorWithR:108 G:108 B:108] CGColor];
    [self.contentView addSubview:typeBg];
    [typeBg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(typeL.mas_bottom).offset(6);
        make.left.equalTo(self.contentView).offset(12);
        make.right.equalTo(self.contentView).offset(-12);
        make.height.equalTo(@44);
    }];
    UITextField *typeTF = [[UITextField alloc] init];
    typeTF.placeholder = @"请输入";
    typeTF.textAlignment= NSTextAlignmentLeft;
    typeTF.textColor = PBColor(40, 58, 79);
    typeTF.font = [UIFont fontWithName:Coarse size:16.0];
    typeTF.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
    typeTF.delegate = self;
//    todayTF.returnKeyType = UIReturnKeyDone;
    [self.contentView addSubview:typeTF];
    [typeTF mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(typeBg).offset(12);
        make.right.equalTo(typeBg).offset(-12);
        make.height.equalTo(@44);
        make.centerY.equalTo(typeBg);
    }];
    
   
    UILabel *compalte = [UILabel z_labelWithText:@"人员总数" Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
    [self.contentView addSubview:compalte];
    [compalte mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(typeBg.mas_bottom).offset(16);
        make.left.equalTo(chooseTask);
    }];
    UILabel *todayNum = [UILabel z_labelWithText:@"今日数量" Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
    [self.contentView addSubview:todayNum];
    [todayNum mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(compalte);
        make.right.equalTo(self.contentView).offset(-114);
    }];
    
    UIView *PlanBgV = [[UIView alloc] init];
    PlanBgV.backgroundColor = PBColor(243, 243, 243);
    PlanBgV.layer.cornerRadius = 4;
    PlanBgV.layer.borderWidth = 1.f;
    PlanBgV.layer.borderColor = PBColor(108, 108, 108).CGColor;
    [self.contentView addSubview:PlanBgV];
    [PlanBgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(compalte.mas_bottom).offset(16);
        make.left.equalTo(compalte).offset(44);
        make.size.mas_equalTo(CGSizeMake(112, 88));
        make.bottom.mas_equalTo(self.contentView).offset(-20);
    }];
//    UIView *planBgLine = [[UIView alloc] init];
//    planBgLine.backgroundColor = PBColor(51, 51, 51);
//    [self.contentView addSubview:planBgLine];
//    [planBgLine mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(PlanBgV).offset(43);
//        make.height.equalTo(@2);
//        make.left.right.equalTo(PlanBgV);
//    }];
    UILabel *planL = [UILabel z_labelWithText:@"计划: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
    [self.contentView addSubview:planL];
    [planL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(PlanBgV);
        make.left.equalTo(compalte);
    }];
//    UILabel *grandL = [UILabel z_labelWithText:@"累计: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
//    [self.contentView addSubview:grandL];
//    [grandL mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.bottom.equalTo(PlanBgV).offset(-14);
//        make.left.equalTo(compalte);
//    }];
    UILabel *todayL = [UILabel z_labelWithText:@"增减: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
    [self.contentView addSubview:todayL];
    [todayL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(PlanBgV).offset(14);
        make.left.equalTo(PlanBgV.mas_right).offset(35);
    }];
    UILabel *tomL = [UILabel z_labelWithText:@"现场: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
    [self.contentView addSubview:tomL];
    [tomL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(PlanBgV).offset(-14);
        make.left.equalTo(todayL);
    }];
    
    UIView *actualBgV = [[UIView alloc] init];
    actualBgV.layer.cornerRadius = 4;
    actualBgV.layer.borderWidth = 1.f;
    actualBgV.layer.borderColor = PBColor(108, 108, 108).CGColor;
    [self.contentView addSubview:actualBgV];
    [actualBgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(PlanBgV);
        make.left.equalTo(PlanBgV.mas_right).offset(81);
        make.size.mas_equalTo(CGSizeMake(112, 88));
    }];
    UIView *actualBgLine = [[UIView alloc] init];
    actualBgLine.backgroundColor = PBColor(51, 51, 51);
    [self.contentView addSubview:actualBgLine];
    [actualBgLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(actualBgV).offset(43);
        make.height.equalTo(@2);
        make.left.right.equalTo(actualBgV);
    }];
    
    UILabel *planProportionL = [UILabel z_labelWithText:@"" Color:[UIColor z_colorWithR:40 G:58 B:79] isBold:YES Font:16];
    [self.contentView addSubview:planProportionL];
    [planProportionL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(PlanBgV);
        make.left.equalTo(PlanBgV).offset(12);
        make.right.equalTo(PlanBgV).offset(-28);
    }];
    UILabel *planunitL = [UILabel z_labelWithText:@"人" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:YES Font:14];
    [self.contentView addSubview:planunitL];
    [planunitL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(PlanBgV);
        make.right.equalTo(PlanBgV).offset(-12);
    }];
//    UILabel *GrandProportionL = [UILabel z_labelWithText:@"" Color:[UIColor z_colorWithR:40 G:58 B:79] isBold:YES Font:16];
//    [self.contentView addSubview:GrandProportionL];
//    [GrandProportionL mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(planBgLine.mas_bottom);
//        make.bottom.equalTo(PlanBgV);
//        make.left.equalTo(PlanBgV).offset(12);
//        make.right.equalTo(PlanBgV).offset(-28);
//    }];
//    UILabel *GrandunitL = [UILabel z_labelWithText:@"人" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:YES Font:14];
//    [self.contentView addSubview:GrandunitL];
//    [GrandunitL mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(grandL);
//        make.right.equalTo(PlanBgV).offset(-12);
//    }];
    
    UITextField *todayTF = [[UITextField alloc] init];
    todayTF.placeholder = @"请输入";
    todayTF.textAlignment= NSTextAlignmentLeft;
    todayTF.textColor = PBColor(40, 58, 79);
    todayTF.font = [UIFont fontWithName:Coarse size:16.0];
    todayTF.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
    todayTF.delegate = self;
//    todayTF.returnKeyType = UIReturnKeyDone;
    [self.contentView addSubview:todayTF];
    [todayTF mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(actualBgV);
        make.bottom.equalTo(actualBgLine.mas_top);
        make.left.equalTo(actualBgV).offset(12);
        make.right.equalTo(actualBgV).offset(-28);
    }];
    UILabel *unitL = [UILabel z_labelWithText:@"人" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:YES Font:14];
    [self.contentView addSubview:unitL];
    [unitL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(todayL);
        make.right.equalTo(actualBgV).offset(-12);
    }];
    UITextField *tomTF = [[UITextField alloc] init];
    tomTF.placeholder = @"请输入";
    tomTF.textAlignment= NSTextAlignmentLeft;
    tomTF.textColor = PBColor(40, 58, 79);
    tomTF.font = [UIFont fontWithName:Coarse size:16.0];
    tomTF.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
//    todayTF.delegate = self;
//    todayTF.returnKeyType = UIReturnKeyDone;
    tomTF.delegate = self;
    [self.contentView addSubview:tomTF];
    [tomTF mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(actualBgLine.mas_bottom);
        make.bottom.equalTo(actualBgV);
        make.left.equalTo(actualBgV).offset(12);
        make.right.equalTo(actualBgV).offset(-28);
    }];
    UILabel *tomunitL = [UILabel z_labelWithText:@"人" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:YES Font:14];
    [self.contentView addSubview:tomunitL];
    [tomunitL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(tomL);
        make.right.equalTo(actualBgV).offset(-12);
    }];
 
    self.chooseTaskL = chooseTaskL;
    self.chooseTask = chooseTask;
    self.typeL = typeL;
    self.typeBg = typeBg;
    self.typeTF = typeTF;
    self.planProportionL = planProportionL;
//    self.GrandProportionL = GrandProportionL;
    self.todayTF = todayTF;
    self.tomTF = tomTF;
    self.taskNameL = taskNameL;
    self.compalte = compalte;
//    self.todayTF.inputAccessoryView = self.kbToolbar;
//    self.tomTF.inputAccessoryView = self.kbToolbar;
//    self.typeTF.inputAccessoryView = self.kbToolbar;
    
    self.planunitL = planunitL;
//    self.GrandunitL = GrandunitL;
    self.unitL = unitL;
    self.tomunitL = tomunitL;
}
 
- (void)choosetype {
    if (self.ChooseTypeBlock) {
        self.ChooseTypeBlock();
    }
}
- (void)deleteAction {
    if (self.DeleteBlock) {
        self.DeleteBlock();
    }
}
- (void)setSitePerModel:(PBSitePerModel *)sitePerModel {
    _sitePerModel = sitePerModel;
    if ([sitePerModel.MobileUserDetial_Name isEqualToString:@"其他"]) {
        self.typeL.hidden = NO;
        self.typeBg.hidden = NO;
        self.typeTF.hidden = NO;
        self.typeL.text = @"人员类别";
        self.typeTF.text = sitePerModel.MobileUserDetial_type;
        [self.compalte mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.chooseTask.mas_bottom).offset(106);
        }];
    } else {
        self.typeL.hidden = YES;
        self.typeBg.hidden = YES;
        self.typeTF.hidden = YES;
        [self.compalte mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.chooseTask.mas_bottom).offset(16);
        }];
    }
    if (sitePerModel.MobileUserDetial_Name == nil){
        self.chooseTaskL.textColor = PBColor(174, 174, 174);
        self.chooseTaskL.text = @"请选择";
        self.planProportionL.text = nil;
    } else {
        self.chooseTaskL.textColor = PBColor(51, 51, 51);
        self.chooseTaskL.text = sitePerModel.MobileUserDetial_Name;
        self.planProportionL.text = sitePerModel.MobileUserDetial_PlanNum;
    }
    self.compalte.text = @"人员总量";
    self.planunitL.text = @"人";
//    self.GrandunitL.text = @"人";
    self.unitL.text = @"人";
    self.tomunitL.text = @"人";
//    self.GrandProportionL.text = sitePerModel.MobileUserDetial_AddNum;
    self.todayTF.text = sitePerModel.MobileUserDetial_AdddelNum;
    self.tomTF.text = sitePerModel.MobileUserDetial_NewNum;
}
- (void)setSiteMaterialModel:(PBSiteMaterialModel *)siteMaterialModel{
    _siteMaterialModel = siteMaterialModel;
    if ([siteMaterialModel.MaterialsDetial_Name isEqualToString:@"其他"]) {
        self.typeL.hidden = NO;
        self.typeBg.hidden = NO;
        self.typeTF.hidden = NO;
        self.typeL.text = @"机械类别";
        self.typeTF.text = siteMaterialModel.MaterialsDetial_type;
        [self.compalte mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.chooseTask.mas_bottom).offset(106);
        }];
    } else {
        self.typeL.hidden = YES;
        self.typeBg.hidden = YES;
        self.typeTF.hidden = YES;
        [self.compalte mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.chooseTask.mas_bottom).offset(16);
        }];
    }
    if (siteMaterialModel.MaterialsDetial_Name == nil){
        self.chooseTaskL.textColor = PBColor(174, 174, 174);
        self.chooseTaskL.text = @"请选择";
        self.planProportionL.text = nil;
    } else {
        self.chooseTaskL.textColor = PBColor(51, 51, 51);
        self.chooseTaskL.text = siteMaterialModel.MaterialsDetial_Name;
        self.planProportionL.text = siteMaterialModel.MaterialsDetial_PlanNum;
    }
    self.compalte.text = @"机械总量";
    self.planunitL.text = @"台";
//    self.GrandunitL.text = @"台";
    self.unitL.text = @"台";
    self.tomunitL.text = @"台";
//    self.GrandProportionL.text = siteMaterialModel.MaterialsDetial_AddNum;
    self.todayTF.text = siteMaterialModel.MaterialsDetial_AdddelNum;
    self.tomTF.text = siteMaterialModel.MaterialsDetial_NewNum;
}
 
- (void)setPerIndex:(NSInteger)perIndex {
    _perIndex = perIndex;
    self.taskNameL.text = [NSString stringWithFormat:@"人员%zd",perIndex];
}
- (void)setMaterialIndex:(NSInteger)materialIndex {
    _materialIndex = materialIndex;
    self.taskNameL.text = [NSString stringWithFormat:@"机械%zd",materialIndex];
}
//- (UIToolbar *) kbToolbar {
//    if (_kbToolbar == nil) {
//        _kbToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, MainScreenWidth, 44)];
//        UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStyleDone target:self action:@selector(closeKeyboard)];
//        _kbToolbar.items = @[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil], doneItem];
//    }
//    return _kbToolbar;
//}
//- (void)closeKeyboard {
//    [self endEditing:YES];
//}
 
#pragma mark - UITextFieldDelegate
- (void)textFieldDidEndEditing:(UITextField *)textField{
    if(self.sitePerModel) {
        if(textField == self.typeTF) {
            self.sitePerModel.MobileUserDetial_type = textField.text;
        }else if (textField == self.todayTF){
            self.sitePerModel.MobileUserDetial_AdddelNum = textField.text;
            NSInteger planNum = [self.sitePerModel.MobileUserDetial_PlanNum integerValue];
            NSInteger adddelNum = [self.sitePerModel.MobileUserDetial_AdddelNum integerValue];
            self.sitePerModel.MobileUserDetial_NewNum = [NSString stringWithFormat:@"%zd", planNum + adddelNum];
            self.tomTF.text = self.sitePerModel.MobileUserDetial_NewNum;
        }else {
            self.sitePerModel.MobileUserDetial_NewNum = textField.text;
            NSInteger planNum = [self.sitePerModel.MobileUserDetial_PlanNum integerValue];
            NSInteger newNum = [self.sitePerModel.MobileUserDetial_NewNum integerValue];
            self.sitePerModel.MobileUserDetial_AdddelNum = [NSString stringWithFormat:@"%zd", newNum - planNum];
            self.todayTF.text = self.sitePerModel.MobileUserDetial_AdddelNum;
            
//            NSInteger site = [textField.text integerValue];
//            NSInteger addNum = [self.sitePerModel.MobileUserDetial_AddNum integerValue];
//            self.sitePerModel.MobileUserDetial_AddNum = [NSString stringWithFormat:@"%zd",addNum + site];
//            self.GrandProportionL.text = self.sitePerModel.MobileUserDetial_AddNum;
        }
    }else {
        if(textField == self.typeTF) {
            self.siteMaterialModel.MaterialsDetial_type = textField.text;
        }else if (textField == self.todayTF){
            self.siteMaterialModel.MaterialsDetial_AdddelNum = textField.text;
            NSInteger planNum = [self.siteMaterialModel.MaterialsDetial_PlanNum integerValue];
            NSInteger adddelNum = [self.siteMaterialModel.MaterialsDetial_AdddelNum integerValue];
            self.siteMaterialModel.MaterialsDetial_NewNum = [NSString stringWithFormat:@"%zd", planNum + adddelNum];
            self.tomTF.text = self.siteMaterialModel.MaterialsDetial_NewNum;
        }else {
            self.siteMaterialModel.MaterialsDetial_NewNum = textField.text;
            NSInteger planNum = [self.siteMaterialModel.MaterialsDetial_PlanNum integerValue];
            NSInteger newNum = [self.siteMaterialModel.MaterialsDetial_NewNum integerValue];
            self.siteMaterialModel.MaterialsDetial_AdddelNum = [NSString stringWithFormat:@"%zd", newNum - planNum];
            self.todayTF.text = self.siteMaterialModel.MaterialsDetial_AdddelNum;
            
//            NSInteger site = [textField.text integerValue];
//            NSInteger addNum = [self.siteMaterialModel.MaterialsDetial_AddNum integerValue];
//            self.siteMaterialModel.MaterialsDetial_AddNum = [NSString stringWithFormat:@"%zd",addNum + site];
//            self.GrandProportionL.text = self.siteMaterialModel.MaterialsDetial_AddNum;
        }
    }
}
@end