Browse Source

设备管理

huangyp 6 years ago
parent
commit
bac9e9c9eb

+ 1 - 1
shiku_im/shiku_im/controller/DocumentCell.m

@@ -28,7 +28,7 @@
         _MyTextView.font = FONT_SIZE(14);
 //        _MyTextView.placeholder = @"请输入";
         _MyTextView.isCanExtend = YES;
-        _MyTextView.extendLimitRow = 5;
+        _MyTextView.extendLimitRow = 80;
         /** 伸缩方向 */
         _MyTextView.extendDirection = ExtendDown;
         _MyTextView.backgroundColor = [UIColor clearColor];

+ 3 - 0
shiku_im/shiku_im/controller/JODetailMsgVC.h

@@ -12,4 +12,7 @@
 
 @property (nonatomic,copy) NSString * msg;
 
+@property (nonatomic,strong) NSString *caller;
+
+@property (nonatomic,strong) NSString *idStr;
 @end

+ 28 - 11
shiku_im/shiku_im/controller/JODetailMsgVC.m

@@ -7,7 +7,7 @@
 //
 
 #import "JODetailMsgVC.h"
-
+#import "DeviceEnterFormVC.h"
 @interface JODetailMsgVC ()
 
 @end
@@ -30,21 +30,37 @@
     
     [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
     
-    self.title=@"消息详情";
-    
+    self.title = @"消息详情";
     
-    UILabel * label=[[UILabel alloc]init];
-    label.frame=CGRectMake(50,self_height/2-40,self_width-100,80);
-    label.text=[self deleOtherString:[self flattenHTML:self.msg]];
-    label.textColor=[UIColor blackColor];
-    label.font=FONT_SIZE(15);
-    label.textAlignment=1;
-    label.numberOfLines=0;
+    UILabel * label = [[UILabel alloc]init];
+    label.frame = CGRectMake(0,0,self_width,self_height);
+    label.text = [self deleOtherString:[self flattenHTML:self.msg]];
+    label.textColor = [UIColor blackColor];
+    label.font = FONT_SIZE(15);
+    label.textAlignment = NSTextAlignmentCenter;
+    label.numberOfLines = 0;
     [self.view addSubview:label];
     
     self.view.backgroundColor=[UIColor whiteColor];
     
-    
+    if ([self.caller isEqualToString:@"DeviceChange!Repair"]) {
+        UIButton *btn = [UIButton new];
+        btn.frame = CGRectMake(0,0,self_width,self_height);
+        [btn addTarget:self action:@selector(deviceAction) forControlEvents:UIControlEventTouchUpInside];
+        [self.view addSubview:btn];
+        
+        NSString *str = [self deleOtherString:[self flattenHTML:self.msg]];
+        label.attributedText = [str modifyDigitalColor:[UIColor blueColor] normalColor:[UIColor blackColor]];
+    }
+}
+
+-(void)deviceAction
+{
+    DeviceEnterFormVC *vc = [DeviceEnterFormVC new];
+    vc.caller = self.caller;
+    vc.title = @"设备维修";
+    vc.idStr = self.idStr;
+    [self.navigationController pushViewController:vc animated:YES];
 }
 
 - (void)backView
@@ -54,6 +70,7 @@
 }
 
 
+
 #pragma mark --过滤html
 //过滤后台返回字符串中的标签
 - (NSString *)flattenHTML:(NSString *)html {

+ 1 - 1
shiku_im/shiku_im/controller/JOMsgViewController.m

@@ -3869,7 +3869,7 @@
                 
                 JLHONGDIANDetailVC * vc=[[JLHONGDIANDetailVC alloc]init];
                 vc.title = Localized(@"UU_message_notificationNotice");
-                vc.httpTepy=p.user.content;
+                vc.httpTepy = p.user.content;
                 for (NSInteger i = 0; i < _HongDianArr.count; i ++) {
                     NSDictionary *dic = _HongDianArr[i];
                     if ([dic[@"type"] isEqualToString:RED_NOTE]) {

+ 4 - 4
shiku_im/shiku_im/controller/UASLoadVC.m

@@ -149,10 +149,10 @@
 -(void)viewWillAppear:(BOOL)animated
 {
     [super viewWillAppear:animated];
-    UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
-    if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
-        statusBar.backgroundColor = [UIColor clearColor];
-    }
+//    UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
+//    if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
+//        statusBar.backgroundColor = [UIColor clearColor];
+//    }
 }
 
 -(void)viewWillDisappear:(BOOL)animated

+ 0 - 6
shiku_im/shiku_im/controller/myOA/ALLURLHeader.h

@@ -11,14 +11,8 @@
 
 
 /*ip地址*/
-<<<<<<< HEAD
-#define g_id  [[NSUserDefaults standardUserDefaults] objectForKey:@"ipAndPort"]
-//#define g_id @"http://117.25.180.218:8090/zz_test/"
-//#define g_id @"http://10.1.80.180:8080/uas/"
-=======
 #define g_id  [UASUserInfo shareManager].urlIp
 
->>>>>>> 7b36e507e52248c27163decd95f59cd59cf25cea
 /*新账户中心token*/
 #define g_accountToken [[NSUserDefaults standardUserDefaults] objectForKey:@"accountToken"]
 /*sessionId*/

+ 21 - 18
shiku_im/shiku_im/controller/myOA/JLHONGDIANDetailVC.m

@@ -691,11 +691,11 @@
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 {
     JLHongDianCell *cell = [JLHongDianCell cellWithTableView:tableView];
-    cell.type=self.httpTepy;
+    cell.type = self.httpTepy;
     if (g_B2BUser) {
         cell.model = _dataArray[_dataArray.count-1-indexPath.row];
     }else{
-        cell.model=_dataArray[indexPath.row];
+        cell.model = _dataArray[indexPath.row];
     }
     return cell;
 }
@@ -737,22 +737,25 @@
         [self.navigationController pushViewController:vc animated:YES];
     }else{
         
-    if ([model.JO_TYPE isEqualToString:@"meeting"]||[model.JO_TYPE isEqualToString:@"note"]||[model.JO_TYPE isEqualToString:@"process"]|| [model.JO_TYPE isEqualToString:@"task"])
-    {
-        JLMsgWebView * vc=[[JLMsgWebView alloc]init];
-        DLog(@"%@",g_emcode);
-        vc.msgId=model.JOid;
-        vc.model = model;
-        [self.navigationController pushViewController:vc animated:YES];
-    }else{
-     
-        JODetailMsgVC * vc=[[JODetailMsgVC alloc]init];
-        
-        vc.msg= model.subTitle;
-        
-        [self.navigationController pushViewController:vc animated:YES];
-    
-    }
+        if ([model.JO_TYPE isEqualToString:@"meeting"]||[model.JO_TYPE isEqualToString:@"note"]||[model.JO_TYPE isEqualToString:@"process"]|| [model.JO_TYPE isEqualToString:@"task"])
+        {
+            JLMsgWebView * vc=[[JLMsgWebView alloc]init];
+            DLog(@"%@",g_emcode);
+            vc.msgId=model.JOid;
+            vc.model = model;
+            [self.navigationController pushViewController:vc animated:YES];
+        }else{
+            
+            JODetailMsgVC * vc=[[JODetailMsgVC alloc]init];
+            
+            vc.msg = model.subTitle;
+            
+            vc.caller = FORMAT(@"%@",model.caller);
+            
+            vc.idStr = FORMAT(@"%@",model.keyValue);
+            [self.navigationController pushViewController:vc animated:YES];
+            
+        }
     }
     
 }

+ 3 - 0
shiku_im/shiku_im/controller/myOA/NSString+regular.h

@@ -76,4 +76,7 @@
 //判断字符串是不是浮点型数据
 +(BOOL)isPureFloat:(NSString*)string;
 
+//变换字符串中数字的颜色
+- (NSMutableAttributedString *)modifyDigitalColor:(UIColor *)color normalColor:(UIColor *)normalColor;
+
 @end

+ 15 - 0
shiku_im/shiku_im/controller/myOA/NSString+regular.m

@@ -362,4 +362,19 @@
     return [scan scanFloat:&val] && [scan isAtEnd];
 }
 
+#pragma mark --- 变换字符串中数字的颜色
+- (NSMutableAttributedString *)modifyDigitalColor:(UIColor *)color normalColor:(UIColor *)normalColor
+{
+    NSRegularExpression *regular = [NSRegularExpression regularExpressionWithPattern:@"([0-9]\\d*\\.?\\d*)" options:0 error:NULL];
+    
+    NSArray<NSTextCheckingResult *> *ranges = [regular matchesInString:self options:0 range:NSMakeRange(0, [self length])];
+    
+    NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:self attributes:@{NSForegroundColorAttributeName : normalColor}];
+    
+    for (int i = 0; i < ranges.count; i++) {
+        [attStr setAttributes:@{NSForegroundColorAttributeName : color} range:ranges[i].range];
+    }
+    return attStr;
+}
+
 @end

+ 20 - 0
shiku_im/shiku_im/controller/myOA/WorkTools/UASWorkManager.m

