Commit 2e7f7c5b authored by lujunye's avatar lujunye

入库

parent 89cd6f09
......@@ -292,6 +292,8 @@
E0F1BE4924692379003015B2 /* ItemCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0F1BE4724692379003015B2 /* ItemCell.xib */; };
E0F3C2CB24590C86006F0D1F /* XinZengAndBianJiKeHuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0F3C2C924590C86006F0D1F /* XinZengAndBianJiKeHuViewController.swift */; };
E0F3C2CC24590C86006F0D1F /* XinZengAndBianJiKeHuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0F3C2CA24590C86006F0D1F /* XinZengAndBianJiKeHuViewController.xib */; };
E0F8E91B248737F100817A08 /* NewOnlyRKCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0F8E919248737F100817A08 /* NewOnlyRKCell.swift */; };
E0F8E91C248737F100817A08 /* NewOnlyRKCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0F8E91A248737F100817A08 /* NewOnlyRKCell.xib */; };
E0F97B022451228A001BD600 /* GLAlertSelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0F97B012451228A001BD600 /* GLAlertSelectView.swift */; };
E0F97B0424512299001BD600 /* GLAlertSelectView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0F97B0324512299001BD600 /* GLAlertSelectView.xib */; };
E0F97B082451620B001BD600 /* ProductDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0F97B062451620B001BD600 /* ProductDetailViewController.swift */; };
......@@ -806,6 +808,8 @@
E0F1BE4724692379003015B2 /* ItemCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ItemCell.xib; sourceTree = "<group>"; };
E0F3C2C924590C86006F0D1F /* XinZengAndBianJiKeHuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XinZengAndBianJiKeHuViewController.swift; sourceTree = "<group>"; };
E0F3C2CA24590C86006F0D1F /* XinZengAndBianJiKeHuViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = XinZengAndBianJiKeHuViewController.xib; sourceTree = "<group>"; };
E0F8E919248737F100817A08 /* NewOnlyRKCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewOnlyRKCell.swift; sourceTree = "<group>"; };
E0F8E91A248737F100817A08 /* NewOnlyRKCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewOnlyRKCell.xib; sourceTree = "<group>"; };
E0F97B012451228A001BD600 /* GLAlertSelectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GLAlertSelectView.swift; sourceTree = "<group>"; };
E0F97B0324512299001BD600 /* GLAlertSelectView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GLAlertSelectView.xib; sourceTree = "<group>"; };
E0F97B062451620B001BD600 /* ProductDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailViewController.swift; sourceTree = "<group>"; };
......@@ -1331,6 +1335,8 @@
children = (
E030DF39248651A5002764D3 /* NewRKVc.swift */,
E030DF3A248651A5002764D3 /* NewRKVc.xib */,
E0F8E919248737F100817A08 /* NewOnlyRKCell.swift */,
E0F8E91A248737F100817A08 /* NewOnlyRKCell.xib */,
);
path = "1.1入库&出库";
sourceTree = "<group>";
......@@ -2601,6 +2607,7 @@
F9023F6E2449A9B100DD5A63 /* TitleAndTFCell.xib in Resources */,
F94A315424626D7800FEC38E /* WorkCViewController.xib in Resources */,
E042F7392452766100CDFA12 /* AdressSelectCell.xib in Resources */,
E0F8E91C248737F100817A08 /* NewOnlyRKCell.xib in Resources */,
E013D7892484B1B90092DE46 /* CRKXiangQVC.xib in Resources */,
E0A409C92464010D00CFF109 /* FirstCell.xib in Resources */,
E00E48C32457C0D600F16545 /* XuanZeShangPinViewController.xib in Resources */,
......@@ -2830,6 +2837,7 @@
E09B03C32445BD9500211A51 /* NavViewController.swift in Sources */,
E06524F124580AAC00CA22E2 /* RuKuJiaGeCell.swift in Sources */,
E042F7382452766100CDFA12 /* AdressSelectCell.swift in Sources */,
E0F8E91B248737F100817A08 /* NewOnlyRKCell.swift in Sources */,
F956D5A6246A2D9C003FF510 /* LMNoteViewController.m in Sources */,
E0CC848B24824291009B1FE9 /* CRKListVC.swift in Sources */,
E03549AD24582828008BD021 /* KeHuGuanLiCell.swift in Sources */,
......
//
// NewOnlyRKCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/6/3.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
protocol NewOnlyRKCellDelegate {
func NewOnlyRKCellDateTypeSelect(sender:Int,cell:NewOnlyRKCell)//选择时间类型
func NewOnlyRKCellDateSelect(cell:NewOnlyRKCell)//选择日期
func NewOnlyRKCellAddRepord(cell:NewOnlyRKCell)//添加检测报告
func NewOnlyRKCellDel(cell:NewOnlyRKCell)//删除
func NewOnlyRKCellTFinput(text:String,inputType:Int,cell:NewOnlyRKCell)
}
class NewOnlyRKCell: UITableViewCell,UITextFieldDelegate {
var delegate:NewOnlyRKCellDelegate?
@IBOutlet weak var rightBtn: UIButton!
@IBOutlet weak var leftBtn: UIButton!
@IBOutlet weak var nameLbl: UILabel!
@IBOutlet weak var detailLbl: UILabel!
@IBOutlet weak var bzqTf: UITextField!
@IBOutlet weak var totalPriceTf: UITextField!
@IBOutlet weak var rkCountTf: UITextField!
@IBOutlet weak var rkPriceTf: UITextField!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
leftBtn.isSelected = true
leftBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
// Initialization code
bzqTf.delegate = self
bzqTf.tag = 100
totalPriceTf.delegate = self
bzqTf.tag = 101
rkCountTf.delegate = self
bzqTf.tag = 102
rkPriceTf.delegate = self
bzqTf.tag = 103
setYuanJiao2(sender: leftBtn)
setYuanJiao(sender: rightBtn)
}
func textFieldDidEndEditing(_ textField: UITextField) {
if isPurnNumber(str: textField.text!) {
delegate?.NewOnlyRKCellTFinput(text: textField.text!, inputType: textField.tag, cell: self)
}else{
HUD.flash(.label("请输入正确的数字"), delay: 1.2)
textField.text = ""
}
}
func setYuanJiao2(sender:UIView){
let maskPath = UIBezierPath(roundedRect: sender.bounds,
byRoundingCorners:[.bottomLeft, .topLeft], cornerRadii:CGSize(width:2, height:2))
let masklayer = CAShapeLayer()
masklayer.frame = sender.bounds
masklayer.path = maskPath.cgPath
sender.layer.mask = masklayer
}
func setYuanJiao(sender:UIView){
let maskPath = UIBezierPath(roundedRect: sender.bounds,
byRoundingCorners:[.bottomRight, .topRight], cornerRadii:CGSize(width:2, height:2))
let masklayer = CAShapeLayer()
masklayer.frame = sender.bounds
masklayer.path = maskPath.cgPath
sender.layer.mask = masklayer
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
@IBAction func dateTypeSelect(_
sender: UIButton) {
if sender.tag == 0{//月
leftBtn.isSelected = false
rightBtn.isSelected = true
leftBtn.backgroundColor = UIColor(named: "app底色")
rightBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
}else{//天
leftBtn.isSelected = true
rightBtn.isSelected = false
leftBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
rightBtn.backgroundColor = UIColor(named: "app底色")
}
delegate?.NewOnlyRKCellDateTypeSelect(sender: sender.tag, cell: self)
}
@IBAction func selectDate(_ sender: UIButton) {
delegate?.NewOnlyRKCellDateSelect(cell: self)
}
@IBAction func addAction(_ sender: UIButton) {
delegate?.NewOnlyRKCellAddRepord(cell: self)
}
@IBAction func delAction(_ sender: UIButton) {
delegate?.NewOnlyRKCellDel(cell: self)
}
}
......@@ -8,24 +8,165 @@
import UIKit
class NewRKVc: BaseViewController {
class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, NewOnlyRKCellDelegate{
let titleArr = ["仓库:","库位:","入库类型:","入库时间:"]
var holderArr = ["默认仓库","默认库位","请选择入库类型","时间"]
var dataArr:Array<Any>? = []
@IBOutlet weak var btmView: UIView!
@IBOutlet weak var listView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "入库"
self.view.addSubview(navbar)
SetTopFrameView(view: listView, btmView: btmView)
listView.separatorStyle = .none
listView.register(UINib(nibName: "AddImgCell", bundle: nil), forCellReuseIdentifier: "AddImgCell")
listView.register(UINib(nibName: "CRKBtnCell", bundle: nil), forCellReuseIdentifier: "CRKBtnCell")
listView.register(UINib(nibName: "NewOnlyRKCell", bundle: nil), forCellReuseIdentifier: "NewOnlyRKCell")
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
//MARK: - 提交任务方法
@IBAction func actionClick(_ sender: UIButton) {
if sender.tag == 0 {//提交并新增
}else{//提交
}
}
//MARK: - cellForRow
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 1{
let cell = tableView.dequeueReusableCell(withIdentifier: "NewOnlyRKCell") as! NewOnlyRKCell
cell.delegate = self
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "CRKBtnCell") as! CRKBtnCell
cell.tag = indexPath.row
cell.nameLbl.text = titleArr[indexPath.row]
cell.contentLbl.text = holderArr[indexPath.row]
cell.mustLbl.isHidden = true
cell.mustWidth.constant = 0
if indexPath.row == 3 {
setCellUI(cell: cell)
}
return cell
}
//MARK: - 入库商品delegate
func NewOnlyRKCellDateTypeSelect(sender: Int, cell: NewOnlyRKCell) {
// 0:月, 1:天
}
func NewOnlyRKCellDateSelect(cell: NewOnlyRKCell) {
//跳转日期选择
}
func NewOnlyRKCellAddRepord(cell: NewOnlyRKCell) {
//添加检测报告
}
func NewOnlyRKCellDel(cell: NewOnlyRKCell) {
//删除
}
func NewOnlyRKCellTFinput(text: String, inputType: Int, cell: NewOnlyRKCell) {
//text:数据 inputType: 100-保质期 101-总价 102-入库数量 103-入库价格
}
//添加商品
@objc func addProduct(){
dataArr?.append("1")
listView.reloadData()
}
//MARK: - cell delegate
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0 {
return 49
}
return 370
}
func setCellUI(cell:CRKBtnCell){
cell.contentLbl.textColor = UIColor(named: "标题字颜色")
cell.arrowImg.isHidden = true
cell.contentRight.constant = -7
cell.nameLeft.constant = 0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if section == 0 {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 10))
view.backgroundColor = UIColor(named: "app底色")
return view
}
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 147.5))
let img = UIImageView()
view.addSubview(img)
img.image = UIImage(named: "tianjiashangpin")
img.snp.makeConstraints { (make) in
make.top.equalTo(30)
make.width.height.equalTo(52)
make.centerX.equalTo(view.snp_centerX)
}
let btn = UIButton()
view.addSubview(btn)
btn.snp.makeConstraints { (make) in
make.top.left.right.bottom.equalTo(0)
}
btn.addTarget(self, action: #selector(addProduct), for: .touchUpInside)
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == 0 {
return 10
}
return 147.5
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 1 {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
let lbl = UILabel(frame: CGRect(x: 15, y: 15, width: fullScreenWidth, height: 21))
lbl.text = "选择商品"
lbl.textColor = UIColor(named: "标题字颜色")
lbl.font = UIFont.boldSystemFont(ofSize: 15)
lbl.sizeToFit()
view.addSubview(lbl)
if dataArr!.count > 0 {
let lbl2 = UILabel(frame: CGRect(x: lbl.frame.maxX + 5, y: 16, width: fullScreenWidth, height: 18.5))
lbl2.text = "(共\(dataArr!.count)件)"
lbl2.textColor = UIColor(named: "标题字颜色")
lbl2.font = UIFont.boldSystemFont(ofSize: 13)
view.addSubview(lbl2)
}
return view
}
return UIView()
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if section == 1 {
if dataArr!.count > 0 {
return 49
}
return 39
}
return 0.001
}
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return 4
}
return dataArr!.count
}
*/
}
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