Commit 43afed33 authored by lujunye's avatar lujunye

入库,出库界面合一(根据名字改变)

parent d5876fc0
......@@ -37,12 +37,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
}
//MARK:--loginVC
func addLoginVc (isAgain:Bool){
let vc = LoginViewController()
vc.delegate = self
let contentView = vc
// let vc = LoginViewController()
// vc.delegate = self
// let contentView = vc
// let vc = KuCunShangPinXQViewController()
// let contentView = vc
let vc = RuKuViewController()
vc.barTitle = "入库"
let contentView = vc
if let windowScene = sceneC as? UIWindowScene {
if isAgain {
......
......@@ -12,15 +12,19 @@ class RuKuViewController: BaseViewController,UITableViewDelegate,UITableViewData
let p1Arr1 = ["仓库:","库位:","入库类型:","入库时间:"]
let chu1Arr1 = ["仓库:","库位:","出库类型:","入库时间:"]
let p1Arr2 = ["默认仓库","默认库位","请选择入库类型","0"]
let chu1Arr2 = ["默认仓库","默认库位","请选择出库类型","0"]
let p3Arr1 = ["入库价格:","入库数量:","生产日期:","保质期:","检测报告:"]
@IBAction func submitAction(_ sender: Any) {
}
var barTitle:String?
@IBOutlet weak var btmView: UIView!
@IBOutlet weak var listVIew: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "入库"
navbar.title = barTitle
self.view.addSubview(navbar)
listVIew.separatorStyle = .none
......@@ -56,7 +60,11 @@ class RuKuViewController: BaseViewController,UITableViewDelegate,UITableViewData
make.bottom.equalTo(0)
}
let ti1 = UILabel()
ti1.text = "(只可选择一种商品入库)"
if barTitle == "入库"{
ti1.text = "(只可选择一种商品入库)"
}else{
ti1.text = "(只可选择一种商品出库)"
}
ti1.font = UIFont.boldSystemFont(ofSize: 11)
ti1.textColor = UIColor(named: "灰色字体颜色")
view.addSubview(ti1)
......@@ -98,8 +106,11 @@ class RuKuViewController: BaseViewController,UITableViewDelegate,UITableViewData
switch section {
case 0: return 4
case 1:return 1
default:return 5
default:
if barTitle == "入库" {
return 5
}
return 1
}
}
......@@ -109,60 +120,76 @@ class RuKuViewController: BaseViewController,UITableViewDelegate,UITableViewData
if indexPath.row == 3 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isUserInteractionEnabled = false
cell.nameLbl.text = p1Arr1[indexPath.row]
if barTitle == "入库"{
cell.nameLbl.text = p1Arr1[indexPath.row]
}else{
cell.nameLbl.text = chu1Arr1[indexPath.row]
}
cell.textTF.text = "2020.03.16 15:03:56"
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = p1Arr1[indexPath.row]
cell.contentLbl.text = p1Arr2[indexPath.row]
if barTitle == "入库"{
cell.nameLbl.text = p1Arr1[indexPath.row]
cell.contentLbl.text = p1Arr2[indexPath.row]
}else{
cell.nameLbl.text = chu1Arr1[indexPath.row]
cell.contentLbl.text = chu1Arr2[indexPath.row]
}
return cell
case 1:
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGeCell") as! AddGuiGeCell
cell.imgBtn.setImage(UIImage(named: "tianjiashangpin"), for: .normal)
return cell
default:
switch indexPath.row {
case 0:
let cell = tableView.dequeueReusableCell(withIdentifier: "RuKuJiaGeCell") as! RuKuJiaGeCell
cell.nameLbl.text = p3Arr1[indexPath.row]
return cell
case 1:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = p3Arr1[indexPath.row]
cell.textTF.layer.cornerRadius = 3
cell.textTF.layer.masksToBounds = true
cell.textTF.layer.borderWidth = 1
cell.textTF.placeholder = "0"
cell.textTF.textAlignment = .center
cell.textTF.keyboardType = .numberPad
cell.textTF.layer.borderColor = UIColor(named: "灰色字体颜色")?.cgColor
cell.textTF.snp.makeConstraints { (make) in
make.centerY.equalTo(cell.snp_centerY)
make.right.equalTo(-15)
make.width.equalTo(83)
make.height.equalTo(32)
if barTitle == "入库" {
switch indexPath.row {
case 0:
let cell = tableView.dequeueReusableCell(withIdentifier: "RuKuJiaGeCell") as! RuKuJiaGeCell
cell.nameLbl.text = p3Arr1[indexPath.row]
return cell
case 1:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = p3Arr1[indexPath.row]
cell.textTF.layer.cornerRadius = 3
cell.textTF.layer.masksToBounds = true
cell.textTF.layer.borderWidth = 1
cell.textTF.placeholder = "0"
cell.textTF.textAlignment = .center
cell.textTF.keyboardType = .numberPad
cell.textTF.layer.borderColor = UIColor(named: "灰色字体颜色")?.cgColor
cell.textTF.snp.makeConstraints { (make) in
make.centerY.equalTo(cell.snp_centerY)
make.right.equalTo(-15)
make.width.equalTo(83)
make.height.equalTo(32)
}
return cell
case 2:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = p3Arr1[indexPath.row]
cell.contentLbl.text = "请选择生产日期"
return cell
case 3:
let cell = tableView.dequeueReusableCell(withIdentifier: "BaoZhiQiCell") as! BaoZhiQiCell
cell.nameLbl.text = p3Arr1[indexPath.row]
return cell
default:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndOnlyBtnCell") as! TitleAndOnlyBtnCell
cell.titleLbl.text = p3Arr1[indexPath.row]
cell.button.setTitle("编辑", for: .normal)
return cell
}
}else{
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = "出库数量:"
cell.contentLbl.text = "选择批次/填写出库数量"
return cell
case 2:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = p3Arr1[indexPath.row]
cell.contentLbl.text = "请选择生产日期"
return cell
case 3:
let cell = tableView.dequeueReusableCell(withIdentifier: "BaoZhiQiCell") as! BaoZhiQiCell
cell.nameLbl.text = p3Arr1[indexPath.row]
return cell
default:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndOnlyBtnCell") as! TitleAndOnlyBtnCell
cell.titleLbl.text = p3Arr1[indexPath.row]
cell.button.setTitle("编辑", for: .normal)
return cell
}
}
}
......
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