Commit ec7743ef authored by lujunye's avatar lujunye

补充入库通过提醒

parent ba912068
...@@ -85,6 +85,8 @@ class WarehouseIoListDataResModel: Mappable { ...@@ -85,6 +85,8 @@ class WarehouseIoListDataResModel: Mappable {
var number : Int? var number : Int?
//缩略图 //缩略图
var goods_thumb : String? var goods_thumb : String?
var sku_id:Int?
var goods_id:Int?
required init?( map: Map) { required init?( map: Map) {
} }
...@@ -93,5 +95,7 @@ class WarehouseIoListDataResModel: Mappable { ...@@ -93,5 +95,7 @@ class WarehouseIoListDataResModel: Mappable {
goods_spec <- map["goods_spec"] goods_spec <- map["goods_spec"]
number <- map["number"] number <- map["number"]
goods_thumb <- map["goods_thumb"] goods_thumb <- map["goods_thumb"]
goods_id <- map["goods_id"]
sku_id <- map["sku_id"]
} }
} }
...@@ -142,7 +142,8 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi ...@@ -142,7 +142,8 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
totalCount += data.chuHuoLiang! totalCount += data.chuHuoLiang!
} }
} }
listView.reloadData() let index = IndexPath(row: 0, section: 1)
listView.reloadRows(at: [index], with: .none)
} }
func PiCiXuanZeCellBtnSelect(cell: PiCiXuanZeCell) { func PiCiXuanZeCellBtnSelect(cell: PiCiXuanZeCell) {
...@@ -165,7 +166,7 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi ...@@ -165,7 +166,7 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
totalCount = 0 totalCount = 0
for item in recordArr{ for item in recordArr{
if item.chuHuoLiang != nil && item.chuHuoLiang != 0{ if item.chuHuoLiang != nil {
totalCount += item.chuHuoLiang! totalCount += item.chuHuoLiang!
} }
} }
......
...@@ -9,7 +9,35 @@ ...@@ -9,7 +9,35 @@
import UIKit import UIKit
import ViewAnimator //cell动效 import ViewAnimator //cell动效
class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CRKCellDelegate,UISearchBarDelegate, SearchBarViewDelegate,CRKXiangQVCDelegate ,MoreAndTimeSelectViewDelegate,GeliAlertTextViewDelegate{ class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CRKCellDelegate,UISearchBarDelegate, SearchBarViewDelegate,CRKXiangQVCDelegate ,MoreAndTimeSelectViewDelegate,GeliAlertTextViewDelegate,GeliAlertViewDelegate{
func sureGeliAlertViewAction(sender: UIButton) {
//MARK: - 出入库列表 iog_id
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let data = datas![selectIdx!]
var goodInfoArr:Array<Any> = []
data.goods_res?.forEach({ (model) in
let goods = [
"w_id":0 as Any,
"p_id":0 as Any,
"iog_id":0 as Any
]
goodInfoArr.append(goods)
})
let goodsInfo = dataChangeString(sender: goodInfoArr)
let dict = [
"user_token":UserToken as Any,
"io_id":data.io_id as Any,
"goods_info":goodsInfo as Any
]
GoodsInputAudit(dict, success: { (data) in
self.listView.mj_header?.beginRefreshing()
}) { (error) in
}
}
...@@ -304,75 +332,30 @@ class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CR ...@@ -304,75 +332,30 @@ class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CR
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
if isPass {//通过 if isPass {//通过
if io_type == 1 {//入库 let data = datas![selectIdx!]
let batchInfo:Array<Any> = []
let UserToken = UserDefaults.standard.value(forKey: "user_token") var goodsInfoArr : Array<Any> = []
//MARK: - 出入库列表 iog_id data.goods_res?.forEach({ (item) in
let goods = [
let data = datas![selectIdx!] "goods_id":item.goods_id as Any,
"goods_name":item.goods_name as Any,
var goodInfoArr:Array<Any> = [] "goods_spec":item.goods_spec as Any,
// data.goods_res?.forEach({ (model) in "sku_id":item.sku_id as Any,
// let goods = [ "number":item.number as Any,
// "w_id":.w_id as Any, "batch_info":batchInfo
// "p_id":data.p_id as Any, ] as [String : Any]
// "iog_id":data.iog_id as Any goodsInfoArr.append(goods)
// ] })
// goodInfoArr.append(goods)
// }) let goods_info = dataChangeString(sender: goodsInfoArr)
let goodsInfo = dataChangeString(sender: goodInfoArr) let dict = [
"user_token":UserToken as Any,
let dict = [ "io_id":data.io_id as Any,
"user_token":UserToken as Any, "audit_remark":sender,
"io_id":data.io_id as Any, "goods_info":goods_info]
"goods_info":goodsInfo as Any GoodsOutputAudit(dict, success: { (data) in
] self.listView.mj_header?.beginRefreshing()
GoodsInputAudit(dict, success: { (data) in }) { (error) in
self.listView.mj_header?.beginRefreshing()
}) { (error) in
}
}else{//出库
let data = datas![selectIdx!]
var batchInfo:Array<Any> = []
// piCiArr.forEach { (batchArr) in
// batchArr.forEach { (model) in
// let batch = [
// "w_id":model.w_id as Any,
// "p_id":model.p_id as Any,
// "number":model.chuHuoLiang as Any,
// "production_data":model.production_data as Any,
// "shelf_life":model.shelf_life as Any,
// "valid_date":model.valid_date as Any,
// "batch_id":model.batch_id as Any,
// "report_id":model.report_id as Any
// ]
// batchInfo.append(batch)
// }
// }
var goodsInfoArr : Array<Any> = []
// outGoodsModels?.forEach({ (item) in
// let goods = [
// "goods_id":item.goods_id as Any,
// "goods_name":item.goods_name as Any,
// "goods_spec":item.goods_spec as Any,
// "sku_id":item.sku_id as Any,
// "number":item.number as Any,
// "batch_info":batchInfo
// ] as [String : Any]
// goodsInfoArr.append(goods)
// })
let goods_info = dataChangeString(sender: goodsInfoArr)
let dict = [
"user_token":UserToken as Any,
"io_id":data.io_id as Any,
"audit_remark":sender,
"goods_info":goods_info]
GoodsOutputAudit(dict, success: { (data) in
self.listView.mj_header?.beginRefreshing()
}) { (error) in
}
} }
}else{//不通过 }else{//不通过
...@@ -397,11 +380,23 @@ class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CR ...@@ -397,11 +380,23 @@ class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CR
func CRKCellBtnClick(sender: UIButton, cell: CRKCell) { func CRKCellBtnClick(sender: UIButton, cell: CRKCell) {
selectIdx = cell.tag selectIdx = cell.tag
if sender.tag == 0 {//通过 if sender.tag == 0 {//通过
print("1",cell.tag) if io_type == 1 {
let alterView = GeliAlertTextView(frame: self.view.window!.bounds) let alertView = GeliAlertView(frame: self.view.window!.bounds)
alterView.delegate = self alertView.delegate = self;
self.view.window?.addSubview(alterView) alertView.tishiLbl.text = ""
isPass = true alertView.titileLbl.text = "是否通过审核?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确定"), for: .normal)
self.view.window?.addSubview(alertView)
return
}
if io_type == 2 {
print("1",cell.tag)
let alterView = GeliAlertTextView(frame: self.view.window!.bounds)
alterView.delegate = self
self.view.window?.addSubview(alterView)
isPass = true
}
}else{//不通过 }else{//不通过
print("2",cell.tag) print("2",cell.tag)
let alterView = GeliAlertTextView(frame: self.view.window!.bounds) let alterView = GeliAlertTextView(frame: self.view.window!.bounds)
......
...@@ -219,8 +219,7 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource, ...@@ -219,8 +219,7 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
alertView.delegate = self; alertView.delegate = self;
alertView.tishiLbl.text = "" alertView.tishiLbl.text = ""
alertView.titileLbl.text = "是否通过审核?" alertView.titileLbl.text = "是否通过审核?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "保存"), for: .normal) alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确定"), for: .normal)
alertView.rightBtn.tag = 1001
self.view.window?.addSubview(alertView) self.view.window?.addSubview(alertView)
}else{ }else{
let alterView = GeliAlertTextView(frame: self.view.window!.bounds) let alterView = GeliAlertTextView(frame: self.view.window!.bounds)
......
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