| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502 |
- //
- // StockingDetailViewController.m
- // IBOSS
- //
- // Created by apple on 2017/5/17.
- // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
- //
- // 功能描述:盘点详细控制器
- //
- #import "StockingDetailViewController.h"
- @interface StockingDetailViewController () {
-
- //盘点单号
- UILabel *_noValue ;
- //唯一编码
- UILabel *_onlyCode;
- //商品等级
- UILabel *_gradeName ;
- //规格
- UILabel *_specification ;
- //色号
- UILabel *_colorNumber;
- //库区
- UILabel *_wareHouseName;
- //仓位号
- UILabel *_positionNumber ;
- //商品种类
- UILabel *_goodKindName;
- //商品品牌
- UILabel *_brandName;
- //商品系列
- UILabel *_serialName;
- //商品品种
- UILabel *_varietyName;
- //库存数量
- UILabel *_quantity ;
- //盘点数量
- UILabel *_stockingQuantity;
- //责任人
- UILabel *_personName;
- //盘亏原因
- UILabel *_reason ;
- //盘点时间
- UILabel *_usertime;
- //盘点人
- UILabel *_username;
- }
- /**
- ASIDownManager
- */
- @property (nonatomic,strong) ASIDownManager *downManager;
- @end
- @implementation StockingDetailViewController
- #pragma mark - 公共函数
- /**
- viewDidLoad
- */
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self showTitle:@"库存盘点详细"];
- [self loadNavStyle];
- [self initUI];
- [self reloadData];
-
- }
- /**
- 安全区视图发生变化
- */
- -(void)viewSafeAreaInsetsDidChange{
- _scroll.frame = self.view.safeAreaLayoutGuide.layoutFrame;
- [super viewSafeAreaInsetsDidChange];
- }
- /**
- didReceiveMemoryWarning
- */
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- }
- #pragma mark - 回调函数
- /**
- * 查询正常数据
- *
- * @param sender <#sender description#>
- */
- - (void)onLoadFinish:(ASIDownManager *)sender
- {
- [self cancel];
- // 服务器返回数据
- RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
- // 服务器返回数据状态值
- int iStatus = resultModel.status;
- // 服务器返回数据消息
- NSString *message = resultModel.message;
- // 服务器返回数据状态值正确
- if (iStatus == 0) {
- NSArray * approvArr = (NSArray *)resultModel.result;
- if(approvArr == nil || approvArr.count == 0)
- {
- [self showAlertViewText:@"未找到匹配结果"];
- }
- else
- {
- // 赋值给控件
- for (int i = 0; i < approvArr.count; i++)
- {
- NSDictionary *dicValue = approvArr[i];
- _noValue.text = [dicValue objectForKey:@"CheckNo"];
- _onlyCode.text = [dicValue objectForKey:@"OnlyCode"];
- _gradeName.text = [dicValue objectForKey:@"GradeName"];
- _specification.text = [dicValue objectForKey:@"Specification"];
- _colorNumber.text = [dicValue objectForKey:@"ColorNumber"];
- _wareHouseName.text = [dicValue objectForKey:@"WarehouseName"];
- _positionNumber.text = [dicValue objectForKey:@"PositionNumber"];
- _goodKindName.text = [dicValue objectForKey:@"KindName"];
- _brandName.text = [dicValue objectForKey:@"BrandName"];
- _serialName.text = [dicValue objectForKey:@"SeriesName"];
- _varietyName.text = [dicValue objectForKey:@"VarietyName"];
- _quantity.text = [[dicValue objectForKey:@"InventoryQuantity"]stringValue] ;
- _stockingQuantity.text = [[dicValue objectForKey:@"CheckQuantity"]stringValue];
- _personName.text = [dicValue objectForKey:@"StaffName"];
- _reason.text = [dicValue objectForKey:@"ShortageReasonName"];
- _usertime.text = [dicValue objectForKey:@"CreateTime"];
- _username.text = [dicValue objectForKey:@"UserName"];
- }
- }
- }
- // 服务器返回数据状态值异常
- else if(iStatus == ActionResultStatusAuthError
- ||iStatus == ActionResultStatusNoLogin
- ||iStatus == ActionResultStatusLogined||iStatus==ActionResultSessionOverdue){
- [self showReLoginDialog:message];
- }
- else {
- [self showAlertViewText:message];
- }
-
- }
- /**
- * 异常数据
- *
- * @param sender sender description
- */
- - (void)onLoadFail:(ASIDownManager *)sender {
- [self cancel];
- [self showAlertViewText:@"网络异常"];
- }
- #pragma mark - 私有函数
- /**
- 初始化ui
- */
- - (void)initUI {
- self.view.backgroundColor = LineBackgroundColor;
-
- CGFloat heightRow = 30;
- CGFloat lblx = 10;
- CGFloat lbly = 3;
- CGFloat lblwidth = 70;
- CGFloat lblheight = 25;
- CGFloat valuex = 80;
- CGFloat valuey = 3;
- CGFloat valueheight = 25;
- _scroll = [UIScrollView new];
- _scroll.frame=self.view.bounds;
- [self.view addSubview:_scroll];
-
- UIView *vTitle = [UIView new];
- [_scroll addSubview:vTitle];
- vTitle.backgroundColor = [UIColor whiteColor];
-
- //盘点单号 —————————
- UIView *vno = [UIView new];
- vno.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame), Screen_Width, heightRow);
- [vTitle addSubview:vno];
- UILabel *lblno = [UILabel new];
- lblno.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblno.text = @"盘点单号:";
- lblno.textColor = [UIColor blackColor];
- lblno.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vno addSubview:lblno];
- _noValue = [UILabel new];
- _noValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _noValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vno addSubview:_noValue];
-
- //唯一编码 —————————
- UIView *vonlyCode = [UIView new];
- vonlyCode.frame=CGRectMake(0, CGRectGetMaxY(vno.frame), Screen_Width, heightRow);
- [vTitle addSubview:vonlyCode];
- UILabel *lblonlyCode = [UILabel new];
- lblonlyCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblonlyCode.text = @"唯一编码:";
- lblonlyCode.textColor = [UIColor blackColor];
- lblonlyCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vonlyCode addSubview:lblonlyCode];
- _onlyCode = [UILabel new];
- _onlyCode.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _onlyCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
-
- [vonlyCode addSubview:_onlyCode];
-
- // —————————
- UIView *vgradeName = [UIView new];
- vgradeName.frame=CGRectMake(0, CGRectGetMaxY(vonlyCode.frame), Screen_Width, heightRow);
- [vTitle addSubview:vgradeName];
- UILabel *lblgradeName = [UILabel new];
- lblgradeName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblgradeName.text = @"商品等级:";
- lblgradeName.textColor = [UIColor blackColor];
- lblgradeName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vgradeName addSubview:lblgradeName];
- _gradeName = [UILabel new];
- _gradeName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _gradeName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
-
- [vgradeName addSubview:_gradeName];
-
- //规格 —————————
- UIView *vspecification = [UIView new];
- vspecification.frame=CGRectMake(0, CGRectGetMaxY(vgradeName.frame), Screen_Width, heightRow);
- [vTitle addSubview:vspecification];
- UILabel *lblspecification = [UILabel new];
- lblspecification.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblspecification.text = @"规 格:";
- lblspecification.textColor = [UIColor blackColor];
- lblspecification.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vspecification addSubview:lblspecification];
- _specification = [UILabel new];
- _specification.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _specification.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vspecification addSubview:_specification];
-
- //色号 —————————
- UIView *vcolorNumber = [UIView new];
- vcolorNumber.frame=CGRectMake(0, CGRectGetMaxY(vspecification.frame), Screen_Width, heightRow);
- [vTitle addSubview:vcolorNumber];
- UILabel *lblcolorNumber = [UILabel new];
- lblcolorNumber.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblcolorNumber.text = @"色 号:";
- lblcolorNumber.textColor = [UIColor blackColor];
- lblcolorNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vcolorNumber addSubview:lblcolorNumber];
- _colorNumber = [UILabel new];
- _colorNumber.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _colorNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vcolorNumber addSubview:_colorNumber];
-
- // —————————
- UIView *vwareHouseName = [UIView new];
- vwareHouseName.frame=CGRectMake(0, CGRectGetMaxY(vcolorNumber.frame), Screen_Width, heightRow);
- [vTitle addSubview:vwareHouseName];
- UILabel *lblwareHouseName = [UILabel new];
- lblwareHouseName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblwareHouseName.text = @"库 区:";
- lblwareHouseName.textColor = [UIColor blackColor];
- lblwareHouseName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vwareHouseName addSubview:lblwareHouseName];
- _wareHouseName = [UILabel new];
- _wareHouseName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _wareHouseName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
-
- [vwareHouseName addSubview:_wareHouseName];
-
- // —————————
- UIView *vpositionNumber = [UIView new];
- vpositionNumber.frame=CGRectMake(0, CGRectGetMaxY(vwareHouseName.frame), Screen_Width, heightRow);
- [vTitle addSubview:vpositionNumber];
- UILabel *lblpositionNumber = [UILabel new];
- lblpositionNumber.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblpositionNumber.text = @"仓 位 号:";
- lblpositionNumber.textColor = [UIColor blackColor];
- lblpositionNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vpositionNumber addSubview:lblpositionNumber];
- _positionNumber = [UILabel new];
- _positionNumber.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _positionNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
-
- [vpositionNumber addSubview:_positionNumber];
-
-
- // —————————
- UIView *vgoodKindName = [UIView new];
- vgoodKindName.frame=CGRectMake(0, CGRectGetMaxY(vpositionNumber.frame), Screen_Width, heightRow);
- [vTitle addSubview:vgoodKindName];
- UILabel *lblgoodKindName = [UILabel new];
- lblgoodKindName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblgoodKindName.text = @"商品种类:";
- lblgoodKindName.textColor = [UIColor blackColor];
- lblgoodKindName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vgoodKindName addSubview:lblgoodKindName];
- _goodKindName = [UILabel new];
- _goodKindName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _goodKindName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
-
- [vgoodKindName addSubview:_goodKindName];
-
- // 品牌 —————————
- UIView *vbrandName = [UIView new];
- vbrandName.frame=CGRectMake(0, CGRectGetMaxY(vgoodKindName.frame), Screen_Width, heightRow);
- [vTitle addSubview:vbrandName];
- UILabel *lblbrandName = [UILabel new];
- lblbrandName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblbrandName.text = @"商品品牌:";
- lblbrandName.textColor = [UIColor blackColor];
- lblbrandName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vbrandName addSubview:lblbrandName];
- _brandName = [UILabel new];
- _brandName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _brandName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
-
- [vbrandName addSubview:_brandName];
-
- // 系列 —————————
- UIView *vserialName = [UIView new];
- vserialName.frame=CGRectMake(0, CGRectGetMaxY(vbrandName.frame), Screen_Width, heightRow);
- [vTitle addSubview:vserialName];
- UILabel *lblserialName = [UILabel new];
- lblserialName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblserialName.text = @"商品系列:";
- lblserialName.textColor = [UIColor blackColor];
- lblserialName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vserialName addSubview:lblserialName];
- _serialName = [UILabel new];
- _serialName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _serialName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vserialName addSubview:_serialName];
-
- // —————————
- UIView *vvarietyName = [UIView new];
- vvarietyName.frame=CGRectMake(0, CGRectGetMaxY(vserialName.frame), Screen_Width, heightRow);
- [vTitle addSubview:vvarietyName];
- UILabel *lblvarietyName = [UILabel new];
- lblvarietyName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblvarietyName.text = @"商品品类:";
- lblvarietyName.textColor = [UIColor blackColor];
- lblvarietyName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vvarietyName addSubview:lblvarietyName];
- _varietyName = [UILabel new];
- _varietyName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _varietyName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vvarietyName addSubview:_varietyName];
-
- // —————————
- UIView *vQuantity = [UIView new];
- vQuantity.frame=CGRectMake(0, CGRectGetMaxY(vvarietyName.frame), Screen_Width, heightRow);
- [vTitle addSubview:vQuantity];
- UILabel *lblQuantity = [UILabel new];
- lblQuantity.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblQuantity.text = @"库存数量:";
- lblQuantity.textColor = [UIColor blackColor];
- lblQuantity.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vQuantity addSubview:lblQuantity];
- _quantity = [UILabel new];
- _quantity.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _quantity.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vQuantity addSubview:_quantity];
-
- // —————————
- UIView *vstockingQuantity = [UIView new];
- vstockingQuantity.frame=CGRectMake(0, CGRectGetMaxY(vQuantity.frame), Screen_Width, heightRow);
- [vTitle addSubview:vstockingQuantity];
- UILabel *lblstockingQuantity = [UILabel new];
- lblstockingQuantity.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblstockingQuantity.text = @"盘点数量:";
- lblstockingQuantity.textColor = [UIColor blackColor];
- lblstockingQuantity.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vstockingQuantity addSubview:lblstockingQuantity];
- _stockingQuantity = [UILabel new];
- _stockingQuantity.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _stockingQuantity.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vstockingQuantity addSubview:_stockingQuantity];
-
- // —————————
- UIView *vpersonName = [UIView new];
- vpersonName.frame=CGRectMake(0, CGRectGetMaxY(vstockingQuantity.frame), Screen_Width, heightRow);
- [vTitle addSubview:vpersonName];
- UILabel *lblpersonName = [UILabel new];
- lblpersonName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblpersonName.text = @"责 任 人:";
- lblpersonName.textColor = [UIColor blackColor];
- lblpersonName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vpersonName addSubview:lblpersonName];
- _personName = [UILabel new];
- _personName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _personName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vpersonName addSubview:_personName];
-
- // —————————
- UIView *vreason = [UIView new];
- vreason.frame=CGRectMake(0, CGRectGetMaxY(vpersonName.frame), Screen_Width, heightRow);
- [vTitle addSubview:vreason];
- UILabel *lblreason = [UILabel new];
- lblreason.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblreason.text = @"盘亏原因:";
- lblreason.textColor = [UIColor blackColor];
- lblreason.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vreason addSubview:lblreason];
- _reason = [UILabel new];
- _reason.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _reason.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vreason addSubview:_reason];
-
- // —————————
- UIView *vusertime = [UIView new];
- vusertime.frame=CGRectMake(0, CGRectGetMaxY(vreason.frame), Screen_Width, heightRow);
- [vTitle addSubview:vusertime];
- UILabel *lblusertime = [UILabel new];
- lblusertime.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblusertime.text = @"盘点时间:";
- lblusertime.textColor = [UIColor blackColor];
- lblusertime.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vusertime addSubview:lblusertime];
- _usertime = [UILabel new];
- _usertime.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _usertime.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vusertime addSubview:_usertime];
-
- // —————————
- UIView *vusername = [UIView new];
- vusername.frame=CGRectMake(0, CGRectGetMaxY(vusertime.frame), Screen_Width, heightRow);
- [vTitle addSubview:vusername];
- UILabel *lblusername = [UILabel new];
- lblusername.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblusername.text = @"盘 点 人:";
- lblusername.textColor = [UIColor blackColor];
- lblusername.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vusername addSubview:lblusername];
- _username = [UILabel new];
- _username.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _username.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vusername addSubview:_username];
-
- vTitle.frame=CGRectMake(10, 10, Screen_Width-20, CGRectGetMaxY(vusername.frame) );
- vTitle.layer.cornerRadius = CornerRadius;
- _scroll.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vTitle.frame)+rectStatusHeight+rectNavHeight);
- }
- /**
- 加载数据
- */
- - (void)reloadData
- {
- [self startLoading];
- NSString *urlStr = ServerURL;
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
-
- [dict setObject:@"GetInventoryCheckDataIphone" 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:_stockingID forKey:@"DetailID"];
- _downManager = [[ASIDownManager alloc] init];
- _downManager.delegate = self;
- _downManager.onRequestSuccess = @selector(onLoadFinish:);
- _downManager.onRequestFail = @selector(onLoadFail:);
- [_downManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
- }
- /**
- * 隐藏进度条
- */
- - (void)cancel {
- [self stopLoading];
-
- }
- /**
- 导航栏
- */
- - (void)loadNavStyle
- {
- //返回
- UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
- [button setImage:[UIImage imageNamed:@"icon_back"] forState:UIControlStateNormal];
- [button addTarget:self action:@selector(goBack)
- forControlEvents:UIControlEventTouchUpInside];
- button.frame = CGRectMake(0, 0,45,22);
-
- UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
- self.navigationItem.leftBarButtonItem = menuButton;
- }
- /**
- 返回
- */
- - (void)goBack
- {
- [self.navigationController popViewControllerAnimated:YES];
- }
- @end
|