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
e26d340d
Commit
e26d340d
authored
Jun 22, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消采购,编辑采购信息
parent
08685a68
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
188 additions
and
21 deletions
+188
-21
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Interface/Interface_Z.plist
GeliBusinessPlatform/Interface/Interface_Z.plist
+4
-0
GeliBusinessPlatform/Model/OrderManageModel/GetGoodsInfoModel.swift
...ssPlatform/Model/OrderManageModel/GetGoodsInfoModel.swift
+4
-0
GeliBusinessPlatform/Model/PurchaseInterface.swift
GeliBusinessPlatform/Model/PurchaseInterface.swift
+48
-0
GeliBusinessPlatform/Model/UpDataModel.swift
GeliBusinessPlatform/Model/UpDataModel.swift
+1
-1
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
...sinessPlatform/ViewController/商品详情/EPViewController.swift
+1
-0
GeliBusinessPlatform/ViewController/新增采购单/XinCaiGouViewController.swift
...atform/ViewController/新增采购单/XinCaiGouViewController.swift
+113
-18
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.swift
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.swift
+17
-2
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
e26d340d
No preview for this file type
GeliBusinessPlatform/Interface/Interface_Z.plist
View file @
e26d340d
...
...
@@ -182,5 +182,9 @@
<string>
Finance/confirmReceipt
</string>
<key>
设为未收
</key>
<string>
Finance/uncollected
</string>
<key>
取消采购单
</key>
<string>
Purchase/cancelPurchaseOrder
</string>
<key>
修改采购订单
</key>
<string>
Purchase/purchaseOrderEdit
</string>
</dict>
</plist>
GeliBusinessPlatform/Model/OrderManageModel/GetGoodsInfoModel.swift
View file @
e26d340d
...
...
@@ -46,6 +46,8 @@ class GetGoodsInfoDataModel: Mappable {
var
target_Count
:
Int
?
//目标数量
var
target_Price
:
String
?
//目标价格
var
pog_id
=
0
var
edit_status
=
1
required
init
?(
map
:
Map
)
{
}
...
...
@@ -68,6 +70,8 @@ class GetGoodsInfoDataModel: Mappable {
adsale_tiered_pri
<-
map
[
"adsale_tiered_pri"
]
target_Count
<-
map
[
"target_Count"
]
target_Price
<-
map
[
"target_Price"
]
pog_id
<-
map
[
"pog_id"
]
edit_status
<-
map
[
"edit_status"
]
}
}
GeliBusinessPlatform/Model/PurchaseInterface.swift
View file @
e26d340d
...
...
@@ -120,3 +120,51 @@ func payStatus(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:
failture
(
error
)
}
}
//MARK:--取消采购单
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key(
//user_token(验证token)
po_id 应收账款记录id
*/
func
cancelPurchaseOrder
(
_
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
ven_id 供应商id
purchase_time 采购时间,时间戳格式
purchaser 采购人
type 采购单类型:1临时采购,2固定采购
remarks 采购订单备注
goods_info
pog_id 采购单商品id,新增项填0
edit_status 订单商品修改状态,1未修改,2新增,3删除
goods_id 商品id
goods_name 商品名
sku_id 商品sku_id
sku_name 商品规格名
num 数量
unit 单位
price 价格(售价)
amount 采购价
*/
func
purchaseOrderEdit
(
_
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/UpDataModel.swift
View file @
e26d340d
...
...
@@ -8,7 +8,7 @@
import
Foundation
import
ObjectMapper
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态,供应商编辑,新增供应商,编辑客户,新增客户,应收账款收款,设为未收,
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态,供应商编辑,新增供应商,编辑客户,新增客户,应收账款收款,设为未收,
取消采购单,修改采购订单,
class
UpDataModel
:
Mappable
{
var
code
:
Int
?
...
...
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
View file @
e26d340d
...
...
@@ -1866,6 +1866,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
}
})
}
var
data2
:
Array
<
Dictionary
<
String
,
Any
>>
=
[]
for
item
in
tempArr
{
if
item
.
count
>
0
{
...
...
GeliBusinessPlatform/ViewController/新增采购单/XinCaiGouViewController.swift
View file @
e26d340d
...
...
@@ -20,37 +20,129 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
var
delegate
:
XinCaiGouViewControllerDelegate
?
func
getNewPicDictsArray
(){
print
(
"源数据"
)
var
tempArr
:
Array
<
GetGoodsInfoDataModel
>
=
[]
var
tempOldArr
:
Array
<
GetGoodsInfoDataModel
>
=
[]
datas
.
forEach
{
(
model
)
in
tempArr
.
append
(
model
)
}
recordArr
.
forEach
({
(
model
)
in
tempOldArr
.
append
(
model
)
})
var
sameItem
:
Array
<
GetGoodsInfoDataModel
>
=
[]
tempOldArr
.
forEach
{
(
old
)
in
tempArr
.
forEach
{
(
new
)
in
if
old
.
sku_id
==
new
.
sku_id
{
sameItem
.
append
(
new
)
}
}
}
sameItem
.
forEach
{
(
same
)
in
tempOldArr
.
forEach
{
(
old
)
in
if
old
.
sku_id
==
same
.
sku_id
{
let
idx
=
tempOldArr
.
lastIndex
{
(
model
)
->
Bool
in
return
model
.
sku_id
==
same
.
sku_id
}
tempOldArr
.
remove
(
at
:
idx
!
)
}
}
}
var
delItem
:
Array
<
GetGoodsInfoDataModel
>
=
[]
tempOldArr
.
forEach
{
(
item
)
in
item
.
edit_status
=
3
delItem
.
append
(
item
)
}
sameItem
.
forEach
{
(
same
)
in
tempArr
.
forEach
{
(
old
)
in
if
old
.
sku_id
==
same
.
sku_id
{
let
idx
=
tempArr
.
lastIndex
{
(
model
)
->
Bool
in
return
model
.
sku_id
==
same
.
sku_id
}
tempArr
.
remove
(
at
:
idx
!
)
}
}
}
var
newItem
:
Array
<
GetGoodsInfoDataModel
>
=
[]
tempArr
.
forEach
{
(
item
)
in
item
.
edit_status
=
2
newItem
.
append
(
item
)
}
holderItemArr
=
newItem
+
sameItem
+
delItem
}
var
holderItemArr
:
Array
<
GetGoodsInfoDataModel
>
=
[]
func
sureGeliAlertViewAction
(
sender
:
UIButton
)
{
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
var
goodsInfoArr
:
Array
<
Any
>
?
=
[]
datas
.
forEach
{
(
model
)
in
let
p
=
model
.
target_Price
as!
NSString
let
amount
=
p
.
floatValue
*
Float
(
model
.
target_Count
!
)
let
goods
=
[
"goods_id"
:
model
.
goods_id
as
Any
,
"sku_id"
:
model
.
sku_id
as
Any
,
"goods_name"
:
model
.
goods_name
as
Any
,
"sku_name"
:
model
.
sku_attr
as
Any
,
"num"
:
model
.
target_Count
as
Any
,
"unit"
:
model
.
unit
as
Any
,
"price"
:
model
.
target_Price
as
Any
,
"amount"
:
amount
as
Any
,
]
goodsInfoArr
?
.
append
(
goods
)
if
sender
.
tag
==
999
{
getNewPicDictsArray
()
holderItemArr
.
forEach
{
(
model
)
in
let
p
=
model
.
target_Price
as!
NSString
let
amount
=
p
.
floatValue
*
Float
(
model
.
target_Count
!
)
let
goods
=
[
"goods_id"
:
model
.
goods_id
as
Any
,
"sku_id"
:
model
.
sku_id
as
Any
,
"goods_name"
:
model
.
goods_name
as
Any
,
"sku_name"
:
model
.
sku_attr
as
Any
,
"num"
:
model
.
target_Count
as
Any
,
"unit"
:
model
.
unit
as
Any
,
"price"
:
model
.
target_Price
as
Any
,
"amount"
:
amount
as
Any
,
"pog_id"
:
model
.
pog_id
as
Any
,
"edit_status"
:
model
.
edit_status
as
Any
]
goodsInfoArr
?
.
append
(
goods
)
}
}
else
{
datas
.
forEach
{
(
model
)
in
let
p
=
model
.
target_Price
as!
NSString
let
amount
=
p
.
floatValue
*
Float
(
model
.
target_Count
!
)
let
goods
=
[
"goods_id"
:
model
.
goods_id
as
Any
,
"sku_id"
:
model
.
sku_id
as
Any
,
"goods_name"
:
model
.
goods_name
as
Any
,
"sku_name"
:
model
.
sku_attr
as
Any
,
"num"
:
model
.
target_Count
as
Any
,
"unit"
:
model
.
unit
as
Any
,
"price"
:
model
.
target_Price
as
Any
,
"amount"
:
amount
as
Any
,
"pog_id"
:
model
.
pog_id
as
Any
]
goodsInfoArr
?
.
append
(
goods
)
}
}
let
goods_info
=
dataChangeString
(
sender
:
goodsInfoArr
!
)
let
dict
=
[
var
dict
=
[
"user_token"
:
UserToken
as
Any
,
"ven_id"
:
ven_id
as
Any
,
"purchase_time"
:
dayTime
as
Any
,
"purchaser"
:
cgName
as
Any
,
"type"
:
typeSelect
+
1
as
Any
,
"remarks"
:
contentStr
as
Any
,
"is_apply"
:
1
as
Any
,
"goods_info"
:
goods_info
as
Any
]
HUD
.
flash
(
.
progress
)
if
orderNum
!=
nil
{
dict
[
"po_id"
]
=
po_id
!
purchaseOrderEdit
(
dict
,
success
:
{
(
data
)
in
HUD
.
hide
()
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"修改成功"
),
delay
:
1.2
)
self
.
delegate
?
.
XinCaiGouViewControllerFinish
()
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
})
{
(
err
)
in
}
return
}
dict
[
"is_apply"
]
=
1
purchaseOrderAdd
(
dict
,
success
:
{
(
data
)
in
HUD
.
hide
()
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
...
...
@@ -147,14 +239,16 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
alertView
.
titileLbl
.
text
=
"是否提交申请?"
}
else
{
alertView
.
titileLbl
.
text
=
"是否提交修改?"
alertView
.
rightBtn
.
tag
=
999
}
alertView
.
rightBtn
.
setAttributedTitle
(
NSAttributedString
(
string
:
"
保存
"
),
for
:
.
normal
)
alertView
.
rightBtn
.
setAttributedTitle
(
NSAttributedString
(
string
:
"
确定
"
),
for
:
.
normal
)
self
.
view
.
window
?
.
addSubview
(
alertView
)
}
@IBOutlet
weak
var
listView
:
UITableView
!
@IBOutlet
weak
var
btmLine
:
UIView
!
var
datas
:
Array
<
GetGoodsInfoDataModel
>
=
[]
var
recordArr
:
Array
<
GetGoodsInfoDataModel
>
=
[]
let
typeArr
=
[
"临时采购"
,
"固定采购"
]
let
titleArr
=
[
"采购单号"
,
"采购日期"
,
"供应商"
,
"采购人"
,
"采购类型"
,
"备注"
]
...
...
@@ -163,6 +257,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
var
orderNum
:
String
?
var
ven_name
:
String
?
var
ven_id
:
Int
?
var
po_id
:
Int
?
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -188,7 +283,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
listView
.
register
(
UINib
(
nibName
:
"CGDCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"CGDCell"
)
listView
.
register
(
UINib
(
nibName
:
"TitleAndLblCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndLblCell"
)
}
//MARK: - cell delegate
...
...
GeliBusinessPlatform/ViewController/采购单列表/CGDListVC.swift
View file @
e26d340d
...
...
@@ -29,6 +29,12 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
self
.
listView
.
mj_header
?
.
beginRefreshing
()
})
{
(
error
)
in
}
}
else
{
cancelPurchaseOrder
(
dict
,
success
:
{
(
data
)
in
self
.
listView
.
mj_header
?
.
beginRefreshing
()
})
{
(
err
)
in
}
}
}
...
...
@@ -211,6 +217,7 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
vc
.
delegate
=
self
vc
.
cgName
=
model
.
purchaser
!
vc
.
orderNum
=
model
.
po_no
!
vc
.
po_id
=
model
.
po_id
!
vc
.
ven_id
=
model
.
ven_id
!
vc
.
ven_name
=
model
.
ven_name
!
vc
.
dayTime
=
model
.
purchase_time
!
...
...
@@ -226,16 +233,24 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
"unit"
:
item
.
unit
as
Any
,
"price"
:
item
.
price
as
Any
,
"target_Count"
:
item
.
num
as
Any
,
"target_Price"
:
item
.
amount
as
Any
"target_Price"
:
item
.
amount
as
Any
,
"pog_id"
:
item
.
pog_id
as
Any
]
as
[
String
:
Any
]
let
mo
=
GetGoodsInfoDataModel
(
JSON
:
dict
)
vc
.
datas
.
append
(
mo
!
)
vc
.
recordArr
.
append
(
mo
!
)
})
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
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
)
alertView
.
rightBtn
.
tag
=
model
.
po_id
!
self
.
view
.
window
?
.
addSubview
(
alertView
)
break
default
:
break
...
...
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