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
8c349793
Commit
8c349793
authored
Jun 13, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
已接入的采购接口(撤销入库,审核,列表,详情)
parent
5ef87967
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
288 additions
and
38 deletions
+288
-38
GeliBusinessPlatform.xcodeproj/project.pbxproj
GeliBusinessPlatform.xcodeproj/project.pbxproj
+1
-1
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Define/Define.swift
GeliBusinessPlatform/Define/Define.swift
+4
-4
GeliBusinessPlatform/Interface/Interface_Z.plist
GeliBusinessPlatform/Interface/Interface_Z.plist
+4
-0
GeliBusinessPlatform/Model/PurchaseInterface.swift
GeliBusinessPlatform/Model/PurchaseInterface.swift
+32
-0
GeliBusinessPlatform/Model/PurchaseModel/PurchaseModel.swift
GeliBusinessPlatform/Model/PurchaseModel/PurchaseModel.swift
+1
-1
GeliBusinessPlatform/Model/UpDataModel.swift
GeliBusinessPlatform/Model/UpDataModel.swift
+1
-1
GeliBusinessPlatform/ViewController/工作中心/WorkCViewController.swift
...essPlatform/ViewController/工作中心/WorkCViewController.swift
+3
-3
GeliBusinessPlatform/ViewController/新增采购单/CGDCell.xib
GeliBusinessPlatform/ViewController/新增采购单/CGDCell.xib
+6
-1
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.swift
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.swift
+68
-5
GeliBusinessPlatform/ViewController/采购单详情/CGDListCell.swift
GeliBusinessPlatform/ViewController/采购单详情/CGDListCell.swift
+2
-1
GeliBusinessPlatform/ViewController/采购单详情/CGDXQVc.swift
GeliBusinessPlatform/ViewController/采购单详情/CGDXQVc.swift
+165
-21
GeliBusinessPlatform/ViewController/采购单详情/CGDXQVc.xib
GeliBusinessPlatform/ViewController/采购单详情/CGDXQVc.xib
+1
-0
No files found.
GeliBusinessPlatform.xcodeproj/project.pbxproj
View file @
8c349793
...
...
@@ -1731,6 +1731,7 @@
F94A315024626D4000FEC38E
/* 工作中心 */
,
E0707DC82462475700E039A8
/* 地图 */
,
E0BE8A8D245A9B6500E80134
/* 应付账款 */
,
E0EFB9C324930BEE005FB0CD
/* 采购单列表 */
,
E04DFF092490695A002A6931
/* 采购单详情 */
,
E07B1E75245966C90055BA3C
/* 新增采购单 */
,
E07B1E64245925F30055BA3C
/* 供应商管理 */
,
...
...
@@ -1747,7 +1748,6 @@
E09F4C9A2452BEA000BE033D
/* 寄派方式 */
,
E0B94620245671AD00FBEC9A
/* 代客下单(购物) */
,
E042F72B245272AC00CDFA12
/* 代客下单(货运) */
,
E0EFB9C324930BEE005FB0CD
/* 采购单列表 */
,
F961D2722450373B007FBE70
/* 订单列表 */
,
E0F97B05245161E6001BD600
/* 商品详情 */
,
F969BF17244EE42700C79953
/* 商品管理 */
,
...
...
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
8c349793
No preview for this file type
GeliBusinessPlatform/Define/Define.swift
View file @
8c349793
...
...
@@ -27,10 +27,10 @@ let systemVersion = (UIDevice.current.systemVersion as String)
//接口地址
//test
//
let SERVERCE_ImageHost = "https://z.gelifood.com/"
//
let SERVERCE_HOST = "https://z.gelifood.com/admin/"
let
SERVERCE_ImageHost
=
"https://zx.gelifood.com/"
let
SERVERCE_HOST
=
"https://zx.gelifood.com/admin/"
let
SERVERCE_ImageHost
=
"https://z.gelifood.com/"
let
SERVERCE_HOST
=
"https://z.gelifood.com/admin/"
//
let SERVERCE_ImageHost = "https://zx.gelifood.com/"
//
let SERVERCE_HOST = "https://zx.gelifood.com/admin/"
//online
//视图常量
...
...
GeliBusinessPlatform/Interface/Interface_Z.plist
View file @
8c349793
...
...
@@ -150,5 +150,9 @@
<string>
Purchase/purchaseOrderList
</string>
<key>
采购单详情
</key>
<string>
Purchase/purchaseOrderDetail
</string>
<key>
审核采购单
</key>
<string>
Purchase/purchaseOrderAudit
</string>
<key>
撤销入库
</key>
<string>
Purchase/backOut
</string>
</dict>
</plist>
GeliBusinessPlatform/Model/PurchaseInterface.swift
View file @
8c349793
...
...
@@ -71,3 +71,35 @@ func purchaseOrderDetail(_ params:[String:Any],success:@escaping (_ res:Any)->()
failture
(
error
)
}
}
//MARK:--审核采购单
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key(
//user_token(验证token)
po_id 采购单id
order_status 状态,2审核通过,3审核不通过
reason 不通过备注,不通过时必选
*/
func
purchaseOrderAudit
(
_
params
:[
String
:
Any
],
success
:
@escaping
(
_
res
:
Any
)
->
(),
failture
:
@escaping
(
_
error
:
Error
)
->
())
{
NetworkRequest
.
sharedInstance
.
postRequest
(
"审核采购单"
,
params
,
{
(
rep
:
DataResponse
<
UpDataModel
>
)
in
},
success
:
{
(
data
)
in
success
(
data
)
})
{
(
error
)
in
failture
(
error
)
}
}
//MARK:--撤销入库
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key(
//user_token(验证token)
po_id 采购单id
*/
func
backOut
(
_
params
:[
String
:
Any
],
success
:
@escaping
(
_
res
:
Any
)
->
(),
failture
:
@escaping
(
_
error
:
Error
)
->
())
{
NetworkRequest
.
sharedInstance
.
postRequest
(
"撤销入库"
,
params
,
{
(
rep
:
DataResponse
<
UpDataModel
>
)
in
},
success
:
{
(
data
)
in
success
(
data
)
})
{
(
error
)
in
failture
(
error
)
}
}
GeliBusinessPlatform/Model/PurchaseModel/PurchaseModel.swift
View file @
8c349793
...
...
@@ -139,7 +139,7 @@ class PurchaseOrderDetailDataModel: Mappable {
var
reason
:
String
?
//审核不通过原因
var
ven_id
:
Int
?
var
purchase_time
:
Int
?
//采购时间
var
purchase_time
:
Double
?
//采购时间
var
user_name
:
String
?
//制单人
var
pay_status
:
Int
?
//付款状态(1未付款,2已付款,3月结,4欠款)
...
...
GeliBusinessPlatform/Model/UpDataModel.swift
View file @
8c349793
...
...
@@ -8,7 +8,7 @@
import
Foundation
import
ObjectMapper
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单
,审核采购单,撤销入库
class
UpDataModel
:
Mappable
{
var
code
:
Int
?
...
...
GeliBusinessPlatform/ViewController/工作中心/WorkCViewController.swift
View file @
8c349793
...
...
@@ -518,9 +518,9 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
HUD
.
flash
(
.
label
(
"敬请期待"
),
delay
:
1.2
)
return
case
92
:
//采购订单管理
HUD
.
flash
(
.
label
(
"敬请期待"
),
delay
:
1.2
)
//
let vc = CGDListViewController()
//
self.navigationController?.pushViewController(vc, animated: true)
//
HUD.flash(.label("敬请期待"),delay: 1.2)
let
vc
=
CGDListViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
return
case
93
:
//供应商管理
// HUD.flash(.label("敬请期待"),delay: 1.2)
...
...
GeliBusinessPlatform/ViewController/新增采购单/CGDCell.xib
View file @
8c349793
...
...
@@ -39,7 +39,7 @@
<action
selector=
"delAction:"
destination=
"KGk-i7-Jjw"
eventType=
"touchUpInside"
id=
"VeY-uG-gFs"
/>
</connections>
</button>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"标题
标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题
"
lineBreakMode=
"tailTruncation"
numberOfLines=
"0"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"53n-Ij-aLj"
>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"标题"
lineBreakMode=
"tailTruncation"
numberOfLines=
"0"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"53n-Ij-aLj"
>
<rect
key=
"frame"
x=
"15"
y=
"15"
width=
"311.5"
height=
"37"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"37"
id=
"2Td-7E-Tpz"
/>
...
...
@@ -109,6 +109,7 @@
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<color
key=
"backgroundColor"
name=
"白色背景色"
/>
<constraints>
<constraint
firstItem=
"xMe-fM-o6d"
firstAttribute=
"top"
secondItem=
"kBE-rT-dOt"
secondAttribute=
"bottom"
constant=
"15"
id=
"1qd-FP-LcT"
/>
<constraint
firstItem=
"kBE-rT-dOt"
firstAttribute=
"top"
secondItem=
"uED-Ck-HCh"
secondAttribute=
"bottom"
constant=
"10"
id=
"DXT-Nj-hCW"
/>
...
...
@@ -132,6 +133,7 @@
<constraint
firstItem=
"HF8-ja-1Mp"
firstAttribute=
"centerX"
secondItem=
"0cf-lx-CTb"
secondAttribute=
"centerX"
id=
"zy8-Zj-6iF"
/>
</constraints>
</tableViewCellContentView>
<color
key=
"backgroundColor"
name=
"白色背景色"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"njF-e1-oar"
/>
<connections>
<outlet
property=
"btnWidth"
destination=
"IJP-pf-u5R"
id=
"64D-9I-XmJ"
/>
...
...
@@ -161,5 +163,8 @@
<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>
</resources>
</document>
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.swift
View file @
8c349793
...
...
@@ -9,14 +9,28 @@
import
UIKit
import
ViewAnimator
//cell动效
class
CGDListVC
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
GeliAlertViewDelegate
,
CGDListCellDelegate
{
class
CGDListVC
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
GeliAlertViewDelegate
,
CGDListCellDelegate
,
CGDXQVcDelegate
{
func
sureGeliAlertViewAction
(
sender
:
UIButton
)
{
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"po_id"
:
sender
.
tag
as
Any
]
backOut
(
dict
,
success
:
{
(
data
)
in
HUD
.
hide
()
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"撤销成功"
),
delay
:
1.2
)
self
.
listView
.
mj_header
?
.
beginRefreshing
()
})
{
(
error
)
in
}
}
func
CGDXQVcFinishAction
()
{
listView
.
mj_header
?
.
beginRefreshing
()
}
var
page
:
Int
=
0
var
isUpData
=
false
var
keyword
=
""
var
orderStatus
=
1
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
var
datas
:
Array
<
PurchaseOrderListDataModel
>
=
[]
...
...
@@ -133,18 +147,67 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
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
=
[
"不通过"
,
"通过"
]
// }
break
case
2
:
//入库状态(1未入库,2部分入库,3已入库)
switch
model
.
push_status
{
case
1
:
btnStr
=
[
"入库"
]
break
case
2
:
btnStr
=
[
"撤销入库"
,
"补录入库"
]
break
default
:
btnStr
=
[
"撤销入库"
]
break
}
break
default
:
break
}
vc
.
btnTitle
=
btnStr
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
//MARK: - 点击cell 按钮
func
allBtnSubmit
(
sender
:
UIButton
)
{
print
(
"cgd == "
,
sender
.
titleLabel
!.
text
,
sender
.
tag
)
let
model
=
datas
[
sender
.
tag
]
switch
sender
.
titleLabel
?
.
text
{
case
"撤销入库"
:
let
alertView
=
GeliAlertView
(
frame
:
self
.
view
.
window
!.
bounds
)
alertView
.
delegate
=
self
;
alertView
.
tishiLbl
.
text
=
""
alertView
.
titileLbl
.
text
=
"是否撤销入库?"
alertView
.
rightBtn
.
setAttributedTitle
(
NSAttributedString
(
string
:
"确定"
),
for
:
.
normal
)
alertView
.
rightBtn
.
tag
=
model
.
po_id
!
self
.
view
.
window
?
.
addSubview
(
alertView
)
break
case
"入库"
:
break
case
"补录入库"
:
break
case
"修改信息"
:
break
case
"取消"
:
break
default
:
break
}
}
//MARK: - alertView delegate
func
sureGeliAlertViewAction
(
sender
:
UIButton
)
{
}
//MARK:-- tablev 处理
var
listView
:
UITableView
!
...
...
@@ -183,7 +246,7 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
print
(
"加载数据"
)
isUpData
=
true
page
=
1
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
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
self
.
datas
.
removeAll
()
...
...
GeliBusinessPlatform/ViewController/采购单详情/CGDListCell.swift
View file @
8c349793
...
...
@@ -72,9 +72,10 @@ class CGDListCell: UITableViewCell {
rightBtn
.
setTitleColor
(
UIColor
.
init
(
named
:
"按钮渐变色上"
),
for
:
.
normal
)
rightBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
rightBtn
.
layer
.
cornerRadius
=
2
rightBtn
.
isUserInteractionEnabled
=
true
if
str
as!
String
==
"查看详情"
{
rightBtn
.
setTitle
(
str
,
for
:
.
normal
)
rightBtn
.
isUserInteractionEnabled
=
false
}
else
if
str
as!
String
==
"修改信息"
{
rightBtn
.
setTitle
(
str
,
for
:
.
normal
)
rightBtn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
...
...
GeliBusinessPlatform/ViewController/采购单详情/CGDXQVc.swift
View file @
8c349793
...
...
@@ -7,20 +7,68 @@
//
import
UIKit
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
HUD
.
hide
()
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"撤销成功"
),
delay
:
1.2
)
self
.
delegate
?
.
CGDXQVcFinishAction
()
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
})
{
(
error
)
in
}
}
class
CGDXQVc
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
GLAlertSelectViewDelegate
{
var
delegate
:
CGDXQVcDelegate
?
func
sureGeliAlertTextViewAction
(
sender
:
String
)
{
if
isPass
==
false
{
print
(
"abc"
)
if
sender
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写不通过原因"
),
delay
:
1.2
)
return
}
HUD
.
flash
(
.
progress
)
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"po_id"
:
po_id
as
Any
,
"order_status"
:
3
as
Any
,
"reason"
:
sender
as
Any
]
purchaseOrderAudit
(
dict
,
success
:
{
(
data
)
in
HUD
.
hide
()
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
self
.
delegate
?
.
CGDXQVcFinishAction
()
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
})
{
(
error
)
in
}
}
else
{
HUD
.
flash
(
.
progress
)
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"po_id"
:
po_id
as
Any
,
"order_status"
:
2
as
Any
,
"reason"
:
sender
as
Any
]
purchaseOrderAudit
(
dict
,
success
:
{
(
data
)
in
HUD
.
hide
()
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
self
.
delegate
?
.
CGDXQVcFinishAction
()
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
})
{
(
error
)
in
}
}
}
var
isPass
=
false
@IBOutlet
weak
var
btmColor
:
UIView
!
@IBOutlet
weak
var
btmView
:
UIView
!
@IBOutlet
weak
var
listView
:
UITableView
!
var
btnTitle
:
Array
<
String
>
=
[]
var
po_id
:
Int
?
let
tArr
=
[
"制单信息"
,
"商品信息"
]
var
glSelectView
:
GLAlertSelectView
?
var
datas
:
Array
<
Any
>
=
[
1
,
2
]
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
//MARK: - cell delegate
var
status
=
1
//审核状态
var
titleArr
=
[
"采购单号"
,
"采购日期"
,
"供应商"
,
"采购人"
,
"采购类型"
,
"支付方式"
,
"支付类型"
,
"备注"
]
var
holderArr
=
[
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"未支付"
,
"未付款"
,
"-"
]
...
...
@@ -30,6 +78,9 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
var
payType
=
0
//支付方式
var
payStatus
=
0
//支付状态
var
model
:
PurchaseOrderDetailDataModel
?
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
navbar
.
title
=
"采购单详情"
...
...
@@ -40,12 +91,98 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
listView
.
register
(
UINib
(
nibName
:
"TitleAndBtnCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndBtnCell"
)
listView
.
register
(
UINib
(
nibName
:
"CGDCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"CGDCell"
)
if
btnTitle
.
count
==
0
{
btmView
.
isHidden
=
true
btmColor
.
isHidden
=
true
}
else
{
let
w
=
fullScreenWidth
/
CGFloat
(
btnTitle
.
count
)
for
i
in
0
..<
btnTitle
.
count
{
let
btn
=
UIButton
(
frame
:
CGRect
(
x
:
CGFloat
(
i
)
*
w
,
y
:
0
,
width
:
w
,
height
:
49
))
btmView
.
addSubview
(
btn
)
btn
.
setTitle
(
btnTitle
[
i
],
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
(
named
:
"蓝色字体颜色"
),
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
btn
.
addTarget
(
self
,
action
:
#selector(
btmBtnClick(sender:)
)
,
for
:
.
touchUpInside
)
}
}
loadData
()
}
@objc
func
btmBtnClick
(
sender
:
UIButton
){
switch
sender
.
titleLabel
?
.
text
{
case
"入库"
:
break
case
"补录入库"
:
break
case
"撤销入库"
:
let
alertView
=
GeliAlertView
(
frame
:
self
.
view
.
window
!.
bounds
)
alertView
.
delegate
=
self
;
alertView
.
tishiLbl
.
text
=
""
alertView
.
titileLbl
.
text
=
"是否撤销入库?"
alertView
.
rightBtn
.
setAttributedTitle
(
NSAttributedString
(
string
:
"确定"
),
for
:
.
normal
)
self
.
view
.
window
?
.
addSubview
(
alertView
)
break
case
"通过"
:
isPass
=
true
let
alterView
=
GeliAlertTextView
(
frame
:
self
.
view
.
window
!.
bounds
)
alterView
.
delegate
=
self
alterView
.
titleLbl
.
text
=
"请填写通过原因(选填)"
alterView
.
placerLbl
.
text
=
"请填写通过原因..."
self
.
view
.
window
?
.
addSubview
(
alterView
)
break
case
"不通过"
:
let
alterView
=
GeliAlertTextView
(
frame
:
self
.
view
.
window
!.
bounds
)
alterView
.
delegate
=
self
alterView
.
titleLbl
.
text
=
"请填写不通过原因(必填)"
alterView
.
placerLbl
.
text
=
"请填写不通过原因..."
self
.
view
.
window
?
.
addSubview
(
alterView
)
break
default
:
break
}
}
func
loadData
(){
// purchaseOrderDetail(<#T##params: [String : Any]##[String : Any]#>, success: <#T##(Any) -> ()#>, failture: <#T##(Error) -> ()#>)
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"po_id"
:
po_id
as
Any
]
purchaseOrderDetail
(
dict
,
success
:
{
(
data
)
in
let
item
=
data
as!
PurchaseOrderDetailModel
let
mo
=
item
.
data
self
.
holderArr
.
insert
(
"
\(
mo
!.
po_no
!
)
"
,
at
:
0
)
self
.
holderArr
.
remove
(
at
:
1
)
self
.
holderArr
.
insert
(
dayByDouble
(
sender
:
mo
!.
purchase_time
!
),
at
:
1
)
self
.
holderArr
.
remove
(
at
:
2
)
if
mo
!.
ven_name
!.
count
>
0
{
self
.
holderArr
.
insert
(
mo
!.
ven_name
!
,
at
:
2
)
self
.
holderArr
.
remove
(
at
:
3
)
}
if
mo
!.
purchaser
!.
count
>
0
{
self
.
holderArr
.
insert
(
mo
!.
purchaser
!
,
at
:
3
)
self
.
holderArr
.
remove
(
at
:
4
)
}
if
mo
!.
type
==
1
{
self
.
holderArr
.
insert
(
"临时采购"
,
at
:
4
)
self
.
holderArr
.
remove
(
at
:
5
)
}
else
{
self
.
holderArr
.
insert
(
"固定采购"
,
at
:
4
)
self
.
holderArr
.
remove
(
at
:
5
)
}
if
mo
!.
remarks
!.
count
>
0
{
self
.
holderArr
.
insert
(
mo
!.
remarks
!
,
at
:
7
)
self
.
holderArr
.
remove
(
at
:
8
)
}
self
.
model
=
mo
self
.
listView
.
reloadData
()
})
{
(
error
)
in
}
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
...
...
@@ -55,6 +192,11 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
cell
.
nameLbl
.
text
=
titleArr
[
indexPath
.
row
]
cell
.
contentLbl
.
text
=
holderArr
[
indexPath
.
row
]
cell
.
btn
.
isUserInteractionEnabled
=
false
if
model
?
.
order_status
==
1
{
cell
.
arrowImg
.
isHidden
=
true
}
else
{
cell
.
arrowImg
.
isHidden
=
false
}
return
cell
}
else
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndTFCell"
)
as!
TitleAndTFCell
...
...
@@ -67,9 +209,20 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"CGDCell"
)
as!
CGDCell
cell
.
btnWidth
.
constant
=
0
cell
.
lblRight
.
constant
=
15
let
item
=
model
?
.
goods_res
!
[
indexPath
.
row
]
cell
.
nameLbl
.
text
=
item
?
.
goods_name
let
num
=
"
\(
item
!.
num
!
)
"
as
NSString
let
amount
=
(
item
?
.
amount
!
)
!
as
NSString
cell
.
cgCount
.
text
=
num
as
String
cell
.
cgPrice
.
text
=
amount
as
String
cell
.
detailLbl
.
text
=
"
\(
item
!.
sku_name
!
)
¥
\(
amount
)
x
\(
num
)
\(
item
!.
unit
!
)
"
cell
.
cgTotalPrice
.
text
=
"
\(
num
.
floatValue
*
amount
.
floatValue
)
"
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
model
?
.
order_status
!=
2
{
return
}
if
indexPath
.
section
==
0
{
if
indexPath
.
row
==
6
{
if
glSelectView
==
nil
{
...
...
@@ -103,28 +256,16 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
if
status
==
0
{
//审核中
if
indexPath
.
section
==
0
{
if
model
?
.
order_status
==
1
{
if
indexPath
.
row
==
5
||
indexPath
.
row
==
6
{
return
0
}
else
{
if
indexPath
.
section
==
1
{
return
174
}
else
{
return
49
}
}
}
}
else
{
if
indexPath
.
section
==
1
{
return
174
}
else
{
return
49
}
}
return
0
return
173
}
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
...
...
@@ -135,7 +276,10 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
if
section
==
0
{
return
8
}
return
datas
.
count
if
model
!=
nil
{
return
(
model
?
.
goods_res
!.
count
)
!
}
return
0
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
...
...
GeliBusinessPlatform/ViewController/采购单详情/CGDXQVc.xib
View file @
8c349793
...
...
@@ -11,6 +11,7 @@
<objects>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
customClass=
"CGDXQVc"
customModule=
"TestClass"
customModuleProvider=
"target"
>
<connections>
<outlet
property=
"btmColor"
destination=
"XSf-8D-3tt"
id=
"14B-Gc-l2f"
/>
<outlet
property=
"btmView"
destination=
"AfC-cy-CDK"
id=
"OZa-qe-r81"
/>
<outlet
property=
"listView"
destination=
"xUS-ih-bIA"
id=
"8g9-zc-R5S"
/>
<outlet
property=
"view"
destination=
"i5M-Pr-FkT"
id=
"sfx-zR-JGt"
/>
...
...
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