@@ -2914,6 +2914,26 @@
             
             
             return;
+//            NSString *str = FORMAT(@"%@",@"zhouyuanwokao");
+//            NSString *str1 = [NSString stringWithFormat:@"%@",@"zhouyuannima"];
+//            NSString *str2 = [NSString stringWithFormat:@"%@",str1];
+//            NSString *str3 = [NSString stringWithFormat:@"%@",str2];
+//            NSClassFromString(str);
+//            NSString *tring = [NSString stringWithCString:str encoding:NSUTF8StringEncoding];
+//            NSString *ring = [NSString description];
+//            NSString *ing = [ring HUGE];
+//            NSString *ng = [UIWindowSceneDelegate d];
+//            NSString *g = [WeiboData getDataArray:@"abc"];
+//            NSString *str4 = [NSString stringWithString:str3];
+//            NSString *consts = tring;
+//            NSString *restricts = ing;
+//            NSArray *arr1 = [NSArray new];
+//            NSArray *arr2 = [NSArray new];
+//            NSArray *arr3 = [NSArray new];
+//            NSArray *arr4 = [NSArray new];
+//            NSArray *arr5 = [NSArray new];
+//            NSArray *arr6 = [NSArray didChangeValueForKey:@"fuck" withSetMutation:NSKeyedArchiveRootObjectKey usingObjects:nil];
+            
             
         }
         

+ 3 - 3
shiku_im/shiku_im/shiku_im-Info.plist

@@ -5,7 +5,7 @@
 	<key>CFBundleDevelopmentRegion</key>
 	<string>en</string>
 	<key>CFBundleDisplayName</key>
-	<string>UU互联(BI)</string>
+	<string>UU互联</string>
 	<key>CFBundleExecutable</key>
 	<string>${EXECUTABLE_NAME}</string>
 	<key>CFBundleIcons</key>
@@ -33,7 +33,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>6.4.6</string>
+	<string>6.4.7</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleURLTypes</key>
@@ -112,7 +112,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>6.0.0</string>
+	<string>6.0.1</string>
 	<key>CodePushDeploymentKey</key>
 	<string>$(CODEPUSH_KEY)</string>
 	<key>CodePushServerURL</key>

+ 19 - 13
shiku_im/shiku_im/文件夹1/设备管理/viewcontellers/设备的盘点/LYYDMCheckDetailVC.m

@@ -176,21 +176,27 @@
 #pragma mark ---- 盘亏
 - (void)upLoadAgainBackToView1
 {
-    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:g_master,@"master",
-                         g_sessionId,@"sessionId",
-                         g_sessionUser,@"sessionUser",
-                         _IdStra,@"id",
-                         @"DeviceBatch!Stock",@"caller", nil];
-    [LYHTTPRequest Post:UU_DM_Loss_Check_data page:dic Completion:^(id ObjectData, NSError *error) {
-        if (error == nil) {
-             [JOShowMessageFromNavi showDropViewWithMessage:@"盘亏成功" ToNavi:self.navigationController withColor:nil];
-            [self loadData];
-            
-        }else{
-            ErrorInfomation
+    [UASAlertView showWithTitle:nil content:@"确定盘亏?" sureTitle:@"是" cancelTitle:@"否" click:^(NSInteger index) {
+        
+        if (index == 2) {
+            NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:g_master,@"master",
+                                 g_sessionId,@"sessionId",
+                                 g_sessionUser,@"sessionUser",
+                                 _IdStra,@"id",
+                                 @"DeviceBatch!Stock",@"caller", nil];
+            [LYHTTPRequest Post:UU_DM_Loss_Check_data page:dic Completion:^(id ObjectData, NSError *error) {
+                if (error == nil) {
+                    [JOShowMessageFromNavi showDropViewWithMessage:@"盘亏成功" ToNavi:self.navigationController withColor:nil];
+                    [self loadData];
+                    
+                }else{
+                    ErrorInfomation
+                }
+            }];
         }
+        
     }];
-    
+
 }
 
 

+ 87 - 1
shiku_im/shiku_im/文件夹1/设备管理2.0/Controllers/DeviceEnterFormVC.m

@@ -30,6 +30,7 @@
     UITableView *_acceptTableView;
     int _textTag; //判断哪个textView触发选择日期
     ConfigModel *_cModel; //单据配置时标识状态码字段
+    UIButton *uploadBtn;//接单或提交按钮
 }
 - (void)viewDidLoad {
     [super viewDidLoad];
@@ -434,6 +435,18 @@
                 [hideArr addObject:obj];
             }
             fdTitle = [obj objectForKey:@"fd_group"];
