Commit f02bdaa7 authored by lujunye's avatar lujunye

非权限入库修改

parent 11732d8a
......@@ -25,17 +25,9 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
if lgBtnTitLbl.text == "提交申请" {
var goodsInfoArr:Array<Any>? = []
rkSelectArr.forEach { (model) in
var rkjg:Float = 0
var total:Float = 0
var number = 0
if model.RKSL != nil {
number = model.RKSL!
}
if model.RKJG != nil {
rkjg = model.RKJG!
total = rkjg * Float(model.RKSL!)
}
total = model.RKJG! * Float(model.RKSL!)
var shelf_life = model.BZQ
if model.DayType == 0 {
shelf_life = model.BZQ! * 30
......@@ -47,9 +39,9 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
"sku_id":model.sku_id as Any,
"goods_name":model.goods_name as Any,
"goods_spec":model.spec_str as Any,
"number":number as Any,
"number":model.RKSL! as Any,
"price":model.price as Any,
"amount":rkjg as Any,
"amount":model.RKJG! as Any,
"subtotal":total as Any,
"production_data":model.createDay as Any,
"shelf_life":shelf_life as Any,
......@@ -67,12 +59,9 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
GoodsInputApply(dict, success: { (data) in
HUD.hide()
HUD.flash(.labeledSubSuccess(subtitle: "申请成功"), delay: 1.2)
self.navigationController?.popViewController(animated: true)
}) { (error) in
}
......@@ -150,8 +139,16 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
}
for item in rkSelectArr{
if item.createDay == nil || item.BZQ == nil || item.RKSL == nil{
HUD.flash(.label("请完整填写数据"), delay: 1.2)
if item.RKSL == nil{
HUD.flash(.label("请填写入库数量"), delay: 1.2)
return
}
if item.createDay == nil {
HUD.flash(.label("请选择生产日期"), delay: 1.2)
return
}
if item.BZQ == nil {
HUD.flash(.label("请填写保质期"), delay: 1.2)
return
}
}
......@@ -362,11 +359,20 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
cell.timeLbl.text = "请选择生产日期"
if data.RKJG != nil {
cell.rkPriceTf.text = "\(data.RKJG!)"
}else{
let num = data.price! as! NSString
data.RKJG = num.floatValue
}
if data.RKSL != nil {
cell.rkCountTf.text = "\(data.RKSL!)"
}else{
cell.rkCountTf.text = "1"
data.RKSL = 1
}
if data.ZJ != nil {
cell.totalPriceTf.text = "\(data.ZJ!)"
}else{
cell.totalPriceTf.text = data.price!
}
if data.BZQ != nil {
cell.bzqTf.text = "\(data.BZQ!)"
......@@ -492,8 +498,14 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
//MARK: - cell delegate
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0 {
if isGm == false {
if indexPath.row < 2{
return 0.001
}
}
return 49
}
return 326
}
func setCellUI(cell:CRKBtnCell){
......
......@@ -497,8 +497,9 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
cell.rkzj.text = "入库总价:¥" + "\(model.subtotal!)"
cell.baozhiQ.text = "保质期:" + "\(model.shelf_life!)天"
let month = model.shelf_life!/30
let day = model.shelf_life! % 30
if month > 0 {
cell.baozhiQ.text = "保质期:" + "\(month)月"
cell.baozhiQ.text = "保质期:" + "\(month)月" + "\(day)天"
}
cell.baogao.text = "报告:无"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment