Commit 64d44745 authored by lujunye's avatar lujunye

补充新逻辑

parent 29f9ccc3
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
///中心点经纬度 ///中心点经纬度
@property (nonatomic, copy) AMapGeoPoint *location; @property (nonatomic, copy) AMapGeoPoint *location;
///面积,单位平方米 ///面积,单位平方米
@property (nonatomic, assign) CGFloat area; @property (nonatomic, assign) CGFloat area;
@end @end
///道路 ///道路
......
...@@ -33,7 +33,7 @@ user_token(验证token) ...@@ -33,7 +33,7 @@ user_token(验证token)
w_id(仓库id) w_id(仓库id)
*/ */
func WarehouseDetail(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) { func WarehouseDetail(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("商家仓库详情", params, { (rep:DataResponse<ShopWarehouseDetailDataModel>) in NetworkRequest.sharedInstance.postRequest("商家仓库详情", params, { (rep:DataResponse<ShopWarehouseDetailModel>) in
}, success: { (data) in }, success: { (data) in
success(data) success(data)
}) { (error) in }) { (error) in
......
...@@ -45,8 +45,8 @@ class ShopWarehouseDetailDataBasicModel: Mappable { ...@@ -45,8 +45,8 @@ class ShopWarehouseDetailDataBasicModel: Mappable {
var w_name:String?//仓库名 var w_name:String?//仓库名
var w_type:Int? //仓库类型,1常温、2冷藏、3冷冻 var w_type:Int? //仓库类型,1常温、2冷藏、3冷冻
var w_address:String?//地址 var w_address:String?//地址
var volume:Int?//容积 var volume:Float?//容积
var area:Int?//面积 var area:Float?//面积
var contact:String?//联系人 var contact:String?//联系人
var contact_number:String?//联系电话 var contact_number:String?//联系电话
var mail:String?//电子邮箱 var mail:String?//电子邮箱
...@@ -81,7 +81,7 @@ class ShopWarehouseDetailDataPositionModel: Mappable { ...@@ -81,7 +81,7 @@ class ShopWarehouseDetailDataPositionModel: Mappable {
var p_name:String?//库位名 var p_name:String?//库位名
var is_default:Int?//是否默认 var is_default:Int?//是否默认
var inventory_count:Int?//库存数 var inventory_count:Int?//库存数
var status = 1//状态
required init?( map: Map) { required init?( map: Map) {
} }
...@@ -91,7 +91,21 @@ class ShopWarehouseDetailDataPositionModel: Mappable { ...@@ -91,7 +91,21 @@ class ShopWarehouseDetailDataPositionModel: Mappable {
p_name <- map["p_name"] p_name <- map["p_name"]
is_default <- map["is_default"] is_default <- map["is_default"]
inventory_count <- map["inventory_count"] inventory_count <- map["inventory_count"]
}
}
class ShopWarehouseDetailDataPositionDetailModel: Mappable {
var p_id :Int?//库位id
var p_name:String?//库位名
var status:Int?//库位修改状态,1未修改2已修改3删除4新增,库位中有库存时则不能删除
required init?( map: Map) {
}
func mapping(map: Map) {
p_id <- map["p_id"]
p_name <- map["p_name"]
status <- map["status"] status <- map["status"]
} }
} }
...@@ -203,7 +203,10 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -203,7 +203,10 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
return cell return cell
} }
@IBAction func submitClick(_ sender: Any) { @IBAction func submitClick(_ sender: Any) {
if (titleLbl.text?.contains("库位"))! {
delegate?.KuWeiDataArr?(sender: kuWeiArr)
return
}
if isMultipleS == false { if isMultipleS == false {
if selectNum == nil { if selectNum == nil {
HUD.flash(.label("\(titleLbl.text!)"), delay: 1.2) HUD.flash(.label("\(titleLbl.text!)"), delay: 1.2)
...@@ -228,14 +231,34 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -228,14 +231,34 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
if isMultipleS == false { if isMultipleS == false {
selectNum = cell.tag selectNum = cell.tag
}else{ }else{
if cell.selectBtn.isSelected == true { if isShangPinType {
selectArray?.insert(99, at: cell.tag) if cell.tag == 0 {
selectArray?.remove(at: cell.tag+1) if selectArray![0] == 99 {
selectArray?.insert(0, at: 0)
selectArray?.remove(at: 1)
}else{
selectArray?.insert(99, at: 0)
selectArray?.remove(at: 1)
}
}else{
for i in 1 ..< selectArray!.count {
selectArray?.insert(99, at: i)
selectArray?.remove(at: i+1)
}
selectArray?.insert(cell.tag, at: cell.tag)
selectArray?.remove(at: cell.tag+1)
}
}else{ }else{
selectArray?.insert(cell.tag, at: cell.tag) if cell.selectBtn.isSelected == true {
selectArray?.remove(at: cell.tag+1) selectArray?.insert(99, at: cell.tag)
selectArray?.remove(at: cell.tag+1)
}else{
selectArray?.insert(cell.tag, at: cell.tag)
selectArray?.remove(at: cell.tag+1)
}
} }
} }
print("sele",selectArray,cell.tag)
selectTbv.reloadData() selectTbv.reloadData()
} }
//库位 //库位
...@@ -349,8 +372,6 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -349,8 +372,6 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
} }
@objc func addKuWei(){ @objc func addKuWei(){
IQKeyboardManager.shared.resignFirstResponder() IQKeyboardManager.shared.resignFirstResponder()
if (inputTextTF?.text!.count)! > 0 { if (inputTextTF?.text!.count)! > 0 {
...@@ -361,7 +382,6 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -361,7 +382,6 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
self.btmVHeight.constant = fullScreenHeight*0.75 self.btmVHeight.constant = fullScreenHeight*0.75
} }
inputTextTF?.text = "" inputTextTF?.text = ""
delegate?.KuWeiDataArr?(sender: kuWeiArr)
selectTbv?.reloadData() selectTbv?.reloadData()
}else{ }else{
HUD.flash(.label("请输入库位名称"), delay: 1.2) HUD.flash(.label("请输入库位名称"), delay: 1.2)
......
...@@ -10,23 +10,8 @@ import UIKit ...@@ -10,23 +10,8 @@ import UIKit
import ViewAnimator import ViewAnimator
import SwipeCellKit import SwipeCellKit
class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource, SearchBarViewDelegate,SwipeTableViewCellDelegate,CheckWareHourseViewControllerDelegate { class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource, SearchBarViewDelegate,SwipeTableViewCellDelegate {
func CheckWareHourseViewControllerDelAction(Idx: Int) {
warehourseArr.remove(at: Idx)
tableV.reloadData()
}
func CheckWareHourseViewControllerEditAction(data: ShopWarehouseListDataModel, Idx: Int) {
warehourseArr.insert(data, at: Idx)
warehourseArr.remove(at: Idx+1)
tableV.reloadData()
}
func CheckWareHourseViewControllerSaveAction(data: ShopWarehouseListDataModel) {
warehourseArr.append(data)
tableV.reloadData()
}
weak var searchV: SearchBarView? = nil weak var searchV: SearchBarView? = nil
@IBOutlet weak var contentView: UIView! @IBOutlet weak var contentView: UIView!
@IBOutlet weak var searchView: UIView! @IBOutlet weak var searchView: UIView!
...@@ -156,7 +141,6 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -156,7 +141,6 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
searchV!.resignFirstResponder() searchV!.resignFirstResponder()
} }
let vc = CheckWareHourseViewController() let vc = CheckWareHourseViewController()
vc.delegate = self
vc.titleStr = "新增仓库" vc.titleStr = "新增仓库"
self.navigationController?.pushViewController(vc, animated: false) self.navigationController?.pushViewController(vc, animated: false)
} }
...@@ -200,7 +184,6 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -200,7 +184,6 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath) print(indexPath)
let vc = CheckWareHourseViewController() let vc = CheckWareHourseViewController()
vc.delegate = self
vc.titleStr = "编辑仓库" vc.titleStr = "编辑仓库"
let model = warehourseArr[indexPath.row] let model = warehourseArr[indexPath.row]
vc.w_id = model.w_id vc.w_id = model.w_id
......
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