Commit f539c42d authored by Sandy's avatar Sandy

销售录入审核功能

parent 16ccdd30
......@@ -28,7 +28,7 @@ pod 'IQKeyboardManager', '~> 3.2.3'
#pod 'Reveal-iOS-SDK', :configurations => ['Debug']
pod 'DZNEmptyDataSet'
pod 'CustomBadge', '~> 3.0.0'
pod 'MJRefresh', '~> 3.1.12'
#should be removed later
#pod 'CocoaAsyncSocket', '~> 7.4.1'
#pod 'CocoaLumberjack', '~> 2.0.0'
\ No newline at end of file
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_audited.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_audited@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_to_audit.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_to_audit@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.8</string>
<string>1.5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -10,25 +10,25 @@
#define VankeConfig_h
// 当前用户信息
#define KEY_CURRENT_USER_INFO @"VANKE_CUR_USER_INFO"
static NSString *const KEY_CURRENT_USER_INFO = @"VANKE_CUR_USER_INFO";
// 当前用户密码
#define KEY_CURRENT_USER_PWD @"VANKE_CUR_USER_PWD"
static NSString *const KEY_CURRENT_USER_PWD = @"VANKE_CUR_USER_PWD";
// 百度服务AK
#define VANKE_BAIDU_API_KEY @"442b5fb0a1dc4dcbbccd26975e180e29"
// 百度服务AKy
static NSString *const VANKE_BAIDU_API_KEY = @"442b5fb0a1dc4dcbbccd26975e180e29";
// 百度天气服务地址
#define VANKE_BAIDU_WEATHER_SERVER_URL @"http://api.map.baidu.com/telematics/v3/weather"
static NSString *const VANKE_BAIDU_WEATHER_SERVER_URL = @"http://api.map.baidu.com/telematics/v3/weather";
//正式环境
#define VANKE_SERVER_BASE_URL @"http://140.206.62.178:8080/wanke-server/rest" //正式
static NSString *const VANKE_SERVER_BASE_URL = @"http://140.206.62.178:8080/wanke-server/rest"; //正式
//后台多媒体文件基准地址
#define VANKE_SERVER_MEDIA_BASE_URL @"http://140.206.62.178:8080" //正式
static NSString *const VANKE_SERVER_MEDIA_BASE_URL = @"http://140.206.62.178:8080"; //正式
// 测试环境
//#define VANKE_SERVER_BASE_URL @"http://139.196.39.77:6080/wanke-server/rest"
//#define VANKE_SERVER_MEDIA_BASE_URL @"http://139.196.39.77:6080"
//static NSString *const VANKE_SERVER_BASE_URL = @"http://139.196.39.77:6080/wanke-server/rest";
//static NSString *const VANKE_SERVER_MEDIA_BASE_URL = @"http://139.196.39.77:6080";
// 后台服务企业认证码
#define VANKE_AUTHENTI_CODE @"211534962"
......
vanke/view_iPhone/resource/img/bill.png

3.02 KB | W: | H:

vanke/view_iPhone/resource/img/bill.png

3.21 KB | W: | H:

vanke/view_iPhone/resource/img/bill.png
vanke/view_iPhone/resource/img/bill.png
vanke/view_iPhone/resource/img/bill.png
vanke/view_iPhone/resource/img/bill.png
  • 2-up
  • Swipe
  • Onion skin
