Commit 428f8454 authored by lujunye's avatar lujunye

改Icon,部分出入库

parent b881c2e8
......@@ -30,7 +30,7 @@ class GetGoodBatchDataModel: Mappable {
var w_id : Int? //仓储id
var p_id:Int? //库位id
var inventory : String? //现有库存
var inventory : Int? //现有库存
var production_data : Double?//生产日期
var valid_date:Double? //过期时间
......
......@@ -12,7 +12,7 @@ import ObjectMapper
class OutGoodsDetailModel: Mappable {
var code:Int?
var message : String?
var data : Array<OutGoodsDetailDataModel>?
var data : OutGoodsDetailDataModel?
required init?( map: Map) {
......
......@@ -38,7 +38,7 @@ class WarehouseIoListDataModel: Mappable {
var i_type : Int?
var o_type:Int?
var goods_res : WarehouseIoListDataResModel? //商品信息
var goods_res : Array<WarehouseIoListDataResModel>? //商品信息
var io_type_cn : String? //出/入库详细类型(已中文处理
......
......@@ -16,71 +16,78 @@ class CRKCell: UITableViewCell {
@IBAction func btnClick(_ sender: UIButton) {
delegate?.CRKCellBtnClick(sender: sender,cell:self)
}
@IBOutlet weak var timeLbl: UILabel!
@IBOutlet weak var countLbl: UILabel!
@IBOutlet weak var statusNameLbl: UILabel!
@IBOutlet weak var statusLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
var dataArr:Array<Any>? = []
var dataArr:Array<WarehouseIoListDataResModel>? = []
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
override func layoutIfNeeded() {
super.layoutIfNeeded()
var num = 0
if dataArr!.count > 4 {
num = 4
}else{
num = dataArr!.count
}
for i in 0 ..< num {
let view = UIView()
detialView.addSubview(view)
view.backgroundColor = UIColor.white
view.snp.makeConstraints { (make) in
make.top.equalTo(i * 49)
make.left.right.equalTo(0)
make.height.equalTo(49)
print("234")
if dataArr != nil {
var num = 0
if dataArr!.count > 4 {
num = 4
}else{
num = dataArr!.count
}
if i != num - 1 {
let dotLine = UIImageView()
view.addSubview(dotLine)
dotLine.image = UIImage(named: "dotLine")
dotLine.snp.makeConstraints { (make) in
for i in 0 ..< num {
let model = dataArr![i]
let view = UIView()
detialView.addSubview(view)
view.backgroundColor = UIColor.white
view.snp.makeConstraints { (make) in
make.top.equalTo(i * 49)
make.left.right.equalTo(0)
make.height.equalTo(49)
}
if i != num - 1 {
let dotLine = UIImageView()
view.addSubview(dotLine)
dotLine.image = UIImage(named: "dotLine")
dotLine.snp.makeConstraints { (make) in
make.left.equalTo(15)
make.bottom.right.equalTo(0)
make.height.equalTo(1)
}
}
let lbl = UILabel()
lbl.font = UIFont.systemFont(ofSize: 13)
lbl.textColor = UIColor(named: "灰色字体颜色")
lbl.text = model.goods_name
view.addSubview(lbl)
lbl.snp.makeConstraints { (make) in
make.left.equalTo(15)
make.bottom.right.equalTo(0)
make.height.equalTo(1)
make.bottom.top.right.equalTo(0)
}
let lbl2 = UILabel()
lbl2.font = UIFont.systemFont(ofSize: 13)
lbl2.textColor = UIColor(named: "灰色字体颜色")
lbl2.text = "x" + "\(model.number!)"
lbl2.textAlignment = .right
view.addSubview(lbl2)
lbl2.snp.makeConstraints { (make) in
make.right.equalTo(-15)
make.bottom.left.top.equalTo(0)
}
}
let lbl = UILabel()
lbl.font = UIFont.systemFont(ofSize: 13)
lbl.textColor = UIColor(named: "灰色字体颜色")
lbl.text = "\(dataArr![i])"
view.addSubview(lbl)
lbl.snp.makeConstraints { (make) in
make.left.equalTo(15)
make.bottom.top.right.equalTo(0)
}
let lbl2 = UILabel()
lbl2.font = UIFont.systemFont(ofSize: 13)
lbl2.textColor = UIColor(named: "灰色字体颜色")
lbl2.textAlignment = .right
view.addSubview(lbl2)
lbl2.snp.makeConstraints { (make) in
make.right.equalTo(-15)
make.bottom.left.top.equalTo(0)
}
}
super.layoutIfNeeded()
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
......
......@@ -180,6 +180,7 @@
<outlet property="nameLbl" destination="C1r-Lj-aue" id="LhE-FE-60d"/>
<outlet property="statusLbl" destination="93P-aM-ST1" id="ch8-CG-bZc"/>
<outlet property="statusNameLbl" destination="Xmr-eU-LIr" id="xLJ-gj-9Ck"/>
<outlet property="timeLbl" destination="65j-rW-XU4" id="pUb-93-V9a"/>
</connections>
<point key="canvasLocation" x="116.66666666666667" y="175.11160714285714"/>
</tableViewCell>
......
<?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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<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"/>
......
......@@ -17,14 +17,14 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="数量" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="15g-hc-bWH">
<rect key="frame" x="278" y="14" width="27" height="16"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="15g-hc-bWH">
<rect key="frame" x="296.5" y="14" width="8.5" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="#F57575"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="出库商品数量:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="G3w-rZ-aM6">
<rect key="frame" x="185" y="14" width="93" height="16"/>
<rect key="frame" x="203.5" y="14" width="93" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
......
......@@ -8,18 +8,19 @@
import UIKit
protocol PiCiXuanZeCellDelegate {
func PiCiXuanZeCellBtnSelect(sender:String,cell:PiCiXuanZeCell)
func PiCiXuanZeCellBtnTextChange(sender:String,cell:PiCiXuanZeCell)
func PiCiXuanZeCellBtnSelect(cell:PiCiXuanZeCell)
func PiCiXuanZeCellRefreshCount()
}
class PiCiXuanZeCell: UITableViewCell {
class PiCiXuanZeCell: UITableViewCell,UITextFieldDelegate {
var delegate:PiCiXuanZeCellDelegate?
@IBAction func btnClickAction(_ sender: UIButton) {
iconBtn.isSelected = !iconBtn.isSelected
if isPurnInt(string: textTF.text!){
delegate?.PiCiXuanZeCellBtnSelect(sender: textTF.text!, cell: self)
}
delegate?.PiCiXuanZeCellBtnSelect(cell: self)
}
@IBOutlet weak var iconBtn: UIButton!
@IBOutlet weak var dateLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
......@@ -28,13 +29,25 @@ class PiCiXuanZeCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
textTF.keyboardType = .numberPad
textTF.delegate = self
textTF.addTarget(self, action: #selector(textChange(sender:)), for: .allEditingEvents)
// Initialization code
}
func textFieldDidEndEditing(_ textField: UITextField) {
if isPurnInt(string: textTF.text!){
delegate?.PiCiXuanZeCellRefreshCount()
}
}
@objc func textChange(sender:UITextField){
if isPurnInt(string: textTF.text!){
delegate?.PiCiXuanZeCellBtnTextChange(sender: textTF.text!, cell: self)
}
}
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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<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"/>
......@@ -10,7 +10,7 @@
<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="PiCiXuanZeCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="PiCiXuanZeCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="49"/>
<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">
......@@ -143,7 +143,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -7,13 +7,20 @@
//
import UIKit
protocol PiCiXuanZeViewControllerDelegate {
func PiCiXuanZeViewControllerPiCiSelect(data:Array<Any>)
}
class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,PiCiXuanZeCellDelegate{
var countArr:Array<String> = []
var dataArray:Array<Any> = []
var p_id:Int?
var sku_id:Int?
var totalCount = 0
var countArr:Array<Int> = []
var selectArr:Array<Int> = []
var dataArray:Array<GetGoodBatchDataModel> = []
@IBOutlet weak var topView: UIView!
@IBOutlet weak var btmLbl: UILabel!
......@@ -34,15 +41,21 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
listView.register(UINib(nibName: "PiCiXuanZeCell", bundle: nil), forCellReuseIdentifier: "PiCiXuanZeCell")
listView.register(UINib(nibName: "CRKSumCell", bundle: nil), forCellReuseIdentifier: "CRKSumCell")
// Do any additional setup after loading the view.
}
func PiCiXuanZeCellBtnSelect(sender: String, cell: PiCiXuanZeCell) {
countArr.insert(sender, at: cell.tag)
countArr.remove(at: cell.tag+1)
let idx = IndexPath(row: 0, section: 1)
listView.reloadRows(at: [idx], with: .none)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let dic = ["user_token":UserToken as Any,"sku_id":sku_id as Any]
GetGoodBatch(dic, success: { (data) in
let model = data as! GetGoodBatchModel
model.data?.forEach({ (item) in
self.dataArray.append(item)
self.countArr.append(0)
})
self.listView.reloadData()
}) { (error) in
}
}
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
......@@ -57,14 +70,59 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: "CRKSumCell") as! CRKSumCell
cell.countLbl.text = "\(totalCount)"
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "PiCiXuanZeCell") as! PiCiXuanZeCell
cell.tag = indexPath.row
let model = dataArray[indexPath.row]
cell.delegate = self
var name = ""
switch model.status {
case 1:
name = "正常"
break
case 2:
name = "临期"
break
default:
name = "过期"
break
}
cell.nameLbl.text = name
cell.SLLbl.text = "\(model.inventory!)"
cell.dateLbl.text = dayByDouble(sender: model.production_data!)
return cell
}
func PiCiXuanZeCellBtnTextChange(sender: String, cell: PiCiXuanZeCell) {
let num = sender as NSString
self.countArr.insert(num.integerValue, at: cell.tag)
self.countArr.remove(at: cell.tag+1)
}
func PiCiXuanZeCellRefreshCount() {
totalCount = 0
for item in selectArr{
totalCount += countArr[item]
}
listView.reloadData()
}
func PiCiXuanZeCellBtnSelect(cell: PiCiXuanZeCell) {
if selectArr.contains(cell.tag) {
let idx = selectArr.index(of: cell.tag)
selectArr.remove(at: idx!)
}else{
selectArr.append(cell.tag)
}
totalCount = 0
for item in selectArr{
totalCount += countArr[item]
}
listView.reloadData()
}
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
......
//
// CRKBtnCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/6/1.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class CRKBtnCell: UITableViewCell {
@IBOutlet weak var mustLbl: UILabel!
@IBOutlet weak var contentRight: NSLayoutConstraint!
@IBOutlet weak var nameLeft: NSLayoutConstraint!
@IBOutlet weak var mustWidth: NSLayoutConstraint!
@IBOutlet weak var arrowImg: UIImageView!
@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="16097" 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="16087"/>
<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" rowHeight="65" id="KGk-i7-Jjw" customClass="CRKBtnCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="334" height="65"/>
<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="334" height="65"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="*" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v5K-tk-5dB">
<rect key="frame" x="15" y="29.5" width="6" height="6"/>
<constraints>
<constraint firstAttribute="height" constant="6" id="3BW-Hj-TdV"/>
<constraint firstAttribute="width" constant="6" id="CoQ-tS-fwe"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="蓝色字体颜色"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SIv-LZ-Qvo">
<rect key="frame" x="15" y="64" width="319" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Nfs-G0-ITG"/>
</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="rZC-N1-umj">
<rect key="frame" x="26" y="0.0" width="27" height="64"/>
<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="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rkw-Cn-WEC">
<rect key="frame" x="275" y="0.0" width="27" height="64"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="个人中心灰色字体"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="jinru" translatesAutoresizingMaskIntoConstraints="NO" id="WFz-VU-QFC">
<rect key="frame" x="312" y="29" width="7" height="7"/>
<constraints>
<constraint firstAttribute="width" constant="7" id="QOa-Nc-xcr"/>
<constraint firstAttribute="height" constant="7" id="kXI-Ot-dwR"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstItem="rZC-N1-umj" firstAttribute="leading" secondItem="v5K-tk-5dB" secondAttribute="trailing" constant="5" id="1IJ-5D-Ndq"/>
<constraint firstAttribute="trailing" secondItem="WFz-VU-QFC" secondAttribute="trailing" constant="15" id="Bro-t8-Yfu"/>
<constraint firstItem="rkw-Cn-WEC" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="GO6-2i-dbD"/>
<constraint firstAttribute="bottom" secondItem="SIv-LZ-Qvo" secondAttribute="bottom" id="JRt-yC-B1M"/>
<constraint firstAttribute="trailing" secondItem="SIv-LZ-Qvo" secondAttribute="trailing" id="SfM-z2-ukI"/>
<constraint firstItem="WFz-VU-QFC" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="bh9-uJ-vUl"/>
<constraint firstItem="WFz-VU-QFC" firstAttribute="leading" secondItem="rkw-Cn-WEC" secondAttribute="trailing" constant="10" id="d6D-Rr-GGf"/>
<constraint firstItem="rZC-N1-umj" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="e7e-it-4oh"/>
<constraint firstItem="v5K-tk-5dB" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="fhy-aX-DI1"/>
<constraint firstItem="SIv-LZ-Qvo" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="qzJ-QI-aia"/>
<constraint firstItem="SIv-LZ-Qvo" firstAttribute="top" secondItem="rkw-Cn-WEC" secondAttribute="bottom" id="sNg-vm-QNw"/>
<constraint firstItem="v5K-tk-5dB" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="tIp-SF-ZAO"/>
<constraint firstItem="SIv-LZ-Qvo" firstAttribute="top" secondItem="rZC-N1-umj" secondAttribute="bottom" id="zjT-cW-lrZ"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="arrowImg" destination="WFz-VU-QFC" id="ate-24-zMP"/>
<outlet property="contentLbl" destination="rkw-Cn-WEC" id="xTn-US-i2J"/>
<outlet property="contentRight" destination="d6D-Rr-GGf" id="Gsz-h7-hvv"/>
<outlet property="mustLbl" destination="v5K-tk-5dB" id="Lny-Qs-97w"/>
<outlet property="mustWidth" destination="CoQ-tS-fwe" id="uia-CJ-7M2"/>
<outlet property="nameLbl" destination="rZC-N1-umj" id="xjJ-VQ-0rJ"/>
<outlet property="nameLeft" destination="1IJ-5D-Ndq" id="PZ1-08-MyI"/>
</connections>
<point key="canvasLocation" x="142.02898550724638" y="115.51339285714285"/>
</tableViewCell>
</objects>
<resources>
<image name="jinru" width="13" height="23"/>
<namedColor name="个人中心灰色字体">
<color red="0.3919999897480011" green="0.3919999897480011" blue="0.3919999897480011" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<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>
<namedColor name="蓝色字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -73,8 +73,9 @@ class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CR
model.data?.forEach({ (item) in
self.datas?.append(item)
})
self.listView.reloadData()
self.listView.mj_header?.endRefreshing()
self.page = 2
self.listView.performBatchUpdates({
......@@ -132,30 +133,49 @@ class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CR
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath.row)
//跳转详情
//MARK: - 跳转详情
let model = datas![indexPath.row]
let vc = CRKXiangQVC()
vc.model = model
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return datas!.count
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return datas!.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "CRKCell") as! CRKCell
// cell.dataArr = arr[indexPath.row]
let model = datas![indexPath.row]
cell.dataArr = model.goods_res
cell.delegate = self
cell.tag = indexPath.row
cell.nameLbl.text = model.applicant
let strs = model.io_type_cn?.components(separatedBy: ":")
cell.statusLbl.text = (strs?.first)! + ":"
cell.statusNameLbl.text = strs?.last
var count = 0
for item in model.goods_res! {
count += item.number!
}
if model.io_type == 1 {
cell.countLbl.text = "入库总数:" + "\(count)"
}
if model.io_type == 2 {
cell.countLbl.text = "出库总数:" + "\(count)"
}
cell.timeLbl.text = dayAndTimeByDouble(sender: model.add_time!)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
// let ar = datas![indexPath.row]
let model = datas![indexPath.row]
var num = 0
// num = ar.count
// if ar.count > 4 {
// num = 4
// }
if model.goods_res != nil {
num = model.goods_res!.count
if num > 4 {
num = 4
}
}
return 174.5 + CGFloat(num * 49)
}
//MARK: - searchView delegate
......
//
// CRKXQVC.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/30.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class CRKXQVC: BaseViewController {
var model:WarehouseIoListDataModel?
override func viewDidLoad() {
super.viewDidLoad()
if model?.io_type == 1 {
navbar.title = "商品入库详情"
}else{
navbar.title = "商品出库详情"
}
self.view.addSubview(navbar)
}
}
//
// CRKXiangQVC.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/6/1.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,NewCKCellDelegate{
@IBOutlet weak var btmView: UIView!
@IBOutlet weak var listView: UITableView!
var model:WarehouseIoListDataModel?
@IBOutlet weak var btmViewH: NSLayoutConstraint!
// var inGoodsModels:Array<InGoodsDetailModel>? = []
var outGoodsModels:Array<OutGoodsDetailDataGoodsResModel>? = []
var titleArr:Array<String>?
var holderArr:Array<String>?
override func viewDidLoad() {
super.viewDidLoad()
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let dict = ["user_token":UserToken as Any,"io_id":model?.io_id as Any]
let strs = model!.io_type_cn?.components(separatedBy: ":")
let str = strs?.last! as! String
HUD.flash(.progress)
if model?.io_type == 1 {
titleArr = ["仓库","库位","入库类型"]
holderArr = ["默认仓库","默认库位",str]
navbar.title = "商品入库详情"
InGoodsDetail(dict, success: { (data) in
HUD.hide()
}) { (error) in
}
}
if model?.io_type == 2 {
titleArr = ["出库类型","出库日期","出库商品"]
holderArr = [str,dayAndTimeByDouble(sender: (model?.add_time)!),"\(model!.goods_res!.count)件"]
navbar.title = "商品出库详情"
OutGoodsDetail(dict, success: { (data) in
let model = data as! OutGoodsDetailModel
model.data?.goods_res!.forEach({ (item) in
self.outGoodsModels?.append(item)
})
self.listView.reloadData()
HUD.hide()
}) { (error) in
}
}
self.view.addSubview(navbar)
listView.register(UINib(nibName: "CRKBtnCell", bundle: nil), forCellReuseIdentifier: "CRKBtnCell")
listView.separatorStyle = .none
SetTopFrameView(view: listView, btmView: btmView)
listView.register(UINib(nibName: "NewCKCell", bundle: nil), forCellReuseIdentifier: "NewCKCell")
}
@IBAction func crkxqBtnClick(_ sender: UIButton) {
if sender.tag == 1 {//不通过
}else{
//通过
}
}
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 {
if indexPath.row == 0 {
}
if indexPath.row == 1 {
}
}
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return 3
}
return (model?.goods_res?.count)!
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "CRKBtnCell") as! CRKBtnCell
cell.nameLbl.text = titleArr![indexPath.row]
cell.contentLbl.text = holderArr![indexPath.row]
if model?.io_type == 1 {//入库
if indexPath.row == 2 {
setCellUI(cell: cell)
}
}else{
setCellUI(cell: cell)
}
return cell
}
if model?.io_type == 1 { //入库
}
let cell = tableView.dequeueReusableCell(withIdentifier: "NewCKCell") as! NewCKCell
cell.delegate = self
cell.tag = indexPath.row
if outGoodsModels!.count > 0 {
let data = outGoodsModels![indexPath.row]
cell.nameLbl.text = data.goods_name
cell.guiGeLbl.text = data.goods_spec
cell.chuKuLbl.text = "出库数量:" + "\(data.number!)"
cell.keChuKuLbl.text = "可出库数量:" + "\(data.inventory!)"
}
return cell
}
func NewCKCellBtnClick(cell: NewCKCell) {
if model?.io_type == 2 {
let data = outGoodsModels![cell.tag]
let vc = PiCiXuanZeViewController()
vc.sku_id = data.sku_id
self.navigationController?.pushViewController(vc, animated: true)
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0{
return 49
}
if model?.io_type == 1 {//入库
return 264
}
return 214 + 0
}
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func setCellUI(cell:CRKBtnCell){
cell.mustLbl.isHidden = true
cell.arrowImg.isHidden = true
cell.contentLbl.textColor = UIColor(named: "标题字颜色")
cell.mustWidth.constant = 0
cell.nameLeft.constant = 0
cell.contentRight.constant = -7
}
}
//
// NewCKCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/6/1.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
protocol NewCKCellDelegate {
func NewCKCellBtnClick(cell:NewCKCell)
}
class NewCKCell: UITableViewCell {
@IBOutlet weak var nameLbl: UILabel!
@IBOutlet weak var btmTitleTop: NSLayoutConstraint!
@IBOutlet weak var btmTitleView: UIView!
@IBOutlet weak var btmListViewH: NSLayoutConstraint!
@IBOutlet weak var btmTitleViewH: NSLayoutConstraint!
var delegate:NewCKCellDelegate?
@IBOutlet weak var guiGeLbl: UILabel!
@IBOutlet weak var chuKuLbl: UILabel!
@IBOutlet weak var keChuKuLbl: UILabel!
@IBAction func btnClick(_ sender: UIButton) {
delegate?.NewCKCellBtnClick(cell: self)
}
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
}
}
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