| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628 |
- //
- // NewOtherInStorageVC.m
- // IBOSSmini
- //
- // Created by guan hong hou on 2018/4/24.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "NewOtherInStorageVC.h"
- @interface NewOtherInStorageVC (){
- UIScrollView *_scrollView;
- UITextField *_selectedAchievementField;
- CGRect originalAchievementFrame;
- }
- @end
- @implementation NewOtherInStorageVC
- #pragma mark 公共函数
- /**
- 视图加载完成函数
- */
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self initUI];
- [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
-
- [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
- [self loadDataSource];
- }
- /**
- 修改:2017-9-25
- 适配机型
- 安全区视图发生变化
- */
- -(void)viewSafeAreaInsetsDidChange{
- _scrollView.frame = CGRectMake(0, 10,Screen_Width, self.view.safeAreaLayoutGuide.layoutFrame.size.height-10);
- [super viewSafeAreaInsetsDidChange];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
-
- }
- #pragma mark 委托函数
- /**
- 客户编码回调
- @param searchModel <#searchModel description#>
- */
- -(void)getCustomerOrder:(CustomerCodeSearchModel*)searchModel{
- _customerId=[NSString stringWithFormat:@"%d",searchModel.customerId];
- _customerCode=searchModel.customerCode;
- _customerName=searchModel.customerName;
- _telephone=searchModel.telephone;
- _address=searchModel.address;
- _contacts=searchModel.contacts;
- _lblCustomerCode.text=_customerCode;
- }
- /**
- textfield委托函数
- @param textField <#textField description#>
- @return <#return value description#>
- */
- -(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
- {
- _selectedAchievementField = textField;
- return YES;
- }
- /**
- 渠道,区域,客户性质,级别等返回回调
-
- @param model <#model description#>
- @param cr <#cr description#>
- */
- - (void)customerReportTextDoneDatas:(CustomerReportTextInfoModel *)model CustomerReport:(CustomerReport)cr
- {
- if (model==nil) {
- return;
- }
- //渠道返回值
- if(cr==ReportDriver){
- _driverId=model.idCode;
- _driverName=model.name;
- _lblDriver.text=_driverName;
- }
-
- if(cr==ReportDocker){
- _dockerId=model.idCode;
- _dockerName=model.name;
- _lblDocker.text=_dockerName;
- }
-
- if(cr==ReportSupplier){
- _supplierId=model.idCode;
- _supplierName=model.name;
- _lblSupplier.text=_supplierName;
- }
-
-
-
-
- }
- /**
- 业务员 业务部门
-
- @param Amodel <#Amodel description#>
- @param cr <#cr description#>
- */
- -(void)achiementData:(AchiementDepartmentInfoModel *)Amodel CustomerReport:(CustomerReport)cr{
- //返回值
- if(cr== ReportAchiementDepartmt){
- _organizationName=Amodel.organizationName;
- _organizationId=Amodel.organizationId;
- _organizationCode=Amodel.organizationCode;
- _lblDepartment.text=_organizationName;
- }
- // 业务员
- if(cr==ReportAchiementmn){
- _staffId=Amodel.staffId;
- _staffName=Amodel.staffName;
- _lblStaff.text=_staffName;
- }
-
- }
- /**
- 数据源加载成功回调
- @param sender <#sender description#>
- */
- - (void)onDataSourceLoadFinish:(ASIDownManager *)sender {
- NSDictionary *dic = [sender.mWebStr JSONValue];
- [self stopLoading];
- // 服务器返回数据是否正确
- if (dic && [dic isKindOfClass:[NSDictionary class]]) {
- // 服务器返回数据状态值
- int iStatus = [[dic objectForKey:@"Status"] intValue];
- // 服务器返回数据消息
- NSString *message=[dic objectForKey:@"Message"];
- // 服务器返回数据状态值正确
- if (iStatus == 0) {
- NSDictionary * infoDic=[dic objectForKey:@"Result"];
- // 返回结果
- if(infoDic!=nil&& infoDic.count>0)
- {
- NSArray *departmentArray=[infoDic objectForKey:@"Table"];
- if(departmentArray!=nil&&departmentArray.count>0){
- _departmentList=departmentArray;
- }
- NSArray *staffArray=[infoDic objectForKey:@"Table1"];
- if(staffArray!=nil&&staffArray.count>0){
- _staffList=staffArray;
- }
- NSArray *driverArray=[infoDic objectForKey:@"Table2"];
- if(driverArray!=nil&&driverArray.count>0){
- _driverList=driverArray;
- _dockerList=driverArray;
- }
- NSArray *supplierArray=[infoDic objectForKey:@"Table3"];
-
- if(supplierArray!=nil&&supplierArray.count>0){
- _supplierList=supplierArray;
-
- }
-
- NSArray *warehouseArray=[infoDic objectForKey:@"Table5"];
-
- if(warehouseArray!=nil&&warehouseArray.count>0){
- _warehouseList=warehouseArray;
-
- }
-
- NSArray *positionNumberArray=[infoDic objectForKey:@"Table6"];
- if(positionNumberArray!=nil&&positionNumberArray.count>0){
- _positionNumberList=positionNumberArray;
-
- }
-
- }
- }
- // 服务器返回数据状态值异常
- else if(iStatus==ActionResultStatusAuthError
- ||iStatus==ActionResultStatusNoLogin
- ||iStatus==ActionResultStatusLogined ||iStatus == ActionResultStatusLoginedInvalid){
-
- [self showReLoginDialog:message];
- }
- else{
-
- [self showAlertViewText:message];
- }
- }
- }
- /**
- 数据源加载失败回调
- @param sender <#sender description#>
- */
- - (void)onDataSourceLoadFail:(ASIDownManager *)sender {
- [self stopLoading];
- [self showAlertViewText:@"加载失败"];
- }
- #pragma mark 私有函数
- /**
- 初始化UI
- */
- -(void)initUI{
- [self.view setBackgroundColor:[UIColor whiteColor]];
- UIView *topSeparatorView = [UIView new];
- topSeparatorView.frame=CGRectMake(0,3, Screen_Width, 10);
- topSeparatorView.backgroundColor = LineBackgroundColor;
- [self.view addSubview:topSeparatorView];
- CGFloat heightRow = 40;
- CGFloat lblx = 20;
- CGFloat lbly = 8;
- CGFloat lblwidth = 80;
- CGFloat lblheight = 25;
- _scrollView=[UIScrollView new];
- _scrollView.frame=CGRectMake(0,CGRectGetMaxY(topSeparatorView.frame), Screen_Width,self.view.frame.size.height-CGRectGetMaxY(topSeparatorView.frame));
- [self.view addSubview:_scrollView];
- UIView *vBody = [UIView new];
- [_scrollView addSubview:vBody];
- UITapGestureRecognizer* singleRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKey)];
-
- [self.view addGestureRecognizer:singleRecognizer];
- UIView *vDriver = [UIView new];
- vDriver.frame=CGRectMake(0,0, Screen_Width, heightRow);
- [vBody addSubview:vDriver];
- NSString *driverTitle=@"运输司机";
- UILabel *lblTitleDriver=[UILabel new];
- lblTitleDriver.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
- lblTitleDriver.textColor = [UIColor blackColor];
- lblTitleDriver.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vDriver addSubview:lblTitleDriver];
- lblTitleDriver.text=driverTitle;
- _lblDriver = [UILabel new];
- _lblDriver.frame=CGRectMake(CGRectGetMaxX(lblTitleDriver.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleDriver.frame)-55, lblheight);
- _lblDriver.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _lblDriver.text=@"请选择运输司机";
- _lblDriver.userInteractionEnabled=YES;
- UITapGestureRecognizer *driverTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goDriver:)];
- [_lblDriver addGestureRecognizer:driverTapGesture];
- [vDriver addSubview:_lblDriver];
- UIButton *btnDriverRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
- btnDriverRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
- UIImageView *rightArrowImg = [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
- [rightArrowImg setImage:[UIImage imageNamed:@"rightarrow"]];
- [ btnDriverRightArrow addSubview:rightArrowImg];
- rightArrowImg.userInteractionEnabled=NO;
- [vDriver addSubview:btnDriverRightArrow];
- UIView *driverSeparator=[UIView new];
- driverSeparator.backgroundColor=LineBackgroundColor;
- driverSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleDriver.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleDriver.frame),1);
- [vDriver addSubview:driverSeparator];
-
-
- UIView *vDocker = [UIView new];
- vDocker.frame=CGRectMake(0,CGRectGetMaxY(vDriver.frame), Screen_Width, heightRow);
- [vBody addSubview:vDocker];
- NSString *dockerTitle=@"装卸工人";
- UILabel *lblTitleDocker=[UILabel new];
- lblTitleDocker.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
- lblTitleDocker.textColor = [UIColor blackColor];
- lblTitleDocker.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vDocker addSubview:lblTitleDocker];
- lblTitleDocker.text=dockerTitle;
-
- _lblDocker = [UILabel new];
- _lblDocker.frame=CGRectMake(CGRectGetMaxX(lblTitleDocker.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleDocker.frame)-55, lblheight);
- _lblDocker.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _lblDocker.text=@"请选择装卸工人";
- _lblDocker.userInteractionEnabled=YES;
- UITapGestureRecognizer *dockerTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goDocker:)];
- [_lblDocker addGestureRecognizer:dockerTapGesture];
- [vDocker addSubview:_lblDocker];
- UIButton *btnDockerRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
- btnDockerRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
- UIImageView *rightArrowImg1 = [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
- [rightArrowImg1 setImage:[UIImage imageNamed:@"rightarrow"]];
- [ btnDockerRightArrow addSubview:rightArrowImg1];
- rightArrowImg1.userInteractionEnabled=NO;
- [vDocker addSubview:btnDockerRightArrow];
- UIView *dockerSeparator=[UIView new];
- dockerSeparator.backgroundColor=LineBackgroundColor;
- dockerSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleDocker.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleDocker.frame),1);
- [vDocker addSubview:dockerSeparator];
-
-
- UIView *vSupplier = [UIView new];
- vSupplier.frame=CGRectMake(0,CGRectGetMaxY(vDocker.frame), Screen_Width, heightRow);
- [vBody addSubview:vSupplier];
- NSString *supplierTitle=@"供 应 商";
- UILabel *lblTitleSupplier=[UILabel new];
- lblTitleSupplier.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
- lblTitleSupplier.textColor = [UIColor blackColor];
- lblTitleSupplier.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vSupplier addSubview:lblTitleSupplier];
- lblTitleSupplier.text=supplierTitle;
-
- _lblSupplier = [UILabel new];
- _lblSupplier.frame=CGRectMake(CGRectGetMaxX(lblTitleSupplier.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleSupplier.frame)-55, lblheight);
- _lblSupplier.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _lblSupplier.text=@"请选择供应商";
- _lblSupplier.userInteractionEnabled=YES;
- UITapGestureRecognizer *supplierTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goSupplier:)];
- [_lblSupplier addGestureRecognizer:supplierTapGesture];
- [vSupplier addSubview:_lblSupplier];
- UIButton *btnSupplierRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
-
- btnSupplierRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
- UIImageView *rightArrowImg2= [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
- [rightArrowImg2 setImage:[UIImage imageNamed:@"rightarrow"]];
- [ btnSupplierRightArrow addSubview:rightArrowImg2];
- rightArrowImg2.userInteractionEnabled=NO;
- [vSupplier addSubview:btnSupplierRightArrow];
- UIView *supplierSeparator=[UIView new];
- supplierSeparator.backgroundColor=LineBackgroundColor;
- supplierSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleSupplier.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleSupplier.frame),1);
- [vSupplier addSubview:supplierSeparator];
-
- UIView *vCustomerCode = [UIView new];
- vCustomerCode.frame=CGRectMake(0,CGRectGetMaxY(vSupplier.frame), Screen_Width, heightRow);
- [vBody addSubview:vCustomerCode];
- NSString *customerCodeTitle=@"客户编码";
- UILabel *lblTitleCustomerCode=[UILabel new];
- lblTitleCustomerCode.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
- lblTitleCustomerCode.textColor = [UIColor blackColor];
- lblTitleCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerCode addSubview:lblTitleCustomerCode];
- lblTitleCustomerCode.text=customerCodeTitle;
-
- _lblCustomerCode = [UILabel new];
- _lblCustomerCode.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleCustomerCode.frame)-55, lblheight);
- _lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _lblCustomerCode.text=@"请选择客户编码";
- _lblCustomerCode.tag=1301;
- _lblCustomerCode.userInteractionEnabled=YES;
- UITapGestureRecognizer *customerCodeTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(searchCustomerCode)];
- [_lblCustomerCode addGestureRecognizer:customerCodeTapGesture];
- [vCustomerCode addSubview:_lblCustomerCode];
- UIButton *btnCustomerCodeRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
- btnCustomerCodeRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
- UIImageView *rightArrowImg3= [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
- [rightArrowImg3 setImage:[UIImage imageNamed:@"rightarrow"]];
- [ btnCustomerCodeRightArrow addSubview:rightArrowImg3];
- rightArrowImg3.userInteractionEnabled=NO;
- [vCustomerCode addSubview:btnCustomerCodeRightArrow];
- UIView *customerCodeSeparator=[UIView new];
- customerCodeSeparator.backgroundColor=LineBackgroundColor;
- customerCodeSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleCustomerCode.frame),1);
- [vCustomerCode addSubview:customerCodeSeparator];
-
-
- //业务员
- UIView *vStaff = [UIView new];
- vStaff.frame=CGRectMake(0,CGRectGetMaxY(vCustomerCode.frame), Screen_Width, heightRow);
- [vBody addSubview:vStaff];
- NSString *staffTitle=@"业 务 员";
- UILabel *lblTitleStaff=[UILabel new];
- lblTitleStaff.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
- lblTitleStaff.textColor = [UIColor blackColor];
- lblTitleStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vStaff addSubview:lblTitleStaff];
- lblTitleStaff.text=staffTitle;
-
- _lblStaff = [UILabel new];
- _lblStaff.frame=CGRectMake(CGRectGetMaxX(lblTitleStaff.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleStaff.frame)-55, lblheight);
- _lblStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _lblStaff.text=@"请选择业务员";
- _lblStaff.userInteractionEnabled=YES;
- UITapGestureRecognizer *staffTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goStaff:)];
- [_lblStaff addGestureRecognizer:staffTapGesture];
- [vStaff addSubview:_lblStaff];
- UIButton *btnStaffRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
-
- btnStaffRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
- UIImageView *rightArrowImg4= [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
- [rightArrowImg4 setImage:[UIImage imageNamed:@"rightarrow"]];
- [ btnStaffRightArrow addSubview:rightArrowImg4];
- rightArrowImg4.userInteractionEnabled=NO;
- [vStaff addSubview:btnStaffRightArrow];
- UIView *staffSeparator=[UIView new];
- staffSeparator.backgroundColor=LineBackgroundColor;
- staffSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleStaff.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleStaff.frame),1);
- [vStaff addSubview:staffSeparator];
-
-
- UIView *vDepartment = [UIView new];
- vDepartment.frame=CGRectMake(0,CGRectGetMaxY(vStaff.frame), Screen_Width, heightRow);
- [vBody addSubview:vDepartment];
- NSString *departmentTitle=@"业务部门";
- UILabel *lblTitleDepartment=[UILabel new];
- lblTitleDepartment.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
- lblTitleDepartment.textColor = [UIColor blackColor];
- lblTitleDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vDepartment addSubview:lblTitleDepartment];
- lblTitleDepartment.text=departmentTitle;
-
- _lblDepartment = [UILabel new];
- _lblDepartment.frame=CGRectMake(CGRectGetMaxX(lblTitleDepartment.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleDepartment.frame)-55, lblheight);
- _lblDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _lblDepartment.text=@"请选择业务部门";
- _lblDepartment.userInteractionEnabled=YES;
- UITapGestureRecognizer *departmentTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goDepartment:)];
- [_lblDepartment addGestureRecognizer:departmentTapGesture];
- [vDepartment addSubview:_lblDepartment];
- UIButton *btnDepartmentRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
-
- btnDepartmentRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
- UIImageView *rightArrowImg5= [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
- [rightArrowImg5 setImage:[UIImage imageNamed:@"rightarrow"]];
- [ btnDepartmentRightArrow addSubview:rightArrowImg5];
- rightArrowImg5.userInteractionEnabled=NO;
- [vDepartment addSubview:btnDepartmentRightArrow];
-
- UIView *departmentSeparator=[UIView new];
- departmentSeparator.backgroundColor=LineBackgroundColor;
- departmentSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleDepartment.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleDepartment.frame),1);
- [vDepartment addSubview:departmentSeparator];
-
- UIView *vRemarks = [UIView new];
- vRemarks.frame=CGRectMake(0,CGRectGetMaxY(vDepartment.frame), Screen_Width, heightRow);
- [vBody addSubview:vRemarks];
- NSString *remarksTitle=@"备 注";
- UILabel *lblRemarksTitle=[UILabel new];
- lblRemarksTitle.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
- lblRemarksTitle.textColor = [UIColor blackColor];
- lblRemarksTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vRemarks addSubview:lblRemarksTitle];
- lblRemarksTitle.text=remarksTitle;
-
- _txtRemarks = [UITextField new];
- _txtRemarks.frame=CGRectMake(CGRectGetMaxX(lblRemarksTitle.frame), lbly,Screen_Width-CGRectGetMaxX(lblRemarksTitle.frame)-10, lblheight);
- _txtRemarks.placeholder=@"请输入备注";
- _txtRemarks.delegate=self;
- _txtRemarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vRemarks addSubview:_txtRemarks];
-
- UIView *remarksSeparator=[UIView new];
- remarksSeparator.backgroundColor=LineBackgroundColor;
- remarksSeparator.frame=CGRectMake(CGRectGetMaxX(lblRemarksTitle.frame),heightRow,Screen_Width-CGRectGetMaxX(lblRemarksTitle.frame),1);
- [vRemarks addSubview:remarksSeparator];
-
- vBody.frame=CGRectMake(0,0, Screen_Width,CGRectGetMaxY(vRemarks.frame));
- _scrollView.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vBody.frame)+rectStatusHeight+rectNavHeight);
- originalAchievementFrame=_scrollView.frame;
-
-
- }
- /**
- 隐藏键盘
- */
- -(void)hideKey{
- [self.view endEditing:YES];
- }
- /**
- 出示键盘通知
- @param notification <#notification description#>
- */
- -(void)keyboardWillShow:(NSNotification*)notification
- {
-
- // 获得键盘尺寸
- NSDictionary *info = notification.userInfo;
-
- NSValue *aValue = [info objectForKeyedSubscript:UIKeyboardFrameEndUserInfoKey];
- CGSize keyboardSize = [aValue CGRectValue].size;
-
- if(!_keyboardShow){
- // //重新定义ScrollView的尺寸
- CGRect viewFrame = _scrollView.frame;
-
- viewFrame.size.height -=(keyboardSize.height); //原来的尺寸减去键盘的高度
- viewFrame.size.height-=130;
- _scrollView.frame = viewFrame;
-
-
- //获取当前文本框架大小
- CGRect textFieldRect = [_selectedAchievementField frame];
-
- //滚动到当前文本框
- [_scrollView scrollRectToVisible:textFieldRect animated:YES];
- }
- _keyboardShow=YES;
- }
- /**
- 隐藏键盘通知
- @param aNotification <#aNotification description#>
- */
- - (void)keyboardWillHide:(NSNotification *)aNotification
- {
-
- if(_keyboardShow){
-
- _scrollView.frame=originalAchievementFrame;
- }
- _keyboardShow=NO;
- }
- /**
- 跳转到司机页面
- @param gesture <#gesture description#>
- */
- - (void)goDriver:(UITapGestureRecognizer *)gesture {
- [self.view endEditing:YES];
- CustomerReportTextVC *tc=[[CustomerReportTextVC alloc] init];
- tc.delegate=self;
- tc.dataSourceCode=@"T_MST_Driver";
- tc.showDialogViewTag=ReportDriver;
- tc.jsonArr=_driverList;
- [self.listNavVc pushViewController:tc animated:YES];
- }
- /**
- 跳转到装卸工人页面
- @param gesture <#gesture description#>
- */
- - (void)goDocker:(UITapGestureRecognizer *)gesture {
- CustomerReportTextVC *tc=[[CustomerReportTextVC alloc] init];
- tc.delegate=self;
- [self.view endEditing:YES];
- tc.dataSourceCode=@"T_MST_Docker";
- tc.showDialogViewTag=ReportDocker;
- tc.jsonArr=_dockerList;
- [self.listNavVc pushViewController:tc animated:YES];
- }
- /**
- 跳转到供应商页面
- @param gesture <#gesture description#>
- */
- - (void)goSupplier:(UITapGestureRecognizer *)gesture {
- self.hidesBottomBarWhenPushed = YES;
- [self.view endEditing:YES];
- CustomerReportTextVC *tc=[[CustomerReportTextVC alloc] init];
- tc.delegate=self;
- tc.jsonArr=_supplierList;
- tc.showDialogViewTag=ReportSupplier;
- [self.listNavVc pushViewController:tc animated:YES];
- }
- /**
- 跳转到业务部门页面
- */
- - (void)goDepartment:(UITapGestureRecognizer *)gesture{
- [self.view endEditing:YES];
- CustomerAchievementTextVC *tc=[CustomerAchievementTextVC new];
- tc.cDelegate = self;
- tc.showDialogViewTag=ReportAchiementDepartmt;
- tc.jsonArr=_departmentList;
- [self.listNavVc pushViewController:tc animated:YES];
-
- }
- /**
- 跳转到客户编码查询
- */
- -(void)searchCustomerCode{
- [self.view endEditing:YES];
- CustomerCodeSearchVC *customerCodeVC=[[ CustomerCodeSearchVC alloc] init];
- UINavigationController *navigationController = [[UINavigationController alloc]initWithRootViewController:customerCodeVC];
- navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
- navigationController.preferredContentSize = CGSizeMake(frameSize.x, frameSize.y);
- customerCodeVC.orderDelegate=self;
- customerCodeVC.flag=@"otherInStorage";
- [self.listNavVc pushViewController:customerCodeVC animated:YES];
- }
- /**
- 跳转到业务员页面
- */
- - (void)goStaff:(UITapGestureRecognizer *)gesture{
- [self.view endEditing:YES];
- CustomerAchievementTextVC *tc=[[CustomerAchievementTextVC alloc] init];
- tc.cDelegate=self;
- tc.showDialogViewTag=ReportAchiementmn;
- tc.jsonArr=_staffList;
- [self.listNavVc pushViewController:tc animated:YES];
- }
- /**
- 加载基本数据源
- */
- -(void)loadDataSource{
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setObject:@"GetOtherEnterInitData" forKey:@"Action"];
- [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
- [dict setObject:kkUserCode forKey:@"UserCode"];
- [dict setObject:kkUserPwd forKey:@"UserPassword"];
- [dict setObject:kkSessionKey forKey:@"SessionKey"];
- [dict setObject:kkOrganizationId forKey:@"OrganizationID"];
- _downManager = [[ASIDownManager alloc] init];
- [self startLoading];
- _downManager.delegate = self;
- _downManager.OnImageDown = @selector(onDataSourceLoadFinish:);
- _downManager.OnImageFail = @selector(onDataSourceLoadFail:);
- [_downManager postHttpRequest:ServerURL dic:dict path:nil fileName:nil];
- }
- @end
|