Commit 858576f8 authored by lujunye's avatar lujunye

出入库修改完成

parent 3b46a29b
......@@ -40,6 +40,8 @@
E0206331246CE303007A40C4 /* OrderDViewSumFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0206330246CE303007A40C4 /* OrderDViewSumFooter.xib */; };
E0206333246CE450007A40C4 /* HeaderOnlyTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0206332246CE450007A40C4 /* HeaderOnlyTitleView.swift */; };
E0206335246CE45A007A40C4 /* HeaderOnlyTitleView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0206334246CE45A007A40C4 /* HeaderOnlyTitleView.xib */; };
E0228BB0246FDA9A005812FA /* TitleAndLblCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0228BAE246FDA9A005812FA /* TitleAndLblCell.swift */; };
E0228BB1246FDA9A005812FA /* TitleAndLblCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0228BAF246FDA9A005812FA /* TitleAndLblCell.xib */; };
E0273DD824551B4C00B3FCAE /* SendTimeSelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0273DD724551B4C00B3FCAE /* SendTimeSelectView.swift */; };
E0273DDA24551B6D00B3FCAE /* SendTimeSelectView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0273DD924551B6D00B3FCAE /* SendTimeSelectView.xib */; };
E0273DDD24551D4500B3FCAE /* OnlyLabelCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0273DDB24551D4500B3FCAE /* OnlyLabelCell.swift */; };
......@@ -510,6 +512,8 @@
E0206330246CE303007A40C4 /* OrderDViewSumFooter.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OrderDViewSumFooter.xib; sourceTree = "<group>"; };
E0206332246CE450007A40C4 /* HeaderOnlyTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderOnlyTitleView.swift; sourceTree = "<group>"; };
E0206334246CE45A007A40C4 /* HeaderOnlyTitleView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HeaderOnlyTitleView.xib; sourceTree = "<group>"; };
E0228BAE246FDA9A005812FA /* TitleAndLblCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleAndLblCell.swift; sourceTree = "<group>"; };
E0228BAF246FDA9A005812FA /* TitleAndLblCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TitleAndLblCell.xib; sourceTree = "<group>"; };
E0273DD724551B4C00B3FCAE /* SendTimeSelectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendTimeSelectView.swift; sourceTree = "<group>"; };
E0273DD924551B6D00B3FCAE /* SendTimeSelectView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SendTimeSelectView.xib; sourceTree = "<group>"; };
E0273DDB24551D4500B3FCAE /* OnlyLabelCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnlyLabelCell.swift; sourceTree = "<group>"; };
......@@ -1864,6 +1868,8 @@
E00E48BD2457BAC700F16545 /* XuanZeShangPinCell.xib */,
E0E341E8246E95EE0060AC20 /* PingLunCell.swift */,
E0E341E9246E95EE0060AC20 /* PingLunCell.xib */,
E0228BAE246FDA9A005812FA /* TitleAndLblCell.swift */,
E0228BAF246FDA9A005812FA /* TitleAndLblCell.xib */,
);
path = Cell;
sourceTree = "<group>";
......@@ -2407,6 +2413,7 @@
F9023F63244999F500DD5A63 /* WarehoseMangementCell.xib in Resources */,
E0BE8A84245A76AF00E80134 /* XiaDanCGDiZhiCell.xib in Resources */,
E0516F832448086700E373CE /* MsgCenterCell.xib in Resources */,
E0228BB1246FDA9A005812FA /* TitleAndLblCell.xib in Resources */,
E0B9461F24566B3100FBEC9A /* TitleAndTFAndBtnCell.xib in Resources */,
E0F1BE3F2469220D003015B2 /* RongCloud.bundle in Resources */,
E08A7ADD246505F000F934F2 /* KeHuListViewController.xib in Resources */,
......@@ -2646,6 +2653,7 @@
F950FDDE24518B9500C40530 /* FSCalendarWeekdayView.m in Sources */,
E0BE8A7F245A740600E80134 /* ChengGongCell.swift in Sources */,
E02DDD90244FE54C00ABB707 /* NewCreateHeader.swift in Sources */,
E0228BB0246FDA9A005812FA /* TitleAndLblCell.swift in Sources */,
F950FDA92451613500C40530 /* GetMobileModel.swift in Sources */,
F94A314724624E9500FEC38E /* GetGelipayInfoModel.swift in Sources */,
E0B94623245671E100FBEC9A /* DaiKeXiaDanGouWuViewController.swift in Sources */,
......
......@@ -49,8 +49,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
//
let vc = CheckWareHourseViewController()
vc.titleStr = "新增仓库"
let vc = ChuRuKuJiLuXQViewController()
vc.barTitle = "入库"
let contentView = vc
......
//
// TitleAndLblCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/16.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class TitleAndLblCell: UITableViewCell {
@IBOutlet weak var contentLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TitleAndLblCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FhC-zl-Pqx">
<rect key="frame" x="15" y="43" width="305" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="cj0-kf-8SN"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="标题" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yit-1Y-dYH">
<rect key="frame" x="15" y="0.0" width="27" height="43"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="内容" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qgN-Hz-wKY">
<rect key="frame" x="278" y="0.0" width="27" height="43"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="FhC-zl-Pqx" secondAttribute="trailing" id="0dP-lG-tJk"/>
<constraint firstItem="qgN-Hz-wKY" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="BLy-iS-f2e"/>
<constraint firstItem="FhC-zl-Pqx" firstAttribute="top" secondItem="yit-1Y-dYH" secondAttribute="bottom" id="H9s-B7-yLY"/>
<constraint firstAttribute="trailing" secondItem="qgN-Hz-wKY" secondAttribute="trailing" constant="15" id="HjE-gb-zaY"/>
<constraint firstItem="yit-1Y-dYH" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="Ijc-8r-P72"/>
<constraint firstItem="FhC-zl-Pqx" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Pva-mW-eJ5"/>
<constraint firstItem="FhC-zl-Pqx" firstAttribute="top" secondItem="qgN-Hz-wKY" secondAttribute="bottom" id="YmO-Ya-ofg"/>
<constraint firstItem="yit-1Y-dYH" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="ZDx-ia-byC"/>
<constraint firstAttribute="bottom" secondItem="FhC-zl-Pqx" secondAttribute="bottom" id="q5c-dX-dmo"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="contentLbl" destination="qgN-Hz-wKY" id="sZW-4d-RVO"/>
<outlet property="nameLbl" destination="yit-1Y-dYH" id="S4K-8f-ncw"/>
</connections>
<point key="canvasLocation" x="132" y="106"/>
</tableViewCell>
</objects>
<resources>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -7,22 +7,22 @@
//
import UIKit
@objc protocol TitleAndOnlyBtnCellDelegate {
@objc optional func TitleAndOnlyBtnCellBtnClick(cell:TitleAndOnlyBtnCell)
protocol TitleAndOnlyBtnCellDelegate {
func TitleAndOnlyBtnCellBtnClick(cell:TitleAndOnlyBtnCell)
@objc optional func TitleAndOnlyBtnCellEditBtnClick(cell:TitleAndOnlyBtnCell)
func TitleAndOnlyBtnCellEditBtnClick(cell:TitleAndOnlyBtnCell)
}
class TitleAndOnlyBtnCell: UITableViewCell {
var delegate:TitleAndOnlyBtnCellDelegate?
@IBAction func selectImgAction(_ sender: Any) {
delegate?.TitleAndOnlyBtnCellBtnClick?(cell: self)
delegate?.TitleAndOnlyBtnCellBtnClick(cell: self)
}
@IBOutlet weak var imgBgView: UIView!
@IBOutlet weak var imgView: UIImageView!
@IBOutlet weak var button: UIButton!
@IBAction func editAction(_ sender: Any) {
delegate?.TitleAndOnlyBtnCellEditBtnClick?(cell: self)
delegate?.TitleAndOnlyBtnCellEditBtnClick(cell: self)
}
@IBOutlet weak var titleLbl: UILabel!
override func awakeFromNib() {
......
......@@ -30,6 +30,17 @@
<constraint firstAttribute="width" constant="90" id="ECa-gV-6Hb"/>
<constraint firstAttribute="height" constant="90" id="VQx-k5-HpD"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="0.5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" name="灰色分界线"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<button hidden="YES" opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4lb-rz-I6F">
<rect key="frame" x="15" y="15" width="90" height="90"/>
......
......@@ -10,39 +10,63 @@ import UIKit
class ChuRuKuJiLuXQViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource{
@IBAction func btmAction(_ sender: UIButton) {
print(sender.titleLabel?.text)
}
var barTitle:String? = ""
let wsh = "完成"//未审核
let wtgReson = ""//未通过原因
@IBOutlet weak var bottomH: NSLayoutConstraint!
@IBOutlet weak var btmView: UIView!
let firstArr = ["0","申请人","申请时间","入库数量"]
let lastArr = ["生产日期","有效日期","保质期","检测报告","商品库存","仓库","库位","备注","未通过原因"]
var firstArr = ["0","审核人","申请时间","入库价格","入库总价","入库数量"]
let firstArrChu = ["0","审核人","审核时间","申请时间","出库数量"]
var lastArr = ["生产日期","有效日期","保质期","检测报告","商品库存","仓库","库位","备注","不通过原因"]
// let lastArrChu = ["生产日期","有效日期","保质期","检测报告","商品库存","仓库","库位","批次","备注","不通过原因"]
@IBOutlet weak var listView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "商品-xxxx"
navbar.title = barTitle
self.view.addSubview(navbar)
//MARK: - 根据状态显示或者隐藏
// if 通过/未通过 {
// bottomH.constant = 0
// btmView.isHidden = true
// }
if wsh == "完成"{
firstArr.insert("审核时间", at: 2)
firstArr.remove(at: 3)
}
if (barTitle?.contains("出库"))!{
lastArr.insert("批次", at: 7)
}
listView.separatorStyle = .none
listView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.bottom.equalTo(btmView.snp_top)
}
listView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
listView.register(UINib(nibName: "TitleAndLblCell", bundle: nil), forCellReuseIdentifier: "TitleAndLblCell")
listView.register(UINib(nibName: "DaiKeXiaDanGouWuCell", bundle: nil), forCellReuseIdentifier: "DaiKeXiaDanGouWuCell")
listView.register(UINib(nibName: "TitleAndOnlyBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndOnlyBtnCell")
// Do any additional setup after loading the view.
}
//MARK: - cell delegate
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return firstArr.count
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 1 {
if indexPath.row == 3 {
print("查看")
}
}
return lastArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
......@@ -55,29 +79,133 @@ class ChuRuKuJiLuXQViewController: BaseViewController,UITableViewDelegate,UITabl
return cell
}
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isUserInteractionEnabled = false
cell.textTF.text = "2020.01.02 15:12:21"
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell
if indexPath.section == 0 {
cell.nameLbl.text = firstArr[indexPath.row]
switch indexPath.row {
case 1:
cell.contentLbl.text = "审核人"
break
case 2:
cell.contentLbl.text = "审核时间"
break
case 3:
if (barTitle?.contains("出库"))! {
cell.contentLbl.text = "申请时间"
}else{
cell.contentLbl.text = "入库价格"
}
break
case 4:
if (barTitle?.contains("出库"))! {
cell.contentLbl.text = "出库数量"
}else{
cell.contentLbl.text = "入库总价"
}
break
case 5:
cell.contentLbl.text = "入库数量"
break
default:
break
}
if (barTitle?.contains("入库"))!{
cell.nameLbl.text = firstArr[indexPath.row]
}else{
cell.nameLbl.text = firstArrChu[indexPath.row]
}
}else{
switch indexPath.row {
case 0:
cell.contentLbl.text = "生产日期"
break
case 1:
cell.contentLbl.text = "生产日期"
break
case 2:
cell.contentLbl.text = "保质期"
break
case 4:
cell.contentLbl.text = "商品库存"
break
case 5:
cell.contentLbl.text = "仓库"
break
case 6:
cell.contentLbl.text = "库位"
break
case 7:
if (barTitle?.contains("出库"))! {
cell.contentLbl.text = "批次"
}else{
cell.contentLbl.text = "备注"
}
break
case 8:
if (barTitle?.contains("出库"))! {
cell.contentLbl.text = "备注"
}else{
cell.contentLbl.text = "不通过原因"
}
break
case 9:
cell.contentLbl.text = "不通过原因"
break
default:
break
}
if indexPath.row == 3 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndOnlyBtnCell")
as! TitleAndOnlyBtnCell
cell.button.setTitle("查看", for: .normal)
cell.button.isUserInteractionEnabled = false
cell.titleLbl.text = lastArr[indexPath.row]
return cell
}
cell.nameLbl.text = lastArr[indexPath.row]
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
//MARK: - 没有未通过原因
if wtgReson.count == 0 {//没有未通过原因
if indexPath.section == 1{
if indexPath.row == lastArr.count-1 {
return 0.001
}
}
}
//***************************
if indexPath.section == 0 {
if indexPath.row == 0 {
return 120
}
if (barTitle?.contains("入库"))!{//入库未审核
if wsh == "未审核" {
if indexPath.row == 1 || indexPath.row == 2{
return 0.001
}
}
if wsh == "已审核"{
if indexPath.row == 1 {
return 0.001
}
}
}else{//出库未审核
if wsh == "未审核"{
if indexPath.row == 1 || indexPath.row == 2 || indexPath.row == 3{
return 0.001
}
}
if wsh == "已审核"{
if indexPath.row == 1 || indexPath.row == 2{
return 0.001
}
}
}
return 49
}
return 49
......@@ -90,4 +218,21 @@ class ChuRuKuJiLuXQViewController: BaseViewController,UITableViewDelegate,UITabl
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 10
}
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
if (barTitle?.contains("入库"))!{
return firstArr.count
}else{
return firstArrChu.count
}
}
return lastArr.count
}
func TitleAndOnlyBtnCellEditBtnClick(cell: TitleAndOnlyBtnCell) {
}
}
......@@ -10,6 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChuRuKuJiLuXQViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="bottomH" destination="XYf-tB-H0h" id="pwu-fg-yBF"/>
<outlet property="btmView" destination="4oh-GD-AgV" id="JqF-7U-i8c"/>
<outlet property="listView" destination="6n5-Zr-Oki" id="jts-69-guJ"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
......
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