Commit 6a162f7b authored by Sandy's avatar Sandy

销售录入模块控制

parent ea4b5f1e
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
8FBE1E181D6ACDA2002584E5 /* SalesInputAuditListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE1E141D6ACDA2002584E5 /* SalesInputAuditListModel.m */; }; 8FBE1E181D6ACDA2002584E5 /* SalesInputAuditListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE1E141D6ACDA2002584E5 /* SalesInputAuditListModel.m */; };
8FBE1E191D6ACDA2002584E5 /* SalesInputLines.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE1E171D6ACDA2002584E5 /* SalesInputLines.m */; }; 8FBE1E191D6ACDA2002584E5 /* SalesInputLines.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE1E171D6ACDA2002584E5 /* SalesInputLines.m */; };
8FBE1E1B1D6ADF28002584E5 /* audit.png in Resources */ = {isa = PBXBuildFile; fileRef = 8FBE1E1A1D6ADF28002584E5 /* audit.png */; }; 8FBE1E1B1D6ADF28002584E5 /* audit.png in Resources */ = {isa = PBXBuildFile; fileRef = 8FBE1E1A1D6ADF28002584E5 /* audit.png */; };
8FC70DA81D7E8F55008DC9BC /* YRBorderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FC70DA71D7E8F55008DC9BC /* YRBorderView.m */; };
A0D453625552DAC91D4EB4A7 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C5987243B74E897E93DEC7D3 /* libPods.a */; }; A0D453625552DAC91D4EB4A7 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C5987243B74E897E93DEC7D3 /* libPods.a */; };
C10F161B1BF77CA00065F18C /* ICRAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10F16121BF77CA00065F18C /* ICRAboutViewController.m */; }; C10F161B1BF77CA00065F18C /* ICRAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10F16121BF77CA00065F18C /* ICRAboutViewController.m */; };
C10F161C1BF77CA00065F18C /* ICRConfigurationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10F16141BF77CA00065F18C /* ICRConfigurationViewController.m */; }; C10F161C1BF77CA00065F18C /* ICRConfigurationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10F16141BF77CA00065F18C /* ICRConfigurationViewController.m */; };
...@@ -918,7 +919,7 @@ ...@@ -918,7 +919,7 @@
19D76A9E1D2667AB006245D6 /* SaleInputPictureTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SaleInputPictureTableViewCell.xib; sourceTree = "<group>"; }; 19D76A9E1D2667AB006245D6 /* SaleInputPictureTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SaleInputPictureTableViewCell.xib; sourceTree = "<group>"; };
19D76A9F1D2667AB006245D6 /* SaleInputPictureCellHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SaleInputPictureCellHeader.xib; sourceTree = "<group>"; }; 19D76A9F1D2667AB006245D6 /* SaleInputPictureCellHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SaleInputPictureCellHeader.xib; sourceTree = "<group>"; };
19D76AA31D266910006245D6 /* CALayer+Addtions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+Addtions.h"; sourceTree = "<group>"; }; 19D76AA31D266910006245D6 /* CALayer+Addtions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+Addtions.h"; sourceTree = "<group>"; };
19D76AA41D266910006245D6 /* CALayer+Addtions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+Addtions.m"; sourceTree = "<group>"; }; 19D76AA41D266910006245D6 /* CALayer+Addtions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CALayer+Addtions.m"; path = "3rd/CALayer+Addtions.m"; sourceTree = "<group>"; };
710E0C5D8A5E02D32E5C6C2D /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; }; 710E0C5D8A5E02D32E5C6C2D /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
8F0419EB1D6ABEF70062800C /* SaleInputAuditViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SaleInputAuditViewController.h; sourceTree = "<group>"; }; 8F0419EB1D6ABEF70062800C /* SaleInputAuditViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SaleInputAuditViewController.h; sourceTree = "<group>"; };
8F0419EC1D6ABEF70062800C /* SaleInputAuditViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SaleInputAuditViewController.m; sourceTree = "<group>"; }; 8F0419EC1D6ABEF70062800C /* SaleInputAuditViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SaleInputAuditViewController.m; sourceTree = "<group>"; };
...@@ -966,6 +967,8 @@ ...@@ -966,6 +967,8 @@
8FBE1E161D6ACDA2002584E5 /* SalesInputLines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SalesInputLines.h; sourceTree = "<group>"; }; 8FBE1E161D6ACDA2002584E5 /* SalesInputLines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SalesInputLines.h; sourceTree = "<group>"; };
8FBE1E171D6ACDA2002584E5 /* SalesInputLines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SalesInputLines.m; sourceTree = "<group>"; }; 8FBE1E171D6ACDA2002584E5 /* SalesInputLines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SalesInputLines.m; sourceTree = "<group>"; };
8FBE1E1A1D6ADF28002584E5 /* audit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = audit.png; sourceTree = "<group>"; }; 8FBE1E1A1D6ADF28002584E5 /* audit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = audit.png; sourceTree = "<group>"; };
8FC70DA61D7E8F55008DC9BC /* YRBorderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YRBorderView.h; sourceTree = "<group>"; };
8FC70DA71D7E8F55008DC9BC /* YRBorderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YRBorderView.m; sourceTree = "<group>"; };
C10F16111BF77CA00065F18C /* ICRAboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICRAboutViewController.h; path = view_iPhone/templates/settings/ICRAboutViewController.h; sourceTree = "<group>"; }; C10F16111BF77CA00065F18C /* ICRAboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICRAboutViewController.h; path = view_iPhone/templates/settings/ICRAboutViewController.h; sourceTree = "<group>"; };
C10F16121BF77CA00065F18C /* ICRAboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ICRAboutViewController.m; path = view_iPhone/templates/settings/ICRAboutViewController.m; sourceTree = "<group>"; }; C10F16121BF77CA00065F18C /* ICRAboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ICRAboutViewController.m; path = view_iPhone/templates/settings/ICRAboutViewController.m; sourceTree = "<group>"; };
C10F16131BF77CA00065F18C /* ICRConfigurationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICRConfigurationViewController.h; path = view_iPhone/templates/settings/ICRConfigurationViewController.h; sourceTree = "<group>"; }; C10F16131BF77CA00065F18C /* ICRConfigurationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICRConfigurationViewController.h; path = view_iPhone/templates/settings/ICRConfigurationViewController.h; sourceTree = "<group>"; };
...@@ -2459,15 +2462,24 @@ ...@@ -2459,15 +2462,24 @@
path = TotalSupportField; path = TotalSupportField;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
8FC70DA51D7E8F55008DC9BC /* YRBorderView */ = {
isa = PBXGroup;
children = (
8FC70DA61D7E8F55008DC9BC /* YRBorderView.h */,
8FC70DA71D7E8F55008DC9BC /* YRBorderView.m */,
);
path = YRBorderView;
sourceTree = "<group>";
};
C10F17831BF7ACA80065F18C /* 3rd */ = { C10F17831BF7ACA80065F18C /* 3rd */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
8FC70DA51D7E8F55008DC9BC /* YRBorderView */,
19605F931D375A4200C20590 /* BaseViewController.h */, 19605F931D375A4200C20590 /* BaseViewController.h */,
19605F941D375A4200C20590 /* BaseViewController.m */, 19605F941D375A4200C20590 /* BaseViewController.m */,
19B34CBC1D3A124E0060E272 /* CalculateHelper.h */, 19B34CBC1D3A124E0060E272 /* CalculateHelper.h */,
19B34CBD1D3A124E0060E272 /* CalculateHelper.m */, 19B34CBD1D3A124E0060E272 /* CalculateHelper.m */,
19D76AA31D266910006245D6 /* CALayer+Addtions.h */, 19D76AA31D266910006245D6 /* CALayer+Addtions.h */,
19D76AA41D266910006245D6 /* CALayer+Addtions.m */,
19D76A741D265A1B006245D6 /* TZImagePickerController */, 19D76A741D265A1B006245D6 /* TZImagePickerController */,
C18A95421C01F56200429BF7 /* DataBaseController */, C18A95421C01F56200429BF7 /* DataBaseController */,
C10F17841BF7ACA80065F18C /* General */, C10F17841BF7ACA80065F18C /* General */,
...@@ -3120,8 +3132,9 @@ ...@@ -3120,8 +3132,9 @@
C1D58B551BB1BC9200D297FE /* Info.plist */, C1D58B551BB1BC9200D297FE /* Info.plist */,
8F67FB4A1D7D4D5000808DF1 /* Main.storyboard */, 8F67FB4A1D7D4D5000808DF1 /* Main.storyboard */,
19605F911D3759D100C20590 /* Statement.storyboard */, 19605F911D3759D100C20590 /* Statement.storyboard */,
C1DED2B71BCEC3F70049BB2D /* LaunchScreen.xib */,
19B34CC21D3B343D0060E272 /* SalesInPut.storyboard */, 19B34CC21D3B343D0060E272 /* SalesInPut.storyboard */,
C1DED2B71BCEC3F70049BB2D /* LaunchScreen.xib */,
19D76AA41D266910006245D6 /* CALayer+Addtions.m */,
C1D58B501BB1BC9200D297FE /* Images.xcassets */, C1D58B501BB1BC9200D297FE /* Images.xcassets */,
C10F17831BF7ACA80065F18C /* 3rd */, C10F17831BF7ACA80065F18C /* 3rd */,
C1D58B3A1BB1BC9200D297FE /* controller */, C1D58B3A1BB1BC9200D297FE /* controller */,
...@@ -5400,6 +5413,7 @@ ...@@ -5400,6 +5413,7 @@
C1D599591BB44B2100D297FE /* Bee_HTTPRequestQueue.m in Sources */, C1D599591BB44B2100D297FE /* Bee_HTTPRequestQueue.m in Sources */,
1912FCE01CCDE0C4004CF976 /* LoginShopsInstance.m in Sources */, 1912FCE01CCDE0C4004CF976 /* LoginShopsInstance.m in Sources */,
C1D598961BB44B2000D297FE /* UINavigationBar+BeeExtension.m in Sources */, C1D598961BB44B2000D297FE /* UINavigationBar+BeeExtension.m in Sources */,
8FC70DA81D7E8F55008DC9BC /* YRBorderView.m in Sources */,
C1F790AE1C076191001AEBBB /* VankeStatementRejectModel.m in Sources */, C1F790AE1C076191001AEBBB /* VankeStatementRejectModel.m in Sources */,
C10F182F1BF7ACA80065F18C /* ICRLoginContentView.m in Sources */, C10F182F1BF7ACA80065F18C /* ICRLoginContentView.m in Sources */,
C1D5991C1BB44B2100D297FE /* Bee_System.mm in Sources */, C1D5991C1BB44B2100D297FE /* Bee_System.mm in Sources */,
...@@ -5767,7 +5781,7 @@ ...@@ -5767,7 +5781,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.vanke; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.vanke;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "da8de50e-62c2-4312-8dda-7c81fb04858d"; PROVISIONING_PROFILE = "";
TARGETED_DEVICE_FAMILY = 1; TARGETED_DEVICE_FAMILY = 1;
VALID_ARCHS = "arm64 armv7 armv7s"; VALID_ARCHS = "arm64 armv7 armv7s";
VERSIONING_SYSTEM = ""; VERSIONING_SYSTEM = "";
...@@ -5828,7 +5842,7 @@ ...@@ -5828,7 +5842,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.vanke; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.vanke;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "da8de50e-62c2-4312-8dda-7c81fb04858d"; PROVISIONING_PROFILE = "";
TARGETED_DEVICE_FAMILY = 1; TARGETED_DEVICE_FAMILY = 1;
VALID_ARCHS = "arm64 armv7 armv7s"; VALID_ARCHS = "arm64 armv7 armv7s";
VERSIONING_SYSTEM = ""; VERSIONING_SYSTEM = "";
......
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
+ (NSString *)archivePathForTmpImages; + (NSString *)archivePathForTmpImages;
+ (NSString *)archivePathForTmpAnnouncementAttachment;
+ (NSString *)saveAnnouncementAttachment:(NSData *)data name:(NSString *)name;
+ (IBTFileData *)saveImageToLocal:(UIImage *)imageToSave; + (IBTFileData *)saveImageToLocal:(UIImage *)imageToSave;
......
...@@ -96,40 +96,40 @@ ...@@ -96,40 +96,40 @@
} }
+ (NSString *)archivePathForCurrentUser { + (NSString *)archivePathForCurrentUser {
// ICRUserUtil *userUtil = [ICRUserUtil sharedInstance]; VankeCommonModel *userUtil = [VankeCommonModel sharedInstance];
// NSString *userName = [userUtil userName]; NSString *userName = userUtil.currentUser.name;
// if (!userName.length) return nil; if (!userName.length) return nil;
//
// NSString *orgCode = [userUtil orgCode]; NSString *orgCode = userUtil.currentUser.code;
// if (!orgCode.length) { if (!orgCode.length) {
// return nil; return nil;
// } }
//
// NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
// NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : NSTemporaryDirectory(); NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : NSTemporaryDirectory();
//
// NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
// if (appName == nil) { if (appName == nil) {
// appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
//
// if (appName == nil) appName = @"Cruiser"; if (appName == nil) appName = @"Cruiser";
// } }
//
// NSString *result = [basePath stringByAppendingPathComponent:appName]; NSString *result = [basePath stringByAppendingPathComponent:appName];
// if (result != nil) { if (result != nil) {
// result = [result stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@", orgCode, userName]]; result = [result stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@", orgCode, userName]];
// } }
//
// NSFileManager *fileManager = [NSFileManager defaultManager]; NSFileManager *fileManager = [NSFileManager defaultManager];
//
// if (![fileManager fileExistsAtPath:result]) { if (![fileManager fileExistsAtPath:result]) {
// [fileManager createDirectoryAtPath:result [fileManager createDirectoryAtPath:result
// withIntermediateDirectories:YES withIntermediateDirectories:YES
// attributes:nil attributes:nil
// error:nil]; error:nil];
// } }
//
// return result; return result;
return @""; return @"";
} }
...@@ -154,6 +154,40 @@ ...@@ -154,6 +154,40 @@
return result; return result;
} }
+ (NSString *)archivePathForTmpAnnouncementAttachment {
NSString *archivePath = [[self class] archivePathForCurrentUser];
if (!archivePath.length) {
return nil;
}
NSString *dirName = @"AnnouncementAttachment";
NSString *result = [archivePath stringByAppendingPathComponent:dirName];
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:result]) {
[fileManager createDirectoryAtPath:result
withIntermediateDirectories:YES
attributes:nil
error:nil];
}
return result;
}
+ (NSString *)saveAnnouncementAttachment:(NSData *)data name:(NSString *)name {
NSString *path = [[IBTCommon archivePathForTmpAnnouncementAttachment] stringByAppendingPathComponent:name];
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:path]) {
return path;
}
if ([data writeToFile:path atomically:YES]) {
return path;
}else{
return nil;
}
}
+ (IBTFileData *)saveImageToLocal:(UIImage *)imageToSave { + (IBTFileData *)saveImageToLocal:(UIImage *)imageToSave {
NSString *imgName = [NSString stringWithFormat:@"ICRIMG-%@.JPG", [[NSDate date] YMDHMSFormatterString]]; NSString *imgName = [NSString stringWithFormat:@"ICRIMG-%@.JPG", [[NSDate date] YMDHMSFormatterString]];
NSString *imgPath = [[IBTCommon archivePathForTmpImages] stringByAppendingPathComponent:imgName]; NSString *imgPath = [[IBTCommon archivePathForTmpImages] stringByAppendingPathComponent:imgName];
......
...@@ -68,7 +68,6 @@ ...@@ -68,7 +68,6 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = IBT_BGCOLOR; self.view.backgroundColor = IBT_BGCOLOR;
if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) { if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
...@@ -80,7 +79,13 @@ ...@@ -80,7 +79,13 @@
[self initWebView]; [self initWebView];
[self initProgressView]; [self initProgressView];
[self goToURL:[NSURL URLWithString:self.m_initUrl]];
if ([self.m_initUrl hasSuffix:@".txt"]) {
[self goToLocalTextFileURL:self.m_initUrl];
}else{
[self goToURL:[NSURL URLWithString:self.m_initUrl]];
}
} }
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
...@@ -313,10 +318,40 @@ ...@@ -313,10 +318,40 @@
[self.m_webView loadRequest:[NSURLRequest requestWithURL:url]]; [self.m_webView loadRequest:[NSURLRequest requestWithURL:url]];
} }
else { else {
// ERROR // ERROR
} }
} }
- (void)goToLocalTextFileURL:(NSString *)url {
NSString *fileName = [url lastPathComponent];
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
NSString *isUNICODE = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSString *path = [IBTCommon saveAnnouncementAttachment:data name:fileName];
//还是ANSI编码
NSString *isANSI = [[NSString alloc] initWithData:data encoding:-2147482062];
if (isUNICODE) {
NSString *retStr = [[NSString alloc]initWithCString:[isUNICODE UTF8String] encoding:NSUTF8StringEncoding];
NSData *data = [retStr dataUsingEncoding:NSUTF16StringEncoding];
[data writeToFile:path atomically:YES];
}
else if(isANSI){
NSData *data = [isANSI dataUsingEncoding:NSUTF16StringEncoding];
[data writeToFile:path atomically:YES];
}
[self goToURL:[NSURL fileURLWithPath:path]];
}
- (void)goForward { - (void)goForward {
[self.m_webView goForward]; [self.m_webView goForward];
} }
......
/*
The MIT License (MIT)
Copyright (c) 2014 YueRuo,王晓宇
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#import <UIKit/UIKit.h>
@interface YRBorderView : UIView
@property (assign,nonatomic) UIEdgeInsets contentEdgeInsets;
@property (assign,nonatomic) BOOL needLineTop;
@property (assign,nonatomic) BOOL needLineLeft;
@property (assign,nonatomic) BOOL needLineBottom;
@property (assign,nonatomic) BOOL needLineRight;
//line width
@property (assign,nonatomic) CGFloat lineWidthTop;
@property (assign,nonatomic) CGFloat lineWidthLeft;
@property (assign,nonatomic) CGFloat lineWidthBottom;
@property (assign,nonatomic) CGFloat lineWidthRight;
//line color
@property (retain,nonatomic) UIColor *lineColorTop;
@property (retain,nonatomic) UIColor *lineColorLeft;
@property (retain,nonatomic) UIColor *lineColorBottom;
@property (retain,nonatomic) UIColor *lineColorRight;
//corner radius
@property (assign,nonatomic) CGFloat radiusTopLeft;
@property (assign,nonatomic) CGFloat radiusTopRight;
@property (assign,nonatomic) CGFloat radiusBottomLeft;
@property (assign,nonatomic) CGFloat radiusBottomRight;
//线段样式,0是实线,否则为线段宽度
@property (assign,nonatomic) CGFloat lineDashTop;
@property (assign,nonatomic) CGFloat lineDashLeft;
@property (assign,nonatomic) CGFloat lineDashRight;
@property (assign,nonatomic) CGFloat lineDashBottom;
//内部填充颜色
@property (retain,nonatomic) UIColor *fillColor;
//根据自身形状根据边线进行裁剪
@property (assign,nonatomic) BOOL clipsToBoundsWithBorder;
-(void)setNeedLineTop:(BOOL)needTop left:(BOOL)needLeft bottom:(BOOL)needBottom right:(BOOL)needRight;
-(void)setLineWidthTop:(CGFloat)widthTop left:(CGFloat)widthLeft bottom:(CGFloat)widthBottom right:(CGFloat)widthRight;
-(void)setLineColorTop:(UIColor *)colorTop left:(UIColor *)colorLeft bottom:(UIColor *)colorBottom right:(UIColor *)colorRight;
-(void)setRadiusTopLeft:(CGFloat)topLeft topRight:(CGFloat)topRight bottomLeft:(CGFloat)bottomLeft bottomRight:(CGFloat)bottomRight;
-(void)setLineDashTop:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right;
@end
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB"> <view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="login_bg.png" translatesAutoresizingMaskIntoConstraints="NO" id="T3n-rV-MUb"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="login_bg.png" translatesAutoresizingMaskIntoConstraints="NO" id="T3n-rV-MUb">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Copyright (c) 2015年 万科. " textAlignment="center" lineBreakMode="tailTruncation" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D9f-bJ-RUy"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright (c) 2015年 万科. " textAlignment="center" lineBreakMode="tailTruncation" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D9f-bJ-RUy">
<rect key="frame" x="36" y="438" width="389" height="28"/> <rect key="frame" x="82" y="638.5" width="211" height="20.5"/>
<constraints>
<constraint firstAttribute="width" constant="500" id="5gY-rb-pwj" userLabel="width = 450"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstItem="T3n-rV-MUb" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="58T-cB-ayr"/>
<constraint firstAttribute="trailing" secondItem="T3n-rV-MUb" secondAttribute="trailing" id="DPq-Lu-PXb"/>
<constraint firstItem="D9f-bJ-RUy" firstAttribute="centerX" secondItem="T3n-rV-MUb" secondAttribute="centerX" id="PEe-PR-T6S"/>
<constraint firstItem="T3n-rV-MUb" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="T3a-72-I7u"/>
<constraint firstItem="D9f-bJ-RUy" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leadingMargin" constant="30" id="Tfn-9w-HrA"/> <constraint firstItem="D9f-bJ-RUy" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leadingMargin" constant="30" id="Tfn-9w-HrA"/>
<constraint firstAttribute="trailingMargin" secondItem="D9f-bJ-RUy" secondAttribute="trailing" constant="47" id="h1b-qH-dll"/> <constraint firstAttribute="trailingMargin" secondItem="D9f-bJ-RUy" secondAttribute="trailing" constant="47" id="h1b-qH-dll"/>
<constraint firstAttribute="bottom" secondItem="T3n-rV-MUb" secondAttribute="bottom" id="vF8-0l-hUy"/>
<constraint firstAttribute="bottom" secondItem="D9f-bJ-RUy" secondAttribute="bottom" constant="8" id="vGm-mj-OK9"/>
<constraint firstAttribute="bottomMargin" secondItem="D9f-bJ-RUy" secondAttribute="bottom" constant="6" id="wfc-m4-EZw"/> <constraint firstAttribute="bottomMargin" secondItem="D9f-bJ-RUy" secondAttribute="bottom" constant="6" id="wfc-m4-EZw"/>
</constraints> </constraints>
<nil key="simulatedStatusBarMetrics"/> <nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<variation key="default">
<mask key="constraints">
<exclude reference="Tfn-9w-HrA"/>
<exclude reference="h1b-qH-dll"/>
<exclude reference="wfc-m4-EZw"/>
</mask>
</variation>
<point key="canvasLocation" x="354" y="186"/> <point key="canvasLocation" x="354" y="186"/>
</view> </view>
</objects> </objects>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.5.2</string> <string>1.5.7</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
This diff is collapsed.
...@@ -64,7 +64,14 @@ ...@@ -64,7 +64,14 @@
@property (nonatomic, strong) NSNumber *paidStatement; @property (nonatomic, strong) NSNumber *paidStatement;
@property (nonatomic, strong) NSNumber *totalStatement; @property (nonatomic, strong) NSNumber *totalStatement;
/**
* 总金额
*/
@property (nonatomic, strong) NSNumber *rentalAmount;
/**
* 总面积
*/
@property (nonatomic, strong) NSNumber *rentalArea;
@end @end
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "AnnouncementDetailTableViewCell.h" #import "AnnouncementDetailTableViewCell.h"
#import "IBTWebViewController.h" #import "IBTWebViewController.h"
#import "VankeUtil.h" #import "VankeUtil.h"
#import "VankeAppBoard_iPhone.h"
@interface AnnouncementDetailViewController ()<UITableViewDelegate, UITableViewDataSource> @interface AnnouncementDetailViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UILabel *labelPublisher; @property (weak, nonatomic) IBOutlet UILabel *labelPublisher;
@property (weak, nonatomic) IBOutlet UILabel *labelTime; @property (weak, nonatomic) IBOutlet UILabel *labelTime;
...@@ -26,11 +27,17 @@ ...@@ -26,11 +27,17 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.tableView.tableFooterView = [UIView new]; self.tableView.tableFooterView = [UIView new];
self.title = @"公告详情";
// self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; // self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self setUpData]; [self setUpData];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[VankeAppBoard_iPhone sharedInstance] hideMenu];
}
- (void)setUpData { - (void)setUpData {
WS(weakSelf); WS(weakSelf);
NSString *url = [NSString stringWithFormat:@"affiche/get/%@", self.announcement.uuid]; NSString *url = [NSString stringWithFormat:@"affiche/get/%@", self.announcement.uuid];
...@@ -91,6 +98,7 @@ ...@@ -91,6 +98,7 @@
WS(weakSelf); WS(weakSelf);
cell.openFile = ^{ cell.openFile = ^{
IBTWebViewController *WVC = [[IBTWebViewController alloc] initWithURL:url presentModal:NO extraInfo:nil]; IBTWebViewController *WVC = [[IBTWebViewController alloc] initWithURL:url presentModal:NO extraInfo:nil];
WVC.title = @"附件详情";
[weakSelf.navigationController pushViewController:WVC animated:YES]; [weakSelf.navigationController pushViewController:WVC animated:YES];
}; };
return cell; return cell;
......
...@@ -7,15 +7,16 @@ ...@@ -7,15 +7,16 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "YRBorderView.h"
typedef NS_ENUM(NSInteger, announcementDetailCellType) { typedef NS_ENUM(NSInteger, announcementDetailCellType) {
announcementDetailCellTypeTop, announcementDetailCellTypeTop,
announcementDetailCellTypeCenter, announcementDetailCellTypeCenter,
announcementDetailCellTypeBottom, announcementDetailCellTypeBottom,
}; };
@interface AnnouncementDetailTableViewCell : UITableViewCell @interface AnnouncementDetailTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *topImage;
@property (weak, nonatomic) IBOutlet UIImageView *centerImage; @property (weak, nonatomic) IBOutlet UIView *line;
@property (weak, nonatomic) IBOutlet UIImageView *bottomImage; @property (weak, nonatomic) IBOutlet YRBorderView *borderView;
@property (nonatomic, copy) NSString *contentText; @property (nonatomic, copy) NSString *contentText;
@property (weak, nonatomic) IBOutlet UILabel *content; @property (weak, nonatomic) IBOutlet UILabel *content;
@property (nonatomic, assign) announcementDetailCellType type; @property (nonatomic, assign) announcementDetailCellType type;
......
...@@ -8,12 +8,20 @@ ...@@ -8,12 +8,20 @@
#import "AnnouncementDetailTableViewCell.h" #import "AnnouncementDetailTableViewCell.h"
#import "IBTWebViewController.h" #import "IBTWebViewController.h"
static CGFloat const kBorderRadious = 8; //圆角的弧度
static CGFloat const kBorderLineWidth = 1; //虚线的宽度
static CGFloat const kBorderLineHeight = 2; //虚线的每个点的高度
@implementation AnnouncementDetailTableViewCell @implementation AnnouncementDetailTableViewCell
- (void)awakeFromNib { - (void)awakeFromNib {
// Initialization code // Initialization code
self.selectionStyle = UITableViewCellSelectionStyleNone; self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.borderView setLineColorTop:[UIColor grayColor] left:[UIColor grayColor] bottom:[UIColor grayColor] right:[UIColor grayColor]];//设置不同的颜色
[self.borderView setLineWidthTop:kBorderLineWidth left:kBorderLineWidth bottom:kBorderLineWidth right:kBorderLineWidth];
[self.borderView setLineDashRight:kBorderLineHeight];//右侧线条是虚线
[self.borderView setLineDashLeft:kBorderLineHeight];
[self.borderView setLineDashTop:kBorderLineHeight];
[self.borderView setLineDashBottom:kBorderLineHeight];
} }
- (IBAction)open:(id)sender { - (IBAction)open:(id)sender {
...@@ -34,29 +42,32 @@ ...@@ -34,29 +42,32 @@
_type = type; _type = type;
switch (type) { switch (type) {
case announcementDetailCellTypeTop: { case announcementDetailCellTypeTop: {
self.topImage.hidden = NO; [self.borderView setNeedLineTop:YES left:YES bottom:NO right:YES];
self.centerImage.hidden = YES; [self.borderView setRadiusTopLeft:kBorderRadious topRight:kBorderRadious bottomLeft:0 bottomRight:0];
self.bottomImage.hidden = YES; self.line.hidden = NO;
break; break;
} }
case announcementDetailCellTypeCenter: { case announcementDetailCellTypeCenter: {
self.topImage.hidden = YES; [self.borderView setNeedLineTop:NO left:YES bottom:NO right:YES];
self.centerImage.hidden = NO; [self.borderView setRadiusTopLeft:0 topRight:0 bottomLeft:0 bottomRight:0];
self.bottomImage.hidden = YES; self.line.hidden = NO;
break; break;
} }
case announcementDetailCellTypeBottom: { case announcementDetailCellTypeBottom: {
self.topImage.hidden = YES; [self.borderView setNeedLineTop:NO left:YES bottom:YES right:YES];
self.centerImage.hidden = YES; [self.borderView setRadiusTopLeft:0 topRight:0 bottomLeft:kBorderRadious bottomRight:kBorderRadious];
self.bottomImage.hidden = NO; self.line.hidden = YES;
break; break;
} }
} }
} }
- (void)setIsOnlyOne:(BOOL)isOnlyOne { - (void)setIsOnlyOne:(BOOL)isOnlyOne {
_isOnlyOne = isOnlyOne; if (isOnlyOne) {
_bottomImage.hidden = !isOnlyOne; [self.borderView setNeedLineTop:YES left:YES bottom:YES right:YES];
[self.borderView setRadiusTopLeft:kBorderRadious topRight:kBorderRadious bottomLeft:kBorderRadious bottomRight:kBorderRadious];
self.line.hidden = YES;
}
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
......
...@@ -61,7 +61,8 @@ DEF_OUTLET( VankeServiceBoardCell_iPhone, complaint ); ...@@ -61,7 +61,8 @@ DEF_OUTLET( VankeServiceBoardCell_iPhone, complaint );
self.salesInfo.imgRightBg.backgroundColor = [UIColor colorWithRed:237/255.0 green:27/255.0 blue:35/255.0 alpha:1]; self.salesInfo.imgRightBg.backgroundColor = [UIColor colorWithRed:237/255.0 green:27/255.0 blue:35/255.0 alpha:1];
[self.passenger loadDefaults:@"people.png" title:@"昨日客流" bgColor:[UIColor colorWithRed:0 green:195/255.0 blue:230/255.0 alpha:1] unit:@"人" defValue:[NSNumber numberWithInt:0]]; [self.passenger loadDefaults:@"people.png" title:@"昨日客流" bgColor:[UIColor colorWithRed:0 green:195/255.0 blue:230/255.0 alpha:1] unit:@"人" defValue:[NSNumber numberWithInt:0]];
[self.traffic loadDefaults:@"car.png" title:@"车流" bgColor:[UIColor colorWithRed:79/255.0 green:143/255.0 blue:248/255.0 alpha:1] unit:@"次" defValue:[NSNumber numberWithInt:0]]; [self.traffic loadDefaults:@"car.png" title:@"车流" bgColor:[UIColor colorWithRed:79/255.0 green:143/255.0 blue:248/255.0 alpha:1] unit:@"次" defValue:[NSNumber numberWithInt:0]];
[self.energy loadDefaults:@"energy.png" title:@"坪效" bgColor:[UIColor colorWithRed:149/255.0 green:200/255.0 blue:8/255.0 alpha:1] unit:@"元" defValue:[NSNumber numberWithInt:0]]; [self.energy loadDefaults:@"energy.png" title:@"日坪效" bgColor:[UIColor colorWithRed:149/255.0 green:200/255.0 blue:8/255.0 alpha:1] unit:@"元"
defValue:[NSNumber numberWithFloat:0.00]];
[self.complaint loadDefaults:@"complaint.png" title:@"收缴率" bgColor:[UIColor colorWithRed:252/255.0 green:67/255.0 blue:62/255.0 alpha:1] unit:@" " defValue:[NSNumber numberWithInt:0]]; [self.complaint loadDefaults:@"complaint.png" title:@"收缴率" bgColor:[UIColor colorWithRed:252/255.0 green:67/255.0 blue:62/255.0 alpha:1] unit:@" " defValue:[NSNumber numberWithInt:0]];
} }
...@@ -78,8 +79,10 @@ DEF_OUTLET( VankeServiceBoardCell_iPhone, complaint ); ...@@ -78,8 +79,10 @@ DEF_OUTLET( VankeServiceBoardCell_iPhone, complaint );
if (nil != summary) { if (nil != summary) {
[self.salesInfo setData:summary.salesAmount]; [self.salesInfo setData:summary.salesAmount];
[self.passenger setData:summary.passengerFlowVolume]; [self.passenger setData:summary.passengerFlowVolume];
[self.traffic setData:[NSNumber numberWithFloat:122]]; [self.traffic setData:[NSNumber numberWithFloat:0]];
[self.energy setData:[NSNumber numberWithInt:789]]; //计算出坪效
NSDecimalNumber *energy = [CalculateHelper calculateNum1:summary.rentalAmount num2:summary.rentalArea type:CalculateTypeDiv roundingType:NSRoundPlain cutLenth:2];
self.energy.lblAmount.text = [CalculateHelper getMoneyStringFrom:energy];
NSString *rate = [CalculateHelper getPercent:summary.paidStatement num:summary.totalStatement]; NSString *rate = [CalculateHelper getPercent:summary.paidStatement num:summary.totalStatement];
self.complaint.lblAmount.text = rate; self.complaint.lblAmount.text = rate;
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
#import "ICRAppMacro.h" #import "ICRAppMacro.h"
#import "ChooseShopViewController.h" #import "ChooseShopViewController.h"
#import "SaleInputPicCollectionViewController.h" #import "SaleInputPicCollectionViewController.h"
#import "CalculateHelper.h"
#define klineCount 19 //列数 #define klineCount 19 //列数
#define kListWidth 100 //一个表格的宽度 #define kListWidth 100 //一个表格的宽度
#define kListHeight 40 #define kListHeight 40
#define kBottomHeight 55 //表格最底部的那行的宽度 #define kBottomHeight 50 //表格最底部的那行的宽度
@interface HistoryViewController ()<UIScrollViewDelegate> @interface HistoryViewController ()<UIScrollViewDelegate>
@property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) NSArray *titles; @property (nonatomic, strong) NSArray *titles;
...@@ -139,9 +139,10 @@ ...@@ -139,9 +139,10 @@
//底部浮动的视图 //底部浮动的视图
UILabel *labelBottom = [[UILabel alloc] initWithFrame:CGRectMake(kListWidth * i, self.scrollView.contentOffset.y + self.scrollView.height - kBottomHeight, kListWidth, kBottomHeight)]; UILabel *labelBottom = [[UILabel alloc] initWithFrame:CGRectMake(kListWidth * i, self.scrollView.contentOffset.y + self.scrollView.height - kBottomHeight, kListWidth, kBottomHeight)];
labelBottom.text = bottomArr[i]; labelBottom.text = bottomArr[i];
labelBottom.backgroundColor = [UIColor grayColor]; labelBottom.backgroundColor = [UIColor lightGrayColor];
labelBottom.font = [UIFont systemFontOfSize:26]; labelBottom.font = [UIFont systemFontOfSize:19];
labelBottom.textAlignment = NSTextAlignmentCenter; labelBottom.textAlignment = NSTextAlignmentCenter;
labelBottom.numberOfLines = 2;
labelBottom.tag = 2000 + i; labelBottom.tag = 2000 + i;
[self.scrollView addSubview:labelBottom]; [self.scrollView addSubview:labelBottom];
if (i != 0) { if (i != 0) {
...@@ -175,9 +176,6 @@ ...@@ -175,9 +176,6 @@
picVC.title = self.arrRecords[row][@"salesDate"]; picVC.title = self.arrRecords[row][@"salesDate"];
picVC.attachmentUuid = self.arrRecords[row][@"attachmentUuid"]; picVC.attachmentUuid = self.arrRecords[row][@"attachmentUuid"];
NSArray *attachments = self.arrRecords[row][@"attachments"]; NSArray *attachments = self.arrRecords[row][@"attachments"];
// if (attachments.count == 0) {
// picVC.attachmentUuid = nil;
// }
[self.navigationController pushViewController:picVC animated:YES]; [self.navigationController pushViewController:picVC animated:YES];
} }
...@@ -318,8 +316,8 @@ ...@@ -318,8 +316,8 @@
NSMutableArray *payment = [NSMutableArray array]; NSMutableArray *payment = [NSMutableArray array];
for (NSDictionary *obj in dic[@"data"][@"records"]) { for (NSDictionary *obj in dic[@"data"][@"records"]) {
[arrDate addObject:obj[@"salesDate"]]; [arrDate addObject:obj[@"salesDate"]];
[arrAmount addObject:[NSString stringWithFormat:@"%.0f", [obj[@"amount"] floatValue]]]; [arrAmount addObject:[CalculateHelper getMoneyStringFrom:obj[@"amount"]]];
[arrBills addObject:[NSString stringWithFormat:@"%.0f", [obj[@"transactions"] floatValue]]]; [arrBills addObject:[CalculateHelper getMoneyStringFrom:obj[@"transactions"] Lenth:0 isSeparate:NO]];
NSMutableArray *arr = [NSMutableArray array]; NSMutableArray *arr = [NSMutableArray array];
for (NSDictionary *dic in obj[@"payments"]) { for (NSDictionary *dic in obj[@"payments"]) {
...@@ -345,7 +343,7 @@ ...@@ -345,7 +343,7 @@
for (int i = 0; i < arr.count; i++) { for (int i = 0; i < arr.count; i++) {
NSDictionary *dic = arr[i]; NSDictionary *dic = arr[i];
NSMutableArray *apay = paytype[i]; NSMutableArray *apay = paytype[i];
[apay addObject:[NSString stringWithFormat:@"%.0f", [dic[@"amount"] floatValue]]]; [apay addObject:[CalculateHelper getMoneyStringFrom:dic[@"amount"]]];
} }
} }
...@@ -358,17 +356,22 @@ ...@@ -358,17 +356,22 @@
[arrBottom addObject:@"总计"]; [arrBottom addObject:@"总计"];
}else{ }else{
NSInteger count = 0; NSDecimalNumber *count = [NSDecimalNumber decimalNumberWithString:@"0"];
for (int j = 0; j < [arrData[i] count]; j++) { for (int j = 0; j < [arrData[i] count]; j++) {
if (j != 0) { if (j != 0) {
NSString *number = arrData[i][j]; NSString *number = arrData[i][j];
NSInteger num = [number integerValue]; count = [CalculateHelper calculateNum1:count num2:number type:CalculateTypeAdd];
count = count + num;
} }
} }
NSString *result = [NSString stringWithFormat:@"%ld", (long)count];
[arrBottom addObject:result];
NSString *result;
if (i == 1) {
result = [CalculateHelper getMoneyStringFrom:count Lenth:0 isSeparate:NO];
}else{
result = [CalculateHelper getMoneyStringFrom:count Lenth:2 isSeparate:NO];
}
[arrBottom addObject:result];
} }
} }
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
...@@ -149,8 +149,8 @@ ...@@ -149,8 +149,8 @@
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="录入日期:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F81-D8-CgE"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="销售日期:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F81-D8-CgE">
<rect key="frame" x="20" y="81" width="80" height="19.5"/> <rect key="frame" x="20" y="81" width="80" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/> <fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
......
...@@ -96,7 +96,7 @@ static NSInteger const TOP_HEIGHT = 145; ...@@ -96,7 +96,7 @@ static NSInteger const TOP_HEIGHT = 145;
self.topView.textfieldDate.enabled = NO; self.topView.textfieldDate.enabled = NO;
self.topView.textfieldDate.text = self.model.salesDate; self.topView.textfieldDate.text = self.model.salesDate;
self.totalView.textFieldBillCount.text = [NSString stringWithFormat:@"%.0f",self.model.transactions]; self.totalView.textFieldBillCount.text = [NSString stringWithFormat:@"%.0f",self.model.transactions];
self.totalView.labelTotal.text = [NSString stringWithFormat:@"%.0f",self.model.amount]; self.totalView.labelTotal.text = [NSString stringWithFormat:@"%.2f",self.model.amount];
for (SalesInputLines *line in self.model.lines) { for (SalesInputLines *line in self.model.lines) {
PaymentTypeModel *payType = [[PaymentTypeModel alloc] init]; PaymentTypeModel *payType = [[PaymentTypeModel alloc] init];
payType.name = line.payment; payType.name = line.payment;
...@@ -104,10 +104,9 @@ static NSInteger const TOP_HEIGHT = 145; ...@@ -104,10 +104,9 @@ static NSInteger const TOP_HEIGHT = 145;
} }
if (self.isReadOnly) { if (self.isReadOnly) {
[self.submitView.buttonCommit setTitle:@"已审核" forState:UIControlStateNormal]; [self.submitView.buttonCommit setTitle:@"返回" forState:UIControlStateNormal];
[self.submitView.buttonCommit setBackgroundColor:[UIColor darkGrayColor]];
self.submitView.buttonCommit.enabled = NO;
self.totalView.textFieldBillCount.userInteractionEnabled = NO; self.totalView.textFieldBillCount.userInteractionEnabled = NO;
self.totalView.textFieldBillCount.textColor = [UIColor lightGrayColor];
} }
[self.tableView reloadData]; [self.tableView reloadData];
...@@ -199,7 +198,11 @@ ON_WILL_APPEAR( signal ) ...@@ -199,7 +198,11 @@ ON_WILL_APPEAR( signal )
[weakSelf.cellDataDic setObject:dataArr forKey:indexPath]; [weakSelf.cellDataDic setObject:dataArr forKey:indexPath];
[weakSelf countTotalMonney]; [weakSelf countTotalMonney];
}; };
cell.userInteractionEnabled = !self.isReadOnly; if (self.isReadOnly) {
cell.userInteractionEnabled = NO;
cell.textFieldAmount.textColor = [UIColor lightGrayColor];
}
return cell; return cell;
}else{ }else{
...@@ -388,7 +391,7 @@ ON_WILL_APPEAR( signal ) ...@@ -388,7 +391,7 @@ ON_WILL_APPEAR( signal )
[httpCtrl getUrl:@"salesinput/query" params:params success:^(id data) { [httpCtrl getUrl:@"salesinput/query" params:params success:^(id data) {
if ([data[@"data"][@"records"] count] > 0) { if ([data[@"data"][@"records"] count] > 0) {
NSNumber *amount = data[@"data"][@"records"][0][@"amount"]; NSNumber *amount = data[@"data"][@"records"][0][@"amount"];
NSString *amountStr = [NSString stringWithFormat:@"%.0f", [amount floatValue]]; NSString *amountStr = [CalculateHelper getMoneyStringFrom:amount];
weakSelf.todayTotalAmount = amountStr; weakSelf.todayTotalAmount = amountStr;
}else{ }else{
weakSelf.todayTotalAmount = @"0"; weakSelf.todayTotalAmount = @"0";
...@@ -420,10 +423,10 @@ ON_WILL_APPEAR( signal ) ...@@ -420,10 +423,10 @@ ON_WILL_APPEAR( signal )
NSArray *array = [self.cellDataDic objectForKey:obj]; NSArray *array = [self.cellDataDic objectForKey:obj];
count = [CalculateHelper calculateNum1:count num2:array[0] type:CalculateTypeAdd roundingType:NSRoundPlain cutLenth:2]; count = [CalculateHelper calculateNum1:count num2:array[0] type:CalculateTypeAdd roundingType:NSRoundPlain cutLenth:2];
} }
self.totalView.labelTotal.text = [count stringValue]; self.totalView.labelTotal.text = [CalculateHelper getMoneyStringFrom:count];
self.topView.textFieldTotalAmount.text = [[CalculateHelper calculateNum1:count num2:self.todayTotalAmount type:CalculateTypeAdd roundingType:NSRoundPlain cutLenth:2] stringValue]; NSDecimalNumber *result = [CalculateHelper calculateNum1:count num2:self.todayTotalAmount type:CalculateTypeAdd roundingType:NSRoundPlain cutLenth:2];
self.topView.textFieldTotalAmount.text = [CalculateHelper getMoneyStringFrom:result];
} }
- (id)viewWithNibName:(NSString *)viewName { - (id)viewWithNibName:(NSString *)viewName {
...@@ -446,7 +449,7 @@ ON_WILL_APPEAR( signal ) ...@@ -446,7 +449,7 @@ ON_WILL_APPEAR( signal )
case SalesInputViewControllerTypeAudit: { case SalesInputViewControllerTypeAudit: {
if (![self.cellDataDic objectForKey:indextPath]) { if (![self.cellDataDic objectForKey:indextPath]) {
SalesInputLines *line = self.model.lines[indextPath.row]; SalesInputLines *line = self.model.lines[indextPath.row];
[self.cellDataDic setObject:@[[NSString stringWithFormat:@"%.0f",line.amount]] forKey:indextPath]; [self.cellDataDic setObject:@[[NSString stringWithFormat:@"%.2f",line.amount]] forKey:indextPath];
} }
break; break;
...@@ -516,6 +519,7 @@ ON_WILL_APPEAR( signal ) ...@@ -516,6 +519,7 @@ ON_WILL_APPEAR( signal )
} }
- (void)submit { - (void)submit {
if (self.shop == nil) { if (self.shop == nil) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请选择商铺!" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请选择商铺!" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
...@@ -591,6 +595,7 @@ ON_WILL_APPEAR( signal ) ...@@ -591,6 +595,7 @@ ON_WILL_APPEAR( signal )
successHud.mode = MBProgressHUDModeText; successHud.mode = MBProgressHUDModeText;
if ([data[@"message"] isEqualToString:@"ok"]) { if ([data[@"message"] isEqualToString:@"ok"]) {
successHud.labelText = @"提交成功!"; successHud.labelText = @"提交成功!";
weakSelf.totalView.textFieldBillCount.text = 0;
weakSelf.arrPics = nil; weakSelf.arrPics = nil;
[weakSelf.selectedAssets removeAllObjects]; [weakSelf.selectedAssets removeAllObjects];
[weakSelf.cellDataDic removeAllObjects]; [weakSelf.cellDataDic removeAllObjects];
...@@ -654,6 +659,11 @@ ON_WILL_APPEAR( signal ) ...@@ -654,6 +659,11 @@ ON_WILL_APPEAR( signal )
/** 审批通过 */ /** 审批通过 */
- (void)audit { - (void)audit {
//如果是只读的,那么就返回
if (self.isReadOnly) {
[self.navigationController popViewControllerAnimated:YES];
return;
}
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"确认审核通过?" message:nil preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"确认审核通过?" message:nil preferredStyle:UIAlertControllerStyleAlert];
......
...@@ -14,6 +14,7 @@ typedef void (^actionBlock)(NSInteger); ...@@ -14,6 +14,7 @@ typedef void (^actionBlock)(NSInteger);
@property (nonatomic, copy) actionBlock addPicBlock; @property (nonatomic, copy) actionBlock addPicBlock;
@property (nonatomic, copy) actionBlock seePicBlock; @property (nonatomic, copy) actionBlock seePicBlock;
@property (nonatomic, copy) actionBlock deleteBolock; @property (nonatomic, copy) actionBlock deleteBolock;
@property (nonatomic, assign) BOOL isLast;
- (void)setUpCellWithPictureArr:(NSMutableArray *)arrPic indexPath:(NSIndexPath *)indexPath; - (void)setUpCellWithPictureArr:(NSMutableArray *)arrPic indexPath:(NSIndexPath *)indexPath;
......
...@@ -12,6 +12,7 @@ typedef void (^myBlock)(NSArray *); ...@@ -12,6 +12,7 @@ typedef void (^myBlock)(NSArray *);
@property (nonatomic, copy) myBlock updateCellData; @property (nonatomic, copy) myBlock updateCellData;
@property (weak, nonatomic) IBOutlet UILabel *paymentType; @property (weak, nonatomic) IBOutlet UILabel *paymentType;
@property (weak, nonatomic) IBOutlet UITextField *textFieldAmount;
- (void)cellWithArray:(NSArray *)array; - (void)cellWithArray:(NSArray *)array;
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
#import "SalesInputTableViewCell.h" #import "SalesInputTableViewCell.h"
@interface SalesInputTableViewCell ()<UITextFieldDelegate> @interface SalesInputTableViewCell () <UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *textFieldAmount;
@end @end
...@@ -18,80 +17,105 @@ ...@@ -18,80 +17,105 @@
- (void)awakeFromNib { - (void)awakeFromNib {
self.selectionStyle = UITableViewCellSelectionStyleNone; self.selectionStyle = UITableViewCellSelectionStyleNone;
self.textFieldAmount.delegate = self; self.textFieldAmount.delegate = self;
// self.txtfieldSum.delegate = self; // self.txtfieldSum.delegate = self;
// Initialization code // Initialization code
} }
- (void)cellWithArray:(NSArray *)array { - (void)cellWithArray:(NSArray *)array {
self.textFieldAmount.text = array[0]; self.textFieldAmount.text = array[0];
// self.txtfieldSum.text = [array[1] isEqualToString:@"0"] ? @"" : array[0]; // self.txtfieldSum.text = [array[1] isEqualToString:@"0"] ? @"" : array[0];
} }
//结束编辑 //结束编辑
- (void)textFieldDidEndEditing:(UITextField *)textField { - (void)textFieldDidEndEditing:(UITextField *)textField {
NSLog(@"textField end editing"); NSLog(@"textField end editing");
if ([textField.text isEqualToString:@"."] || [textField.text isEqualToString:@"-"]) {
textField.text = @"";
}
self.updateCellData(@[self.textFieldAmount.text]); self.updateCellData(@[self.textFieldAmount.text]);
} }
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{ {
NSArray *valideInput = @[@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"-",@""]; NSArray *valideInput = @[@"0", @"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"-", @"", @"."];
if ([valideInput containsObject:string]) { if ([valideInput containsObject:string]) {
if (textField.text.length > 0 && [string isEqualToString:@"-"]) { if (textField.text.length > 0 && [string isEqualToString:@"-"]) {
return NO; return NO;
} }
NSMutableString * futureString = [NSMutableString stringWithString:textField.text]; NSMutableString *futureString = [NSMutableString stringWithString:textField.text];
[futureString insertString:string atIndex:range.location]; [futureString insertString:string atIndex:range.location];
if ([futureString hasPrefix:@"."] || [futureString hasPrefix:@"00"] || [futureString hasPrefix:@"-."] || futureString.length > 11) {
return NO;
}
NSInteger flag = 0; NSInteger flag = 0;
NSInteger pointNum = 0;//用于标记-的数量,只能有一个- NSInteger pointNum = 0; //用于标记-的数量,只能有一个-
const NSInteger limited = 20;//限制小数点后面的位数 const NSInteger limited = 20; //限制小数点后面的位数
for (int i = (int) futureString.length - 1; i >= 0; i--) {
for (int i = (int)futureString.length - 1; i>=0; i--) {
if ([futureString characterAtIndex:i] == '-') { if ([futureString characterAtIndex:i] == '-') {
pointNum++; pointNum++;
if (pointNum == 2) { if (pointNum == 2) {
return NO; return NO;
} }
} }
} }
for (int i = (int)futureString.length - 1; i>=0; i--) { for (int i = (int) futureString.length - 1; i >= 0; i--) {
if ([futureString characterAtIndex:i] == '-') { if ([futureString characterAtIndex:i] == '-') {
if (flag > limited) { if (flag > limited) {
return NO; return NO;
} }
break; break;
} }
flag++; flag++;
} }
NSInteger flag1 = 0;
NSInteger pointNum1 = 0; //用于标记.的数量,只能有一个.
const NSInteger limited1 = 2; //限制小数点后面的位数
for (int i = (int) futureString.length - 1; i >= 0; i--) {
if ([futureString characterAtIndex:i] == '.') {
pointNum1++;
if (pointNum1 == 2) {
return NO;
}
}
}
for (int i = (int) futureString.length - 1; i >= 0; i--) {
if ([futureString characterAtIndex:i] == '.') {
if (flag1 > limited1) {
return NO;
}
break;
}
flag1++;
}
return YES; return YES;
}else{ } else {
return NO; return NO;
} }
} }
- (void)textFieldDidBeginEditing:(UITextField *)textField - (void)textFieldDidBeginEditing:(UITextField *)textField {
{
[textField selectAll:self]; [textField selectAll:self];
} }
......
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
} }
NSMutableString * futureString = [NSMutableString stringWithString:textField.text]; NSMutableString * futureString = [NSMutableString stringWithString:textField.text];
[futureString insertString:string atIndex:range.location]; [futureString insertString:string atIndex:range.location];
if ([futureString hasPrefix:@"0"] || [futureString hasPrefix:@"-0"] || futureString.length > 6) {
return NO;
}
NSInteger flag = 0; NSInteger flag = 0;
NSInteger pointNum = 0;//用于标记-的数量,只能有一个- NSInteger pointNum = 0;//用于标记-的数量,只能有一个-
const NSInteger limited = 20;//限制小数点后面的位数 const NSInteger limited = 20;//限制小数点后面的位数
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
...@@ -548,7 +548,7 @@ ...@@ -548,7 +548,7 @@
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="RVD-1S-Uuk" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="RVD-1S-Uuk" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="-664.5" y="2672.5"/> <point key="canvasLocation" x="-227.5" y="2908.5"/>
</scene> </scene>
<!--Statement Detail View Controller--> <!--Statement Detail View Controller-->
<scene sceneID="VuM-mH-kRs"> <scene sceneID="VuM-mH-kRs">
...@@ -1078,7 +1078,7 @@ ...@@ -1078,7 +1078,7 @@
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="llf-hx-tX7" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="llf-hx-tX7" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="-725.5" y="3453.5"/> <point key="canvasLocation" x="-709.5" y="3057.5"/>
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment