Commit ec7743ef authored by lujunye's avatar lujunye

补充入库通过提醒

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