Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
f683fd96
Commit
f683fd96
authored
5 years ago
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批次输入正确后自动选择
parent
7d3e7368
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
12 deletions
+28
-12
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/入库/PiCiXuanZeCell.swift
GeliBusinessPlatform/ViewController/入库/PiCiXuanZeCell.swift
+1
-0
GeliBusinessPlatform/ViewController/入库/PiCiXuanZeViewController.swift
...Platform/ViewController/入库/PiCiXuanZeViewController.swift
+27
-12
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
f683fd96
No preview for this file type
This diff is collapsed.
Click to expand it.
GeliBusinessPlatform/ViewController/入库/PiCiXuanZeCell.swift
View file @
f683fd96
...
@@ -36,6 +36,7 @@ class PiCiXuanZeCell: UITableViewCell,UITextFieldDelegate {
...
@@ -36,6 +36,7 @@ class PiCiXuanZeCell: UITableViewCell,UITextFieldDelegate {
}
}
func
textFieldDidEndEditing
(
_
textField
:
UITextField
)
{
func
textFieldDidEndEditing
(
_
textField
:
UITextField
)
{
print
(
"fuck == "
,
textField
.
text
)
if
isPurnInt
(
string
:
textTF
.
text
!
){
if
isPurnInt
(
string
:
textTF
.
text
!
){
delegate
?
.
PiCiXuanZeCellRefreshCount
(
cell
:
self
)
delegate
?
.
PiCiXuanZeCellRefreshCount
(
cell
:
self
)
}
}
...
...
This diff is collapsed.
Click to expand it.
GeliBusinessPlatform/ViewController/入库/PiCiXuanZeViewController.swift
View file @
f683fd96
...
@@ -13,7 +13,7 @@ protocol PiCiXuanZeViewControllerDelegate {
...
@@ -13,7 +13,7 @@ protocol PiCiXuanZeViewControllerDelegate {
class
PiCiXuanZeViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
PiCiXuanZeCellDelegate
{
class
PiCiXuanZeViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
PiCiXuanZeCellDelegate
{
var
first
=
true
var
p_id
:
Int
?
var
p_id
:
Int
?
var
sku_id
:
Int
?
var
sku_id
:
Int
?
var
tag
:
Int
?
var
tag
:
Int
?
...
@@ -38,6 +38,9 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
...
@@ -38,6 +38,9 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
@IBOutlet
weak
var
listView
:
UITableView
!
@IBOutlet
weak
var
listView
:
UITableView
!
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
if
recordArr
.
count
==
0
{
first
=
false
}
navbar
.
title
=
"批次选择"
navbar
.
title
=
"批次选择"
self
.
view
.
addSubview
(
navbar
)
self
.
view
.
addSubview
(
navbar
)
topView
.
snp
.
makeConstraints
{
(
make
)
in
topView
.
snp
.
makeConstraints
{
(
make
)
in
...
@@ -89,7 +92,7 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
...
@@ -89,7 +92,7 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
}
}
return
dataArray
.
count
return
dataArray
.
count
}
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
==
1
{
if
indexPath
.
section
==
1
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"CRKSumCell"
)
as!
CRKSumCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"CRKSumCell"
)
as!
CRKSumCell
...
@@ -123,38 +126,50 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
...
@@ -123,38 +126,50 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
cell
.
textTF
.
text
=
"
\(
item
.
chuHuoLiang
!
)
"
cell
.
textTF
.
text
=
"
\(
item
.
chuHuoLiang
!
)
"
}
}
cell
.
iconBtn
.
isSelected
=
true
cell
.
iconBtn
.
isSelected
=
true
selectArr
.
append
(
cell
.
tag
)
if
first
{
first
=
false
selectArr
.
append
(
cell
.
tag
)
}
}
}
}
}
}
}
return
cell
return
cell
}
}
func
PiCiXuanZeCellBtnTextChange
(
sender
:
String
,
cell
:
PiCiXuanZeCell
)
{
func
PiCiXuanZeCellBtnTextChange
(
sender
:
String
,
cell
:
PiCiXuanZeCell
)
{
print
(
"2 == "
,
selectArr
,
recordArr
.
first
?
.
chuHuoLiang
)
let
num
=
sender
as
NSString
let
num
=
sender
as
NSString
let
data
=
dataArray
[
cell
.
tag
]
let
data
=
dataArray
[
cell
.
tag
]
data
.
chuHuoLiang
=
num
.
integerValue
data
.
chuHuoLiang
=
num
.
integerValue
}
}
func
PiCiXuanZeCellRefreshCount
(
cell
:
PiCiXuanZeCell
)
{
func
PiCiXuanZeCellRefreshCount
(
cell
:
PiCiXuanZeCell
)
{
if
selectArr
.
contains
(
cell
.
tag
)
==
false
{
selectArr
.
append
(
cell
.
tag
)
}
print
(
selectArr
.
count
)
let
data
=
dataArray
[
cell
.
tag
]
let
idx
=
recordArr
.
firstIndex
{
(
model
)
->
Bool
in
return
data
.
batch_id
==
model
.
batch_id
}
if
idx
==
nil
{
recordArr
.
append
(
data
)
}
print
(
recordArr
.
count
)
totalCount
=
0
totalCount
=
0
print
(
"1 == "
,
selectArr
,
recordArr
.
first
?
.
chuHuoLiang
)
for
item
in
selectArr
{
for
item
in
selectArr
{
let
data
=
dataArray
[
item
]
let
data
=
dataArray
[
item
]
if
data
.
chuHuoLiang
!=
nil
{
if
data
.
chuHuoLiang
!=
nil
{
print
(
data
.
chuHuoLiang
)
totalCount
+=
data
.
chuHuoLiang
!
totalCount
+=
data
.
chuHuoLiang
!
}
}
}
}
if
selectArr
.
contains
(
cell
.
tag
)
==
false
{
selectArr
.
append
(
cell
.
tag
)
}
// let index = IndexPath(row: 0, section: 1)
// listView.reloadRows(at: [index], with: .none)
listView
.
reloadData
()
listView
.
reloadData
()
}
}
func
PiCiXuanZeCellBtnSelect
(
cell
:
PiCiXuanZeCell
)
{
func
PiCiXuanZeCellBtnSelect
(
cell
:
PiCiXuanZeCell
)
{
//已选择cell
//已选择cell
if
selectArr
.
contains
(
cell
.
tag
){
if
selectArr
.
contains
(
cell
.
tag
){
let
idx
=
selectArr
.
index
(
of
:
cell
.
tag
)
let
idx
=
selectArr
.
index
(
of
:
cell
.
tag
)
...
@@ -174,7 +189,7 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
...
@@ -174,7 +189,7 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
}
}
totalCount
=
0
totalCount
=
0
print
(
"0 == "
,
selectArr
,
recordArr
.
first
?
.
chuHuoLiang
)
for
item
in
recordArr
{
for
item
in
recordArr
{
if
item
.
chuHuoLiang
!=
nil
{
if
item
.
chuHuoLiang
!=
nil
{
totalCount
+=
item
.
chuHuoLiang
!
totalCount
+=
item
.
chuHuoLiang
!
...
...
This diff is collapsed.
Click to expand it.
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