Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ALand
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
张杰
ALand
Commits
e5d8c074
Commit
e5d8c074
authored
May 06, 2016
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品管理 bug fix
parent
c8653d5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
52 deletions
+60
-52
CommodityManagementViewController.m
...s/Home/ViewController/CommodityManagementViewController.m
+29
-25
ManagementViewController.m
.../CodeClass/Home/ViewController/ManagementViewController.m
+30
-27
JavenSortView.m
ALand/Global/JavenSortView.m
+1
-0
No files found.
ALand/CodeClass/Home/ViewController/CommodityManagementViewController.m
View file @
e5d8c074
...
@@ -58,8 +58,9 @@
...
@@ -58,8 +58,9 @@
[
self
setUpViews
];
[
self
setUpViews
];
[
self
setUpSearchBar
];
[
self
setUpSearchBar
];
[
self
.
topView
.
buttonAddCommodity
addTarget
:
self
action
:
@selector
(
addCommodityAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
kButtonAddAction
(
self
.
topView
.
buttonAddCommodity
,
addCommodityAction
)
[
self
.
topView
.
buttonManageCommodity
addTarget
:
self
action
:
@selector
(
manageManentAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
kButtonAddAction
(
self
.
topView
.
buttonManageCommodity
,
manageManentAction
)
}
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
...
@@ -107,9 +108,7 @@
...
@@ -107,9 +108,7 @@
//设置现在默认选中的排序方式
//设置现在默认选中的排序方式
[
self
.
sorView
defaultSelectISLeft
:
YES
row
:
0
];
[
self
.
sorView
defaultSelectISLeft
:
YES
row
:
0
];
// self.topView.isLeft = YES;
// self.topView.row = 0;
WS
(
weakSelf
)
WS
(
weakSelf
)
self
.
sorView
.
leftTableSelect
=
^
(
NSInteger
row
){
self
.
sorView
.
leftTableSelect
=
^
(
NSInteger
row
){
[
weakSelf
leftSelectCodtition
:
row
];
[
weakSelf
leftSelectCodtition
:
row
];
...
@@ -121,7 +120,6 @@
...
@@ -121,7 +120,6 @@
CLog
(
@"r"
);
CLog
(
@"r"
);
};
};
//
_tableView
=
[
UITableView
plainTableViewWithTarget
:
self
cellNibName
:
@"CommodityTableViewCell"
cellId
:
kCellId
];
_tableView
=
[
UITableView
plainTableViewWithTarget
:
self
cellNibName
:
@"CommodityTableViewCell"
cellId
:
kCellId
];
[
self
.
view
addSubview
:
_tableView
];
[
self
.
view
addSubview
:
_tableView
];
_tableView
.
sd_layout
.
topSpaceToView
(
self
.
sorView
,
0
).
leftEqualToView
(
self
.
view
).
rightEqualToView
(
self
.
view
).
bottomEqualToView
(
self
.
view
);
_tableView
.
sd_layout
.
topSpaceToView
(
self
.
sorView
,
0
).
leftEqualToView
(
self
.
view
).
rightEqualToView
(
self
.
view
).
bottomEqualToView
(
self
.
view
);
...
@@ -208,26 +206,9 @@
...
@@ -208,26 +206,9 @@
}
}
-
(
void
)
setUpData
{
-
(
void
)
setUpData
{
UserInfo
*
info
=
[
UserInfo
shareInstance
];
NSDictionary
*
params
=
@{
@"defintion"
:
@{
@"probePages"
:
@0
,
@"orders"
:
@[@{
@"field"
:
self
.
field
,
@"direction"
:
self
.
direction
}],
@"conditions"
:
@[@{
@"parameters"
:
@[
info
.
domain
],
@"operation"
:
@"domain equals"
,
@"parameter"
:
@{
@"operation"
:
@"string"
}},
@{
@"parameters"
:
@[@[[
UserInfo
shareInstance
].
shop
.
uuid
]],
@"operation"
:
@"shop uuid equals"
,
@"parameter"
:
@{
@"operation"
:
@"sring"
}},
@{
@"parameters"
:
@[
self
.
searchText
],
@"operation"
:
self
.
condition
,
@"parameter"
:
@{
@"operation"
:
@"sring"
}}],
@"pageSize"
:
kPageSize
,
@"page"
:
@0
},
@"fetchParts"
:
@[
@"string"
]};
WS
(
weakSelf
)
WS
(
weakSelf
)
[[
HTTPCilent
shareCilent
]
POST
:
@"goods/query2"
parameters
:
params
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[[
HTTPCilent
shareCilent
]
POST
:
@"goods/query2"
parameters
:
[
self
getParams
]
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
for
(
NSDictionary
*
dic
in
responseObject
[
@"queryResult"
])
{
for
(
NSDictionary
*
dic
in
responseObject
[
@"queryResult"
])
{
CommotityListModel
*
model
=
[
CommotityListModel
modelObjectWithDictionary
:
dic
];
CommotityListModel
*
model
=
[
CommotityListModel
modelObjectWithDictionary
:
dic
];
...
@@ -241,6 +222,29 @@
...
@@ -241,6 +222,29 @@
}
}
-
(
NSDictionary
*
)
getParams
{
UserInfo
*
info
=
[
UserInfo
shareInstance
];
NSDictionary
*
params
=
@{
@"defintion"
:
@{
@"probePages"
:
@0
,
@"orders"
:
@[@{
@"field"
:
self
.
field
,
@"direction"
:
self
.
direction
}],
@"conditions"
:
@[@{
@"parameters"
:
@[
info
.
domain
],
@"operation"
:
@"domain equals"
,
@"parameter"
:
@{
@"operation"
:
@"string"
}},
@{
@"parameters"
:
@[@[[
UserInfo
shareInstance
].
shop
.
uuid
]],
@"operation"
:
@"shop uuid equals"
,
@"parameter"
:
@{
@"operation"
:
@"sring"
}},
@{
@"parameters"
:
@[
self
.
searchText
],
@"operation"
:
self
.
condition
,
@"parameter"
:
@{
@"operation"
:
@"sring"
}}],
@"pageSize"
:
kPageSize
,
@"page"
:
@0
},
@"fetchParts"
:
@[
@"string"
]};
return
params
;
}
#pragma mark =========== action ===========
#pragma mark =========== action ===========
-
(
void
)
searchAct
{
-
(
void
)
searchAct
{
...
...
ALand/CodeClass/Home/ViewController/ManagementViewController.m
View file @
e5d8c074
...
@@ -54,6 +54,8 @@
...
@@ -54,6 +54,8 @@
[
weakSelf
rightSelectCondition
:
row
];
[
weakSelf
rightSelectCondition
:
row
];
CLog
(
@"r"
);
CLog
(
@"r"
);
};
};
_tableView
=
[
UITableView
plainTableViewWithTarget
:
self
cellNibName
:
@"CommodityTableViewCell"
cellId
:
kCellId
];
_tableView
=
[
UITableView
plainTableViewWithTarget
:
self
cellNibName
:
@"CommodityTableViewCell"
cellId
:
kCellId
];
[
self
.
view
addSubview
:
_tableView
];
[
self
.
view
addSubview
:
_tableView
];
_tableView
.
sd_layout
.
topSpaceToView
(
self
.
sorView
,
0
).
leftEqualToView
(
self
.
view
).
rightEqualToView
(
self
.
view
).
bottomSpaceToView
(
self
.
view
,
70
);
_tableView
.
sd_layout
.
topSpaceToView
(
self
.
sorView
,
0
).
leftEqualToView
(
self
.
view
).
rightEqualToView
(
self
.
view
).
bottomSpaceToView
(
self
.
view
,
70
);
...
@@ -149,7 +151,23 @@
...
@@ -149,7 +151,23 @@
-
(
void
)
setUpData
{
-
(
void
)
setUpData
{
WS
(
weakSelf
)
[[
HTTPCilent
shareCilent
]
POST
:
@"goods/query2"
parameters
:[
self
getParams
]
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
for
(
NSDictionary
*
dic
in
responseObject
[
@"queryResult"
])
{
CommotityListModel
*
model
=
[
CommotityListModel
modelObjectWithDictionary
:
dic
];
[
weakSelf
.
arrCellData
addObject
:
model
];
}
[
weakSelf
.
tableView
reloadData
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
}];
}
-
(
NSDictionary
*
)
getParams
{
NSDictionary
*
params
=
@{
@"defintion"
:
@{
@"probePages"
:
@0
,
NSDictionary
*
params
=
@{
@"defintion"
:
@{
@"probePages"
:
@0
,
@"orders"
:
@[@{
@"field"
:
self
.
field
,
@"orders"
:
@[@{
@"field"
:
self
.
field
,
@"direction"
:
self
.
direction
}],
@"direction"
:
self
.
direction
}],
...
@@ -165,21 +183,11 @@
...
@@ -165,21 +183,11 @@
@"pageSize"
:
kPageSize
,
@"pageSize"
:
kPageSize
,
@"page"
:
@0
},
@"page"
:
@0
},
@"fetchParts"
:
@[
@"string"
]};
@"fetchParts"
:
@[
@"string"
]};
return
params
;
WS
(
weakSelf
)
[[
HTTPCilent
shareCilent
]
POST
:
@"goods/query2"
parameters
:
params
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
for
(
NSDictionary
*
dic
in
responseObject
[
@"queryResult"
])
{
CommotityListModel
*
model
=
[
CommotityListModel
modelObjectWithDictionary
:
dic
];
[
weakSelf
.
arrCellData
addObject
:
model
];
}
[
weakSelf
.
tableView
reloadData
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
}];
}
}
#pragma mark =========== action ===========
#pragma mark =========== action ===========
-
(
void
)
selectAll
:
(
UIButton
*
)
btn
{
-
(
void
)
selectAll
:
(
UIButton
*
)
btn
{
...
@@ -187,9 +195,9 @@
...
@@ -187,9 +195,9 @@
if
(
self
.
dicSelectIds
.
allKeys
.
count
==
self
.
arrCellData
.
count
)
{
//全选
if
(
self
.
dicSelectIds
.
allKeys
.
count
==
self
.
arrCellData
.
count
)
{
//全选
[
self
.
bottomView
deselectAll
];
[
self
.
bottomView
deselectAll
];
for
(
int
i
=
0
;
i
<
self
.
arrCellData
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
self
.
arrCellData
.
count
;
i
++
)
{
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForItem
:
i
inSection
:
0
];
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForItem
:
i
inSection
:
0
];
[
self
.
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
[
self
.
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
[
self
.
dicSelectIds
removeObjectForKey
:
model
.
uuid
];
[
self
.
dicSelectIds
removeObjectForKey
:
model
.
uuid
];
...
@@ -308,24 +316,19 @@
...
@@ -308,24 +316,19 @@
//解析数据
//解析数据
-
(
void
)
unparseData
:
(
NSDictionary
*
)
responseObject
{
-
(
void
)
unparseData
:
(
NSDictionary
*
)
responseObject
{
MBProgressHUD
*
hud
=
[[
MBProgressHUD
alloc
]
initWithView
:
self
.
view
];
[
self
.
view
addSubview
:
hud
];
if
([
responseObject
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
responseObject
[
@"code"
]
isEqualToNumber
:
@0
])
{
UIImage
*
image
=
[[
UIImage
imageNamed
:
@"Checkmark"
]
imageWithRenderingMode
:
UIImageRenderingModeAlwaysTemplate
];
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
initWithImage
:
image
];
imageView
.
tintColor
=
kSysWhite
;
hud
.
customView
=
imageView
;
hud
.
mode
=
MBProgressHUDModeCustomView
;
hud
.
labelText
=
@"操作成功!"
;
[
MBProgressHUD
Javen_showSuccess
:
@"操作成功!"
onView
:
self
.
view
delay
:
0
.
7
complete
:
nil
];
[
self
.
dicSelectIds
removeAllObjects
];
[
self
.
dicSelectIds
removeAllObjects
];
[
self
.
sorView
defaultSelectISLeft
:
YES
row
:
0
];
[
self
resetReloadData
];
[
self
resetReloadData
];
}
else
{
}
else
{
hud
.
mode
=
MBProgressHUDModeText
;
[
MBProgressHUD
Javen_showError
:
@"未知错误!"
onView
:
self
.
view
delay
:
0
.
7
complete
:
nil
];
hud
.
labelText
=
@"未知错误!"
;
}
}
[
hud
show
:
YES
];
[
hud
hide
:
YES
afterDelay
:
0
.
7
];
[
self
.
bottomView
deselectAll
];
}
}
//检查是否全部选中了
//检查是否全部选中了
...
...
ALand/Global/JavenSortView.m
View file @
e5d8c074
...
@@ -323,6 +323,7 @@
...
@@ -323,6 +323,7 @@
-
(
void
)
defaultSelectISLeft
:
(
BOOL
)
isLeft
row
:
(
NSInteger
)
row
-
(
void
)
defaultSelectISLeft
:
(
BOOL
)
isLeft
row
:
(
NSInteger
)
row
{
{
self
.
selectedMark
=
row
;
if
(
isLeft
)
{
if
(
isLeft
)
{
self
.
isLeft
=
YES
;
self
.
isLeft
=
YES
;
self
.
arrTitles
=
self
.
arrLeft
;
self
.
arrTitles
=
self
.
arrLeft
;
...
...
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