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
114609f9
Commit
114609f9
authored
Jun 17, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充修改采购单UI
parent
8da510de
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
265 additions
and
123 deletions
+265
-123
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Model/PurchaseModel/PurchaseModel.swift
GeliBusinessPlatform/Model/PurchaseModel/PurchaseModel.swift
+5
-1
GeliBusinessPlatform/Model/accountsPayableInterface.swift
GeliBusinessPlatform/Model/accountsPayableInterface.swift
+2
-2
GeliBusinessPlatform/Model/yfzkModel/accountsPayableListModel.swift
...ssPlatform/Model/yfzkModel/accountsPayableListModel.swift
+14
-14
GeliBusinessPlatform/View/Cell/TitleAndTFCell.swift
GeliBusinessPlatform/View/Cell/TitleAndTFCell.swift
+2
-0
GeliBusinessPlatform/View/Cell/TitleAndTFCell.xib
GeliBusinessPlatform/View/Cell/TitleAndTFCell.xib
+7
-8
GeliBusinessPlatform/ViewController/应付账款/YingFuZKListViewController.swift
...form/ViewController/应付账款/YingFuZKListViewController.swift
+2
-2
GeliBusinessPlatform/ViewController/应付账款/YingFuZhangKuanXQViewController.swift
...ViewController/应付账款/YingFuZhangKuanXQViewController.swift
+3
-14
GeliBusinessPlatform/ViewController/新增采购单/XinCaiGouViewController.swift
...atform/ViewController/新增采购单/XinCaiGouViewController.swift
+100
-31
GeliBusinessPlatform/ViewController/新增采购单/XinCaiGouViewController.xib
...Platform/ViewController/新增采购单/XinCaiGouViewController.xib
+14
-7
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.swift
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.swift
+41
-8
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.xib
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.xib
+8
-5
GeliBusinessPlatform/ViewController/采购单列表/CGDListViewController.swift
...Platform/ViewController/采购单列表/CGDListViewController.swift
+7
-19
GeliBusinessPlatform/ViewController/采购单详情/CGDListCell.swift
GeliBusinessPlatform/ViewController/采购单详情/CGDListCell.swift
+10
-10
GeliBusinessPlatform/ViewController/采购单详情/CGDXQVc.swift
GeliBusinessPlatform/ViewController/采购单详情/CGDXQVc.swift
+50
-2
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
114609f9
No preview for this file type
GeliBusinessPlatform/Model/PurchaseModel/PurchaseModel.swift
View file @
114609f9
...
...
@@ -46,7 +46,8 @@ class PurchaseOrderListDataModel: Mappable {
var
ven_name
:
String
?
//供应商名
var
goods_res
:
Array
<
PurchaseOrderListDataItemsModel
>
?
var
purchase_time
:
Int
?
var
remarks
:
String
?
required
init
?(
map
:
Map
)
{
...
...
@@ -71,6 +72,9 @@ class PurchaseOrderListDataModel: Mappable {
type
<-
map
[
"type"
]
ven_name
<-
map
[
"ven_name"
]
goods_res
<-
map
[
"goods_res"
]
purchase_time
<-
map
[
"purchase_time"
]
remarks
<-
map
[
"remarks"
]
}
}
...
...
GeliBusinessPlatform/Model/accountsPayableInterface.swift
View file @
114609f9
...
...
@@ -15,7 +15,7 @@ import ObjectMapper
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key(
//user_token(验证token)
page 页数
page 页数
keyword 搜索关键词
*/
func
accountsPayableList
(
_
params
:[
String
:
Any
],
success
:
@escaping
(
_
res
:
Any
)
->
(),
failture
:
@escaping
(
_
error
:
Error
)
->
())
{
...
...
@@ -31,7 +31,7 @@ func accountsPayableList(_ params:[String:Any],success:@escaping (_ res:Any)->()
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key(
//user_token(验证token)
page 页数
page 页数
keyword 搜索关键词
*/
func
accountsPayableDetail
(
_
params
:[
String
:
Any
],
success
:
@escaping
(
_
res
:
Any
)
->
(),
failture
:
@escaping
(
_
error
:
Error
)
->
())
{
...
...
GeliBusinessPlatform/Model/yfzkModel/accountsPayableListModel.swift
View file @
114609f9
...
...
@@ -25,7 +25,7 @@ class accountsPayableListModel: Mappable {
}
class
accountsPayableDataModel
:
Mappable
{
var
vendor_res
:
Array
<
accountsPayableListDataModel
>
?
var
total_payable_money
:
Float
?
var
total_payable_money
:
Float
?
//当前欠款金额总计
required
init
?(
map
:
Map
)
{
...
...
@@ -37,9 +37,9 @@ class accountsPayableDataModel: Mappable {
}
}
class
accountsPayableListDataModel
:
Mappable
{
var
ven_id
:
Int
?
var
ven_name
:
String
?
var
payable_money
:
String
?
var
ven_id
:
Int
?
//供应商id
var
ven_name
:
String
?
//供应商名
var
payable_money
:
String
?
//欠款金额
required
init
?(
map
:
Map
)
{
...
...
@@ -70,8 +70,8 @@ class accountsPayableDetailModel: Mappable {
class
accountsPayableDetailDataModel
:
Mappable
{
var
list
:
Array
<
accountsPayableDetailDataListModel
>
?
var
payable
:
String
?
var
already
:
Float
?
var
payable
:
String
?
//当前应付款余额总计
var
already
:
Float
?
//已付应付款
required
init
?(
map
:
Map
)
{
...
...
@@ -85,16 +85,16 @@ class accountsPayableDetailDataModel: Mappable {
class
accountsPayableDetailDataListModel
:
Mappable
{
var
ven_id_log
:
Int
?
var
ven_id
:
Int
?
var
po_id
:
Int
?
var
ven_id
:
Int
?
//供应商id
var
po_id
:
Int
?
//采购单id
var
money
:
String
?
var
type
:
Int
?
var
create_time
:
Double
?
var
money
:
String
?
//金额(根据类型应付已付决定)
var
type
:
Int
?
//类型:1应付 2已付
var
create_time
:
Double
?
//时间
var
payable_money
:
String
?
var
status
:
Int
?
var
po_no
:
String
?
var
payable_money
:
String
?
//欠款额
var
status
:
Int
?
//支付状态:1应付未付 2应付已付
var
po_no
:
String
?
//采购单号
required
init
?(
map
:
Map
)
{
...
...
GeliBusinessPlatform/View/Cell/TitleAndTFCell.swift
View file @
114609f9
...
...
@@ -21,7 +21,9 @@ class TitleAndTFCell: UITableViewCell {
textTF
.
addTarget
(
self
,
action
:
#selector(
textChange(textField:)
)
,
for
:
.
allEditingEvents
)
}
@objc
func
textChange
(
textField
:
UITextField
){
delegate
?
.
textFieldContent
?(
content
:
textField
.
text
!
,
cell
:
self
)
}
...
...
GeliBusinessPlatform/View/Cell/TitleAndTFCell.xib
View file @
114609f9
...
...
@@ -25,14 +25,14 @@
<constraint
firstAttribute=
"height"
constant=
"1"
id=
"qV8-4M-UFb"
/>
</constraints>
</view>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"25
1
"
verticalHuggingPriority=
"251"
text=
"标题:"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"6wI-Bk-Hnz"
>
<rect
key=
"frame"
x=
"15"
y=
"1
7
"
width=
"40"
height=
"16"
/>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"25
2
"
verticalHuggingPriority=
"251"
text=
"标题:"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"6wI-Bk-Hnz"
>
<rect
key=
"frame"
x=
"15"
y=
"1
5
"
width=
"40"
height=
"16"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"13"
/>
<color
key=
"textColor"
name=
"标题字颜色"
/>
<nil
key=
"highlightedColor"
/>
</label>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请输入内容"
textAlignment=
"right"
minimumFontSize=
"17"
clearButtonMode=
"
whileEditing
"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Q6V-I9-aNd"
>
<rect
key=
"frame"
x=
"
65"
y=
"15.5"
width=
"29
5"
height=
"19"
/>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请输入内容"
textAlignment=
"right"
minimumFontSize=
"17"
clearButtonMode=
"
always
"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Q6V-I9-aNd"
>
<rect
key=
"frame"
x=
"
266.5"
y=
"15.5"
width=
"93.
5"
height=
"19"
/>
<color
key=
"textColor"
name=
"标题字颜色"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"13"
/>
<textInputTraits
key=
"textInputTraits"
/>
...
...
@@ -42,9 +42,8 @@
<constraint
firstAttribute=
"trailing"
secondItem=
"Q6V-I9-aNd"
secondAttribute=
"trailing"
constant=
"15"
id=
"91e-XA-Iqf"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"zvz-cN-gmt"
secondAttribute=
"trailing"
id=
"91g-iJ-e2S"
/>
<constraint
firstItem=
"zvz-cN-gmt"
firstAttribute=
"leading"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"leading"
constant=
"15"
id=
"Mua-VI-kn3"
/>
<constraint
firstItem=
"6wI-Bk-Hnz"
firstAttribute=
"centerY"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"centerY"
id=
"OKy-c6-FsX"
/>
<constraint
firstItem=
"Q6V-I9-aNd"
firstAttribute=
"leading"
secondItem=
"6wI-Bk-Hnz"
secondAttribute=
"trailing"
constant=
"10"
id=
"RC6-xh-0Q7"
/>
<constraint
firstItem=
"6wI-Bk-Hnz"
firstAttribute=
"leading"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"leading"
constant=
"15"
id=
"Z1h-nD-Y6S"
/>
<constraint
firstItem=
"6wI-Bk-Hnz"
firstAttribute=
"leading"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"leading"
constant=
"15"
id=
"NXV-5U-lIO"
/>
<constraint
firstItem=
"6wI-Bk-Hnz"
firstAttribute=
"top"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"top"
constant=
"15"
id=
"PBH-Gt-wO7"
/>
<constraint
firstItem=
"Q6V-I9-aNd"
firstAttribute=
"centerY"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"centerY"
id=
"lmF-E2-VqK"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"zvz-cN-gmt"
secondAttribute=
"bottom"
id=
"oe1-RM-1UU"
/>
</constraints>
...
...
@@ -55,7 +54,7 @@
<outlet
property=
"nameLbl"
destination=
"6wI-Bk-Hnz"
id=
"W9P-gn-wOa"
/>
<outlet
property=
"textTF"
destination=
"Q6V-I9-aNd"
id=
"Qep-Os-9qk"
/>
</connections>
<point
key=
"canvasLocation"
x=
"13
3"
y=
"104
"
/>
<point
key=
"canvasLocation"
x=
"13
2.60869565217394"
y=
"103.79464285714285
"
/>
</tableViewCell>
</objects>
<resources>
...
...
GeliBusinessPlatform/ViewController/应付账款/YingFuZKListViewController.swift
View file @
114609f9
...
...
@@ -87,7 +87,7 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB
let
mo
=
dataArr
[
indexPath
.
row
]
cell
.
nameLbl
.
text
=
mo
.
ven_name
!
if
mo
.
payable_money
!=
"0.00"
{
cell
.
priceLbl
.
text
=
"¥
-
"
+
mo
.
payable_money
!
cell
.
priceLbl
.
text
=
"¥"
+
mo
.
payable_money
!
}
else
{
cell
.
priceLbl
.
text
=
"¥0"
}
...
...
@@ -150,7 +150,7 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB
model
.
data
?
.
vendor_res
?
.
forEach
({
(
model
)
in
self
.
dataArr
.
append
(
model
)
})
self
.
totalPriceLbl
.
text
=
"¥
-
\(
model
.
data
!.
total_payable_money
!
)
"
self
.
totalPriceLbl
.
text
=
"¥
\(
model
.
data
!.
total_payable_money
!
)
"
self
.
listView
.
reloadData
()
self
.
listView
.
mj_header
?
.
endRefreshing
()
self
.
page
=
2
...
...
GeliBusinessPlatform/ViewController/应付账款/YingFuZhangKuanXQViewController.swift
View file @
114609f9
...
...
@@ -10,9 +10,6 @@ import UIKit
class
YingFuZhangKuanXQViewController
:
BaseViewController
,
UISearchBarDelegate
,
SearchBarViewDelegate
,
UITableViewDelegate
,
UITableViewDataSource
,
YingFuZhangKuanXQCellDelegate
,
GLAlertSelectViewDelegate
{
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
var
ven_id
:
Int
?
...
...
@@ -24,10 +21,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
glSelectView
=
nil
}
func
GLAlertSelectViewFinish
(
sender
:
UIButton
,
title
:
String
,
cellTag
:
Int
)
{
HUD
.
flash
(
.
progress
)
var
dict
=
[
"user_token"
:
UserToken
as
Any
]
...
...
@@ -40,9 +34,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
payStatus
(
dict
,
success
:
{
(
data
)
in
HUD
.
hide
()
self
.
listView
.
mj_header
?
.
beginRefreshing
()
})
{
(
err
)
in
}
})
{
(
err
)
in
}
break
case
"设置未收款"
:
let
model
=
dataArr
[
cellTag
]
...
...
@@ -52,9 +44,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
payStatus
(
dict
,
success
:
{
(
data
)
in
HUD
.
hide
()
self
.
listView
.
mj_header
?
.
beginRefreshing
()
})
{
(
err
)
in
}
})
{
(
err
)
in
}
break
case
"收款"
:
break
...
...
@@ -68,7 +58,6 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
}
let
payTypeArr
=
[
"已付款"
,
"未付款"
]
let
typeArr
=
[
"现金"
,
"转账(私)"
,
"转账(公)"
,
"转账(微信)"
,
"转账(支付宝)"
]
var
glSelectView
:
GLAlertSelectView
?
var
navTitle
:
String
=
""
...
...
@@ -130,7 +119,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
make
.
width
.
equalTo
(
title
.
bounds
.
size
.
width
)
}
let
ti1
=
UILabel
()
ti1
.
text
=
"¥
-
\(
first
)
"
ti1
.
text
=
"¥
\(
first
)
"
ti1
.
font
=
UIFont
.
boldSystemFont
(
ofSize
:
13
)
ti1
.
textColor
=
UIColor
(
named
:
"#F57575"
)
view
.
addSubview
(
ti1
)
...
...
GeliBusinessPlatform/ViewController/新增采购单/XinCaiGouViewController.swift
View file @
114609f9
...
...
@@ -8,8 +8,13 @@
import
UIKit
protocol
XinCaiGouViewControllerDelegate
{
func
XinCaiGouViewControllerFinish
()
}
class
XinCaiGouViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
CGDCellDelegate
,
XuanZeShangPinViewControllerDelegate
,
ShowTimeSelectViewDelegate
,
GLAlertSelectViewDelegate
,
GYSListViewControllerDelegate
,
UITextFieldDelegate
,
GeliAlertViewDelegate
{
var
delegate
:
XinCaiGouViewControllerDelegate
?
func
sureGeliAlertViewAction
(
sender
:
UIButton
)
{
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
...
...
@@ -32,11 +37,11 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
let
goods_info
=
dataChangeString
(
sender
:
goodsInfoArr
!
)
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"ven_id"
:
ven
dor
?
.
ven
_id
as
Any
,
"ven_id"
:
ven_id
as
Any
,
"purchase_time"
:
dayTime
as
Any
,
"purchaser"
:
cgName
as
Any
,
"type"
:
typeSelect
+
1
as
Any
,
"remarks"
:
""
as
Any
,
"remarks"
:
contentStr
as
Any
,
"is_apply"
:
1
as
Any
,
"goods_info"
:
goods_info
as
Any
]
...
...
@@ -44,6 +49,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
purchaseOrderAdd
(
dict
,
success
:
{
(
data
)
in
HUD
.
hide
()
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
self
.
delegate
?
.
XinCaiGouViewControllerFinish
()
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
})
{
(
error
)
in
...
...
@@ -56,7 +62,12 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
textField
.
text
=
""
return
}
cgName
=
textField
.
text
if
textField
.
tag
==
3
{
cgName
=
textField
.
text
}
if
textField
.
tag
==
5
{
contentStr
=
textField
.
text
}
listView
.
reloadData
()
}
func
GLASClose
(
view
:
GLAlertSelectView
,
selectnum
:
Int
,
selectArr
:
Array
<
Int
>
)
{
...
...
@@ -67,9 +78,9 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
func
GLAlertSelectViewClick
(
selectNum
:
Int
,
view
:
GLAlertSelectView
)
{
typeSelect
=
selectNum
if
typeSelect
!=
nil
&&
typeSelect
!=
10086
{
holderArr
.
insert
(
typeArr
[
typeSelect
],
at
:
3
)
holderArr
.
remove
(
at
:
4
)
listView
.
reloadData
()
holderArr
.
insert
(
typeArr
[
typeSelect
],
at
:
4
)
holderArr
.
remove
(
at
:
5
)
listView
.
reloadData
()
}
view
.
removeFromSuperview
()
glSelectView
=
nil
...
...
@@ -96,10 +107,13 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
}
var
dayTimeStr
=
""
var
dayTime
:
Int
?
var
vendor
:
VendorListDataModel
?
@IBOutlet
weak
var
btmLbl
:
UILabel
!
var
glSelectView
:
GLAlertSelectView
?
var
typeSelect
=
1
var
cgName
:
String
?
var
contentStr
:
String
?
//MARK: - 提交审核
@IBAction
func
submitAction
(
_
sender
:
Any
)
{
print
(
"submit"
)
...
...
@@ -107,7 +121,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
HUD
.
flash
(
.
label
(
"请选择时间"
),
delay
:
1.2
)
return
}
if
ven
dor
==
nil
{
if
ven
_id
==
nil
{
HUD
.
flash
(
.
label
(
"请选择供应商"
),
delay
:
1.2
)
return
}
...
...
@@ -126,7 +140,11 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
let
alertView
=
GeliAlertView
(
frame
:
self
.
view
.
window
!.
bounds
)
alertView
.
delegate
=
self
;
alertView
.
tishiLbl
.
text
=
""
alertView
.
titileLbl
.
text
=
"是否提交申请?"
if
orderNum
==
nil
{
alertView
.
titileLbl
.
text
=
"是否提交申请?"
}
else
{
alertView
.
titileLbl
.
text
=
"是否提交修改?"
}
alertView
.
rightBtn
.
setAttributedTitle
(
NSAttributedString
(
string
:
"保存"
),
for
:
.
normal
)
self
.
view
.
window
?
.
addSubview
(
alertView
)
...
...
@@ -135,11 +153,28 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
@IBOutlet
weak
var
btmLine
:
UIView
!
var
datas
:
Array
<
GetGoodsInfoDataModel
>
=
[]
let
typeArr
=
[
"临时采购"
,
"固定采购"
]
let
titleArr
=
[
"采购日期"
,
"供应商"
,
"采购人"
,
"采购类型"
]
var
holderArr
=
[
""
,
"请选择供应商"
,
"请输入采购人姓名"
,
"固定采购"
]
let
titleArr
=
[
"采购单号"
,
"采购日期"
,
"供应商"
,
"采购人"
,
"采购类型"
,
"备注"
]
var
holderArr
=
[
""
,
""
,
"请选择供应商"
,
"请输入采购人姓名"
,
"固定采购"
,
"请输入备注"
]
var
orderNum
:
String
?
var
ven_name
:
String
?
var
ven_id
:
Int
?
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
navbar
.
title
=
"新增采购单"
if
ven_name
!=
nil
{
holderArr
.
insert
((
ven_name
)
!
,
at
:
2
)
holderArr
.
remove
(
at
:
3
)
}
if
orderNum
==
nil
{
navbar
.
title
=
"新增采购单"
}
else
{
navbar
.
title
=
"编辑采购单"
btmLbl
.
text
=
"确认修改提交"
}
self
.
view
.
addSubview
(
navbar
)
SetTopFrameView
(
view
:
listView
,
btmView
:
btmLine
)
listView
.
separatorStyle
=
.
none
...
...
@@ -148,6 +183,8 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
listView
.
register
(
UINib
(
nibName
:
"TitleAndTFCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndTFCell"
)
listView
.
register
(
UINib
(
nibName
:
"CGDDayCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"CGDDayCell"
)
listView
.
register
(
UINib
(
nibName
:
"CGDCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"CGDCell"
)
listView
.
estimatedRowHeight
=
49
listView
.
rowHeight
=
UITableView
.
automaticDimension
}
//MARK: - cell delegate
...
...
@@ -155,39 +192,37 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
==
0
{
switch
indexPath
.
row
{
case
0
:
//时间
case
1
:
//时间
print
(
"跳转日期选择"
)
let
timeSelectV
=
ShowTimeSelectView
(
frame
:
self
.
view
.
window
!.
bounds
)
timeSelectV
.
moreSelection
=
false
//把默认值传回去
if
dayTime
!=
nil
{
print
(
"day t = "
,
dayTime
!
)
let
time
=
TimeInterval
(
exactly
:
dayTime
!
)
timeSelectV
.
BeginDate
=
Date
(
timeIntervalSince1970
:
time
!
)
timeSelectV
.
EndDate
=
Date
(
timeIntervalSince1970
:
time
!
)
//无用处
}
timeSelectV
.
endDateByWork
=
Date
()
timeSelectV
.
titleLbl
.
text
=
"请选择采购日期"
timeSelectV
.
delegate
=
self
self
.
view
.
window
?
.
addSubview
(
timeSelectV
)
break
case
1
:
//供应商
case
2
:
//供应商
let
vc
=
GYSListViewController
()
vc
.
barTitle
=
"选择供应商"
vc
.
delegate
=
self
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
case
3
:
//采购类型
case
4
:
//采购类型
if
glSelectView
==
nil
{
let
view
=
GLAlertSelectView
(
frame
:
self
.
view
.
bounds
)
view
.
tag
=
indexPath
.
row
if
typeSelect
!=
nil
{
view
.
selectNum
=
typeSelect
view
.
tempNum
=
view
.
selectNum
}
view
.
selectNum
=
typeSelect
view
.
tempNum
=
view
.
selectNum
view
.
isOnlySelectKuWei
=
true
view
.
delegate
=
self
view
.
titleLbl
.
text
=
"请选择采购类型"
...
...
@@ -208,7 +243,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
print
(
timeStr
,
"采购日期"
,
timeInterval
)
dayTimeStr
=
timeStr
dayTime
=
Int
(
timeInterval
)
listView
.
reloadData
()
}
//MARK: - 添加商品
...
...
@@ -222,13 +257,13 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
==
0
{
if
indexPath
.
row
==
1
||
indexPath
.
row
==
3
{
if
indexPath
.
row
==
2
||
indexPath
.
row
==
4
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndBtnCell"
)
as!
TitleAndBtnCell
cell
.
nameLbl
.
text
=
titleArr
[
indexPath
.
row
]
cell
.
contentLbl
.
text
=
holderArr
[
indexPath
.
row
]
cell
.
btn
.
isUserInteractionEnabled
=
false
return
cell
}
else
if
indexPath
.
row
==
0
{
}
else
if
indexPath
.
row
==
1
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"CGDDayCell"
)
as!
CGDDayCell
if
dayTimeStr
.
count
>
0
{
cell
.
dayLbl
.
text
=
dayTimeStr
...
...
@@ -239,10 +274,33 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
return
cell
}
else
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndTFCell"
)
as!
TitleAndTFCell
if
orderNum
!=
nil
{
cell
.
textTF
.
clearButtonMode
=
.
always
}
if
indexPath
.
row
==
0
{
if
orderNum
==
nil
{
cell
.
nameLbl
.
isHidden
=
true
cell
.
textTF
.
isHidden
=
true
}
else
{
cell
.
nameLbl
.
isHidden
=
false
cell
.
textTF
.
isHidden
=
false
cell
.
textTF
.
text
=
orderNum
!
cell
.
textTF
.
isUserInteractionEnabled
=
false
cell
.
textTF
.
clearButtonMode
=
.
never
}
}
cell
.
nameLbl
.
text
=
titleArr
[
indexPath
.
row
]
cell
.
textTF
.
placeholder
=
holderArr
[
indexPath
.
row
]
cell
.
textTF
.
delegate
=
self
cell
.
textTF
.
text
=
cgName
cell
.
textTF
.
tag
=
indexPath
.
row
if
indexPath
.
row
==
3
{
cell
.
textTF
.
text
=
cgName
}
if
indexPath
.
row
==
5
{
cell
.
textTF
.
text
=
contentStr
}
return
cell
}
...
...
@@ -263,6 +321,16 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
if
indexPath
.
section
==
0
{
if
indexPath
.
row
==
0
{
if
orderNum
==
nil
{
return
0.01
}
else
{
return
49
}
}
if
indexPath
.
row
==
5
{
return
tableView
.
rowHeight
}
return
49
}
return
174
...
...
@@ -327,15 +395,16 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
return
0.001
}
func
GYSListViewControllerGetGYS
(
sender
:
VendorListDataModel
)
{
vendor
=
sender
holderArr
.
insert
((
vendor
?
.
ven_name
)
!
,
at
:
1
)
holderArr
.
remove
(
at
:
2
)
ven_name
=
sender
.
ven_name
ven_id
=
sender
.
ven_id
holderArr
.
insert
(
ven_name
!
,
at
:
2
)
holderArr
.
remove
(
at
:
3
)
listView
.
reloadData
()
}
}
extension
Date
{
extension
Date
{
/// 获取当前 秒级 时间戳 - 10位
var
timeStamp
:
Int
{
let
timeInterval
:
TimeInterval
=
self
.
timeIntervalSince1970
...
...
GeliBusinessPlatform/ViewController/新增采购单/XinCaiGouViewController.xib
View file @
114609f9
...
...
@@ -11,6 +11,7 @@
<objects>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
customClass=
"XinCaiGouViewController"
customModule=
"TestClass"
customModuleProvider=
"target"
>
<connections>
<outlet
property=
"btmLbl"
destination=
"0WX-TF-5sE"
id=
"W9q-HT-jbp"
/>
<outlet
property=
"btmLine"
destination=
"cSW-1R-48s"
id=
"W3Q-FC-Bvs"
/>
<outlet
property=
"listView"
destination=
"Cs6-iU-pYN"
id=
"3RO-hA-kcA"
/>
<outlet
property=
"view"
destination=
"i5M-Pr-FkT"
id=
"sfx-zR-JGt"
/>
...
...
@@ -25,9 +26,12 @@
<rect
key=
"frame"
x=
"0.0"
y=
"813"
width=
"414"
height=
"83"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute
type=
"boolean"
keyPath=
"gradientHorizontal"
value=
"NO"
/>
<userDefinedRuntimeAttribute
type=
"color"
keyPath=
"bgColor"
>
<color
key=
"value"
name=
"白色背景色"
/>
<userDefinedRuntimeAttribute
type=
"boolean"
keyPath=
"gradientHorizontal"
value=
"YES"
/>
<userDefinedRuntimeAttribute
type=
"color"
keyPath=
"gradientStartColor"
>
<color
key=
"value"
name=
"按钮渐变色上"
/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute
type=
"color"
keyPath=
"gradientEndColor"
>
<color
key=
"value"
name=
"按钮渐变色下,字体颜色"
/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
...
...
@@ -40,7 +44,7 @@
<constraint
firstAttribute=
"height"
constant=
"49"
id=
"vbT-1r-JRY"
/>
</constraints>
<fontDescription
key=
"fontDescription"
name=
"PingFangSC-Medium"
family=
"PingFang SC"
pointSize=
"17"
/>
<color
key=
"textColor"
name=
"
蓝色字体颜
色"
/>
<color
key=
"textColor"
name=
"
白色背景
色"
/>
<nil
key=
"highlightedColor"
/>
</label>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"cSW-1R-48s"
>
...
...
@@ -81,14 +85,17 @@
</view>
</objects>
<resources>
<namedColor
name=
"按钮渐变色上"
>
<color
red=
"0.3880000114440918"
green=
"0.62400001287460327"
blue=
"0.90200001001358032"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<namedColor
name=
"按钮渐变色下,字体颜色"
>
<color
red=
"0.27843137254901962"
green=
"0.5607843137254902"
blue=
"0.8901960784313725"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<namedColor
name=
"灰色分界线"
>
<color
red=
"0.92941176470588238"
green=
"0.92941176470588238"
blue=
"0.92941176470588238"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<namedColor
name=
"白色背景色"
>
<color
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<namedColor
name=
"蓝色字体颜色"
>
<color
red=
"0.27843137254901962"
green=
"0.5607843137254902"
blue=
"0.8901960784313725"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
</resources>
</document>
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.swift
View file @
114609f9
...
...
@@ -9,7 +9,11 @@
import
UIKit
import
ViewAnimator
//cell动效
class
CGDListVC
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
GeliAlertViewDelegate
,
CGDListCellDelegate
,
CGDXQVcDelegate
{
class
CGDListVC
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
GeliAlertViewDelegate
,
CGDListCellDelegate
,
CGDXQVcDelegate
,
XinCaiGouViewControllerDelegate
{
func
XinCaiGouViewControllerFinish
()
{
listView
.
mj_header
?
.
beginRefreshing
()
}
func
sureGeliAlertViewAction
(
sender
:
UIButton
)
{
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"po_id"
:
sender
.
tag
as
Any
]
...
...
@@ -121,7 +125,7 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
case
1
:
btnStr
=
[
"修改信息"
,
"取消"
]
break
case
2
:
//入库状态(1未入库,2部分入库,3已入库)
case
2
,
5
:
//入库状态(1未入库,2部分入库,3已入库)
switch
model
.
push_status
{
case
1
:
btnStr
=
[
"查看详情"
,
"入库"
,]
...
...
@@ -138,26 +142,26 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
btnStr
=
[
"查看详情"
]
break
default
:
btnStr
=
[
"查看详情"
]
break
}
cell
.
delegate
=
self
cell
.
setCGDBtnUI
(
arr
:
btnStr
,
index
:
indexPath
.
row
)
return
cell
}
var
isPowerful
=
false
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
model
=
datas
[
indexPath
.
row
]
let
vc
=
CGDXQVc
()
vc
.
po_id
=
model
.
po_id
vc
.
delegate
=
self
var
btnStr
:
Array
<
String
>
=
[]
switch
model
.
order_status
{
//订单状态(1未审核,2审核通过,3审核不通过,4已撤销,5已完成)
case
1
:
// if 权限
{
btnStr
=
[
"不通过"
,
"通过"
]
//
}
if
isPowerful
{
btnStr
=
[
"不通过"
,
"通过"
]
}
break
case
2
:
//入库状态(1未入库,2部分入库,3已入库)
switch
model
.
push_status
{
...
...
@@ -200,7 +204,36 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
break
case
"修改信息"
:
let
vc
=
XinCaiGouViewController
()
vc
.
delegate
=
self
vc
.
cgName
=
model
.
purchaser
!
vc
.
orderNum
=
model
.
po_no
!
if
model
.
ven_id
!=
nil
{
vc
.
ven_id
=
model
.
ven_id
!
}
vc
.
ven_name
=
model
.
ven_name
!
vc
.
dayTime
=
model
.
purchase_time
!
vc
.
contentStr
=
model
.
remarks
!
if
model
.
type
!=
nil
{
vc
.
typeSelect
=
model
.
type
!
-
1
}
model
.
goods_res
?
.
forEach
({
(
item
)
in
let
dict
=
[
"goods_name"
:
item
.
goods_name
,
"goods_id"
:
item
.
goods_id
,
"sku_id"
:
item
.
sku_id
,
"spec_str"
:
item
.
sku_name
,
"unit"
:
item
.
unit
,
"price"
:
item
.
price
,
"target_Count"
:
item
.
num
,
"target_Price"
:
item
.
amount
]
as
[
String
:
Any
]
let
mo
=
GetGoodsInfoDataModel
(
JSON
:
dict
)
vc
.
datas
.
append
(
mo
!
)
})
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
case
"取消"
:
...
...
@@ -280,7 +313,7 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
//MARK:--加载更多数据
@objc
func
loadMoreData
(){
print
(
"加载更多数据"
)
let
dic
=
[
"user_token"
:
UserToken
as
Any
,
"keyword"
:
keyword
as
Any
,
"page"
:
page
as
Any
,
"order_status"
:
orderStatus
as
Any
]
purchaseOrderList
(
dic
,
success
:
{
(
data
)
in
let
model
=
data
as!
PurchaseOrderListModel
...
...
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.xib
View file @
114609f9
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"13142"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"16097"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina6_1"
orientation=
"portrait"
appearance=
"light"
/>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"12042"
/>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"16087"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<objects>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
customClass=
"CGDListVC"
customModuleProvider=
"target"
>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
customClass=
"CGDListVC"
customModule
=
"TestClass"
customModule
Provider=
"target"
>
<connections>
<outlet
property=
"view"
destination=
"i5M-Pr-FkT"
id=
"sfx-zR-JGt"
/>
</connections>
</placeholder>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"-2"
customClass=
"UIResponder"
/>
<view
clearsContextBeforeDrawing=
"NO"
contentMode=
"scaleToFill"
id=
"i5M-Pr-FkT"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"
375"
height=
"667
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"
414"
height=
"896
"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"fnl-2z-Ty3"
/>
<point
key=
"canvasLocation"
x=
"132"
y=
"108"
/>
</view>
</objects>
</document>
GeliBusinessPlatform/ViewController/采购单列表/CGDListViewController.swift
View file @
114609f9
...
...
@@ -9,7 +9,12 @@
import
UIKit
import
Parchment
class
CGDListViewController
:
BaseViewController
,
UISearchBarDelegate
,
SearchBarViewDelegate
,
PagingViewControllerDelegate
{
class
CGDListViewController
:
BaseViewController
,
UISearchBarDelegate
,
SearchBarViewDelegate
,
PagingViewControllerDelegate
,
XinCaiGouViewControllerDelegate
{
func
XinCaiGouViewControllerFinish
()
{
let
vc
=
viewControllers
[
selectIndex
]
vc
.
listView
.
mj_header
?
.
beginRefreshing
()
}
@IBOutlet
weak
var
contentView
:
UIView
!
@IBOutlet
weak
var
searchBg
:
UIView
!
func
clearSearchAction
()
{
...
...
@@ -38,6 +43,7 @@ class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBar
var
searchV
:
SearchBarView
?
=
nil
func
rightBtnClick
()
{
let
vc
=
XinCaiGouViewController
()
vc
.
delegate
=
self
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
override
func
viewDidLoad
()
{
...
...
@@ -77,26 +83,8 @@ class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBar
contentView
.
constrainToEdges
(
pagingViewController
.
view
)
pagingViewController
.
didMove
(
toParent
:
self
)
pagingVC
=
pagingViewController
// //MARK:--添加个刷新通知
// NotificationCenter.default.addObserver(self, selector: #selector(refreshingByCGDHavChange), name: NSNotification.Name(rawValue: "cgdChange"), object: nil)
//
// //跳转对应的头部视图
// NotificationCenter.default.addObserver(self, selector: #selector(CgdNavChange), name: NSNotification.Name(rawValue: "cgdNavChange"), object: nil)
}
// @objc func CgdNavChange(notion:Notification){
// let dic = notion.userInfo
// pagingVC!.select(index: dic!["tag"] as Any as! Int, animated: true)
// }
//
// @objc func refreshingByCGDHavChange(){
// viewControllers.forEach { (vc) in
// vc.isUpData = false
// }
// }
//MAKR:--调起搜索后添加个蒙版本
var
blackBtnView
:
UIButton
!
=
nil
func
searchBarShouldBeginEditing
(
_
searchBar
:
UISearchBar
)
->
Bool
{
...
...
GeliBusinessPlatform/ViewController/采购单详情/CGDListCell.swift
View file @
114609f9
...
...
@@ -73,21 +73,21 @@ class CGDListCell: UITableViewCell {
rightBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
rightBtn
.
layer
.
cornerRadius
=
2
rightBtn
.
isUserInteractionEnabled
=
true
if
str
as!
String
==
"查看详情"
{
if
str
==
"查看详情"
{
rightBtn
.
setTitle
(
str
,
for
:
.
normal
)
rightBtn
.
isUserInteractionEnabled
=
false
}
else
if
str
as!
String
==
"修改信息"
{
}
else
if
str
==
"修改信息"
{
rightBtn
.
setTitle
(
str
,
for
:
.
normal
)
rightBtn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
rightBtn
.
backgroundColor
=
UIColor
.
init
(
named
:
"按钮渐变色上"
)
rightBtn
.
layer
.
borderColor
=
UIColor
.
init
(
named
:
"按钮渐变色上"
)?
.
cgColor
}
else
if
str
as!
String
==
"取消"
{
}
else
if
str
==
"取消"
{
rightBtn
.
setTitle
(
str
,
for
:
.
normal
)
}
else
if
str
as!
String
==
"撤销入库"
{
}
else
if
str
==
"撤销入库"
{
rightBtn
.
setTitle
(
str
,
for
:
.
normal
)
}
else
if
str
as!
String
==
"入库"
{
}
else
if
str
==
"入库"
{
rightBtn
.
setTitle
(
str
,
for
:
.
normal
)
}
else
if
str
as!
String
==
"补录入库"
{
}
else
if
str
==
"补录入库"
{
rightBtn
.
setTitle
(
str
,
for
:
.
normal
)
}
...
...
@@ -132,16 +132,16 @@ class CGDListCell: UITableViewCell {
rightBtn
.
setTitleColor
(
UIColor
.
init
(
named
:
"按钮渐变色上"
),
for
:
.
normal
)
rightBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
rightBtn
.
layer
.
cornerRadius
=
2
if
str
as!
String
==
"查看详情"
{
if
str
==
"查看详情"
{
rightBtn
.
setTitle
(
"查看详情"
,
for
:
.
normal
)
}
else
if
str
as!
String
==
"确认订单"
{
}
else
if
str
==
"确认订单"
{
rightBtn
.
setTitle
(
"确认订单"
,
for
:
.
normal
)
rightBtn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
rightBtn
.
backgroundColor
=
UIColor
.
init
(
named
:
"按钮渐变色上"
)
rightBtn
.
layer
.
borderColor
=
UIColor
.
init
(
named
:
"按钮渐变色上"
)?
.
cgColor
}
else
if
str
as!
String
==
"取消订单"
{
}
else
if
str
==
"取消订单"
{
rightBtn
.
setTitle
(
"取消订单"
,
for
:
.
normal
)
}
else
if
str
as!
String
==
"付款码"
{
}
else
if
str
==
"付款码"
{
rightBtn
.
setTitle
(
"付款码"
,
for
:
.
normal
)
}
btnBgView
.
addSubview
(
rightBtn
)
...
...
GeliBusinessPlatform/ViewController/采购单详情/CGDXQVc.swift
View file @
114609f9
...
...
@@ -11,6 +11,7 @@ protocol CGDXQVcDelegate {
func
CGDXQVcFinishAction
()
}
class
CGDXQVc
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
GLAlertSelectViewDelegate
,
GeliAlertTextViewDelegate
,
GeliAlertViewDelegate
{
func
sureGeliAlertViewAction
(
sender
:
UIButton
)
{
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"po_id"
:
po_id
as
Any
]
backOut
(
dict
,
success
:
{
(
data
)
in
...
...
@@ -170,7 +171,12 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
self
.
holderArr
.
insert
(
"固定采购"
,
at
:
4
)
self
.
holderArr
.
remove
(
at
:
5
)
}
self
.
payFs
=
mo
!.
pay_type
!
self
.
payZt
=
mo
!.
pay_status
!
-
1
self
.
holderArr
.
insert
(
self
.
zfWayArr
[
self
.
payFs
],
at
:
5
)
self
.
holderArr
.
remove
(
at
:
6
)
self
.
holderArr
.
insert
(
self
.
zfTypeArr
[
self
.
payZt
],
at
:
6
)
self
.
holderArr
.
remove
(
at
:
7
)
if
mo
!.
remarks
!.
count
>
0
{
self
.
holderArr
.
insert
(
mo
!.
remarks
!
,
at
:
7
)
self
.
holderArr
.
remove
(
at
:
8
)
...
...
@@ -218,7 +224,7 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
model
?
.
order_status
!=
2
{
if
model
?
.
order_status
!=
2
&&
model
?
.
order_status
!=
5
{
return
}
if
indexPath
.
section
==
0
{
...
...
@@ -228,8 +234,11 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
view
.
tag
=
100
view
.
delegate
=
self
view
.
selectNum
=
payZt
view
.
isYsYf
=
true
view
.
tempNum
=
view
.
selectNum
view
.
cellTag
=
payZt
view
.
titleLbl
.
text
=
"请选择支付状态"
view
.
ysyfTitle
=
"请选择支付状态"
view
.
dataArr
=
zfTypeArr
if
payFs
!=
0
{
view
.
deSelectArr
=
[
0
,
2
,
3
]
...
...
@@ -244,6 +253,9 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
view
.
tag
=
999
view
.
delegate
=
self
view
.
selectNum
=
payFs
view
.
cellTag
=
payFs
view
.
isYsYf
=
true
view
.
ysyfTitle
=
"请选择支付方式"
view
.
tempNum
=
view
.
selectNum
view
.
titleLbl
.
text
=
"请选择支付方式"
view
.
dataArr
=
zfWayArr
...
...
@@ -288,6 +300,42 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
return
10
}
func
GLAlertSelectViewFinish
(
sender
:
UIButton
,
title
:
String
,
cellTag
:
Int
)
{
print
(
"3"
,
cellTag
)
if
title
==
"请选择支付状态"
{
if
payFs
==
0
{
payZt
=
sender
.
tag
holderArr
.
insert
(
zfTypeArr
[
payZt
],
at
:
6
)
holderArr
.
remove
(
at
:
7
)
}
}
if
title
==
"请选择支付方式"
{
payFs
=
sender
.
tag
holderArr
.
insert
(
zfWayArr
[
payFs
],
at
:
5
)
holderArr
.
remove
(
at
:
6
)
if
payFs
!=
0
{
payZt
=
1
}
else
{
payZt
=
0
}
holderArr
.
insert
(
zfTypeArr
[
payZt
],
at
:
6
)
holderArr
.
remove
(
at
:
7
)
}
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"po_id"
:
po_id
as
Any
,
"pay_type"
:
payFs
as
Any
,
"pay_status"
:
payZt
+
1
as
Any
]
payStatus
(
dict
,
success
:
{
(
data
)
in
self
.
listView
.
reloadData
()
self
.
glSelectView
?
.
removeFromSuperview
()
self
.
glSelectView
=
nil
})
{
(
err
)
in
}
}
func
GLAlertSelectViewClick
(
selectNum
:
Int
,
view
:
GLAlertSelectView
)
{
if
view
.
tag
==
999
{
payFs
=
selectNum
...
...
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