|
@@ -8,21 +8,23 @@
|
|
|
|
|
|
|
|
#import "HJSalarySheetView.h"
|
|
#import "HJSalarySheetView.h"
|
|
|
#import "HJSalaryKeys.h"
|
|
#import "HJSalaryKeys.h"
|
|
|
-#import "HJLabelContentView.h"
|
|
|
|
|
|
|
+//#import "HJLabelContentView.h"
|
|
|
|
|
|
|
|
@interface HJSalarySheetView ()
|
|
@interface HJSalarySheetView ()
|
|
|
|
|
|
|
|
-@property (nonatomic, strong) HJLabelContentView *monthView;
|
|
|
|
|
-@property (nonatomic, strong) HJLabelContentView *companyView;
|
|
|
|
|
-@property (nonatomic, strong) HJLabelContentView *workNumberView;
|
|
|
|
|
-@property (nonatomic, strong) HJLabelContentView *nameView;
|
|
|
|
|
|
|
+@property (nonatomic, strong) HJLabelRightContentView *monthView;//月份
|
|
|
|
|
+@property (nonatomic, strong) HJLabelRightContentView *companyView;//公司
|
|
|
|
|
+@property (nonatomic, strong) HJLabelRightContentView *workNumberView;//
|
|
|
|
|
+@property (nonatomic, strong) HJLabelRightContentView *nameView;//姓名
|
|
|
|
|
|
|
|
-@property (nonatomic, strong) HJLabelContentView *grossPaymentView;//应发合计
|
|
|
|
|
-@property (nonatomic, strong) HJLabelContentView *totalChargebackView;//扣款合计
|
|
|
|
|
-@property (nonatomic, strong) HJLabelContentView *netPaymentView;//实发工资
|
|
|
|
|
|
|
+@property (nonatomic, strong) HJLabelRightContentView *sourceView;//姓名
|
|
|
|
|
|
|
|
|
|
+@property (nonatomic, strong) HJLabelRightContentView *grossPaymentView;//应发合计
|
|
|
|
|
+@property (nonatomic, strong) HJLabelRightContentView *totalChargebackView;//扣款合计
|
|
|
|
|
+@property (nonatomic, strong) HJLabelRightContentView *netPaymentView;//实发工资
|
|
|
|
|
|
|
|
-@property (nonatomic, strong) HJLabelContentView *lastListView;
|
|
|
|
|
|
|
+
|
|
|
|
|
+@property (nonatomic, strong) HJLabelRightContentView *lastListView;
|
|
|
|
|
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
@@ -56,7 +58,7 @@
|
|
|
make.left.right.equalTo(self).offset(0);
|
|
make.left.right.equalTo(self).offset(0);
|
|
|
make.height.mas_equalTo(58);
|
|
make.height.mas_equalTo(58);
|
|
|
}];
|
|
}];
|
|
|
- [self autoLayOutHJLabelContentView:self.monthView];
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
[self.companyView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
[self.companyView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
@@ -64,15 +66,43 @@
|
|
|
make.left.right.equalTo(self).offset(0);
|
|
make.left.right.equalTo(self).offset(0);
|
|
|
make.height.mas_equalTo(58);
|
|
make.height.mas_equalTo(58);
|
|
|
}];
|
|
}];
|
|
|
- [self autoLayOutHJLabelContentView:self.companyView];
|
|
|
|
|
|
|
|
|
|
- [self.nameView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //判断是否添加发放来源
|
|
|
|
|
+ if (data[kHJSalaryKeySourceCompanyName][kHJSalaryKeyInnerValue]) {
|
|
|
|
|
|
|
|
- make.top.equalTo(self.companyView.mas_bottom).offset(0);
|
|
|
|
|
- make.left.right.equalTo(self).offset(0);
|
|
|
|
|
- make.height.mas_equalTo(58);
|
|
|
|
|
- }];
|
|
|
|
|
- [self autoLayOutHJLabelContentView:self.nameView];
|
|
|
|
|
|
|
+ [self addSubview:self.sourceView];
|
|
|
|
|
+
|
|
|
|
|
+ [self.sourceView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+
|
|
|
|
|
+ make.top.equalTo(self.companyView.mas_bottom).offset(0);
|
|
|
|
|
+ make.left.right.equalTo(self).offset(0);
|
|
|
|
|
+ make.height.mas_equalTo(58);
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [self.nameView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+
|
|
|
|
|
+ make.top.equalTo(self.sourceView.mas_bottom).offset(0);
|
|
|
|
|
+ make.left.right.equalTo(self).offset(0);
|
|
|
|
|
+ make.height.mas_equalTo(58);
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+ self.sourceView.contentLabel.text = data[kHJSalaryKeySourceCompanyName][kHJSalaryKeyInnerValue];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ [self.nameView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+
|
|
|
|
|
+ make.top.equalTo(self.companyView.mas_bottom).offset(0);
|
|
|
|
|
+ make.left.right.equalTo(self).offset(0);
|
|
|
|
|
+ make.height.mas_equalTo(58);
|
|
|
|
|
+ }];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
[self.workNumberView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
[self.workNumberView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
|
@@ -80,8 +110,7 @@
|
|
|
make.left.right.equalTo(self).offset(0);
|
|
make.left.right.equalTo(self).offset(0);
|
|
|
make.height.mas_equalTo(58);
|
|
make.height.mas_equalTo(58);
|
|
|
}];
|
|
}];
|
|
|
- [self autoLayOutHJLabelContentView:self.workNumberView];
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
self.monthView.contentLabel.text = data[kHJSalaryKeyMonth][kHJSalaryKeyInnerValue];
|
|
self.monthView.contentLabel.text = data[kHJSalaryKeyMonth][kHJSalaryKeyInnerValue];
|
|
|
self.companyView.contentLabel.text = data[kHJSalaryKeyCompanyName][kHJSalaryKeyInnerValue];
|
|
self.companyView.contentLabel.text = data[kHJSalaryKeyCompanyName][kHJSalaryKeyInnerValue];
|
|
|
self.nameView.contentLabel.text = data[kHJSalaryKeyEmployeeName][kHJSalaryKeyInnerValue];
|
|
self.nameView.contentLabel.text = data[kHJSalaryKeyEmployeeName][kHJSalaryKeyInnerValue];
|
|
@@ -97,11 +126,7 @@
|
|
|
|
|
|
|
|
for (int i = 0; i < listArray.count; i ++ )
|
|
for (int i = 0; i < listArray.count; i ++ )
|
|
|
{
|
|
{
|
|
|
- HJLabelContentView *listView = [[HJLabelContentView alloc]init];
|
|
|
|
|
- [listView.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
- make.centerY.equalTo(listView);
|
|
|
|
|
- make.left.equalTo(listView.mas_left).offset(120);
|
|
|
|
|
- }];
|
|
|
|
|
|
|
+ HJLabelRightContentView *listView = [[HJLabelRightContentView alloc]init];
|
|
|
listView.titleLabel.text = listArray[i][kHJSalaryKeyInnerKey];
|
|
listView.titleLabel.text = listArray[i][kHJSalaryKeyInnerKey];
|
|
|
listView.contentLabel.text = listArray[i][kHJSalaryKeyInnerValue];
|
|
listView.contentLabel.text = listArray[i][kHJSalaryKeyInnerValue];
|
|
|
|
|
|
|
@@ -123,7 +148,7 @@
|
|
|
make.left.right.equalTo(self).offset(0);
|
|
make.left.right.equalTo(self).offset(0);
|
|
|
make.height.mas_equalTo(58);
|
|
make.height.mas_equalTo(58);
|
|
|
}];
|
|
}];
|
|
|
- [self autoLayOutHJLabelContentView:self.grossPaymentView];
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
[self.totalChargebackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
[self.totalChargebackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
|
@@ -131,7 +156,7 @@
|
|
|
make.left.right.equalTo(self).offset(0);
|
|
make.left.right.equalTo(self).offset(0);
|
|
|
make.height.mas_equalTo(58);
|
|
make.height.mas_equalTo(58);
|
|
|
}];
|
|
}];
|
|
|
- [self autoLayOutHJLabelContentView:self.totalChargebackView];
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
[self.netPaymentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
[self.netPaymentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
|
@@ -140,78 +165,82 @@
|
|
|
make.height.mas_equalTo(58);
|
|
make.height.mas_equalTo(58);
|
|
|
make.bottom.equalTo(self.mas_bottom).offset(0);
|
|
make.bottom.equalTo(self.mas_bottom).offset(0);
|
|
|
}];
|
|
}];
|
|
|
- [self autoLayOutHJLabelContentView:self.netPaymentView];
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-- (void)autoLayOutHJLabelContentView:(HJLabelContentView *)view {
|
|
|
|
|
-
|
|
|
|
|
- [view.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
- make.centerY.equalTo(view);
|
|
|
|
|
- make.left.equalTo(view.mas_left).offset(120);
|
|
|
|
|
- }];
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
#pragma mark - getters and setters
|
|
#pragma mark - getters and setters
|
|
|
|
|
|
|
|
-- (HJLabelContentView *)monthView {
|
|
|
|
|
|
|
+- (HJLabelRightContentView *)monthView {
|
|
|
|
|
|
|
|
if (_monthView == nil)
|
|
if (_monthView == nil)
|
|
|
{
|
|
{
|
|
|
- _monthView = [[HJLabelContentView alloc]init];
|
|
|
|
|
|
|
+ _monthView = [[HJLabelRightContentView alloc]init];
|
|
|
_monthView.titleLabel.text = @"工资月份:";
|
|
_monthView.titleLabel.text = @"工资月份:";
|
|
|
}
|
|
}
|
|
|
return _monthView;
|
|
return _monthView;
|
|
|
}
|
|
}
|
|
|
-- (HJLabelContentView *)companyView {
|
|
|
|
|
|
|
+- (HJLabelRightContentView *)companyView {
|
|
|
|
|
|
|
|
if (_companyView == nil)
|
|
if (_companyView == nil)
|
|
|
{
|
|
{
|
|
|
- _companyView = [[HJLabelContentView alloc]init];
|
|
|
|
|
|
|
+ _companyView = [[HJLabelRightContentView alloc]init];
|
|
|
_companyView.titleLabel.text = @"公司名称:";
|
|
_companyView.titleLabel.text = @"公司名称:";
|
|
|
}
|
|
}
|
|
|
return _companyView;
|
|
return _companyView;
|
|
|
}
|
|
}
|
|
|
-- (HJLabelContentView *)workNumberView {
|
|
|
|
|
|
|
+- (HJLabelRightContentView *)sourceView {
|
|
|
|
|
+
|
|
|
|
|
+ if (_sourceView == nil)
|
|
|
|
|
+ {
|
|
|
|
|
+ _sourceView = [[HJLabelRightContentView alloc]init];
|
|
|
|
|
+ _sourceView.titleLabel.text = @"发放来源:";
|
|
|
|
|
+ }
|
|
|
|
|
+ return _sourceView;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (HJLabelRightContentView *)workNumberView {
|
|
|
|
|
|
|
|
if (_workNumberView == nil)
|
|
if (_workNumberView == nil)
|
|
|
{
|
|
{
|
|
|
- _workNumberView = [[HJLabelContentView alloc]init];
|
|
|
|
|
|
|
+ _workNumberView = [[HJLabelRightContentView alloc]init];
|
|
|
_workNumberView.titleLabel.text = @"工号:";
|
|
_workNumberView.titleLabel.text = @"工号:";
|
|
|
}
|
|
}
|
|
|
return _workNumberView;
|
|
return _workNumberView;
|
|
|
}
|
|
}
|
|
|
-- (HJLabelContentView *)nameView {
|
|
|
|
|
|
|
+- (HJLabelRightContentView *)nameView {
|
|
|
|
|
|
|
|
if (_nameView == nil)
|
|
if (_nameView == nil)
|
|
|
{
|
|
{
|
|
|
- _nameView = [[HJLabelContentView alloc]init];
|
|
|
|
|
|
|
+ _nameView = [[HJLabelRightContentView alloc]init];
|
|
|
_nameView.titleLabel.text = @"员工姓名:";
|
|
_nameView.titleLabel.text = @"员工姓名:";
|
|
|
}
|
|
}
|
|
|
return _nameView;
|
|
return _nameView;
|
|
|
}
|
|
}
|
|
|
-- (HJLabelContentView *)grossPaymentView {
|
|
|
|
|
|
|
+- (HJLabelRightContentView *)grossPaymentView {
|
|
|
|
|
|
|
|
if (_grossPaymentView == nil)
|
|
if (_grossPaymentView == nil)
|
|
|
{
|
|
{
|
|
|
- _grossPaymentView = [[HJLabelContentView alloc]init];
|
|
|
|
|
|
|
+ _grossPaymentView = [[HJLabelRightContentView alloc]init];
|
|
|
_grossPaymentView.titleLabel.text = @"应发合计:";
|
|
_grossPaymentView.titleLabel.text = @"应发合计:";
|
|
|
}
|
|
}
|
|
|
return _grossPaymentView;
|
|
return _grossPaymentView;
|
|
|
}
|
|
}
|
|
|
-- (HJLabelContentView *)totalChargebackView {
|
|
|
|
|
|
|
+- (HJLabelRightContentView *)totalChargebackView {
|
|
|
|
|
|
|
|
if (_totalChargebackView == nil)
|
|
if (_totalChargebackView == nil)
|
|
|
{
|
|
{
|
|
|
- _totalChargebackView = [[HJLabelContentView alloc]init];
|
|
|
|
|
|
|
+ _totalChargebackView = [[HJLabelRightContentView alloc]init];
|
|
|
_totalChargebackView.titleLabel.text = @"扣款合计:";
|
|
_totalChargebackView.titleLabel.text = @"扣款合计:";
|
|
|
}
|
|
}
|
|
|
return _totalChargebackView;
|
|
return _totalChargebackView;
|
|
|
}
|
|
}
|
|
|
-- (HJLabelContentView *)netPaymentView {
|
|
|
|
|
|
|
+- (HJLabelRightContentView *)netPaymentView {
|
|
|
|
|
|
|
|
if (_netPaymentView == nil)
|
|
if (_netPaymentView == nil)
|
|
|
{
|
|
{
|
|
|
- _netPaymentView = [[HJLabelContentView alloc]init];
|
|
|
|
|
|
|
+ _netPaymentView = [[HJLabelRightContentView alloc]init];
|
|
|
_netPaymentView.titleLabel.text = @"实发工资:";
|
|
_netPaymentView.titleLabel.text = @"实发工资:";
|
|
|
}
|
|
}
|
|
|
return _netPaymentView;
|
|
return _netPaymentView;
|