//
// VankeAffairsTenantBoard_iPhone.h
// vanke
//
// Created by Javen on 16/8/24.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "Bee_UIBoard.h"
#import "UIPopoverListView.h"
@interface VankeAffairsTenantBoard_iPhone : BeeUIBoard<UIPopoverListViewDataSource, UIPopoverListViewDelegate>
AS_OUTLET( BeeUIButton, btnNotice )
AS_OUTLET( BeeUIButton, btnBill )
AS_OUTLET( BeeUIButton, btnSaleInput )
AS_OUTLET( BeeUIButton, btnServiceApply )
@end
//
// VankeAffairsTenantBoard_iPhone.m
// vanke
//
// Created by Javen on 16/8/24.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "VankeAffairsTenantBoard_iPhone.h"
#import "VankeUtil.h"
#import "GEToast.h"
#import "VankeCommonModel.h"
#import "VankeAppBoard_iPhone.h"
#import "VankeNoticeListBoard_iPhone.h"
#import "VankeStatementListBoard_iPhone.h"
#import "ICRAnnouncementViewController.h"
#import "SalesInputViewController.h"
#import "StatementViewController.h"
#import "ChooseProjectTableViewController.h"
#import "ICRAppMacro.h"
@interface VankeAffairsTenantBoard_iPhone ()
{
//
NSArray *authorizedOrgs;
}
@end
@implementation VankeAffairsTenantBoard_iPhone
SUPPORT_AUTOMATIC_LAYOUT( YES )
SUPPORT_RESOURCE_LOADING( YES )
DEF_OUTLET( BeeUIButton, btnNotice )
DEF_OUTLET( BeeUIButton, btnBill )
DEF_OUTLET( BeeUIButton, btnSaleInput )
DEF_OUTLET( BeeUIButton, btnServiceApply )
- (void)load
{
}
- (void)unload
{
}
#pragma mark - Signal
ON_CREATE_VIEWS( signal )
{
self.navigationBarShown = YES;
self.navigationBarTitle = @"业务";
}
ON_DELETE_VIEWS( signal )
{
}
ON_LAYOUT_VIEWS( signal )
{
}
ON_WILL_APPEAR( signal )
{
self.navigationController.navigationBar.backgroundImage = [UIImage imageWithColor:[UIColor colorWithR:63 g:134 b:244 a:1]];
UIColor *color = [VankeUtil rgbStringToColor: @"237,27,35"];
if ( IOS7_OR_LATER ) {
self.navigationController.navigationBar.barTintColor = color;
} else {
self.navigationController.navigationBar.tintColor = color;
}
[[VankeAppBoard_iPhone sharedInstance] showMenu];
}
ON_DID_APPEAR( signal )
{
}
ON_WILL_DISAPPEAR( signal )
{
}
ON_DID_DISAPPEAR( signal )
{
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnNotice, signal) {
[[VankeAppBoard_iPhone sharedInstance] hideMenu];
VankeNoticeListBoard_iPhone *board = [VankeNoticeListBoard_iPhone board];
// ICRAnnouncementViewController *board = [ICRAnnouncementViewController board];
[self.stack pushBoard:board animated:YES];
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnBill, signal) {
VankeCommonModel *userModel = [VankeCommonModel sharedInstance];
authorizedOrgs = [userModel getAuthOrgs];
if (authorizedOrgs.count == 0) {
return;
}
else if (authorizedOrgs.count == 1) {
AuthorizedOrg *org = [authorizedOrgs objectAtIndex:0];
//跳转对账单
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Statement" bundle:nil];
StatementViewController *statementVC = [storyboard instantiateViewControllerWithIdentifier:@"StatementViewController"];
statementVC.org = org;
[self.navigationController pushViewController:statementVC animated:YES];
}
else {
CGFloat xWidth = self.view.bounds.size.width - 20.0f;
CGFloat yHeight = authorizedOrgs.count * 60 + 50;
if (yHeight > 400) {
yHeight = 400.0f;
}
CGFloat yOffset = (self.view.bounds.size.height - yHeight)/2.0f;
UIPopoverListView *poplistview = [[UIPopoverListView alloc] initWithFrame:CGRectMake(10, yOffset, xWidth, yHeight)];
poplistview.tag = 10000;
poplistview.delegate = self;
poplistview.datasource = self;
poplistview.listView.scrollEnabled = YES;
[poplistview setTitle:@"请选择查看项目"];
[poplistview show];
}
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnSaleInput, signal) {
// [GEToast showWithText:@"销售录入正在开发中..." bottomOffset:60.0f duration:1.0f];
// if ([[model getAuthOrgs] count] > 1) {
// ChooseProjectTableViewController *chooseVC = [[ChooseProjectTableViewController alloc] init];
// chooseVC.arrAuthorized = [model getAuthOrgs];
// chooseVC.chooseAuthorized = ^(AuthorizedOrg *author){
// salesVC.authorizedOrg = author;
// [weakSelf.navigationController pushViewController:salesVC animated:YES];
// };
// UINavigationController *navc = [[UINavigationController alloc] initWithRootViewController:chooseVC];
// [self.navigationController presentViewController:navc animated:YES completion:nil];
// }else{
// salesVC.authorizedOrg = [model getAuthOrgs][0];
// [self.navigationController pushViewController:salesVC animated:YES];
// }
SalesInputViewController *salesVC = [[SalesInputViewController alloc] init];
salesVC.type = SalesInputViewControllerTypeInput;
VankeCommonModel *userModel = [VankeCommonModel sharedInstance];
if ([[userModel getAuthOrgs] count] == 1) {
salesVC.authorizedOrg = [userModel getAuthOrgs][0];
[self.navigationController pushViewController:salesVC animated:YES];
}else{
authorizedOrgs = [userModel getAuthOrgs];
CGFloat xWidth = self.view.bounds.size.width - 20.0f;
CGFloat yHeight = authorizedOrgs.count * 60 + 50;
if (yHeight > 400) {
yHeight = 400.0f;
}
CGFloat yOffset = (self.view.bounds.size.height - yHeight)/2.0f;
UIPopoverListView *poplistview = [[UIPopoverListView alloc] initWithFrame:CGRectMake(10, yOffset, xWidth, yHeight)];
poplistview.tag = 10001;
poplistview.delegate = self;
poplistview.datasource = self;
poplistview.listView.scrollEnabled = YES;
[poplistview setTitle:@"请选择查看项目"];
[poplistview show];
}
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnServiceApply, signal) {
[GEToast showWithText:@"服务申请正在开发中..." bottomOffset:60.0f duration:1.0f];
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnBillAudit, signal) {
// [[VankeAppBoard_iPhone sharedInstance] hideMenu];
// CLog(@"销售录入审核");
// UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"SalesInPut" bundle:nil];
// SaleInputAuditViewController *auditVC = [storyBoard instantiateViewControllerWithIdentifier:@"SaleInputAuditViewController"];
// [self.navigationController pushViewController:auditVC animated:YES];
}
#pragma mark - UIPopoverListViewDataSource
- (UITableViewCell *)popoverListView:(UIPopoverListView *)popoverListView
cellForIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = @"cell";
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:identifier];
AuthorizedOrg *org = [authorizedOrgs objectAtIndex:indexPath.row];
cell.textLabel.text = org.name;
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:org.picture] placeholderImage:[UIImage imageNamed:@"bill_no_image_default"]];
return cell;
}
- (NSInteger)popoverListView:(UIPopoverListView *)popoverListView
numberOfRowsInSection:(NSInteger)section
{
return authorizedOrgs.count;
}
#pragma mark - UIPopoverListViewDelegate
- (void)popoverListView:(UIPopoverListView *)popoverListView
didSelectIndexPath:(NSIndexPath *)indexPath
{
if (popoverListView.tag == 10000) {
//跳转对账单
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Statement" bundle:nil];
StatementViewController *statementVC = [storyboard instantiateViewControllerWithIdentifier:@"StatementViewController"];
AuthorizedOrg *org = [authorizedOrgs objectAtIndex:indexPath.row];
statementVC.org = org;
[self.navigationController pushViewController:statementVC animated:YES];
}else{
SalesInputViewController *salesVC = [[SalesInputViewController alloc] init];
salesVC.authorizedOrg = [authorizedOrgs objectAtIndex:indexPath.row];
[self.navigationController pushViewController:salesVC animated:YES];
}
}
- (CGFloat)popoverListView:(UIPopoverListView *)popoverListView
heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 60.0f;
}
-(void) showStatementList: (AuthorizedOrg*) org {
if (nil == org) {
ERROR(@"Authorized Org cannot be null.");
return;
}
[[VankeAppBoard_iPhone sharedInstance] hideMenu];
VankeStatementListBoard_iPhone *board = [VankeStatementListBoard_iPhone board];
board.authorizedOrgUuidEquals = org.code;
[self.stack pushBoard:board animated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
<?xml version="1.0" encoding="UTF-8"?>
<ui namespace="VankeAffairsTenantBoard_iPhone">
<linear orientation="v" class="wrapper">
<image class="bg" />
<linear orientation="h" class="row row1">
<linear orientation="v" class="cell notice">
<button id="btnNotice" class="mask" />
<image src="notice.png" />
</linear>
<linear orientation="v" class="cell">
<button id="btnBill" class="mask" />
<image src="bill.png" />
</linear>
</linear>
<linear orientation="h" class="row row2">
<linear orientation="v" class="cell sale-input">
<button id="btnSaleInput" class="mask" />
<image src="sale_input.png" />
</linear>
<linear orientation="v" class="cell">
<button id="btnServiceApply" class="mask" />
<image src="service_apply.png" />
</linear>
</linear>
</linear>
<style type="text/css">
.wrapper {
width: 100%;
height: 100%;
margin-top: 64px;
padding: 5px;
}
.wrapper > .bg {
position: absolute;
width: 100%;
height: 100%;
background-color: #f6f6f6;
}
.wrapper > .row {
width: 100%;
height: 135px;
margin-bottom: 5px;
}
.row > .cell {
width: 50%;
height: 100%;
}
.row > .cell > .mask {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
}
.row > .cell > image {
image-mode: fill;
}
.row1 > .notice,
.row2 > .sale-input {
padding-right: 5px;
}
.row3 > .audit {
padding-right: 5px;
}
</style>
</ui>
......@@ -19,6 +19,7 @@
#import "ICRModifyPwdViewController.h"
#import "ReportViewController.h"
#import "ReportBoardsViewController.h"
#import "VankeAffairsTenantBoard_iPhone.h"
#pragma mark -
@interface VankeAppBoard_iPhone ()
......@@ -56,6 +57,7 @@ ON_CREATE_VIEWS( signal )
_router.view.alpha = 0.0f;
[_router map:@"home" toClass:[VankeMainBoard_iPhone class]];
[_router map:@"affairs" toClass:[VankeAffairsBoard_iPhone class]];
[_router map:@"tenantAffairs" toClass:[VankeAffairsTenantBoard_iPhone class]];
[_router map:@"me" toClass:[ICRSystemViewController class]];
[_router map:@"report" toClass:[ReportBoardsViewController class]];
[self.view addSubview:_router.view];
......@@ -193,7 +195,7 @@ ON_SIGNAL3( VankeMainTabBoard_iPhone, me, signal )
//商户用户
ON_SIGNAL3( VankeTenantTabBoard_iPhone, affairs, signal )
{
[_router open:@"affairs" animated:YES];
[_router open:@"tenantAffairs" animated:YES];
[_tenantTabbar selectAffairs];
}
......
......@@ -26,5 +26,7 @@ AS_OUTLET( BeeUIButton, btnNotice )
AS_OUTLET( BeeUIButton, btnBill )
AS_OUTLET( BeeUIButton, btnSaleInput )
AS_OUTLET( BeeUIButton, btnServiceApply )
AS_OUTLET( BeeUIButton, btnBillAudit )
@end
//
// ______ ______ ______
// /\ __ \ /\ ___\ /\ ___\
// /\ __ \ /\ ___\ /\ ___\
// \ \ __< \ \ __\_ \ \ __\_
// \ \_____\ \ \_____\ \ \_____\
// \ \_____\ \ \_____\ \ \_____\
// \/_____/ \/_____/ \/_____/
//
// Powered by BeeFramework
......@@ -27,11 +27,12 @@
#import "StatementViewController.h"
#import "ChooseProjectTableViewController.h"
#import "ICRAppMacro.h"
#import "SaleInputAuditViewController.h"
#pragma mark -
@interface VankeAffairsBoard_iPhone()
{
//<#@private var#>
//
NSArray *authorizedOrgs;
}
@end
......@@ -45,7 +46,7 @@ DEF_OUTLET( BeeUIButton, btnNotice )
DEF_OUTLET( BeeUIButton, btnBill )
DEF_OUTLET( BeeUIButton, btnSaleInput )
DEF_OUTLET( BeeUIButton, btnServiceApply )
DEF_OUTLET( BeeUIButton, btnBillAudit )
- (void)load
{
}
......@@ -149,6 +150,7 @@ ON_SIGNAL3(VankeAffairsBoard_iPhone, btnSaleInput, signal) {
// [self.navigationController pushViewController:salesVC animated:YES];
// }
SalesInputViewController *salesVC = [[SalesInputViewController alloc] init];
salesVC.type = SalesInputViewControllerTypeInput;
VankeCommonModel *userModel = [VankeCommonModel sharedInstance];
if ([[userModel getAuthOrgs] count] == 1) {
salesVC.authorizedOrg = [userModel getAuthOrgs][0];
......@@ -177,6 +179,15 @@ ON_SIGNAL3(VankeAffairsBoard_iPhone, btnServiceApply, signal) {
[GEToast showWithText:@"服务申请正在开发中..." bottomOffset:60.0f duration:1.0f];
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnBillAudit, signal) {
[[VankeAppBoard_iPhone sharedInstance] hideMenu];
CLog(@"销售录入审核");
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"SalesInPut" bundle:nil];
SaleInputAuditViewController *auditVC = [storyBoard instantiateViewControllerWithIdentifier:@"SaleInputAuditViewController"];
[self.navigationController pushViewController:auditVC animated:YES];
}
#pragma mark - UIPopoverListViewDataSource
- (UITableViewCell *)popoverListView:(UIPopoverListView *)popoverListView
......
......@@ -24,9 +24,18 @@
</linear>
<linear orientation="v" class="cell">
<button id="btnBillAudit" class="mask" />
<image src="audit.png" />
</linear>
</linear>
<linear orientation="h" class="row row3">
<linear orientation="v" class="cell audit">
<button id="btnServiceApply" class="mask" />
<image src="service_apply.png" />
</linear>
</linear>
</linear>
......@@ -73,5 +82,8 @@
.row2 > .sale-input {
padding-right: 5px;
}
.row3 > .audit {
padding-right: 5px;
}
</style>
</ui>
......@@ -205,8 +205,8 @@ ON_SIGNAL3( VankeServiceSaleCell_iPhone, btnHistoryMask, signal ) {
ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal) {
[[VankeAppBoard_iPhone sharedInstance] hideMenu];
[self showListView: CELL_TYPE_FLOOR];
// [[VankeAppBoard_iPhone sharedInstance] hideMenu];
// [self showListView: CELL_TYPE_FLOOR];
// VankeServiceBoardCell_iPhone *cell = (VankeServiceBoardCell_iPhone *)signal.sourceCell;
// if ([@"昨日客流" eq:[cell name]]) {
......
......@@ -3,7 +3,7 @@
#import "VankeTenantTabBoard_iPhone.h"
#import "VankeCommonModel.h"
NSString *const TENANT_TAB_NAME_AFFAIRS = @"affairs"; // affairs
NSString *const TENANT_TAB_NAME_AFFAIRS = @"tenantAffairs"; // affairs
NSString *const TENANT_TAB_NAME_ME = @"me"; // me
#pragma mark -
......
......@@ -8,9 +8,17 @@
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, GalleryType) {
GalleryTypeHistory,
GalleryTypeAudit
};
typedef void (^closeBlock)(NSInteger);
@interface GalleryViewController : UIViewController
@property (nonatomic, strong) NSMutableArray *arrData;
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, assign) GalleryType type;
@property (nonatomic, strong) NSMutableArray *arrOnlineUuids;
@end
......@@ -12,6 +12,8 @@
@interface GalleryViewController ()<UIScrollViewDelegate>
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *flowLayout;
@property (nonatomic, strong) NSMutableArray *arrPic;
@end
......@@ -23,10 +25,51 @@
self.flowLayout.minimumLineSpacing = 0;
self.flowLayout.minimumInteritemSpacing = 0;
self.flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
// Do any additional setup after loading the view.
switch (self.type) {
case GalleryTypeHistory: {
self.arrPic = self.arrData;
break;
}
case GalleryTypeAudit: {
UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(deletePic)];
self.navigationItem.rightBarButtonItem = rightBtn;
self.arrPic = [self.arrData mutableCopy];
[self.arrPic removeLastObject];
break;
}
}
}
- (void)deletePic {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"确认删除这张图片?" message:nil preferredStyle:UIAlertControllerStyleAlert];
WS(weakSelf);
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
if (weakSelf.page < weakSelf.arrOnlineUuids.count) {
[weakSelf.arrOnlineUuids removeObjectAtIndex:weakSelf.page];
}
[weakSelf.arrPic removeObjectAtIndex:weakSelf.page];
[weakSelf.arrData removeObjectAtIndex:weakSelf.page];
[weakSelf.collectionView reloadData];
weakSelf.page--;
if (self.arrPic.count == 0) {
[weakSelf.navigationController popViewControllerAnimated:YES];
}
}];
[alertVC addAction:action];
UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
[alertVC addAction:actionCancel];
[self.navigationController presentViewController:alertVC animated:YES completion:nil];
}
- (void)viewDidLayoutSubviews {
if (self.page < 0) {
return;
}
[self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:self.page inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:NO];
}
......@@ -37,20 +80,31 @@
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.arrData.count;
return self.arrPic.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
GalleryCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GalleryCollectionViewCell" forIndexPath:indexPath];
AttachmentModel *model = self.arrData[indexPath.row];
[cell setUpCellWithModel:model];
// Configure the cell
self.title = [NSString stringWithFormat:@"(%ld/%.0lu)", indexPath.row + 1, (unsigned long)self.arrData.count];
// [cell setUpCellWithModel:model];
switch (self.type) {
case GalleryTypeHistory: {
AttachmentModel *model = self.arrPic[indexPath.row];
[cell setUpCell:[NSString stringWithFormat:@"%@%@",VANKE_SERVER_MEDIA_BASE_URL, model.fileUrl]];
break;
}
case GalleryTypeAudit: {
[cell setUpCell:self.arrPic[indexPath.row]];
break;
}
}
self.title = [NSString stringWithFormat:@"(%ld/%.0lu)", indexPath.row + 1, (unsigned long)self.arrPic.count];
return cell;
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
self.title = [NSString stringWithFormat:@"(%.0f/%.0lu)", scrollView.contentOffset.x / SCREEN_WIDTH + 1, (unsigned long)self.arrData.count];
self.title = [NSString stringWithFormat:@"(%.0f/%.0lu)", scrollView.contentOffset.x / SCREEN_WIDTH + 1, (unsigned long)self.arrPic.count];
self.page = scrollView.contentOffset.x / SCREEN_WIDTH;
}
- (void)didReceiveMemoryWarning {
......
......@@ -117,7 +117,7 @@
label.tag = j - 1;
if (i == 0) {
label.tag = 3000 + j;
}else if(i == 1){//金额
}else if(i == 2){//金额
label.textColor = [UIColor redColor];
}
}
......@@ -148,7 +148,7 @@
[self.scrollView insertSubview:labelBottom belowSubview:[self.scrollView viewWithTag:2000 + i -1]];//防止前面的别挡住
if (i==1) {
if (i==2) {
labelBottom.textColor = [UIColor redColor];
}else{
labelBottom.textColor = [UIColor whiteColor];
......@@ -308,29 +308,35 @@
NSMutableArray *arrDate = [NSMutableArray array];//日期
[arrDate addObject:@"日期"];
NSMutableArray *arrBills = [NSMutableArray array];//笔数
[arrBills addObject:@"笔数"];
NSMutableArray *arrAmount = [NSMutableArray array];//金额
[arrAmount addObject:@"金额(元)"];
// 日期金额笔数这三项是固定在前面,所以在前面先写,后面的是动态的。
weakSelf.arrRecords = dic[@"data"][@"records"];
NSMutableArray *payment = [NSMutableArray array];
for (NSDictionary *obj in dic[@"data"][@"records"]) {
[arrDate addObject:obj[@"salesDate"]];
[arrAmount addObject:[NSString stringWithFormat:@"%.0f", [obj[@"amount"] floatValue]]];
[arrBills addObject:[NSString stringWithFormat:@"%.0f", [obj[@"transactions"] floatValue]]];
NSMutableArray *arr = [NSMutableArray array];
for (NSDictionary *dic in obj[@"lines"]) {
for (NSDictionary *dic in obj[@"payments"]) {
[arr addObject:dic];
}
[payment addObject:arr];
}
[arrData addObject:arrDate];
[arrData addObject:arrBills];
[arrData addObject:arrAmount];
NSMutableArray *paytype = [NSMutableArray array];
if (payment.count > 0) {
for (NSDictionary *dic in payment[0]) {
NSMutableArray *apay = [NSMutableArray array];
[apay addObject:dic[@"payment"]];
[apay addObject:dic[@"paymentName"]];
[paytype addObject:apay];
}
}
......
//
// SaleInputAuditViewController.h
// vanke
//
// Created by Javen on 16/8/22.
// Copyright © 2016年 gomore. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SaleInputAuditViewController : UIViewController
@end
//
// SaleInputAuditViewController.m
// vanke
//
// Created by Javen on 16/8/22.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "SaleInputAuditViewController.h"
#import "SalesInputAuditModels.h"
#import "SaleInputAuditTableViewCell.h"
#import "MJRefresh.h"
#import "SalesInputViewController.h"
@interface SaleInputAuditViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *arrData;
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, strong) MBProgressHUD *hud;
@end
@implementation SaleInputAuditViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.page = 0;
self.title = @"审批列表";
self.tableView.estimatedRowHeight = 159;
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.backgroundImage = [UIImage imageWithColor:[UIColor colorWithRed:0.918 green:0.392 blue:0.004 alpha:1.000]];
WS(weakSelf);
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf httpRequest];
}];
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
[weakSelf.arrData removeAllObjects];
weakSelf.page = 0;
weakSelf.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
[weakSelf httpRequest];
}];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.tableView.mj_header beginRefreshing];
}
- (void)httpRequest{
NSDictionary *dic = @{@"beginDateEquals":@"2016-07-10",
@"endDateEquals":[[NSDate date] yearMonthDayString],
@"pageNumber":@(self.page),
@"pageSize":@20};
WS(weakSelf);
[[ICRHTTPController sharedController] getUrl:@"salesinput/bill/query" params:dic success:^(id data) {
NSString *strData = [data JSONString];
CLog(@"%@",strData);
for (NSDictionary *dic in data[@"data"][@"records"]) {
SalesInputAuditListModel *model = [SalesInputAuditListModel modelObjectWithDictionary:dic];
[weakSelf.arrData addObject:model];
}
[self.hud hide:YES];
[weakSelf.tableView.mj_header endRefreshing];
if ([data[@"data"][@"records"] count] == 0) {
[weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView reloadData];
} failure:^(id data) {
}];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.arrData.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
SaleInputAuditTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SaleInputAuditTableViewCell" forIndexPath:indexPath];
[cell configCellWithArr:self.arrData index:indexPath];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SalesInputViewController *saleInputVC = [[SalesInputViewController alloc] init];
saleInputVC.type = SalesInputViewControllerTypeAudit;
saleInputVC.model = self.arrData[indexPath.row];
[self.navigationController pushViewController:saleInputVC animated:YES];
}
- (NSMutableArray *)arrData {
if (!_arrData) {
_arrData = [NSMutableArray array];
}
return _arrData;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -103,6 +103,7 @@ static NSString * const reuseIdentifier = @"saleInputCollection";
GalleryViewController *seePicVC = [storyBoard instantiateViewControllerWithIdentifier:@"GalleryViewController"];
seePicVC.arrData = self.dataArr;
seePicVC.page = indexPath.row;
seePicVC.type = GalleryTypeHistory;
[self.navigationController pushViewController:seePicVC animated:YES];
}
......
......@@ -9,9 +9,16 @@
#import "IBTUIViewController.h"
#import "VankeShopModel.h"
#import "VankeCommonModel.h"
#import "SalesInputAuditModels.h"
typedef NS_ENUM(NSInteger, SalesInputViewControllerType) {
SalesInputViewControllerTypeInput,
SalesInputViewControllerTypeAudit,
};
@interface SalesInputViewController : UIViewController
@property (nonatomic, strong) VankeShopModel *shop;
@property (nonatomic, strong) AuthorizedOrg *authorizedOrg;
@property (nonatomic, assign) SalesInputViewControllerType type;
@property (nonatomic, strong) SalesInputAuditListModel *model;
@property (nonatomic, assign) BOOL isReadOnly;
@end
......@@ -16,4 +16,7 @@
@property (nonatomic, copy) NSString *fileName;
@property (nonatomic, strong) UIImage *image;
@end
//
// SalesInputAuditListModel.h
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SalesInputAuditListModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double amount;
@property (nonatomic, strong) NSArray *lines;
@property (nonatomic, strong) NSString *salesDate;
@property (nonatomic, strong) NSString *attachmentUuid;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *shopName;
@property (nonatomic, assign) double transactions;
@property (nonatomic, strong) NSString *shopCode;
@property (nonatomic, strong) NSArray *attachments;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *projectId;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// SalesInputAuditListModel.m
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "SalesInputAuditListModel.h"
#import "SalesInputLines.h"
NSString *const kSalesInputAuditListModelAmount = @"amount";
NSString *const kSalesInputAuditListModelLines = @"lines";
NSString *const kSalesInputAuditListModelSalesDate = @"salesDate";
NSString *const kSalesInputAuditListModelAttachmentUuid = @"attachmentUuid";
NSString *const kSalesInputAuditListModelUuid = @"uuid";
NSString *const kSalesInputAuditListModelShopName = @"shopName";
NSString *const kSalesInputAuditListModelTransactions = @"transactions";
NSString *const kSalesInputAuditListModelShopCode = @"shopCode";
NSString *const kSalesInputAuditListModelAttachments = @"attachments";
NSString *const kSalesInputAuditListModelState = @"state";
NSString *const kSalesInputAuditListModelProjectId = @"projectId";
@interface SalesInputAuditListModel ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation SalesInputAuditListModel
@synthesize amount = _amount;
@synthesize lines = _lines;
@synthesize salesDate = _salesDate;
@synthesize attachmentUuid = _attachmentUuid;
@synthesize uuid = _uuid;
@synthesize shopName = _shopName;
@synthesize transactions = _transactions;
@synthesize shopCode = _shopCode;
@synthesize attachments = _attachments;
@synthesize state = _state;
@synthesize projectId = _projectId;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.amount = [[self objectOrNilForKey:kSalesInputAuditListModelAmount fromDictionary:dict] doubleValue];
NSObject *receivedSalesInputLines = [dict objectForKey:kSalesInputAuditListModelLines];
NSMutableArray *parsedSalesInputLines = [NSMutableArray array];
if ([receivedSalesInputLines isKindOfClass:[NSArray class]]) {
for (NSDictionary *item in (NSArray *)receivedSalesInputLines) {
if ([item isKindOfClass:[NSDictionary class]]) {
[parsedSalesInputLines addObject:[SalesInputLines modelObjectWithDictionary:item]];
}
}
} else if ([receivedSalesInputLines isKindOfClass:[NSDictionary class]]) {
[parsedSalesInputLines addObject:[SalesInputLines modelObjectWithDictionary:(NSDictionary *)receivedSalesInputLines]];
}
self.lines = [NSArray arrayWithArray:parsedSalesInputLines];
self.salesDate = [self objectOrNilForKey:kSalesInputAuditListModelSalesDate fromDictionary:dict];
self.attachmentUuid = [self objectOrNilForKey:kSalesInputAuditListModelAttachmentUuid fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kSalesInputAuditListModelUuid fromDictionary:dict];
self.shopName = [self objectOrNilForKey:kSalesInputAuditListModelShopName fromDictionary:dict];
self.transactions = [[self objectOrNilForKey:kSalesInputAuditListModelTransactions fromDictionary:dict] doubleValue];
self.shopCode = [self objectOrNilForKey:kSalesInputAuditListModelShopCode fromDictionary:dict];
self.attachments = [self objectOrNilForKey:kSalesInputAuditListModelAttachments fromDictionary:dict];
self.state = [self objectOrNilForKey:kSalesInputAuditListModelState fromDictionary:dict];
self.projectId = [self objectOrNilForKey:kSalesInputAuditListModelProjectId fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[NSNumber numberWithDouble:self.amount] forKey:kSalesInputAuditListModelAmount];
NSMutableArray *tempArrayForLines = [NSMutableArray array];
for (NSObject *subArrayObject in self.lines) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForLines addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForLines addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForLines] forKey:kSalesInputAuditListModelLines];
[mutableDict setValue:self.salesDate forKey:kSalesInputAuditListModelSalesDate];
[mutableDict setValue:self.attachmentUuid forKey:kSalesInputAuditListModelAttachmentUuid];
[mutableDict setValue:self.uuid forKey:kSalesInputAuditListModelUuid];
[mutableDict setValue:self.shopName forKey:kSalesInputAuditListModelShopName];
[mutableDict setValue:[NSNumber numberWithDouble:self.transactions] forKey:kSalesInputAuditListModelTransactions];
[mutableDict setValue:self.shopCode forKey:kSalesInputAuditListModelShopCode];
NSMutableArray *tempArrayForAttachments = [NSMutableArray array];
for (NSObject *subArrayObject in self.attachments) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForAttachments addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForAttachments addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForAttachments] forKey:kSalesInputAuditListModelAttachments];
[mutableDict setValue:self.state forKey:kSalesInputAuditListModelState];
[mutableDict setValue:self.projectId forKey:kSalesInputAuditListModelProjectId];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.amount = [aDecoder decodeDoubleForKey:kSalesInputAuditListModelAmount];
self.lines = [aDecoder decodeObjectForKey:kSalesInputAuditListModelLines];
self.salesDate = [aDecoder decodeObjectForKey:kSalesInputAuditListModelSalesDate];
self.attachmentUuid = [aDecoder decodeObjectForKey:kSalesInputAuditListModelAttachmentUuid];
self.uuid = [aDecoder decodeObjectForKey:kSalesInputAuditListModelUuid];
self.shopName = [aDecoder decodeObjectForKey:kSalesInputAuditListModelShopName];
self.transactions = [aDecoder decodeDoubleForKey:kSalesInputAuditListModelTransactions];
self.shopCode = [aDecoder decodeObjectForKey:kSalesInputAuditListModelShopCode];
self.attachments = [aDecoder decodeObjectForKey:kSalesInputAuditListModelAttachments];
self.state = [aDecoder decodeObjectForKey:kSalesInputAuditListModelState];
self.projectId = [aDecoder decodeObjectForKey:kSalesInputAuditListModelProjectId];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeDouble:_amount forKey:kSalesInputAuditListModelAmount];
[aCoder encodeObject:_lines forKey:kSalesInputAuditListModelLines];
[aCoder encodeObject:_salesDate forKey:kSalesInputAuditListModelSalesDate];
[aCoder encodeObject:_attachmentUuid forKey:kSalesInputAuditListModelAttachmentUuid];
[aCoder encodeObject:_uuid forKey:kSalesInputAuditListModelUuid];
[aCoder encodeObject:_shopName forKey:kSalesInputAuditListModelShopName];
[aCoder encodeDouble:_transactions forKey:kSalesInputAuditListModelTransactions];
[aCoder encodeObject:_shopCode forKey:kSalesInputAuditListModelShopCode];
[aCoder encodeObject:_attachments forKey:kSalesInputAuditListModelAttachments];
[aCoder encodeObject:_state forKey:kSalesInputAuditListModelState];
[aCoder encodeObject:_projectId forKey:kSalesInputAuditListModelProjectId];
}
- (id)copyWithZone:(NSZone *)zone
{
SalesInputAuditListModel *copy = [[SalesInputAuditListModel alloc] init];
if (copy) {
copy.amount = self.amount;
copy.lines = [self.lines copyWithZone:zone];
copy.salesDate = [self.salesDate copyWithZone:zone];
copy.attachmentUuid = [self.attachmentUuid copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
copy.shopName = [self.shopName copyWithZone:zone];
copy.transactions = self.transactions;
copy.shopCode = [self.shopCode copyWithZone:zone];
copy.attachments = [self.attachments copyWithZone:zone];
copy.state = [self.state copyWithZone:zone];
copy.projectId = [self.projectId copyWithZone:zone];
}
return copy;
}
@end
//
// DataModels.h
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "SalesInputLines.h" #import "SalesInputAuditListModel.h"
\ No newline at end of file
//
// SalesInputLines.h
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SalesInputLines : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double amount;
@property (nonatomic, strong) NSString *payment;
@property (nonatomic, assign) double sortNumber;
@property (nonatomic, assign) double transactions;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// SalesInputLines.m
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "SalesInputLines.h"
NSString *const kSalesInputLinesAmount = @"amount";
NSString *const kSalesInputLinesPayment = @"payment";
NSString *const kSalesInputLinesSortNumber = @"sortNumber";
NSString *const kSalesInputLinesTransactions = @"transactions";
@interface SalesInputLines ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation SalesInputLines
@synthesize amount = _amount;
@synthesize payment = _payment;
@synthesize sortNumber = _sortNumber;
@synthesize transactions = _transactions;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.amount = [[self objectOrNilForKey:kSalesInputLinesAmount fromDictionary:dict] doubleValue];
self.payment = [self objectOrNilForKey:kSalesInputLinesPayment fromDictionary:dict];
self.sortNumber = [[self objectOrNilForKey:kSalesInputLinesSortNumber fromDictionary:dict] doubleValue];
self.transactions = [[self objectOrNilForKey:kSalesInputLinesTransactions fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[NSNumber numberWithDouble:self.amount] forKey:kSalesInputLinesAmount];
[mutableDict setValue:self.payment forKey:kSalesInputLinesPayment];
[mutableDict setValue:[NSNumber numberWithDouble:self.sortNumber] forKey:kSalesInputLinesSortNumber];
[mutableDict setValue:[NSNumber numberWithDouble:self.transactions] forKey:kSalesInputLinesTransactions];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.amount = [aDecoder decodeDoubleForKey:kSalesInputLinesAmount];
self.payment = [aDecoder decodeObjectForKey:kSalesInputLinesPayment];
self.sortNumber = [aDecoder decodeDoubleForKey:kSalesInputLinesSortNumber];
self.transactions = [aDecoder decodeDoubleForKey:kSalesInputLinesTransactions];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeDouble:_amount forKey:kSalesInputLinesAmount];
[aCoder encodeObject:_payment forKey:kSalesInputLinesPayment];
[aCoder encodeDouble:_sortNumber forKey:kSalesInputLinesSortNumber];
[aCoder encodeDouble:_transactions forKey:kSalesInputLinesTransactions];
}
- (id)copyWithZone:(NSZone *)zone
{
SalesInputLines *copy = [[SalesInputLines alloc] init];
if (copy) {
copy.amount = self.amount;
copy.payment = [self.payment copyWithZone:zone];
copy.sortNumber = self.sortNumber;
copy.transactions = self.transactions;
}
return copy;
}
@end
......@@ -13,5 +13,6 @@
@property (nonatomic, strong) UIImageView *imgView;
- (void)setUpCellWithModel:(AttachmentModel *)model;
- (void)setUpCell:(id)img;
- (void)cellWithImgName:(NSString *)imgUrl;
@end
......@@ -21,16 +21,33 @@
}
- (void)setUpCellWithModel:(AttachmentModel *)model {
NSString *imageUrl;
id imageUrl;
if (model.fileUrl.length < 3) {
imageUrl = @"floor-def";
}else if ([model.fileUrl hasPrefix:@"http://"]){
imageUrl = model.fileUrl;
}else{
imageUrl = [NSString stringWithFormat:@"%@%@",VANKE_SERVER_MEDIA_BASE_URL, model.fileUrl];
}
[self cellWithImgName:imageUrl];
}
- (void)cellWithImgName:(NSString *)imgUrl {
- (void)setUpCell:(id)img {
id imageUrl;
if ([img isKindOfClass:[NSString class]]) {
if ([img hasPrefix:@"http://"]){
imageUrl = img;
}else{
imageUrl = [UIImage imageNamed:img];
}
}else if ([img isKindOfClass:[UIImage class]]){
imageUrl = img;
}
[self cellWithImgName:imageUrl];
}
- (void)cellWithImgName:(id)imgUrl {
[self.imageScrollView setImage:imgUrl placeHolder:[UIImage imageNamed:@"no_picture"]];
}
......
//
// SaleInputAuditTableViewCell.h
// vanke
//
// Created by Javen on 16/8/22.
// Copyright © 2016年 gomore. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SalesInputAuditModels.h"
@interface SaleInputAuditTableViewCell : UITableViewCell
/** 店铺名称 */
@property (weak, nonatomic) IBOutlet UILabel *shopName;
/** 笔数 */
@property (weak, nonatomic) IBOutlet UILabel *billsCount;
/** 录入时间 */
@property (weak, nonatomic) IBOutlet UILabel *date;
/** 状态图片 */
@property (weak, nonatomic) IBOutlet UIImageView *statePic;
@property (nonatomic, strong) SalesInputAuditListModel *model;
- (void)configCellWithArr:(NSArray *)arr index:(NSIndexPath *)indexPath;
@end
//
// SaleInputAuditTableViewCell.m
// vanke
//
// Created by Javen on 16/8/22.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "SaleInputAuditTableViewCell.h"
@implementation SaleInputAuditTableViewCell
- (void)awakeFromNib {
// Initialization code
}
- (void)configCellWithArr:(NSArray *)arr index:(NSIndexPath *)indexPath {
SalesInputAuditListModel *model = arr[indexPath.row];
self.shopName.text = model.shopName;
self.billsCount.text = [NSString stringWithFormat:@"%.0f",model.transactions];
self.date.text = model.salesDate;
if ([model.state isEqualToString:@"submited"]) {
self.statePic.image = [UIImage imageNamed:@"img_to_audit"];
}else if ([model.state isEqualToString:@"approved"]){
self.statePic.image = [UIImage imageNamed:@"img_audited"];
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -13,7 +13,8 @@ typedef void (^actionBlock)(NSInteger);
@property (weak, nonatomic) IBOutlet UIButton *btnRight;
@property (nonatomic, copy) actionBlock addPicBlock;
@property (nonatomic, copy) actionBlock seePicBlock;
@property (nonatomic, copy) actionBlock deleteBolock;
- (void)setUpCellWithPictureArr:(NSArray *)arrPic indexPath:(NSIndexPath *)indexPath;
- (void)setUpCellWithPictureArr:(NSMutableArray *)arrPic indexPath:(NSIndexPath *)indexPath;
@end
......@@ -7,7 +7,7 @@
//
#import "SaleInputPictureTableViewCell.h"
#import "UIButton+WebCache.h"
@interface SaleInputPictureTableViewCell ()
@property (nonatomic, strong) NSMutableArray *arrPictures;
@end
......@@ -20,17 +20,32 @@
// Initialization code
}
- (void)setUpCellWithPictureArr:(NSArray *)arrPic indexPath:(NSIndexPath *)indexPath {
- (void)setUpCellWithPictureArr:(NSMutableArray *)arrPic indexPath:(NSIndexPath *)indexPath {
self.arrPictures = arrPic;
[self.btnLeft setImage:arrPic[indexPath.row * 2] forState:UIControlStateNormal];
id img = arrPic[indexPath.row * 2];
if ([img isKindOfClass:[UIImage class]]) {
[self.btnLeft setImage:img forState:UIControlStateNormal];
}else if ([img isKindOfClass:[NSString class]]) {
[self.btnLeft sd_setImageWithURL:[NSURL URLWithString:img] forState:UIControlStateNormal];
}
self.btnLeft.tag = indexPath.row * 2;
self.btnRight.hidden = YES;
if (indexPath.row * 2 + 1 <= arrPic.count - 1) {
[self.btnRight setImage:arrPic[indexPath.row * 2 + 1] forState:UIControlStateNormal];
id image = arrPic[indexPath.row * 2 + 1];
if ([image isKindOfClass:[UIImage class]]) {
[self.btnRight setImage:image forState:UIControlStateNormal];
}else if ([image isKindOfClass:[NSString class]]) {
[self.btnRight sd_setImageWithURL:[NSURL URLWithString:image] forState:UIControlStateNormal];
}
self.btnRight.tag = indexPath.row * 2 + 1;
self.btnRight.hidden = NO;
}
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
UILongPressGestureRecognizer *lp2 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
[self.btnLeft addGestureRecognizer:longPress];
[self.btnRight addGestureRecognizer:lp2];
[self.btnLeft addTarget:self action:@selector(actionPic:) forControlEvents:UIControlEventTouchUpInside];
[self.btnRight addTarget:self action:@selector(actionPic:) forControlEvents:UIControlEventTouchUpInside];
......@@ -45,6 +60,15 @@
}
}
- (void)longPress:(UILongPressGestureRecognizer *)recognizer{
UIButton *btn = (UIButton *)recognizer.view;
if (btn.tag == self.arrPictures.count - 1) {
self.addPicBlock(0);
}else{
self.deleteBolock(btn.tag);
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
......
......@@ -15,7 +15,13 @@ typedef void (^tapBlock)(void);
@property (weak, nonatomic) IBOutlet UITextField *textfieldDate;
@property (weak, nonatomic) IBOutlet UIButton *buttonName;
@property (weak, nonatomic) IBOutlet UITextField *textFieldTotalAmount;
@property (weak, nonatomic) IBOutlet UILabel *totalTitle;
@property (weak, nonatomic) IBOutlet UILabel *totalUnit;
/** 右边的两个小剪头 */
@property (weak, nonatomic) IBOutlet UIImageView *rightIcon1;
@property (weak, nonatomic) IBOutlet UIImageView *rightIcon2;
- (void)setShopName:(NSString *)name;
- (void)setDate:(NSString *)date;
- (void)hideBottom;
@end
......@@ -28,6 +28,13 @@
- (void)awakeFromNib {
}
- (void)hideBottom {
self.totalUnit.hidden = YES;
self.totalTitle.hidden = YES;
self.textFieldTotalAmount.hidden = YES;
self.rightIcon1.hidden = YES;
self.rightIcon2.hidden = YES;
}
- (IBAction)labelNameTapAction:(id)sender {
self.nameTapActionBlock();
......
......@@ -27,7 +27,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="星巴克【A01-01】" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dRE-Ph-BBH">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="星巴克【A01-01】" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dRE-Ph-BBH">
<rect key="frame" x="129" y="23" width="213" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
......@@ -66,7 +66,7 @@
<action selector="labelNameTapAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="8Y1-hG-eN4"/>
</connections>
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="2016-02-4" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="g0n-5F-LTn">
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="2016-02-4" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="g0n-5F-LTn">
<rect key="frame" x="129" y="71" width="213" height="22"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
......@@ -154,8 +154,12 @@
<connections>
<outlet property="buttonName" destination="7BV-nx-jgh" id="GzA-Vh-lYV"/>
<outlet property="labelShopName" destination="dRE-Ph-BBH" id="KsU-if-OPN"/>
<outlet property="rightIcon1" destination="stJ-qB-AhQ" id="BNR-sn-ta6"/>
<outlet property="rightIcon2" destination="JFd-La-Uz1" id="Jkz-nz-jue"/>
<outlet property="textFieldTotalAmount" destination="zUU-xk-nju" id="Tt8-sa-E0R"/>
<outlet property="textfieldDate" destination="g0n-5F-LTn" id="fXf-XI-RTH"/>
<outlet property="totalTitle" destination="VmV-iM-1La" id="hbd-QJ-FZK"/>
<outlet property="totalUnit" destination="Zqk-gi-ME5" id="e7Y-ja-x7k"/>
</connections>
<point key="canvasLocation" x="213.5" y="-61.5"/>
</view>
......
......@@ -11,5 +11,5 @@
@interface SingleScrollView : UIScrollView
//
- (SingleScrollView *)initWithFrame:(CGRect)frame image:(NSString *)image;
- (void)setImage:(NSString *)image placeHolder:(UIImage *)placeHolder;
- (void)setImage:(id)image placeHolder:(UIImage *)placeHolder;
@end
......@@ -52,15 +52,20 @@
[self addSubview:_imageView];
}
- (void)setImage:(NSString *)image placeHolder:(UIImage *)placeHolder{
- (void)setImage:(id)image placeHolder:(UIImage *)placeHolder{
//每次重新设置图片的时候设置缩放比例(场景是在做相册的时候)
self.zoomScale = 1.0;
if ([image hasPrefix:@"http://"]) {
NSURL *url = [NSURL URLWithString:image];
[_imageView sd_setImageWithURL:url placeholderImage:placeHolder];
}else{
_imageView.image=[UIImage imageNamed:image];
if ([image isKindOfClass:[NSString class]]) {
if ([image hasPrefix:@"http://"]){
NSURL *url = [NSURL URLWithString:image];
[_imageView sd_setImageWithURL:url placeholderImage:placeHolder];
}else{
_imageView.image = [UIImage imageNamed:image];
}
}else if ([image isKindOfClass:[UIImage class]]){
_imageView.image = image;
}
}
//双击定点缩放
......
......@@ -67,7 +67,7 @@
[self setDefaults];
[self setUpDatePicker];
self.paramModel = [[StatementListParamModel alloc] init];
self.title = @"对账单";
self.title = @"商铺对账";
self.tableView.estimatedRowHeight = 90;
self.tableView.emptyDataSetSource = self;
self.tableView.emptyDataSetDelegate = self;
......
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