Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
xffruit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
xffruit
Commits
d357fa51
Commit
d357fa51
authored
Sep 05, 2015
by
freecui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交新建加工单接口
parent
9ce3345a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
698 additions
and
158 deletions
+698
-158
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+12
-0
ICRDataBaseController.m
...it/Controllers/DataBaseController/ICRDataBaseController.m
+2
-1
ICRHTTPController.h
XFFruit/Controllers/HTTPController/ICRHTTPController.h
+20
-0
ICRHTTPController.m
XFFruit/Controllers/HTTPController/ICRHTTPController.m
+122
-83
ICRAppMacro.h
XFFruit/Macro/ICRAppMacro.h
+2
-2
ICRNotificationMacro.h
XFFruit/Macro/ICRNotificationMacro.h
+10
-0
GXFProductUnit.h
XFFruit/ViewControllers/GXFCommon/GXFProductUnit.h
+22
-0
GXFProductUnit.m
XFFruit/ViewControllers/GXFCommon/GXFProductUnit.m
+20
-0
GXFSearchVendorViewController.m
...llers/GXFCommon/GXFSelect/GXFSearchVendorViewController.m
+24
-7
ICRHomeViewController.m
.../ViewControllers/Home/Controllers/ICRHomeViewController.m
+3
-4
GXFNewProcessViewController.h
...rollers/Process/Controllers/GXFNewProcessViewController.h
+1
-1
GXFNewProcessViewController.m
...rollers/Process/Controllers/GXFNewProcessViewController.m
+198
-8
GXFSeeProcessViewController.h
...rollers/Process/Controllers/GXFSeeProcessViewController.h
+13
-0
GXFSeeProcessViewController.m
...rollers/Process/Controllers/GXFSeeProcessViewController.m
+63
-0
GXFBottomView.h
XFFruit/ViewControllers/Process/Views/GXFBottomView.h
+7
-0
GXFBottomView.m
XFFruit/ViewControllers/Process/Views/GXFBottomView.m
+29
-8
GXFPopNewMaterialViewController.m
...ntrollers/Process/Views/GXFPopNewMaterialViewController.m
+42
-7
GXFPopNewProductViewController.h
...ontrollers/Process/Views/GXFPopNewProductViewController.h
+3
-1
GXFPopNewProductViewController.m
...ontrollers/Process/Views/GXFPopNewProductViewController.m
+103
-35
GXFProcessBill.h
XFFruit/ViewControllers/Process/Views/GXFProcessBill.h
+1
-1
Localizable.strings
XFFruit/zh-Hans.lproj/Localizable.strings
+1
-0
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
d357fa51
...
...
@@ -52,6 +52,8 @@
35321F6D1B98C66400E5C670
/* GXFButtonAndLineView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35321F6C1B98C66400E5C670
/* GXFButtonAndLineView.m */
;
};
358432EE1B993BAF007E73ED
/* GXFProcessMaterialTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
358432ED1B993BAF007E73ED
/* GXFProcessMaterialTableViewCell.m */
;
};
358432F11B993BD8007E73ED
/* GXFProcessProductTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
358432F01B993BD8007E73ED
/* GXFProcessProductTableViewCell.m */
;
};
358432F41B994EDD007E73ED
/* GXFSeeProcessViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
358432F31B994EDD007E73ED
/* GXFSeeProcessViewController.m */
;
};
358432F71B998ED2007E73ED
/* GXFProductUnit.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
358432F61B998ED2007E73ED
/* GXFProductUnit.m */
;
};
35A1C3551B8EFBBF004AC9F7
/* PermissionJson in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35A1C3541B8EFBBF004AC9F7
/* PermissionJson */
;
};
35A1C3581B8F09D2004AC9F7
/* GXFFunctionDB.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35A1C3571B8F09D2004AC9F7
/* GXFFunctionDB.m */
;
};
35B9B40E1B8FFB59009851CC
/* GXFFunctionDBHelper.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35B9B40D1B8FFB59009851CC
/* GXFFunctionDBHelper.m */
;
};
...
...
@@ -478,6 +480,10 @@
358432ED1B993BAF007E73ED
/* GXFProcessMaterialTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFProcessMaterialTableViewCell.m
;
sourceTree
=
"<group>"
;
};
358432EF1B993BD8007E73ED
/* GXFProcessProductTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GXFProcessProductTableViewCell.h
;
sourceTree
=
"<group>"
;
};
358432F01B993BD8007E73ED
/* GXFProcessProductTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFProcessProductTableViewCell.m
;
sourceTree
=
"<group>"
;
};
358432F21B994EDD007E73ED
/* GXFSeeProcessViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GXFSeeProcessViewController.h
;
sourceTree
=
"<group>"
;
};
358432F31B994EDD007E73ED
/* GXFSeeProcessViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFSeeProcessViewController.m
;
sourceTree
=
"<group>"
;
};
358432F51B998ED2007E73ED
/* GXFProductUnit.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GXFProductUnit.h
;
sourceTree
=
"<group>"
;
};
358432F61B998ED2007E73ED
/* GXFProductUnit.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFProductUnit.m
;
sourceTree
=
"<group>"
;
};
35A1C3541B8EFBBF004AC9F7
/* PermissionJson */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text
;
path
=
PermissionJson
;
sourceTree
=
"<group>"
;
};
35A1C3561B8F09D2004AC9F7
/* GXFFunctionDB.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GXFFunctionDB.h
;
sourceTree
=
"<group>"
;
};
35A1C3571B8F09D2004AC9F7
/* GXFFunctionDB.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFFunctionDB.m
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1014,6 +1020,8 @@
35321F691B97EF3600E5C670
/* GXFPopNewProductViewController.m */
,
35CF337F1B9542BE001211EF
/* GXFNewProcessViewController.h */
,
35CF33801B9542BE001211EF
/* GXFNewProcessViewController.m */
,
358432F21B994EDD007E73ED
/* GXFSeeProcessViewController.h */
,
358432F31B994EDD007E73ED
/* GXFSeeProcessViewController.m */
,
);
path
=
Controllers
;
sourceTree
=
"<group>"
;
...
...
@@ -1053,6 +1061,8 @@
35CF33911B95B419001211EF
/* GXFCommon */
=
{
isa
=
PBXGroup
;
children
=
(
358432F51B998ED2007E73ED
/* GXFProductUnit.h */
,
358432F61B998ED2007E73ED
/* GXFProductUnit.m */
,
35CF33961B96BB02001211EF
/* GXFPaging.h */
,
35CF33971B96BB02001211EF
/* GXFPaging.m */
,
35CF33921B95B419001211EF
/* GXFSelect(选择内容) */
,
...
...
@@ -2495,6 +2505,7 @@
C15918451AC062460013B391
/* IBTBadgeView.m in Sources */
,
7281A0C81B89BFE60052B1AC
/* Vendor.m in Sources */
,
C15295C31B2451AC00DF60D1
/* ICRQReseachViewController.m in Sources */
,
358432F71B998ED2007E73ED
/* GXFProductUnit.m in Sources */
,
C15918531AC062460013B391
/* IBTUINavigationController.m in Sources */
,
C11A346F1B247BDB00079129
/* ICRAnswerDetail.m in Sources */
,
C1ADF7411ACE6EFD007258A8
/* UIViewController+LogicController.m in Sources */
,
...
...
@@ -2515,6 +2526,7 @@
FE0C9B091B7C543D00335B39
/* User.m in Sources */
,
C1E093041AC8E8E0003B7126
/* ICRCheckBox.m in Sources */
,
C1864A561B0B0D9D00D11C4E
/* ICRPostTask.m in Sources */
,
358432F41B994EDD007E73ED
/* GXFSeeProcessViewController.m in Sources */
,
FE2FCC7F1B74511000BBC6FB
/* ChooseProductViewController.m in Sources */
,
351CFF5E1B90633700F30866
/* GXFNoticeFunctionTableViewCell.m in Sources */
,
FE2FCC881B7492C500BBC6FB
/* ResultDetailViewController.m in Sources */
,
...
...
XFFruit/Controllers/DataBaseController/ICRDataBaseController.m
View file @
d357fa51
...
...
@@ -25,6 +25,7 @@
#import "Survey.h"
#import "Vendor.h"
#import "Warehouse.h"
#import "GXFProductUnit.h"
#define ICR_DB_ERROR_PARAMETER @"Parse Error: Bad Parameter(s)"
...
...
@@ -96,7 +97,7 @@ static NSString *ICRDataBasePath = @"";
[
_m_dbQueue
inDatabase
:
^
(
FMDatabase
*
db
)
{
NSArray
*
tableNameArr
=
@[
[
Product
class
],[
User
class
],[
Survey
class
],[
Vendor
class
],[
Warehouse
class
]];
@[
[
Product
class
],[
User
class
],[
Survey
class
],[
Vendor
class
],[
Warehouse
class
]
,[
GXFProductUnit
class
]
];
NSMutableArray
*
sqlBatch
=
[
NSMutableArray
array
];
NSString
*
sql
=
nil
;
...
...
XFFruit/Controllers/HTTPController/ICRHTTPController.h
View file @
d357fa51
...
...
@@ -231,6 +231,26 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//1.7 商品单位
-
(
void
)
getProductunitWithPage_number
:(
NSUInteger
)
page_number
page_size
:(
NSUInteger
)
page_size
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//7.1 保存加工单(写)
-
(
void
)
saveProcessWithAuthenticode
:(
id
)
data
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//7.2 获取加工单列表(读)
-
(
void
)
processQueryWithBillData
:(
id
)
data
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//7.3 加工单明细(读) [已实现]
-
(
void
)
getResultWithProcessUuid
:(
NSString
*
)
processUuid
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
@end
...
...
XFFruit/Controllers/HTTPController/ICRHTTPController.m
View file @
d357fa51
...
...
@@ -79,7 +79,12 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
//供应商
XFFHttp_GetVendor
,
//仓库
XFFHttp_GetWarehouse
XFFHttp_GetWarehouse
,
//商品单位
XFFHttp_GetProductunit
,
//加工单
XFFHttp_QueryProcess
,
XFFHttp_GetProcess
};
static
NSString
*
const
ICRHTTPInterface
[]
=
{
...
...
@@ -140,6 +145,11 @@ static NSString * const ICRHTTPInterface[] = {
[
XFFHttp_GetVendor
]
=
@"data/vendor/download"
,
//仓库
[
XFFHttp_GetWarehouse
]
=
@"data/warehouse/download"
,
//商品单位
[
XFFHttp_GetProductunit
]
=
@"data/productunit"
,
//加工单
[
XFFHttp_QueryProcess
]
=
@"process/query"
,
[
XFFHttp_GetProcess
]
=
@"process/get"
,
};
...
...
@@ -1620,46 +1630,6 @@ acceptTypeJson:YES
failure
:
(
void
(
^
)(
id
))
fail
{
[
self
p_getDownloadWithICRHTTPAction
:
XFFHttp_GetVendor
ClassName
:
@"Vendor"
Page_number
:
page_number
page_size
:
page_size
success
:
succ
failure
:
fail
];
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
// objectClass:NSClassFromString( @"Vendor" )
// deleteLocal:YES
// handleData:NULL
// complete:complete
// fail:fail];
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSString *dateStr = @"2015-05-04";
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetVendor] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// [self GET:encodeUrlStr
// parameters:NULL
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
//仓库
-
(
void
)
getWarehouseWithPage_number
:
(
NSUInteger
)
page_number
...
...
@@ -1668,48 +1638,15 @@ acceptTypeJson:YES
failure
:
(
void
(
^
)(
id
))
fail
{
[
self
p_getDownloadWithICRHTTPAction
:
XFFHttp_GetWarehouse
ClassName
:
@"Warehouse"
Page_number
:
page_number
page_size
:
page_size
success
:
succ
failure
:
fail
];
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
// objectClass:NSClassFromString( @"Warehouse" )
// deleteLocal:YES
// handleData:NULL
// complete:complete
// fail:fail];
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSString *dateStr = @"2015-05-04";
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetWarehouse] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// [self GET:encodeUrlStr
// parameters:NULL
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
getProductunitWithPage_number
:
(
NSUInteger
)
page_number
page_size
:
(
NSUInteger
)
page_size
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
[
self
p_postDownloadWithICRHTTPAction
:
XFFHttp_GetProductunit
ClassName
:
@"GXFProductUnit"
Page_number
:
page_number
page_size
:
page_size
success
:
succ
failure
:
fail
];
}
//私有方法
-
(
void
)
p_getDownloadWithICRHTTPAction
:
(
NSUInteger
)
urlAction
ClassName
:
(
NSString
*
)
class_Name
Page_number
:
(
NSUInteger
)
page_number
...
...
@@ -1766,7 +1703,7 @@ acceptTypeJson:YES
fail
(
error
);
}
};
NSString
*
dateStr
=
@"2015-05-04"
;
NSString
*
dateStr
=
[[
NSDate
date
]
httpParameterString
]
;
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
urlAction
]
stringByAppendingFormat
:
@"?startDate=%@&pageNumber=%@&pageSize=%@"
,
dateStr
,
@
(
page_number
),
@
(
page_size
)];
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
...
...
@@ -1788,4 +1725,106 @@ acceptTypeJson:YES
}
//7.1 保存加工单(写)
-
(
void
)
saveProcessWithAuthenticode
:
(
id
)
data
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
if
(
!
data
)
{
if
(
fail
)
{
fail
(
[[
self
class
]
ErrorWithMsg
:
ERROR_PARAMETER
code
:
0
]
);
}
return
;
}
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
CLog
(
@"%@"
,
responseObject
);
if
(
succ
)
{
succ
(
responseObject
);
}
};
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
CLog
(
@"%@"
,
error
);
if
(
fail
)
{
fail
(
error
);
}
};
NSDictionary
*
dict
=
data
;
NSString
*
currentTime
=
[[
NSDate
date
]
httpParameterString
];
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
XFFHttp_SurveySave
]
stringByAppendingFormat
:
@"?time=%@&operId=%@&operName=%@"
,
currentTime
,
userUtil
.
userCode
,
userUtil
.
displayName
];
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
[
self
POST
:
encodeUrlStr
parameters
:
dict
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
//7.2 获取加工单列表(读)
-
(
void
)
processQueryWithBillData
:
(
id
)
data
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
CLog
(
@"%@"
,
responseObject
);
if
(
succ
)
{
succ
(
responseObject
);
}
};
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
CLog
(
@"%@"
,
error
);
if
(
fail
)
{
fail
(
error
);
}
};
NSDictionary
*
dict
=
data
;
NSString
*
urlStr
=
[[
self
class
]
UrlForPluginHTTPAction
:
XFFHttp_QueryProcess
];
[
self
GET
:
urlStr
parameters
:
dict
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
//7.3 加工单明细(读) [已实现]
-
(
void
)
getResultWithProcessUuid
:
(
NSString
*
)
processUuid
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
if
(
!
processUuid
)
{
if
(
fail
)
{
fail
(
[[
self
class
]
ErrorWithMsg
:
ERROR_PARAMETER
code
:
0
]
);
}
return
;
}
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
CLog
(
@"%@"
,
responseObject
);
if
(
succ
)
{
succ
(
responseObject
);
}
};
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
CLog
(
@"%@"
,
error
);
if
(
fail
)
{
fail
(
error
);
}
};
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
XFFHttp_GetProcess
]
stringByAppendingFormat
:
@"/%@"
,
processUuid
];
//CFURLCreateStringByAddingPercentEscapes stringByAddingPercentEscapesUsingEncoding 对url的编码问题
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
[
self
GET
:
encodeUrlStr
parameters
:
nil
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
@end
XFFruit/Macro/ICRAppMacro.h
View file @
d357fa51
...
...
@@ -50,8 +50,8 @@
#define GXF_LABLE_TINT_COLOR HexColor(@"444444")
#define GXF_LABLE_BG_COLOR XXFBgColor
#define GXF_GREEN_COLOR HexColor(@"50bd62")
#define GXF_ORIGIN_COLOR HexColor(@"f69100")
#define
GXF_ORIGIN_COLOR HexColor(@"f69100")
#define GXF_GRAY_COLOR HexColor(@"444444")
//字体大小
#define GXF_LABLE_FONT FontSize(15)
...
...
XFFruit/Macro/ICRNotificationMacro.h
View file @
d357fa51
...
...
@@ -10,4 +10,14 @@
#define XFFruit_ICRNotificationMacro_h
#define KNOTIFICATION_changeIsSelectedFunctions @"KNOTIFICATION_changeIsSelectedFunctions"
//Avatar
#define KNOTIFICATION_saveMaterial @"KNOTIFICATION_saveMaterial"
#define KNOTIFICATION_editMaterial @"KNOTIFICATION_editMaterial"
#define KNOTIFICATION_saveProduct @"KNOTIFICATION_saveProduct"
#define KNOTIFICATION_editProduct @"KNOTIFICATION_editProduct"
#define KNOTIFICATION_deleteProduct @"KNOTIFICATION_deleteProduct"
#endif
XFFruit/ViewControllers/GXFCommon/GXFProductUnit.h
0 → 100644
View file @
d357fa51
//
// ProductUnit.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface
GXFProductUnit
:
IBTModel
@property
(
nonatomic
,
copy
)
NSString
*
uuid
;
//唯一标识
@property
(
nonatomic
,
copy
)
NSString
*
name
;
//名称
@property
(
nonatomic
,
assign
)
BOOL
enabled
;
//是否启用
@property
(
nonatomic
,
strong
)
NSDate
*
create_time
;
//创建时间
@property
(
nonatomic
,
copy
)
NSString
*
create_id
;
//创建人代码
@property
(
nonatomic
,
copy
)
NSString
*
crete_operName
;
//创建人名称
@property
(
nonatomic
,
strong
)
NSDate
*
lastModified_time
;
//最后修改时间
@property
(
nonatomic
,
copy
)
NSString
*
lastModified_id
;
//最后修改人代码
@property
(
nonatomic
,
copy
)
NSString
*
lastModified_operName
;
//最后修改人名称
@end
XFFruit/ViewControllers/GXFCommon/GXFProductUnit.m
0 → 100644
View file @
d357fa51
//
// ProductUnit.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFProductUnit.h"
@implementation
GXFProductUnit
+
(
NSDictionary
*
)
specialKeysAndReplaceKeys
{
return
@{
@"sID"
:
[[
self
class
]
PrimaryKey
],
};
}
+
(
NSString
*
)
PrimaryKey
{
return
@"uuid"
;
}
@end
XFFruit/ViewControllers/GXFCommon/GXFSelect/GXFSearchVendorViewController.m
View file @
d357fa51
...
...
@@ -13,6 +13,7 @@
#import "Vendor.h"
#import "Product.h"
#import "Warehouse.h"
#import "GXFProductUnit.h"
@interface
GXFSearchVendorViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
GXFSearchViewDelegate
>
{
...
...
@@ -81,21 +82,25 @@
NSInteger
pageNumber
=
0
;
NSInteger
pageSize
=
100
;
//判断选择
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"ProductTitle"
]])
{
[[
ICRHTTPController
sharedController
]
getProductWithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"VendorTitle"
]])
{
[[
ICRHTTPController
sharedController
]
getVendorWithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"WarehouseTitle"
]])
{
[[
ICRHTTPController
sharedController
]
getWarehouseWithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"ProductUnitTitle"
]])
{
[[
ICRHTTPController
sharedController
]
getProductunitWithPage_number
:
pageNumber
page_size
:
pageSize
success
:
succ
failure
:
fail
];
}
else
{
}
[[
ICRHTTPController
sharedController
]
getVendorWithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
//
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
}
/*
...
...
@@ -129,6 +134,9 @@
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"WarehouseTitle"
]])
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ ORDER BY %@"
,
[
Warehouse
TableName
],
@"uuid"
];
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"ProductUnitTitle"
]])
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ ORDER BY %@"
,
[
GXFProductUnit
TableName
],
@"uuid"
];
}
else
{
}
...
...
@@ -165,7 +173,11 @@
fetchBlock
:
fetchBlk
fetchResultsBlock
:
fetchResultsBlk
];
}
else
{
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"ProductUnitTitle"
]])
{
[
dbCtrl
runFetchForClass
:[
GXFProductUnit
class
]
fetchBlock
:
fetchBlk
fetchResultsBlock
:
fetchResultsBlk
];
}
else
{
}
...
...
@@ -261,7 +273,8 @@
if
(
self
.
dataArr
.
count
>
0
)
{
NSString
*
proStr
;
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"ProductTitle"
]])
{
Product
*
product
=
_dataArr
[
indexPath
.
row
];
proStr
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"VendorTitle"
]])
{
Vendor
*
vendor
=
self
.
dataArr
[
indexPath
.
row
];
proStr
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
vendor
.
name
,
vendor
.
code
];
...
...
@@ -308,14 +321,18 @@
NSString
*
textStr
;
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"ProductTitle"
]])
{
Product
*
product
=
self
.
dataArr
[
indexPath
.
row
];
textStr
=
product
.
name
;
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"VendorTitle"
]])
{
Vendor
*
vendor
=
self
.
dataArr
[
indexPath
.
row
];
textStr
=
vendor
.
name
;
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"WarehouseTitle"
]])
{
Warehouse
*
warehouse
=
self
.
dataArr
[
indexPath
.
row
];
textStr
=
warehouse
.
name
;
}
else
{
}
else
if
([
self
.
title
isEqualToString
:[
IBTCommon
localizableString
:
@"ProductUnitTitle"
]])
{
GXFProductUnit
*
productunit
=
self
.
dataArr
[
indexPath
.
row
];
textStr
=
productunit
.
name
;
}
else
{
}
...
...
XFFruit/ViewControllers/Home/Controllers/ICRHomeViewController.m
View file @
d357fa51
...
...
@@ -32,7 +32,7 @@
#import "GXFFunction.h"
#import "GXFNoticeFunctionTableViewCell.h"
#import "GXFFunctionCollectionViewCell.h"
#import "GXFSeeProcessViewController.h"
...
...
@@ -276,9 +276,8 @@ static NSString *collectionCellID = @"collectionCell";
}
break
;
case
kFunctionSeeProcessing
:{
// PurchaseViewController *pvc = [[PurchaseViewController alloc]init];
// pvc.title = @"采购单";
// [self PushViewController:pvc animated:YES];
GXFSeeProcessViewController
*
seeProcessVC
=
[[
GXFSeeProcessViewController
alloc
]
init
];
[
self
PushViewController
:
seeProcessVC
animated
:
YES
];
}
break
;
default
:
...
...
XFFruit/ViewControllers/Process/Controllers/GXFNewProcessViewController.h
View file @
d357fa51
...
...
@@ -8,7 +8,7 @@
#import "ICRBaseViewController.h"
@interface
GXFNewProcessViewController
:
ICRBase
ViewController
@interface
GXFNewProcessViewController
:
UI
ViewController
@end
XFFruit/ViewControllers/Process/Controllers/GXFNewProcessViewController.m
View file @
d357fa51
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Process/Controllers/GXFSeeProcessViewController.h
0 → 100644
View file @
d357fa51
//
// GXFSeeProcessViewController.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
GXFSeeProcessViewController
:
UIViewController
@end
XFFruit/ViewControllers/Process/Controllers/GXFSeeProcessViewController.m
0 → 100644
View file @
d357fa51
//
// GXFSeeProcessViewController.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFSeeProcessViewController.h"
@interface
GXFSeeProcessViewController
()
@end
@implementation
GXFSeeProcessViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
//[strongSelf fetchtSurveyList:data];
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSDictionary
*
queryOrderDict
=
@{
@"direction"
:
@"desc"
,
@"field"
:
@"billNumber"
};
NSDictionary
*
dict
=
@{
@"billNumberLike"
:
@""
,
@"state"
:
@""
,
@"titleLike"
:
@""
,
@"queryOrders"
:
@[
queryOrderDict
],
@"pageNumber"
:
@
(
0
),
@"pageSize"
:
@
(
20
)};
[[
ICRHTTPController
sharedController
]
querySurveyWithBillData
:
dict
success
:
succ
failure
:
fail
];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
XFFruit/ViewControllers/Process/Views/GXFBottomView.h
View file @
d357fa51
...
...
@@ -22,8 +22,15 @@ typedef NS_ENUM(NSInteger, buttonTag){
};
@property
(
nonatomic
,
weak
)
id
<
GXFBottomViewDelegate
>
delegate
;
@property
(
nonatomic
,
strong
)
UIButton
*
f_leftBtn
;
@property
(
nonatomic
,
strong
)
UIButton
*
f_rightBtn
;
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
LeftBtnTitle
:
(
NSString
*
)
leftTitle
rightBtnTitle
:
(
NSString
*
)
rightTitle
;
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
leftButtonColor
:
(
UIColor
*
)
leftBtnColor
rightButtonColor
:
(
UIColor
*
)
rightBtnColor
LeftBtnTitle
:
(
NSString
*
)
leftTitle
rightBtnTitle
:
(
NSString
*
)
rightTitle
;
@end
XFFruit/ViewControllers/Process/Views/GXFBottomView.m
View file @
d357fa51
...
...
@@ -16,8 +16,7 @@
#define LEFT_BUTTON_COLOR HexColor(@"50bd62")
#define RIGHT_BUTTON_COLOR HexColor(@"f69100")
@interface
GXFBottomView
()
@property
(
nonatomic
,
strong
)
UIButton
*
c_leftBtn
;
@property
(
nonatomic
,
strong
)
UIButton
*
c_rightBtn
;
@end
@implementation
GXFBottomView
...
...
@@ -29,27 +28,49 @@
CGRect
leftRect
=
CGRectMake
(
LEFT_PADDING
,
TOP_PADDING
,
BUTTON_WIDTH
,
BUTTON_HEIGHT
);
UIButton
*
leftBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
leftRect
target
:
self
sel
:
@selector
(
leftBtnClicked
)
tag
:
leftTag
image
:
nil
title
:
leftTitle
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
LEFT_BUTTON_COLOR
];
self
.
c
_leftBtn
=
leftBtn
;
[
self
addSubview
:
_
c
_leftBtn
];
self
.
f
_leftBtn
=
leftBtn
;
[
self
addSubview
:
_
f
_leftBtn
];
CGRect
rightRect
=
CGRectMake
(
leftBtn
.
right
+
LEFT_PADDING
,
TOP_PADDING
,
BUTTON_WIDTH
,
BUTTON_HEIGHT
);
UIButton
*
rightBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
rightRect
target
:
self
sel
:
@selector
(
rightBtnClicked
)
tag
:
rightTag
image
:
nil
title
:
rightTitle
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
RIGHT_BUTTON_COLOR
];
self
.
c
_rightBtn
=
rightBtn
;
[
self
addSubview
:
_
c
_rightBtn
];
self
.
f
_rightBtn
=
rightBtn
;
[
self
addSubview
:
_
f
_rightBtn
];
return
self
;
}
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
leftButtonColor
:
(
UIColor
*
)
leftBtnColor
rightButtonColor
:
(
UIColor
*
)
rightBtnColor
LeftBtnTitle
:
(
NSString
*
)
leftTitle
rightBtnTitle
:
(
NSString
*
)
rightTitle
{
self
=
[
super
initWithFrame
:
frame
];
if
(
!
self
)
{
return
nil
;
}
CGRect
leftRect
=
CGRectMake
(
LEFT_PADDING
,
TOP_PADDING
,
BUTTON_WIDTH
,
BUTTON_HEIGHT
);
UIButton
*
leftBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
leftRect
target
:
self
sel
:
@selector
(
leftBtnClicked
)
tag
:
leftTag
image
:
nil
title
:
leftTitle
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
leftBtnColor
];
self
.
f_leftBtn
=
leftBtn
;
[
self
addSubview
:
_f_leftBtn
];
CGRect
rightRect
=
CGRectMake
(
leftBtn
.
right
+
LEFT_PADDING
,
TOP_PADDING
,
BUTTON_WIDTH
,
BUTTON_HEIGHT
);
UIButton
*
rightBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
rightRect
target
:
self
sel
:
@selector
(
rightBtnClicked
)
tag
:
rightTag
image
:
nil
title
:
rightTitle
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
rightBtnColor
];
self
.
f_rightBtn
=
rightBtn
;
[
self
addSubview
:
_f_rightBtn
];
return
self
;
}
-
(
void
)
leftBtnClicked
{
if
([
_delegate
respondsToSelector
:
@selector
(
bottomViewleftButtonClicked
:)])
{
[
_delegate
bottomViewleftButtonClicked
:
_
c
_leftBtn
];
[
_delegate
bottomViewleftButtonClicked
:
_
f
_leftBtn
];
}
}
-
(
void
)
rightBtnClicked
{
if
([
_delegate
respondsToSelector
:
@selector
(
bottomViewRightButtonClicked
:)])
{
[
_delegate
bottomViewRightButtonClicked
:
_
c
_rightBtn
];
[
_delegate
bottomViewRightButtonClicked
:
_
f
_rightBtn
];
}
}
...
...
XFFruit/ViewControllers/Process/Views/GXFPopNewMaterialViewController.m
View file @
d357fa51
...
...
@@ -17,8 +17,12 @@
#import "GXFTableViewCell.h"
#import "StartTimeView.h"
#import "GXFProcessMaterial.h"
#import "GXFSearchVendorViewController.h"
#import "Product.h"
@interface
GXFPopNewMaterialViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
UITextFieldDelegate
,
StartTimeViewDelegate
,
GXFBottomViewDelegate
>
{
StartTimeView
*
_startTimeView
;
}
@property
(
nonatomic
,
strong
)
UIView
*
c_bgView
;
...
...
@@ -28,6 +32,9 @@
@property
(
nonatomic
,
strong
)
NSArray
*
d_lableTextArr
;
@property
(
nonatomic
,
strong
)
GXFProcessMaterial
*
d_processMaterial
;
@property
(
nonatomic
,
strong
)
NSIndexPath
*
d_dateIndexPath
;
@property
(
nonatomic
,
assign
)
BOOL
d_hasSaved
;
@property
(
nonatomic
,
strong
)
GXFBottomView
*
c_bottomV
;
@end
@implementation
GXFPopNewMaterialViewController
...
...
@@ -40,7 +47,6 @@
-
(
void
)
initData
{
self
.
d_leftArr
=
@[
@"原料商品:"
,
@"入库日期:"
,
@"产地:"
,
@"品质描述:"
,
@"基础数量"
,
@"基础单价:"
,
@"总金额:"
,
@"备注:"
,];
self
.
d_rightArr
=
@[
@"选择商品"
,
@""
,
@"输入产地"
,
@"输入品质描述"
,
@"基础数量"
,
@"基础单价"
,
@"总金额"
,
@"输入备注内容"
];
...
...
@@ -59,9 +65,10 @@
[
self
.
view
addSubview
:
_c_tableView
];
GXFBottomView
*
bottomV
=
[[
GXFBottomView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
_c_tableView
.
bottom
,
self
.
view
.
width
,
BottomViewHeight
)
LeftBtnTitle
:
@"结束
"
rightBtnTitle
:
@"保存"
];
GXFBottomView
*
bottomV
=
[[
GXFBottomView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
_c_tableView
.
bottom
,
self
.
view
.
width
,
BottomViewHeight
)
leftButtonColor
:
GXF_ORIGIN_COLOR
rightButtonColor
:
GXF_GREEN_COLOR
LeftBtnTitle
:
@"删除"
rightBtnTitle
:
@"保存"
];
// [[GXFBottomView alloc]initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, BottomViewHeight) LeftBtnTitle:@"删除
" rightBtnTitle:@"保存"];
bottomV
.
delegate
=
self
;
[
self
.
view
addSubview
:
bottomV
];
self
.
c_bottomV
=
bottomV
;
[
self
.
view
addSubview
:
_c_bottomV
];
...
...
@@ -72,7 +79,7 @@
// [self registerForKeyboardNotifications];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
//
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
#pragma UITableViewDataSource
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
...
...
@@ -103,14 +110,14 @@
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
GXFTableViewCell
*
xfCell
;
xfCell
.
width
=
_c_tableView
.
width
;
if
(
indexPath
.
row
==
1
)
{
if
(
indexPath
.
row
==
0
||
indexPath
.
row
==
1
)
{
xfCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
arrowCell
];
if
(
!
xfCell
)
{
xfCell
=
[[
GXFTableViewCell
alloc
]
initWithWidth
:
_c_tableView
.
width
Style
:
UITableViewCellStyleDefault
reuseIdentifier
:
arrowCell
textFieldPlaceholder
:
_d_rightArr
[
indexPath
.
row
]
isEdit
:
NO
];
xfCell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
}
}
else
if
(
indexPath
.
row
==
0
||
indexPath
.
row
==
2
||
indexPath
.
row
==
3
||
indexPath
.
row
==
7
)
{
}
else
if
(
indexPath
.
row
==
2
||
indexPath
.
row
==
3
||
indexPath
.
row
==
7
)
{
xfCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
noLblCell
];
//-
if
(
!
xfCell
)
{
xfCell
=
[[
GXFTableViewCell
alloc
]
initWithWidth
:
_c_tableView
.
width
Style
:
UITableViewCellStyleDefault
reuseIdentifier
:
arrowCell
textFieldPlaceholder
:
_d_rightArr
[
indexPath
.
row
]
isEdit
:
YES
];
...
...
@@ -136,7 +143,20 @@
}
#pragma UITableViewDelegate
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
GXFTableViewCell
*
xfCell
=
(
GXFTableViewCell
*
)[
_c_tableView
cellForRowAtIndexPath
:
indexPath
];
if
(
indexPath
.
row
==
0
)
{
GXFSearchVendorViewController
*
vc
=
[[
GXFSearchVendorViewController
alloc
]
initWithTitle
:[
IBTCommon
localizableString
:
@"ProductTitle"
]];
vc
.
choseVendor
=
^
(
NSArray
*
vendors
){
if
(
vendors
.
count
>
0
)
{
Product
*
product
=
vendors
[
0
];
xfCell
.
f_textField
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
_d_processMaterial
.
productUuid
=
product
.
uuid
;
_d_processMaterial
.
productCode
=
product
.
code
;
_d_processMaterial
.
productName
=
product
.
name
;
}
};
[
self
PushViewController
:
vc
animated
:
YES
];
}
if
(
indexPath
.
row
==
1
)
{
[
self
startDatePickView
];
self
.
d_dateIndexPath
=
indexPath
;
...
...
@@ -232,6 +252,21 @@
break
;
}
return
YES
;
}
#pragma GXFBottomViewDelegate
-
(
void
)
bottomViewleftButtonClicked
:
(
UIButton
*
)
leftBtn
{
}
-
(
void
)
bottomViewRightButtonClicked
:
(
UIButton
*
)
rightBtn
{
self
.
d_hasSaved
=
YES
;
[
self
.
c_bottomV
.
f_rightBtn
setBackgroundColor
:
GXF_GRAY_COLOR
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_saveMaterial
object
:
_d_processMaterial
];
}
//- (void)setTableFrame: (CGFloat)tableOffset {
// [UIView animateWithDuration:0.25 animations:^{
...
...
XFFruit/ViewControllers/Process/Views/GXFPopNewProductViewController.h
View file @
d357fa51
...
...
@@ -7,7 +7,9 @@
//
#import <UIKit/UIKit.h>
@class
GXFProcessProduct
;
@interface
GXFPopNewProductViewController
:
UIViewController
-
(
instancetype
)
initWithProcessProduct
:
(
GXFProcessProduct
*
)
processProduct
isEdit
:
(
BOOL
)
isEdited
;
@end
XFFruit/ViewControllers/Process/Views/GXFPopNewProductViewController.m
View file @
d357fa51
...
...
@@ -13,6 +13,9 @@
#import "GXFTableViewCell.h"
#import "StartTimeView.h"
#import "GXFProcessProduct.h"
#import "GXFSearchVendorViewController.h"
#import "Product.h"
#import "GXFProductUnit.h"
@interface
GXFPopNewProductViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
UITextFieldDelegate
,
StartTimeViewDelegate
,
GXFBottomViewDelegate
>
{
StartTimeView
*
_startTimeView
;
...
...
@@ -24,9 +27,22 @@
@property
(
nonatomic
,
strong
)
NSArray
*
d_lableTextArr
;
@property
(
nonatomic
,
strong
)
GXFProcessProduct
*
d_processProduct
;
@property
(
nonatomic
,
strong
)
NSIndexPath
*
d_dateIndexPath
;
@property
(
nonatomic
,
assign
)
BOOL
d_hasSaved
;
@property
(
nonatomic
,
strong
)
GXFBottomView
*
c_bottomV
;
@property
(
nonatomic
,
assign
)
BOOL
d_isEdited
;
@end
@implementation
GXFPopNewProductViewController
-
(
instancetype
)
initWithProcessProduct
:(
GXFProcessProduct
*
)
processProduct
isEdit
:
(
BOOL
)
isEdited
{
self
=
[
super
init
];
if
(
!
self
)
{
return
nil
;
}
self
.
d_processProduct
=
processProduct
;
self
.
d_isEdited
=
isEdited
;
return
self
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
title
=
@"新增成品明细"
;
...
...
@@ -39,9 +55,12 @@
-
(
void
)
initData
{
self
.
d_leftArr
=
@[
@"商品:"
,
@"出库时间:"
,
@"包装单位:"
,
@"包装规格:"
,
@"包装数量"
,
@"基础数量:"
,
@"备注:"
,];
self
.
d_rightArr
=
@[
@"选择商品"
,
@"
"
,
@"出库时间"
,
@"选择包装单位"
,
@"
"
,
@"基础数量"
,
@"输入备注内容"
];
self
.
d_rightArr
=
@[
@"选择商品"
,
@"
选择出库时间"
,
@"选择包装单位"
,
@"包装规格"
,
@"包装数量
"
,
@"基础数量"
,
@"输入备注内容"
];
self
.
d_lableTextArr
=
@[
@"斤"
,
@"筐"
,
@"斤"
];
self
.
d_processProduct
=
[[
GXFProcessProduct
alloc
]
init
];
if
(
!
_d_processProduct
)
{
self
.
d_processProduct
=
[[
GXFProcessProduct
alloc
]
init
];
}
}
-
(
void
)
initSubViews
{
...
...
@@ -53,8 +72,9 @@
[
self
.
view
addSubview
:
_c_tableView
];
GXFBottomView
*
bottomV
=
[[
GXFBottomView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
_c_tableView
.
bottom
,
self
.
view
.
width
,
BottomViewHeight
)
LeftBtnTitle
:
@"结束"
rightBtnTitle
:
@"保存"
]
;
GXFBottomView
*
bottomV
=
[[
GXFBottomView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
_c_tableView
.
bottom
,
self
.
view
.
width
,
BottomViewHeight
)
leftButtonColor
:
GXF_ORIGIN_COLOR
rightButtonColor
:
GXF_GREEN_COLOR
LeftBtnTitle
:
@"删除"
rightBtnTitle
:
@"保存"
];
;
bottomV
.
delegate
=
self
;
self
.
c_bottomV
=
bottomV
;
[
self
.
view
addSubview
:
bottomV
];
...
...
@@ -66,7 +86,7 @@
// [self registerForKeyboardNotifications];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
//
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
#pragma UITableViewDataSource
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
...
...
@@ -104,17 +124,75 @@
xfCell
.
selectionStyle
=
UITableViewCellAccessoryNone
;
xfCell
.
f_textField
.
tag
=
indexPath
.
row
;
xfCell
.
textLabel
.
text
=
_d_leftArr
[
indexPath
.
row
];
if
(
_d_isEdited
)
{
switch
(
indexPath
.
row
)
{
case
0
:
xfCell
.
f_textField
.
text
=
_d_processProduct
.
productName
;
break
;
case
1
:
xfCell
.
f_textField
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
_d_processProduct
.
outstockDate
];
break
;
case
2
:
xfCell
.
f_textField
.
text
=
_d_processProduct
.
unit
;
break
;
case
3
:
xfCell
.
f_textField
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
_d_processProduct
.
qpc
];
break
;
case
4
:
xfCell
.
f_textField
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
_d_processProduct
.
quantity
];
break
;
case
5
:
xfCell
.
f_textField
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
_d_processProduct
.
baseQty
];
break
;
case
6
:
xfCell
.
f_textField
.
text
=
_d_processProduct
.
remark
;
break
;
default
:
break
;
}
}
return
xfCell
;
}
#pragma UITableViewDelegate
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
GXFTableViewCell
*
xfCell
=
(
GXFTableViewCell
*
)[
_c_tableView
cellForRowAtIndexPath
:
indexPath
];
if
(
indexPath
.
row
==
0
)
{
GXFSearchVendorViewController
*
vc
=
[[
GXFSearchVendorViewController
alloc
]
initWithTitle
:[
IBTCommon
localizableString
:
@"ProductTitle"
]];
vc
.
choseVendor
=
^
(
NSArray
*
vendors
){
if
(
vendors
.
count
>
0
)
{
Product
*
product
=
vendors
[
0
];
xfCell
.
f_textField
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
_d_processProduct
.
productUuid
=
product
.
uuid
;
_d_processProduct
.
productCode
=
product
.
code
;
_d_processProduct
.
productName
=
product
.
name
;
}
};
[
self
PushViewController
:
vc
animated
:
YES
];
}
if
(
indexPath
.
row
==
1
)
{
[
self
startDatePickView
];
self
.
d_dateIndexPath
=
indexPath
;
}
if
(
indexPath
.
row
==
2
)
{
GXFSearchVendorViewController
*
vc
=
[[
GXFSearchVendorViewController
alloc
]
initWithTitle
:[
IBTCommon
localizableString
:
@"ProductUnitTitle"
]];
vc
.
choseVendor
=
^
(
NSArray
*
vendors
){
if
(
vendors
.
count
>
0
)
{
GXFProductUnit
*
productUnit
=
vendors
[
0
];
xfCell
.
f_textField
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
productUnit
.
name
,
productUnit
.
uuid
];
_d_processProduct
.
productUuid
=
productUnit
.
uuid
;
_d_processProduct
.
productName
=
productUnit
.
name
;
}
};
[
self
PushViewController
:
vc
animated
:
YES
];
}
}
...
...
@@ -192,35 +270,25 @@
}
return
YES
;
}
//- (void)setTableFrame: (CGFloat)tableOffset {
// [UIView animateWithDuration:0.25 animations:^{
// CGRect tableFrame = _c_tableView.frame;
// tableFrame.origin.y -= tableOffset;
// self.c_tableView.frame = tableFrame;
// }];
//}
//- (void)recoverTableViewFrame {
// [UIView animateWithDuration:0.25 animations:^{
// CGRect tableFrame = _c_tableView.frame;
// tableFrame.origin.y = 0;
// self.c_tableView.frame = tableFrame;
// }];
//}
////注册通知观察者
//- (void)registerForKeyboardNotifications {
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];
//
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillBeHidden:) name:UIKeyboardWillHideNotification object:nil];
//}
//
//- (void)keyboardWasShown: (NSNotification *)aNotification {
// NSDictionary *info = [aNotification userInfo];
// CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
//
// [UIView animateWithDuration:0.25 animations:^{
// CGRect tableFrame = _c_tableView.frame;
// tableFrame.origin.y = kbSize.height;
// }];
//}
#pragma GXFBottomViewDelegate
-
(
void
)
bottomViewleftButtonClicked
:
(
UIButton
*
)
leftBtn
{
[
self
.
c_bottomV
.
f_leftBtn
setBackgroundColor
:
GXF_GRAY_COLOR
];
if
(
_d_isEdited
)
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_deleteProduct
object
:
_d_processProduct
];
}
}
-
(
void
)
bottomViewRightButtonClicked
:
(
UIButton
*
)
rightBtn
{
self
.
d_hasSaved
=
YES
;
[
self
.
c_bottomV
.
f_rightBtn
setBackgroundColor
:
GXF_GRAY_COLOR
];
if
(
_d_isEdited
)
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_editProduct
object
:
_d_processProduct
];
}
else
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_saveProduct
object
:
_d_processProduct
];
}
}
@end
XFFruit/ViewControllers/Process/Views/GXFProcessBill.h
View file @
d357fa51
...
...
@@ -25,7 +25,7 @@
@property
(
nonatomic
,
copy
)
NSString
*
warehouse_name
;
//加工工厂姓名
@property
(
nonatomic
,
copy
)
NSString
*
contact
;
//联系人
@property
(
nonatomic
,
copy
)
NSString
*
contactPhone
;
//联系人电话
@property
(
nonatomic
,
copy
)
NS
String
*
total
;
//总金额
@property
(
nonatomic
,
copy
)
NS
Number
*
total
;
//总金额
@property
(
nonatomic
,
copy
)
NSString
*
remark
;
//备注
@property
(
nonatomic
,
strong
)
NSDate
*
create_time
;
//创建时间
@property
(
nonatomic
,
copy
)
NSString
*
create_id
;
// 创建人代码
...
...
XFFruit/zh-Hans.lproj/Localizable.strings
View file @
d357fa51
...
...
@@ -192,3 +192,4 @@
"ProductTitle" = "商品选择";
"VendorTitle" = "供应商";
"WarehouseTitle" = "加工工厂";
"ProductUnitTitle" = "商品单位";
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment