Commit 997ea4ef authored by lujunye's avatar lujunye

界面显示优化

parent 965aa5b4
...@@ -426,32 +426,31 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne ...@@ -426,32 +426,31 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
let data = rkSelectArr[indexPath.row] let data = rkSelectArr[indexPath.row]
cell.nameLbl.text = data.goods_name cell.nameLbl.text = data.goods_name
if data.no_push_num != nil { if data.no_push_num != nil {
cell.titLbl.text = "入库数量:(可入库量为\(data.no_push_num!))" cell.titLbl.text = "入库数量:(可入库量为" + StringByInt(number: data.no_push_num!)
} }
cell.detailLbl.text = data.spec_str! + " " + \(data.price!)" cell.detailLbl.text = data.spec_str! + " ¥" + data.price!
cell.rkPriceTf.text = "\(data.price!)" cell.rkPriceTf.text = data.price!
cell.rkCountTf.text = "1" cell.rkCountTf.text = "1"
cell.bzqTf.text = "" cell.bzqTf.text = ""
cell.timeLbl.text = "请选择生产日期" cell.timeLbl.text = "请选择生产日期"
if data.RKJG != nil { if data.RKJG != nil {
cell.rkPriceTf.text = "\(data.RKJG!)" cell.rkPriceTf.text = String(format: "%.2f", data.RKJG!)
}else{ }else{
let num = data.price! as! NSString data.RKJG = Float(data.price!)
data.RKJG = num.floatValue
} }
if data.RKSL != nil { if data.RKSL != nil {
cell.rkCountTf.text = "\(data.RKSL!)" cell.rkCountTf.text = String(format: "%d", data.RKSL!)
}else{ }else{
cell.rkCountTf.text = "1" cell.rkCountTf.text = "1"
data.RKSL = 1 data.RKSL = 1
} }
if data.ZJ != nil { if data.ZJ != nil {
cell.totalPriceTf.text = "\(data.ZJ!)" cell.totalPriceTf.text = String(format: "%.2f", data.ZJ!)
}else{ }else{
cell.totalPriceTf.text = data.price! cell.totalPriceTf.text = data.price!
} }
if data.BZQ != nil { if data.BZQ != nil {
cell.bzqTf.text = "\(data.BZQ!)" cell.bzqTf.text = String(format: "%d", data.BZQ!)
} }
if data.DayType == 0 { if data.DayType == 0 {
...@@ -557,7 +556,8 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne ...@@ -557,7 +556,8 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
data.BZQ = num.integerValue data.BZQ = num.integerValue
break break
case 101: case 101:
data.ZJ = num.floatValue let value = String(format:"%.2f", num.floatValue)
data.ZJ = Float(value)
break break
case 102: case 102:
if num.integerValue == 0 { if num.integerValue == 0 {
...@@ -570,14 +570,14 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne ...@@ -570,14 +570,14 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
} }
if data.RKJG != nil && data.RKSL != nil { if data.RKJG != nil && data.RKSL != nil {
data.ZJ = data.RKJG! * Float(data.RKSL!) data.ZJ = data.RKJG! * Float(data.RKSL!)
cell.totalPriceTf.text = "\(data.ZJ!)" cell.totalPriceTf.text = String(format: "%.2f", data.ZJ!)
} }
break break
case 103: case 103:
data.RKJG = num.floatValue data.RKJG = num.floatValue
if data.RKJG != nil && data.RKSL != nil { if data.RKJG != nil && data.RKSL != nil {
data.ZJ = data.RKJG! * Float(data.RKSL!) data.ZJ = data.RKJG! * Float(data.RKSL!)
cell.totalPriceTf.text = "\(data.ZJ!)" cell.totalPriceTf.text = String(format: "%.2f", data.ZJ!)
} }
break break
default: default:
......
...@@ -64,7 +64,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U ...@@ -64,7 +64,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
if orderType == 1 { if orderType == 1 {
if djTFstr.count == 0 || wkTFstr.count == 0 { if djTFstr == "-" || wkTFstr == "-" {
HUD.flash(.label("请修改相应的定金和尾款"), delay: 1.2) HUD.flash(.label("请修改相应的定金和尾款"), delay: 1.2)
return return
} }
...@@ -411,15 +411,22 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U ...@@ -411,15 +411,22 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
} }
//MARK: - 跳转修改价格 //MARK: - 跳转修改价格
var djTFstr:String = ""; var djTFstr:String = "-";
var wkTFstr:String = ""; var wkTFstr:String = "-";
@objc func jumpToEditPrice(){ @objc func jumpToEditPrice(){
if orderType == 1 {//预售 if orderType == 1 {//预售
let vc = XiuGaiYuShouJiaViewController() let vc = XiuGaiYuShouJiaViewController()
vc.inputData = cellDataArr vc.inputData = cellDataArr
vc.djTFstr = djTFstr vc.djTFstr = djTFstr
if djTFstr == "-"{
vc.djTFstr = ""
}
vc.wkTFstr = wkTFstr vc.wkTFstr = wkTFstr
if wkTFstr == "-" {
vc.wkTFstr = ""
}
let item = cellDataArr[0]; let item = cellDataArr[0];
let price = item.target_Price?.replacingOccurrences(of: "", with: ",") as! NSString let price = item.target_Price?.replacingOccurrences(of: "", with: ",") as! NSString
let tp = price.floatValue * Float(item.target_Count!) let tp = price.floatValue * Float(item.target_Count!)
...@@ -456,7 +463,13 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U ...@@ -456,7 +463,13 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
//MARK:-- 修改价格(预售)回调 //MARK:-- 修改价格(预售)回调
func changeYuShouGoodsByData(sender: EditOGPAdDataModel?, djText: String, wkText: String) { func changeYuShouGoodsByData(sender: EditOGPAdDataModel?, djText: String, wkText: String) {
djTFstr = djText djTFstr = djText
if djText.count == 0 {
djTFstr = "-"
}
wkTFstr = wkText wkTFstr = wkText
if wkText.count == 0 {
wkTFstr = "-"
}
listView.reloadData() listView.reloadData()
} }
...@@ -532,8 +545,8 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U ...@@ -532,8 +545,8 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
//MARK: - 删除已选商品 //MARK: - 删除已选商品
func DaiKeXiaDanGouWuCellDelAction(cell: DaiKeXiaDanGouWuCell) { func DaiKeXiaDanGouWuCellDelAction(cell: DaiKeXiaDanGouWuCell) {
if orderType == 1 { if orderType == 1 {
djTFstr = "" djTFstr = "-"
wkTFstr = "" wkTFstr = "-"
} }
cellDataArr.remove(at: cell.tag) cellDataArr.remove(at: cell.tag)
listView.reloadData() listView.reloadData()
...@@ -726,6 +739,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U ...@@ -726,6 +739,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
var goodsInfo:String = "" var goodsInfo:String = ""
var goodsArr : Array<Any> = [] var goodsArr : Array<Any> = []
if orderType == 1{ if orderType == 1{
cellDataArr.forEach { (item) in cellDataArr.forEach { (item) in
let priceStr = item.target_Price! as NSString let priceStr = item.target_Price! as NSString
let subtoal = priceStr.floatValue * Float(item.target_Count!) let subtoal = priceStr.floatValue * Float(item.target_Count!)
......
...@@ -331,6 +331,11 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab ...@@ -331,6 +331,11 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
cell.cellModel = model cell.cellModel = model
cell.detailLbl.text = "\(model.spec_str!)/\(model.unit!)" cell.detailLbl.text = "\(model.spec_str!)/\(model.unit!)"
cell.detailLbl2.text = "库存:\(model.inventory!)" cell.detailLbl2.text = "库存:\(model.inventory!)"
if isYuShou {
cell.detailLbl2.text = "库存:\(model.adsale_inventory!)"
}
cell.iconImg.sd_setImage(with: URL(string: SERVERCE_ImageHost + model.goods_img!)) cell.iconImg.sd_setImage(with: URL(string: SERVERCE_ImageHost + model.goods_img!))
cell.imgUrlPath = SERVERCE_ImageHost + model.goods_img! cell.imgUrlPath = SERVERCE_ImageHost + model.goods_img!
cell.sku_id = model.sku_id cell.sku_id = model.sku_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