Commit 65123257 authored by lujunye's avatar lujunye

26

parent dd3df967
......@@ -76,7 +76,7 @@ class selDbtGoodsList_Data_D_model: Mappable {
var dbt_price:String?
var is_show : Int?
var agent_id :String?
var agent_id :Int?
required init?( map: Map) {
......
......@@ -312,6 +312,7 @@ class GLAlertTbAddView: UIView,UITableViewDelegate,UITableViewDataSource,GLAlert
return
}
HUD.flash(.progress)
ageAddContract(["user_token":UserToken as Any,"agent_id":shop_id as Any]) { (data) in
self.removeFromSuperview()
HUD.hide()
......
......@@ -24,6 +24,7 @@ class ageSetDbtGoods_View: UIView {
}else{
first_line_lbl.text = "商品供货价:\(model!.supply_price!)元"
comission_lbl.text = "(提成 - 元)"
sell_intro.text = "不能低于商品供货价售卖,可以加价在\(model!.floor_price!)-\(model!.ceiling_price!)元范围内加价"
if model!.supply_price != nil && sell_price_tf.text!.count > 0 {
let num1 = Float(sell_price_tf.text!)
let num2 = Float(model!.supply_price!)
......@@ -36,14 +37,7 @@ class ageSetDbtGoods_View: UIView {
@IBOutlet weak var sell_bg_view: UIView!
@IBOutlet weak var sell_bg_view_h: NSLayoutConstraint!
@IBAction func submit_action(_ sender: UIButton) {
if model?.price_type == 1 {
let num1 = Float(sell_price_tf.text!)
let num2 = Float((model?.supply_price!)!)
if num1! < num2! {
HUD.flash(.label("商品售价不得低于供货价~"), delay: 1.2)
return
}
}
delegate?.ageSetDbtGoods_View_submit_action(view: self ,sell_price: sell_price_tf.text,commission: comission_tf.text!)
close_action(sender)
}
......@@ -51,6 +45,7 @@ class ageSetDbtGoods_View: UIView {
@IBAction func close_action(_ sender: UIButton) {
self.removeFromSuperview()
}
@IBOutlet weak var sell_intro: UILabel!
@IBOutlet weak var comission_tf: UITextField!
@IBOutlet weak var sell_price_tf: UITextField!
@IBOutlet weak var first_line_lbl: UILabel!
......@@ -76,13 +71,26 @@ class ageSetDbtGoods_View: UIView {
}
sell_price_tf.addTarget(self, action: #selector(textChange(text:)), for: .allEditingEvents)
}
@objc func textChange(text:UITextField){
let high = Float((model?.ceiling_price!)!)
let low = Float((model?.floor_price!)!)
let supply_p = Float((model?.supply_price!)!)
let high_p = high! + supply_p!
let low_p = low! + supply_p!
if text.text!.count > 0 {
let num1 = Float(text.text!)
let num2 = Float(model!.supply_price!)
if num1! > num2! {
comission_lbl.text = String(format: "(提成%.2f元)",num1! - num2!)
let input_p = Float(text.text!)
if input_p! > high_p {
HUD.flash(.label("输入价格高于最大加价范围\(model!.ceiling_price!)元"), delay: 1.2)
text.text = ""
return
}
if input_p! < low_p {
HUD.flash(.label("输入价格低于最小加价范围\(model!.floor_price!)元"), delay: 1.2)
text.text = ""
return
}
comission_lbl.text = String(format: "(提成%.2f元)",input_p! - supply_p!)
}
}
......
......@@ -19,6 +19,7 @@
<outlet property="intro_lbl" destination="6mI-yU-v1H" id="RTK-5J-Zcy"/>
<outlet property="sell_bg_view" destination="VG4-tU-xVK" id="fU3-fB-ath"/>
<outlet property="sell_bg_view_h" destination="djX-u5-oHB" id="LJw-Q0-qCf"/>
<outlet property="sell_intro" destination="v0e-J7-bNZ" id="wnd-yC-yx6"/>
<outlet property="sell_price_tf" destination="QVd-05-Mcc" id="S2a-Mz-bMk"/>
</connections>
</placeholder>
......
......@@ -53,7 +53,6 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
sku_id += StringByInt(number: model)
}
}
let dic = ["user_token":UserToken as Any,
"operation_type":1 as Any,
"sku_id":sku_id as Any,
......@@ -73,7 +72,7 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
} failture: { (err) in}
return
}
print("tag == ",tag)
let model = datas[tag]
let dic = ["user_token":UserToken as Any,
"operation_type":1 as Any,
......@@ -176,6 +175,7 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
let data = datas[cell.tag]
let view = FXSZ_View(frame: self.view.bounds)
view.delegate = self
view.tag = cell.tag
view.FX_Price_Tf.text = data.dbt_price
view.commission_tf.text = data.commission_val
self.view.addSubview(view)
......@@ -246,7 +246,6 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
}
let vc = FXSZ_View(frame: self.view.bounds)
vc.delegate = self
if selectItem.count > 1 {
vc.is_all_select_mode = is_Edit
}
......@@ -514,6 +513,7 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
let cell = tableView.dequeueReusableCell(withIdentifier: "New_Fx_Cell") as! New_Fx_Cell
cell.tag = indexPath.row
cell.delegate = self
if is_Edit{
cell.leftValue.constant = 45
......
......@@ -62,7 +62,7 @@ class RetailListMgVC: BaseViewController,PagingViewControllerDelegate, UISearchB
make.left.right.bottom.equalTo(0)
}
listView.separatorStyle = .none
if vcType == 132 {
if vcType == 162 {
jurisdiction = 1
}else{//店长管理
jurisdiction = 2
......
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