Commit e4cda593 authored by lujunye's avatar lujunye

修改逻辑

parent b99ac8a6
...@@ -200,7 +200,9 @@ ...@@ -200,7 +200,9 @@
E0A7548B244A8F0F00A84B67 /* CheckWareHourseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0A75489244A8F0F00A84B67 /* CheckWareHourseViewController.xib */; }; E0A7548B244A8F0F00A84B67 /* CheckWareHourseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0A75489244A8F0F00A84B67 /* CheckWareHourseViewController.xib */; };
E0B5307E247266F400FFCC15 /* DKXDAdrCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B5307C247266F400FFCC15 /* DKXDAdrCell.swift */; }; E0B5307E247266F400FFCC15 /* DKXDAdrCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B5307C247266F400FFCC15 /* DKXDAdrCell.swift */; };
E0B5307F247266F400FFCC15 /* DKXDAdrCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0B5307D247266F400FFCC15 /* DKXDAdrCell.xib */; }; E0B5307F247266F400FFCC15 /* DKXDAdrCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0B5307D247266F400FFCC15 /* DKXDAdrCell.xib */; };
E0B5308124727ED600FFCC15 /* WareHourseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B5308024727ED600FFCC15 /* WareHourseModel.swift */; }; E0B5308424728D7E00FFCC15 /* ShopWarehouseListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B5308324728D7E00FFCC15 /* ShopWarehouseListModel.swift */; };
E0B5308624728FB600FFCC15 /* WarehouseInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B5308524728FB600FFCC15 /* WarehouseInterface.swift */; };
E0B530882472917F00FFCC15 /* ShopWarehouseDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B530872472917F00FFCC15 /* ShopWarehouseDetailModel.swift */; };
E0B6036E244D376900A56B38 /* KuWeiCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B6036C244D376900A56B38 /* KuWeiCell.swift */; }; E0B6036E244D376900A56B38 /* KuWeiCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B6036C244D376900A56B38 /* KuWeiCell.swift */; };
E0B6036F244D376900A56B38 /* KuWeiCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0B6036D244D376900A56B38 /* KuWeiCell.xib */; }; E0B6036F244D376900A56B38 /* KuWeiCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0B6036D244D376900A56B38 /* KuWeiCell.xib */; };
E0B9461E24566B3100FBEC9A /* TitleAndTFAndBtnCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B9461C24566B3100FBEC9A /* TitleAndTFAndBtnCell.swift */; }; E0B9461E24566B3100FBEC9A /* TitleAndTFAndBtnCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B9461C24566B3100FBEC9A /* TitleAndTFAndBtnCell.swift */; };
...@@ -677,7 +679,9 @@ ...@@ -677,7 +679,9 @@
E0A75489244A8F0F00A84B67 /* CheckWareHourseViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CheckWareHourseViewController.xib; sourceTree = "<group>"; }; E0A75489244A8F0F00A84B67 /* CheckWareHourseViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CheckWareHourseViewController.xib; sourceTree = "<group>"; };
E0B5307C247266F400FFCC15 /* DKXDAdrCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DKXDAdrCell.swift; sourceTree = "<group>"; }; E0B5307C247266F400FFCC15 /* DKXDAdrCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DKXDAdrCell.swift; sourceTree = "<group>"; };
E0B5307D247266F400FFCC15 /* DKXDAdrCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DKXDAdrCell.xib; sourceTree = "<group>"; }; E0B5307D247266F400FFCC15 /* DKXDAdrCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DKXDAdrCell.xib; sourceTree = "<group>"; };
E0B5308024727ED600FFCC15 /* WareHourseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WareHourseModel.swift; sourceTree = "<group>"; }; E0B5308324728D7E00FFCC15 /* ShopWarehouseListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopWarehouseListModel.swift; sourceTree = "<group>"; };
E0B5308524728FB600FFCC15 /* WarehouseInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WarehouseInterface.swift; sourceTree = "<group>"; };
E0B530872472917F00FFCC15 /* ShopWarehouseDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopWarehouseDetailModel.swift; sourceTree = "<group>"; };
E0B6036C244D376900A56B38 /* KuWeiCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KuWeiCell.swift; sourceTree = "<group>"; }; E0B6036C244D376900A56B38 /* KuWeiCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KuWeiCell.swift; sourceTree = "<group>"; };
E0B6036D244D376900A56B38 /* KuWeiCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KuWeiCell.xib; sourceTree = "<group>"; }; E0B6036D244D376900A56B38 /* KuWeiCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KuWeiCell.xib; sourceTree = "<group>"; };
E0B9461C24566B3100FBEC9A /* TitleAndTFAndBtnCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleAndTFAndBtnCell.swift; sourceTree = "<group>"; }; E0B9461C24566B3100FBEC9A /* TitleAndTFAndBtnCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleAndTFAndBtnCell.swift; sourceTree = "<group>"; };
...@@ -1465,10 +1469,12 @@ ...@@ -1465,10 +1469,12 @@
E09B03A92445B09200211A51 /* Model */ = { E09B03A92445B09200211A51 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E0B5308224728D5600FFCC15 /* WarehouseManageModel */,
F956D5BE246A3649003FF510 /* OrderManageModel */, F956D5BE246A3649003FF510 /* OrderManageModel */,
F956D5BD246A3629003FF510 /* PersonCenterModel */, F956D5BD246A3629003FF510 /* PersonCenterModel */,
F956D5BC246A35DB003FF510 /* GoodsManageMoel */, F956D5BC246A35DB003FF510 /* GoodsManageMoel */,
F9171EFB245128B200359C2B /* Interface.swift */, F9171EFB245128B200359C2B /* Interface.swift */,
E0B5308524728FB600FFCC15 /* WarehouseInterface.swift */,
F956D5BA246A359C003FF510 /* GoodsInterface.swift */, F956D5BA246A359C003FF510 /* GoodsInterface.swift */,
F956D5B8246A33E2003FF510 /* OrderInterface.swift */, F956D5B8246A33E2003FF510 /* OrderInterface.swift */,
E09B03AA2445B0A300211A51 /* LoginModel.swift */, E09B03AA2445B0A300211A51 /* LoginModel.swift */,
...@@ -1661,11 +1667,19 @@ ...@@ -1661,11 +1667,19 @@
children = ( children = (
E0A75488244A8F0F00A84B67 /* CheckWareHourseViewController.swift */, E0A75488244A8F0F00A84B67 /* CheckWareHourseViewController.swift */,
E0A75489244A8F0F00A84B67 /* CheckWareHourseViewController.xib */, E0A75489244A8F0F00A84B67 /* CheckWareHourseViewController.xib */,
E0B5308024727ED600FFCC15 /* WareHourseModel.swift */,
); );
path = "新增、编辑(查看)仓库"; path = "新增、编辑(查看)仓库";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
E0B5308224728D5600FFCC15 /* WarehouseManageModel */ = {
isa = PBXGroup;
children = (
E0B5308324728D7E00FFCC15 /* ShopWarehouseListModel.swift */,
E0B530872472917F00FFCC15 /* ShopWarehouseDetailModel.swift */,
);
path = WarehouseManageModel;
sourceTree = "<group>";
};
E0B94620245671AD00FBEC9A /* 代客下单(购物) */ = { E0B94620245671AD00FBEC9A /* 代客下单(购物) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -2742,6 +2756,7 @@ ...@@ -2742,6 +2756,7 @@
F961D27724503F51007FBE70 /* OrderSelectMoreView.swift in Sources */, F961D27724503F51007FBE70 /* OrderSelectMoreView.swift in Sources */,
F933F6C62452C68B00189561 /* PKHUDAssets.swift in Sources */, F933F6C62452C68B00189561 /* PKHUDAssets.swift in Sources */,
F95D9B522448530E0080D6E3 /* GeliAlertView.swift in Sources */, F95D9B522448530E0080D6E3 /* GeliAlertView.swift in Sources */,
E0B5308624728FB600FFCC15 /* WarehouseInterface.swift in Sources */,
E02FD9EC2455627300E10E27 /* ChuKuViewController.swift in Sources */, E02FD9EC2455627300E10E27 /* ChuKuViewController.swift in Sources */,
E07B1E6F245929060055BA3C /* GYSGLViewController.swift in Sources */, E07B1E6F245929060055BA3C /* GYSGLViewController.swift in Sources */,
E0D197BB2448431C002B080C /* BabyCallback.m in Sources */, E0D197BB2448431C002B080C /* BabyCallback.m in Sources */,
...@@ -2760,6 +2775,7 @@ ...@@ -2760,6 +2775,7 @@
E0C4F4A7244EC82A00CC7E2F /* TitleAndBtnCell.swift in Sources */, E0C4F4A7244EC82A00CC7E2F /* TitleAndBtnCell.swift in Sources */,
E0A2E81A24552E3C00D6DB34 /* XinZengPinPaiViewController.swift in Sources */, E0A2E81A24552E3C00D6DB34 /* XinZengPinPaiViewController.swift in Sources */,
F956D5A8246A2D9C003FF510 /* LMNSpecialLine.m in Sources */, F956D5A8246A2D9C003FF510 /* LMNSpecialLine.m in Sources */,
E0B530882472917F00FFCC15 /* ShopWarehouseDetailModel.swift in Sources */,
E0273DDD24551D4500B3FCAE /* OnlyLabelCell.swift in Sources */, E0273DDD24551D4500B3FCAE /* OnlyLabelCell.swift in Sources */,
F950FDD724518B9500C40530 /* FSCalendarCollectionView.m in Sources */, F950FDD724518B9500C40530 /* FSCalendarCollectionView.m in Sources */,
E02C88262456B24F00925766 /* WuLiuGenZongViewController.swift in Sources */, E02C88262456B24F00925766 /* WuLiuGenZongViewController.swift in Sources */,
...@@ -2828,6 +2844,7 @@ ...@@ -2828,6 +2844,7 @@
E0337EF12464F69000952EF4 /* YingFuZKListViewController.swift in Sources */, E0337EF12464F69000952EF4 /* YingFuZKListViewController.swift in Sources */,
E099B588246BF8FA009F587F /* OrderDViewController.swift in Sources */, E099B588246BF8FA009F587F /* OrderDViewController.swift in Sources */,
F933F6CE2452C68B00189561 /* PKHUDSquareBaseView.swift in Sources */, F933F6CE2452C68B00189561 /* PKHUDSquareBaseView.swift in Sources */,
E0B5308424728D7E00FFCC15 /* ShopWarehouseListModel.swift in Sources */,
E06524F524580BB600CA22E2 /* BaoZhiQiCell.swift in Sources */, E06524F524580BB600CA22E2 /* BaoZhiQiCell.swift in Sources */,
E0BE8AA4245AA31400E80134 /* YingFuZhangKuanXQViewController.swift in Sources */, E0BE8AA4245AA31400E80134 /* YingFuZhangKuanXQViewController.swift in Sources */,
F94A315324626D7800FEC38E /* WorkCViewController.swift in Sources */, F94A315324626D7800FEC38E /* WorkCViewController.swift in Sources */,
...@@ -2852,7 +2869,6 @@ ...@@ -2852,7 +2869,6 @@
F956D5B5246A2D9C003FF510 /* LMNStore.m in Sources */, F956D5B5246A2D9C003FF510 /* LMNStore.m in Sources */,
F956D5A7246A2D9C003FF510 /* LMNLineChain+Numbering.m in Sources */, F956D5A7246A2D9C003FF510 /* LMNLineChain+Numbering.m in Sources */,
E0A7548A244A8F0F00A84B67 /* CheckWareHourseViewController.swift in Sources */, E0A7548A244A8F0F00A84B67 /* CheckWareHourseViewController.swift in Sources */,
E0B5308124727ED600FFCC15 /* WareHourseModel.swift in Sources */,
F9023F62244999F500DD5A63 /* WarehoseMangementCell.swift in Sources */, F9023F62244999F500DD5A63 /* WarehoseMangementCell.swift in Sources */,
F956D5B1246A2D9C003FF510 /* LMNFolder.m in Sources */, F956D5B1246A2D9C003FF510 /* LMNFolder.m in Sources */,
E0A409D424640B8300CFF109 /* DZGLViewController.swift in Sources */, E0A409D424640B8300CFF109 /* DZGLViewController.swift in Sources */,
......
...@@ -24,5 +24,21 @@ ...@@ -24,5 +24,21 @@
continueAfterRunningActions = "No"> continueAfterRunningActions = "No">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B223F50A-4F5B-423B-9F6D-A967E5BFB36E"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "GeliBusinessPlatform/ViewController/&#x65b0;&#x589e;&#x89c4;&#x683c;/CreatNewSpecsViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "575"
endingLineNumber = "575"
landmarkName = "YuShouCellSwitchStatus(sender:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
<string>Common/sendSmsCaptcha</string> <string>Common/sendSmsCaptcha</string>
<key>验证短信验证码</key> <key>验证短信验证码</key>
<string>Common/verifyMmsCaptcha</string> <string>Common/verifyMmsCaptcha</string>
<key>简单通用操作接口 <key>简单通用操作接口</key>
</key>
<string>Common/editField</string> <string>Common/editField</string>
<key>图片(文件)上传</key> <key>图片(文件)上传</key>
<string>Common/saveFile</string> <string>Common/saveFile</string>
...@@ -73,5 +72,15 @@ ...@@ -73,5 +72,15 @@
<string>Customer/cusListAll</string> <string>Customer/cusListAll</string>
<key>获取商品信息</key> <key>获取商品信息</key>
<string>Adminorder/getGoodsInfo</string> <string>Adminorder/getGoodsInfo</string>
<key>商家仓库列表</key>
<string>Warehouse/shopWarehouseList</string>
<key>商家仓库添加</key>
<string>Warehouse/shopWarehouseAdd</string>
<key>商家仓库修改</key>
<string>Warehouse/shopWarehouseEdit</string>
<key>商家仓库删除</key>
<string>Warehouse/shopWarehouseDel</string>
<key>商家仓库详情</key>
<string>Warehouse/shopWarehouseDetail</string>
</dict> </dict>
</plist> </plist>
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
import Foundation import Foundation
import ObjectMapper import ObjectMapper
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态) //发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除
class UpDataModel: Mappable { class UpDataModel: Mappable {
var code:Int? var code:Int?
var message : String? var message : String?
......
//
// WarehouseInterface.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/18.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
import Alamofire
import SwiftyJSON
import ObjectMapper
//MARK: --商家仓库列表
/**
params-key:
user_token(验证token)
keyword(关键字)
page(第几页)
*/
func warehouseList(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) { NetworkRequest.sharedInstance.postRequest("商家仓库列表", params, { (rep:DataResponse<ShopWarehouseListModel>) in
}, success: { (data) in
success(data)
}) { (error) in
}
}
//MARK: -- 商家详情
/**
params-key:
user_token(验证token)
w_id(仓库id)
*/
func WarehouseDetail(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("商家仓库详情", params, { (rep:DataResponse<ShopWarehouseDetailDataModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
//MRAK: - 商家仓库添加
//params-key
/*
user_token
w_name 仓库名称
w_type 仓库类型,1常温、2冷藏、3冷冻
position_str 库位名,多库位用逗号拼接
w_address 仓库地址
volume 仓库容积
area 仓库面积
contact 联系人
contact_number 联系电话
mail 邮箱
is_default 是否默认,1是0非
*/
func ShopWarehouseAdd(_ 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)
}
}
//MRAK: - 商家仓库修改
//params-key
/*
user_token
w_name 仓库名称
w_type 仓库类型,1常温、2冷藏、3冷冻
position_str 库位名,多库位用逗号拼接
w_address 仓库地址
volume 仓库容积
area 仓库面积
contact 联系人
contact_number 联系电话
mail 邮箱
is_default 是否默认,1是0非
warehouse_position 仓库库位信息,必须要有一个库位json字符串,字段见下表
*/
func ShopWarehouseEdit(_ 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)
}
}
//MRAK: - 商家仓库删除
//params-key
/*
user_token
w_id 仓库id,仓库中有库存则不可删除
*/
func ShopWarehouseDel(_ 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)
}
}
//
// ShopWarehouseDetail.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/18.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
import ObjectMapper
class ShopWarehouseDetailModel: Mappable {
var code:Int?
var message : String?
var data : ShopWarehouseDetailDataModel?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class ShopWarehouseDetailDataModel: Mappable {
var warehouse_res : ShopWarehouseDetailDataBasicModel? //仓库基本信息
var position_res : Array<ShopWarehouseDetailDataPositionModel>? //库存总数商店id
required init?( map: Map) {
}
func mapping(map: Map) {
warehouse_res <- map["warehouse_res"]
position_res <- map["position_res"]
}
}
class ShopWarehouseDetailDataBasicModel: Mappable {
var w_id : Int? //仓库id
var shop_id :Int?
var w_name:String?//仓库名
var w_type:Int? //仓库类型,1常温、2冷藏、3冷冻
var w_address:String?//地址
var volume:Int?//容积
var area:Int?//面积
var contact:String?//联系人
var contact_number:String?//联系电话
var mail:String?//电子邮箱
var position_count:Int?
var is_default:Int?//是否默认
var inventory_count:Int?//库存总数
required init?( map: Map) {
}
func mapping(map: Map) {
w_id <- map["w_id"]
shop_id <- map["shop_id"]
w_name <- map["w_name"]
w_type <- map["w_type"]
w_address <- map["w_address"]
volume <- map["volume"]
area <- map["area"]
contact <- map["contact"]
contact_number <- map["contact_number"]
mail <- map["mail"]
position_count <- map["position_count"]
is_default <- map["is_default"]
inventory_count <- map["inventory_count"]
}
}
class ShopWarehouseDetailDataPositionModel: Mappable {
var p_id :Int?//库位id
var w_id :Int?//仓库id
var p_name:String?//库位名
var is_default:Int?//是否默认
var inventory_count:Int?//库存数
var status = 1//状态
required init?( map: Map) {
}
func mapping(map: Map) {
p_id <- map["p_id"]
w_id <- map["w_id"]
p_name <- map["p_name"]
is_default <- map["is_default"]
inventory_count <- map["inventory_count"]
status <- map["status"]
}
}
//
// shopWarehouseListModel.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/18.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
import ObjectMapper
//仓库列表
class ShopWarehouseListModel: Mappable {
var code:Int?
var message : String?
var data : Array<ShopWarehouseListDataModel>?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class ShopWarehouseListDataModel: Mappable {
var w_id : Int? //库存总数仓库id
var shop_id : Int? //库存总数商店id
var w_name : String? //库存总数仓库名
var w_type : Int? //库存总数仓库类型,1常温、2冷藏、3冷冻
var w_address : String? //库存总数仓库地址
var volume : Int? //容积,库存总数单位立方米
var area : Int? //面积,库存总数单位平方米
var contact : String? //库存总数联系人
var contact_number : String? //库存总数联系电话
var mail : String? //库存总数电子邮箱
var position_count : Int? //库存总数库位数量(统计用)
var is_default : Bool? //库存总数是否为默认
var inventory_count : Int? //库存总数
required init?( map: Map) {
}
func mapping(map: Map) {
w_id <- map["w_id"]
shop_id <- map["shop_id"]
w_name <- map["w_name"]
w_type <- map["w_type"]
w_address <- map["w_address"]
volume <- map["volume"]
area <- map["area"]
contact <- map["contact"]
contact_number <- map["contact_number"]
mail <- map["mail"]
position_count <- map["position_count"]
is_default <- map["is_default"]
inventory_count <- map["inventory_count"]
}
}
...@@ -43,14 +43,15 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg ...@@ -43,14 +43,15 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
//MARK:--loginVC //MARK:--loginVC
func addLoginVc (isAgain:Bool){ func addLoginVc (isAgain:Bool){
let vc = LoginViewController() // let vc = LoginViewController()
vc.delegate = self // vc.delegate = self
let contentView = vc // let contentView = vc
//
// let vc = ProductDetailViewController()
// let contentView = vc let vc = ProductDetailViewController()
//
let contentView = vc
if let windowScene = sceneC as? UIWindowScene { if let windowScene = sceneC as? UIWindowScene {
...@@ -98,7 +99,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg ...@@ -98,7 +99,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
tabBarController.viewControllers = [v1, v2, v3, v4, v5] tabBarController.viewControllers = [v1, v2, v3, v4, v5]
tabBarController.selectedIndex = 1 tabBarController.selectedIndex = 1
let contentView = tabBarController let contentView = tabBarController
if let windowScene = sceneC as? UIWindowScene { if let windowScene = sceneC as? UIWindowScene {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="库存位" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bj5-q9-e71"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="库存位" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bj5-q9-e71">
<rect key="frame" x="15" y="40" width="250" height="14"/> <rect key="frame" x="15" y="40" width="34" height="14"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/> <fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" name="灰色字体颜色"/> <color key="textColor" name="灰色字体颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<constraint firstItem="S67-Hn-Sjn" firstAttribute="centerY" secondItem="zy2-GT-oMd" secondAttribute="centerY" id="Ip0-ct-MLf"/> <constraint firstItem="S67-Hn-Sjn" firstAttribute="centerY" secondItem="zy2-GT-oMd" secondAttribute="centerY" id="Ip0-ct-MLf"/>
<constraint firstAttribute="trailing" secondItem="KhW-Le-FMh" secondAttribute="trailing" id="KHe-n3-k0i"/> <constraint firstAttribute="trailing" secondItem="KhW-Le-FMh" secondAttribute="trailing" id="KHe-n3-k0i"/>
<constraint firstAttribute="trailing" secondItem="TPl-73-La4" secondAttribute="trailing" constant="15" id="NbF-Ti-tGJ"/> <constraint firstAttribute="trailing" secondItem="TPl-73-La4" secondAttribute="trailing" constant="15" id="NbF-Ti-tGJ"/>
<constraint firstAttribute="trailing" secondItem="bj5-q9-e71" secondAttribute="trailing" constant="55" id="ONy-wx-sWh"/> <constraint firstItem="bj5-q9-e71" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Rbn-Eo-Tkr"/>
<constraint firstItem="zy2-GT-oMd" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="TbK-iY-ppo"> <constraint firstItem="zy2-GT-oMd" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="TbK-iY-ppo">
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/> <userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/> <userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</constraint> </constraint>
<constraint firstItem="voP-B3-BGZ" firstAttribute="top" secondItem="bj5-q9-e71" secondAttribute="bottom" constant="10" id="WS7-0G-3Zw"/>
<constraint firstItem="zy2-GT-oMd" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="abd-R7-H83"> <constraint firstItem="zy2-GT-oMd" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="abd-R7-H83">
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/> <userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
...@@ -111,11 +110,6 @@ ...@@ -111,11 +110,6 @@
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/> <userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</constraint> </constraint>
<constraint firstItem="bj5-q9-e71" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="ft0-TZ-hKh">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
</constraint>
<constraint firstAttribute="trailing" secondItem="voP-B3-BGZ" secondAttribute="trailing" constant="30" id="gbP-D6-WcB"/> <constraint firstAttribute="trailing" secondItem="voP-B3-BGZ" secondAttribute="trailing" constant="30" id="gbP-D6-WcB"/>
<constraint firstItem="TPl-73-La4" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="lmY-7S-KxB"/> <constraint firstItem="TPl-73-La4" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="lmY-7S-KxB"/>
<constraint firstItem="KhW-Le-FMh" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="mM8-35-q0k"> <constraint firstItem="KhW-Le-FMh" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="mM8-35-q0k">
...@@ -123,6 +117,7 @@ ...@@ -123,6 +117,7 @@
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/> <userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</constraint> </constraint>
<constraint firstItem="bj5-q9-e71" firstAttribute="centerY" secondItem="TPl-73-La4" secondAttribute="centerY" id="r32-31-ctS"/>
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
......
...@@ -16,13 +16,13 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -16,13 +16,13 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
tableV.reloadData() tableV.reloadData()
} }
func CheckWareHourseViewControllerEditAction(data: WareHourseModel, Idx: Int) { func CheckWareHourseViewControllerEditAction(data: ShopWarehouseListDataModel, Idx: Int) {
warehourseArr.insert(data, at: Idx) warehourseArr.insert(data, at: Idx)
warehourseArr.remove(at: Idx+1) warehourseArr.remove(at: Idx+1)
tableV.reloadData() tableV.reloadData()
} }
func CheckWareHourseViewControllerSaveAction(data: WareHourseModel) { func CheckWareHourseViewControllerSaveAction(data: ShopWarehouseListDataModel) {
warehourseArr.append(data) warehourseArr.append(data)
tableV.reloadData() tableV.reloadData()
} }
...@@ -30,8 +30,9 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -30,8 +30,9 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
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!
var page : Int = 0
var isUpData = false
var keyWord = ""
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.view.backgroundColor = UIColor.white self.view.backgroundColor = UIColor.white
...@@ -49,8 +50,57 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -49,8 +50,57 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
searchBr.cornerRadius = 35/2.0 searchBr.cornerRadius = 35/2.0
searchBr.delegate = self searchBr.delegate = self
setTabv() setTabv()
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
self.tableV!.mj_header = headerMJ
//上拉加载相关设置
footerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadMoreData))
self.tableV!.mj_footer = footerMJ
self.tableV?.mj_header?.beginRefreshing()
}
@objc func loadData(){
print("加载数据")
isUpData = true
page = 1
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let dict = ["user_token":UserToken as Any,"keyword":keyWord,"page":page]
warehouseList(dict, success: { (data) in
self.warehourseArr.removeAll()
let dataModel = data as! ShopWarehouseListModel
dataModel.data?.forEach({ (model) in
self.warehourseArr.append(model)
})
self.tableV.reloadData()
self.tableV?.mj_header?.endRefreshing()
self.page = 2
self.tableV.performBatchUpdates({
UIView.animate(views: self.tableV!.visibleCells,
animations: self.animations, completion: {
})
}, completion: nil)
}) { (error) in
self.tableV?.mj_header?.endRefreshing()
}
}
@objc func loadMoreData(){
print("加载更多数据")
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let dict = ["user_token":UserToken as Any,"keyword":keyWord,"page":page]
warehouseList(dict, success: { (data) in
self.page += 1
let dataModel = data as! ShopWarehouseListModel
dataModel.data?.forEach({ (model) in
self.warehourseArr.append(model)
})
self.tableV.reloadData()
self.tableV?.mj_header?.endRefreshing()
}) { (error) in
self.tableV?.mj_header?.endRefreshing()
}
} }
//MARK:--搜索按钮代理 //MARK:--搜索按钮代理
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--") print("点击搜索进行--")
...@@ -111,13 +161,13 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -111,13 +161,13 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
self.navigationController?.pushViewController(vc, animated: false) self.navigationController?.pushViewController(vc, animated: false)
} }
var warehourseArr:Array<WareHourseModel> = []//仓库数组 var warehourseArr:Array<ShopWarehouseListDataModel> = []//仓库数组
var tableV :UITableView! var tableV :UITableView!
var tableSearchV :UITableView! = nil var tableSearchV :UITableView! = nil
private let animations = [AnimationType.from(direction: .bottom, offset: 150*glscale)] private let animations = [AnimationType.from(direction: .bottom, offset: 150*glscale)]
func setTabv() { func setTabv() {
tableV = UITableView() tableV = UITableView()
contentView.addSubview(tableV); contentView.addSubview(tableV);
...@@ -136,15 +186,15 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -136,15 +186,15 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
}, completion: nil) }, completion: nil)
} }
let typeArr = ["冷冻","冷藏","常温"] let typeArr = ["常温","冷藏","冷冻"]
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "WarehoseMangementCell") as! WarehoseMangementCell let cell = tableView.dequeueReusableCell(withIdentifier: "WarehoseMangementCell") as! WarehoseMangementCell
cell.delegate = self cell.delegate = self
let model = warehourseArr[indexPath.row] let model = warehourseArr[indexPath.row]
cell.nameLbl.text = model.cangKuName cell.nameLbl.text = model.w_name
cell.statusLbl.text = typeArr[model.warehourseType!] cell.statusLbl.text = typeArr[model.w_type!-1]
cell.adrLbl.text = model.cangKuAdr cell.adrLbl.text = model.w_address!
cell.kuCunLbl.text = model.kuWeiName cell.kuCunLbl.text = "\(model.inventory_count!)"
return cell return cell
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
...@@ -152,7 +202,8 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -152,7 +202,8 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
let vc = CheckWareHourseViewController() let vc = CheckWareHourseViewController()
vc.delegate = self vc.delegate = self
vc.titleStr = "编辑仓库" vc.titleStr = "编辑仓库"
vc.dataModel = warehourseArr[indexPath.row] let model = warehourseArr[indexPath.row]
vc.w_id = model.w_id
vc.editIdx = indexPath.row vc.editIdx = indexPath.row
self.navigationController?.pushViewController(vc, animated: false) self.navigationController?.pushViewController(vc, animated: false)
...@@ -185,9 +236,9 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -185,9 +236,9 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
return [deleteAction,] return [deleteAction,]
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == tableSearchV { if tableView == tableSearchV {
return 3 return 3
} }
return warehourseArr.count return warehourseArr.count
} }
} }
...@@ -657,7 +657,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -657,7 +657,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
vc.barTitle = "编辑规格" vc.barTitle = "编辑规格"
vc.datasArr = guiGeArr vc.datasArr = guiGeArr
vc.danWeiArr = generalInfoModel?.data?.unit! vc.danWeiArr = generalInfoModel?.data?.unit!
vc.isJieTiJiaSetting = true
let dataDict:GuiGeModel! let dataDict:GuiGeModel!
if selectIdx?.item != nil { if selectIdx?.item != nil {
dataDict = guiGeArr[selectIdx!.item] dataDict = guiGeArr[selectIdx!.item]
...@@ -670,16 +670,18 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -670,16 +670,18 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
vc.weight = dataDict.weight vc.weight = dataDict.weight
vc.wenDu = dataDict.wenDu vc.wenDu = dataDict.wenDu
vc.danWei = dataDict.danWei vc.danWei = dataDict.danWei
print("test == ",isYuShouShangPin!) vc.isJieTiOpen = dataDict.isJieTiOpen
// vc.isNonYuShou = isYuShouShangPin!
vc.isYuShouSetting = isYuShouShangPin! vc.isYuShouSetting = isYuShouShangPin!
vc.yuShouPrice = dataDict.yuShouPrice vc.yuShouPrice = dataDict.yuShouPrice
vc.specalArr = dataDict.specalArr vc.specalArr = dataDict.specalArr
vc.jieTiArr = dataDict.jieTiArr vc.jieTiArr = dataDict.jieTiArr
vc.isOpenYSSetting = dataDict.isOpenYSSetting
vc.selectIdx = selectIdx vc.selectIdx = selectIdx
vc.itemDanWeiSelect = dataDict.itemDanWeiSelect vc.itemDanWeiSelect = dataDict.itemDanWeiSelect
vc.tempSelect = dataDict.tempSelect vc.tempSelect = dataDict.tempSelect
vc.delegate = self vc.delegate = self
vc.DJBiLi = dataDict.DJBiLi
vc.ysKuCun = dataDict.ysKuCun
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
// //MARK: - 删除规格 // //MARK: - 删除规格
......
...@@ -11,30 +11,18 @@ import LGButton ...@@ -11,30 +11,18 @@ import LGButton
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
protocol CheckWareHourseViewControllerDelegate { protocol CheckWareHourseViewControllerDelegate {
func CheckWareHourseViewControllerSaveAction(data:WareHourseModel) func CheckWareHourseViewControllerSaveAction(data:ShopWarehouseListDataModel)
func CheckWareHourseViewControllerEditAction(data:WareHourseModel,Idx:Int) func CheckWareHourseViewControllerEditAction(data:ShopWarehouseListDataModel,Idx:Int)
func CheckWareHourseViewControllerDelAction(Idx:Int) func CheckWareHourseViewControllerDelAction(Idx:Int)
} }
class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,WareHouseSpCellDelegate,GLAlertSelectViewDelegate,UITextFieldDelegate{ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,WareHouseSpCellDelegate,GLAlertSelectViewDelegate,UITextFieldDelegate,GeliAlertViewDelegate{
var delegate:CheckWareHourseViewControllerDelegate? var delegate:CheckWareHourseViewControllerDelegate?
var dataModel = WareHourseModel(){ var dataModel:ShopWarehouseListDataModel?
didSet{ var w_id:Int?//仓库id
shiFouMoRen = dataModel.shiFouMoRen
lianXiRen = dataModel.lianXiRen
mianJi = dataModel.mianJi
rongJi = dataModel.rongJi
phone = dataModel.phone
cangKuAdr = dataModel.cangKuAdr
cangKuName = dataModel.cangKuName
kuWeiName = dataModel.kuWeiName
warehourseType = dataModel.warehourseType
kuWeiSelect = dataModel.kuWeiSelect
}
}
var editIdx:Int? var editIdx:Int?
@IBOutlet weak var btnTitleLbl: UILabel! @IBOutlet weak var btnTitleLbl: UILabel!
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
...@@ -44,7 +32,7 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -44,7 +32,7 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa
var kuWeiArr:Array<Any>? = [] var kuWeiArr:Array<Any>? = []
var listArray = ["冷冻","冷藏","常温"] var listArray = ["常温","冷藏","冷冻"]
var glSelectView:GLAlertSelectView? var glSelectView:GLAlertSelectView?
var btnArray:Array<UIButton> = [] var btnArray:Array<UIButton> = []
var statusStr = "" var statusStr = ""
...@@ -79,8 +67,45 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -79,8 +67,45 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa
make.left.right.equalTo(0) make.left.right.equalTo(0)
make.bottom.equalTo(btnTitleLbl.snp_top) make.bottom.equalTo(btnTitleLbl.snp_top)
} }
loadData()
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
func loadData(){
//加载数据
if w_id != nil {
let UserToken = UserDefaults.standard.value(forKey: "user_token")
WarehouseDetail(["user_token":UserToken as Any,"w_id":w_id as Any], success: { (data) in
let dataModel = data as! ShopWarehouseDetailDataModel
print(dataModel.warehouse_res?.area)
// self.shiFouMoRen = false
// print(dataModel.warehouse_res!.is_default)
//// if dataModel.warehouse_res!.is_default! == 1 {
//// self.shiFouMoRen = true
//// }
//
//
//
// self.lianXiRen = dataModel.warehouse_res!.contact!
// self.mianJi = "\(dataModel.warehouse_res!.area!)"
// self.rongJi = "\(dataModel.warehouse_res!.volume!)"
// self.phone = dataModel.warehouse_res!.contact_number!
// let strArr = NSMutableArray()
// for item in dataModel.position_res! {
// strArr.add(item.p_name!)
// }
// self.kuWeiName = strArr.componentsJoined(by: ",")
// self.cangKuAdr = dataModel.warehouse_res!.w_address!
// self.cangKuName = dataModel.warehouse_res!.w_name!
// self.warehourseType = dataModel.warehouse_res!.w_type!
// self.listView.reloadData()
}) { (error) in
}
}
}
//MARK: - cell delegate //MARK: - cell delegate
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
...@@ -131,6 +156,7 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -131,6 +156,7 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa
//cell ui 布局 //cell ui 布局
self.setCellLayout(cell: cell, indexPath: indexPath) self.setCellLayout(cell: cell, indexPath: indexPath)
}else{//默认仓库 }else{//默认仓库
cell.titleLbl.text = "默认仓库"
if btnTitleLbl.text == "编辑"{ if btnTitleLbl.text == "编辑"{
cell.whSwitch.isUserInteractionEnabled = false cell.whSwitch.isUserInteractionEnabled = false
}else{ }else{
...@@ -184,31 +210,31 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -184,31 +210,31 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa
} }
} }
@IBAction func submitAction(_ sender: LGButton) { @IBAction func submitAction(_ sender: LGButton) {
dataModel.shiFouMoRen = shiFouMoRen // dataModel.shiFouMoRen = shiFouMoRen
pdContent(sender: cangKuName, str: "请填写仓库名称") // pdContent(sender: cangKuName, str: "请填写仓库名称")
dataModel.cangKuName = cangKuName // dataModel.cangKuName = cangKuName
pdSelect(select: warehourseType, str: "请选择仓库类型") // pdSelect(select: warehourseType, str: "请选择仓库类型")
dataModel.warehourseType = warehourseType // dataModel.warehourseType = warehourseType
pdContent(sender: kuWeiName, str: "请选择库位") // pdContent(sender: kuWeiName, str: "请选择库位")
dataModel.kuWeiName = kuWeiName // dataModel.kuWeiName = kuWeiName
pdContent(sender: cangKuAdr, str: "请填写仓库地址") // pdContent(sender: cangKuAdr, str: "请填写仓库地址")
dataModel.cangKuAdr = cangKuAdr // dataModel.cangKuAdr = cangKuAdr
pdContent(sender: rongJi, str: "请填写仓库容积") // pdContent(sender: rongJi, str: "请填写仓库容积")
dataModel.rongJi = rongJi // dataModel.rongJi = rongJi
pdContent(sender: mianJi, str: "请填写仓库面积") // pdContent(sender: mianJi, str: "请填写仓库面积")
dataModel.mianJi = mianJi // dataModel.mianJi = mianJi
pdContent(sender: lianXiRen, str: "请填写联系人") // pdContent(sender: lianXiRen, str: "请填写联系人")
dataModel.lianXiRen = lianXiRen // dataModel.lianXiRen = lianXiRen
pdContent(sender: phone, str: "请填写联系人电话") // pdContent(sender: phone, str: "请填写联系人电话")
dataModel.phone = phone // dataModel.phone = phone
//
dataModel.kuWeiSelect = kuWeiSelect // dataModel.kuWeiSelect = kuWeiSelect
if titleStr == "新增仓库" { if titleStr == "新增仓库" {
delegate?.CheckWareHourseViewControllerSaveAction(data: dataModel) // delegate?.CheckWareHourseViewControllerSaveAction(data: dataModel)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
}else{ }else{
if btnTitleLbl.text == "保存" { if btnTitleLbl.text == "保存" {
delegate?.CheckWareHourseViewControllerEditAction(data: dataModel, Idx: editIdx!) // delegate?.CheckWareHourseViewControllerEditAction(data: dataModel, Idx: editIdx!)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
}else{ }else{
btnTitleLbl.text = "保存" btnTitleLbl.text = "保存"
...@@ -246,10 +272,18 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -246,10 +272,18 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa
//MARK: - delegate //MARK: - delegate
func rightBtnClick() { func rightBtnClick() {
print("删除") print("删除")
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)
}
func sureAction(sender: UIButton) {
delegate?.CheckWareHourseViewControllerDelAction(Idx: editIdx!) delegate?.CheckWareHourseViewControllerDelAction(Idx: editIdx!)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
} }
@objc func removeActin(sender:UIButton){ @objc func removeActin(sender:UIButton){
sender.superview?.removeFromSuperview() sender.superview?.removeFromSuperview()
......
//
// WareHourseModel.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/18.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
class WareHourseModel: NSObject {
///仓库类型
var warehourseType : Int?
///仓库名称
var cangKuName : String = ""
///库位名
var kuWeiName : String = ""
///仓库地址
var cangKuAdr : String = ""
///容积
var rongJi : String = ""
///面积
var mianJi : String = ""
///联系人
var lianXiRen : String = ""
///电话
var phone :String = ""
///是否默认
var shiFouMoRen : Bool = false
///库位选择
var kuWeiSelect:Int?
}
...@@ -27,7 +27,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -27,7 +27,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
view.removeFromSuperview() view.removeFromSuperview()
selectView = nil selectView = nil
} }
var ysKuCun:String = ""//预售库存
var DJBiLi:String = ""//定金比例
var yuShouPrice:String = ""//预售价格
var layout = UICollectionViewFlowLayout() var layout = UICollectionViewFlowLayout()
var delegate:CreatNewSpecsViewControllerDelegate? var delegate:CreatNewSpecsViewControllerDelegate?
var collectView:UICollectionView? var collectView:UICollectionView?
...@@ -39,13 +41,11 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -39,13 +41,11 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
@IBOutlet weak var listTbv: UITableView! @IBOutlet weak var listTbv: UITableView!
var selectIdx:IndexPath? var selectIdx:IndexPath?
var isYuShouSetting = false//打开预售 var isYuShouSetting = false//打开预售
var isJieTiJiaSetting = false // var isJieTiJiaSetting = false
var isJieTiOpen = false//控制阶梯价是否打开
var isOpenYSSetting = false//是否打开预售设置
var selectYuShou:Bool = false//是否选择设置预售价格 var selectYuShou:Bool = false//是否选择设置预售价格
// var isNonYuShou:Bool = false //是否选择预售价格
var yuShouPrice:String = ""//预售设置数据记录
//选择页面 //选择页面
var selectView:GLAlertSelectView? = nil var selectView:GLAlertSelectView? = nil
var selectListArr:Array<String> = ["冷冻","冷藏","常温"] var selectListArr:Array<String> = ["冷冻","冷藏","常温"]
...@@ -123,6 +123,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -123,6 +123,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
@IBAction func saveAction(_ sender: Any) { @IBAction func saveAction(_ sender: Any) {
print("save") print("save")
print("open = ",isJieTiOpen)
// if price.count == 0 { // if price.count == 0 {
// HUD.flash(.label("请输入售价"), delay: 1.2) // HUD.flash(.label("请输入售价"), delay: 1.2)
// return // return
...@@ -174,7 +175,6 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -174,7 +175,6 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
// } // }
// } // }
// let dict = NSMutableDictionary()
dataModel.price = price dataModel.price = price
dataModel.guiGe = guiGe dataModel.guiGe = guiGe
dataModel.weight = weight dataModel.weight = weight
...@@ -182,11 +182,13 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -182,11 +182,13 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
dataModel.danWei = danWei dataModel.danWei = danWei
dataModel.jieTiArr = jieTiArr as! Array<Any> dataModel.jieTiArr = jieTiArr as! Array<Any>
dataModel.specalArr = specalArr as! Array<Any> dataModel.specalArr = specalArr as! Array<Any>
// dataModel.isNonYuShou = isNonYuShou
dataModel.isYuShouSetting = isYuShouSetting
dataModel.yuShouPrice = yuShouPrice dataModel.yuShouPrice = yuShouPrice
dataModel.itemDanWeiSelect = itemDanWeiSelect dataModel.itemDanWeiSelect = itemDanWeiSelect
dataModel.tempSelect = tempSelect dataModel.tempSelect = tempSelect
dataModel.isJieTiOpen = isJieTiOpen
dataModel.isOpenYSSetting = isOpenYSSetting
dataModel.DJBiLi = DJBiLi
dataModel.ysKuCun = ysKuCun
if barTitle?.contains("编辑") == true { if barTitle?.contains("编辑") == true {
datasArr.insert(dataModel, at: selectIdx!.item) datasArr.insert(dataModel, at: selectIdx!.item)
...@@ -196,7 +198,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -196,7 +198,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
datasArr.append(dataModel) datasArr.append(dataModel)
selectIdx?.item = datasArr.count - 1 selectIdx?.item = datasArr.count - 1
} }
delegate?.CreatNewSpecsViewControllerSaveAction(datas:datasArr,selectIdx:selectIdx!) delegate?.CreatNewSpecsViewControllerSaveAction(datas:datasArr,selectIdx:selectIdx!)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
} }
//MARK: - TEXTFIELD DELEGATE //MARK: - TEXTFIELD DELEGATE
...@@ -315,26 +317,26 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -315,26 +317,26 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
cell.namelbl.font = UIFont.boldSystemFont(ofSize: 15) cell.namelbl.font = UIFont.boldSystemFont(ofSize: 15)
if indexPath.section == 1{ if indexPath.section == 1{
cell.namelbl.text = "预售设置" cell.namelbl.text = "预售设置"
cell.infoSw.isOn = isYuShouSetting
cell.tag = 5
if isYuShouSetting == false{ if isYuShouSetting == false{
isOpenYSSetting = isYuShouSetting
cell.namelbl.alpha = 0.45 cell.namelbl.alpha = 0.45
cell.isUserInteractionEnabled = false cell.isUserInteractionEnabled = false
}else{
cell.infoSw.isOn = isOpenYSSetting
} }
cell.tag = 5
} }
if indexPath.section == 1 { if indexPath.section == 1 {
if isYuShouSetting == true { if isYuShouSetting == true {
let cell = tableView.dequeueReusableCell(withIdentifier: "YuShou") as! YuShouCell let cell = tableView.dequeueReusableCell(withIdentifier: "YuShou") as! YuShouCell
cell.tag = indexPath.row cell.tag = indexPath.row
cell.infoSw.isOn = isYuShouSetting cell.infoSw.isOn = isOpenYSSetting
cell.delegate = self cell.delegate = self
if yuShouPrice.count > 0 { cell.inputTF1.text = yuShouPrice
let arr = yuShouPrice.components(separatedBy: "_") cell.inputTF2.text = ysKuCun
cell.inputTF1.text = arr[0] cell.inputTF3.text = DJBiLi
cell.inputTF2.text = arr[1]
cell.inputTF3.text = arr[2]
}
return cell return cell
} }
} }
...@@ -384,12 +386,12 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -384,12 +386,12 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 1 { if indexPath.section == 1 {
if isYuShouSetting { if isOpenYSSetting {
return 184.5 return 184.5
} }
} }
if indexPath.section == 2 { if indexPath.section == 2 {
if isJieTiJiaSetting { if isJieTiOpen {
return 49 return 49
}else{ }else{
return 0.001 return 0.001
...@@ -404,9 +406,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -404,9 +406,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
if section == 2 {//阶梯价设置 if section == 2 {//阶梯价设置
let view = NewCreateHeader(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49)) let view = NewCreateHeader(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49))
view.delegate = self view.delegate = self
view.infoSw.isOn = isJieTiJiaSetting view.infoSw.isOn = isJieTiOpen
if isJieTiJiaSetting == false{ if isJieTiOpen == false{
return view return view
} }
...@@ -415,7 +417,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -415,7 +417,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
let view = TitleAndSwitchHeaderView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 90)) let view = TitleAndSwitchHeaderView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 90))
view.delegate = self view.delegate = self
view.selectYuShou = selectYuShou view.selectYuShou = selectYuShou
view.infoSW.isOn = isYuShouSetting view.infoSW.isOn = isJieTiOpen
return view return view
} }
return view return view
...@@ -425,7 +427,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -425,7 +427,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if section != 0 { if section != 0 {
if section == 2 { if section == 2 {
if isYuShouSetting && isJieTiJiaSetting { if isYuShouSetting && isJieTiOpen {
return 90 return 90
} }
return 59 return 59
...@@ -437,7 +439,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -437,7 +439,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
//footer //footer
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if section == 2 { if section == 2 {
if isJieTiJiaSetting { if isJieTiOpen {
let view = NewCreateFooter(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49)) let view = NewCreateFooter(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49))
view.delegate = self view.delegate = self
return view return view
...@@ -448,7 +450,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -448,7 +450,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
} }
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == 2 { if section == 2 {
if isJieTiJiaSetting { if isJieTiOpen {
return 49 return 49
} }
} }
...@@ -457,8 +459,10 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -457,8 +459,10 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
//MARK: - NEW CELL DELEGATE //MARK: - NEW CELL DELEGATE
func YuShouCellTFContent(Price: NSString) { func YuShouCellTFContent(Price: NSString) {
let arr = Price.components(separatedBy: "_")
yuShouPrice = Price as String yuShouPrice = arr[0]
ysKuCun = arr[1]
DJBiLi = arr[2]
} }
func textFieldContent(content: String, cell: TitleAndTFCell) { func textFieldContent(content: String, cell: TitleAndTFCell) {
switch cell.tag { switch cell.tag {
...@@ -532,16 +536,16 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -532,16 +536,16 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
} }
func switchStatus(sender: UISwitch) {//阶梯价设置 func switchStatus(sender: UISwitch) {//阶梯价设置
isJieTiJiaSetting = sender.isOn isJieTiOpen = sender.isOn
// isJieTiJiaSetting = sender.isOn
listTbv.reloadData() listTbv.reloadData()
} }
func switchClick(content: UISwitch, cell: TitleAndSwitchCell) { func switchClick(content: UISwitch, cell: TitleAndSwitchCell) {
//控制 //控制
if cell.tag == 5{ if cell.tag == 5{
isYuShouSetting = content.isOn
let idxPath = IndexPath(row: 0, section: 1) let idxPath = IndexPath(row: 0, section: 1)
if isYuShouSetting && isJieTiJiaSetting {//单独点击预售设置 if isYuShouSetting && isOpenYSSetting {//单独点击预售设置
listTbv.reloadData() listTbv.reloadData()
}else{//单独打开预售设置 }else{//单独打开预售设置
listTbv.reloadRows(at: [idxPath], with: .none) listTbv.reloadRows(at: [idxPath], with: .none)
...@@ -551,7 +555,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -551,7 +555,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
} }
func newCreateSwitchStatus(sender: UISwitch) { func newCreateSwitchStatus(sender: UISwitch) {
//打开switch 阶梯价设置 //打开switch 阶梯价设置
isJieTiJiaSetting = sender.isOn // isJieTiJiaSetting = sender.isOn
isJieTiOpen = sender.isOn
listTbv.reloadData() listTbv.reloadData()
} }
...@@ -566,12 +571,12 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -566,12 +571,12 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
} }
func YuShouCellSwitchStatus(sender: UISwitch) { func YuShouCellSwitchStatus(sender: UISwitch) {
//控制 //控制
isYuShouSetting = sender.isOn // isYuShouSetting = sender.isOn
isOpenYSSetting = sender.isOn
listTbv.reloadData() listTbv.reloadData()
} }
func PuTongJieTiDelAction(sender: PuTongJieTiCell) { func PuTongJieTiDelAction(sender: PuTongJieTiCell) {
jieTiArr.remove(at: sender.tag) jieTiArr.remove(at: sender.tag)
print(jieTiArr,sender.tag)
listTbv.reloadData() listTbv.reloadData()
} }
func PuTongJieTiContent(price: String, count: String, cell: PuTongJieTiCell) { func PuTongJieTiContent(price: String, count: String, cell: PuTongJieTiCell) {
...@@ -629,6 +634,10 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -629,6 +634,10 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
yuShouPrice = dataDict.yuShouPrice yuShouPrice = dataDict.yuShouPrice
specalArr = dataDict.specalArr specalArr = dataDict.specalArr
jieTiArr = dataDict.jieTiArr jieTiArr = dataDict.jieTiArr
isJieTiOpen = dataDict.isJieTiOpen
isOpenYSSetting = dataDict.isOpenYSSetting
DJBiLi = dataDict.DJBiLi
ysKuCun = dataDict.ysKuCun
listTbv.reloadData() listTbv.reloadData()
collectionView.reloadData() collectionView.reloadData()
} }
......
...@@ -19,18 +19,24 @@ class GuiGeModel: NSObject { ...@@ -19,18 +19,24 @@ class GuiGeModel: NSObject {
var wenDu : String = "" var wenDu : String = ""
///单位 ///单位
var danWei : String = "" var danWei : String = ""
// ///是否预售 ///是否打开预售设置
// var isNonYuShou : Bool = false
///是否打开预售设置
var isYuShouSetting : Bool = false var isYuShouSetting : Bool = false
///预售价格 ///预售价格
var yuShouPrice : String = "" var yuShouPrice : String = ""
///普通阶梯价 ///预售库存
var ysKuCun:String = ""
///定金比例
var DJBiLi:String = ""
///普通阶梯价
var jieTiArr : Array<Any> = [] var jieTiArr : Array<Any> = []
///预售阶梯价 ///预售阶梯价
var specalArr : Array<Any> = [] var specalArr : Array<Any> = []
///单位select ///单位select
var itemDanWeiSelect:Int? var itemDanWeiSelect:Int?
///温度select ///温度select
var tempSelect:Int? var tempSelect:Int?
///是否打开阶梯价
var isJieTiOpen:Bool = false
///是否打开预售设置
var isOpenYSSetting:Bool = false
} }
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