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
93f8bc21
Commit
93f8bc21
authored
Jun 09, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
待补充时间选择
parent
f8abf555
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
161 additions
and
30 deletions
+161
-30
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Model/VendorModel/VendorListModel.swift
GeliBusinessPlatform/Model/VendorModel/VendorListModel.swift
+2
-0
GeliBusinessPlatform/ViewController/供应商管理/GYSGLCell.swift
GeliBusinessPlatform/ViewController/供应商管理/GYSGLCell.swift
+1
-3
GeliBusinessPlatform/ViewController/供应商管理/GYSGLCell.xib
GeliBusinessPlatform/ViewController/供应商管理/GYSGLCell.xib
+4
-13
GeliBusinessPlatform/ViewController/供应商管理/GYSListViewController.swift
...Platform/ViewController/供应商管理/GYSListViewController.swift
+92
-4
GeliBusinessPlatform/ViewController/地址管理/DZGLViewController.swift
...nessPlatform/ViewController/地址管理/DZGLViewController.swift
+7
-1
GeliBusinessPlatform/ViewController/新增采购单/CGDCell.swift
GeliBusinessPlatform/ViewController/新增采购单/CGDCell.swift
+13
-2
GeliBusinessPlatform/ViewController/新增采购单/CGDCell.xib
GeliBusinessPlatform/ViewController/新增采购单/CGDCell.xib
+0
-0
GeliBusinessPlatform/ViewController/新增采购单/XinCaiGouViewController.swift
...atform/ViewController/新增采购单/XinCaiGouViewController.swift
+42
-7
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
93f8bc21
No preview for this file type
GeliBusinessPlatform/Model/VendorModel/VendorListModel.swift
View file @
93f8bc21
...
@@ -33,6 +33,7 @@ class VendorListDataModel: Mappable {
...
@@ -33,6 +33,7 @@ class VendorListDataModel: Mappable {
var
city
:
Int
?
//市id
var
city
:
Int
?
//市id
var
district
:
Int
?
//区id
var
district
:
Int
?
//区id
var
address
:
String
?
//详细地址
var
address
:
String
?
//详细地址
var
contacts_name
:
String
?
//联系人
var
contacts_phone
:
String
?
//联系人电话
var
contacts_phone
:
String
?
//联系人电话
var
contacts_mobile
:
String
?
//联系人手机号
var
contacts_mobile
:
String
?
//联系人手机号
var
zhizhao
:
String
?
//营业执照
var
zhizhao
:
String
?
//营业执照
...
@@ -52,6 +53,7 @@ class VendorListDataModel: Mappable {
...
@@ -52,6 +53,7 @@ class VendorListDataModel: Mappable {
ven_name
<-
map
[
"ven_name"
]
ven_name
<-
map
[
"ven_name"
]
province
<-
map
[
"province"
]
province
<-
map
[
"province"
]
city
<-
map
[
"city"
]
city
<-
map
[
"city"
]
contacts_name
<-
map
[
"contacts_name"
]
district
<-
map
[
"district"
]
district
<-
map
[
"district"
]
address
<-
map
[
"address"
]
address
<-
map
[
"address"
]
contacts_phone
<-
map
[
"contacts_phone"
]
contacts_phone
<-
map
[
"contacts_phone"
]
...
...
GeliBusinessPlatform/ViewController/供应商管理/GYSGLCell.swift
View file @
93f8bc21
...
@@ -15,9 +15,7 @@ class GYSGLCell: UITableViewCell {
...
@@ -15,9 +15,7 @@ class GYSGLCell: UITableViewCell {
@IBOutlet
weak
var
selectTypeBtn
:
UIButton
!
@IBOutlet
weak
var
selectTypeBtn
:
UIButton
!
@IBOutlet
weak
var
selectTypeView
:
UIView
!
@IBOutlet
weak
var
selectTypeView
:
UIView
!
@IBAction
func
selectAction
(
_
sender
:
Any
)
{
selectTypeBtn
.
isSelected
=
!
selectTypeBtn
.
isSelected
}
@IBOutlet
weak
var
Lbl3
:
UILabel
!
@IBOutlet
weak
var
Lbl3
:
UILabel
!
@IBOutlet
weak
var
Lbl2
:
UILabel
!
@IBOutlet
weak
var
Lbl2
:
UILabel
!
@IBOutlet
weak
var
Lbl1
:
UILabel
!
@IBOutlet
weak
var
Lbl1
:
UILabel
!
...
...
GeliBusinessPlatform/ViewController/供应商管理/GYSGLCell.xib
View file @
93f8bc21
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
5702
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
6097
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina6_1"
orientation=
"portrait"
appearance=
"light"
/>
<device
id=
"retina6_1"
orientation=
"portrait"
appearance=
"light"
/>
<dependencies>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"15704"
/>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"16087"
/>
<capability
name=
"Named colors"
minToolsVersion=
"9.0"
/>
<capability
name=
"Named colors"
minToolsVersion=
"9.0"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
...
@@ -10,7 +11,7 @@
...
@@ -10,7 +11,7 @@
<objects>
<objects>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
/>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
/>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"-2"
customClass=
"UIResponder"
/>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"-2"
customClass=
"UIResponder"
/>
<tableViewCell
contentMode=
"scaleToFill"
selectionStyle=
"default"
indentationWidth=
"10"
id=
"KGk-i7-Jjw"
customClass=
"GYSGLCell"
customModule=
"
GeliBusinessPlatform
"
customModuleProvider=
"target"
>
<tableViewCell
contentMode=
"scaleToFill"
selectionStyle=
"default"
indentationWidth=
"10"
id=
"KGk-i7-Jjw"
customClass=
"GYSGLCell"
customModule=
"
TestClass
"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"100"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"100"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"KGk-i7-Jjw"
id=
"H2p-sc-9uM"
>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"KGk-i7-Jjw"
id=
"H2p-sc-9uM"
>
...
@@ -91,22 +92,12 @@
...
@@ -91,22 +92,12 @@
<state
key=
"normal"
image=
"daixuan"
/>
<state
key=
"normal"
image=
"daixuan"
/>
<state
key=
"selected"
image=
"yuxuan"
/>
<state
key=
"selected"
image=
"yuxuan"
/>
</button>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Hl5-nJ-ltZ"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"60"
height=
"100"
/>
<connections>
<action
selector=
"selectAction:"
destination=
"KGk-i7-Jjw"
eventType=
"touchUpInside"
id=
"gos-H7-iRU"
/>
</connections>
</button>
</subviews>
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<constraints>
<constraints>
<constraint
firstAttribute=
"trailing"
secondItem=
"q1A-kf-Vam"
secondAttribute=
"trailing"
constant=
"15"
id=
"7rf-NV-2qJ"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"q1A-kf-Vam"
secondAttribute=
"trailing"
constant=
"15"
id=
"7rf-NV-2qJ"
/>
<constraint
firstItem=
"Hl5-nJ-ltZ"
firstAttribute=
"leading"
secondItem=
"yTm-Gk-jr3"
secondAttribute=
"leading"
id=
"JZ8-4t-68d"
/>
<constraint
firstItem=
"q1A-kf-Vam"
firstAttribute=
"centerY"
secondItem=
"yTm-Gk-jr3"
secondAttribute=
"centerY"
id=
"Lfn-Bw-qKb"
/>
<constraint
firstItem=
"q1A-kf-Vam"
firstAttribute=
"centerY"
secondItem=
"yTm-Gk-jr3"
secondAttribute=
"centerY"
id=
"Lfn-Bw-qKb"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"Hl5-nJ-ltZ"
secondAttribute=
"trailing"
id=
"WTh-w4-hQk"
/>
<constraint
firstAttribute=
"width"
constant=
"60"
id=
"XEz-wR-bpA"
/>
<constraint
firstAttribute=
"width"
constant=
"60"
id=
"XEz-wR-bpA"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"Hl5-nJ-ltZ"
secondAttribute=
"bottom"
id=
"cYf-p4-glJ"
/>
<constraint
firstItem=
"Hl5-nJ-ltZ"
firstAttribute=
"top"
secondItem=
"yTm-Gk-jr3"
secondAttribute=
"top"
id=
"lWD-4j-dMX"
/>
</constraints>
</constraints>
</view>
</view>
</subviews>
</subviews>
...
...
GeliBusinessPlatform/ViewController/供应商管理/GYSListViewController.swift
View file @
93f8bc21
...
@@ -11,11 +11,68 @@ import UIKit
...
@@ -11,11 +11,68 @@ import UIKit
class
GYSListViewController
:
BaseViewController
,
UITableViewDataSource
,
UITableViewDelegate
,
UISearchBarDelegate
,
SearchBarViewDelegate
{
class
GYSListViewController
:
BaseViewController
,
UITableViewDataSource
,
UITableViewDelegate
,
UISearchBarDelegate
,
SearchBarViewDelegate
{
var
searchV
:
SearchBarView
?
=
nil
var
searchV
:
SearchBarView
?
=
nil
var
selectTarget
:
VendorListDataModel
?
@IBOutlet
weak
var
topView
:
UIView
!
@IBOutlet
weak
var
topView
:
UIView
!
@IBOutlet
weak
var
btmLbl
:
UILabel
!
@IBOutlet
weak
var
btmLbl
:
UILabel
!
@IBOutlet
weak
var
listView
:
UITableView
!
@IBOutlet
weak
var
listView
:
UITableView
!
var
barTitle
:
String
?
var
barTitle
:
String
?
var
keyWord
=
""
var
page
=
0
var
datas
:
Array
<
VendorListDataModel
>
=
[]
@objc
func
loadData
(){
print
(
"加载数据"
)
page
=
1
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"keyword"
:
keyWord
as
Any
,
"page"
:
page
as
Any
]
vendorList
(
dict
,
success
:
{
(
data
)
in
self
.
datas
.
removeAll
()
let
model
=
data
as!
VendorListModel
self
.
listView
.
mj_header
?
.
endRefreshing
()
self
.
page
=
2
model
.
data
?
.
forEach
({
(
item
)
in
self
.
datas
.
append
(
item
)
})
self
.
listView
.
reloadData
()
if
model
.
data
?
.
count
==
0
{
self
.
listView
?
.
mj_footer
?
.
endRefreshingWithNoMoreData
()
}
else
{
self
.
listView
?
.
mj_footer
?
.
endRefreshing
()
}
})
{
(
error
)
in
}
}
//MARK:--加载更多数据
@objc
func
loadMoreData
(){
print
(
"加载更多数据"
)
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"keyword"
:
keyWord
as
Any
,
"page"
:
page
as
Any
]
vendorList
(
dict
,
success
:
{
(
data
)
in
let
dataM
=
data
as!
VendorListModel
if
dataM
.
data
?
.
count
==
0
{
self
.
listView
?
.
mj_footer
?
.
endRefreshingWithNoMoreData
()
}
else
{
self
.
page
+=
1
dataM
.
data
?
.
forEach
({
(
model
)
in
self
.
datas
.
append
(
model
)
})
self
.
listView
.
reloadData
()
self
.
listView
?
.
mj_footer
?
.
endRefreshing
()
}
})
{
(
error
)
in
self
.
listView
?
.
mj_footer
?
.
endRefreshing
()
}
}
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
navbar
.
title
=
barTitle
navbar
.
title
=
barTitle
...
@@ -42,6 +99,14 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
...
@@ -42,6 +99,14 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
listView
.
separatorStyle
=
.
none
listView
.
separatorStyle
=
.
none
listView
.
register
(
UINib
(
nibName
:
"GYSGLCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"GYSGLCell"
)
listView
.
register
(
UINib
(
nibName
:
"GYSGLCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"GYSGLCell"
)
// Do any additional setup after loading the view.
// Do any additional setup after loading the view.
//下拉刷新相关设置
headerMJ
.
setRefreshingTarget
(
self
,
refreshingAction
:
#selector(
loadData
)
)
self
.
listView
!.
mj_header
=
headerMJ
//上拉加载相关设置
footerMJ
.
setRefreshingTarget
(
self
,
refreshingAction
:
#selector(
loadMoreData
)
)
self
.
listView
!.
mj_footer
=
footerMJ
self
.
listView
?
.
mj_header
?
.
beginRefreshing
()
}
}
@IBAction
func
addAction
(
_
sender
:
Any
)
{
@IBAction
func
addAction
(
_
sender
:
Any
)
{
...
@@ -58,23 +123,46 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
...
@@ -58,23 +123,46 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
}
}
//MARK: - CELL DELEGATE
//MARK: - CELL DELEGATE
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
vc
=
GYSGLViewController
()
if
barTitle
==
"供应商管理"
{
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
let
vc
=
GYSGLViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
else
{
selectTarget
=
datas
[
indexPath
.
row
]
listView
.
reloadData
()
}
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
105.5
return
105.5
}
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
3
return
datas
.
count
}
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"GYSGLCell"
)
as!
GYSGLCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"GYSGLCell"
)
as!
GYSGLCell
let
model
=
datas
[
indexPath
.
row
]
if
barTitle
!=
"供应商管理"
{
if
barTitle
!=
"供应商管理"
{
cell
.
selectTypeBtn
.
isSelected
=
false
cell
.
selectTypeView
.
isHidden
=
false
cell
.
selectTypeView
.
isHidden
=
false
if
selectTarget
?
.
ven_id
==
model
.
ven_id
{
cell
.
selectTypeBtn
.
isSelected
=
true
}
}
else
{
}
else
{
cell
.
selectTypeView
.
isHidden
=
true
cell
.
selectTypeView
.
isHidden
=
true
}
}
cell
.
Lbl1
.
text
=
model
.
ven_name
!
cell
.
Lbl2
.
text
=
model
.
contacts_name
!
+
" "
+
model
.
contacts_phone
!
cell
.
Lbl3
.
text
=
model
.
p_cn
!
+
model
.
address
!
if
model
.
c_cn
!=
nil
{
cell
.
Lbl3
.
text
=
model
.
p_cn
!
+
model
.
c_cn
!
+
model
.
address
!
if
model
.
d_cn
!=
nil
{
cell
.
Lbl3
.
text
=
model
.
p_cn
!
+
model
.
c_cn
!
+
model
.
d_cn
!
+
model
.
address
!
}
}
return
cell
return
cell
}
}
}
}
GeliBusinessPlatform/ViewController/地址管理/DZGLViewController.swift
View file @
93f8bc21
...
@@ -206,7 +206,13 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
...
@@ -206,7 +206,13 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
let
model
=
adrArrs
[
indexPath
.
row
]
let
model
=
adrArrs
[
indexPath
.
row
]
cell
.
nameLbl
.
text
=
model
.
consignee
cell
.
nameLbl
.
text
=
model
.
consignee
cell
.
phoneLbl
.
text
=
model
.
mobile
cell
.
phoneLbl
.
text
=
model
.
mobile
cell
.
adrLbl
.
text
=
model
.
address
cell
.
adrLbl
.
text
=
model
.
province_cn
!
+
model
.
address
!
if
model
.
city_cn
!=
nil
{
cell
.
adrLbl
.
text
=
model
.
province_cn
!
+
model
.
city_cn
!
+
model
.
address
!
if
model
.
district_cn
!=
nil
{
cell
.
adrLbl
.
text
=
model
.
province_cn
!
+
model
.
city_cn
!
+
model
.
district_cn
!
+
model
.
address
!
}
}
cell
.
btnH
.
constant
=
0
cell
.
btnH
.
constant
=
0
cell
.
xValue
.
constant
=
0
cell
.
xValue
.
constant
=
0
cell
.
blueLbl
.
isHidden
=
true
cell
.
blueLbl
.
isHidden
=
true
...
...
GeliBusinessPlatform/ViewController/新增采购单/CGDCell.swift
View file @
93f8bc21
...
@@ -7,9 +7,20 @@
...
@@ -7,9 +7,20 @@
//
//
import
UIKit
import
UIKit
protocol
CGDCellDelegate
{
func
CGDCellDelAction
(
cell
:
CGDCell
)
}
class
CGDCell
:
UITableViewCell
{
class
CGDCell
:
UITableViewCell
{
var
delegate
:
CGDCellDelegate
?
@IBAction
func
delAction
(
_
sender
:
UIButton
)
{
delegate
?
.
CGDCellDelAction
(
cell
:
self
)
}
@IBOutlet
weak
var
cgTotalPrice
:
UILabel
!
@IBOutlet
weak
var
cgPrice
:
UILabel
!
@IBOutlet
weak
var
cgCount
:
UILabel
!
@IBOutlet
weak
var
detailLbl
:
UILabel
!
@IBOutlet
weak
var
nameLbl
:
UILabel
!
@IBOutlet
weak
var
btnWidth
:
NSLayoutConstraint
!
override
func
awakeFromNib
()
{
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
super
.
awakeFromNib
()
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
...
...
GeliBusinessPlatform/ViewController/新增采购单/CGDCell.xib
View file @
93f8bc21
This diff is collapsed.
Click to expand it.
GeliBusinessPlatform/ViewController/新增采购单/XinCaiGouViewController.swift
View file @
93f8bc21
...
@@ -8,7 +8,27 @@
...
@@ -8,7 +8,27 @@
import
UIKit
import
UIKit
class
XinCaiGouViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
{
class
XinCaiGouViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
CGDCellDelegate
,
XuanZeShangPinViewControllerDelegate
{
func
XuanZeShangPinViewControllerSubmitAction
(
selectArr
:
Array
<
GetGoodsInfoDataModel
>
)
{
for
item
in
selectArr
{
datas
.
append
(
item
)
}
listView
.
reloadData
()
}
func
XuanZeShangPinViewControllerYuShou
(
YuShouData
:
Array
<
GetGoodsInfoDataModel
>
)
{
}
func
XuanZeShangPinViewControllerEdit
(
selectArr
:
Array
<
GetGoodsInfoDataModel
>
)
{
}
//MARK: - 删除
func
CGDCellDelAction
(
cell
:
CGDCell
)
{
}
//MARK: - 提交审核
//MARK: - 提交审核
@IBAction
func
submitAction
(
_
sender
:
Any
)
{
@IBAction
func
submitAction
(
_
sender
:
Any
)
{
...
@@ -16,8 +36,8 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -16,8 +36,8 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
@IBOutlet
weak
var
listView
:
UITableView
!
@IBOutlet
weak
var
listView
:
UITableView
!
@IBOutlet
weak
var
btmLine
:
UIView
!
@IBOutlet
weak
var
btmLine
:
UIView
!
var
datas
:
Array
<
Any
>
=
[]
var
datas
:
Array
<
GetGoodsInfoDataModel
>
=
[]
let
titleArr
=
[
"采购日期"
,
"供应商"
,
"采购人"
,
"
制单人"
,
"
采购类型"
]
let
titleArr
=
[
"采购日期"
,
"供应商"
,
"采购人"
,
"采购类型"
]
let
holderArr
=
[
""
,
"请选择供应商"
,
"请输入采购人姓名"
,
""
,
"请选择采购类型"
]
let
holderArr
=
[
""
,
"请选择供应商"
,
"请输入采购人姓名"
,
""
,
"请选择采购类型"
]
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
...
@@ -29,6 +49,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -29,6 +49,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
listView
.
register
(
UINib
(
nibName
:
"TitleAndBtnCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndBtnCell"
)
listView
.
register
(
UINib
(
nibName
:
"TitleAndBtnCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndBtnCell"
)
listView
.
register
(
UINib
(
nibName
:
"TitleAndTFCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndTFCell"
)
listView
.
register
(
UINib
(
nibName
:
"TitleAndTFCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndTFCell"
)
listView
.
register
(
UINib
(
nibName
:
"CGDDayCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"CGDDayCell"
)
listView
.
register
(
UINib
(
nibName
:
"CGDDayCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"CGDDayCell"
)
listView
.
register
(
UINib
(
nibName
:
"CGDCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"CGDCell"
)
}
}
//MARK: - cell delegate
//MARK: - cell delegate
...
@@ -39,6 +60,9 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -39,6 +60,9 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
case
0
:
//时间
case
0
:
//时间
break
break
case
1
:
//供应商
case
1
:
//供应商
let
vc
=
GYSListViewController
()
vc
.
barTitle
=
"选择供应商"
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
break
case
4
:
//采购类型
case
4
:
//采购类型
break
break
...
@@ -50,9 +74,11 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -50,9 +74,11 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
//MARK: - 添加商品
//MARK: - 添加商品
@objc
func
addItemAction
(){
@objc
func
addItemAction
(){
print
(
"add product"
)
datas
.
append
(
"1"
)
let
vc
=
XuanZeShangPinViewController
()
listView
.
reloadData
()
vc
.
delegate
=
self
vc
.
barTitle
=
"选择商品"
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
==
0
{
if
indexPath
.
section
==
0
{
...
@@ -76,7 +102,16 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -76,7 +102,16 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
}
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndBtnCell"
)
as!
TitleAndBtnCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"CGDCell"
)
as!
CGDCell
cell
.
tag
=
indexPath
.
row
cell
.
delegate
=
self
let
model
=
datas
[
indexPath
.
row
]
cell
.
nameLbl
.
text
=
model
.
goods_name
!
cell
.
detailLbl
.
text
=
model
.
spec_str
!
+
" ¥"
+
model
.
target_Price
!
+
"x
\(
model
.
target_Count
!
)
"
+
model
.
unit
!
cell
.
cgCount
.
text
=
"
\(
model
.
target_Count
!
)
"
cell
.
cgPrice
.
text
=
model
.
target_Price
!
let
price
=
model
.
target_Price
!
as
NSString
cell
.
cgTotalPrice
.
text
=
"
\(
Float
(
model
.
target_Count
!
)
*
price
.
floatValue
)
"
return
cell
return
cell
}
}
...
...
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