Commit 012aa31a authored by freecui's avatar freecui

Merge branch 'DEV_20150805_001' of http://121.42.32.57/root/xffruit into #DEV_20150805_001

# Conflicts:
#	XFFruit.xcodeproj/project.pbxproj
parents 22d1c9c5 f29bab24
......@@ -29,11 +29,11 @@ PODS:
- FMDB/common
- IQKeyboardManager (3.2.4)
- MBProgressHUD (0.9.1)
- MJRefresh (2.2.0)
- MJRefresh (2.2.1)
- Reveal-iOS-SDK (1.5.1)
- SDWebImage (3.7.2):
- SDWebImage/Core (= 3.7.2)
- SDWebImage/Core (3.7.2)
- SDWebImage (3.7.3):
- SDWebImage/Core (= 3.7.3)
- SDWebImage/Core (3.7.3)
- SSKeychain (1.2.3)
DEPENDENCIES:
......@@ -55,9 +55,9 @@ SPEC CHECKSUMS:
FMDB: 96e8f1bcc1329e269330f99770ad4285d9003e52
IQKeyboardManager: 555b1231fefafb21b19278d7cca72986a27b748b
MBProgressHUD: c47f2c166c126cf2ce36498d80f33e754d4e93ad
MJRefresh: 65a2bf14abb6feeaed8696aa1551f70e15ab0a08
MJRefresh: c3fa0387e8e97a11a9666639d2f815607edd1c2f
Reveal-iOS-SDK: c9c55cad2729c85f6ced415f1b21857c9a2d8ef9
SDWebImage: 71b7cdc1d1721d6a82ed62889030225f2c249e29
SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
COCOAPODS: 0.37.1
COCOAPODS: 0.38.2
This diff is collapsed.
......@@ -26,6 +26,7 @@
#import "Vendor.h"
#import "Warehouse.h"
#import "GXFProductUnit.h"
#import "Accounttitle.h"
#define ICR_DB_ERROR_PARAMETER @"Parse Error: Bad Parameter(s)"
......@@ -97,7 +98,7 @@ static NSString *ICRDataBasePath = @"";
[_m_dbQueue inDatabase:^(FMDatabase *db) {
NSArray *tableNameArr =
@[ [Product class],[User class],[Survey class],[Vendor class],[Warehouse class],[GXFProductUnit class]];
@[ [Product class],[User class],[Survey class],[Vendor class],[Warehouse class],[GXFProductUnit class],[Accounttitle class]];
NSMutableArray *sqlBatch = [NSMutableArray array];
NSString *sql = nil;
......
......@@ -238,6 +238,12 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//5.科目账款
- (void)getAccounttitleWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
// 新增行情反馈(写)
- (void)surveySaveResultWithDict: (NSDictionary *)dict
......@@ -338,22 +344,25 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
- (void)saveTransportWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//2.获取发运单列表
//2.保存并提交
- (void)saveAndSubmitTransportWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//3.获取发运单列表
- (void)queryTransPortWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//3.获取发运单详情
//4.获取发运单详情
- (void)getTransportResultWithTransportUuid:(NSString *)transportUuid
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//4.结束发运单
//5.结束发运单
- (void)endTransportWithTransportUuid:(NSString *)transportUuid
version:(NSNumber *)version
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//5.作废发运单
//6.作废发运单
- (void)abortTransportWithTransportUuid:(NSString *)transportUuid
version:(NSNumber *)version
success:(void (^)(id))succ
......
......@@ -83,6 +83,8 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
XFFHttp_GetVendor,
//仓库
XFFHttp_GetWarehouse,
//科目账单
XFFHttp_GetAccounttitle,
//商品单位
XFFHttp_GetProductunit,
......@@ -111,6 +113,7 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
//发运单
XFFHttp_TransportSave,
XFFHttp_TransportSaveAndSubmit,
XFFHttp_QueryTransport,
XFFHttp_GetTransportDetail,
XFFHttp_EndTransport,
......@@ -191,7 +194,9 @@ static NSString * const ICRHTTPInterface[] = {
[XFFHttp_GetVendor] = @"data/vendor/download",
//仓库
[XFFHttp_GetWarehouse] = @"data/warehouse/download",
//科目账单
[XFFHttp_GetAccounttitle] = @"data/accounttitle/download",
//商品单位
[XFFHttp_GetProductunit] = @"mdata/productunit/download",
//加工单
......@@ -221,6 +226,7 @@ static NSString * const ICRHTTPInterface[] = {
//发运单
[XFFHttp_TransportSave] = @"transport/save_transport",
[XFFHttp_TransportSaveAndSubmit] = @"transport/saveandsubmit_transport",
[XFFHttp_QueryTransport] = @"transport/query_transport",
[XFFHttp_GetTransportDetail] = @"transport/get_transport",
[XFFHttp_EndTransport] = @"transport/finish",
......@@ -1764,6 +1770,14 @@ acceptTypeJson:YES
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetWarehouse ClassName:@"Warehouse" Page_number:page_number page_size:page_size success:succ failure:fail];
}
//科目
- (void)getAccounttitleWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetAccounttitle ClassName:GXF_BASECLASS_ACCOUNTTITLE Page_number:page_number page_size:page_size success:succ failure:fail];
}
- (void)getProductunitWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
......@@ -2176,6 +2190,24 @@ acceptTypeJson:YES
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
[self privateSaveAndSubmitWithUrl:XFFHttp_TransportSave
data:data
success:succ
failure:fail];
}
//保存并提交
- (void)saveAndSubmitTransportWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail{
[self privateSaveAndSubmitWithUrl:XFFHttp_TransportSaveAndSubmit
data:data
success:succ
failure:fail];
}
- (void)privateSaveAndSubmitWithUrl:(ICRHTTPAction)url
data:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail{
if (!data) {
if (fail) {
fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
......@@ -2198,7 +2230,7 @@ acceptTypeJson:YES
NSDictionary *dict = data;
NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_TransportSave] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:url] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:dict
......
//
//
// ChooseParentViewController.m
// XFFruit
//
......@@ -158,16 +158,28 @@
if ([tableStr isEqualToString:GXF_BASECLASS_USER]) {
if (titleStr.length > 0) {
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' AND ENABLED = 1 ORDER BY %@", tableStr,titleStr, @"uuid"];
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE (NAME LIKE '%%%@%%' or LOGIN LIKE '%%%@%%') AND ENABLED = 1 AND POSITION = 'purchaser' ORDER BY %@", tableStr,titleStr,titleStr, @"uuid"];
}else{
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE ENABLED = 1 ORDER BY %@", tableStr, @"uuid"];
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE ENABLED = 1 AND POSITION = 'purchaser' ORDER BY %@", tableStr, @"uuid"];
}
}else{
}else if([tableStr isEqualToString:GXF_BASECLASS_PRODUCTUNIT]){
if (titleStr.length > 0) {
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' ORDER BY %@", tableStr,titleStr, @"uuid"];
}else{
sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", tableStr, @"uuid"];
}
}else if([tableStr isEqualToString:GXF_BASECLASS_ACCOUNTTITLE]){
if (titleStr.length > 0) {
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' AND ENABLED = 1 ORDER BY %@", tableStr,titleStr, @"uuid"];
}else{
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE ENABLED = 1 ORDER BY %@", tableStr, @"uuid"];
}
}else {
if (titleStr.length > 0) {
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' or CODE LIKE '%%%@%%' ORDER BY %@", tableStr,titleStr,titleStr, @"uuid"];
}else{
sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", tableStr, @"uuid"];
}
}
return [db executeQuery:sql];
};
......@@ -182,7 +194,12 @@
[self getBaseDataFromServer];
}else{
[strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObject:self.tableView.header.lastUpdatedTime];
if (!self.tableView.header.lastUpdatedTime) {
[strongSelf.dataArr addObject:[NSDate date]];
}else{
[strongSelf.dataArr addObject:self.tableView.header.lastUpdatedTime];
}
[strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[self tableViewRefresh:titleStr];
......
......@@ -2,6 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
......
......@@ -112,17 +112,18 @@
#define GXF_SEVENTEENTH_SIZE FontSize(17)
//refreshUpdateDate
#define SurveyUpdateDate @"surveyUpdateDate"
#define ChooseProductUpdateDate @"chooseProductUpdateDate"
#define ChooseProductUnitUpdateDate @"chooseProductUnitUpdateDate"
#define ChoosePersonUpdateDate @"choosePersonUpdateDate"
#define ChooseVendorUpdateDate @"chooseVendorUpdateDate"
#define ChooseWarehouseUpdateDate @"chooseWarehouseUpdateDate"
#define PurchaseUpdateDate @"purchaseUpdateDate"
#define TransportUpdateDate @"TransportUpdateDate"
#define PurchaseNoticeUpdateDate @"purchaseNoticeUpdateDate"
#define TransferUpdateDate @"TransferUpdateDate"
#define ChooseTransportUpdateDate @"ChooseTransportUpdateDate"
#define SurveyUpdateDate @"surveyUpdateDate"
#define ChooseProductUpdateDate @"chooseProductUpdateDate"
#define ChooseProductUnitUpdateDate @"chooseProductUnitUpdateDate"
#define ChoosePersonUpdateDate @"choosePersonUpdateDate"
#define ChooseVendorUpdateDate @"chooseVendorUpdateDate"
#define ChooseAccountTitleUpdateDate @"chooseAccountTitleUpdateDate"
#define ChooseWarehouseUpdateDate @"chooseWarehouseUpdateDate"
#define PurchaseUpdateDate @"purchaseUpdateDate"
#define TransportUpdateDate @"TransportUpdateDate"
#define PurchaseNoticeUpdateDate @"purchaseNoticeUpdateDate"
#define TransferUpdateDate @"TransferUpdateDate"
#define ChooseTransportUpdateDate @"ChooseTransportUpdateDate"
//行情调研状态
......@@ -170,6 +171,7 @@
#define GXF_BASECLASS_PRODUCT @"Product"
#define GXF_BASECLASS_PRODUCTUNIT @"GXFProductUnit"
#define GXF_BASECLASS_USER @"User"
#define GXF_BASECLASS_ACCOUNTTITLE @"Accounttitle"
//发运单状态
......@@ -177,6 +179,7 @@
#define TRANSPORT_STATE_UNRECEIVED @"unreceived"//未收货
#define TRANSPORT_STATE_RECEIVED @"received" //已收货
#define TRANSPORT_STATE_ABORTED @"aborted" //已废用
#define TRANSPORT_STATE_FINISHED @"finished" //已完成
//采购通知单状态
//initial("未提交"), notAccepted("未接受"), purchasing("采购中"), finished("已完成")
......
......@@ -12,4 +12,11 @@
//验证是否是整数,小数
+ (BOOL)isValidateNmuberAndFloat:(NSString *)candidate;
//校验手机号位数
+ (BOOL)isValidatePhone:(NSString *) candidate;
// 手机号前3位规定
+ (BOOL)isValidatePhoneNew:(NSString *)candidate;
@end
......@@ -16,4 +16,25 @@
return [numberTest evaluateWithObject:candidate];
}
+ (BOOL)isValidatePhone:(NSString *) candidate {
// NSString *phoneRegex = @"(13[0-9]|15[0|3|6|7|8|9]|18[2|3|6|7|8|9])\\d{8}";
NSString *phoneRegex=@"(\\d{11,11})";
NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex];
return [phoneTest evaluateWithObject:candidate];
}
// 手机号前3位规定
+ (BOOL)isValidatePhoneNew:(NSString *)candidate {
// NSString *phoneRegex = @"(13[0-9]|15[0|3|6|7|8|9]|18[2|3|6|7|8|9])\\d{8}";
NSString *phoneRegex = @"(13[0-9]|14[0-9]|15[0-9]|18[0-9]|17[0|6|7|8])\\d{8}";
NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex];
return [phoneTest evaluateWithObject:candidate];
}
@end
......@@ -7,7 +7,7 @@
//
#import "ChooseParentViewController.h"
#import "Accounttitle.h"
@interface ChooseCostViewController : ChooseParentViewController
@end
......@@ -17,17 +17,25 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"类型";
[self.dataArr addObject:@"运费"];
[self.dataArr addObject:@"人工费"];
[self.dataArr addObject:@"装卸费"];
[self.dataArr addObject:@"杂费"];
self.selectTextFiled = nil;
self.tableView.frame = CGRectMake(0, 5, ScreenSize.width, ScreenSize.height - 64 - 5);
self.title = @"费用类型";
self.tableView.header.lastUpdatedTimeKey = ChooseAccountTitleUpdateDate;
[self fetchDataList:@"" tableStr:GXF_BASECLASS_ACCOUNTTITLE];
}
- (void)getBaseDataFromServer{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_ACCOUNTTITLE];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getAccounttitleWithPage_number:0 page_size:100 success:succ failure:fail];
}
- (void)createRefresh{}
#pragma mark - 协议方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
......@@ -37,39 +45,72 @@
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (self.currentIndexPath) {
if (indexPath.row == self.currentIndexPath.row) {
if (self.isMoreChose) {
if ([self isHaveIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
cell.titleLabel.textColor = BASESELECT_COLOR;
}else{
cell.Commitbtn.hidden = YES;
cell.titleLabel.textColor = [UIColor blackColor];
}
}else{
cell.Commitbtn.hidden = YES;
cell.titleLabel.textColor = [UIColor blackColor];
if (self.currentIndexPath) {
if (indexPath.row == self.currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
cell.titleLabel.textColor = BASESELECT_COLOR;
}else{
cell.Commitbtn.hidden = YES;
cell.titleLabel.textColor = [UIColor blackColor];
}
}else{
cell.Commitbtn.hidden = YES;
cell.titleLabel.textColor = [UIColor blackColor];
}
}
if (self.dataArr.count > 0) {
NSString *type = self.dataArr[indexPath.row];
[cell setTitleStr:type];
if (indexPath.row == 0) {
NSString *dateStr = [self.dataArr[indexPath.row] httpParameterString];
cell.titleLabel.textColor = GXF_CONTENT_COLOR;
[cell setTitleStr:[NSString stringWithFormat:@"上次更新时间:%@",dateStr]];
}else{
Accounttitle *accounttitle = self.dataArr[indexPath.row];
NSString *proStr = [NSString stringWithFormat:@"%@",accounttitle.name];
[cell setTitleStr:proStr];
}
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:self.currentIndexPath];
currentCell.Commitbtn.hidden = YES;
currentCell.titleLabel.textColor = [UIColor blackColor];
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
cell.titleLabel.textColor = BASESELECT_COLOR;
self.currentIndexPath = indexPath;
- (void)boxValueChanged:(NSNotification *)fication{
NSString *tilkeStr = [IBTCommon trimmingCharacters:self.selectTextFiled.text];
[self fetchDataList:tilkeStr tableStr:GXF_BASECLASS_ACCOUNTTITLE];
}
- (void)tableViewRefresh:(NSString *)titltstr{
if (titltstr.length > 0) {
[super tableViewRefresh:titltstr];
}else{
if (self.selectStr.length>0) {
if (!self.isMoreChose) {
for (NSInteger i = 1;i< self.dataArr.count; i++) {
Accounttitle *type = self.dataArr[i];
if ([type.name isEqualToString:self.selectStr]) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
self.currentIndexPath = indexPath;
break;
}
}
[self.tableView reloadData];
}
}else{
[super tableViewRefresh:titltstr];
}
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
//
// RejectView.h
// XFFruit
//
// Created by 陈俊俊 on 15/10/26.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ICRPlaceholderTextView.h"
@interface RejectView : UIView
@property (nonatomic,strong)ICRPlaceholderTextView *rejectTextView;
@end
//
// RejectView.m
// XFFruit
//
// Created by 陈俊俊 on 15/10/26.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "RejectView.h"
#define GXFPOpView_LeftMargin 20
#define GXFPOpView_ContentHeight 230
#define GXFPOpView_TopHeight 44
@implementation RejectView
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout{
self.backgroundColor = RGBA(0, 0, 0, 0.5);
UIScrollView *bgView = [[UIScrollView alloc]initWithFrame:CGRectMake(GXFPOpView_LeftMargin, (ScreenSize.height - GXFPOpView_ContentHeight)/2, ScreenSize.width - GXFPOpView_LeftMargin*2, GXFPOpView_ContentHeight)];
bgView.backgroundColor = XXFBgColor;
bgView.layer.cornerRadius = 4;
bgView.layer.masksToBounds = YES;
[self addSubview:bgView];
UILabel *titlelabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, CGRectGetWidth(bgView.frame)- 20, GXFPOpView_TopHeight-1)];
titlelabel.text = @"请输入拒绝原因";
titlelabel.textColor = GXF_PopView_COLOR;
[bgView addSubview:titlelabel];
UILabel *lineLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, GXFPOpView_TopHeight-1, CGRectGetWidth(bgView.frame), 1)];
lineLabel.backgroundColor = GXF_PopView_COLOR;
[bgView addSubview:lineLabel];
UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, GXFPOpView_TopHeight, CGRectGetWidth(bgView.frame), GXFPOpView_ContentHeight - GXFPOpView_TopHeight*2)];
// scrollView.bounces = NO;
scrollView.backgroundColor = [UIColor redColor];
scrollView.showsHorizontalScrollIndicator = NO;
scrollView.showsVerticalScrollIndicator = NO;
scrollView.contentSize = CGSizeMake(CGRectGetWidth(bgView.frame), GXFPOpView_ContentHeight - GXFPOpView_TopHeight*2);
[bgView addSubview:scrollView];
self.rejectTextView = [[ICRPlaceholderTextView alloc] initWithFrame:CGRectMake(0,0, CGRectGetWidth(bgView.frame), GXFPOpView_ContentHeight - GXFPOpView_TopHeight*2 -10)];
self.rejectTextView.font = [UIFont systemFontOfSize:16.0f];
self.rejectTextView.m_placeHolder = @"请输入拒绝原因";
self.rejectTextView.m_placeholderColor = [UIColor colorWithW:109 a:1];
[scrollView addSubview:self.rejectTextView];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, CGRectGetHeight(bgView.frame)- GXFPOpView_TopHeight, CGRectGetWidth(bgView.frame)/2, GXFPOpView_TopHeight);
[btn setTitle:@"取消" forState:UIControlStateNormal];
[btn addTarget:self action:@selector(cancelClick) forControlEvents:UIControlEventTouchUpInside];
[btn setTitleColor:GXF_CONTENT_COLOR forState:UIControlStateNormal];
[bgView addSubview:btn];
UIButton *sureBtn = [UIButton buttonWithType:UIButtonTypeCustom];
sureBtn.frame = CGRectMake(btn.right, CGRectGetHeight(bgView.frame)- GXFPOpView_TopHeight, CGRectGetWidth(bgView.frame)/2, GXFPOpView_TopHeight);
[sureBtn setTitle:@"确定" forState:UIControlStateNormal];
[sureBtn addTarget:self action:@selector(sureClick) forControlEvents:UIControlEventTouchUpInside];
[sureBtn setTitleColor:GXF_CONTENT_COLOR forState:UIControlStateNormal];
[bgView addSubview:sureBtn];
}
- (void)cancelClick{
}
- (void)sureClick{
}
@end
......@@ -12,7 +12,7 @@
#import "ProductBillCell.h"
#import "PurchaseBillProduct.h"
#define TableHeight 44
#define ShowHeight 110
#define ShowHeight 130
@interface ProductBillViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate,HeaderCellDelegate>
{
......@@ -50,7 +50,7 @@
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.view addSubview:self.tableView];
NSArray *arr = @[@"商品",@"单价",@"包装数量"];
NSArray *arr = @[@"商品",@"单价",@"包装数量",@"已发运"];
HeaderCell *headCell = [[HeaderCell alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 38) withArr:arr withHiddenEdit:self.isHiddenEdit];
[self.view addSubview:headCell];
......
......@@ -9,6 +9,7 @@
#import "PurchaseDetailViewController.h"
#import "ProductBillViewController.h"
#import "PurchaseBillProduct.h"
//#import "RejectView.h"
#define BottomHeight 50
#define LeftMargin 15
#define LeftWidth 100
......@@ -52,6 +53,7 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)UILabel *totalPriceLabel;
@property (nonatomic,strong)UILabel *noteLabel;
//@property (nonatomic,strong)RejectView *rejectView;
@property (nonatomic,strong)NSString *rejectCause;//拒接原因
@end
......@@ -134,7 +136,7 @@ typedef enum : NSUInteger {
_firstBtn.hidden = YES;
[self changeBtnFrame:_secondBtn title:@"确认" originX:LeftMargin width:OneWidth];
_secondBtn.tag = SureTag;
self.indexStyle = 2;
self.indexStyle = 1;
}else{
self.indexStyle = 0;
if ([self checkIsPermission:PURCHASE_PERMISSIONS_FINISH]&&[self checkIsPermission:PURCHASE_PERMISSIONS_ABORT]) {
......@@ -275,7 +277,7 @@ typedef enum : NSUInteger {
}
- (void)createBottomView{
_bottomView= [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + TopMargin, ScreenSize.width, 200)];
_bottomView= [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + TopMargin, ScreenSize.width, 300)];
_bottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_bottomView];
......
......@@ -16,9 +16,11 @@
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *priceLabel;
@property (nonatomic,strong)UILabel *countLabel;
@property (nonatomic,strong)UILabel *shippedQtyLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIView *showView;
@property (nonatomic,strong)UILabel *showNameLabel;
@property (nonatomic,strong)UILabel *showStandLabel;
@property (nonatomic,strong)UILabel *showCountLabel;
@property (nonatomic,strong)UILabel *showBaseCountLabel;
......
......@@ -33,7 +33,7 @@
- (void)bulidLayout
{
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (3 -1))/3;
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (4 -1))/4;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
......@@ -61,18 +61,28 @@
self.countLabel.text = @"200";
self.countLabel.textColor = GXF_CONTENT_COLOR;
self.countLabel.font = GXF_SIXTEENTEH_SIZE;
self.shippedQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.countLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.shippedQtyLabel.textAlignment = NSTextAlignmentCenter;
self.shippedQtyLabel.textColor = GXF_CONTENT_COLOR;
self.shippedQtyLabel.font = GXF_SIXTEENTEH_SIZE;
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
self.showView.clipsToBounds = YES;
self.showStandLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), 0, ShowWidth, ShowHeight))];
self.showNameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), 0, ShowWidth*2, ShowHeight))];
self.showNameLabel.textAlignment = NSTextAlignmentLeft;
self.showNameLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showNameLabel.font = GXF_THREETEENTH_SIZE;
self.showStandLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), CGRectGetMaxY(self.showNameLabel.frame), ShowWidth, ShowHeight))];
self.showStandLabel.textAlignment = NSTextAlignmentLeft;
self.showStandLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showStandLabel.text = @"包装规格:1*12斤";
self.showStandLabel.font = GXF_THREETEENTH_SIZE;
self.showCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showStandLabel.frame), 0, ShowWidth, ShowHeight))];
self.showCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showStandLabel.frame), CGRectGetMaxY(self.showNameLabel.frame), ShowWidth, ShowHeight))];
self.showCountLabel.textAlignment = NSTextAlignmentLeft;
self.showCountLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showCountLabel.text = @"包装数量:10000";
......@@ -123,9 +133,12 @@
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.priceLabel];
[self.contentView addSubview:self.countLabel];
[self.contentView addSubview:self.shippedQtyLabel];
[self.contentView addSubview:self.editBtn];
[self.contentView addSubview:self.showView];
[self.showView addSubview:self.showNameLabel];
[self.showView addSubview:self.showStandLabel];
[self.showView addSubview:self.showCountLabel];
[self.showView addSubview:self.showBaseCountLabel];
......@@ -144,6 +157,9 @@
self.titleLabel.text = billProduct.product_name;
self.priceLabel.text = [NSString stringWithFormat:@"%@元",billProduct.basePrice];
self.countLabel.text = [NSString stringWithFormat:@"%@%@",billProduct.qty,billProduct.unit];
self.shippedQtyLabel.text = [NSString stringWithFormat:@"%@%@",billProduct.shippedBaseQty ? [billProduct.shippedBaseQty stringValue]:@"0",billProduct.unit];
self.showNameLabel.text = [NSString stringWithFormat:@"商品:%@[%@]",billProduct.product_name,billProduct.product_code];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",billProduct.qpc,billProduct.baseUnit];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@%@",billProduct.qty,billProduct.unit];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@%@",billProduct.baseQty,billProduct.baseUnit];
......@@ -181,8 +197,8 @@
[attributeStr1 appendAttributedString:[IBTCommon setTextViewFontOfString:str paragraphStyle:0 fontSize:13 color:[UIColor redColor]]];
self.showShippedFlag.attributedText = attributeStr1;
self.showShippedBaseQty.text = [NSString stringWithFormat:@"发运包装数量:%@",billProduct.shippedBaseQty ? [billProduct.shippedBaseQty stringValue]:@"0"];
self.showShippedQty.text = [NSString stringWithFormat:@"发运基础数量:%@",billProduct.shippedQty ? [billProduct.shippedQty stringValue]:@"0"];
self.showShippedBaseQty.text = [NSString stringWithFormat:@"发运包装数量:%@%@",billProduct.shippedBaseQty ? [billProduct.shippedBaseQty stringValue]:@"0",billProduct.unit];
self.showShippedQty.text = [NSString stringWithFormat:@"发运基础数量:%@%@",billProduct.shippedQty ? [billProduct.shippedQty stringValue]:@"0",billProduct.baseUnit];
[self.showView addSubview:self.showShippedFlag];
[self.showView addSubview:self.showShippedQty];
[self.showView addSubview:self.showShippedBaseQty];
......
......@@ -371,7 +371,7 @@ typedef enum : NSUInteger {
_titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)];
_titleField.textAlignment = NSTextAlignmentRight;
_titleField.textColor = GXF_CONTENT_COLOR;
_titleField.placeholder = @"输入采购通知标题";
_titleField.placeholder = @"输入采购通知标题";
_titleField.font = FontSize(15);
_titleField.returnKeyType = UIReturnKeyDone;
_titleField.delegate = self;
......@@ -432,7 +432,7 @@ typedef enum : NSUInteger {
{
NoticeProduct *noticeProduct=[_shopeArr objectAtIndex:indexPath.row];
Cell.SpLabel.text=noticeProduct.productName;//商品
Cell.shopeName.text=[NSString stringWithFormat:@"%@[%@]",noticeProduct.productName,noticeProduct.productCode];
Cell.BzggLabel.text= [NSString stringWithFormat:@"1*%@%@",noticeProduct.qpc,noticeProduct.baseUnit];//包装规格
Cell.packageUnit.text=noticeProduct.packUnit;//包装单位
Cell.BzslLabel.text=[NSString stringWithFormat:@"%@%@",noticeProduct.qpcQuantity,noticeProduct.packUnit];//包装数量
......
......@@ -391,7 +391,7 @@ typedef enum : NSUInteger {
if ([purchaseNotice.state isEqualToString:PURCHASENOTICE_STATE_INITIAL]) {
NewPurchaseNoticeViewController *nvc = [NewPurchaseNoticeViewController new];
nvc.purchaseNotice = purchaseNotice;
nvc.title = @"修改采购单通知";
nvc.title = @"修改采购单通知";
[self PushViewController:nvc animated:YES];
}else{
SeePurchaseNoticeViewController *pvc = [SeePurchaseNoticeViewController new];
......
......@@ -496,7 +496,7 @@ typedef enum : NSUInteger {
{
NoticeProduct *noticeProduct=[_shopeArr objectAtIndex:indexPath.row];
Cell.SpLabel.text=noticeProduct.productName;//商品
Cell.shopeName.text=[NSString stringWithFormat:@"%@[%@]",noticeProduct.productName,noticeProduct.productCode];
Cell.BzggLabel.text= [NSString stringWithFormat:@"1*%@%@",noticeProduct.qpc,noticeProduct.baseUnit];//包装规格
Cell.packageUnit.text=noticeProduct.packUnit;//包装单位
Cell.BzslLabel.text=[NSString stringWithFormat:@"%@%@",noticeProduct.qpcQuantity,noticeProduct.packUnit];//包装数量
......
......@@ -21,6 +21,7 @@
@property (nonatomic, assign) BOOL isSelected;
@property (nonatomic,strong)UIButton *button;
@property (nonatomic,assign)BOOL isButtonhidden;
@property (nonatomic,strong)UILabel *shopeName;//商品
@property (nonatomic,strong)UILabel *packageSpecification;//包装规格
@property (nonatomic,strong)UILabel *packageQuantity;//包装数量
@property (nonatomic,strong)UILabel *packageUnit;//包装单位
......
......@@ -28,6 +28,7 @@
}
-(void)initdata
{
self.shopeName=[[UILabel alloc]init];//商品
self.packageSpecification=[[UILabel alloc]init];//包装规格
self.packageQuantity=[[UILabel alloc]init];;//包装数量
self.packageUnit=[[UILabel alloc]init]; ;//包装单位
......@@ -42,6 +43,10 @@
- (void)bulidLayout
{
CGFloat gipWidth = (ScreenSize.width-(LeftMargin+20)-RightWidth-2)/4;
self.shopeName.textAlignment= NSTextAlignmentLeft;
self.shopeName.textColor = GXF_PLACEHOLDER_COLOR;
self.shopeName.font = FontSize(TitleSize-2);
self.HeardLabel=[[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin * 2, 1))];
self.HeardLabel.backgroundColor = HexColor(@"e5e5e5");
......@@ -86,12 +91,18 @@
NSArray*array=[NSArray arrayWithObjects:@"包装规格:",@"基础数量:" ,@"备注:",nil];
NSArray*array1=[NSArray arrayWithObjects:@"包装数量:",@"包装单位:" ,nil];
UILabel *shopeNameLable=[[UILabel alloc]init];
shopeNameLable.frame=CGRectMake(LeftWidth, 0, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4);
shopeNameLable.text=@"商品:";
shopeNameLable.font=FontSize(TitleSize-2);
[shopeNameLable setTextColor:GXF_PLACEHOLDER_COLOR];
[self.subSview addSubview:shopeNameLable];
self.shopeName.frame=CGRectMake(shopeNameLable.frame.origin.x+shopeNameLable.frame.size.width, shopeNameLable.frame.origin.y,(self.contentView.width-2*LeftMargin)/4*3, TableHeight*2/4);
[self.subSview addSubview:self.shopeName];
for (int i=0; i<array.count; i++) {
UILabel *lable=[[UILabel alloc]init];
// if (i==0) {
lable.frame=CGRectMake(LeftWidth, i*TableHeight*2/4, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4);
lable.frame=CGRectMake(LeftWidth, i*TableHeight*2/4+TableHeight/2, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4);
// }
lable.text=[array objectAtIndex:i];
lable.font=FontSize(TitleSize-2);
......@@ -111,7 +122,7 @@
[self.subSview addSubview:shopeLable];
}
for (int i=0; i<array1.count; i++) {
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(LeftWidth+(self.contentView.width-2*LeftMargin)/2, i*TableHeight*2/4, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4)];
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(LeftWidth+(self.contentView.width-2*LeftMargin)/2, i*TableHeight*2/4+TableHeight/2, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4)];
lable.text=[array1 objectAtIndex:i];
lable.font=FontSize(TitleSize-2);
......
......@@ -186,6 +186,7 @@ typedef enum : NSUInteger {
cell = [[SurveyCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.titleLabel.width = 120;
if (indexPath.row == 0 || indexPath.row == 1) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
......@@ -197,7 +198,7 @@ typedef enum : NSUInteger {
- (void)createViewInCell:(SurveyCell *)cell indexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 0 || indexPath.row == 1) {
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableRowHeight))];
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(cell.titleLabel.right, 0, ScreenSize.width - cell.titleLabel.width - LeftMargin*2-15, TableRowHeight))];
contentLabel.textAlignment= NSTextAlignmentRight;
contentLabel.textColor = GXF_PLACEHOLDER_COLOR;
contentLabel.font = GXF_FIFTEENTEN_SIZE;
......@@ -211,7 +212,7 @@ typedef enum : NSUInteger {
_choosePackUnitLabel = contentLabel;
}
}else if (indexPath.row == _dataArr.count -1){
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableRowHeight)];
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(cell.titleLabel.right, 0, ScreenSize.width - cell.titleLabel.width - LeftMargin*2-15, TableRowHeight)];
_noteTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
_noteTextView.minNumberOfLines = 1;
_noteTextView.maxNumberOfLines = 4;
......@@ -227,13 +228,14 @@ typedef enum : NSUInteger {
lineFrame.origin.y = TableRowHeight*2-1;
cell.lineLabel.frame = lineFrame;
}else{
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-30, TableRowHeight)];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake( cell.titleLabel.right, 0, ScreenSize.width - cell.titleLabel.width - LeftMargin*2-30, TableRowHeight)];
textField.textAlignment = NSTextAlignmentRight;
textField.textColor = GXF_CONTENT_COLOR;
textField.font = GXF_FIFTEENTEN_SIZE;
textField.returnKeyType = UIReturnKeyDone;
textField.keyboardType = UIKeyboardTypeDecimalPad;
textField.delegate = self;
[textField addTarget:self action:@selector(textEditClick:) forControlEvents:UIControlEventAllEditingEvents];
[cell.contentView addSubview:textField];
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(textField.frame)+ 5, 0, 20, TableRowHeight)];
......@@ -243,7 +245,7 @@ typedef enum : NSUInteger {
if (indexPath.row == 2) {
_qpcLabel = label;
UILabel *labelTwo = [[UILabel alloc]initWithFrame:CGRectMake(100+LeftMargin, 0, 50, TableRowHeight)];
UILabel *labelTwo = [[UILabel alloc]initWithFrame:CGRectMake(cell.titleLabel.right, 0, 50, TableRowHeight)];
labelTwo.text = @"1*";
labelTwo.textAlignment = NSTextAlignmentRight;
[cell.contentView addSubview:labelTwo];
......@@ -266,6 +268,33 @@ typedef enum : NSUInteger {
[self prepareDataIncell];
}
}
//【基础数量】=包装规格*包装数量
- (void)textEditClick:(UITextField *)textField{
if (textField == _qpcField) {//包装规格
if (_qpcQuantityField.text.length > 0) {//包装数量
//计算基础数量
float baseCount = [_qpcField.text floatValue] * [_qpcQuantityField.text floatValue];
_quantityField.text = [NSString stringWithFormat:@"%.0f",baseCount];
}
}else if (textField == _qpcQuantityField) {//包装数量
if (_qpcField.text.length > 0) {//包装规格
//计算基础数量
float baseCount = [_qpcField.text floatValue] * [_qpcQuantityField.text floatValue];
_quantityField.text = [NSString stringWithFormat:@"%.0f",baseCount];
}
}else if (textField == _quantityField) {//基础数量
if (_qpcField.text.length > 0) {//包装规格
//计算包装数量
if ([_qpcField.text integerValue] > 0) {
float packCount = [_quantityField.text floatValue] / [_qpcField.text floatValue];
_qpcQuantityField.text = [NSString stringWithFormat:@"%.0f",packCount];
}
}
}
}
- (void)prepareDataIncell{
_chooseCostLabel.text = [NSString stringWithFormat:@"%@[%@]",self.noticeProduct.productName,self.noticeProduct.productCode];
self.productUuidStr = self.noticeProduct.productUuid;
......@@ -286,6 +315,7 @@ typedef enum : NSUInteger {
_quantityField.text = [self.noticeProduct.quantity stringValue];
_noteTextView.text = self.noticeProduct.remark;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row == _dataArr.count - 1) {
return TableRowHeight *2;
......
......@@ -20,6 +20,7 @@
@property (nonatomic, assign) BOOL isSelected;
@property (nonatomic,strong)UIButton *button;
@property (nonatomic,assign)BOOL isButtonhidden;
@property (nonatomic,strong)UILabel *shopeName;//商品
@property (nonatomic,strong)UILabel *packageSpecification;//包装规格
@property (nonatomic,strong)UILabel *packageQuantity;//包装数量
@property (nonatomic,strong)UILabel *packageUnit;//包装单位
......
......@@ -28,6 +28,7 @@
}
-(void)initdata
{
self.shopeName=[[UILabel alloc]init];//商品
self.packageSpecification=[[UILabel alloc]init];//包装规格
self.packageQuantity=[[UILabel alloc]init];;//包装数量
self.packageUnit=[[UILabel alloc]init]; ;//包装单位
......@@ -42,6 +43,9 @@
- (void)bulidLayout
{
CGFloat gipWidth = (ScreenSize.width-(LeftMargin+20)-RightWidth-2)/3;
self.shopeName.textAlignment= NSTextAlignmentLeft;
self.shopeName.textColor = GXF_PLACEHOLDER_COLOR;
self.shopeName.font = FontSize(TitleSize-2);
self.HeardLabel=[[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin * 2, 1))];
self.HeardLabel.backgroundColor = HexColor(@"e5e5e5");
self.HeardLabel.font = FontSize(TitleSize);
......@@ -81,12 +85,19 @@
NSArray*array=[NSArray arrayWithObjects:@"包装规格:",@"基础数量:" ,@"备注:",nil];
NSArray*array1=[NSArray arrayWithObjects:@"包装数量:",@"包装单位:" ,nil];
UILabel *shopeNameLable=[[UILabel alloc]init];
shopeNameLable.frame=CGRectMake(LeftWidth, 0, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4);
shopeNameLable.text=@"商品:";
shopeNameLable.font=FontSize(TitleSize-2);
[shopeNameLable setTextColor:GXF_PLACEHOLDER_COLOR];
[self.subSview addSubview:shopeNameLable];
self.shopeName.frame=CGRectMake(shopeNameLable.frame.origin.x+shopeNameLable.frame.size.width, shopeNameLable.frame.origin.y,(self.contentView.width-2*LeftMargin)/4*3, TableHeight*2/4);
[self.subSview addSubview:self.shopeName];
for (int i=0; i<array.count; i++) {
UILabel *lable=[[UILabel alloc]init];
// if (i==0) {
lable.frame=CGRectMake(LeftWidth, i*TableHeight*2/4, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4);
lable.frame=CGRectMake(LeftWidth, i*TableHeight*2/4+TableHeight/2, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4);
// }
lable.text=[array objectAtIndex:i];
lable.font=FontSize(TitleSize-2);
......@@ -106,7 +117,7 @@
[self.subSview addSubview:shopeLable];
}
for (int i=0; i<array1.count; i++) {
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(LeftWidth+(self.contentView.width-2*LeftMargin)/2, i*TableHeight*2/4, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4)];
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(LeftWidth+(self.contentView.width-2*LeftMargin)/2, i*TableHeight*2/4+TableHeight/2, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4)];
lable.text=[array1 objectAtIndex:i];
lable.font=FontSize(TitleSize-2);
......
......@@ -471,10 +471,10 @@ typedef enum : NSUInteger {
if (foundationUnitPrice.text.length > 0) {
if (foundationQuantity.text.length > 0) {
float totalPrice = [foundationUnitPrice.text floatValue] * [foundationQuantity.text floatValue];
totalMoney.text = [NSString stringWithFormat:@"%.1f",totalPrice];
totalMoney.text = [NSString stringWithFormat:@"%.2f",totalPrice];
if (packageQuantity.text.length > 0 && [packageQuantity.text integerValue] > 0) {
float packagePrice = totalPrice / [packageQuantity.text floatValue];
packageUnitPrice.text = [NSString stringWithFormat:@"%.1f",packagePrice];
packageUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice];
}
}
}
......@@ -484,10 +484,10 @@ typedef enum : NSUInteger {
if (packageUnitPrice.text.length > 0) {
if (packageQuantity.text.length > 0) {
float totalPrice = [packageUnitPrice.text floatValue] * [packageQuantity.text floatValue];
totalMoney.text = [NSString stringWithFormat:@"%.1f",totalPrice];
totalMoney.text = [NSString stringWithFormat:@"%.2f",totalPrice];
if (foundationQuantity.text.length > 0 && [foundationQuantity.text integerValue] > 0) {
float packagePrice = totalPrice / [foundationQuantity.text floatValue];
foundationUnitPrice.text = [NSString stringWithFormat:@"%.1f",packagePrice];
foundationUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice];
}
}
}
......@@ -497,11 +497,11 @@ typedef enum : NSUInteger {
if (totalMoney.text.length > 0) {
if (packageQuantity.text.length > 0 && [packageQuantity.text floatValue] > 0) {
float packagePrice = [totalMoney.text floatValue] / [packageQuantity.text floatValue];
packageUnitPrice.text = [NSString stringWithFormat:@"%.1f",packagePrice];
packageUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice];
}
if (foundationQuantity.text.length > 0 && [foundationQuantity.text floatValue] > 0) {
float packagePrice = [totalMoney.text floatValue] / [foundationQuantity.text floatValue];
foundationUnitPrice.text = [NSString stringWithFormat:@"%.1f",packagePrice];
foundationUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice];
}
}
}
......
......@@ -255,7 +255,7 @@
baseCount = total / [self.noticeProduct.price floatValue];
}
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%.1f",total];
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%.2f",total];
_shBaseQuantityField.text = [NSString stringWithFormat:@"%.0f",baseCount];
}
}
......
......@@ -14,7 +14,6 @@
#import "ReceiveBoltView.h"
#import "MJRefresh.h"
#import "NewReceiveViewController.h"
//#import "ReceiveDetailViewController.h"
#define TopMargin 44
#define TableHeight 140
#define LeftMargin 20
......
......@@ -82,8 +82,9 @@
billNumberObject = self.contentStr;
}
NSDictionary *dict = @{
@"state":TRANSPORT_STATE_UNRECEIVED,
@"state":TRANSPORT_STATE_RECEIVED,
@"userCode":userUtil.userCode,
@"billNumberLike":billNumberObject,
@"fetchParts":@"pdtDetails",
@"pageNumber":@(_currentPage),
@"pageSize":@(20)
......
......@@ -268,6 +268,12 @@ typedef enum : NSUInteger {
return NO;
}
}
// 校验手机号码
if (![RegexUtil isValidatePhone:_sheetView.carphone] || ![RegexUtil isValidatePhoneNew:_sheetView.carphone]){
ShowMessage(@"手机号格式不正确");
return NO;
}
return YES;
}
......
......@@ -15,7 +15,7 @@
#import "GXFPopView.h"
#define TableHeight 44
#define ShowHeight 110
#define ShowHeight 130
@interface TransferProductViewController ()
<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate,HeaderCellDelegate,GXFPopViewDelegate>
......
......@@ -19,6 +19,7 @@
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIView *showView;
@property (nonatomic,strong)UILabel *showNameLabel;
@property (nonatomic,strong)UILabel *showStandLabel;
@property (nonatomic,strong)UILabel *showCountLabel;
@property (nonatomic,strong)UILabel *showBaseCountLabel;
......
......@@ -61,12 +61,17 @@
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
self.showView.clipsToBounds = YES;
self.showStandLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), 0, ShowWidth, ShowHeight))];
self.showNameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), 0, ShowWidth*2, ShowHeight))];
self.showNameLabel.textAlignment = NSTextAlignmentLeft;
self.showNameLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showNameLabel.font = GXF_THREETEENTH_SIZE;
self.showStandLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), CGRectGetMaxY(self.showNameLabel.frame), ShowWidth, ShowHeight))];
self.showStandLabel.textAlignment = NSTextAlignmentLeft;
self.showStandLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showStandLabel.font = GXF_THREETEENTH_SIZE;
self.showCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showStandLabel.frame), 0, ShowWidth, ShowHeight))];
self.showCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showStandLabel.frame), CGRectGetMaxY(self.showNameLabel.frame), ShowWidth, ShowHeight))];
self.showCountLabel.textAlignment = NSTextAlignmentLeft;
self.showCountLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showCountLabel.font = GXF_THREETEENTH_SIZE;
......@@ -121,6 +126,7 @@
[self.contentView addSubview:self.editBtn];
[self.contentView addSubview:self.showView];
[self.showView addSubview:self.showNameLabel];
[self.showView addSubview:self.showStandLabel];
[self.showView addSubview:self.showCountLabel];
[self.showView addSubview:self.showBaseCountLabel];
......@@ -140,6 +146,7 @@
self.titleLabel.text = pdtDetail.productName;
self.priceLabel.text = [NSString stringWithFormat:@"%@元",[pdtDetail.price stringValue]];
self.countLabel.text = [NSString stringWithFormat:@"%@%@",pdtDetail.qty,pdtDetail.unit];
self.showNameLabel.text = [NSString stringWithFormat:@"商品:%@[%@]",pdtDetail.productName,pdtDetail.productCode];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",pdtDetail.qpc,pdtDetail.baseUnit];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@%@",pdtDetail.qty,pdtDetail.unit];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@%@",pdtDetail.baseQty,pdtDetail.baseUnit];
......
......@@ -236,7 +236,7 @@ typedef enum : NSUInteger {
}
- (void)textChange:(UITextField *)textField{
if (_actualmoneyField.text.length > 0 && _paidmoneyField.text.length > 0 ) {
_leftmoneyField.text = [NSString stringWithFormat:@"%.1f",[_actualmoneyField.text floatValue] - [_paidmoneyField.text floatValue]];
_leftmoneyField.text = [NSString stringWithFormat:@"%.2f",[_actualmoneyField.text floatValue] - [_paidmoneyField.text floatValue]];
}
}
......@@ -249,8 +249,8 @@ typedef enum : NSUInteger {
ChooseCostViewController *cvc = [ChooseCostViewController new];
cvc.choseBaseInfo = ^(NSArray *costs){
if (costs.count > 0) {
NSString *type = costs[0];
_chooseCostLabel.text = type;
Accounttitle *type = costs[0];
_chooseCostLabel.text = type.name;
_chooseCostLabel.textColor = GXF_CONTENT_COLOR;
}
};
......
......@@ -32,6 +32,7 @@ typedef enum : NSUInteger {
id uuidObject;
id billNumberObject;
NSNumber *versionObject;
id stateObject;
}
@property (nonatomic,strong)NSString *state;
......@@ -58,6 +59,7 @@ typedef enum : NSUInteger {
uuidObject = [NSNull null];
billNumberObject = [NSNull null];
versionObject = [NSNumber numberWithInteger:0];
stateObject = [NSNull null];
if (self.transport) {
[self getDataFromServer];
}
......@@ -185,6 +187,11 @@ typedef enum : NSUInteger {
if (self.transport.billnumber > 0 && billNumberObject == [NSNull null]) {
billNumberObject = self.transport.billnumber;
}
if (self.transport.state > 0 && stateObject == [NSNull null]) {
stateObject = self.transport.state;
}else{
stateObject = state;
}
if (self.transport && [versionObject integerValue] == 0) {
versionObject = self.transport.version;
}
......@@ -202,7 +209,7 @@ typedef enum : NSUInteger {
@"version":versionObject,
@"billnumber":billNumberObject,
@"enterprise":[ICRUserUtil sharedInstance].orgId,
@"state":state,
@"state":stateObject,
@"warehouseUuid":[IBTCommon checkString:_sheetView.warehouseUuid],
@"warehouseCode":[IBTCommon checkString:_sheetView.warehouseCode],
@"warehouseName":[IBTCommon checkString:_sheetView.warehouseName],
......@@ -216,7 +223,12 @@ typedef enum : NSUInteger {
@"pdtDetails":billProducts,
@"accountDetails":costs};
[IBTLoadingView showProgressLabel:msg];
[[ICRHTTPController sharedController] saveTransportWithData:dict success:succ failure:fail];
if ([state isEqualToString:TRANSFER_STATE_INITIAL]) {
[[ICRHTTPController sharedController] saveTransportWithData:dict success:succ failure:fail];
}else{
[[ICRHTTPController sharedController] saveAndSubmitTransportWithData:dict success:succ failure:fail];
}
}
......@@ -255,6 +267,7 @@ typedef enum : NSUInteger {
ShowMessage(@"费用不能为空");
return NO;
}
for (TransportPdtDetail *billProduct in _bottomView.productVC.transportProductArr) {
if ([billProduct.qty integerValue] <= 0 || [billProduct.baseQty integerValue] <= 0) {
ShowMessage(@"有数量等于0的商品明细,请编辑后保存");
......@@ -265,8 +278,12 @@ typedef enum : NSUInteger {
return NO;
}
}
// 校验手机号码
if (![RegexUtil isValidatePhone:_sheetView.carphone] || ![RegexUtil isValidatePhoneNew:_sheetView.carphone]){
ShowMessage(@"手机号格式不正确");
return NO;
}
return YES;
}
......@@ -376,8 +393,8 @@ typedef enum : NSUInteger {
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1) {
//提交
self.state = TRANSPORT_STATE_UNRECEIVED;
[self getDataFromServer:TRANSPORT_STATE_UNRECEIVED msg:@"正在提交..."];
self.state = TRANSPORT_STATE_RECEIVED;
[self getDataFromServer:TRANSPORT_STATE_RECEIVED msg:@"正在提交..."];
}
}
......
......@@ -201,7 +201,13 @@ typedef enum : NSUInteger {
[[ICRHTTPController sharedController] endTransportWithTransportUuid:self.transport.uuid version:self.transport.version success:succ failure:fail];
}
}
- (void)hiddenAllBtn{
_firstBtn.hidden = YES;
_secondBtn.hidden = YES;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
}
#pragma mark - 视图初始化
- (void)bulifLayout{
......@@ -217,12 +223,16 @@ typedef enum : NSUInteger {
_secondBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(CGRectGetMaxX(_firstBtn.frame)+ LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40) target:self sel:@selector(btnClick:) tag:EndTag image:nil title:@"结束" titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR];
[self.view addSubview:_secondBtn];
if ([self.transport.state isEqualToString:TRANSPORT_STATE_RECEIVED] || [self.transport.state isEqualToString:TRANSPORT_STATE_ABORTED]) {
_firstBtn.hidden = YES;
_secondBtn.hidden = YES;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
if ([self.transport.state isEqualToString:TRANSPORT_STATE_ABORTED]) {
[self hiddenAllBtn];
}else if([self.transport.state isEqualToString:TRANSPORT_STATE_FINISHED]){
if ([IBTCommon checkIsPermission:TRANSPORT_ACTION_ABORT]) {
_secondBtn.hidden = YES;
_firstBtn.hidden = NO;
_firstBtn.width = ScreenSize.width - LeftMargin*2;
}else{
[self hiddenAllBtn];
}
}else{
if ([IBTCommon checkIsPermission:TRANSPORT_ACTION_ABORT] && [IBTCommon checkIsPermission:TRANSPORT_ACTION_FINISH]) {
_secondBtn.hidden = NO;
......@@ -238,16 +248,10 @@ typedef enum : NSUInteger {
_firstBtn.hidden = YES;
_secondBtn.frame = CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin*2, 40);
}else{
_firstBtn.hidden = YES;
_secondBtn.hidden = YES;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
[self hiddenAllBtn];
}
}
}
NSArray *leftArr = @[@"单号:",@"采购单:",@"状态:",@"发货仓库:",@"收货仓库:",@"车辆:",@"司机电话:",@"创建:",@"备注"];
_transportView= [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, LeftHeight*leftArr.count +LeftMargin)];
......@@ -290,6 +294,7 @@ typedef enum : NSUInteger {
}
[self createBottomView];
}
- (void)createBottomView{
_bottomView= [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_transportView.frame) + TopMargin, ScreenSize.width, 300)];
_bottomView.backgroundColor = [UIColor whiteColor];
......
......@@ -137,7 +137,7 @@
detail.productName = arrDict[@"product_name"];
detail.price = arrDict[@"basePrice"];
detail.packprice = arrDict[@"price"];
detail.note = arrDict[@"remark"];
detail.note = arrDict[@"remark"] != [NSNull null] ? arrDict[@"remark"] : @"无";
[transArr addObject:detail];
}
return transArr;
......
//
// Accounttitle.h
// XFFruit
//
// Created by 陈俊俊 on 15/10/26.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface Accounttitle : IBTModel
@property (nonatomic, strong) NSString *uuid;//唯一标识
@property (nonatomic, strong) NSString *name;//名称
@property (nonatomic, assign) BOOL enabled;//是否启用
@end
//
// Accounttitle.m
// XFFruit
//
// Created by 陈俊俊 on 15/10/26.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "Accounttitle.h"
@implementation Accounttitle
@end
......@@ -87,6 +87,9 @@
stateStr = @"已作废";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
}else if ([transport.state isEqualToString:TRANSPORT_STATE_FINISHED]) {
stateStr = @"已完成";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
}
[self.stateBtn setTitle:stateStr forState:UIControlStateNormal];
}
......
......@@ -18,6 +18,7 @@
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIView *showView;
@property (nonatomic,strong)UILabel *showNameLabel;
@property (nonatomic,strong)UILabel *showStandLabel;
@property (nonatomic,strong)UILabel *showCountLabel;
@property (nonatomic,strong)UILabel *showBaseCountLabel;
......
......@@ -67,13 +67,19 @@
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
self.showView.clipsToBounds = YES;
self.showStandLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), 0, ShowWidth, ShowHeight))];
self.showNameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), 0, ShowWidth*2, ShowHeight))];
self.showNameLabel.textAlignment = NSTextAlignmentLeft;
self.showNameLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showNameLabel.font = GXF_THREETEENTH_SIZE;
self.showStandLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), CGRectGetMaxY(self.showNameLabel.frame), ShowWidth, ShowHeight))];
self.showStandLabel.textAlignment = NSTextAlignmentLeft;
self.showStandLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showStandLabel.text = @"包装规格:1*12斤";
self.showStandLabel.font = GXF_THREETEENTH_SIZE;
self.showCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showStandLabel.frame), 0, ShowWidth, ShowHeight))];
self.showCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showStandLabel.frame), CGRectGetMaxY(self.showNameLabel.frame), ShowWidth, ShowHeight))];
self.showCountLabel.textAlignment = NSTextAlignmentLeft;
self.showCountLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showCountLabel.text = @"包装数量:10000";
......@@ -128,6 +134,7 @@
[self.contentView addSubview:self.editBtn];
[self.contentView addSubview:self.showView];
[self.showView addSubview:self.showNameLabel];
[self.showView addSubview:self.showStandLabel];
[self.showView addSubview:self.showCountLabel];
[self.showView addSubview:self.showBaseCountLabel];
......@@ -145,6 +152,7 @@
self.titleLabel.text = pdtDetail.productName;
self.priceLabel.text = [NSString stringWithFormat:@"%@元",[pdtDetail.price stringValue]];
self.countLabel.text = [NSString stringWithFormat:@"%@%@",pdtDetail.qty,pdtDetail.unit];
self.showNameLabel.text = [NSString stringWithFormat:@"商品:%@[%@]",pdtDetail.productName,pdtDetail.productCode];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",pdtDetail.qpc,pdtDetail.baseUnit];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@%@",pdtDetail.qty,pdtDetail.unit];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@%@",pdtDetail.baseQty,pdtDetail.baseUnit];
......
......@@ -43,7 +43,7 @@
"Survey" = "查看行情调研";
"Survey1" = "填写行情反馈";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey3" = "查看采购通知";
"Survey4" = "新建采购单";
"Survey5" = "查看采购单";
"Survey6" = "审核采购单";
......@@ -201,8 +201,8 @@
"AddSurvey" = "新建行情调研";
"Survey" = "查看行情调研";
"Survey1" = "填写行情反馈";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey4" = "新建采购单";
"Survey5" = "查看采购单";
"Survey6" = "审核采购单";
......
......@@ -188,8 +188,8 @@
"AddSurvey" = "新建行情调研";
"Survey" = "查看行情调研";
"Survey1" = "填写行情反馈";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey4" = "新建采购单";
"Survey5" = "查看采购单";
"Survey6" = "审核采购单";
......
......@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>Xummer.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>com.cntaiping.life.XFFruit</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
......
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