Commit d7b136f4 authored by 勾芒's avatar 勾芒

曹云霄

parent ebd70446
...@@ -22,15 +22,15 @@ ...@@ -22,15 +22,15 @@
{ {
_goodsAllprice = goodsAllprice; _goodsAllprice = goodsAllprice;
NSUInteger allNumber; NSUInteger allNumber = 0;
NSInteger allPrice; NSInteger allPrice = 0;
for (ShopcarModel *model in _goodsAllprice) { for (ShopcarModel *model in _goodsAllprice) {
allNumber += model.goodsNum; allNumber += model.goodsNum;
allPrice += [model.goods.costPrice integerValue]; allPrice += [model.goods.costPrice integerValue];
} }
self.goodsAllNumber.text = [NSString stringWithFormat:@"%ld",allNumber]; self.goodsAllNumber.text = [NSString stringWithFormat:@"%ld",allNumber];
self.goodsAllPrice.text = [NSString stringWithFormat:@"%ld",allPrice]; self.goodsAllPrice.text = [NSString stringWithFormat:@"%ld",allPrice*allNumber];
} }
......
...@@ -136,11 +136,11 @@ ...@@ -136,11 +136,11 @@
self.searchPersonInformationField.delegate = self; self.searchPersonInformationField.delegate = self;
//监听键盘落下的通知 //监听键盘落下的通知
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(KeyboadrDismiss) name:UIKeyboardWillHideNotification object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(KeyboadrDismiss) name:UIKeyboardWillHideNotification object:nil];
} }
#pragma mark -获取导购关联客户 #pragma mark -获取导购关联客户
- (void)getShoppersAssociatedCustomer:(ConsumerQueryCondition *)condition isRemoveArray:(BOOL)remove - (void)getShoppersAssociatedCustomer:(ConsumerQueryCondition *)condition isRemoveArray:(BOOL)remove
{ {
...@@ -267,13 +267,18 @@ ...@@ -267,13 +267,18 @@
[Customermanager manager].customerID = model.fid; [Customermanager manager].customerID = model.fid;
[Customermanager manager].customerName = model.name; [Customermanager manager].customerName = model.name;
[Customermanager manager].customerPhoneNumber = model.mobile; [Customermanager manager].customerPhoneNumber = model.mobile;
[Customermanager manager].companyAddress = model.address; [Customermanager manager].companyName = model.address;
[Customermanager manager].cutomerAddress = model.address; [Customermanager manager].cutomerAddress = model.address;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal]; [self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO; self.changePersonInformationButton.hidden = NO;
[self SetupUserShoppingCarNumberRequest]; [self SetupUserShoppingCarNumberRequest];
[self SetupUserRequest]; [self SetupUserRequest];
[self ChangeCustomerName]; [self ChangeCustomerName];
self.customerNameField.enabled = NO;
self.customerAddress.enabled = NO;
self.phoneNumberField.enabled = NO;
self.companyNameField.enabled = NO;
} }
...@@ -311,13 +316,11 @@ ...@@ -311,13 +316,11 @@
} }
#pragma mark -添加客户信息、或者退出当前客户 #pragma mark -添加客户信息、或者退出当前客户
- (IBAction)addCustomerInformationORExit:(UIButton *)sender { - (IBAction)addCustomerInformationORExit:(UIButton *)sender {
if ([sender.currentTitle isEqualToString:@"退出当前客户"]) { if ([sender.currentTitle isEqualToString:@"退出当前客户"]) {
[[NSNotificationCenter defaultCenter]postNotificationName:REFRESHSHOPPINGCAR object:@(0)];
self.customerNameField.text = nil; self.customerNameField.text = nil;
self.customerAddress.text = nil; self.customerAddress.text = nil;
self.phoneNumberField.text = nil; self.phoneNumberField.text = nil;
...@@ -329,8 +332,13 @@ ...@@ -329,8 +332,13 @@
self.changePersonInformationButton.hidden = YES; self.changePersonInformationButton.hidden = YES;
[Shoppersmanager manager].currentCustomer = NO; [Shoppersmanager manager].currentCustomer = NO;
[Customermanager manager].customerID = nil; [Customermanager manager].customerID = nil;
[Customermanager manager].customerName = nil;
[Customermanager manager].customerPhoneNumber = nil;
[Customermanager manager].companyName = nil;
[Customermanager manager].cutomerAddress = nil;
[self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal]; [self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
[self ChangeCustomerName];
[self QueryShoppingCarNumber];
//全部为为选中状态 //全部为为选中状态
for (InformationTableViewCell *cell in self.informationTableview.visibleCells) { for (InformationTableViewCell *cell in self.informationTableview.visibleCells) {
...@@ -344,6 +352,7 @@ ...@@ -344,6 +352,7 @@
return; return;
} }
[self addCustomerInformation:NO]; [self addCustomerInformation:NO];
} }
...@@ -386,6 +395,8 @@ ...@@ -386,6 +395,8 @@
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
//进入刷新状态
[self.informationTableview.mj_header beginRefreshing];
//新增保存ID //新增保存ID
if (!isChange) { if (!isChange) {
[Customermanager manager].customerID = returnValue[@"data"]; [Customermanager manager].customerID = returnValue[@"data"];
...@@ -398,7 +409,7 @@ ...@@ -398,7 +409,7 @@
//保存客户信息 //保存客户信息
[Customermanager manager].customerName = customerEntity.name; [Customermanager manager].customerName = customerEntity.name;
[Customermanager manager].customerPhoneNumber = customerEntity.mobile; [Customermanager manager].customerPhoneNumber = customerEntity.mobile;
[Customermanager manager].companyAddress = customerEntity.address; [Customermanager manager].companyName = customerEntity.address;
[Customermanager manager].cutomerAddress = customerEntity.address; [Customermanager manager].cutomerAddress = customerEntity.address;
[Shoppersmanager manager].currentCustomer = YES; [Shoppersmanager manager].currentCustomer = YES;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal]; [self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
...@@ -504,7 +515,7 @@ ...@@ -504,7 +515,7 @@
#pragma mark -键盘落下,判断更改信息按钮是否可见,可见则取消输入框的响应 #pragma mark -键盘落下,判断更改信息按钮是否可见,可见则取消输入框的响应
- (void)KeyboadrDismiss - (void)KeyboadrDismiss
{ {
if (!self.changePersonInformationButton.selected) { if (!self.changePersonInformationButton.hidden) {
self.customerNameField.enabled = NO; self.customerNameField.enabled = NO;
self.customerAddress.enabled = NO; self.customerAddress.enabled = NO;
......
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
_model = model; _model = model;
[self.goodsHeader sd_setImageWithURL:[NSURL URLWithString:_model.goods.pictures] placeholderImage:ReplaceImage]; [self.goodsHeader sd_setImageWithURL:[NSURL URLWithString:_model.goods.pictures] placeholderImage:ReplaceImage];
self.goodsName.text = _model.goods.name; self.goodsName.text = _model.goods.name;
self.goodsNumber.text = [NSString stringWithFormat:@"数量 X%@",_model.goods.number]; self.goodsNumber.text = [NSString stringWithFormat:@"数量 X%d",_model.goodsNum];
self.clinchPrice.text = [NSString stringWithFormat:@"成交价 ¥%@",[_model.goods.costPrice stringValue]]; self.clinchPrice.text = [NSString stringWithFormat:@"成交价 ¥%@",[_model.goods.costPrice stringValue]];
//计算总价格 //计算总价格
NSInteger number = [_model.goods.number integerValue]; NSInteger number = _model.goodsNum;
NSInteger price = [_model.goods.costPrice integerValue]; NSInteger price = [_model.goods.costPrice integerValue];
NSInteger allPrice = number*price; NSInteger allPrice = number*price;
self.totalPrice.text = [NSString stringWithFormat:@"%ld",allPrice]; self.totalPrice.text = [NSString stringWithFormat:@"%ld",allPrice];
......
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
break; break;
case 1: case 1:
{ {
return 135; return 110;
} }
break; break;
case 2: case 2:
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
self.customerName.text = [Customermanager manager].customerName; self.customerName.text = [Customermanager manager].customerName;
self.companyName.text = [Customermanager manager].customerName; self.companyName.text = [Customermanager manager].customerName;
// self.emailName.text = [Customermanager manager] // self.emailName.text = [Customermanager manager]
self.companyLocation.text = [Customermanager manager].companyAddress; self.companyLocation.text = [Customermanager manager].companyName;
self.customerPhoneNumber.text = [Customermanager manager].customerPhoneNumber; self.customerPhoneNumber.text = [Customermanager manager].customerPhoneNumber;
} }
......
...@@ -16,6 +16,17 @@ ...@@ -16,6 +16,17 @@
* 城市选择器 * 城市选择器
*/ */
@property (nonatomic,strong) ModifyShippingAddressView *citySelecteview; @property (nonatomic,strong) ModifyShippingAddressView *citySelecteview;
/**
* 选中省
*/
@property (nonatomic,copy) NSString *provincesString;
/**
* 选中城市
*/
@property (nonatomic,copy) NSString *cityString;
@end @end
@implementation AddressViewController @implementation AddressViewController
...@@ -123,13 +134,15 @@ ...@@ -123,13 +134,15 @@
#pragma mark 完成城市选择后 #pragma mark 完成城市选择后
- (void)citySelected:(NSString *)cityString - (void)citySelected:(NSString *)cityString WithprovincesString:(NSString *)provincesString
{ {
self.cityString = cityString;
self.provincesString = provincesString;
[self.citySelected setTitle:cityString forState:UIControlStateNormal]; [self.citySelected setTitle:cityString forState:UIControlStateNormal];
} }
#pragma mark 新增按钮点击,或者修改 #pragma mark 新增按钮点击,或者保存
- (IBAction)addAddressButtonClick:(UIButton *)sender { - (IBAction)addAddressButtonClick:(UIButton *)sender {
if ([sender.currentTitle isEqualToString:@"新增"]) { if ([sender.currentTitle isEqualToString:@"新增"]) {
...@@ -140,11 +153,9 @@ ...@@ -140,11 +153,9 @@
{ {
[self ChangeAddressInformationRequest]; [self ChangeAddressInformationRequest];
} }
} }
#pragma mark -新增地址信息 #pragma mark -新增地址信息
- (void)addAddressInformationRequest - (void)addAddressInformationRequest
{ {
...@@ -153,6 +164,7 @@ ...@@ -153,6 +164,7 @@
address.name = self.recipientPerson.text; address.name = self.recipientPerson.text;
address.miblephone = self.PhoneNumber.text; address.miblephone = self.PhoneNumber.text;
address.city = [self.citySelected currentTitle]; address.city = [self.citySelected currentTitle];
address.province = self.provincesString;
address.address = self.detailsAddress.text; address.address = self.detailsAddress.text;
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
......
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
switch (indexPath.section) { switch (indexPath.section) {
case 0: case 0:
{ {
return 140; return 110;
} }
break; break;
case 1: case 1:
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
@protocol CityselectedDelegate <NSObject> @protocol CityselectedDelegate <NSObject>
//城市选择 //城市选择
- (void)citySelected:(NSString *)cityString; - (void)citySelected:(NSString *)cityString WithprovincesString:(NSString *)provincesString;
@end @end
......
...@@ -114,8 +114,8 @@ ...@@ -114,8 +114,8 @@
break; break;
} }
if ([self.delegate respondsToSelector:@selector(citySelected:)]) { if ([self.delegate respondsToSelector:@selector(citySelected:WithprovincesString:)]) {
[self.delegate citySelected:cityString]; [self.delegate citySelected:cityString WithprovincesString:provincesString];
} }
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
self.tagsPriceLabe.text = [_model.goods.tagPrice stringValue]; self.tagsPriceLabe.text = [_model.goods.tagPrice stringValue];
self.clinchTextfield.text = [_model.goods.costPrice stringValue]; self.clinchTextfield.text = [_model.goods.costPrice stringValue];
self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%d",_model.goodsNum]; self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%d",_model.goodsNum];
self.productPriceLabe.text = [_model.goods.costPrice stringValue]; self.productPriceLabe.text = [NSString stringWithFormat:@"¥%ld",[self.goodsNumbersLabe.text integerValue]*[_model.goods.costPrice integerValue]];;
} }
#pragma mark -增加或者减少商品 #pragma mark -增加或者减少商品
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#import "GenerateOrdersViewController.h" #import "GenerateOrdersViewController.h"
#import "ShopcarModel.h" #import "ShopcarModel.h"
#import "AddressModel.h"
@interface ShoppingViewController ()<UITableViewDelegate,UITableViewDataSource,ChangeGoodsNumberDelegate> @interface ShoppingViewController ()<UITableViewDelegate,UITableViewDataSource,ChangeGoodsNumberDelegate>
...@@ -227,9 +228,11 @@ ...@@ -227,9 +228,11 @@
[self ErrorMBProgressView:@"没有选中任何商品"]; [self ErrorMBProgressView:@"没有选中任何商品"];
return; return;
} }
//占位
ShopcarModel *ZhanweiModel = [[ShopcarModel alloc]init]; //商品总信息占位
ShopcarModel*ZhanweiModel = [[ShopcarModel alloc]init];
[array addObject:ZhanweiModel]; [array addObject:ZhanweiModel];
GenerateOrdersViewController *generateOrder = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"generateorders"]; GenerateOrdersViewController *generateOrder = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"generateorders"];
generateOrder.settlementGoodsdatas = array; generateOrder.settlementGoodsdatas = array;
//清除已经生成订单的商品 //清除已经生成订单的商品
......
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
@property (nonatomic,copy) NSString *customerPhoneNumber; @property (nonatomic,copy) NSString *customerPhoneNumber;
/** /**
* 客户公司地址 * 客户公司名字
*/ */
@property (nonatomic,copy) NSString *companyAddress; @property (nonatomic,copy) NSString *companyName;
/** /**
* 客户地址 * 客户地址
......
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