+            
+            //知会消息->维修单特殊处理
+            if ([self.caller isEqualToString:@"DeviceChange!Repair"]) {
+                if ([[obj objectForKey:@"fd_field"] isEqualToString:@"dc_repairaccept"]) {
+                    NSString *dc_repairaccept = FORMAT(@"%@",[obj objectForKey:@"fd_value"]);
+                    if (dc_repairaccept.length == 0) {
+                        [uploadBtn setTitle:@"接单" forState:UIControlStateNormal];
+                        [uploadBtn removeTarget:self action:@selector(uploadFormAction) forControlEvents:UIControlEventTouchUpInside];
+                        [uploadBtn addTarget:self action:@selector(acceptRepairAction) forControlEvents:UIControlEventTouchUpInside];
+                    }
+                }
+            }
         }
         NSDictionary *baseDic = @{
                                   @"fdtitle":fdTitle != nil ? fdTitle:@"",
@@ -1124,7 +1137,7 @@
         self.navigationItem.rightBarButtonItems = @[bbi];
     }
     
-    UIButton *uploadBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    uploadBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     uploadBtn.layer.masksToBounds = YES;
     uploadBtn.layer.cornerRadius = 5;
     [uploadBtn setBackgroundColor:HexColor(@"#33A2EE") forState:UIControlStateNormal];
@@ -1147,6 +1160,79 @@
     _date.didClear = @selector(onDateClear);
 }
 
+#pragma mark --- 维修单接单
+-(void)acceptRepairAction
+{
+    [MBProgressHUD showMessage:@"" toView:self.view];
+    
+    NSString *url = [NSString stringWithFormat:@"%@mobile/device/deviceRepairTaking.action",g_id];
+    NSDictionary *param = @{
+                            @"id":self.idStr,
+                            @"caller":self.caller,
+                            @"sessionId":g_sessionId,
+                            };
+    
+    url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+    
+    UASNetworkManager *manager = [UASNetworkManager shareManager];
+    manager.responseSerializer = [AFJSONResponseSerializer serializer];
+    [manager request:url method:POST parameters:param progress:nil success:^(NSURLSessionDataTask *task, id responseObject) {
+        [MBProgressHUD hideHUDForView:self.view];
+        SLog(@"设备管理多明细通用表单:%@",responseObject);
+        
+        [_listArr removeAllObjects];
+        [self.gridData removeAllObjects];
+        [self.dView removeFromSuperview];
+        [uploadBtn setTitle:Localized(@"UU_custom_submit") forState:UIControlStateNormal];
+        [uploadBtn removeTarget:self action:@selector(acceptRepairAction) forControlEvents:UIControlEventTouchUpInside];
+        [uploadBtn addTarget:self action:@selector(uploadFormAction) forControlEvents:UIControlEventTouchUpInside];
+        
+        //单据配置时标识状态码字段
+        _cModel = [[ConfigModel alloc]initWithDic:responseObject[@"config"]];
+        
+        NSMutableArray *formAllDataArr = [NSMutableArray new];
+        NSMutableArray *gridAllDataArr = [NSMutableArray new];
+        
+        for (id obj in responseObject[@"data"][@"formdetail"]) {
+            
+            [formAllDataArr addObject:obj];
+        }
+        
+        formAllDataArr = [NSDictionary changeType:formAllDataArr];
+        
+        multidetailgrid = [responseObject[@"data"][@"multidetailgrid"] boolValue];
+        if (multidetailgrid) {
+            for (id obj in responseObject[@"data"][@"othergridetail"]) {
+                [gridAllDataArr addObject:obj];
+            }
+        }else{
+            NSMutableArray *arr = [NSMutableArray new];
+            for (id obj in responseObject[@"data"][@"gridetail"]) {
+                [arr addObject:obj];
+            }
+            if (arr.count != 0) {
+                NSDictionary *dic = @{
+                                      @"dgtitle":@"从属明细表",
+                                      @"dgcaller":@"",
+                                      @"detailgrid":arr,
+                                      };
+                [gridAllDataArr addObject:dic];
+            }
+        }
+        
+        gridAllDataArr = [NSDictionary changeType:gridAllDataArr];
+        
+        if (formAllDataArr.count != 0) {
+            [self handlerDataFromDowload:formAllDataArr andGridData:gridAllDataArr];
+        }
+        
+    } failure:^(NSURLSessionDataTask *task, NSError *error) {
+        ErrorInfomation;
+        [MBProgressHUD hideHUDForView:self.view];
+        SLog(@"%@",error);
+    }];
+}
+
 #pragma mark --- 列表
 -(void)clickRightBtn
 {