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
97c995b9
Commit
97c995b9
authored
Oct 14, 2015
by
陈俊俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收货单
parent
f605bbb8
Show whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
4129 additions
and
15 deletions
+4129
-15
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+128
-0
GXFFunctionDBHelper.m
XFFruit/Controllers/DataBaseController/GXFFunctionDBHelper.m
+1
-1
ICRHTTPController.h
XFFruit/Controllers/HTTPController/ICRHTTPController.h
+27
-0
ICRHTTPController.m
XFFruit/Controllers/HTTPController/ICRHTTPController.m
+187
-1
ICRFunctionItemControl.h
XFFruit/General/Views/FunctionView/ICRFunctionItemControl.h
+3
-0
Contents.json
...ages.xcassets/首页切图/create_transfer.imageset/Contents.json
+3
-2
create_transfer.png
...cassets/首页切图/create_transfer.imageset/create_transfer.png
+0
-0
create_transfer@2x.png
...sets/首页切图/create_transfer.imageset/create_transfer@2x.png
+0
-0
create_transport-2.png
...s/首页切图/create_transport-2.imageset/create_transport-2.png
+0
-0
ICRNotificationMacro.h
XFFruit/Macro/ICRNotificationMacro.h
+3
-3
IBTConstants.h
XFFruit/Utilities/IBTUIKit/IBTConstants.h
+18
-0
BusinessViewController.m
XFFruit/ViewControllers/Business/BusinessViewController.m
+20
-1
GXFPopView.m
XFFruit/ViewControllers/ChooseViewController/GXFPopView.m
+1
-1
NewReceiveViewController.h
...trollers/Receiving/Controllers/NewReceiveViewController.h
+13
-0
NewReceiveViewController.m
...trollers/Receiving/Controllers/NewReceiveViewController.m
+37
-0
ReceiveDetailViewController.h
...llers/Receiving/Controllers/ReceiveDetailViewController.h
+13
-0
ReceiveDetailViewController.m
...llers/Receiving/Controllers/ReceiveDetailViewController.m
+37
-0
ReceiveViewController.h
...Controllers/Receiving/Controllers/ReceiveViewController.h
+13
-0
ReceiveViewController.m
...Controllers/Receiving/Controllers/ReceiveViewController.m
+424
-0
ReceiveBoltView.h
XFFruit/ViewControllers/Receiving/Views/ReceiveBoltView.h
+23
-0
ReceiveBoltView.m
XFFruit/ViewControllers/Receiving/Views/ReceiveBoltView.m
+158
-0
ChooseTransportViewController.h
...lers/Transfer/Controllers/ChooseTransportViewController.h
+15
-0
ChooseTransportViewController.m
...lers/Transfer/Controllers/ChooseTransportViewController.m
+279
-0
NewTransferViewController.h
...trollers/Transfer/Controllers/NewTransferViewController.h
+14
-0
NewTransferViewController.m
...trollers/Transfer/Controllers/NewTransferViewController.m
+448
-0
TransferDetailViewController.h
...llers/Transfer/Controllers/TransferDetailViewController.h
+13
-0
TransferDetailViewController.m
...llers/Transfer/Controllers/TransferDetailViewController.m
+306
-0
TransferProductViewController.h
...lers/Transfer/Controllers/TransferProductViewController.h
+16
-0
TransferProductViewController.m
...lers/Transfer/Controllers/TransferProductViewController.m
+195
-0
TransferViewController.h
...Controllers/Transfer/Controllers/TransferViewController.h
+13
-0
TransferViewController.m
...Controllers/Transfer/Controllers/TransferViewController.m
+458
-0
Transfer.h
XFFruit/ViewControllers/Transfer/Models/Transfer.h
+37
-0
Transfer.m
XFFruit/ViewControllers/Transfer/Models/Transfer.m
+13
-0
TransferPdtDetail.h
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.h
+29
-0
TransferPdtDetail.m
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.m
+13
-0
BottomTransferView.h
XFFruit/ViewControllers/Transfer/Views/BottomTransferView.h
+41
-0
BottomTransferView.m
XFFruit/ViewControllers/Transfer/Views/BottomTransferView.m
+186
-0
TopTransferView.h
XFFruit/ViewControllers/Transfer/Views/TopTransferView.h
+40
-0
TopTransferView.m
XFFruit/ViewControllers/Transfer/Views/TopTransferView.m
+246
-0
TransferBoltView.h
XFFruit/ViewControllers/Transfer/Views/TransferBoltView.h
+27
-0
TransferBoltView.m
XFFruit/ViewControllers/Transfer/Views/TransferBoltView.m
+265
-0
TransferCell.h
XFFruit/ViewControllers/Transfer/Views/TransferCell.h
+27
-0
TransferCell.m
XFFruit/ViewControllers/Transfer/Views/TransferCell.m
+110
-0
TransferProductCell.h
XFFruit/ViewControllers/Transfer/Views/TransferProductCell.h
+35
-0
TransferProductCell.m
XFFruit/ViewControllers/Transfer/Views/TransferProductCell.m
+169
-0
NewCostViewController.m
...Controllers/Transport/Controllers/NewCostViewController.m
+1
-1
NewTransportViewController.m
...ollers/Transport/Controllers/NewTransportViewController.m
+10
-2
TransportDetailViewController.m
...ers/Transport/Controllers/TransportDetailViewController.m
+1
-1
TransportViewController.m
...ntrollers/Transport/Controllers/TransportViewController.m
+1
-1
TransportPurchaseCell.h
...t/ViewControllers/Transport/Views/TransportPurchaseCell.h
+2
-1
TransportPurchaseCell.m
...t/ViewControllers/Transport/Views/TransportPurchaseCell.m
+10
-0
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
97c995b9
...
...
@@ -117,6 +117,17 @@
724171721B9D30660094DF55
/* ChooseWarehouseViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7241716C1B9D30660094DF55
/* ChooseWarehouseViewController.m */
;
};
724171731B9D30660094DF55
/* ChosePersonViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7241716E1B9D30660094DF55
/* ChosePersonViewController.m */
;
};
724171761B9D30DE0094DF55
/* ChooseCostViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
724171751B9D30DE0094DF55
/* ChooseCostViewController.m */
;
};
72805CF31BB8E1B0009E1F82
/* TransferViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805CF21BB8E1B0009E1F82
/* TransferViewController.m */
;
};
72805CF61BB8E20B009E1F82
/* NewTransferViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805CF51BB8E20B009E1F82
/* NewTransferViewController.m */
;
};
72805CF91BB8E227009E1F82
/* TransferDetailViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805CF81BB8E227009E1F82
/* TransferDetailViewController.m */
;
};
72805CFC1BB8E4F8009E1F82
/* TransferCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805CFB1BB8E4F8009E1F82
/* TransferCell.m */
;
};
72805CFF1BB8E592009E1F82
/* TransferBoltView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805CFE1BB8E592009E1F82
/* TransferBoltView.m */
;
};
72805D021BB8E6BE009E1F82
/* Transfer.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805D011BB8E6BE009E1F82
/* Transfer.m */
;
};
72805D051BB8ED6D009E1F82
/* TopTransferView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805D041BB8ED6D009E1F82
/* TopTransferView.m */
;
};
72805D081BB8F22B009E1F82
/* BottomTransferView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805D071BB8F22B009E1F82
/* BottomTransferView.m */
;
};
72805D0B1BB8F318009E1F82
/* TransferProductViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805D0A1BB8F318009E1F82
/* TransferProductViewController.m */
;
};
72805D0E1BB8F46B009E1F82
/* TransferProductCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805D0D1BB8F46B009E1F82
/* TransferProductCell.m */
;
};
72805D111BB8F6E4009E1F82
/* TransferPdtDetail.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72805D101BB8F6E4009E1F82
/* TransferPdtDetail.m */
;
};
7281A0B31B8974120052B1AC
/* NewPurchaseViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7281A0AA1B8974120052B1AC
/* NewPurchaseViewController.m */
;
};
7281A0B41B8974120052B1AC
/* ProductBillViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7281A0AC1B8974120052B1AC
/* ProductBillViewController.m */
;
};
7281A0B61B8974120052B1AC
/* TopPurchaseView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7281A0B21B8974120052B1AC
/* TopPurchaseView.m */
;
};
...
...
@@ -128,6 +139,11 @@
72873CEB1BA27BA6007B3387
/* GXFPopView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72873CEA1BA27BA6007B3387
/* GXFPopView.m */
;
};
72873CEE1BA280DD007B3387
/* GXFPopCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72873CED1BA280DD007B3387
/* GXFPopCell.m */
;
};
72882D8B1BA9121E00935BA6
/* ChooseProductUnitViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72882D8A1BA9121E00935BA6
/* ChooseProductUnitViewController.m */
;
};
72A8132D1BCA8BBA003631F3
/* ChooseTransportViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72A8132C1BCA8BBA003631F3
/* ChooseTransportViewController.m */
;
};
72A813FA1BCD3205003631F3
/* ReceiveViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72A813F71BCD3205003631F3
/* ReceiveViewController.m */
;
};
72A813FD1BCD33BE003631F3
/* ReceiveBoltView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72A813FC1BCD33BE003631F3
/* ReceiveBoltView.m */
;
};
72A814001BCD3B0A003631F3
/* NewReceiveViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72A813FF1BCD3B0A003631F3
/* NewReceiveViewController.m */
;
};
72A814031BCD3C6C003631F3
/* ReceiveDetailViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72A814021BCD3C6C003631F3
/* ReceiveDetailViewController.m */
;
};
72B3C0C11B9D3C7300025D81
/* CostViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72B3C0AC1B9D3C7300025D81
/* CostViewController.m */
;
};
72B3C0C21B9D3C7300025D81
/* NewCostViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72B3C0AE1B9D3C7300025D81
/* NewCostViewController.m */
;
};
72B3C0C31B9D3C7300025D81
/* NewTransportViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72B3C0B01B9D3C7300025D81
/* NewTransportViewController.m */
;
};
...
...
@@ -631,6 +647,28 @@
7241716E1B9D30660094DF55
/* ChosePersonViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ChosePersonViewController.m
;
sourceTree
=
"<group>"
;
};
724171741B9D30DE0094DF55
/* ChooseCostViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ChooseCostViewController.h
;
sourceTree
=
"<group>"
;
};
724171751B9D30DE0094DF55
/* ChooseCostViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ChooseCostViewController.m
;
sourceTree
=
"<group>"
;
};
72805CF11BB8E1B0009E1F82
/* TransferViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TransferViewController.h
;
sourceTree
=
"<group>"
;
};
72805CF21BB8E1B0009E1F82
/* TransferViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TransferViewController.m
;
sourceTree
=
"<group>"
;
};
72805CF41BB8E20B009E1F82
/* NewTransferViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
NewTransferViewController.h
;
sourceTree
=
"<group>"
;
};
72805CF51BB8E20B009E1F82
/* NewTransferViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
NewTransferViewController.m
;
sourceTree
=
"<group>"
;
};
72805CF71BB8E227009E1F82
/* TransferDetailViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TransferDetailViewController.h
;
sourceTree
=
"<group>"
;
};
72805CF81BB8E227009E1F82
/* TransferDetailViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TransferDetailViewController.m
;
sourceTree
=
"<group>"
;
};
72805CFA1BB8E4F8009E1F82
/* TransferCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TransferCell.h
;
sourceTree
=
"<group>"
;
};
72805CFB1BB8E4F8009E1F82
/* TransferCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TransferCell.m
;
sourceTree
=
"<group>"
;
};
72805CFD1BB8E592009E1F82
/* TransferBoltView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TransferBoltView.h
;
sourceTree
=
"<group>"
;
};
72805CFE1BB8E592009E1F82
/* TransferBoltView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TransferBoltView.m
;
sourceTree
=
"<group>"
;
};
72805D001BB8E6BE009E1F82
/* Transfer.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
Transfer.h
;
sourceTree
=
"<group>"
;
};
72805D011BB8E6BE009E1F82
/* Transfer.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
Transfer.m
;
sourceTree
=
"<group>"
;
};
72805D031BB8ED6D009E1F82
/* TopTransferView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TopTransferView.h
;
sourceTree
=
"<group>"
;
};
72805D041BB8ED6D009E1F82
/* TopTransferView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TopTransferView.m
;
sourceTree
=
"<group>"
;
};
72805D061BB8F22B009E1F82
/* BottomTransferView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BottomTransferView.h
;
sourceTree
=
"<group>"
;
};
72805D071BB8F22B009E1F82
/* BottomTransferView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BottomTransferView.m
;
sourceTree
=
"<group>"
;
};
72805D091BB8F318009E1F82
/* TransferProductViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TransferProductViewController.h
;
sourceTree
=
"<group>"
;
};
72805D0A1BB8F318009E1F82
/* TransferProductViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TransferProductViewController.m
;
sourceTree
=
"<group>"
;
};
72805D0C1BB8F46B009E1F82
/* TransferProductCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TransferProductCell.h
;
sourceTree
=
"<group>"
;
};
72805D0D1BB8F46B009E1F82
/* TransferProductCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TransferProductCell.m
;
sourceTree
=
"<group>"
;
};
72805D0F1BB8F6E4009E1F82
/* TransferPdtDetail.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TransferPdtDetail.h
;
sourceTree
=
"<group>"
;
};
72805D101BB8F6E4009E1F82
/* TransferPdtDetail.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TransferPdtDetail.m
;
sourceTree
=
"<group>"
;
};
7281A0A91B8974120052B1AC
/* NewPurchaseViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
NewPurchaseViewController.h
;
sourceTree
=
"<group>"
;
};
7281A0AA1B8974120052B1AC
/* NewPurchaseViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
NewPurchaseViewController.m
;
sourceTree
=
"<group>"
;
};
7281A0AB1B8974120052B1AC
/* ProductBillViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ProductBillViewController.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -653,6 +691,16 @@
72873CED1BA280DD007B3387
/* GXFPopCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFPopCell.m
;
sourceTree
=
"<group>"
;
};
72882D891BA9121E00935BA6
/* ChooseProductUnitViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ChooseProductUnitViewController.h
;
sourceTree
=
"<group>"
;
};
72882D8A1BA9121E00935BA6
/* ChooseProductUnitViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ChooseProductUnitViewController.m
;
sourceTree
=
"<group>"
;
};
72A8132B1BCA8BBA003631F3
/* ChooseTransportViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ChooseTransportViewController.h
;
sourceTree
=
"<group>"
;
};
72A8132C1BCA8BBA003631F3
/* ChooseTransportViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ChooseTransportViewController.m
;
sourceTree
=
"<group>"
;
};
72A813F61BCD3205003631F3
/* ReceiveViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ReceiveViewController.h
;
sourceTree
=
"<group>"
;
};
72A813F71BCD3205003631F3
/* ReceiveViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ReceiveViewController.m
;
sourceTree
=
"<group>"
;
};
72A813FB1BCD33BE003631F3
/* ReceiveBoltView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ReceiveBoltView.h
;
sourceTree
=
"<group>"
;
};
72A813FC1BCD33BE003631F3
/* ReceiveBoltView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ReceiveBoltView.m
;
sourceTree
=
"<group>"
;
};
72A813FE1BCD3B0A003631F3
/* NewReceiveViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
NewReceiveViewController.h
;
sourceTree
=
"<group>"
;
};
72A813FF1BCD3B0A003631F3
/* NewReceiveViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
NewReceiveViewController.m
;
sourceTree
=
"<group>"
;
};
72A814011BCD3C6C003631F3
/* ReceiveDetailViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ReceiveDetailViewController.h
;
sourceTree
=
"<group>"
;
};
72A814021BCD3C6C003631F3
/* ReceiveDetailViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ReceiveDetailViewController.m
;
sourceTree
=
"<group>"
;
};
72B3C0AB1B9D3C7300025D81
/* CostViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CostViewController.h
;
sourceTree
=
"<group>"
;
};
72B3C0AC1B9D3C7300025D81
/* CostViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CostViewController.m
;
sourceTree
=
"<group>"
;
};
72B3C0AD1B9D3C7300025D81
/* NewCostViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
NewCostViewController.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1369,6 +1417,16 @@
72805CEE1BB79D68009E1F82
/* Controllers */
=
{
isa
=
PBXGroup
;
children
=
(
72805CF11BB8E1B0009E1F82
/* TransferViewController.h */
,
72805CF21BB8E1B0009E1F82
/* TransferViewController.m */
,
72805CF41BB8E20B009E1F82
/* NewTransferViewController.h */
,
72805CF51BB8E20B009E1F82
/* NewTransferViewController.m */
,
72805CF71BB8E227009E1F82
/* TransferDetailViewController.h */
,
72805CF81BB8E227009E1F82
/* TransferDetailViewController.m */
,
72805D091BB8F318009E1F82
/* TransferProductViewController.h */
,
72805D0A1BB8F318009E1F82
/* TransferProductViewController.m */
,
72A8132B1BCA8BBA003631F3
/* ChooseTransportViewController.h */
,
72A8132C1BCA8BBA003631F3
/* ChooseTransportViewController.m */
,
);
path
=
Controllers
;
sourceTree
=
"<group>"
;
...
...
@@ -1376,6 +1434,10 @@
72805CEF1BB79D68009E1F82
/* Models */
=
{
isa
=
PBXGroup
;
children
=
(
72805D001BB8E6BE009E1F82
/* Transfer.h */
,
72805D011BB8E6BE009E1F82
/* Transfer.m */
,
72805D0F1BB8F6E4009E1F82
/* TransferPdtDetail.h */
,
72805D101BB8F6E4009E1F82
/* TransferPdtDetail.m */
,
);
path
=
Models
;
sourceTree
=
"<group>"
;
...
...
@@ -1383,6 +1445,16 @@
72805CF01BB79D68009E1F82
/* Views */
=
{
isa
=
PBXGroup
;
children
=
(
72805CFA1BB8E4F8009E1F82
/* TransferCell.h */
,
72805CFB1BB8E4F8009E1F82
/* TransferCell.m */
,
72805CFD1BB8E592009E1F82
/* TransferBoltView.h */
,
72805CFE1BB8E592009E1F82
/* TransferBoltView.m */
,
72805D031BB8ED6D009E1F82
/* TopTransferView.h */
,
72805D041BB8ED6D009E1F82
/* TopTransferView.m */
,
72805D061BB8F22B009E1F82
/* BottomTransferView.h */
,
72805D071BB8F22B009E1F82
/* BottomTransferView.m */
,
72805D0C1BB8F46B009E1F82
/* TransferProductCell.h */
,
72805D0D1BB8F46B009E1F82
/* TransferProductCell.m */
,
);
path
=
Views
;
sourceTree
=
"<group>"
;
...
...
@@ -1442,6 +1514,45 @@
path
=
Views
;
sourceTree
=
"<group>"
;
};
72A813F11BCD3117003631F3
/* Receiving */
=
{
isa
=
PBXGroup
;
children
=
(
72A813F51BCD3205003631F3
/* Controllers */
,
72A813F81BCD3205003631F3
/* models */
,
72A813F91BCD3205003631F3
/* Views */
,
);
path
=
Receiving
;
sourceTree
=
"<group>"
;
};
72A813F51BCD3205003631F3
/* Controllers */
=
{
isa
=
PBXGroup
;
children
=
(
72A813F61BCD3205003631F3
/* ReceiveViewController.h */
,
72A813F71BCD3205003631F3
/* ReceiveViewController.m */
,
72A813FE1BCD3B0A003631F3
/* NewReceiveViewController.h */
,
72A813FF1BCD3B0A003631F3
/* NewReceiveViewController.m */
,
72A814011BCD3C6C003631F3
/* ReceiveDetailViewController.h */
,
72A814021BCD3C6C003631F3
/* ReceiveDetailViewController.m */
,
);
path
=
Controllers
;
sourceTree
=
"<group>"
;
};
72A813F81BCD3205003631F3
/* models */
=
{
isa
=
PBXGroup
;
children
=
(
);
path
=
models
;
sourceTree
=
"<group>"
;
};
72A813F91BCD3205003631F3
/* Views */
=
{
isa
=
PBXGroup
;
children
=
(
72A813FB1BCD33BE003631F3
/* ReceiveBoltView.h */
,
72A813FC1BCD33BE003631F3
/* ReceiveBoltView.m */
,
);
path
=
Views
;
sourceTree
=
"<group>"
;
};
72B3C0A91B9D3C7300025D81
/* Transport */
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -2155,6 +2266,7 @@
C1C6FEED1AB88A3400D4C41A
/* ViewControllers */
=
{
isa
=
PBXGroup
;
children
=
(
72A813F11BCD3117003631F3
/* Receiving */
,
72805CED1BB79D68009E1F82
/* Transfer */
,
72B3C0A91B9D3C7300025D81
/* Transport */
,
724171641B9D30660094DF55
/* ChooseViewController */
,
...
...
@@ -2543,9 +2655,11 @@
35B448DF1B9B0A73001209E2
/* ProductBillCell.m in Sources */
,
30D7495F1ACE8F4400C63BA1
/* ICRConfigurationViewController.m in Sources */
,
724171721B9D30660094DF55
/* ChooseWarehouseViewController.m in Sources */
,
72805D111BB8F6E4009E1F82
/* TransferPdtDetail.m in Sources */
,
FE2FCC821B745E1A00BBC6FB
/* SurveyDetailViewController.m in Sources */
,
0414FF171B94959700C7B00E
/* NewPurchaseNoticeViewController.m in Sources */
,
35CF33901B95AF1B001211EF
/* GXFBaseSearchViewController.m in Sources */
,
72805D0E1BB8F46B009E1F82
/* TransferProductCell.m in Sources */
,
04E721E31BA755FD008F9158
/* ProductUnit.m in Sources */
,
FE2FCC8B1B74A9EE00BBC6FB
/* SurveyResultCell.m in Sources */
,
C182E40E1AD4CE0B009BB9DB
/* IBTModel.m in Sources */
,
...
...
@@ -2600,6 +2714,7 @@
C123A9331B27BDCD003C0C36
/* ICRQResultViewController.m in Sources */
,
C18AEA881AC8D31000A1DB7B
/* IBTUIView.m in Sources */
,
C1FE50501AE024FA00C18080
/* UIActionSheet+Blocks.m in Sources */
,
72805CFC1BB8E4F8009E1F82
/* TransferCell.m in Sources */
,
C123A92B1B26EDDA003C0C36
/* ICRQuestionHelperView.m in Sources */
,
7281A0BF1B8980E60052B1AC
/* PurchaseBill.m in Sources */
,
72F9D4851BA7FFC400795A00
/* PurchaseNotice.m in Sources */
,
...
...
@@ -2617,6 +2732,7 @@
C1C564431AD66C6E006A1050
/* ICRTaskEditViewController.m in Sources */
,
72F9D48B1BA8582100795A00
/* NoticeBoltView.m in Sources */
,
C142D2AA1AC3A155000109A7
/* NSDate+FormatterAdditions.m in Sources */
,
72805CF61BB8E20B009E1F82
/* NewTransferViewController.m in Sources */
,
C1B307A31ADD199600657F11
/* ICRTaskResultContentView.m in Sources */
,
72873CEB1BA27BA6007B3387
/* GXFPopView.m in Sources */
,
721BF46A1BAAA18400255750
/* FooterCell.m in Sources */
,
...
...
@@ -2624,6 +2740,7 @@
7217E9E61B72364300FE5C1D
/* SurveyViewController.m in Sources */
,
C10214E41AD9141E0024637E
/* ICRAnnouncementViewController.m in Sources */
,
C1D017281AD8F46700CD9CB8
/* IBTScrollLoadMoreView.m in Sources */
,
72A813FD1BCD33BE003631F3
/* ReceiveBoltView.m in Sources */
,
C18AEA841AC8D2EA00A1DB7B
/* IBTUIButton.m in Sources */
,
C1FE50521AE024FA00C18080
/* UIAlertView+Blocks.m in Sources */
,
351CFF5C1B90633700F30866
/* GXFFunction.m in Sources */
,
...
...
@@ -2635,6 +2752,7 @@
35CF339B1B96E41F001211EF
/* GXFVendorViewController.m in Sources */
,
72B3C0CA1B9D3C7300025D81
/* TransportPurductCell.m in Sources */
,
C142D2B01AC3A155000109A7
/* UIColor+Helper.m in Sources */
,
72A813FA1BCD3205003631F3
/* ReceiveViewController.m in Sources */
,
C142D2AC1AC3A155000109A7
/* NSNull+OVNatural.m in Sources */
,
300DD94A1B184B450080EE12
/* ICRPatrolPlan.m in Sources */
,
72B3C0C61B9D3C7300025D81
/* Transport.m in Sources */
,
...
...
@@ -2652,7 +2770,10 @@
C167F9C11AC8615B00D2A098
/* ICRLoginContentView.m in Sources */
,
C142D2BA1AC3A155000109A7
/* UITabBarItem+Universal.m in Sources */
,
72B3C0DF1B9DC60D00025D81
/* TransportDetailViewController.m in Sources */
,
72A814031BCD3C6C003631F3
/* ReceiveDetailViewController.m in Sources */
,
C1374F561B33C40D00594D19
/* IBTWebProgressBar.m in Sources */
,
72A8132D1BCA8BBA003631F3
/* ChooseTransportViewController.m in Sources */
,
72805D021BB8E6BE009E1F82
/* Transfer.m in Sources */
,
351CFF5A1B90633700F30866
/* ICRHomeViewController.m in Sources */
,
721B5DA21B9FD523006CA199
/* RegexUtil.m in Sources */
,
35B9B40E1B8FFB59009851CC
/* GXFFunctionDBHelper.m in Sources */
,
...
...
@@ -2693,6 +2814,7 @@
721B5DB51BA02A2B006CA199
/* GXFProcessCell.m in Sources */
,
7217E9EA1B72364300FE5C1D
/* BoltMaskView.m in Sources */
,
C11A346B1B2451D500079129
/* NALLabelsMatrix.m in Sources */
,
72805D051BB8ED6D009E1F82
/* TopTransferView.m in Sources */
,
72B3C0C51B9D3C7300025D81
/* FeeAcountDetail.m in Sources */
,
C17DE85A1AD81D1600581AA6
/* NSMutableArray+SafeInsert.m in Sources */
,
721B5DB61BA02A2B006CA199
/* GXFProcessMaterial.m in Sources */
,
...
...
@@ -2705,6 +2827,7 @@
C15295BB1B244C8E00DF60D1
/* ICRQScoreViewController.m in Sources */
,
C123A9221B26ED85003C0C36
/* ICRQuestionManager.m in Sources */
,
C15918801AC4362D0013B391
/* UIApplication+CheckFirstRun.m in Sources */
,
72A814001BCD3B0A003631F3
/* NewReceiveViewController.m in Sources */
,
0460F6711BA8B3FC004A073D
/* FollowUpRecordViewController.m in Sources */
,
C1F696091AB870B400F9F5DD
/* main.m in Sources */
,
30D9D8811AD3AC5A0086EEE7
/* ICRHelpAndFeedBackViewController.m in Sources */
,
...
...
@@ -2713,6 +2836,7 @@
C1E91C471AD77842007B00D4
/* ICRTask.m in Sources */
,
C1D0171B1AD8F0D600CD9CB8
/* IBTSegmentContainer.m in Sources */
,
C10C90991AE56E8700B911CD
/* JTOptionCell.m in Sources */
,
72805D081BB8F22B009E1F82
/* BottomTransferView.m in Sources */
,
35321F671B97EF1100E5C670
/* GXFPopNewMaterialViewController.m in Sources */
,
C1E9F55E1B2E3B9200BF1356
/* JTImagePreviewer.m in Sources */
,
721B5DAD1BA029E1006CA199
/* GXFListProcessViewController.m in Sources */
,
...
...
@@ -2751,7 +2875,9 @@
358432F71B998ED2007E73ED
/* GXFProductUnit.m in Sources */
,
C15918531AC062460013B391
/* IBTUINavigationController.m in Sources */
,
C11A346F1B247BDB00079129
/* ICRAnswerDetail.m in Sources */
,
72805CFF1BB8E592009E1F82
/* TransferBoltView.m in Sources */
,
C1ADF7411ACE6EFD007258A8
/* UIViewController+LogicController.m in Sources */
,
72805D0B1BB8F318009E1F82
/* TransferProductViewController.m in Sources */
,
C1FE503D1AE0235D00C18080
/* IBTAudioServicesManager.m in Sources */
,
7217E9F41B72364300FE5C1D
/* SurveyListCell.m in Sources */
,
C10214D21AD904F30024637E
/* ICRPatrolPlanViewController.m in Sources */
,
...
...
@@ -2782,7 +2908,9 @@
7217E9E71B72364300FE5C1D
/* Attachment.m in Sources */
,
72B3C0C41B9D3C7300025D81
/* TransportPurchaseViewController.m in Sources */
,
30ECD6241B00948A0088C57A
/* ICRPatrolPlanCellContentView.m in Sources */
,
72805CF31BB8E1B0009E1F82
/* TransferViewController.m in Sources */
,
C123A9291B26EDDA003C0C36
/* ICRQInputPopup.m in Sources */
,
72805CF91BB8E227009E1F82
/* TransferDetailViewController.m in Sources */
,
30D702421ADE37D3008DC0BF
/* ICRAnnouncementDetailViewController.m in Sources */
,
FE17F6791B85847D0078CE96
/* QueryOrder.m in Sources */
,
72F9D4821BA7EC9600795A00
/* NoticeProductViewController.m in Sources */
,
...
...
XFFruit/Controllers/DataBaseController/GXFFunctionDBHelper.m
View file @
97c995b9
...
...
@@ -108,7 +108,7 @@
@"create_purchase"
,
@"watch_purchase"
,
@"watch_purchase"
,
@"review_purchase"
,
@"create_transport"
,
@"watch_transort"
,
@"watch_transort"
,
@"create_process"
,
@"watch_process"
,
@"watch_process"
,
@"
新建转运单"
,
@"查看转运单"
,
@"查看转运单
"
];
@"
create_transfer"
,
@"create_transfer"
,
@"create_transfer
"
];
//NSArray *functionsSmallImgName = @[];
NSArray
*
functionItemTag
=
@[
@
(
0
),
...
...
XFFruit/Controllers/HTTPController/ICRHTTPController.h
View file @
97c995b9
...
...
@@ -358,6 +358,33 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
version
:(
NSNumber
*
)
version
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//1.添加转运单
-
(
void
)
saveTransferWithData
:(
id
)
data
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//2.获取转运单列表
-
(
void
)
queryTransferWithData
:(
id
)
data
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//3.获取转运单详情
-
(
void
)
getTransferResultWithTransferUuid
:(
NSString
*
)
transferUuid
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//4.结束转运单
-
(
void
)
endTransferWithTransferUuid
:(
NSString
*
)
transferUuid
version
:(
NSNumber
*
)
version
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//5.作废转运单
-
(
void
)
abortTransferWithTransferUuid
:(
NSString
*
)
transferUuid
version
:(
NSNumber
*
)
version
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
@end
XFFruit/Controllers/HTTPController/ICRHTTPController.m
View file @
97c995b9
...
...
@@ -114,7 +114,17 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
XFFHttp_QueryTransport
,
XFFHttp_GetTransportDetail
,
XFFHttp_EndTransport
,
XFFHttp_AbortTransport
XFFHttp_AbortTransport
,
//转运单
XFFHttp_QueryTransfer
,
XFFHTTP_TransferSave
,
XFFHttp_GetTransferDetail
,
XFFHttp_EndTransfer
,
XFFHttp_AbortTransfer
,
};
static
NSString
*
const
ICRHTTPInterface
[]
=
{
...
...
@@ -211,6 +221,12 @@ static NSString * const ICRHTTPInterface[] = {
[
XFFHttp_GetTransportDetail
]
=
@"transport/get_transport"
,
[
XFFHttp_EndTransport
]
=
@"transport/finish"
,
[
XFFHttp_AbortTransport
]
=
@"transport/abort"
,
[
XFFHTTP_TransferSave
]
=
@"transfer/save_transfer"
,
[
XFFHttp_QueryTransfer
]
=
@"transfer/query_transfer"
,
[
XFFHttp_GetTransferDetail
]
=
@"transfer/get_transfer"
,
[
XFFHttp_EndTransfer
]
=
@"transfer/finish"
,
[
XFFHttp_AbortTransfer
]
=
@"transfer/abort"
,
};
static
NSString
*
const
ICRAttachmentTypeValue
[]
=
{
...
...
@@ -2592,4 +2608,174 @@ acceptTypeJson:YES
}
//获取转运单列表
-
(
void
)
queryTransferWithData
:
(
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_QueryTransfer
];
[
self
POST
:
urlStr
parameters
:
dict
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
//添加转运单
-
(
void
)
saveTransferWithData
:
(
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_TransferSave
]
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
];
}
//获取转运单详情
-
(
void
)
getTransferResultWithTransferUuid
:
(
NSString
*
)
transferUuid
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
if
(
!
transferUuid
)
{
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_GetTransferDetail
]
stringByAppendingFormat
:
@"/%@"
,
transferUuid
];
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
[
self
GET
:
encodeUrlStr
parameters
:
nil
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
-
(
void
)
endTransferWithTransferUuid
:
(
NSString
*
)
transferUuid
version
:
(
NSNumber
*
)
version
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
if
(
!
transferUuid
)
{
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
);
}
};
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
XFFHttp_EndTransfer
]
stringByAppendingFormat
:
@"/%@?version=%@&time=%@&operId=%@&operName=%@"
,
transferUuid
,
version
,[[
NSDate
date
]
httpParameterString
],
userUtil
.
userCode
,
userUtil
.
displayName
];
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
[
self
POST
:
encodeUrlStr
parameters
:
nil
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
-
(
void
)
abortTransferWithTransferUuid
:
(
NSString
*
)
transferUuid
version
:
(
NSNumber
*
)
version
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
if
(
!
transferUuid
)
{
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
);
}
};
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
XFFHttp_AbortTransfer
]
stringByAppendingFormat
:
@"/%@?version=%@&time=%@&operId=%@&operName=%@"
,
transferUuid
,
version
,[[
NSDate
date
]
httpParameterString
],
userUtil
.
userCode
,
userUtil
.
displayName
];
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
[
self
POST
:
encodeUrlStr
parameters
:
nil
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
@end
XFFruit/General/Views/FunctionView/ICRFunctionItemControl.h
View file @
97c995b9
...
...
@@ -26,6 +26,9 @@ typedef NS_ENUM (NSUInteger, ICRFunctionID) {
kFunctionSeeShipment
,
// 查看发运单
kFunctionNewProcessing
,
// 新增加工单
kFunctionSeeProcessing
,
// 查看加工单
kFunctionNewTransfer
,
//新建转运单
kFunctionSeeTransfer
,
//查看发运单
kFunctionSeeReceive
,
//查看收货单
kFunctionAnnouncement
,
...
...
XFFruit/Images.xcassets/首页切图/create_trans
port-2
.imageset/Contents.json
→
XFFruit/Images.xcassets/首页切图/create_trans
fer
.imageset/Contents.json
View file @
97c995b9
...
...
@@ -3,11 +3,12 @@
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
,
"filename"
:
"create_trans
port-2
.png"
"filename"
:
"create_trans
fer
.png"
},
{
"idiom"
:
"universal"
,
"scale"
:
"2x"
"scale"
:
"2x"
,
"filename"
:
"create_transfer@2x.png"
},
{
"idiom"
:
"universal"
,
...
...
XFFruit/Images.xcassets/首页切图/create_transfer.imageset/create_transfer.png
0 → 100644
View file @
97c995b9
3.59 KB
XFFruit/Images.xcassets/首页切图/create_transfer.imageset/create_transfer@2x.png
0 → 100644
View file @
97c995b9
6.08 KB
XFFruit/Images.xcassets/首页切图/create_transport-2.imageset/create_transport-2.png
deleted
100644 → 0
View file @
f605bbb8
2.99 KB
XFFruit/Macro/ICRNotificationMacro.h
View file @
97c995b9
...
...
@@ -11,12 +11,12 @@
#define SetProductTotalPrice @"setProductTotalPrice"
#define KNOTIFICATION_getSelectPurchaseProduct @"KNOTIFICATION_getSelectPurchaseProduct"
#define KNOTIFICATION_ChoseTransportPurchase @"KNOTIFICATION_ChoseTransportPurchase"
#define KNOTIFICATION_ChoseTransportPurchase @"KNOTIFICATION_ChoseTransportPurchase"//选择采购单
#define KNOTIFICATION_ChoseTransportProduct @"KNOTIFICATION_ChoseTransportProduct"//选择发运单
#define KNOTIFICATION_AddPurchaseProduct @"KNOTIFICATION_AddPurchaseProduct"
#define KNOTIFICATION_AddTransportCost @"KNOTIFICATION_AddTransportCost"
#define KNOTIFICATION_changeIsSelectedFunctions @"KNOTIFICATION_changeIsSelectedFunctions"
...
...
XFFruit/Utilities/IBTUIKit/IBTConstants.h
View file @
97c995b9
...
...
@@ -121,6 +121,8 @@
#define PurchaseUpdateDate @"purchaseUpdateDate"
#define TransportUpdateDate @"TransportUpdateDate"
#define PurchaseNoticeUpdateDate @"purchaseNoticeUpdateDate"
#define TransferUpdateDate @"TransferUpdateDate"
#define ChooseTransportUpdateDate @"ChooseTransportUpdateDate"
//行情调研状态
...
...
@@ -180,6 +182,13 @@
#define TRANSPORT_STATE_RECEIVED @"received" //已收货
#define TRANSPORT_STATE_ABORTED @"aborted" //已废用
//发运单权限
#define TRANSPORT_ACTION_FINISH @"500404" //结束权
#define TRANSPORT_ACTION_ABORT @"500505" //作废权
//采购通知单状态
//initial("未提交"), notAccepted("未接受"), purchasing("采购中"), finished("已完成")
#define PURCHASENOTICE_STATE_INITIAL @"initial"
...
...
@@ -193,6 +202,15 @@
#define NOTICE_PERMISSIONS_FINISH @"500306"//结束
//转运单状态
#define TRANSFER_STATE_INITIAL @"initial" //未提交
#define TRANSFER_STATE_UNRECEIVED @"unreceived"//待收货
#define TRANSFER_STATE_RECEIVED @"received" //已收货
#define TRANSFER_STATE_ABORTED @"aborted" //已废用
#define TRANSFER_ACTION_FINISH @"500604" //结束权
#define TRANSFER_ACTION_ABORT @"500605" //作废权
//选中的颜色
#define BASESELECT_COLOR RGBA(255, 127, 0, 1)
...
...
XFFruit/ViewControllers/Business/BusinessViewController.m
View file @
97c995b9
...
...
@@ -26,6 +26,10 @@
#import "TransportViewController.h"
#import"PurchaseNoticeViewController.h"
#import "NewTransferViewController.h"
#import "TransferViewController.h"
#import "ReceiveViewController.h"
#import "GXFFunctionDB.h"
#import "GXFNewProcessViewController.h"
#import "GXFListProcessViewController.h"
...
...
@@ -190,7 +194,22 @@
[
self
PushViewController
:
tVC
animated
:
YES
];
}
break
;
// case kFunctionPatrolPlan://巡店计划
case
kFunctionNewTransfer
:
//新建转运单
{
NewTransferViewController
*
tVC
=
[[
NewTransferViewController
alloc
]
init
];
tVC
.
title
=
@"新建转运单"
;
[
self
PushViewController
:
tVC
animated
:
YES
];
}
break
;
case
kFunctionSeeTransfer
:
//转运单列表
{
TransferViewController
*
tVC
=
[[
TransferViewController
alloc
]
init
];
tVC
.
title
=
@"转运单"
;
[
self
PushViewController
:
tVC
animated
:
YES
];
}
break
;
// case kFunctionPatrolPlan://巡店计划
// {
// ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES];
// [self PushViewController:pVC animated:YES];
...
...
XFFruit/ViewControllers/ChooseViewController/GXFPopView.m
View file @
97c995b9
...
...
@@ -9,7 +9,7 @@
#import "GXFPopView.h"
#import "GXFPopCell.h"
#define GXFPOpView_LeftMargin 20
#define GXFPOpView_ContentHeight 2
0
0
#define GXFPOpView_ContentHeight 2
3
0
#define GXFPOpView_TopHeight 44
@interface
GXFPopView
()
<
UITableViewDelegate
,
UITableViewDataSource
>
...
...
XFFruit/ViewControllers/Receiving/Controllers/NewReceiveViewController.h
0 → 100644
View file @
97c995b9
//
// NewReceiveViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/10/13.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface
NewReceiveViewController
:
ICRBaseViewController
@end
XFFruit/ViewControllers/Receiving/Controllers/NewReceiveViewController.m
0 → 100644
View file @
97c995b9
//
// NewReceiveViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/10/13.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "NewReceiveViewController.h"
@interface
NewReceiveViewController
()
@end
@implementation
NewReceiveViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
}
-
(
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/Receiving/Controllers/ReceiveDetailViewController.h
0 → 100644
View file @
97c995b9
//
// ReceiveDetailViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/10/13.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface
ReceiveDetailViewController
:
ICRBaseViewController
@end
XFFruit/ViewControllers/Receiving/Controllers/ReceiveDetailViewController.m
0 → 100644
View file @
97c995b9
//
// ReceiveDetailViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/10/13.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ReceiveDetailViewController.h"
@interface
ReceiveDetailViewController
()
@end
@implementation
ReceiveDetailViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
}
-
(
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/Receiving/Controllers/ReceiveViewController.h
0 → 100644
View file @
97c995b9
//
// ReceiveViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/10/13.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface
ReceiveViewController
:
ICRBaseViewController
@end
XFFruit/ViewControllers/Receiving/Controllers/ReceiveViewController.m
0 → 100644
View file @
97c995b9
//
// ReceiveViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/10/13.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ReceiveViewController.h"
#import "TransferCell.h"
#import "Transfer.h"
#import "QueryOrder.h"
#import "SortMaskView.h"
#import "ReceiveBoltView.h"
#import "MJRefresh.h"
#import "NewReceiveViewController.h"
#import "ReceiveDetailViewController.h"
#define TopMargin 44
#define TableHeight 140
#define LeftMargin 20
#define BtnWidth 60
#define BtnHeight 24
#define BtnSize 16
typedef
enum
:
NSUInteger
{
SortTag
=
3000
,
BoltTag
}
BtnTag
;
@interface
ReceiveViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
ReceiveBoltViewDelegate
,
SortMaskViewDelegate
>
{
UIView
*
_maskView
;
UIButton
*
currentBtn
;
SortMaskView
*
_sortView
;
ReceiveBoltView
*
_boltView
;
UIBarButtonItem
*
_sureBtn
;
UIButton
*
_sortBtn
;
UIButton
*
_boltBtn
;
BOOL
_isRefresh
;
BOOL
_isLoadMore
;
NSInteger
_currentPage
;
}
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
NSString
*
state
;
@property
(
nonatomic
,
strong
)
NSString
*
orderDirection
;
//asc(升序),desc(降序)
@end
@implementation
ReceiveViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
XXFBgColor
;
[
self
initData
];
[
self
createBackBtn
];
[
self
createTableView
];
[
self
createRefresh
];
[
self
getData
];
}
-
(
void
)
initData
{
self
.
dataArr
=
[
NSMutableArray
array
];
}
-
(
void
)
getData
{
[
ICRUserUtil
sharedInstance
].
needFresh
=
NO
;
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
[
strongSelf
fetchtPuchaseList
:
data
];
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
NSMutableArray
*
orderArr
=
[
NSMutableArray
array
];
if
(
self
.
orderDirection
.
length
>
0
&&
!
[
self
.
orderDirection
isEqualToString
:
@"none"
])
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"lastModified"
;
order
.
direction
=
self
.
orderDirection
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
id
stateObject
=
[
NSNull
null
];
if
(
self
.
state
.
length
>
0
&&
!
[
self
.
state
isEqualToString
:
@"none"
])
{
stateObject
=
self
.
state
;
if
(
self
.
orderDirection
.
length
>
0
&&
!
[
self
.
orderDirection
isEqualToString
:
@"none"
])
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"state"
;
order
.
direction
=
self
.
orderDirection
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
}
else
{
stateObject
=
TRANSFER_STATE_UNRECEIVED
;
}
if
(
orderArr
.
count
==
0
)
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"billNumber"
;
order
.
direction
=
@"desc"
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSDictionary
*
dict
=
@{
@"state"
:
stateObject
,
@"queryOrders"
:
orderArr
,
@"userCode"
:
userUtil
.
userCode
,
@"pageNumber"
:
@
(
_currentPage
),
@"pageSize"
:
@
(
20
)};
[[
ICRHTTPController
sharedController
]
queryTransferWithData
:
dict
success
:
succ
failure
:
fail
];
}
-
(
void
)
fetchtPuchaseList
:
(
id
)
data
{
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
]
;
if
(
success
==
1
)
{
if
(
_currentPage
==
0
)
{
if
(
self
.
dataArr
.
count
>
0
)
{
[
self
.
dataArr
removeAllObjects
];
}
}
NSArray
*
recodesArr
=
data
[
@"data"
][
@"records"
];
for
(
NSDictionary
*
transportDict
in
recodesArr
)
{
Transfer
*
transport
=
[[
Transfer
alloc
]
init
];
[
transport
setValuesForKeysWithDictionary
:
transportDict
];
[
self
.
dataArr
addObject
:
transport
];
}
NSDictionary
*
pageDict
=
data
[
@"data"
][
@"paging"
];
NSInteger
pageCount
=
[
pageDict
[
@"pageCount"
]
integerValue
];
[
self
.
tableView
reloadData
];
[
self
endRefreshing
];
if
(
pageCount
<=
_currentPage
)
{
[
self
.
tableView
.
footer
noticeNoMoreData
];
}
if
(
_currentPage
==
0
&&
self
.
dataArr
.
count
>
0
)
{
[
self
.
tableView
scrollToRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
]
atScrollPosition
:
UITableViewScrollPositionTop
animated
:
YES
];
}
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
else
{
[
IBTLoadingView
showTips
:
@" 无记录 "
];
}
}
-
(
void
)
createRefresh
{
self
.
tableView
.
header
=
[
MJRefreshNormalHeader
headerWithRefreshingBlock
:
^
{
if
(
_isRefresh
)
{
return
;
}
_isRefresh
=
YES
;
_currentPage
=
0
;
[
self
getData
];
}];
self
.
tableView
.
header
.
lastUpdatedTimeKey
=
TransferUpdateDate
;
self
.
tableView
.
footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
_isLoadMore
)
{
return
;
}
_isLoadMore
=
YES
;
_currentPage
++
;
[
self
getData
];
}
];
}
#pragma mark - 结束刷新
-
(
void
)
endRefreshing
{
_isLoadMore
=
NO
;
_isRefresh
=
NO
;
[
self
.
tableView
.
header
endRefreshing
];
[
self
.
tableView
.
footer
endRefreshing
];
}
-
(
void
)
createTableView
{
_sureBtn
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:
@"确定"
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
@selector
(
sureClick
)];
self
.
navigationItem
.
rightBarButtonItem
=
_sureBtn
;
_sortBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
LeftMargin
,
10
,
BtnWidth
,
BtnHeight
)
target
:
self
sel
:
@selector
(
sortClick
:
)
tag
:
SortTag
image
:
@"black_arrow_down_with_text"
title
:
nil
titleColor
:
GXF_DETAIL_COLOR
isCorner
:
NO
corner
:
0
bgColor
:
nil
];
_sortBtn
.
titleLabel
.
font
=
FontSize
(
BtnSize
);
[
self
.
view
addSubview
:
_sortBtn
];
_boltBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
ScreenSize
.
width
-
BtnWidth
-
LeftMargin
,
10
,
BtnWidth
,
BtnHeight
)
target
:
self
sel
:
@selector
(
sortClick
:
)
tag
:
BoltTag
image
:
@"black_filter_with_text"
title
:
nil
titleColor
:
GXF_DETAIL_COLOR
isCorner
:
NO
corner
:
0
bgColor
:
nil
];
_boltBtn
.
titleLabel
.
font
=
FontSize
(
BtnSize
);
[
self
.
view
addSubview
:
_boltBtn
];
self
.
tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
TopMargin
))
style
:(
UITableViewStylePlain
)];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
[
self
.
view
addSubview
:
self
.
tableView
];
_maskView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
TopMargin
)];
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
.
5
);
_maskView
.
hidden
=
YES
;
[
self
.
view
addSubview
:
_maskView
];
}
#pragma mark -按钮事件
-
(
void
)
sortClick
:
(
UIButton
*
)
btn
{
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
.
5
);
_maskView
.
hidden
=
NO
;
if
(
btn
.
tag
==
SortTag
)
{
if
(
_boltView
){
[
self
hiddenBoltMaskView
:
NO
];
}
if
(
currentBtn
==
btn
)
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"black_arrow_down_with_text"
]
forState
:
UIControlStateNormal
];
[
self
hiddenSortMaskView
:
YES
];
currentBtn
=
nil
;
}
else
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"select_arrow_up_text"
]
forState
:
UIControlStateNormal
];
if
(
_sortView
==
nil
)
{
_sortView
=
[[
SortMaskView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
-
105
,
ScreenSize
.
width
,
150
)
withOrderDirection
:
self
.
orderDirection
];
_sortView
.
dataArr
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"按时间顺序"
,
@"按时间逆序"
,
@"默认排序"
,
nil
];
_sortView
.
delegate
=
self
;
[
_maskView
addSubview
:
_sortView
];
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_sortView
.
frame
;
sortFrame
.
origin
.
y
=
0
;
_sortView
.
frame
=
sortFrame
;
}];
}
currentBtn
=
btn
;
}
}
else
if
(
btn
.
tag
==
BoltTag
){
if
(
_sortView
)
{
[
self
hiddenSortMaskView
:
NO
];
}
if
(
currentBtn
==
btn
)
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"black_filter_with_text"
]
forState
:
UIControlStateNormal
];
[
self
hiddenBoltMaskView
:
YES
];
currentBtn
=
nil
;
}
else
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"selected-filter_with_text"
]
forState
:
UIControlStateNormal
];
if
(
_boltView
==
nil
)
{
_boltView
=
[[
ReceiveBoltView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
-
105
,
ScreenSize
.
width
,
274
)
state
:
self
.
state
];
_boltView
.
backgroundColor
=
XXFBgColor
;
_boltView
.
delegate
=
self
;
_boltView
.
dataArr
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"待收货"
,
@"已收货"
,
nil
];
[
_maskView
addSubview
:
_boltView
];
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_boltView
.
frame
;
sortFrame
.
origin
.
y
=
0
;
_boltView
.
frame
=
sortFrame
;
}];
currentBtn
=
btn
;
}
}
}
}
-
(
void
)
hiddenSortMaskView
:
(
BOOL
)
isHide
{
currentBtn
=
nil
;
[
self
checkSortBtnColor
];
if
(
isHide
==
NO
)
{
[
_sortView
removeFromSuperview
];
_sortView
=
nil
;
}
else
{
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_sortView
.
frame
;
sortFrame
.
origin
.
y
=
-
105
;
_sortView
.
frame
=
sortFrame
;
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
);
}
completion
:^
(
BOOL
finished
)
{
[
_sortView
removeFromSuperview
];
_sortView
=
nil
;
_maskView
.
hidden
=
YES
;
}];
}
}
-
(
void
)
hiddenBoltMaskView
:
(
BOOL
)
isHide
{
currentBtn
=
nil
;
[
self
checkBoltBtnColor
];
if
(
isHide
==
NO
)
{
[
_boltView
removeFromSuperview
];
_boltView
=
nil
;
}
else
{
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_boltView
.
frame
;
sortFrame
.
origin
.
y
=
-
105
;
_boltView
.
frame
=
sortFrame
;
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
);
}
completion
:^
(
BOOL
finished
)
{
[
_boltView
removeFromSuperview
];
_boltView
=
nil
;
_maskView
.
hidden
=
YES
;
}];
}
}
//检测排序的颜色
-
(
void
)
checkSortBtnColor
{
if
(
self
.
orderDirection
.
length
>
0
)
{
[
_sortBtn
setImage
:[
UIImage
imageNamed
:
@"select_arrow_up_text"
]
forState
:
UIControlStateNormal
];
}
else
{
[
_sortBtn
setImage
:[
UIImage
imageNamed
:
@"black_arrow_down_with_text"
]
forState
:
UIControlStateNormal
];
}
}
-
(
void
)
checkBoltBtnColor
{
if
(
self
.
state
.
length
>
0
)
{
[
_boltBtn
setImage
:[
UIImage
imageNamed
:
@"selected-filter_with_text"
]
forState
:
UIControlStateNormal
];
}
else
{
[
_boltBtn
setImage
:[
UIImage
imageNamed
:
@"black_filter_with_text"
]
forState
:
UIControlStateNormal
];
}
}
#pragma mark - 确定
-
(
void
)
sureClick
{
_currentPage
=
0
;
//请求
[
self
getData
];
//还原数据
if
(
_sortView
)
{
[
self
hiddenSortMaskView
:
YES
];
}
if
(
_boltView
)
{
[
self
hiddenBoltMaskView
:
YES
];
}
}
#pragma mark - sortDelegate
-
(
void
)
getSortValueSelectRow
:
(
NSString
*
)
state
{
if
(
state
.
length
>
0
)
{
self
.
orderDirection
=
state
;
CLog
(
@"%@"
,
state
);
}
}
#pragma mark - boltDelegate
-
(
void
)
getBoltValueSelectRow
:
(
NSString
*
)
state
{
self
.
state
=
state
;
CLog
(
@"%@"
,
state
);
}
-
(
void
)
clearBoltInformation
{
if
(
self
.
state
.
length
>
0
)
{
self
.
state
=
@""
;
}
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
dataArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"TransferCell"
;
TransferCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
TransferCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
}
if
(
self
.
dataArr
.
count
>
0
)
{
Transfer
*
transfer
=
self
.
dataArr
[
indexPath
.
row
];
[
cell
setTransfer
:
transfer
];
}
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
_dataArr
.
count
>
0
)
{
Transfer
*
transfer
=
_dataArr
[
indexPath
.
row
];
if
([
transfer
.
state
isEqualToString
:
TRANSPORT_STATE_INITIAL
]
)
{
NewReceiveViewController
*
nvc
=
[
NewReceiveViewController
new
];
// nvc.transfer = transfer;
nvc
.
title
=
@"收货单收货"
;
[
self
PushViewController
:
nvc
animated
:
YES
];
}
else
{
ReceiveDetailViewController
*
pvc
=
[
ReceiveDetailViewController
new
];
pvc
.
title
=
@"查看收货单"
;
// pvc.transfer = transfer;
[
self
PushViewController
:
pvc
animated
:
YES
];
}
}
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
TableHeight
;
}
-
(
void
)
createBackBtn
{
UIButton
*
btn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
btn
setImage
:[
UIImage
imageNamed
:
@"back"
]
forState
:
UIControlStateNormal
];
btn
.
frame
=
CGRectMake
(
0
,
0
,
12
,
20
);
[
btn
addTarget
:
self
action
:
@selector
(
backRV
)
forControlEvents
:
UIControlEventTouchUpInside
];
UIBarButtonItem
*
back
=
[[
UIBarButtonItem
alloc
]
initWithCustomView
:
btn
];
self
.
navigationItem
.
leftBarButtonItem
=
back
;
}
-
(
void
)
backRV
{
[
self
PopToRootViewControllerAnimated
:
YES
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
if
([
ICRUserUtil
sharedInstance
].
needFresh
&&
self
.
tableView
!=
nil
)
{
[
self
.
tableView
.
header
beginRefreshing
];
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
}
/*
#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
\ No newline at end of file
XFFruit/ViewControllers/Receiving/Views/ReceiveBoltView.h
0 → 100644
View file @
97c995b9
//
// ReceiveBoltView.h
// XFFruit
//
// Created by 陈俊俊 on 15/10/13.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol
ReceiveBoltViewDelegate
<
NSObject
>
-
(
void
)
getBoltValueSelectRow
:
(
NSString
*
)
state
;
-
(
void
)
clearBoltInformation
;
@end
@interface
ReceiveBoltView
:
UIView
<
UITableViewDataSource
,
UITableViewDelegate
>
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArr
;
@property
(
nonatomic
,
weak
)
id
<
ReceiveBoltViewDelegate
>
delegate
;
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
state
:(
NSString
*
)
state
;
@end
XFFruit/ViewControllers/Receiving/Views/ReceiveBoltView.m
0 → 100644
View file @
97c995b9
//
// ReceiveBoltView.m
// XFFruit
//
// Created by 陈俊俊 on 15/10/13.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ReceiveBoltView.h"
#import "MaskCell.h"
#define TableHeight 45
#define LeftMargin 80
#define TotalHeight 224
#define LeftHeight 44
#define BottomHeight 50
@interface
ReceiveBoltView
()
<
UITextFieldDelegate
>
{
UIView
*
_leftView
;
UIButton
*
_currentBtn
;
NSIndexPath
*
_currentIndexPath
;
NSString
*
_state
;
UIButton
*
_clearBtn
;
}
@property
(
nonatomic
,
strong
)
NSString
*
state
;
@end
@implementation
ReceiveBoltView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
state
:(
NSString
*
)
state
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
state
=
state
;
[
self
createView
];
[
self
createRightView
];
[
self
preferData
];
}
return
self
;
}
-
(
void
)
preferData
{
if
([
self
.
state
isEqualToString
:
TRANSPORT_STATE_UNRECEIVED
])
{
_currentIndexPath
=
[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
];
}
else
if
([
self
.
state
isEqualToString
:
TRANSPORT_STATE_RECEIVED
])
{
_currentIndexPath
=
[
NSIndexPath
indexPathForRow
:
1
inSection
:
0
];
}
}
#pragma mark - 创建视图
-
(
void
)
createView
{
_leftView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
LeftMargin
,
self
.
frame
.
size
.
height
-
BottomHeight
)];
[
self
addSubview
:
_leftView
];
NSArray
*
arr
=
@[
@"按状态"
];
for
(
NSInteger
i
=
0
;
i
<
arr
.
count
;
i
++
)
{
UIButton
*
button
=
[
UIButton
buttonWithType
:
UIButtonTypeSystem
];
button
.
frame
=
CGRectMake
(
0
,
LeftHeight
*
i
,
LeftMargin
,
LeftHeight
);
[
button
setTitle
:
arr
[
i
]
forState
:
UIControlStateNormal
];
[
button
setTitleColor
:
GXF_DETAIL_COLOR
forState
:
UIControlStateNormal
];
if
(
i
==
0
)
{
button
.
enabled
=
NO
;
_currentBtn
=
button
;
}
[
button
setBackgroundImage
:[
UIImage
imageNamed
:
@"maskEnable"
]
forState
:
UIControlStateDisabled
];
[
button
setBackgroundImage
:[
UIImage
imageNamed
:
@"mask"
]
forState
:
UIControlStateNormal
];
button
.
tag
=
1001
+
i
;
[
button
addTarget
:
self
action
:
@selector
(
leftBtnClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
_leftView
addSubview
:
button
];
}
_clearBtn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
_clearBtn
.
frame
=
CGRectMake
(
0
,
CGRectGetMaxY
(
_leftView
.
frame
),
self
.
frame
.
size
.
width
,
BottomHeight
);
[
_clearBtn
setTitle
:
@"清空选项"
forState
:
UIControlStateNormal
];
[
_clearBtn
setTitleColor
:
GXF_CONTENT_COLOR
forState
:
UIControlStateNormal
];
_clearBtn
.
titleLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
_clearBtn
addTarget
:
self
action
:
@selector
(
clearBolt
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
addSubview
:
_clearBtn
];
}
-
(
void
)
createRightView
{
self
.
tableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
,
0
,
ScreenSize
.
width
-
LeftMargin
,
self
.
frame
.
size
.
height
-
BottomHeight
)
style
:(
UITableViewStylePlain
)];
self
.
tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
[
self
addSubview
:
self
.
tableView
];
}
-
(
void
)
leftBtnClick
:
(
UIButton
*
)
btn
{
_currentBtn
.
enabled
=
YES
;
btn
.
enabled
=
NO
;
_currentBtn
=
btn
;
}
-
(
void
)
clearBolt
{
if
(
_currentIndexPath
)
{
_currentIndexPath
=
nil
;
[
self
.
tableView
reloadData
];
}
if
([
self
.
delegate
respondsToSelector
:
@selector
(
clearBoltInformation
)])
{
[
self
.
delegate
clearBoltInformation
];
}
}
#pragma mark - 协议
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
dataArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"MaskID"
;
MaskCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
MaskCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
totalWidth
:
ScreenSize
.
width
-
80
totalHeight
:
TableHeight
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
}
if
(
_dataArr
.
count
>
0
)
{
cell
.
Commitbtn
.
hidden
=
YES
;
[
cell
setTitleStr
:
self
.
dataArr
[
indexPath
.
row
]];
}
if
(
_currentIndexPath
)
{
if
(
indexPath
.
row
==
_currentIndexPath
.
row
)
{
cell
.
Commitbtn
.
hidden
=
NO
;
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
}
}
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
//获取选中的cell
MaskCell
*
currentCell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
_currentIndexPath
];
currentCell
.
Commitbtn
.
hidden
=
YES
;
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
_currentIndexPath
=
indexPath
;
NSString
*
stateStr
=
@""
;
if
(
indexPath
.
row
==
0
)
{
stateStr
=
TRANSFER_STATE_UNRECEIVED
;
}
else
if
(
indexPath
.
row
==
1
){
stateStr
=
TRANSFER_STATE_RECEIVED
;
}
[
self
.
delegate
getBoltValueSelectRow
:
stateStr
];
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
TableHeight
;
}
@end
XFFruit/ViewControllers/Transfer/Controllers/ChooseTransportViewController.h
0 → 100644
View file @
97c995b9
//
// ChooseTransportViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/10/11.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
typedef
void
(
^
GetTransferProduct
)(
NSArray
*
products
);
@interface
ChooseTransportViewController
:
ICRBaseViewController
@property
(
nonatomic
,
copy
)
GetTransferProduct
getTransferProduct
;
@end
XFFruit/ViewControllers/Transfer/Controllers/ChooseTransportViewController.m
0 → 100644
View file @
97c995b9
//
// ChooseTransportViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/10/11.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ChooseTransportViewController.h"
#import "TransportPurchaseCell.h"
#import "QueryOrder.h"
#import "TransportPdtDetail.h"
#import "MJRefresh.h"
#import "Transport.h"
#define TopMargin 50
#define TableHeight 50
@interface
ChooseTransportViewController
()
<
UITextFieldDelegate
,
UITableViewDataSource
,
UITableViewDelegate
>
{
BOOL
_isRefresh
;
BOOL
_isLoadMore
;
NSInteger
_currentPage
;
id
billNumberObject
;
}
@property
(
nonatomic
,
strong
)
NSMutableArray
*
indexArr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
UITextField
*
selectTextFiled
;
@property
(
nonatomic
,
strong
)
NSString
*
contentStr
;
@end
@implementation
ChooseTransportViewController
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
}
return
self
;
}
-
(
void
)
dealloc
{
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
title
=
@"选择发运单"
;
[
self
initData
];
[
self
bulidLayout
];
[
self
createRefresh
];
[
self
getData
];
}
-
(
void
)
initData
{
self
.
dataArr
=
[
NSMutableArray
array
];
self
.
indexArr
=
[
NSMutableArray
array
];
}
-
(
void
)
getData
{
[
ICRUserUtil
sharedInstance
].
needFresh
=
NO
;
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
[
strongSelf
fetchtPuchaseList
:
data
];
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSMutableArray
*
orderArr
=
[
NSMutableArray
array
];
if
(
orderArr
.
count
==
0
)
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"billNumber"
;
order
.
direction
=
@"desc"
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
billNumberObject
=
[
NSNull
null
];
if
(
self
.
contentStr
.
length
>
0
)
{
billNumberObject
=
self
.
contentStr
;
}
NSDictionary
*
dict
=
@{
@"state"
:
TRANSPORT_STATE_UNRECEIVED
,
@"userCode"
:
userUtil
.
userCode
,
@"pageNumber"
:
@
(
_currentPage
),
@"pageSize"
:
@
(
20
),
// @"fetchParts":@"products"
};
[[
ICRHTTPController
sharedController
]
queryTransPortWithData
:
dict
success
:
succ
failure
:
fail
];
}
-
(
void
)
fetchtPuchaseList
:
(
id
)
data
{
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
]
;
if
(
success
==
1
)
{
if
(
_currentPage
==
0
)
{
if
(
self
.
dataArr
.
count
>
0
)
{
[
self
.
dataArr
removeAllObjects
];
}
}
NSArray
*
recodesArr
=
data
[
@"data"
][
@"records"
];
for
(
NSDictionary
*
purchaseBillDict
in
recodesArr
)
{
Transport
*
purchaseBill
=
[[
Transport
alloc
]
init
];
[
purchaseBill
setValuesForKeysWithDictionary
:
purchaseBillDict
];
NSMutableArray
*
pdtArr
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
pdtDetailDict
in
purchaseBill
.
pdtDetails
)
{
TransportPdtDetail
*
tran
=
[
TransportPdtDetail
new
];
[
tran
setValuesForKeysWithDictionary
:
pdtDetailDict
];
[
pdtArr
addObject
:
tran
];
}
purchaseBill
.
pdtDetails
=
pdtArr
;
[
self
.
dataArr
addObject
:
purchaseBill
];
}
NSDictionary
*
pageDict
=
data
[
@"data"
][
@"paging"
];
NSInteger
pageCount
=
[
pageDict
[
@"pageCount"
]
integerValue
];
[
self
.
tableView
reloadData
];
[
self
endRefreshing
];
if
(
pageCount
<=
_currentPage
)
{
[
self
.
tableView
.
footer
noticeNoMoreData
];
}
if
(
_currentPage
==
0
&&
self
.
dataArr
.
count
>
0
)
{
[
self
.
tableView
scrollToRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
]
atScrollPosition
:
UITableViewScrollPositionTop
animated
:
YES
];
}
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
else
{
[
IBTLoadingView
showTips
:
@" 无记录 "
];
}
}
-
(
void
)
checkWithBillNumber
{
if
(
self
.
indexArr
.
count
>
0
)
{
[
self
.
indexArr
removeAllObjects
];
}
[
self
.
selectTextFiled
resignFirstResponder
];
if
(
self
.
selectTextFiled
.
text
.
length
>
0
)
{
self
.
contentStr
=
self
.
selectTextFiled
.
text
;
}
else
{
self
.
contentStr
=
@""
;
}
[
self
getData
];
}
#pragma mark - 布局
-
(
void
)
bulidLayout
{
self
.
selectTextFiled
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
20
,
5
,
ScreenSize
.
width
-
100
,
TopMargin
-
10
)];
self
.
selectTextFiled
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
selectTextFiled
.
background
=
[
UIImage
imageNamed
:
@"textFiled"
];
self
.
selectTextFiled
.
delegate
=
self
;
self
.
selectTextFiled
.
placeholder
=
@"输入类似发运单号"
;
self
.
selectTextFiled
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
self
.
view
addSubview
:
self
.
selectTextFiled
];
UIButton
*
btn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
btn
.
frame
=
CGRectMake
(
self
.
selectTextFiled
.
right
+
5
,
10
,
60
,
TopMargin
-
20
);
[
btn
setTitle
:
@"开始查询"
forState
:
UIControlStateNormal
];
btn
.
titleLabel
.
font
=
FontSize
(
13
);
btn
.
layer
.
cornerRadius
=
5
;
btn
.
layer
.
masksToBounds
=
YES
;
btn
.
backgroundColor
=
GXF_NAVIGAYION_COLOR
;
[
btn
addTarget
:
self
action
:
@selector
(
checkWithBillNumber
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
view
addSubview
:
btn
];
UIImageView
*
leftView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
35
,
40
)];
leftView
.
image
=
[
UIImage
imageNamed
:
@"search"
];
self
.
selectTextFiled
.
leftView
=
leftView
;
self
.
selectTextFiled
.
leftViewMode
=
UITextFieldViewModeAlways
;
UIButton
*
rightView
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
rightView
setImage
:[
UIImage
imageNamed
:
@"delete"
]
forState
:
UIControlStateNormal
];
rightView
.
frame
=
CGRectMake
(
0
,
0
,
35
,
40
);
[
rightView
addTarget
:
self
action
:
@selector
(
deleteTextFieldStr
)
forControlEvents
:
UIControlEventTouchUpInside
];
self
.
selectTextFiled
.
rightView
=
rightView
;
self
.
selectTextFiled
.
rightViewMode
=
UITextFieldViewModeAlways
;
self
.
tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
TopMargin
))
style
:(
UITableViewStylePlain
)];
self
.
tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
self
.
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
[
self
.
view
addSubview
:
self
.
tableView
];
UIBarButtonItem
*
rightItem
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:
@"确定"
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
@selector
(
sureClick
)];
self
.
navigationItem
.
rightBarButtonItem
=
rightItem
;
}
-
(
void
)
createRefresh
{
self
.
tableView
.
header
=
[
MJRefreshNormalHeader
headerWithRefreshingBlock
:
^
{
if
(
_isRefresh
)
{
return
;
}
_isRefresh
=
YES
;
_currentPage
=
0
;
[
self
getData
];
}];
self
.
tableView
.
header
.
lastUpdatedTimeKey
=
ChooseTransportUpdateDate
;
self
.
tableView
.
footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
_isLoadMore
)
{
return
;
}
_isLoadMore
=
YES
;
_currentPage
++
;
[
self
getData
];
}
];
}
#pragma mark - 结束刷新
-
(
void
)
endRefreshing
{
_isLoadMore
=
NO
;
_isRefresh
=
NO
;
[
self
.
tableView
.
header
endRefreshing
];
[
self
.
tableView
.
footer
endRefreshing
];
}
-
(
void
)
deleteTextFieldStr
{
self
.
selectTextFiled
.
text
=
@""
;
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
dataArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"TransPortPurchase"
;
TransportPurchaseCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
TransportPurchaseCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
}
if
(
self
.
dataArr
.
count
>
0
){
Transport
*
bill
=
_dataArr
[
indexPath
.
row
];
[
cell
setTransPort
:
bill
selectArr
:
self
.
indexArr
];
}
return
cell
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
//44+38+10 + count* 44
Transport
*
bill
=
_dataArr
[
indexPath
.
row
];
return
102
+
bill
.
pdtDetails
.
count
*
44
;
}
#pragma mark - 按钮确定
-
(
void
)
sureClick
{
[
self
PopViewControllerAnimated
:
YES
];
if
(
self
.
indexArr
.
count
>
0
)
{
NSMutableArray
*
arr
=
[
NSMutableArray
array
];
for
(
TransportPdtDetail
*
detail
in
self
.
indexArr
)
{
detail
.
purchasePdtDetail
=
detail
.
uuid
;
detail
.
uuid
=
nil
;
[
arr
addObject
:
detail
];
}
self
.
getTransferProduct
(
arr
);
}
}
-
(
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/Transfer/Controllers/NewTransferViewController.h
0 → 100644
View file @
97c995b9
//
// NewTransferViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "Transfer.h"
@interface
NewTransferViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
Transfer
*
transfer
;
@end
XFFruit/ViewControllers/Transfer/Controllers/NewTransferViewController.m
0 → 100644
View file @
97c995b9
//
// NewTransferViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
// 新建转运单
#import "NewTransferViewController.h"
#import "TopTransferView.h"
#import "BottomTransferView.h"
#import "TransportPurchaseViewController.h"
#import "NewCostViewController.h"
#import "TransferPdtDetail.h"
#import "FeeAcountDetail.h"
#import "TransferViewController.h"
#import "ShopDetaileViewController.h"
#import "TransportPdtDetail.h"
#import "ChooseTransportViewController.h"
typedef
enum
:
NSUInteger
{
SaveTag
=
7000
,
CommitTag
,
}
BtnTag
;
#define TopHeight 284
#define BottomHeight 300
#define SpaceHeight 20
#define BottomViewHeight 60
@interface
NewTransferViewController
()
<
TopTransferViewDelegate
,
UIScrollViewDelegate
,
UIAlertViewDelegate
>
{
UIScrollView
*
_scrollView
;
TopTransferView
*
_sheetView
;
BottomTransferView
*
_bottomView
;
id
uuidObject
;
id
billNumberObject
;
NSNumber
*
versionObject
;
}
@property
(
nonatomic
,
strong
)
NSString
*
state
;
@end
@implementation
NewTransferViewController
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
choseTransferPurchase
)
name
:
KNOTIFICATION_ChoseTransportPurchase
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
addTransferCost
:
)
name
:
KNOTIFICATION_AddTransportCost
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
addPurchferProduct
:
)
name
:
KNOTIFICATION_AddPurchaseProduct
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
chooseTransportProduct
)
name
:
KNOTIFICATION_ChoseTransportProduct
object
:
nil
];
}
return
self
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
//布局
[
self
bulidLayout
];
uuidObject
=
[
NSNull
null
];
billNumberObject
=
[
NSNull
null
];
versionObject
=
[
NSNumber
numberWithInteger
:
0
];
if
(
self
.
transfer
)
{
[
self
getDataFromServer
];
}
}
-
(
void
)
getDataFromServer
{
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
]
;
if
(
success
==
1
)
{
NSDictionary
*
dictData
=
data
[
@"data"
];
Transfer
*
transfer
=
[[
Transfer
alloc
]
init
];
[
transfer
setValuesForKeysWithDictionary
:
dictData
];
self
.
transfer
=
transfer
;
[
strongSelf
fetchtTransportDetail
];
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
else
{
[
IBTLoadingView
showTips
:
@" 无记录 "
];
}
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
[[
ICRHTTPController
sharedController
]
getTransferResultWithTransferUuid
:
self
.
transfer
.
uuid
success
:
succ
failure
:
fail
];
}
-
(
void
)
fetchtTransportDetail
{
_sheetView
.
transfer
=
self
.
transfer
;
[
_bottomView
refreshCost
:
self
.
transfer
.
accountDetails
];
[
_bottomView
refreshTranProduct
:
self
.
transfer
.
pdtDetails
];
}
-
(
void
)
bulidLayout
{
self
.
view
.
backgroundColor
=
XXFBgColor
;
_scrollView
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
BottomViewHeight
)];
_scrollView
.
showsHorizontalScrollIndicator
=
NO
;
_scrollView
.
showsVerticalScrollIndicator
=
NO
;
_scrollView
.
contentSize
=
CGSizeMake
(
ScreenSize
.
width
,
TopHeight
+
BottomHeight
+
SpaceHeight
*
2
);
[
self
.
view
addSubview
:
_scrollView
];
UIView
*
footView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
ScreenSize
.
height
-
BottomViewHeight
-
64
,
ScreenSize
.
width
,
BottomViewHeight
)];
UIButton
*
saveBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
15
,
8
,
(
ScreenSize
.
width
-
15
*
3
)
/
2
,
44
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
SaveTag
image
:
nil
title
:
@"保存"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
GXF_SAVE_COLOR
];
[
footView
addSubview
:
saveBtn
];
UIButton
*
commitBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
saveBtn
.
frame
)
+
15
,
8
,
(
ScreenSize
.
width
-
15
*
3
)
/
2
,
44
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
CommitTag
image
:
nil
title
:
@"提交"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
GXF_COMMIT_COLOR
];
[
footView
addSubview
:
commitBtn
];
[
self
.
view
addSubview
:
footView
];
_sheetView
=
[[
TopTransferView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
TopHeight
)];
_sheetView
.
delegate
=
self
;
[
_scrollView
addSubview
:
_sheetView
];
_bottomView
=
[[
BottomTransferView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_sheetView
.
frame
)
+
20
,
ScreenSize
.
width
,
BottomHeight
)
withHidden
:
NO
];
_bottomView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_scrollView
addSubview
:
_bottomView
];
}
-
(
void
)
btnClick
:
(
UIButton
*
)
btn
{
switch
(
btn
.
tag
)
{
case
SaveTag
:
{
if
([
self
checkTransfer
])
{
self
.
state
=
TRANSFER_STATE_INITIAL
;
[
self
getDataFromServer
:
TRANSFER_STATE_INITIAL
msg
:
@"正在保存..."
];
}
}
break
;
case
CommitTag
:{
if
([
self
checkTransfer
])
{
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"温馨提示"
message
:
@"请确认提交"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确认"
,
nil
];
alertView
.
delegate
=
self
;
[
alertView
show
];
}
}
break
;
default
:
break
;
}
}
-
(
void
)
getDataFromServer
:
(
NSString
*
)
state
msg
:
(
NSString
*
)
msg
{
//保存
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
];
if
(
success
==
1
)
{
//成功
if
([
state
isEqualToString
:
PURCHASE_STATE_INITIAL
])
{
//保存成功
NSString
*
uuidS
=
data
[
@"data"
][
@"uuid"
];
NSString
*
billNumberS
=
data
[
@"data"
][
@"billNumber"
];
NSNumber
*
versionN
=
data
[
@"data"
][
@"version"
];
uuidObject
=
uuidS
;
billNumberObject
=
billNumberS
;
versionObject
=
versionN
;
[
IBTLoadingView
showTips
:[
NSString
stringWithFormat
:
@"当前单据%@已保存成功"
,
billNumberS
]];
}
else
{
//提交成功
TransferViewController
*
svc
=
[
TransferViewController
new
];
svc
.
title
=
@"转运单列表"
;
[
self
PushViewController
:
svc
animated
:
YES
];
}
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
if
(
self
.
transfer
.
uuid
.
length
>
0
&&
uuidObject
==
[
NSNull
null
]){
uuidObject
=
self
.
transfer
.
uuid
;
}
if
(
self
.
transfer
.
billnumber
>
0
&&
billNumberObject
==
[
NSNull
null
])
{
billNumberObject
=
self
.
transfer
.
billnumber
;
}
if
(
self
.
transfer
&&
[
versionObject
integerValue
]
==
0
)
{
versionObject
=
self
.
transfer
.
version
;
}
NSMutableArray
*
billProducts
=
[
NSMutableArray
array
];
for
(
TransferPdtDetail
*
pdtDetail
in
_bottomView
.
productVC
.
transferProductArr
)
{
[
billProducts
addObject
:[
pdtDetail
dictForCommit
]];
}
NSMutableArray
*
costs
=
[
NSMutableArray
array
];
for
(
FeeAcountDetail
*
fee
in
_bottomView
.
costVC
.
costArr
)
{
[
costs
addObject
:[
fee
dictForCommit
]];
}
// self.state = state;
NSDictionary
*
dict
=
@{
@"uuid"
:
uuidObject
,
@"version"
:
versionObject
,
@"billnumber"
:
billNumberObject
,
@"enterprise"
:
[
ICRUserUtil
sharedInstance
].
orgId
,
@"state"
:
state
,
@"warehouseUuid"
:
[
IBTCommon
checkString
:
_sheetView
.
warehouseUuid
],
@"warehouseCode"
:
[
IBTCommon
checkString
:
_sheetView
.
warehouseCode
],
@"warehouseName"
:
[
IBTCommon
checkString
:
_sheetView
.
warehouseName
],
@"rwarehouseUuid"
:
[
IBTCommon
checkString
:
_sheetView
.
rwarehouseUuid
],
@"rwarehouseCode"
:
[
IBTCommon
checkString
:
_sheetView
.
rwarehouseCode
],
@"rwarehouseName"
:
[
IBTCommon
checkString
:
_sheetView
.
rwarehouseName
],
@"carnumber"
:
[
IBTCommon
checkString
:
_sheetView
.
carnumber
],
@"type"
:
[
IBTCommon
checkString
:
_sheetView
.
type
],
@"carphone"
:
[
IBTCommon
checkString
:
_sheetView
.
carphone
],
@"note"
:
_sheetView
.
note
,
@"pdtDetails"
:
billProducts
,
@"accountDetails"
:
costs
};
[
IBTLoadingView
showProgressLabel
:
msg
];
[[
ICRHTTPController
sharedController
]
saveTransferWithData
:
dict
success
:
succ
failure
:
fail
];
}
-
(
BOOL
)
checkTransfer
{
_sheetView
.
note
=
_sheetView
.
remarkTextView
.
text
;
_sheetView
.
carnumber
=
_sheetView
.
carTextFiled
.
text
;
_sheetView
.
carphone
=
_sheetView
.
phoneTextFiled
.
text
;
if
(
_sheetView
.
warehouseName
.
length
==
0
)
{
ShowMessage
(
@"发货仓库不能为空"
);
return
NO
;
}
if
(
_sheetView
.
rwarehouseUuid
.
length
==
0
)
{
ShowMessage
(
@"收货仓库不能为空"
);
return
NO
;
}
if
(
_sheetView
.
type
.
length
==
0
)
{
ShowMessage
(
@"运输类型不能为空"
);
return
NO
;
}
if
(
_sheetView
.
carnumber
.
length
==
0
)
{
ShowMessage
(
@"车牌号不能为空"
);
return
NO
;
}
if
(
_sheetView
.
carphone
.
length
==
0
)
{
ShowMessage
(
@"司机电话不能为空"
);
return
NO
;
}
if
(
_bottomView
.
productVC
.
transferProductArr
.
count
==
0
)
{
ShowMessage
(
@"商品不能为空"
);
return
NO
;
}
if
(
_bottomView
.
costVC
.
costArr
.
count
==
0
)
{
ShowMessage
(
@"费用不能为空"
);
return
NO
;
}
return
YES
;
}
#pragma mark - 通知选择采购单
-
(
void
)
choseTransferPurchase
{
TransportPurchaseViewController
*
tpv
=
[
TransportPurchaseViewController
new
];
tpv
.
getProchaseProduct
=
^
(
NSArray
*
products
){
if
(
products
.
count
>
0
)
{
NSMutableArray
*
arr
=
[
self
coverTransferProduct
:
products
];
[
_bottomView
reProduct
:
arr
];
}
};
[
self
PushViewController
:
tpv
animated
:
YES
];
}
#pragma mark - 通知选择发运单
-
(
void
)
chooseTransportProduct
{
ChooseTransportViewController
*
tpv
=
[
ChooseTransportViewController
new
];
tpv
.
getTransferProduct
=
^
(
NSArray
*
products
){
if
(
products
.
count
>
0
)
{
NSMutableArray
*
arr
=
[
self
coverTransferProduct
:
products
];
[
_bottomView
reProduct
:
arr
];
}
};
[
self
PushViewController
:
tpv
animated
:
YES
];
}
-
(
void
)
addTransferCost
:
(
NSNotification
*
)
fination
{
NewCostViewController
*
nvc
=
[
NewCostViewController
new
];
NSIndexPath
*
indexPath
=
[[
fination
userInfo
]
objectForKey
:
@"indexPath"
];
FeeAcountDetail
*
fee
=
[[
fination
userInfo
]
objectForKey
:
@"feeAccountDetail"
];
if
(
indexPath
)
{
nvc
.
navTitle
=
@"编辑费用"
;
nvc
.
indexPath
=
indexPath
;
nvc
.
accountDetail
=
fee
;
}
else
{
nvc
.
navTitle
=
@"添加费用"
;
}
nvc
.
getTransportCost
=
^
(
FeeAcountDetail
*
fee
,
NSIndexPath
*
indexPath
){
if
(
fee
)
{
[
_bottomView
refreshCost
:
fee
indexPath
:
indexPath
];
}
};
nvc
.
deleteTransportCost
=
^
(
FeeAcountDetail
*
fee
,
NSIndexPath
*
indexPath
){
if
(
fee
)
{
[
_bottomView
refreshDelCost
:
fee
indexPath
:
indexPath
];
}
};
[
self
PushViewController
:
nvc
animated
:
YES
];
}
-
(
void
)
addPurchferProduct
:
(
NSNotification
*
)
fication
{
TransferPdtDetail
*
billProduct
=
[[
fication
userInfo
]
objectForKey
:
@"transferPdtDetail"
];
NSInteger
indexTag
=
[[[
fication
userInfo
]
objectForKey
:
@"indexTag"
]
integerValue
];
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
if
(
billProduct
)
{
svc
.
navTitle
=
@"编辑商品"
;
ShopDetail
*
shopDetail
=
[
self
coverShopDetail
:
billProduct
];
shopDetail
.
IsXiuGai
=
YES
;
svc
.
choseShopDetail
=
^
(
ShopDetail
*
Detail
){
TransferPdtDetail
*
tdetail
=
[
self
coverTransportPdtDetail
:
Detail
];
if
(
Detail
.
IsDeleted
)
{
[
_bottomView
refreshDelProduct
:
tdetail
tag
:
indexTag
];
}
else
{
[
_bottomView
refreshEditProduct
:
tdetail
tag
:
indexTag
];
}
};
svc
.
shopDetail
=
shopDetail
;
}
else
{
svc
.
navTitle
=
@"添加商品"
;
// 回调
svc
.
choseShopDetail
=
^
(
ShopDetail
*
shopDetail
){
TransferPdtDetail
*
tdetail
=
[
self
coverTransportPdtDetail
:
shopDetail
];
[
_bottomView
refreshProduct
:
tdetail
];
};
}
[
self
PushViewController
:
svc
animated
:
YES
];
}
-
(
TransferPdtDetail
*
)
coverTransportPdtDetail
:
(
ShopDetail
*
)
shopDetail
{
TransferPdtDetail
*
billProduct
=
[[
TransferPdtDetail
alloc
]
init
];
billProduct
.
uuid
=
shopDetail
.
uuid
;
billProduct
.
productUuid
=
shopDetail
.
product_uuid
;
billProduct
.
productCode
=
shopDetail
.
product_code
;
billProduct
.
productName
=
shopDetail
.
merchandise
;
billProduct
.
qpc
=
[
NSNumber
numberWithFloat
:[
shopDetail
.
packageSpecification
floatValue
]];
billProduct
.
unit
=
shopDetail
.
packageUnit
;
billProduct
.
qty
=
[
NSNumber
numberWithFloat
:[
shopDetail
.
packageQuantity
floatValue
]];
billProduct
.
packprice
=
[
NSNumber
numberWithFloat
:[
shopDetail
.
packageUnitPrice
floatValue
]];
billProduct
.
price
=
[
NSNumber
numberWithFloat
:[
shopDetail
.
foundationUnitPrice
floatValue
]];
billProduct
.
baseQty
=
[
NSNumber
numberWithFloat
:[
shopDetail
.
foundationQuantity
floatValue
]];
billProduct
.
total
=
[
NSNumber
numberWithFloat
:[
shopDetail
.
totalMoney
floatValue
]];
billProduct
.
note
=
shopDetail
.
remark
;
billProduct
.
qpcStr
=
shopDetail
.
packageQpcStr
?
shopDetail
.
packageQpcStr
:
@"无"
;
billProduct
.
baseUnit
=
shopDetail
.
packageQpcUnit
;
billProduct
.
sourcetype
=
@"none"
;
// billProduct.sourcebillnumber = @"11111111";
// billProduct.sourcePdtDetail = @"33333333";
return
billProduct
;
}
-
(
ShopDetail
*
)
coverShopDetail
:
(
TransferPdtDetail
*
)
billProduct
{
ShopDetail
*
shopDetail
=
[[
ShopDetail
alloc
]
init
];
shopDetail
.
uuid
=
billProduct
.
uuid
;
shopDetail
.
product_uuid
=
billProduct
.
productUuid
;
shopDetail
.
product_code
=
billProduct
.
productCode
;
shopDetail
.
merchandise
=
billProduct
.
productName
;
shopDetail
.
packageSpecification
=
[
billProduct
.
qpc
stringValue
];
shopDetail
.
packageUnit
=
billProduct
.
unit
;
shopDetail
.
packageQuantity
=
[
billProduct
.
qty
stringValue
];
shopDetail
.
packageUnitPrice
=
[
billProduct
.
packprice
stringValue
];
shopDetail
.
foundationUnitPrice
=
[
billProduct
.
price
stringValue
];
shopDetail
.
foundationQuantity
=
[
billProduct
.
baseQty
stringValue
];
shopDetail
.
totalMoney
=
[
billProduct
.
total
stringValue
];
shopDetail
.
remark
=
billProduct
.
note
;
shopDetail
.
packageQpcUnit
=
billProduct
.
baseUnit
;
shopDetail
.
packageQpcStr
=
billProduct
.
qpcStr
;
return
shopDetail
;
}
-
(
NSMutableArray
*
)
coverTransferProduct
:
(
NSArray
*
)
products
{
NSMutableArray
*
transferP
=
[
NSMutableArray
new
];
for
(
TransportPdtDetail
*
pdt
in
products
)
{
TransferPdtDetail
*
ferPdt
=
[
TransferPdtDetail
new
];
ferPdt
.
uuid
=
pdt
.
uuid
;
ferPdt
.
productCode
=
pdt
.
productCode
;
ferPdt
.
productName
=
pdt
.
productName
;
ferPdt
.
productUuid
=
pdt
.
productUuid
;
ferPdt
.
sourcebillnumber
=
pdt
.
purchasebillnumber
;
ferPdt
.
sourcePdtDetail
=
pdt
.
purchasePdtDetail
;
ferPdt
.
sourcetype
=
@"purchase"
;
ferPdt
.
qpc
=
pdt
.
qpc
;
ferPdt
.
qpcStr
=
pdt
.
qpcStr
;
ferPdt
.
unit
=
pdt
.
unit
;
ferPdt
.
qty
=
pdt
.
qty
;
ferPdt
.
price
=
pdt
.
price
;
ferPdt
.
baseQty
=
pdt
.
baseQty
;
ferPdt
.
packprice
=
pdt
.
packprice
;
ferPdt
.
baseUnit
=
pdt
.
baseUnit
;
ferPdt
.
total
=
pdt
.
total
;
ferPdt
.
note
=
pdt
.
note
;
[
transferP
addObject
:
ferPdt
];
}
return
transferP
;
}
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
buttonIndex
==
1
)
{
//提交
self
.
state
=
TRANSFER_STATE_UNRECEIVED
;
[
self
getDataFromServer
:
TRANSFER_STATE_UNRECEIVED
msg
:
@"正在提交..."
];
}
}
#pragma mark - TopPurchaseViewDelegate
-
(
void
)
pushNextViewController
:
(
id
)
vc
{
[
self
PushViewController
:
vc
animated
:
YES
];
}
#pragma mark - 协议方法
-
(
void
)
hiddenKeyBoard
{
[
self
keyboardHidden
];
}
-
(
void
)
keyboardHidden
{
[
_sheetView
.
phoneTextFiled
resignFirstResponder
];
[
_sheetView
.
carTextFiled
resignFirstResponder
];
[
_sheetView
.
remarkTextView
resignFirstResponder
];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
if
(
self
.
transfer
&&
[
self
.
state
isEqualToString
:
TRANSFER_STATE_INITIAL
]){
[
ICRUserUtil
sharedInstance
].
needFresh
=
YES
;
}
}
/*
#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/Transfer/Controllers/TransferDetailViewController.h
0 → 100644
View file @
97c995b9
//
// TransferDetailViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "Transfer.h"
@interface
TransferDetailViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
Transfer
*
transfer
;
@end
XFFruit/ViewControllers/Transfer/Controllers/TransferDetailViewController.m
0 → 100644
View file @
97c995b9
//
// TransferDetailViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
// 转运单详情
#import "TransferDetailViewController.h"
#import "BottomTransferView.h"
#define BottomHeight 50
#define LeftMargin 15
#define LeftWidth 100
#define LeftHeight 30
#define TopMargin 15
typedef
enum
:
NSUInteger
{
AbortTag
=
20000
,
EndTag
}
BtnTag
;
@interface
TransferDetailViewController
(){
UIScrollView
*
_scrollView
;
UIView
*
_transportView
;
UIView
*
_bottomView
;
UIButton
*
_firstBtn
;
UIButton
*
_secondBtn
;
BottomTransferView
*
_transView
;
}
@property
(
nonatomic
,
strong
)
UILabel
*
billNumberLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
purchaseLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
stateLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
warehouseLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
rwarehouseLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
carnumberLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
carhoneLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
createOperLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
noteLabel
;
@end
@implementation
TransferDetailViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
bulifLayout
];
[
self
getDataFromServer
];
}
-
(
void
)
getDataFromServer
{
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
]
;
if
(
success
==
1
)
{
NSDictionary
*
dictData
=
data
[
@"data"
];
Transfer
*
transfer
=
[[
Transfer
alloc
]
init
];
[
transfer
setValuesForKeysWithDictionary
:
dictData
];
self
.
transfer
=
transfer
;
[
strongSelf
fetchtTransportDetail
];
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
else
{
[
IBTLoadingView
showTips
:
@" 无记录 "
];
}
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
[[
ICRHTTPController
sharedController
]
getTransferResultWithTransferUuid
:
self
.
transfer
.
uuid
success
:
succ
failure
:
fail
];
}
-
(
void
)
fetchtTransportDetail
{
self
.
billNumberLabel
.
text
=
[
IBTCommon
checkString
:
self
.
transfer
.
billnumber
];
if
([
self
.
transfer
.
state
isEqualToString
:
TRANSFER_STATE_UNRECEIVED
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
redColor
];
self
.
stateLabel
.
text
=
@"待收货"
;
}
else
if
([
self
.
transfer
.
state
isEqualToString
:
TRANSFER_STATE_RECEIVED
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
greenColor
];
self
.
stateLabel
.
text
=
@"已收货"
;
}
else
if
([
self
.
transfer
.
state
isEqualToString
:
TRANSFER_STATE_ABORTED
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
grayColor
];
self
.
stateLabel
.
text
=
@"已作废"
;
}
self
.
purchaseLabel
.
text
=
[
self
getPurchaseWith
:
self
.
transfer
.
pdtDetails
];
self
.
warehouseLabel
.
text
=
[
IBTCommon
checkString
:
self
.
transfer
.
warehouseName
];
self
.
rwarehouseLabel
.
text
=
[
IBTCommon
checkString
:
self
.
transfer
.
rwarehouseName
];
self
.
carnumberLabel
.
text
=
[
IBTCommon
checkString
:
self
.
transfer
.
carnumber
];
self
.
carhoneLabel
.
text
=
[
IBTCommon
checkString
:
self
.
transfer
.
carphone
];
self
.
noteLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
self
.
transfer
.
note
?
self
.
transfer
.
note
:
@"无"
];
self
.
createOperLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@%@"
,[
IBTCommon
checkString
:
self
.
transfer
.
create_operName
],
self
.
transfer
.
create_time
.
length
>
10
?
[
self
.
transfer
.
create_time
substringToIndex
:
10
]
:
self
.
transfer
.
create_time
];
[
_transView
refreshTranProduct
:
self
.
transfer
.
pdtDetails
];
[
_transView
refreshCost
:
self
.
transfer
.
accountDetails
];
[
self
setNoteHeight
];
}
-
(
void
)
setNoteHeight
{
CGFloat
height
=
[
self
.
noteLabel
calculateHeight
];
CGRect
noteFrame
=
self
.
noteLabel
.
frame
;
noteFrame
.
size
.
height
=
height
;
self
.
noteLabel
.
frame
=
noteFrame
;
CGFloat
totalHeight
=
height
+
LeftHeight
*
9
;
// CGRect purchaseFrame = _purchaseView.frame;
// purchaseFrame.size.height = totalHeight;
// _purchaseView.frame = purchaseFrame;
//
//
// CGRect bottomFrame = _bottomView.frame;
// bottomFrame.origin.y = CGRectGetMaxY(_purchaseView.frame) + TopMargin;
// _bottomView.frame = bottomFrame;
_scrollView
.
contentSize
=
CGSizeMake
(
ScreenSize
.
width
,
totalHeight
+
CGRectGetHeight
(
_bottomView
.
frame
)
+
TopMargin
*
2
);
}
-
(
NSString
*
)
getPurchaseWith
:
(
NSArray
*
)
purchases
{
NSString
*
purchseNumber
=
@""
;
NSInteger
count
=
0
;
for
(
NSDictionary
*
billDict
in
purchases
)
{
if
(
!
[
billDict
[
@"sourcebillnumber"
]
isEqual
:[
NSNull
null
]])
{
count
++
;
if
(
purchseNumber
.
length
==
0
)
{
purchseNumber
=
[
purchseNumber
stringByAppendingFormat
:
@"%@"
,
billDict
[
@"sourcebillnumber"
]];
}
else
{
purchseNumber
=
[
purchseNumber
stringByAppendingFormat
:
@",%@"
,
billDict
[
@"sourcebillnumber"
]];
}
}
}
if
(
count
==
0
)
{
purchseNumber
=
@"无"
;
}
return
purchseNumber
;
}
#pragma mark - 视图初始化
-
(
void
)
bulifLayout
{
_scrollView
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
BottomHeight
)];
_scrollView
.
showsHorizontalScrollIndicator
=
NO
;
_scrollView
.
showsVerticalScrollIndicator
=
NO
;
_scrollView
.
backgroundColor
=
XXFBgColor
;
[
self
.
view
addSubview
:
_scrollView
];
_firstBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
LeftMargin
,
ScreenSize
.
height
-
64
-
BottomHeight
+
5
,
(
ScreenSize
.
width
-
LeftMargin
*
2
),
40
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
AbortTag
image
:
nil
title
:
@"作废"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
GXF_SAVE_COLOR
];
[
self
.
view
addSubview
:
_firstBtn
];
// _secondBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(CGRectGetMaxX(_firstBtn.frame)+ LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40) target:self sel:@selector(btnClick:) tag:EndTag image:nil title:@"结束" titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR];
// [self.view addSubview:_secondBtn];
if
([
self
.
transfer
.
state
isEqualToString
:
TRANSFER_STATE_RECEIVED
]
||
[
self
.
transfer
.
state
isEqualToString
:
TRANSFER_STATE_ABORTED
]
||
!
[
self
checkIsPermission
:
TRANSFER_ACTION_ABORT
])
{
_firstBtn
.
hidden
=
YES
;
_secondBtn
.
hidden
=
YES
;
CGRect
scrollViewFrame
=
_scrollView
.
frame
;
scrollViewFrame
.
size
.
height
=
ScreenSize
.
height
-
64
;
_scrollView
.
frame
=
scrollViewFrame
;
}
NSArray
*
leftArr
=
@[
@"单号:"
,
@"来源单据:"
,
@"状态:"
,
@"发货仓库:"
,
@"收货仓库:"
,
@"车辆:"
,
@"司机电话:"
,
@"创建:"
,
@"备注"
];
_transportView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
LeftHeight
*
leftArr
.
count
+
LeftMargin
)];
_transportView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_scrollView
addSubview
:
_transportView
];
for
(
NSInteger
i
=
0
;
i
<
leftArr
.
count
;
i
++
)
{
UILabel
*
leftLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
,
10
+
LeftHeight
*
i
,
LeftWidth
,
LeftHeight
)];
leftLabel
.
font
=
GXF_SEVENTEENTH_SIZE
;
leftLabel
.
text
=
leftArr
[
i
];
leftLabel
.
textColor
=
GXF_DETAIL_COLOR
;
[
_transportView
addSubview
:
leftLabel
];
UILabel
*
rightLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
leftLabel
.
frame
),
10
+
LeftHeight
*
i
,
_transportView
.
frame
.
size
.
width
-
LeftMargin
-
LeftWidth
,
LeftHeight
)];
rightLabel
.
font
=
GXF_SEVENTEENTH_SIZE
;
rightLabel
.
textColor
=
GXF_DETAIL_COLOR
;
if
(
i
==
0
)
{
self
.
billNumberLabel
=
rightLabel
;
}
else
if
(
i
==
1
)
{
self
.
purchaseLabel
=
rightLabel
;
}
else
if
(
i
==
2
){
self
.
stateLabel
=
rightLabel
;
}
else
if
(
i
==
3
){
self
.
warehouseLabel
=
rightLabel
;
}
else
if
(
i
==
4
){
self
.
rwarehouseLabel
=
rightLabel
;
}
else
if
(
i
==
5
){
self
.
carnumberLabel
=
rightLabel
;
}
else
if
(
i
==
6
){
self
.
carhoneLabel
=
rightLabel
;
}
else
if
(
i
==
7
){
self
.
createOperLabel
=
rightLabel
;
}
else
if
(
i
==
leftArr
.
count
-
1
){
rightLabel
.
numberOfLines
=
0
;
self
.
noteLabel
=
rightLabel
;
}
[
_transportView
addSubview
:
rightLabel
];
}
[
self
createBottomView
];
}
-
(
void
)
createBottomView
{
_bottomView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_transportView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
300
)];
_bottomView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_scrollView
addSubview
:
_bottomView
];
_transView
=
[[
BottomTransferView
alloc
]
initWithFrame
:
_bottomView
.
bounds
withHidden
:
YES
];
[
_bottomView
addSubview
:
_transView
];
}
-
(
void
)
btnClick
:
(
UIButton
*
)
btn
{
CLog
(
@"%ld"
,(
long
)
btn
.
tag
);
switch
(
btn
.
tag
)
{
case
AbortTag
:
{
CLog
(
@"作废"
);
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"温馨提示"
message
:
@"请确认作废"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确认"
,
nil
];
alertView
.
delegate
=
self
;
alertView
.
tag
=
AbortTag
;
[
alertView
show
];
}
break
;
case
EndTag
:
{
CLog
(
@"结束"
);
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"温馨提示"
message
:
@"请确认结束"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确认"
,
nil
];
alertView
.
delegate
=
self
;
alertView
.
tag
=
EndTag
;
[
alertView
show
];
}
break
;
default
:
break
;
}
}
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
alertView
.
tag
==
AbortTag
)
{
if
(
buttonIndex
==
1
)
{
[
self
dealByAction
:
TRANSFER_STATE_ABORTED
];
//作废
}
}
else
if
(
alertView
.
tag
==
EndTag
){
if
(
buttonIndex
==
1
)
{
[
self
dealByAction
:
TRANSFER_STATE_RECEIVED
];
//结束
}
}
}
-
(
void
)
dealByAction
:
(
NSString
*
)
action
{
//保存
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
];
if
(
success
==
1
)
{
[
ICRUserUtil
sharedInstance
].
needFresh
=
YES
;
[
self
PopViewControllerAnimated
:
YES
];
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
else
{
[
IBTLoadingView
showTips
:
@"操作异常"
];
}
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
if
([
action
isEqualToString
:
TRANSFER_STATE_ABORTED
])
{
[[
ICRHTTPController
sharedController
]
abortTransferWithTransferUuid
:
self
.
transfer
.
uuid
version
:
self
.
transfer
.
version
success
:
succ
failure
:
fail
];
}
else
{
[[
ICRHTTPController
sharedController
]
endTransferWithTransferUuid
:
self
.
transfer
.
uuid
version
:
self
.
transfer
.
version
success
:
succ
failure
:
fail
];
}
}
-
(
BOOL
)
checkIsPermission
:
(
NSString
*
)
permission
{
for
(
NSString
*
per
in
[
ICRUserUtil
sharedInstance
].
permissions
)
{
if
([
per
isEqualToString
:
permission
])
{
return
YES
;
}
}
return
NO
;
}
-
(
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/Transfer/Controllers/TransferProductViewController.h
0 → 100644
View file @
97c995b9
//
// TransferProductViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface
TransferProductViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
NSMutableArray
*
transferProductArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
assign
)
CGRect
viewFrame
;
@property
(
nonatomic
,
assign
)
BOOL
isHiddenEdit
;
@property
(
nonatomic
,
strong
)
NSString
*
twoTitle
;
@end
XFFruit/ViewControllers/Transfer/Controllers/TransferProductViewController.m
0 → 100644
View file @
97c995b9
//
// TransferProductViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransferProductViewController.h"
#import "FooterCell.h"
#import "HeaderCell.h"
#import "TransferProductCell.h"
#import "TransferPdtDetail.h"
#import "GXFPopView.h"
#define TableHeight 44
#define ShowHeight 110
@interface
TransferProductViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
FooterCellDelegate
,
HeaderCellDelegate
,
GXFPopViewDelegate
>
{
CGRect
_tableFrame
;
NSMutableArray
*
_selectRowArr
;
//记录当前选中的cell
}
@property
(
nonatomic
,
strong
)
GXFPopView
*
popView
;
@end
@implementation
TransferProductViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
XXFBgColor
;
[
self
initData
];
[
self
createView
];
}
-
(
void
)
initData
{
_selectRowArr
=
[[
NSMutableArray
alloc
]
init
];
if
(
!
self
.
transferProductArr
)
{
self
.
transferProductArr
=
[
NSMutableArray
array
];
}
}
-
(
void
)
setViewFrame
:
(
CGRect
)
viewFrame
{
_tableFrame
=
viewFrame
;
}
-
(
void
)
createView
{
self
.
tableView
=
[[
UITableView
alloc
]
initWithFrame
:
_tableFrame
style
:(
UITableViewStylePlain
)];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
self
.
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
[
self
.
view
addSubview
:
self
.
tableView
];
NSArray
*
arr
=
@[
@"商品"
,
@"单价"
,
@"包装数量"
];
HeaderCell
*
headCell
=
[[
HeaderCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
38
)
withArr
:
arr
withHiddenEdit
:
self
.
isHiddenEdit
];
[
self
.
view
addSubview
:
headCell
];
headCell
.
delegate
=
self
;
self
.
tableView
.
tableHeaderView
=
headCell
;
// if (!self.isHiddenEdit) {
// FooterCell *footCell = [[FooterCell alloc]initWithFrame:CGRectMake(0, 0, _tableFrame.size.width, 50) withTitle:@"+点击添加商品明细" isTwo:self.twoTitle];
// [self.view addSubview:footCell];
// footCell.delegate = self;
// self.tableView.tableFooterView = footCell;
// }
}
#pragma mark - headCellDelegate
-
(
void
)
addClickList
{
if
(
!
self
.
popView
)
{
NSArray
*
arr
=
@[
@"添加商品明细"
,
@"选择采购单"
,
@"选择发运单"
];
self
.
popView
=
[[
GXFPopView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
ScreenSize
.
height
)
withArr
:
arr
];
self
.
popView
.
delegate
=
self
;
[
AppWindow
addSubview
:
self
.
popView
];
}
}
#pragma mark - popViewdelegate
-
(
void
)
selectRowTitle
:
(
NSString
*
)
str
{
if
(
self
.
popView
)
{
[
self
.
popView
removeFromSuperview
];
self
.
popView
=
nil
;
}
if
([
str
isEqualToString
:
@"添加商品明细"
])
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_AddPurchaseProduct
object
:
nil
];
}
else
if
([
str
isEqualToString
:
@"选择采购单"
]){
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_ChoseTransportPurchase
object
:
nil
];
}
else
if
([
str
isEqualToString
:
@"选择发运单"
]){
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_ChoseTransportProduct
object
:
nil
];
}
}
-
(
void
)
clearFromSuper
{
if
(
self
.
popView
)
{
[
self
.
popView
removeFromSuperview
];
self
.
popView
=
nil
;
}
}
#pragma mark - footerDelegate
-
(
void
)
addClick
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_AddPurchaseProduct
object
:
nil
];
}
-
(
void
)
editClick
:
(
UIButton
*
)
btn
{
TransferPdtDetail
*
pdDetail
=
self
.
transferProductArr
[
btn
.
tag
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_AddPurchaseProduct
object
:
nil
userInfo
:
@{
@"transferPdtDetail"
:
pdDetail
,
@"indexTag"
:
@
(
btn
.
tag
)}];
}
-
(
void
)
choosePurchase
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_ChoseTransportPurchase
object
:
nil
];
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
transferProductArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"TransferProductCell"
;
TransferProductCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
TransferProductCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
withImageName
:
@"edit"
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
if
(
self
.
isHiddenEdit
)
{
cell
.
editBtn
.
hidden
=
YES
;
}
}
if
([
self
isHaveIndexPath
:
indexPath
])
{
cell
.
smallImageView
.
image
=
[
UIImage
imageNamed
:
@"arrowdown"
];
CGRect
Linefrmame
=
cell
.
lineLabel
.
frame
;
Linefrmame
.
origin
.
y
=
ShowHeight
+
TableHeight
-
1
;
cell
.
lineLabel
.
frame
=
Linefrmame
;
CGRect
showfrmame
=
cell
.
showView
.
frame
;
showfrmame
.
size
.
height
=
ShowHeight
;
cell
.
showView
.
frame
=
showfrmame
;
cell
.
backgroundColor
=
XXFBgColor
;
}
else
{
cell
.
smallImageView
.
image
=
[
UIImage
imageNamed
:
@"arrowright"
];
CGRect
Linefrmame
=
cell
.
lineLabel
.
frame
;
Linefrmame
.
origin
.
y
=
TableHeight
-
1
;
cell
.
lineLabel
.
frame
=
Linefrmame
;
CGRect
showfrmame
=
cell
.
showView
.
frame
;
showfrmame
.
size
.
height
=
0
;
cell
.
showView
.
frame
=
showfrmame
;
cell
.
backgroundColor
=
[
UIColor
whiteColor
];
}
cell
.
editBtn
.
tag
=
indexPath
.
row
;
[
cell
.
editBtn
addTarget
:
self
action
:
@selector
(
editClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
if
(
self
.
transferProductArr
.
count
>
0
)
{
TransferPdtDetail
*
billP
=
self
.
transferProductArr
[
indexPath
.
row
];
[
cell
setPdtDetail
:
billP
row
:
indexPath
.
row
];
}
return
cell
;
}
-
(
BOOL
)
isHaveIndexPath
:
(
NSIndexPath
*
)
indexPath
{
for
(
NSIndexPath
*
path
in
_selectRowArr
)
{
if
(
path
.
row
==
indexPath
.
row
)
{
return
YES
;
}
}
return
NO
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
TransferProductCell
*
cell
=
(
TransferProductCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
CGRect
Linefrmame
=
cell
.
lineLabel
.
frame
;
CGRect
showfrmame
=
cell
.
showView
.
frame
;
if
(
Linefrmame
.
origin
.
y
==
TableHeight
-
1
)
{
cell
.
smallImageView
.
image
=
[
UIImage
imageNamed
:
@"arrowdown"
];
Linefrmame
.
origin
.
y
=
ShowHeight
+
TableHeight
-
1
;
showfrmame
.
size
.
height
=
ShowHeight
;
cell
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_selectRowArr
addObject
:
indexPath
];
}
else
{
cell
.
smallImageView
.
image
=
[
UIImage
imageNamed
:
@"arrowright"
];
Linefrmame
.
origin
.
y
=
TableHeight
-
1
;
showfrmame
.
size
.
height
=
0
;
cell
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_selectRowArr
removeObject
:
indexPath
];
}
cell
.
lineLabel
.
frame
=
Linefrmame
;
cell
.
showView
.
frame
=
showfrmame
;
[
self
.
tableView
reloadData
];
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
([
self
isHaveIndexPath
:
indexPath
])
{
return
ShowHeight
+
TableHeight
;
}
return
TableHeight
;
}
@end
XFFruit/ViewControllers/Transfer/Controllers/TransferViewController.h
0 → 100644
View file @
97c995b9
//
// TransferViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
// 转运单列表
#import "ICRBaseViewController.h"
@interface
TransferViewController
:
ICRBaseViewController
@end
XFFruit/ViewControllers/Transfer/Controllers/TransferViewController.m
0 → 100644
View file @
97c995b9
//
// TransferViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransferViewController.h"
#import "NewTransferViewController.h"
#import "TransferDetailViewController.h"
#import "TransferCell.h"
#import "Transfer.h"
#import "QueryOrder.h"
#import "SortMaskView.h"
#import "TransferBoltView.h"
#import "MJRefresh.h"
#define TopMargin 44
#define TableHeight 140
#define LeftMargin 20
#define BtnWidth 60
#define BtnHeight 24
#define BtnSize 16
typedef
enum
:
NSUInteger
{
SortTag
=
3000
,
BoltTag
}
BtnTag
;
@interface
TransferViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
TransferBoltViewDelegate
,
SortMaskViewDelegate
>
{
UIView
*
_maskView
;
UIButton
*
currentBtn
;
SortMaskView
*
_sortView
;
TransferBoltView
*
_boltView
;
UIBarButtonItem
*
_sureBtn
;
UIButton
*
_sortBtn
;
UIButton
*
_boltBtn
;
BOOL
_isRefresh
;
BOOL
_isLoadMore
;
NSInteger
_currentPage
;
}
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
NSString
*
billLike
;
@property
(
nonatomic
,
strong
)
NSString
*
state
;
@property
(
nonatomic
,
strong
)
NSString
*
userLike
;
@property
(
nonatomic
,
strong
)
NSString
*
orderDirection
;
//asc(升序),desc(降序)
@end
@implementation
TransferViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
XXFBgColor
;
[
self
initData
];
[
self
createBackBtn
];
[
self
createTableView
];
[
self
createRefresh
];
[
self
getData
];
}
-
(
void
)
initData
{
self
.
dataArr
=
[
NSMutableArray
array
];
}
-
(
void
)
getData
{
[
ICRUserUtil
sharedInstance
].
needFresh
=
NO
;
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
[
strongSelf
fetchtPuchaseList
:
data
];
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
NSMutableArray
*
orderArr
=
[
NSMutableArray
array
];
if
(
self
.
orderDirection
.
length
>
0
&&
!
[
self
.
orderDirection
isEqualToString
:
@"none"
])
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"lastModified"
;
order
.
direction
=
self
.
orderDirection
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
id
userObject
=
[
NSNull
null
];
if
(
self
.
userLike
.
length
>
0
)
{
userObject
=
self
.
userLike
;
}
id
stateObject
=
[
NSNull
null
];
if
(
self
.
state
.
length
>
0
&&
!
[
self
.
state
isEqualToString
:
@"none"
])
{
stateObject
=
self
.
state
;
if
(
self
.
orderDirection
.
length
>
0
&&
!
[
self
.
orderDirection
isEqualToString
:
@"none"
])
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"state"
;
order
.
direction
=
self
.
orderDirection
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
}
id
billObject
=
[
NSNull
null
];
if
(
self
.
billLike
.
length
>
0
)
{
billObject
=
self
.
billLike
;
if
(
self
.
orderDirection
.
length
>
0
&&
!
[
self
.
orderDirection
isEqualToString
:
@"none"
])
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"billNumber"
;
order
.
direction
=
self
.
orderDirection
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
}
if
(
orderArr
.
count
==
0
)
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"billNumber"
;
order
.
direction
=
@"desc"
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSDictionary
*
dict
=
@{
@"state"
:
stateObject
,
@"billNumberLike"
:
billObject
,
@"creator"
:
userObject
,
@"queryOrders"
:
orderArr
,
@"userCode"
:
userUtil
.
userCode
,
@"pageNumber"
:
@
(
_currentPage
),
@"pageSize"
:
@
(
20
)};
[[
ICRHTTPController
sharedController
]
queryTransferWithData
:
dict
success
:
succ
failure
:
fail
];
}
-
(
void
)
fetchtPuchaseList
:
(
id
)
data
{
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
]
;
if
(
success
==
1
)
{
if
(
_currentPage
==
0
)
{
if
(
self
.
dataArr
.
count
>
0
)
{
[
self
.
dataArr
removeAllObjects
];
}
}
NSArray
*
recodesArr
=
data
[
@"data"
][
@"records"
];
for
(
NSDictionary
*
transportDict
in
recodesArr
)
{
Transfer
*
transport
=
[[
Transfer
alloc
]
init
];
[
transport
setValuesForKeysWithDictionary
:
transportDict
];
[
self
.
dataArr
addObject
:
transport
];
}
NSDictionary
*
pageDict
=
data
[
@"data"
][
@"paging"
];
NSInteger
pageCount
=
[
pageDict
[
@"pageCount"
]
integerValue
];
[
self
.
tableView
reloadData
];
[
self
endRefreshing
];
if
(
pageCount
<=
_currentPage
)
{
[
self
.
tableView
.
footer
noticeNoMoreData
];
}
if
(
_currentPage
==
0
&&
self
.
dataArr
.
count
>
0
)
{
[
self
.
tableView
scrollToRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
]
atScrollPosition
:
UITableViewScrollPositionTop
animated
:
YES
];
}
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
else
{
[
IBTLoadingView
showTips
:
@" 无记录 "
];
}
}
-
(
void
)
createRefresh
{
self
.
tableView
.
header
=
[
MJRefreshNormalHeader
headerWithRefreshingBlock
:
^
{
if
(
_isRefresh
)
{
return
;
}
_isRefresh
=
YES
;
_currentPage
=
0
;
[
self
getData
];
}];
self
.
tableView
.
header
.
lastUpdatedTimeKey
=
TransferUpdateDate
;
self
.
tableView
.
footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
_isLoadMore
)
{
return
;
}
_isLoadMore
=
YES
;
_currentPage
++
;
[
self
getData
];
}
];
}
#pragma mark - 结束刷新
-
(
void
)
endRefreshing
{
_isLoadMore
=
NO
;
_isRefresh
=
NO
;
[
self
.
tableView
.
header
endRefreshing
];
[
self
.
tableView
.
footer
endRefreshing
];
}
-
(
void
)
createTableView
{
_sureBtn
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:
@"确定"
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
@selector
(
sureClick
)];
self
.
navigationItem
.
rightBarButtonItem
=
_sureBtn
;
_sortBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
LeftMargin
,
10
,
BtnWidth
,
BtnHeight
)
target
:
self
sel
:
@selector
(
sortClick
:
)
tag
:
SortTag
image
:
@"black_arrow_down_with_text"
title
:
nil
titleColor
:
GXF_DETAIL_COLOR
isCorner
:
NO
corner
:
0
bgColor
:
nil
];
_sortBtn
.
titleLabel
.
font
=
FontSize
(
BtnSize
);
[
self
.
view
addSubview
:
_sortBtn
];
_boltBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
ScreenSize
.
width
-
BtnWidth
-
LeftMargin
,
10
,
BtnWidth
,
BtnHeight
)
target
:
self
sel
:
@selector
(
sortClick
:
)
tag
:
BoltTag
image
:
@"black_filter_with_text"
title
:
nil
titleColor
:
GXF_DETAIL_COLOR
isCorner
:
NO
corner
:
0
bgColor
:
nil
];
_boltBtn
.
titleLabel
.
font
=
FontSize
(
BtnSize
);
[
self
.
view
addSubview
:
_boltBtn
];
self
.
tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
TopMargin
))
style
:(
UITableViewStylePlain
)];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
[
self
.
view
addSubview
:
self
.
tableView
];
_maskView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
TopMargin
)];
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
.
5
);
_maskView
.
hidden
=
YES
;
[
self
.
view
addSubview
:
_maskView
];
}
#pragma mark -按钮事件
-
(
void
)
sortClick
:
(
UIButton
*
)
btn
{
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
.
5
);
_maskView
.
hidden
=
NO
;
if
(
btn
.
tag
==
SortTag
)
{
if
(
_boltView
){
[
self
hiddenBoltMaskView
:
NO
];
}
if
(
currentBtn
==
btn
)
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"black_arrow_down_with_text"
]
forState
:
UIControlStateNormal
];
[
self
hiddenSortMaskView
:
YES
];
currentBtn
=
nil
;
}
else
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"select_arrow_up_text"
]
forState
:
UIControlStateNormal
];
if
(
_sortView
==
nil
)
{
_sortView
=
[[
SortMaskView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
-
105
,
ScreenSize
.
width
,
150
)
withOrderDirection
:
self
.
orderDirection
];
_sortView
.
dataArr
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"按时间顺序"
,
@"按时间逆序"
,
@"默认排序"
,
nil
];
_sortView
.
delegate
=
self
;
[
_maskView
addSubview
:
_sortView
];
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_sortView
.
frame
;
sortFrame
.
origin
.
y
=
0
;
_sortView
.
frame
=
sortFrame
;
}];
}
currentBtn
=
btn
;
}
}
else
if
(
btn
.
tag
==
BoltTag
){
if
(
_sortView
)
{
[
self
hiddenSortMaskView
:
NO
];
}
if
(
currentBtn
==
btn
)
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"black_filter_with_text"
]
forState
:
UIControlStateNormal
];
[
self
hiddenBoltMaskView
:
YES
];
currentBtn
=
nil
;
}
else
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"selected-filter_with_text"
]
forState
:
UIControlStateNormal
];
if
(
_boltView
==
nil
)
{
_boltView
=
[[
TransferBoltView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
-
105
,
ScreenSize
.
width
,
274
)
state
:
self
.
state
userNumber
:
self
.
userLike
billNumber
:
self
.
billLike
];
_boltView
.
backgroundColor
=
XXFBgColor
;
_boltView
.
delegate
=
self
;
_boltView
.
dataArr
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"未提交"
,
@"待收货"
,
@"已收货"
,
@"已作废"
,
nil
];
[
_maskView
addSubview
:
_boltView
];
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_boltView
.
frame
;
sortFrame
.
origin
.
y
=
0
;
_boltView
.
frame
=
sortFrame
;
}];
currentBtn
=
btn
;
}
}
}
}
-
(
void
)
hiddenSortMaskView
:
(
BOOL
)
isHide
{
currentBtn
=
nil
;
[
self
checkSortBtnColor
];
if
(
isHide
==
NO
)
{
[
_sortView
removeFromSuperview
];
_sortView
=
nil
;
}
else
{
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_sortView
.
frame
;
sortFrame
.
origin
.
y
=
-
105
;
_sortView
.
frame
=
sortFrame
;
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
);
}
completion
:^
(
BOOL
finished
)
{
[
_sortView
removeFromSuperview
];
_sortView
=
nil
;
_maskView
.
hidden
=
YES
;
}];
}
}
-
(
void
)
hiddenBoltMaskView
:
(
BOOL
)
isHide
{
currentBtn
=
nil
;
[
self
checkBoltBtnColor
];
if
(
isHide
==
NO
)
{
[
_boltView
removeFromSuperview
];
_boltView
=
nil
;
}
else
{
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_boltView
.
frame
;
sortFrame
.
origin
.
y
=
-
105
;
_boltView
.
frame
=
sortFrame
;
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
);
}
completion
:^
(
BOOL
finished
)
{
[
_boltView
removeFromSuperview
];
_boltView
=
nil
;
_maskView
.
hidden
=
YES
;
}];
}
}
//检测排序的颜色
-
(
void
)
checkSortBtnColor
{
if
(
self
.
orderDirection
.
length
>
0
)
{
[
_sortBtn
setImage
:[
UIImage
imageNamed
:
@"select_arrow_up_text"
]
forState
:
UIControlStateNormal
];
}
else
{
[
_sortBtn
setImage
:[
UIImage
imageNamed
:
@"black_arrow_down_with_text"
]
forState
:
UIControlStateNormal
];
}
}
-
(
void
)
checkBoltBtnColor
{
if
(
self
.
state
.
length
>
0
||
self
.
billLike
.
length
>
0
||
self
.
userLike
.
length
>
0
)
{
[
_boltBtn
setImage
:[
UIImage
imageNamed
:
@"selected-filter_with_text"
]
forState
:
UIControlStateNormal
];
}
else
{
[
_boltBtn
setImage
:[
UIImage
imageNamed
:
@"black_filter_with_text"
]
forState
:
UIControlStateNormal
];
}
}
#pragma mark - 确定
-
(
void
)
sureClick
{
[
_boltView
.
userFiled
resignFirstResponder
];
[
_boltView
.
billFiled
resignFirstResponder
];
_currentPage
=
0
;
//请求
[
self
getData
];
//还原数据
if
(
_sortView
)
{
[
self
hiddenSortMaskView
:
YES
];
}
if
(
_boltView
)
{
[
self
hiddenBoltMaskView
:
YES
];
}
}
#pragma mark - sortDelegate
-
(
void
)
getSortValueSelectRow
:
(
NSString
*
)
state
{
if
(
state
.
length
>
0
)
{
self
.
orderDirection
=
state
;
CLog
(
@"%@"
,
state
);
}
}
#pragma mark - boltDelegate
-
(
void
)
getBoltValueSelectRow
:
(
NSString
*
)
state
{
self
.
state
=
state
;
CLog
(
@"%@"
,
state
);
}
-
(
void
)
getuserLike
:
(
NSString
*
)
userLike
{
self
.
userLike
=
userLike
;
CLog
(
@"%@"
,
userLike
);
}
-
(
void
)
getbillLike
:
(
NSString
*
)
billLike
{
self
.
billLike
=
billLike
;
CLog
(
@"%@"
,
billLike
);
}
-
(
void
)
clearBoltInformation
{
//清空所有条件
if
(
self
.
userLike
.
length
>
0
)
{
self
.
userLike
=
@""
;
}
if
(
self
.
billLike
.
length
>
0
)
{
self
.
billLike
=
@""
;
}
if
(
self
.
state
.
length
>
0
)
{
self
.
state
=
@""
;
}
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
dataArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"TransferCell"
;
TransferCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
TransferCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
}
if
(
self
.
dataArr
.
count
>
0
)
{
Transfer
*
transfer
=
self
.
dataArr
[
indexPath
.
row
];
[
cell
setTransfer
:
transfer
];
}
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
_dataArr
.
count
>
0
)
{
Transfer
*
transfer
=
_dataArr
[
indexPath
.
row
];
if
([
transfer
.
state
isEqualToString
:
TRANSPORT_STATE_INITIAL
]
)
{
NewTransferViewController
*
nvc
=
[
NewTransferViewController
new
];
nvc
.
transfer
=
transfer
;
nvc
.
title
=
@"修改转运单"
;
[
self
PushViewController
:
nvc
animated
:
YES
];
}
else
{
TransferDetailViewController
*
pvc
=
[
TransferDetailViewController
new
];
pvc
.
title
=
@"查看转运单"
;
pvc
.
transfer
=
transfer
;
[
self
PushViewController
:
pvc
animated
:
YES
];
}
}
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
TableHeight
;
}
-
(
void
)
createBackBtn
{
UIButton
*
btn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
btn
setImage
:[
UIImage
imageNamed
:
@"back"
]
forState
:
UIControlStateNormal
];
btn
.
frame
=
CGRectMake
(
0
,
0
,
12
,
20
);
[
btn
addTarget
:
self
action
:
@selector
(
backRV
)
forControlEvents
:
UIControlEventTouchUpInside
];
UIBarButtonItem
*
back
=
[[
UIBarButtonItem
alloc
]
initWithCustomView
:
btn
];
self
.
navigationItem
.
leftBarButtonItem
=
back
;
}
-
(
void
)
backRV
{
[
self
PopToRootViewControllerAnimated
:
YES
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
if
([
ICRUserUtil
sharedInstance
].
needFresh
&&
self
.
tableView
!=
nil
)
{
[
self
.
tableView
.
header
beginRefreshing
];
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
}
/*
#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/Transfer/Models/Transfer.h
0 → 100644
View file @
97c995b9
//
// Transfer.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface
Transfer
:
IBTModel
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
//唯一标识
@property
(
nonatomic
,
strong
)
NSString
*
billnumber
;
//调研单号
@property
(
nonatomic
,
strong
)
NSString
*
warehouseUuid
;
//仓库id
@property
(
nonatomic
,
strong
)
NSString
*
warehouseCode
;
//仓库代码
@property
(
nonatomic
,
strong
)
NSString
*
warehouseName
;
//仓库名称
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseUuid
;
//收货仓库id
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseCode
;
//收货仓库代码
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseName
;
//收货仓库名称
@property
(
nonatomic
,
strong
)
NSString
*
carnumber
;
//车牌号
@property
(
nonatomic
,
strong
)
NSString
*
state
;
//状态
@property
(
nonatomic
,
strong
)
NSString
*
type
;
//类型
@property
(
nonatomic
,
strong
)
NSString
*
carphone
;
//司机电话
@property
(
nonatomic
,
strong
)
NSString
*
note
;
//备注
@property
(
nonatomic
,
strong
)
NSString
*
create_time
;
//创建时间
@property
(
nonatomic
,
strong
)
NSString
*
create_id
;
//创建人代码
@property
(
nonatomic
,
strong
)
NSString
*
create_operName
;
//创建人名称
@property
(
nonatomic
,
strong
)
NSString
*
lastModified_time
;
//最后修改时间
@property
(
nonatomic
,
strong
)
NSString
*
lastModified_id
;
//最后修改人代码
@property
(
nonatomic
,
strong
)
NSString
*
lastModified_operName
;
//最后修改人名称
@property
(
nonatomic
,
strong
)
NSNumber
*
version
;
//版本
@property
(
nonatomic
,
strong
)
NSArray
*
pdtDetails
;
//商品
@property
(
nonatomic
,
strong
)
NSArray
*
accountDetails
;
//费用
@end
XFFruit/ViewControllers/Transfer/Models/Transfer.m
0 → 100644
View file @
97c995b9
//
// Transfer.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "Transfer.h"
@implementation
Transfer
@end
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.h
0 → 100644
View file @
97c995b9
//
// TransferPdtDetail.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface
TransferPdtDetail
:
IBTModel
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
//唯一标识
@property
(
nonatomic
,
strong
)
NSString
*
productUuid
;
//商品id
@property
(
nonatomic
,
strong
)
NSString
*
productCode
;
//商品代码
@property
(
nonatomic
,
strong
)
NSString
*
productName
;
//商品名称
@property
(
nonatomic
,
strong
)
NSString
*
sourcebillnumber
;
//来源单号
@property
(
nonatomic
,
strong
)
NSString
*
sourcePdtDetail
;
//来源单明细id
@property
(
nonatomic
,
strong
)
NSString
*
sourcetype
;
//来源单类型
@property
(
nonatomic
,
strong
)
NSNumber
*
qpc
;
//包装规格
@property
(
nonatomic
,
strong
)
NSString
*
qpcStr
;
//包装规格描述
@property
(
nonatomic
,
strong
)
NSString
*
unit
;
//包装单位
@property
(
nonatomic
,
strong
)
NSNumber
*
packprice
;
//包装单价
@property
(
nonatomic
,
strong
)
NSString
*
baseUnit
;
//规格单位
@property
(
nonatomic
,
strong
)
NSNumber
*
qty
;
//转运的包装数量
@property
(
nonatomic
,
strong
)
NSNumber
*
price
;
//基础单价
@property
(
nonatomic
,
strong
)
NSNumber
*
baseQty
;
//转运的基础数量
@property
(
nonatomic
,
strong
)
NSNumber
*
total
;
//转运合计金额
@property
(
nonatomic
,
strong
)
NSString
*
note
;
//备注
@end
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.m
0 → 100644
View file @
97c995b9
//
// TransferPdtDetail.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransferPdtDetail.h"
@implementation
TransferPdtDetail
@end
XFFruit/ViewControllers/Transfer/Views/BottomTransferView.h
0 → 100644
View file @
97c995b9
//
// BottomTransferView.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TransferProductViewController.h"
#import "CostViewController.h"
#import "FeeAcountDetail.h"
#import "TransferPdtDetail.h"
@interface
BottomTransferView
:
UIView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withHidden
:(
BOOL
)
isHidden
;
@property
(
nonatomic
,
strong
)
TransferProductViewController
*
productVC
;
@property
(
nonatomic
,
strong
)
CostViewController
*
costVC
;
@property
(
nonatomic
,
assign
)
BOOL
isHiddenEdit
;
//添加或者编辑费用
-
(
void
)
refreshCost
:(
FeeAcountDetail
*
)
fee
indexPath
:(
NSIndexPath
*
)
indexPath
;
//删除费用
-
(
void
)
refreshDelCost
:(
FeeAcountDetail
*
)
fee
indexPath
:(
NSIndexPath
*
)
indexPath
;
//刷新费用
-
(
void
)
refreshCost
:(
NSArray
*
)
costArr
;
//刷新商品
-
(
void
)
refreshTranProduct
:(
NSArray
*
)
tranProductArr
;
-
(
void
)
reProduct
:(
NSArray
*
)
tranProductArr
;
//删除商品
-
(
void
)
refreshDelProduct
:(
TransferPdtDetail
*
)
fee
tag
:(
NSInteger
)
indexTag
;
//添加
-
(
void
)
refreshProduct
:(
TransferPdtDetail
*
)
transportPdtDetail
;
-
(
void
)
refreshEditProduct
:(
TransferPdtDetail
*
)
transportPdtDetail
tag
:(
NSInteger
)
indexTag
;
@end
XFFruit/ViewControllers/Transfer/Views/BottomTransferView.m
0 → 100644
View file @
97c995b9
//
// BottomTransferView.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "BottomTransferView.h"
#import "TransportPdtDetail.h"
#import "FeeAcountDetail.h"
#define ContentHeight 44
#define BtnWidth 100
#define BeginTag 8000
#define SpaceWidth (ScreenSize.width - 100*2)/3
@interface
BottomTransferView
()
<
UIScrollViewDelegate
>
{
UIScrollView
*
_bottomSV
;
UIImageView
*
_moveImageView
;
UIButton
*
_currentBtn
;
UIButton
*
_addBtn
;
}
@end
@implementation
BottomTransferView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withHidden
:(
BOOL
)
isHidden
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
isHiddenEdit
=
isHidden
;
//界面
[
self
bulidLayout
];
}
return
self
;
}
#pragma mark - 布局
-
(
void
)
bulidLayout
{
[
self
addChildView
];
[
self
createBottomView
];
}
-
(
void
)
createBottomView
{
NSArray
*
arr
=
@[
@"商品明细"
,
@"费用明细"
];
_bottomSV
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
ContentHeight
+
4
,
ScreenSize
.
width
,
CGRectGetHeight
(
self
.
frame
)
-
ContentHeight
-
2
)];
_bottomSV
.
showsHorizontalScrollIndicator
=
NO
;
_bottomSV
.
showsVerticalScrollIndicator
=
NO
;
_bottomSV
.
pagingEnabled
=
YES
;
_bottomSV
.
delegate
=
self
;
_bottomSV
.
contentSize
=
CGSizeMake
(
ScreenSize
.
width
*
arr
.
count
,
CGRectGetHeight
(
_bottomSV
.
frame
));
[
self
addSubview
:
_bottomSV
];
for
(
NSInteger
i
=
0
;
i
<
arr
.
count
;
i
++
)
{
UIButton
*
btn
=
[
UIButton
buttonWithType
:
UIButtonTypeSystem
];
[
btn
setTitle
:
arr
[
i
]
forState
:
UIControlStateNormal
];
btn
.
frame
=
CGRectMake
(
SpaceWidth
+
(
BtnWidth
+
SpaceWidth
)
*
i
,
0
,
BtnWidth
,
ContentHeight
);
[
btn
setTitleColor
:
GXF_CONTENT_COLOR
forState
:
UIControlStateNormal
];
[
btn
setTitleColor
:
GXF_SAVE_COLOR
forState
:
UIControlStateDisabled
];
btn
.
titleLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
btn
.
tag
=
i
+
BeginTag
;
[
btn
addTarget
:
self
action
:
@selector
(
btnClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
addSubview
:
btn
];
UIView
*
view
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetWidth
(
_bottomSV
.
frame
)
*
i
,
0
,
CGRectGetWidth
(
_bottomSV
.
frame
),
CGRectGetHeight
(
_bottomSV
.
frame
))];
if
(
i
==
0
)
{
view
.
backgroundColor
=
[
UIColor
redColor
];
self
.
productVC
.
viewFrame
=
view
.
bounds
;
self
.
productVC
.
isHiddenEdit
=
self
.
isHiddenEdit
;
[
view
addSubview
:
self
.
productVC
.
view
];
}
else
if
(
i
==
1
){
self
.
costVC
.
viewFrame
=
view
.
bounds
;
self
.
costVC
.
isHiddenEdit
=
self
.
isHiddenEdit
;
[
view
addSubview
:
self
.
costVC
.
view
];
view
.
backgroundColor
=
[
UIColor
blueColor
];
}
[
_bottomSV
addSubview
:
view
];
}
_moveImageView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
SpaceWidth
,
ContentHeight
,
BtnWidth
,
4
)];
_moveImageView
.
image
=
[
UIImage
imageNamed
:
@"tab_line"
];
UILabel
*
lineLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
ContentHeight
+
1
,
ScreenSize
.
width
,
1
))];
lineLabel
.
backgroundColor
=
GXF_LINE_COLOR
;
lineLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
self
addSubview
:
lineLabel
];
[
self
addSubview
:
_moveImageView
];
}
-
(
void
)
addChildView
{
self
.
productVC
=
[[
TransferProductViewController
alloc
]
init
];
// self.productVC.twoTitle = @"";
self
.
costVC
=
[[
CostViewController
alloc
]
init
];
}
-
(
void
)
btnClick
:
(
UIButton
*
)
btn
{
NSInteger
index
=
btn
.
tag
-
BeginTag
;
_currentBtn
.
enabled
=
YES
;
btn
.
enabled
=
NO
;
_currentBtn
=
btn
;
[
UIView
animateWithDuration
:
0
.
5
animations
:
^
{
CGRect
moveFrame
=
_moveImageView
.
frame
;
moveFrame
.
origin
.
x
=
SpaceWidth
+
(
BtnWidth
+
SpaceWidth
)
*
index
;
_moveImageView
.
frame
=
moveFrame
;
_bottomSV
.
contentOffset
=
CGPointMake
(
index
*
self
.
frame
.
size
.
width
,
0
);
}];
}
-
(
void
)
scrollViewDidEndDecelerating
:
(
UIScrollView
*
)
scrollView
{
CGFloat
offsetX
=
scrollView
.
contentOffset
.
x
/
self
.
frame
.
size
.
width
;
[
UIView
animateWithDuration
:
0
.
5
animations
:
^
{
CGRect
moveFrame
=
_moveImageView
.
frame
;
moveFrame
.
origin
.
x
=
SpaceWidth
+
(
BtnWidth
+
SpaceWidth
)
*
offsetX
;
_moveImageView
.
frame
=
moveFrame
;
}];
_currentBtn
.
enabled
=
YES
;
UIButton
*
btn
=
(
UIButton
*
)
[
self
viewWithTag
:
offsetX
+
BeginTag
];
btn
.
enabled
=
NO
;
_currentBtn
=
btn
;
}
//添加商品
-
(
void
)
refreshProduct
:
(
TransportPdtDetail
*
)
transportPdtDetail
{
if
(
self
.
productVC
.
transferProductArr
)
{
[
self
.
productVC
.
transferProductArr
addObject
:
transportPdtDetail
];
[
self
.
productVC
.
tableView
reloadData
];
}
}
//添加编辑
-
(
void
)
refreshCost
:
(
FeeAcountDetail
*
)
fee
indexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
)
{
[
self
.
costVC
.
costArr
replaceObjectAtIndex
:
indexPath
.
row
withObject
:
fee
];
// NSArray *indexArray=[NSArray arrayWithObject:indexPath];
// [self.costVC.tableView reloadRowsAtIndexPaths:indexArray withRowAnimation:UITableViewRowAnimationAutomatic];
[
self
.
costVC
.
tableView
reloadData
];
}
else
{
if
(
self
.
costVC
.
costArr
)
{
[
self
.
costVC
.
costArr
addObject
:
fee
];
[
self
.
costVC
.
tableView
reloadData
];
}
}
}
//删除
-
(
void
)
refreshDelCost
:
(
FeeAcountDetail
*
)
fee
indexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
)
{
[
self
.
costVC
.
costArr
removeObjectAtIndex
:
indexPath
.
row
];
[
self
.
costVC
.
tableView
reloadData
];
}
}
//刷新
-
(
void
)
refreshCost
:
(
NSArray
*
)
costArr
{
NSMutableArray
*
feeArr
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
billDict
in
costArr
)
{
FeeAcountDetail
*
billProbuct
=
[
FeeAcountDetail
new
];
[
billProbuct
setValuesForKeysWithDictionary
:
billDict
];
[
feeArr
addObject
:
billProbuct
];
}
self
.
costVC
.
costArr
=
feeArr
;
[
self
.
costVC
.
tableView
reloadData
];
}
-
(
void
)
refreshTranProduct
:
(
NSArray
*
)
tranProductArr
{
NSMutableArray
*
productArr
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
billDict
in
tranProductArr
)
{
TransferPdtDetail
*
billProbuct
=
[
TransferPdtDetail
new
];
[
billProbuct
setValuesForKeysWithDictionary
:
billDict
];
[
productArr
addObject
:
billProbuct
];
}
self
.
productVC
.
transferProductArr
=
productArr
;
[
self
.
productVC
.
tableView
reloadData
];
}
-
(
void
)
reProduct
:
(
NSArray
*
)
tranProductArr
{
[
self
.
productVC
.
transferProductArr
addObjectsFromArray
:
tranProductArr
];
[
self
.
productVC
.
tableView
reloadData
];
}
-
(
void
)
refreshDelProduct
:
(
TransferPdtDetail
*
)
fee
tag
:
(
NSInteger
)
indexTag
{
if
(
fee
)
{
[
self
.
productVC
.
transferProductArr
removeObjectAtIndex
:
indexTag
];
[
self
.
productVC
.
tableView
reloadData
];
}
}
-
(
void
)
refreshEditProduct
:
(
TransferPdtDetail
*
)
transportPdtDetail
tag
:
(
NSInteger
)
indexTag
{
[
self
.
productVC
.
transferProductArr
replaceObjectAtIndex
:
indexTag
withObject
:
transportPdtDetail
];
[
self
.
productVC
.
tableView
reloadData
];
}
@end
XFFruit/ViewControllers/Transfer/Views/TopTransferView.h
0 → 100644
View file @
97c995b9
//
// TopTransferView.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HPGrowingTextView.h"
#import "Transfer.h"
@protocol
TopTransferViewDelegate
<
NSObject
>
-
(
void
)
hiddenKeyBoard
;
-
(
void
)
pushNextViewController
:(
id
)
vc
;
@end
@interface
TopTransferView
:
UIView
@property
(
nonatomic
,
strong
)
UILabel
*
rwarehouseLabel
;
//收货仓库
@property
(
nonatomic
,
strong
)
UILabel
*
warehouseLabel
;
//发货仓库
@property
(
nonatomic
,
strong
)
UITextField
*
carTextFiled
;
//车辆
@property
(
nonatomic
,
strong
)
UILabel
*
typeLabel
;
//运输类型
@property
(
nonatomic
,
strong
)
UITextField
*
phoneTextFiled
;
//电话
@property
(
nonatomic
,
strong
)
HPGrowingTextView
*
remarkTextView
;
//备注
@property
(
nonatomic
,
weak
)
id
<
TopTransferViewDelegate
>
delegate
;
@property
(
nonatomic
,
strong
)
NSString
*
warehouseUuid
;
@property
(
nonatomic
,
strong
)
NSString
*
warehouseCode
;
@property
(
nonatomic
,
strong
)
NSString
*
warehouseName
;
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseUuid
;
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseCode
;
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseName
;
@property
(
nonatomic
,
strong
)
NSString
*
carnumber
;
@property
(
nonatomic
,
strong
)
NSString
*
type
;
@property
(
nonatomic
,
strong
)
NSString
*
carphone
;
@property
(
nonatomic
,
strong
)
NSString
*
note
;
@property
(
nonatomic
,
strong
)
Transfer
*
transfer
;
@end
XFFruit/ViewControllers/Transfer/Views/TopTransferView.m
0 → 100644
View file @
97c995b9
//
// TopTransferView.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TopTransferView.h"
#import "SurveyCell.h"
#import "Warehouse.h"
#import "ChooseWarehouseViewController.h"
#import "ChooseTypeViewController.h"
#define LeftMargin 15
#define TopMargin 20
#define LeftWidth 80
#define TableHeight 44
#define SpaceHeight 10
@interface
TopTransferView
()
<
UITableViewDataSource
,
UITableViewDelegate
,
HPGrowingTextViewDelegate
,
UITextFieldDelegate
>
{
UITableView
*
_tableView
;
NSMutableArray
*
_dataArr
;
}
@property
(
nonatomic
,
strong
)
NSString
*
selectType
;
@property
(
nonatomic
,
strong
)
NSString
*
selectRwarehouse
;
@property
(
nonatomic
,
strong
)
NSString
*
selectWarehouse
;
@end
@implementation
TopTransferView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
//界面
[
self
bulidLayout
];
}
return
self
;
}
#pragma mark - 布局
-
(
void
)
bulidLayout
{
self
.
backgroundColor
=
XXFBgColor
;
_dataArr
=
[
NSMutableArray
array
];
NSArray
*
arr
=
@[
@"发货仓库:"
,
@"收货仓库:"
,
@"运输类型:"
,
@"车辆:"
,
@"司机电话:"
,
@"备注:"
];
[
_dataArr
addObjectsFromArray
:
arr
];
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
TopMargin
,
self
.
frame
.
size
.
width
,
self
.
frame
.
size
.
height
-
TopMargin
))
style
:(
UITableViewStylePlain
)];
_tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
_tableView
.
bounces
=
NO
;
_tableView
.
delegate
=
self
;
_tableView
.
dataSource
=
self
;
[
self
addSubview
:
_tableView
];
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
_dataArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"cellID"
;
SurveyCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
SurveyCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
if
(
indexPath
.
row
==
0
||
indexPath
.
row
==
1
||
indexPath
.
row
==
2
)
{
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
}
[
self
createViewInCell
:
cell
indexPath
:
indexPath
];
}
[
cell
setTitleStr
:
_dataArr
[
indexPath
.
row
]];
return
cell
;
}
-
(
void
)
createViewInCell
:
(
SurveyCell
*
)
cell
indexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
3
||
indexPath
.
row
==
4
)
{
UITextField
*
textField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
)];
textField
.
textAlignment
=
NSTextAlignmentRight
;
textField
.
textColor
=
GXF_CONTENT_COLOR
;
textField
.
font
=
GXF_FIFTEENTEN_SIZE
;
textField
.
returnKeyType
=
UIReturnKeyDone
;
textField
.
delegate
=
self
;
[
cell
.
contentView
addSubview
:
textField
];
if
(
indexPath
.
row
==
3
)
{
self
.
carTextFiled
=
textField
;
self
.
carTextFiled
.
placeholder
=
@"请输入车辆"
;
}
else
if
(
indexPath
.
row
==
4
){
textField
.
keyboardType
=
UIKeyboardTypeNumbersAndPunctuation
;
textField
.
returnKeyType
=
UIReturnKeyDone
;
self
.
phoneTextFiled
=
textField
;
self
.
phoneTextFiled
.
placeholder
=
@"请输入司机电话"
;
}
}
else
if
(
indexPath
.
row
==
_dataArr
.
count
-
1
){
self
.
remarkTextView
=
[[
HPGrowingTextView
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
)];
self
.
remarkTextView
.
contentInset
=
UIEdgeInsetsMake
(
5
,
5
,
5
,
0
);
self
.
remarkTextView
.
minNumberOfLines
=
1
;
self
.
remarkTextView
.
maxNumberOfLines
=
1
;
self
.
remarkTextView
.
isScrollable
=
YES
;
self
.
remarkTextView
.
font
=
GXF_FIFTEENTEN_SIZE
;
self
.
remarkTextView
.
textAlignment
=
NSTextAlignmentRight
;
self
.
remarkTextView
.
delegate
=
self
;
self
.
remarkTextView
.
returnKeyType
=
UIReturnKeyDone
;
self
.
remarkTextView
.
placeholder
=
@"输入备注内容"
;
[
cell
.
contentView
addSubview
:
self
.
remarkTextView
];
}
else
{
UILabel
*
contentLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
))];
contentLabel
.
textAlignment
=
NSTextAlignmentRight
;
contentLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
contentLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
cell
.
contentView
addSubview
:
contentLabel
];
if
(
indexPath
.
row
==
0
)
{
contentLabel
.
text
=
@"选择发货仓库"
;
self
.
warehouseLabel
=
contentLabel
;
}
else
if
(
indexPath
.
row
==
1
){
contentLabel
.
text
=
@"选择收货仓库"
;
self
.
rwarehouseLabel
=
contentLabel
;
}
else
if
(
indexPath
.
row
==
2
){
contentLabel
.
text
=
@"选择类型"
;
self
.
typeLabel
=
contentLabel
;
}
}
}
-
(
void
)
setTransfer
:
(
Transfer
*
)
transfer
{
if
(
transfer
)
{
if
(
transfer
.
warehouseName
.
length
>
0
)
{
self
.
warehouseLabel
.
text
=
transfer
.
warehouseName
;
self
.
warehouseLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
warehouseCode
=
transfer
.
warehouseCode
;
self
.
warehouseName
=
transfer
.
warehouseName
;
self
.
warehouseUuid
=
transfer
.
warehouseUuid
;
self
.
selectWarehouse
=
transfer
.
warehouseUuid
;
}
if
(
transfer
.
type
.
length
>
0
)
{
NSString
*
type
=
[
transfer
.
type
isEqualToString
:
GXF_Critical
]
?
@"紧急"
:
@"普通"
;
self
.
typeLabel
.
text
=
type
;
self
.
typeLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
type
=
transfer
.
type
;
self
.
selectType
=
transfer
.
type
;
}
if
(
transfer
.
rwarehouseName
.
length
>
0
)
{
self
.
rwarehouseLabel
.
text
=
transfer
.
rwarehouseName
;
self
.
rwarehouseLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
rwarehouseCode
=
transfer
.
rwarehouseCode
;
self
.
rwarehouseName
=
transfer
.
rwarehouseName
;
self
.
rwarehouseUuid
=
transfer
.
rwarehouseUuid
;
self
.
selectRwarehouse
=
transfer
.
rwarehouseUuid
;
}
if
(
transfer
.
carnumber
.
length
>
0
)
{
self
.
carTextFiled
.
text
=
transfer
.
carnumber
;
self
.
carnumber
=
transfer
.
carnumber
;
}
if
(
transfer
.
carphone
)
{
self
.
phoneTextFiled
.
text
=
transfer
.
carphone
;
self
.
carphone
=
transfer
.
carphone
;
}
if
(
transfer
.
note
)
{
self
.
remarkTextView
.
text
=
transfer
.
note
;
self
.
note
=
transfer
.
note
;
}
}
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
){
ChooseWarehouseViewController
*
cvc
=
[
ChooseWarehouseViewController
new
];
if
(
self
.
selectWarehouse
.
length
>
0
)
{
cvc
.
selectStr
=
self
.
selectWarehouse
;
}
cvc
.
choseBaseInfo
=
^
(
NSArray
*
warehouses
){
if
(
warehouses
.
count
>
0
)
{
Warehouse
*
warehouse
=
warehouses
[
0
];
self
.
warehouseLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
warehouse
.
name
,
warehouse
.
code
];
self
.
warehouseLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
warehouseUuid
=
warehouse
.
uuid
;
self
.
warehouseCode
=
warehouse
.
code
;
self
.
warehouseName
=
warehouse
.
name
;
self
.
selectWarehouse
=
warehouse
.
uuid
;
}
};
cvc
.
isMoreChose
=
NO
;
[
self
.
delegate
pushNextViewController
:
cvc
];
}
else
if
(
indexPath
.
row
==
1
){
ChooseWarehouseViewController
*
tvc
=
[[
ChooseWarehouseViewController
alloc
]
init
];
if
(
self
.
selectRwarehouse
.
length
>
0
)
{
tvc
.
selectStr
=
self
.
selectRwarehouse
;
}
tvc
.
choseBaseInfo
=
^
(
NSArray
*
warehouses
){
if
(
warehouses
.
count
>
0
)
{
Warehouse
*
warehouse
=
warehouses
[
0
];
self
.
rwarehouseLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
warehouse
.
name
,
warehouse
.
code
];
self
.
rwarehouseLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
rwarehouseUuid
=
warehouse
.
uuid
;
self
.
rwarehouseCode
=
warehouse
.
code
;
self
.
rwarehouseName
=
warehouse
.
name
;
self
.
selectRwarehouse
=
warehouse
.
uuid
;
}
};
[
self
.
delegate
pushNextViewController
:
tvc
];
}
else
if
(
indexPath
.
row
==
2
){
ChooseTypeViewController
*
tvc
=
[[
ChooseTypeViewController
alloc
]
init
];
if
(
self
.
selectType
.
length
>
0
)
{
tvc
.
selectStr
=
self
.
selectType
;
}
tvc
.
choseBaseInfo
=
^
(
NSArray
*
types
){
if
(
types
.
count
>
0
)
{
NSString
*
type
=
types
[
0
];
self
.
typeLabel
.
text
=
type
;
self
.
selectType
=
type
;
self
.
typeLabel
.
textColor
=
GXF_CONTENT_COLOR
;
if
([
type
isEqualToString
:
@"紧急"
])
{
self
.
type
=
GXF_Critical
;
}
else
{
self
.
type
=
GXF_Normal
;
}
}
};
[
self
.
delegate
pushNextViewController
:
tvc
];
}
}
-
(
BOOL
)
growingTextViewShouldReturn
:
(
HPGrowingTextView
*
)
growingTextView
{
[
self
.
remarkTextView
resignFirstResponder
];
return
YES
;
}
-
(
BOOL
)
textFieldShouldReturn
:
(
UITextField
*
)
textField
{
[
self
.
delegate
hiddenKeyBoard
];
return
YES
;
}
@end
XFFruit/ViewControllers/Transfer/Views/TransferBoltView.h
0 → 100644
View file @
97c995b9
//
// TransferBoltView.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol
TransferBoltViewDelegate
<
NSObject
>
-
(
void
)
getBoltValueSelectRow
:
(
NSString
*
)
state
;
-
(
void
)
getuserLike
:(
NSString
*
)
userLike
;
-
(
void
)
getbillLike
:(
NSString
*
)
billLike
;
-
(
void
)
clearBoltInformation
;
@end
@interface
TransferBoltView
:
UIView
<
UITableViewDataSource
,
UITableViewDelegate
>
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArr
;
@property
(
nonatomic
,
weak
)
id
<
TransferBoltViewDelegate
>
delegate
;
@property
(
nonatomic
,
strong
)
UITextField
*
userFiled
;
//采购单号类似于
@property
(
nonatomic
,
strong
)
UITextField
*
billFiled
;
//通知单号类似于
@property
(
nonatomic
,
strong
)
UITextField
*
creatorField
;
//供应商uuid类似于
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
state
:(
NSString
*
)
state
userNumber
:(
NSString
*
)
userNumber
billNumber
:(
NSString
*
)
billNumber
;
@end
XFFruit/ViewControllers/Transfer/Views/TransferBoltView.m
0 → 100644
View file @
97c995b9
//
// TransferBoltView.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransferBoltView.h"
#import "MaskCell.h"
#define TableHeight 45
#define LeftMargin 80
#define TotalHeight 224
#define LeftHeight 44
#define BottomHeight 50
@interface
TransferBoltView
()
<
UITextFieldDelegate
>
{
UIView
*
_leftView
;
UIButton
*
_currentBtn
;
NSIndexPath
*
_currentIndexPath
;
NSString
*
_state
;
NSString
*
_billNumber
;
NSString
*
_title
;
UIButton
*
_clearBtn
;
}
@property
(
nonatomic
,
strong
)
NSString
*
state
;
@property
(
nonatomic
,
strong
)
NSString
*
billNumber
;
@property
(
nonatomic
,
strong
)
NSString
*
userNumber
;
@end
@implementation
TransferBoltView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
state
:(
NSString
*
)
state
userNumber
:(
NSString
*
)
userNumber
billNumber
:(
NSString
*
)
billNumber
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
userNumber
=
userNumber
;
self
.
billNumber
=
billNumber
;
self
.
state
=
state
;
[
self
createView
];
[
self
createRightView
];
[
self
preferData
];
}
return
self
;
}
-
(
void
)
preferData
{
if
([
self
.
state
isEqualToString
:
TRANSPORT_STATE_INITIAL
])
{
_currentIndexPath
=
[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
];
}
else
if
([
self
.
state
isEqualToString
:
TRANSPORT_STATE_UNRECEIVED
])
{
_currentIndexPath
=
[
NSIndexPath
indexPathForRow
:
1
inSection
:
0
];
}
else
if
([
self
.
state
isEqualToString
:
TRANSPORT_STATE_RECEIVED
])
{
_currentIndexPath
=
[
NSIndexPath
indexPathForRow
:
2
inSection
:
0
];
}
else
if
([
self
.
state
isEqualToString
:
TRANSPORT_STATE_ABORTED
])
{
_currentIndexPath
=
[
NSIndexPath
indexPathForRow
:
3
inSection
:
0
];
}
self
.
userFiled
.
hidden
=
YES
;
if
(
self
.
userNumber
.
length
>
0
){
self
.
userFiled
.
text
=
self
.
userNumber
;
}
self
.
billFiled
.
hidden
=
YES
;
if
(
self
.
billNumber
.
length
>
0
)
{
self
.
billFiled
.
text
=
self
.
billNumber
;
}
}
#pragma mark - 创建视图
-
(
void
)
createView
{
_leftView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
LeftMargin
,
self
.
frame
.
size
.
height
-
BottomHeight
)];
[
self
addSubview
:
_leftView
];
NSArray
*
arr
=
@[
@"按状态"
,
@"创建人代码"
,
@"调研单号"
];
for
(
NSInteger
i
=
0
;
i
<
arr
.
count
;
i
++
)
{
UIButton
*
button
=
[
UIButton
buttonWithType
:
UIButtonTypeSystem
];
button
.
frame
=
CGRectMake
(
0
,
LeftHeight
*
i
,
LeftMargin
,
LeftHeight
);
[
button
setTitle
:
arr
[
i
]
forState
:
UIControlStateNormal
];
[
button
setTitleColor
:
GXF_DETAIL_COLOR
forState
:
UIControlStateNormal
];
if
(
i
==
0
)
{
button
.
enabled
=
NO
;
_currentBtn
=
button
;
}
[
button
setBackgroundImage
:[
UIImage
imageNamed
:
@"maskEnable"
]
forState
:
UIControlStateDisabled
];
[
button
setBackgroundImage
:[
UIImage
imageNamed
:
@"mask"
]
forState
:
UIControlStateNormal
];
button
.
tag
=
1001
+
i
;
[
button
addTarget
:
self
action
:
@selector
(
leftBtnClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
_leftView
addSubview
:
button
];
}
_clearBtn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
_clearBtn
.
frame
=
CGRectMake
(
0
,
CGRectGetMaxY
(
_leftView
.
frame
),
self
.
frame
.
size
.
width
,
BottomHeight
);
[
_clearBtn
setTitle
:
@"清空选项"
forState
:
UIControlStateNormal
];
[
_clearBtn
setTitleColor
:
GXF_CONTENT_COLOR
forState
:
UIControlStateNormal
];
_clearBtn
.
titleLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
_clearBtn
addTarget
:
self
action
:
@selector
(
clearBolt
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
addSubview
:
_clearBtn
];
}
-
(
void
)
createRightView
{
NSArray
*
arr
=
@[
@"输入类似创建人代码"
,
@"输入类似调研单号"
];
UIView
*
contentView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
,
0
,
ScreenSize
.
width
-
LeftMargin
,
self
.
frame
.
size
.
height
-
BottomHeight
)];
contentView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
self
addSubview
:
contentView
];
UILabel
*
contentLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
10
,
20
,
(
ScreenSize
.
width
-
LeftMargin
-
10
*
2
),
20
)];
contentLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
contentLabel
.
text
=
@"类似于:"
;
[
contentView
addSubview
:
contentLabel
];
for
(
NSInteger
i
=
0
;
i
<
arr
.
count
;
i
++
)
{
UITextField
*
contentField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
10
,
CGRectGetMaxY
(
contentLabel
.
frame
)
+
10
,
(
ScreenSize
.
width
-
LeftMargin
-
10
*
2
),
30
)];
contentField
.
textAlignment
=
NSTextAlignmentLeft
;
contentField
.
textColor
=
GXF_CONTENT_COLOR
;
contentField
.
borderStyle
=
UITextBorderStyleRoundedRect
;
contentField
.
font
=
GXF_FIFTEENTEN_SIZE
;
contentField
.
placeholder
=
arr
[
i
];
contentField
.
returnKeyType
=
UIReturnKeyDone
;
contentField
.
delegate
=
self
;
[
contentView
addSubview
:
contentField
];
if
(
i
==
0
)
{
self
.
userFiled
=
contentField
;
}
else
if
(
i
==
1
){
self
.
billFiled
=
contentField
;
}
}
self
.
tableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
,
0
,
ScreenSize
.
width
-
LeftMargin
,
self
.
frame
.
size
.
height
-
BottomHeight
)
style
:(
UITableViewStylePlain
)];
self
.
tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
[
self
addSubview
:
self
.
tableView
];
}
-
(
void
)
leftBtnClick
:
(
UIButton
*
)
btn
{
_currentBtn
.
enabled
=
YES
;
btn
.
enabled
=
NO
;
_currentBtn
=
btn
;
[
self
keyBoardHidden
];
switch
(
btn
.
tag
)
{
case
1001
:
//状态
{
self
.
tableView
.
hidden
=
NO
;
self
.
userFiled
.
hidden
=
YES
;
self
.
billFiled
.
hidden
=
YES
;
}
break
;
case
1002
:
//条件二
{
self
.
tableView
.
hidden
=
YES
;
self
.
userFiled
.
hidden
=
NO
;
self
.
billFiled
.
hidden
=
YES
;
}
break
;
case
1003
:
//条件三
{
self
.
tableView
.
hidden
=
YES
;
self
.
userFiled
.
hidden
=
YES
;
self
.
billFiled
.
hidden
=
NO
;
}
break
;
default
:
break
;
}
}
-
(
void
)
clearBolt
{
if
(
_billFiled
.
text
.
length
>
0
)
{
_billFiled
.
text
=
@""
;
}
if
(
_userFiled
.
text
.
length
>
0
)
{
_userFiled
.
text
=
@""
;
}
if
(
_currentIndexPath
)
{
_currentIndexPath
=
nil
;
[
self
.
tableView
reloadData
];
}
if
([
self
.
delegate
respondsToSelector
:
@selector
(
clearBoltInformation
)])
{
[
self
.
delegate
clearBoltInformation
];
}
}
#pragma mark - 协议
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
dataArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"MaskID"
;
MaskCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
MaskCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
totalWidth
:
ScreenSize
.
width
-
80
totalHeight
:
TableHeight
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
}
if
(
_dataArr
.
count
>
0
)
{
cell
.
Commitbtn
.
hidden
=
YES
;
[
cell
setTitleStr
:
self
.
dataArr
[
indexPath
.
row
]];
}
if
(
_currentIndexPath
)
{
if
(
indexPath
.
row
==
_currentIndexPath
.
row
)
{
cell
.
Commitbtn
.
hidden
=
NO
;
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
}
}
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
//获取选中的cell
MaskCell
*
currentCell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
_currentIndexPath
];
currentCell
.
Commitbtn
.
hidden
=
YES
;
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
_currentIndexPath
=
indexPath
;
//initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
NSString
*
stateStr
=
@""
;
if
(
indexPath
.
row
==
0
)
{
stateStr
=
TRANSFER_STATE_INITIAL
;
}
else
if
(
indexPath
.
row
==
1
){
stateStr
=
TRANSFER_STATE_UNRECEIVED
;
}
else
if
(
indexPath
.
row
==
2
){
stateStr
=
TRANSFER_STATE_RECEIVED
;
}
else
if
(
indexPath
.
row
==
3
){
stateStr
=
TRANSFER_STATE_ABORTED
;
}
[
self
.
delegate
getBoltValueSelectRow
:
stateStr
];
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
TableHeight
;
}
-
(
BOOL
)
textFieldShouldReturn
:
(
UITextField
*
)
textField
{
[
self
keyBoardHidden
];
return
YES
;
}
-
(
void
)
touchesEnded
:
(
NSSet
*
)
touches
withEvent
:
(
UIEvent
*
)
event
{
[
self
keyBoardHidden
];
}
-
(
void
)
keyBoardHidden
{
[
self
.
userFiled
resignFirstResponder
];
[
self
.
billFiled
resignFirstResponder
];
}
-
(
void
)
textFieldDidEndEditing
:
(
UITextField
*
)
textField
{
if
(
textField
==
self
.
userFiled
)
{
// if (self.userFiled.text.length > 0) {
[
self
.
delegate
getuserLike
:
self
.
userFiled
.
text
];
// }
}
else
if
(
textField
==
self
.
billFiled
){
// if (self.billFiled.text.length > 0) {
[
self
.
delegate
getbillLike
:
self
.
billFiled
.
text
];
// }
}
}
@end
XFFruit/ViewControllers/Transfer/Views/TransferCell.h
0 → 100644
View file @
97c995b9
//
// TransferCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Transfer.h"
@interface
TransferCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
billNumberLabel
;
//单号
@property
(
nonatomic
,
strong
)
UILabel
*
warehouseLabel
;
//发货仓库
@property
(
nonatomic
,
strong
)
UILabel
*
rwarehouseLabel
;
//收货仓库
@property
(
nonatomic
,
strong
)
UILabel
*
carnumberLabel
;
//车辆
@property
(
nonatomic
,
strong
)
UILabel
*
createOperNameLabel
;
//创建人
@property
(
nonatomic
,
strong
)
UILabel
*
createTimeLabel
;
//创建时间
@property
(
nonatomic
,
strong
)
UILabel
*
lineLabel
;
@property
(
nonatomic
,
strong
)
UIButton
*
stateBtn
;
@property
(
nonatomic
,
strong
)
Transfer
*
transfer
;
@end
XFFruit/ViewControllers/Transfer/Views/TransferCell.m
0 → 100644
View file @
97c995b9
//
// TransferCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransferCell.h"
#define TitleSize 16
#define LeftMargin 90
#define TopMargin 10
#define TitleHeight 20
#define TableHeight 140
@implementation
TransferCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
];
if
(
self
)
{
[
self
bulidLayout
];
}
return
self
;
}
-
(
void
)
bulidLayout
{
self
.
stateBtn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
self
.
stateBtn
.
frame
=
CGRectMake
(
TopMargin
*
2
,
TopMargin
,
LeftMargin
-
TopMargin
*
3
,
20
);
self
.
stateBtn
.
titleLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
[
self
.
stateBtn
setTitleColor
:[
UIColor
whiteColor
]
forState
:
UIControlStateNormal
];
self
.
stateBtn
.
enabled
=
NO
;
self
.
billNumberLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
TopMargin
,
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
billNumberLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
billNumberLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
warehouseLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
billNumberLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
warehouseLabel
.
numberOfLines
=
0
;
self
.
warehouseLabel
.
textColor
=
GXF_CELL_COLOR
;
self
.
warehouseLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
self
.
rwarehouseLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
warehouseLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
rwarehouseLabel
.
numberOfLines
=
0
;
self
.
rwarehouseLabel
.
textColor
=
GXF_CELL_COLOR
;
self
.
rwarehouseLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
self
.
carnumberLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
rwarehouseLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
carnumberLabel
.
textColor
=
GXF_CELL_COLOR
;
self
.
carnumberLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
self
.
createOperNameLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
carnumberLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
createOperNameLabel
.
textColor
=
GXF_CELL_COLOR
;
self
.
createOperNameLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
self
.
createTimeLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
createOperNameLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
createTimeLabel
.
textColor
=
GXF_CELL_COLOR
;
self
.
createTimeLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
self
.
lineLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
TableHeight
-
1
,
ScreenSize
.
width
-
LeftMargin
-
TopMargin
*
2
,
1
))];;
self
.
lineLabel
.
backgroundColor
=
GXF_LINE_COLOR
;
[
self
.
contentView
addSubview
:
self
.
stateBtn
];
[
self
.
contentView
addSubview
:
self
.
billNumberLabel
];
[
self
.
contentView
addSubview
:
self
.
warehouseLabel
];
[
self
.
contentView
addSubview
:
self
.
rwarehouseLabel
];
[
self
.
contentView
addSubview
:
self
.
carnumberLabel
];
[
self
.
contentView
addSubview
:
self
.
createOperNameLabel
];
[
self
.
contentView
addSubview
:
self
.
createTimeLabel
];
[
self
.
contentView
addSubview
:
self
.
lineLabel
];
}
-
(
void
)
setTransfer
:
(
Transfer
*
)
transfer
{
self
.
billNumberLabel
.
text
=
[
NSString
stringWithFormat
:
@"单号:%@"
,
transfer
.
billnumber
];
self
.
warehouseLabel
.
text
=
[
NSString
stringWithFormat
:
@"发货仓库:%@"
,
transfer
.
warehouseName
];
self
.
rwarehouseLabel
.
text
=
[
NSString
stringWithFormat
:
@"发货仓库:%@"
,
transfer
.
rwarehouseName
];
self
.
carnumberLabel
.
text
=
[
NSString
stringWithFormat
:
@"车辆:%@"
,
transfer
.
carnumber
]
;
self
.
createOperNameLabel
.
text
=
[
NSString
stringWithFormat
:
@"创建人:%@"
,
transfer
.
create_operName
]
;
self
.
createTimeLabel
.
text
=
[
NSString
stringWithFormat
:
@"创建时间:%@"
,
transfer
.
create_time
];
NSString
*
stateStr
=
@""
;
if
([
transfer
.
state
isEqualToString
:
TRANSFER_STATE_INITIAL
])
{
stateStr
=
@"未提交"
;
[
self
.
stateBtn
setBackgroundImage
:[
UIImage
imageNamed
:
@"initial"
]
forState
:
UIControlStateDisabled
];
}
else
if
([
transfer
.
state
isEqualToString
:
TRANSFER_STATE_UNRECEIVED
])
{
stateStr
=
@"待收货"
;
[
self
.
stateBtn
setBackgroundImage
:[
UIImage
imageNamed
:
@"insurvey"
]
forState
:
UIControlStateDisabled
];
}
else
if
([
transfer
.
state
isEqualToString
:
TRANSFER_STATE_RECEIVED
])
{
stateStr
=
@"已收货"
;
[
self
.
stateBtn
setBackgroundImage
:[
UIImage
imageNamed
:
@"finish"
]
forState
:
UIControlStateDisabled
];
}
else
if
([
transfer
.
state
isEqualToString
:
TRANSFER_STATE_ABORTED
])
{
stateStr
=
@"已作废"
;
[
self
.
stateBtn
setBackgroundImage
:[
UIImage
imageNamed
:
@"finish"
]
forState
:
UIControlStateDisabled
];
}
[
self
.
stateBtn
setTitle
:
stateStr
forState
:
UIControlStateNormal
];
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
XFFruit/ViewControllers/Transfer/Views/TransferProductCell.h
0 → 100644
View file @
97c995b9
//
// TransferProductCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TransferPdtDetail.h"
@interface
TransferProductCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UIImageView
*
smallImageView
;
@property
(
nonatomic
,
strong
)
UIButton
*
editBtn
;
@property
(
nonatomic
,
strong
)
UILabel
*
seqLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
priceLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
countLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
lineLabel
;
@property
(
nonatomic
,
strong
)
UIView
*
showView
;
@property
(
nonatomic
,
strong
)
UILabel
*
showStandLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showCountLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showBaseCountLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showPriceLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showTotalLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showNoteLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showPurchaseLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showSourceNumberLabel
;
@property
(
nonatomic
,
strong
)
NSString
*
rightImageName
;
-
(
void
)
setPdtDetail
:(
TransferPdtDetail
*
)
pdtDetail
row
:(
NSInteger
)
row
;
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
withImageName
:(
NSString
*
)
imageName
;
@end
XFFruit/ViewControllers/Transfer/Views/TransferProductCell.m
0 → 100644
View file @
97c995b9
//
// TransferProductCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransferProductCell.h"
#define LeftMargin 13
#define TableHeight 44
#define SmallSize 10
#define SmallWidth 20
#define SpaceMargin 1
#define LeftWidth 45
#define RightWidth 30
#define ShowWidth 150
#define ShowHeight 20
@implementation
TransferProductCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
withImageName
:(
NSString
*
)
imageName
{
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
];
if
(
self
)
{
self
.
rightImageName
=
imageName
;
[
self
bulidLayout
];
}
return
self
;
}
-
(
void
)
bulidLayout
{
CGFloat
headWidth
=
(
ScreenSize
.
width
-
LeftWidth
*
2
-
SpaceMargin
*
(
3
-
1
))
/
3
;
self
.
smallImageView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
,
(
TableHeight
-
SmallSize
)
/
2
,
SmallSize
,
SmallSize
)];
self
.
smallImageView
.
image
=
[
UIImage
imageNamed
:
@"arrowright"
];
self
.
smallImageView
.
contentMode
=
UIViewContentModeScaleAspectFit
;
self
.
seqLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMaxX
(
self
.
smallImageView
.
frame
),
0
,
SmallWidth
,
TableHeight
))];
self
.
seqLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
seqLabel
.
text
=
@"13"
;
self
.
seqLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
titleLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftWidth
,
0
,
headWidth
,
TableHeight
))];
self
.
titleLabel
.
textAlignment
=
NSTextAlignmentCenter
;
self
.
titleLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
titleLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
priceLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMaxX
(
self
.
titleLabel
.
frame
)
+
SpaceMargin
,
0
,
headWidth
,
TableHeight
))];
self
.
priceLabel
.
textAlignment
=
NSTextAlignmentCenter
;
self
.
priceLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
priceLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
countLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMaxX
(
self
.
priceLabel
.
frame
)
+
SpaceMargin
,
0
,
headWidth
,
TableHeight
))];
self
.
countLabel
.
textAlignment
=
NSTextAlignmentCenter
;
self
.
countLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
countLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
showView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
TableHeight
,
ScreenSize
.
width
,
0
)];
self
.
showView
.
clipsToBounds
=
YES
;
self
.
showStandLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMaxX
(
self
.
seqLabel
.
frame
),
0
,
ShowWidth
,
ShowHeight
))];
self
.
showStandLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showStandLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showStandLabel
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showCountLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMaxX
(
self
.
showStandLabel
.
frame
),
0
,
ShowWidth
,
ShowHeight
))];
self
.
showCountLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showCountLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showCountLabel
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showBaseCountLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMinX
(
self
.
showStandLabel
.
frame
),
CGRectGetMaxY
(
self
.
showStandLabel
.
frame
),
ShowWidth
,
ShowHeight
))];
self
.
showBaseCountLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showBaseCountLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showBaseCountLabel
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showPriceLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMinX
(
self
.
showCountLabel
.
frame
),
CGRectGetMaxY
(
self
.
showStandLabel
.
frame
),
ShowWidth
,
ShowHeight
))];
self
.
showPriceLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showPriceLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showPriceLabel
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showTotalLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMinX
(
self
.
showStandLabel
.
frame
),
CGRectGetMaxY
(
self
.
showBaseCountLabel
.
frame
),
ShowWidth
,
ShowHeight
))];
self
.
showTotalLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showTotalLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showTotalLabel
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showNoteLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMinX
(
self
.
showCountLabel
.
frame
),
CGRectGetMaxY
(
self
.
showBaseCountLabel
.
frame
),
ShowWidth
,
ShowHeight
))];
self
.
showNoteLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showNoteLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showNoteLabel
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showPurchaseLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMinX
(
self
.
showStandLabel
.
frame
),
CGRectGetMaxY
(
self
.
showTotalLabel
.
frame
),
ShowWidth
+
100
,
ShowHeight
))];
self
.
showPurchaseLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showPurchaseLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showPurchaseLabel
.
text
=
@"来源类型:"
;
self
.
showPurchaseLabel
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showSourceNumberLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMinX
(
self
.
showStandLabel
.
frame
),
CGRectGetMaxY
(
self
.
showPurchaseLabel
.
frame
),
ShowWidth
+
100
,
ShowHeight
))];
self
.
showSourceNumberLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showSourceNumberLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showSourceNumberLabel
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
editBtn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
self
.
editBtn
setImage
:[
UIImage
imageNamed
:
self
.
rightImageName
]
forState
:
UIControlStateNormal
];
self
.
editBtn
.
frame
=
CGRectMake
(
ScreenSize
.
width
-
LeftWidth
,
0
,
LeftWidth
,
TableHeight
);
self
.
editBtn
.
contentMode
=
UIViewContentModeScaleAspectFit
;
self
.
lineLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
TableHeight
-
1
,
ScreenSize
.
width
-
LeftMargin
*
2
,
1
))];;
self
.
lineLabel
.
backgroundColor
=
GXF_LINE_COLOR
;
[
self
.
contentView
addSubview
:
self
.
smallImageView
];
[
self
.
contentView
addSubview
:
self
.
seqLabel
];
[
self
.
contentView
addSubview
:
self
.
titleLabel
];
[
self
.
contentView
addSubview
:
self
.
priceLabel
];
[
self
.
contentView
addSubview
:
self
.
countLabel
];
[
self
.
contentView
addSubview
:
self
.
editBtn
];
[
self
.
contentView
addSubview
:
self
.
showView
];
[
self
.
showView
addSubview
:
self
.
showStandLabel
];
[
self
.
showView
addSubview
:
self
.
showCountLabel
];
[
self
.
showView
addSubview
:
self
.
showBaseCountLabel
];
[
self
.
showView
addSubview
:
self
.
showPriceLabel
];
[
self
.
showView
addSubview
:
self
.
showPurchaseLabel
];
[
self
.
showView
addSubview
:
self
.
showSourceNumberLabel
];
[
self
.
showView
addSubview
:
self
.
showTotalLabel
];
[
self
.
showView
addSubview
:
self
.
showNoteLabel
];
[
self
.
contentView
addSubview
:
self
.
lineLabel
];
}
-
(
void
)
setPdtDetail
:
(
TransferPdtDetail
*
)
pdtDetail
row
:
(
NSInteger
)
row
{
self
.
seqLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
@
(
row
+
1
)];
self
.
titleLabel
.
text
=
pdtDetail
.
productName
;
self
.
priceLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@元"
,[
pdtDetail
.
price
stringValue
]];
self
.
countLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@%@"
,
pdtDetail
.
qty
,
pdtDetail
.
unit
];
self
.
showStandLabel
.
text
=
[
NSString
stringWithFormat
:
@"包装规格:1*%@%@"
,
pdtDetail
.
qpc
,
pdtDetail
.
baseUnit
];
self
.
showCountLabel
.
text
=
[
NSString
stringWithFormat
:
@"包装数量:%@%@"
,
pdtDetail
.
qty
,
pdtDetail
.
unit
];
self
.
showBaseCountLabel
.
text
=
[
NSString
stringWithFormat
:
@"基础数量:%@%@"
,
pdtDetail
.
baseQty
,
pdtDetail
.
baseUnit
];
self
.
showPriceLabel
.
text
=
[
NSString
stringWithFormat
:
@"包装单价:%@元"
,
pdtDetail
.
packprice
];
NSString
*
sourceT
=
@""
;
if
([
pdtDetail
.
sourcetype
isEqualToString
:
@"none"
])
{
sourceT
=
@"无"
;
}
else
if
([
pdtDetail
.
sourcetype
isEqualToString
:
@"purchase"
])
{
sourceT
=
@"采购单"
;
}
if
([
pdtDetail
.
sourcetype
isEqualToString
:
@"transport"
])
{
sourceT
=
@"发运单"
;
}
self
.
showPurchaseLabel
.
text
=
[
NSString
stringWithFormat
:
@"来源类型:%@"
,
sourceT
];
self
.
showSourceNumberLabel
.
text
=
[
NSString
stringWithFormat
:
@"来源单号:%@"
,
pdtDetail
.
sourcebillnumber
.
length
>
0
?
pdtDetail
.
sourcebillnumber
:
@"无"
];
self
.
showTotalLabel
.
text
=
[
NSString
stringWithFormat
:
@"总金额:%@元"
,
pdtDetail
.
total
];
self
.
showNoteLabel
.
text
=
[
NSString
stringWithFormat
:
@"备注:%@"
,
pdtDetail
.
note
?
pdtDetail
.
note
:
@"无"
];
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
XFFruit/ViewControllers/Transport/Controllers/NewCostViewController.m
View file @
97c995b9
...
...
@@ -128,7 +128,7 @@ typedef enum : NSUInteger {
ShowMessage
(
@"尾款不能为空"
);
return
NO
;
}
if
([
_leftmoneyField
.
text
floatValue
]
<
=
0
)
{
if
([
_leftmoneyField
.
text
floatValue
]
<
0
)
{
ShowMessage
(
@"检查应付金额和已付金额是否正确"
);
return
NO
;
}
...
...
XFFruit/ViewControllers/Transport/Controllers/NewTransportViewController.m
View file @
97c995b9
...
...
@@ -32,8 +32,9 @@ typedef enum : NSUInteger {
id
uuidObject
;
id
billNumberObject
;
NSNumber
*
versionObject
;
}
}
@property
(
nonatomic
,
strong
)
NSString
*
state
;
@end
@implementation
NewTransportViewController
...
...
@@ -129,6 +130,7 @@ typedef enum : NSUInteger {
case
SaveTag
:
{
if
([
self
checkTransport
])
{
self
.
state
=
TRANSFER_STATE_INITIAL
;
[
self
getDataFromServer
:
TRANSPORT_STATE_INITIAL
msg
:
@"正在保存..."
];
}
}
...
...
@@ -362,6 +364,7 @@ typedef enum : NSUInteger {
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
buttonIndex
==
1
)
{
//提交
self
.
state
=
TRANSPORT_STATE_UNRECEIVED
;
[
self
getDataFromServer
:
TRANSPORT_STATE_UNRECEIVED
msg
:
@"正在提交..."
];
}
}
...
...
@@ -383,7 +386,12 @@ typedef enum : NSUInteger {
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
if
(
self
.
transport
&&
[
self
.
state
isEqualToString
:
TRANSPORT_STATE_INITIAL
]){
[
ICRUserUtil
sharedInstance
].
needFresh
=
YES
;
}
}
/*
#pragma mark - Navigation
...
...
XFFruit/ViewControllers/Transport/Controllers/TransportDetailViewController.m
View file @
97c995b9
XFFruit/ViewControllers/Transport/Controllers/TransportViewController.m
View file @
97c995b9
...
...
@@ -259,7 +259,7 @@ typedef enum : NSUInteger {
_boltView
.
backgroundColor
=
XXFBgColor
;
_boltView
.
delegate
=
self
;
_boltView
.
dataArr
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"未提交"
,
@"
未
收货"
,
@"已收货"
,
@"已作废"
,
nil
];
_boltView
.
dataArr
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"未提交"
,
@"
待
收货"
,
@"已收货"
,
@"已作废"
,
nil
];
[
_maskView
addSubview
:
_boltView
];
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_boltView
.
frame
;
...
...
XFFruit/ViewControllers/Transport/Views/TransportPurchaseCell.h
View file @
97c995b9
...
...
@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
#import "PurchaseBill.h"
#import "Transport.h"
@interface
TransportPurchaseCell
:
UITableViewCell
<
UITableViewDataSource
,
UITableViewDelegate
>
@property
(
nonatomic
,
strong
)
UIView
*
bgView
;
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
...
...
@@ -24,6 +24,7 @@
@property
(
nonatomic
,
strong
)
NSMutableArray
*
selectArr
;
-
(
void
)
setPurchaseBill
:(
PurchaseBill
*
)
bill
selectArr
:(
NSMutableArray
*
)
selectArr
;
-
(
void
)
setTransPort
:(
Transport
*
)
bill
selectArr
:(
NSMutableArray
*
)
selectArr
;
@end
XFFruit/ViewControllers/Transport/Views/TransportPurchaseCell.m
View file @
97c995b9
...
...
@@ -85,6 +85,16 @@
//重要
[
self
.
secondTable
reloadData
];
}
-
(
void
)
setTransPort
:
(
Transport
*
)
bill
selectArr
:
(
NSMutableArray
*
)
selectArr
{
self
.
bgView
.
height
=
92
+
bill
.
pdtDetails
.
count
*
44
;
self
.
secondTable
.
height
=
self
.
bgView
.
height
-
45
;
self
.
titleLabel
.
text
=
[
NSString
stringWithFormat
:
@"发运单号:%@"
,
bill
.
billnumber
];
self
.
secondArr
=
[
NSMutableArray
array
];
self
.
selectArr
=
selectArr
;
[
self
.
secondArr
addObjectsFromArray
:
bill
.
pdtDetails
];
}
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
...
...
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